@salesforce/ui-design-mode 12.18.0 → 13.0.0

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.
Files changed (36) hide show
  1. package/dist/authoring/core/DesignPropertyPanelRoot.d.cts +3 -1
  2. package/dist/authoring/core/DesignPropertyPanelRoot.d.ts +3 -1
  3. package/dist/authoring/core/DesignPropertyPanelRoot.d.ts.map +1 -1
  4. package/dist/authoring/core/editors/ColorEditor.d.cts +8 -7
  5. package/dist/authoring/core/editors/ColorEditor.d.ts +8 -7
  6. package/dist/authoring/core/editors/ColorEditor.d.ts.map +1 -1
  7. package/dist/authoring/core/hooks/useRecentColors.d.cts +12 -0
  8. package/dist/authoring/core/hooks/useRecentColors.d.ts +12 -0
  9. package/dist/authoring/core/hooks/useRecentColors.d.ts.map +1 -0
  10. package/dist/authoring/core/labels/labels.d.cts +17 -4
  11. package/dist/authoring/core/labels/labels.d.ts +17 -4
  12. package/dist/authoring/core/labels/labels.d.ts.map +1 -1
  13. package/dist/authoring/core/utils/colorEditorModel.d.cts +18 -0
  14. package/dist/authoring/core/utils/colorEditorModel.d.ts +18 -0
  15. package/dist/authoring/core/utils/colorEditorModel.d.ts.map +1 -0
  16. package/dist/authoring/react/index.js +4 -4
  17. package/dist/authoring/react/styles.css +1 -1
  18. package/dist/authoring/web-component/index.d.cts +2 -0
  19. package/dist/authoring/web-component/index.d.ts +2 -0
  20. package/dist/authoring/web-component/index.d.ts.map +1 -1
  21. package/dist/authoring/web-component/index.js +156 -174
  22. package/dist/protocol/messageTypes.d.cts +5 -0
  23. package/dist/protocol/messageTypes.d.ts +5 -0
  24. package/dist/protocol/messageTypes.d.ts.map +1 -1
  25. package/dist/protocol/version.cjs +1 -1
  26. package/dist/protocol/version.js +1 -1
  27. package/dist/runtime/design-mode-interactions.js +57 -5
  28. package/dist/runtime/interactions/communicationManager.d.ts.map +1 -1
  29. package/dist/runtime/interactions/eventHandlers.d.cts +1 -1
  30. package/dist/runtime/interactions/eventHandlers.d.ts +1 -1
  31. package/dist/runtime/interactions/eventHandlers.d.ts.map +1 -1
  32. package/dist/runtime/interactions/interactionsController.d.ts.map +1 -1
  33. package/dist/runtime/interactions/propertyEditorCapabilities.d.cts +4 -0
  34. package/dist/runtime/interactions/propertyEditorCapabilities.d.ts +4 -0
  35. package/dist/runtime/interactions/propertyEditorCapabilities.d.ts.map +1 -0
  36. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- var j5=Object.create;var fa=Object.defineProperty;var K5=Object.getOwnPropertyDescriptor;var G5=Object.getOwnPropertyNames;var W5=Object.getPrototypeOf,X5=Object.prototype.hasOwnProperty;var Q5=(e,t,o)=>t in e?fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var no=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var Y5=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of G5(t))!X5.call(e,a)&&a!==o&&fa(e,a,{get:()=>t[a],enumerable:!(r=K5(t,a))||r.enumerable});return e};var l2=(e,t,o)=>(o=e!=null?j5(W5(e)):{},Y5(t||!e||!e.__esModule?fa(o,"default",{value:e,enumerable:!0}):o,e));var bt=(e,t,o)=>Q5(e,typeof t!="symbol"?t+"":t,o);var D0=no((Hw,E0)=>{"use strict";var b7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";E0.exports=b7});var Z0=no((kw,A0)=>{"use strict";var I7=D0();function O0(){}function B0(){}B0.resetWarningCache=O0;A0.exports=function(){function e(r,a,n,l,i,s){if(s!==I7){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:B0,resetWarningCache:O0};return o.PropTypes=o,o}});var $0=no((Vw,F0)=>{F0.exports=Z0()();var Pw,Tw});var U0=no(ve=>{"use strict";var An=Symbol.for("react.element"),Zn=Symbol.for("react.portal"),Pr=Symbol.for("react.fragment"),Tr=Symbol.for("react.strict_mode"),Vr=Symbol.for("react.profiler"),_r=Symbol.for("react.provider"),Er=Symbol.for("react.context"),y7=Symbol.for("react.server_context"),Dr=Symbol.for("react.forward_ref"),Or=Symbol.for("react.suspense"),Br=Symbol.for("react.suspense_list"),Ar=Symbol.for("react.memo"),Zr=Symbol.for("react.lazy"),M7=Symbol.for("react.offscreen"),N0;N0=Symbol.for("react.module.reference");function m1(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case An:switch(e=e.type,e){case Pr:case Vr:case Tr:case Or:case Br:return e;default:switch(e=e&&e.$$typeof,e){case y7:case Er:case Dr:case Zr:case Ar:case _r:return e;default:return t}}case Zn:return t}}}ve.ContextConsumer=Er;ve.ContextProvider=_r;ve.Element=An;ve.ForwardRef=Dr;ve.Fragment=Pr;ve.Lazy=Zr;ve.Memo=Ar;ve.Portal=Zn;ve.Profiler=Vr;ve.StrictMode=Tr;ve.Suspense=Or;ve.SuspenseList=Br;ve.isAsyncMode=function(){return!1};ve.isConcurrentMode=function(){return!1};ve.isContextConsumer=function(e){return m1(e)===Er};ve.isContextProvider=function(e){return m1(e)===_r};ve.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===An};ve.isForwardRef=function(e){return m1(e)===Dr};ve.isFragment=function(e){return m1(e)===Pr};ve.isLazy=function(e){return m1(e)===Zr};ve.isMemo=function(e){return m1(e)===Ar};ve.isPortal=function(e){return m1(e)===Zn};ve.isProfiler=function(e){return m1(e)===Vr};ve.isStrictMode=function(e){return m1(e)===Tr};ve.isSuspense=function(e){return m1(e)===Or};ve.isSuspenseList=function(e){return m1(e)===Br};ve.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Pr||e===Vr||e===Tr||e===Or||e===Br||e===M7||typeof e=="object"&&e!==null&&(e.$$typeof===Zr||e.$$typeof===Ar||e.$$typeof===_r||e.$$typeof===Er||e.$$typeof===Dr||e.$$typeof===N0||e.getModuleId!==void 0)};ve.typeOf=m1});var z0=no((Ew,q0)=>{"use strict";q0.exports=U0()});import{forwardRef as Q1,createElement as Ge}from"react";function Y1(e,t){if(e==null)return{};var o={},r=Object.keys(e),a,n;for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&(o[a]=e[a]);return o}var J5=["color"],Zo=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,J5);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var es=["color"],i2=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,es);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ts=["color"],s2=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,ts);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var os=["color"],u2=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,os);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("path",{d:"M2 2.5C2 2.22386 2.22386 2 2.5 2H5.5C5.77614 2 6 2.22386 6 2.5C6 2.77614 5.77614 3 5.5 3H3V5.5C3 5.77614 2.77614 6 2.5 6C2.22386 6 2 5.77614 2 5.5V2.5ZM9 2.5C9 2.22386 9.22386 2 9.5 2H12.5C12.7761 2 13 2.22386 13 2.5V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3H9.5C9.22386 3 9 2.77614 9 2.5ZM2.5 9C2.77614 9 3 9.22386 3 9.5V12H5.5C5.77614 12 6 12.2239 6 12.5C6 12.7761 5.77614 13 5.5 13H2.5C2.22386 13 2 12.7761 2 12.5V9.5C2 9.22386 2.22386 9 2.5 9ZM12.5 9C12.7761 9 13 9.22386 13 9.5V12.5C13 12.7761 12.7761 13 12.5 13H9.5C9.22386 13 9 12.7761 9 12.5C9 12.2239 9.22386 12 9.5 12H12V9.5C12 9.22386 12.2239 9 12.5 9Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var rs=["color"],d2=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,rs);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var as=["color"],c2=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,as);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ns=["color"],f2=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,ns);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ls=["color"],p2=Q1(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=Y1(e,ls);return Ge("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Ge("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});import me from"react";import{createRoot as f8}from"react-dom/client";import C2 from"react";import{jsx as pa,jsxs as m2}from"react/jsx-runtime";function J1({title:e,defaultOpen:t=!0,children:o}){let[r,a]=C2.useState(t),n=C2.useCallback(l=>{a(l.currentTarget.open)},[]);return m2("details",{className:"property-panel-section",open:r,onToggle:n,children:[m2("summary",{className:"property-panel-section-trigger",children:[pa("span",{children:e}),pa(i2,{className:"property-panel-section-chevron",width:12,height:12,"aria-hidden":"true"})]}),pa("div",{className:"property-panel-section-content",children:o})]})}var g2=["H1","H2","H3","H4","H5","H6","P","SPAN","A","BUTTON","LABEL","DIV","LI","TD","TH","CAPTION","FIGCAPTION","BLOCKQUOTE","LEGEND","SUMMARY","DT","DD","EM","STRONG"];var h2=new Set(["fontFamily","fontWeight","fontSize","lineHeight","letterSpacing"]),O1={padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"],margin:["marginTop","marginRight","marginBottom","marginLeft"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},v2=new Set([...Object.keys(O1),...Object.values(O1).flat()]);import x1 from"react";import{jsx as us,jsxs as ds}from"react/jsx-runtime";var is={border:"none",margin:0,padding:0,minWidth:0},ss={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:r}){let a=`${t}-legend`;return ds("fieldset",{style:is,className:o,"aria-labelledby":a,children:[us("legend",{id:a,style:ss,children:e}),r]})}function Ve(e,t){return e.replace(/\{(\d+)\}/g,(o,r)=>{let a=t[Number(r)];return a===void 0?o:String(a)})}function v1(e,t){if(t==null||typeof t!="object"||typeof e!="object")return e;let o={...e},r=t;for(let a of Object.keys(o)){let n=o[a],l=r[a];n!==null&&typeof n=="object"&&!Array.isArray(n)?o[a]=v1(n,l):typeof l=="string"&&(o[a]=l)}return o}var x2=[{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:"instances.imageSource"},{path:"instances.backgroundColor"},{path:"instances.padding"},{path:"instances.margin"},{path:"instances.borderRadius"},{path:"instances.fontFamily"},{path:"instances.fontSize"},{path:"instances.fontWeight"},{path:"instances.textStyling"},{path:"instances.textColor"},{path:"instances.textAlignment"},{path:"instances.lineHeight"},{path:"instances.letterSpacing"},{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.ariaImageUrl"},{path:"editors.image.urlPlaceholder"},{path:"editors.image.previewAlt"},{path:"editors.image.altText"},{path:"editors.image.altPlaceholder"},{path:"editors.image.sourceFromData"},{path:"editors.image.sourceNotEditable"},{path:"editors.image.altFromData"},{path:"editors.image.altNotEditable"},{path:"editors.image.sourceShared",placeholders:[0]},{path:"editors.image.altShared",placeholders:[0]},{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.allCorners"},{path:"editors.boxDimension.expandCorners"},{path:"editors.boxDimension.collapseCorners"},{path:"editors.boxDimension.matchCornersAndCollapse"},{path:"editors.boxDimension.vertical"},{path:"editors.boxDimension.horizontal"},{path:"editors.boxDimension.expand"},{path:"editors.boxDimension.collapse"},{path:"editors.boxDimension.matchAndCollapse"},{path:"editors.boxDimension.collapseUnavailable"},{path:"editors.boxDimension.measurementUnavailable"},{path:"editors.boxDimension.invalidNumber"},{path:"editors.boxDimension.invalidNonNegative"},{path:"editors.boxDimension.ariaSide",placeholders:[0,1]},{path:"editors.dimension.ariaValue",placeholders:[0]},{path:"editors.dimension.ariaActions",placeholders:[0]},{path:"editors.dimension.useNormalLineHeight"},{path:"editors.dimension.useNormalSpacing"},{path:"editors.dimension.useInherit"},{path:"editors.dimension.invalidRange",placeholders:[0,1]},{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.textStyle.options.italic"},{path:"editors.textStyle.options.underline"},{path:"editors.textStyle.options.uppercase"},{path:"editors.textAlignment.options.left"},{path:"editors.textAlignment.options.center"},{path:"editors.textAlignment.options.right"},{path:"editors.textAlignment.options.justify"},{path:"history.changeLimitTitle"},{path:"history.changeLimitBody"}];function cs(e,t){return t.split(".").reduce((o,r)=>{if(o&&typeof o=="object")return o[r]},e)}function fs(e){let t=new Set;for(let o of e.matchAll(/\{(\d+)\}/g))t.add(Number(o[1]));return Array.from(t).sort((o,r)=>o-r)}function ps(e){let t=[];if(!e||typeof e!="object")return["labels is not an object"];for(let o of x2){let{path:r,placeholders:a}=o,n=cs(e,r);if(typeof n!="string"){t.push(`missing or non-string label: ${r}`);continue}if(a){let l=fs(n),i=[...a].sort((u,d)=>u-d);(l.length!==i.length||l.some((u,d)=>u!==i[d]))&&t.push(`placeholder mismatch at ${r}: expected {${i.join(",")}}, got {${l.join(",")}}`)}}return t}var lo={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}},Cs=lo.px??{min:0,max:1e4,step:1,decimals:0};function io(e,t=lo){return t[e]||Cs}function ms(e,t,o=lo){let r=io(t,o);return Math.min(r.max,Math.max(r.min,e))}function Ca(e,t,o=lo){if(e===""||e==null||isNaN(e))return"";let r=io(t,o);return Number(Number(e).toFixed(r.decimals))}function L2(e,t,o,r,a=lo){let n=parseFloat(e)||0,l=io(r,a),i=o?10:1,s=(t==="ArrowUp"?1:-1)*l.step*i,u=ms(n+s,r,a);return String(Ca(u,r,a))}var w2=String.raw`[+-]?(?:\d+(?:\.\d*)?|\.\d+)`,gs=new RegExp(`^${w2}$`),b2=new RegExp(`^(${w2})([a-z%]*)$`);function t1(e){return gs.test(e)&&Number.isFinite(Number(e))}var Fo={fontSize:{unit:"px",icon:d2,constraints:{px:{min:1,max:200,step:1,decimals:2}},presets:[8,9,10,11,12,14,18,24,30,36,48,60,72,96]},lineHeight:{unit:"",icon:p2,constraints:{"":{min:.1,max:3,step:.1,decimals:2}},presets:[1,1.2,1.4,1.5,1.6,2],normalLabelKey:"useNormalLineHeight"},letterSpacing:{unit:"em",icon:f2,constraints:{em:{min:-.1,max:.5,step:.01,decimals:3}},presets:[-.05,-.025,0,.025,.05,.1],normalLabelKey:"useNormalSpacing"}};import{jsx as M1,jsxs as so}from"react/jsx-runtime";var L1=["top","right","bottom","left"],hs=["top","right","left","bottom"],No={top:"",right:"",bottom:"",left:""},vs={sides:{top:"Top",right:"Right",bottom:"Bottom",left:"Left"},corners:{topLeft:"Top Left",topRight:"Top Right",bottomRight:"Bottom Right",bottomLeft:"Bottom Left"},allCorners:"All corners",expandCorners:"Show all corners",collapseCorners:"Collapse",matchCornersAndCollapse:"Match all corners and collapse",vertical:"Vertical",horizontal:"Horizontal",expand:"Show all sides",collapse:"Collapse",matchAndCollapse:"Match opposite sides and collapse",collapseUnavailable:"Finish editing and resolve all measurements before collapsing.",measurementUnavailable:"Wait for all side measurements before editing this box.",invalidNumber:"Enter a finite number in pixels.",invalidNonNegative:"Enter a number greater than or equal to 0.",ariaSide:"{0} {1}"};function et(e){let t=[],o=0,r=0,a=-1,n=e.trim();for(let d=0;d<=n.length;d++){let c=n[d];if(c==="("&&o++,c===")"&&o--,o<0)return{...No};if(c==="/"&&o===0){if(a!==-1)return{...No};a=d}(d===n.length||o===0&&/\s/.test(c??""))&&(d>r&&t.push(n.slice(r,d)),r=d+1)}if(a!==-1){let d=et(n.slice(0,a)),c=et(n.slice(a+1));return Object.fromEntries(L1.map(C=>[C,d[C]&&c[C]?d[C]===c[C]?d[C]:`${d[C]} ${c[C]}`:""]))}if(o!==0||t.length===0||t.length>4)return{...No};let[l="",i=l,s=l,u=i]=t;return{top:l,right:i,bottom:s,left:u}}function S2(e){return String(Number(e.toFixed(2)))}var xs=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)px$/i,I2=9999;function y2(e,t){let o=t??et(e),r={top:null,right:null,bottom:null,left:null},a={...No};for(let n of L1){let l=(o[n]??"").trim(),i=xs.exec(l)?.[1]??(t1(l)&&Number(l)===0?l:void 0),s=Number(i);if(i!==void 0&&Number.isFinite(s)){let u=Math.max(-I2,Math.min(I2,s));r[n]=s,a[n]=S2(u)}else a[n]=l}return{raw:r,display:a}}function R2(e){return L1.every(t=>e[t]!==null)&&e.top===e.bottom&&e.right===e.left}function Ls(e){return R2(e)&&e.top===e.right}function ma(e,t){return t?Ls(e):R2(e)}var M2={top:"top",right:"right",bottom:"top",left:"right"},$o={uniform:{compact:"M1 4V3a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V4",sides:{top:"M1 5V3a2 2 0 0 1 2-2h2",right:"M7 1h2a2 2 0 0 1 2 2v2",bottom:"M11 7v2a2 2 0 0 1-2 2H7",left:"M5 11H3a2 2 0 0 1-2-2V7"}},paired:{compact:{top:"M1 1h10M1 11h10",right:"M1 1v10M11 1v10"},sides:{top:"M1 1h10",right:"M11 1v10",bottom:"M1 11h10",left:"M1 1v10"}}};function ws(e,t,o){return e?t?$o.uniform.compact:$o.uniform.sides[o]:t?$o.paired.compact[o==="top"?"top":"right"]:$o.paired.sides[o]}function Uo({label:e,displayValue:t,displaySides:o,measurement:r,resetVersion:a,paired:n=!1,uniform:l=!1,onSidesChange:i,id:s,allowNegative:u=!1,sideLabelKind:d="sides",aria:c}){let C=x1.useId(),m=s||C,f=v1(vs,c),L=l||!l&&n&&d==="sides",[I]=x1.useState(()=>y2(t,o)),[v,b]=x1.useState(()=>!ma(I.raw,l)),y=x1.useRef(!0),H=L&&!v,[$,D]=x1.useState(I.display),[w,E]=x1.useState({}),M=x1.useRef({}),P=x1.useRef({...I.display}),K=x1.useRef({...I.raw}),W=x1.useRef({displayValue:t,displaySides:o,measurement:r,resetVersion:a});x1.useEffect(()=>{let g=W.current,O=a!==g.resetVersion,p=(o===void 0?g.displaySides!==void 0||t!==g.displayValue:g.displaySides===void 0||L1.some(U=>o[U]!==g.displaySides?.[U]))||r!==g.measurement;if(W.current={displayValue:t,displaySides:o,measurement:r,resetVersion:a},!O&&!p)return;let Z=y2(t,o);P.current=Z.display,K.current=Z.raw,O&&(M.current={},E({})),D(U=>{let q={...Z.display};for(let h of L1)M.current[h]&&(q[h]=U[h]);return q}),ma(Z.raw,l)?y.current&&Object.keys(M.current).length===0&&b(!1):b(!0)},[t,o,r,a,l]);let Q=g=>H&&l?L1:H?g==="top"?["top","bottom"]:["right","left"]:[g],te=(g,O)=>{var V;y.current=!1,(V=M.current)[g]??(V[g]={baseline:P.current[g],sides:Q(g)}),D(p=>({...p,[g]:O})),E(p=>({...p,[g]:void 0}))},z=g=>{delete M.current[g],E(O=>({...O,[g]:void 0})),D(O=>({...O,[g]:P.current[g]}))},T=(g,O)=>{let V=M.current[g]?.sides??Q(g),p=O.trim(),Z=M.current[g]?.baseline??P.current[g],U=t1(p);if(p===""||U&&t1(Z)&&Number(p)===Number(Z)){z(g);return}if(!U||!u&&Number(p)<0){E(G=>({...G,[g]:U?"negative":"number"}));return}let q=Number(p),h={};for(let G of V)h[G]=`${q}px`;if(i(h)===!1){E(G=>({...G,[g]:"measurement"}));return}y.current=H;let R=S2(q);for(let G of V)P.current[G]=R,K.current[G]=q;delete M.current[g],E(G=>({...G,[g]:void 0})),D(G=>{let ee={...G};for(let xe of V)M.current[xe]||(ee[xe]=R);return ee})},A=[f.corners.topLeft,f.corners.topRight,f.corners.bottomRight,f.corners.bottomLeft],F=(d==="corners"?hs:L1).filter(g=>!H||g==="top"||!l&&g==="right"),x=`${m}-sides`,j=`${m}-collapse-description`,N=L1.every(g=>K.current[g]!==null)&&Object.keys(M.current).length===0,X=v?ma(K.current,l)?l?f.collapseCorners:f.collapse:l?f.matchCornersAndCollapse:f.matchAndCollapse:l?f.expandCorners:f.expand;return so(c1,{label:e,id:m,className:"boxDimensionEditor-fieldset",children:[so("div",{className:`boxDimensionEditor-layout${H?l?" boxDimensionEditor-layout--uniform-compact":" boxDimensionEditor-layout--paired-compact":""}`,children:[M1("div",{id:x,className:"boxDimensionEditor-grid",children:F.map(g=>{let O=L1.indexOf(g),V=H?l?f.allCorners:g==="top"?f.vertical:f.horizontal:d==="corners"?A[O]:f.sides[g],p=Ve(f.ariaSide,[e,V??""]),Z=`${m}-${g}-error`;return so("div",{className:"boxDimensionEditor-cell",children:[M1("label",{htmlFor:`${m}-${g}`,className:"boxDimensionEditor-label",children:V}),so("div",{className:"boxDimensionEditor-input-row",children:[L&&M1("span",{className:"boxDimensionEditor-input-icon","aria-hidden":"true",title:p,children:so("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",className:"boxDimensionEditor-pair-icon",children:[M1("rect",{x:1,y:1,width:10,height:10,rx:l?2:void 0}),M1("path",{d:ws(l,H,g)})]})}),M1("input",{id:`${m}-${g}`,type:"text",inputMode:"decimal",className:`boxDimensionEditor-input${L?" boxDimensionEditor-input--with-icon":""}`,value:$[g],onChange:U=>te(g,U.target.value),onPaste:U=>{U.preventDefault();let q=U.currentTarget;te(g,$[g].slice(0,q.selectionStart??0)+U.clipboardData.getData("text")+$[g].slice(q.selectionEnd??$[g].length))},onBlur:()=>{M.current[g]&&T(g,$[g])},onKeyDown:U=>{if(U.key==="Enter")M.current[g]&&T(g,$[g]),U.currentTarget.blur();else if(U.key==="Escape")z(g);else if(U.key==="ArrowUp"||U.key==="ArrowDown"){U.preventDefault(),y.current=!1;let q=M.current[g]?U.currentTarget.value:P.current[g];if(!t1(q.trim()))return;if(!u&&Number(q)<0){T(g,q);return}let h=(U.key==="ArrowUp"?1:-1)*(U.shiftKey?10:1),R=Number(q)+h;T(g,String(u?R:Math.max(0,R)))}},"aria-label":p,"aria-invalid":w[g]?!0:void 0,"aria-describedby":w[g]?Z:void 0,autoComplete:"off",spellCheck:"false"})]}),w[g]&&M1("span",{id:Z,role:"alert",className:"boxDimensionEditor-error",children:w[g]==="measurement"?f.measurementUnavailable:w[g]==="negative"?f.invalidNonNegative:f.invalidNumber})]},g)})}),L&&M1("button",{type:"button",className:"boxDimensionEditor-expand","aria-label":X,"aria-expanded":v,"aria-controls":x,"aria-disabled":v&&!N?!0:void 0,"aria-describedby":v&&!N?j:void 0,title:v&&!N?f.collapseUnavailable:X,onPointerDown:g=>{v&&!N&&g.preventDefault()},onClick:()=>{if(v){if(!N)return;let g=K.current,O={};for(let V of L1){let p=l?"top":M2[V];g[V]!==g[p]&&(O[V]=`${g[p]}px`)}if(Object.keys(O).length>0&&i(O)===!1)return;for(let V of L1){let p=O[V];p!==void 0&&(g[V]=Number.parseFloat(p),P.current[V]=P.current[l?"top":M2[V]])}D({...P.current})}y.current=v,b(!v)},children:M1(u2,{width:12,height:12,"aria-hidden":"true"})})]}),L&&v&&!N&&M1("span",{id:j,className:"boxDimensionEditor-collapseDescription",children:f.collapseUnavailable})]})}import{forwardRef as Is,createElement as ys}from"react";var qo=(...e)=>e.filter((t,o,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===o).join(" ").trim();var H2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var k2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,r)=>r?r.toUpperCase():o.toLowerCase());var ga=e=>{let t=k2(e);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as bs,createElement as V2}from"react";var P2={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 T2=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var _2=bs(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:n,iconNode:l,...i},s)=>V2("svg",{ref:s,...P2,width:t,height:t,stroke:e,strokeWidth:r?Number(o)*24/Number(t):o,className:qo("lucide",a),...!n&&!T2(i)&&{"aria-hidden":"true"},...i},[...l.map(([u,d])=>V2(u,d)),...Array.isArray(n)?n:[n]]));var E2=(e,t)=>{let o=Is(({className:r,...a},n)=>ys(_2,{ref:n,iconNode:t,className:qo(`lucide-${H2(ga(e))}`,`lucide-${e}`,r),...a}));return o.displayName=ga(e),o};var Ms=[["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"}]],uo=E2("pipette",Ms);import Pe from"react";import{useRef as Go,useCallback as Ke,useEffect as ya,useMemo as Wo,useState as Ma,createContext as Ss,useContext as Rs}from"react";var D2={exports:{}},co={};var O2;function Hs(){if(O2)return co;O2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(r,a,n){var l=null;if(n!==void 0&&(l=""+n),a.key!==void 0&&(l=""+a.key),"key"in a){n={};for(var i in a)i!=="key"&&(n[i]=a[i])}else n=a;return a=n.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:n}}return co.Fragment=t,co.jsx=o,co.jsxs=o,co}var B2;function ks(){return B2||(B2=1,D2.exports=Hs()),D2.exports}var _e=ks();function j2(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=j2(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Ps(){for(var e,t,o=0,r="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=j2(e))&&(r&&(r+=" "),r+=t);return r}var Sa="-",Ts=e=>{let t=_s(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let n=a.split(Sa);return n[0]===""&&n.length!==1&&n.shift(),K2(n,t)||Vs(a)},getConflictingClassGroupIds:(a,n)=>{let l=o[a]||[];return n&&r[a]?[...l,...r[a]]:l}}},K2=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?K2(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(Sa);return t.validators.find(({validator:l})=>l(n))?.classGroupId},A2=/^\[(.+)\]$/,Vs=e=>{if(A2.test(e)){let t=A2.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},_s=e=>{let{theme:t,classGroups:o}=e,r={nextPart:new Map,validators:[]};for(let a in o)xa(o[a],r,a,t);return r},xa=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:Z2(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Es(a)){xa(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,l])=>{xa(l,Z2(t,n),o,r)})})},Z2=(e,t)=>{let o=e;return t.split(Sa).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Es=e=>e.isThemeGetter,Ds=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=r.get(n))!==void 0)return a(n,l),l},set(n,l){o.has(n)?o.set(n,l):a(n,l)}}},La="!",wa=":",Os=wa.length,Bs=e=>{let{prefix:t,experimentalParseClassName:o}=e,r=a=>{let n=[],l=0,i=0,s=0,u;for(let f=0;f<a.length;f++){let S=a[f];if(l===0&&i===0){if(S===wa){n.push(a.slice(s,f)),s=f+Os;continue}if(S==="/"){u=f;continue}}S==="["?l++:S==="]"?l--:S==="("?i++:S===")"&&i--}let d=n.length===0?a:a.substring(s),c=As(d),C=c!==d,m=u&&u>s?u-s:void 0;return{modifiers:n,hasImportantModifier:C,baseClassName:c,maybePostfixModifierPosition:m}};if(t){let a=t+wa,n=r;r=l=>l.startsWith(a)?n(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(o){let a=r;r=n=>o({className:n,parseClassName:a})}return r},As=e=>e.endsWith(La)?e.substring(0,e.length-1):e.startsWith(La)?e.substring(1):e,Zs=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;let r=[],a=[];return o.forEach(n=>{n[0]==="["||t[n]?(r.push(...a.sort(),n),a=[]):a.push(n)}),r.push(...a.sort()),r}},Fs=e=>({cache:Ds(e.cacheSize),parseClassName:Bs(e),sortModifiers:Zs(e),...Ts(e)}),$s=/\s+/,Ns=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:n}=t,l=[],i=e.trim().split($s),s="";for(let u=i.length-1;u>=0;u-=1){let d=i[u],{isExternal:c,modifiers:C,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:S}=o(d);if(c){s=d+(s.length>0?" "+s:s);continue}let L=!!S,I=r(L?f.substring(0,S):f);if(!I){if(!L){s=d+(s.length>0?" "+s:s);continue}if(I=r(f),!I){s=d+(s.length>0?" "+s:s);continue}L=!1}let v=n(C).join(":"),b=m?v+La:v,y=b+I;if(l.includes(y))continue;l.push(y);let H=a(I,L);for(let $=0;$<H.length;++$){let D=H[$];l.push(b+D)}s=d+(s.length>0?" "+s:s)}return s};function Us(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=G2(t))&&(r&&(r+=" "),r+=o);return r}var G2=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=G2(e[r]))&&(o&&(o+=" "),o+=t);return o};function qs(e,...t){let o,r,a,n=l;function l(s){let u=t.reduce((d,c)=>c(d),e());return o=Fs(u),r=o.cache.get,a=o.cache.set,n=i,i(s)}function i(s){let u=r(s);if(u)return u;let d=Ns(s,o);return a(s,d),d}return function(){return n(Us.apply(null,arguments))}}var Oe=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},W2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,X2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zs=/^\d+\/\d+$/,js=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ks=/\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$/,Gs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ws=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ot=e=>zs.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),tt=e=>!!e&&Number.isInteger(Number(e)),ha=e=>e.endsWith("%")&&de(e.slice(0,-1)),B1=e=>js.test(e),Qs=()=>!0,Ys=e=>Ks.test(e)&&!Gs.test(e),Q2=()=>!1,Js=e=>Ws.test(e),eu=e=>Xs.test(e),tu=e=>!Y(e)&&!J(e),ou=e=>Bt(e,e9,Q2),Y=e=>W2.test(e),It=e=>Bt(e,t9,Ys),va=e=>Bt(e,iu,de),F2=e=>Bt(e,Y2,Q2),ru=e=>Bt(e,J2,eu),zo=e=>Bt(e,o9,Js),J=e=>X2.test(e),fo=e=>At(e,t9),au=e=>At(e,su),$2=e=>At(e,Y2),nu=e=>At(e,e9),lu=e=>At(e,J2),jo=e=>At(e,o9,!0),Bt=(e,t,o)=>{let r=W2.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},At=(e,t,o=!1)=>{let r=X2.exec(e);return r?r[1]?t(r[1]):o:!1},Y2=e=>e==="position"||e==="percentage",J2=e=>e==="image"||e==="url",e9=e=>e==="length"||e==="size"||e==="bg-size",t9=e=>e==="length",iu=e=>e==="number",su=e=>e==="family-name",o9=e=>e==="shadow",uu=()=>{let e=Oe("color"),t=Oe("font"),o=Oe("text"),r=Oe("font-weight"),a=Oe("tracking"),n=Oe("leading"),l=Oe("breakpoint"),i=Oe("container"),s=Oe("spacing"),u=Oe("radius"),d=Oe("shadow"),c=Oe("inset-shadow"),C=Oe("text-shadow"),m=Oe("drop-shadow"),f=Oe("blur"),S=Oe("perspective"),L=Oe("aspect"),I=Oe("ease"),v=Oe("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],H=()=>[...y(),J,Y],$=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],w=()=>[J,Y,s],E=()=>[Ot,"full","auto",...w()],M=()=>[tt,"none","subgrid",J,Y],P=()=>["auto",{span:["full",tt,J,Y]},tt,J,Y],K=()=>[tt,"auto",J,Y],W=()=>["auto","min","max","fr",J,Y],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...w()],T=()=>[Ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],A=()=>[e,J,Y],F=()=>[...y(),$2,F2,{position:[J,Y]}],x=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",nu,ou,{size:[J,Y]}],N=()=>[ha,fo,It],X=()=>["","none","full",u,J,Y],g=()=>["",de,fo,It],O=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],p=()=>[de,ha,$2,F2],Z=()=>["","none",f,J,Y],U=()=>["none",de,J,Y],q=()=>["none",de,J,Y],h=()=>[de,J,Y],R=()=>[Ot,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[B1],breakpoint:[B1],color:[Qs],container:[B1],"drop-shadow":[B1],ease:["in","out","in-out"],font:[tu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[B1],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[B1],shadow:[B1],spacing:["px",de],text:[B1],"text-shadow":[B1],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ot,Y,J,L]}],container:["container"],columns:[{columns:[de,Y,J,i]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[tt,"auto",J,Y]}],basis:[{basis:[Ot,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,Ot,"auto","initial","none",Y]}],grow:[{grow:["",de,J,Y]}],shrink:[{shrink:["",de,J,Y]}],order:[{order:[tt,"first","last","none",J,Y]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[i,"screen",...T()]}],"min-w":[{"min-w":[i,"screen","none",...T()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",o,fo,It]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,J,va]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ha,Y]}],"font-family":[{font:[au,Y,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:[a,J,Y]}],"line-clamp":[{"line-clamp":[de,"none",J,va]}],leading:[{leading:[n,...w()]}],"list-image":[{"list-image":["none",J,Y]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",J,Y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[de,"from-font","auto",J,It]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[de,"auto",J,Y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J,Y]}],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",J,Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:x()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tt,J,Y],radial:["",J,Y],conic:[tt,J,Y]},lu,ru]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:g()}],"border-w-x":[{"border-x":g()}],"border-w-y":[{"border-y":g()}],"border-w-s":[{"border-s":g()}],"border-w-e":[{"border-e":g()}],"border-w-t":[{"border-t":g()}],"border-w-r":[{"border-r":g()}],"border-w-b":[{"border-b":g()}],"border-w-l":[{"border-l":g()}],"divide-x":[{"divide-x":g()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":g()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[de,J,Y]}],"outline-w":[{outline:["",de,fo,It]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",d,jo,zo]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",c,jo,zo]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:g()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[de,It]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":g()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",C,jo,zo]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[de,J,Y]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"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":[de]}],"mask-image-linear-from-pos":[{"mask-linear-from":p()}],"mask-image-linear-to-pos":[{"mask-linear-to":p()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":p()}],"mask-image-t-to-pos":[{"mask-t-to":p()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":p()}],"mask-image-r-to-pos":[{"mask-r-to":p()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":p()}],"mask-image-b-to-pos":[{"mask-b-to":p()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":p()}],"mask-image-l-to-pos":[{"mask-l-to":p()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":p()}],"mask-image-x-to-pos":[{"mask-x-to":p()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":p()}],"mask-image-y-to-pos":[{"mask-y-to":p()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[J,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":p()}],"mask-image-radial-to-pos":[{"mask-radial-to":p()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":y()}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":p()}],"mask-image-conic-to-pos":[{"mask-conic-to":p()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:x()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",J,Y]}],filter:[{filter:["","none",J,Y]}],blur:[{blur:Z()}],brightness:[{brightness:[de,J,Y]}],contrast:[{contrast:[de,J,Y]}],"drop-shadow":[{"drop-shadow":["","none",m,jo,zo]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",de,J,Y]}],"hue-rotate":[{"hue-rotate":[de,J,Y]}],invert:[{invert:["",de,J,Y]}],saturate:[{saturate:[de,J,Y]}],sepia:[{sepia:["",de,J,Y]}],"backdrop-filter":[{"backdrop-filter":["","none",J,Y]}],"backdrop-blur":[{"backdrop-blur":Z()}],"backdrop-brightness":[{"backdrop-brightness":[de,J,Y]}],"backdrop-contrast":[{"backdrop-contrast":[de,J,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":["",de,J,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[de,J,Y]}],"backdrop-invert":[{"backdrop-invert":["",de,J,Y]}],"backdrop-opacity":[{"backdrop-opacity":[de,J,Y]}],"backdrop-saturate":[{"backdrop-saturate":[de,J,Y]}],"backdrop-sepia":[{"backdrop-sepia":["",de,J,Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",J,Y]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[de,"initial",J,Y]}],ease:[{ease:["linear","initial",I,J,Y]}],delay:[{delay:[de,J,Y]}],animate:[{animate:["none",v,J,Y]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,J,Y]}],"perspective-origin":[{"perspective-origin":H()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:h()}],"skew-x":[{"skew-x":h()}],"skew-y":[{"skew-y":h()}],transform:[{transform:[J,Y,"","none","gpu","cpu"]}],"transform-origin":[{origin:H()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",J,Y]}],"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":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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",J,Y]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[de,fo,It,va]}],stroke:[{stroke:["none",...A()]}],"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"]}},du=qs(uu),cu=(e,t,o)=>Math.min(Math.max(e,t),o),Ko=e=>Math.round(cu(e,0,255)),r9=e=>{let t=e.replace("#",""),o=parseInt(t,16);return{r:o>>16&255,g:o>>8&255,b:o&255}},fu=({r:e,g:t,b:o})=>{let r=a=>Ko(a).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(o)}`},ba=({h:e,s:t,v:o})=>{e=e/360,t=t/100,o=o/100;let r=Math.floor(e*6),a=e*6-r,n=o*(1-t),l=o*(1-a*t),i=o*(1-(1-a)*t),s,u,d;switch(r%6){case 0:s=o,u=i,d=n;break;case 1:s=l,u=o,d=n;break;case 2:s=n,u=o,d=i;break;case 3:s=n,u=l,d=o;break;case 4:s=i,u=n,d=o;break;case 5:s=o,u=n,d=l;break;default:s=u=d=0}return{r:Ko(s*255),g:Ko(u*255),b:Ko(d*255)}},Ia=({r:e,g:t,b:o})=>{e/=255,t/=255,o/=255;let r=Math.max(e,t,o),a=Math.min(e,t,o),n=r-a,l=0,i=r===0?0:n/r,s=r;if(n!==0)switch(r){case e:l=((t-o)/n+(t<o?6:0))/6;break;case t:l=((o-e)/n+2)/6;break;case o:l=((e-t)/n+4)/6;break}return{h:Math.round(l*360),s:Math.round(i*100),v:Math.round(s*100)}},pu=e=>fu(ba(e)),Cu=e=>Ia(r9(e));var N2=({h:e,s:t,v:o})=>{let r=o*(2-t/100)/2,a=r!==0&&r!==100?(o-r)/Math.min(r,100-r)*100:0;return{h:e,s:Math.round(a),l:Math.round(r)}},U2=({h:e,s:t,l:o})=>{let r=o+t*Math.min(o,100-o)/100,a=r===0?0:2*(1-o/r)*100;return{h:e,s:Math.round(a),v:Math.round(r)}},mu=e=>{let{r:t,g:o,b:r}=r9(e);return(.299*t+.587*o+.114*r)/255>.5?"#000000":"#ffffff"};var gu=(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 r=e.getRgba();return`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`;case"hsl":let a=e.getHsl();return`hsl(${a.h}, ${a.s}%, ${a.l}%)`;case"hsla":let n=e.getHsla();return`hsla(${n.h}, ${n.s}%, ${n.l}%, ${n.a})`;default:Xo()}};function hu(e){switch(e.type){case"hex":return{...Cu(e.value),a:1};case"rgb":return{...Ia(e),a:1};case"rgba":return{...Ia(e),a:e.a};case"hsl":return{...U2(e),a:1};case"hsla":return{...U2(e),a:1};case"hsv":return{...e,a:1};case"hsva":return{...e};default:Xo()}}function ot(e,t){let o=hu(e);switch(t){case"hex":return pu(o);case"rgb":return ba(o);case"rgba":return{...ba(o),a:o.a};case"hsl":return N2(o);case"hsla":return{...N2(o),a:o.a};case"hsv":return{h:o.h,s:o.s,v:o.v};case"hsva":return o;default:Xo()}}var yt=(...e)=>du(Ps(e)),A1=(e,t,o)=>Math.min(Math.max(e,t),o),rt=e=>Math.round(e);function Xo(e){throw new Error("You should never get here.")}var at=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 ot(this.color,"rgb")}getHsv(){return ot(this.color,"hsv")}getHsla(){return ot(this.color,"hsla")}getHsva(){return ot(this.color,"hsva")}getHex(){return ot(this.color,"hex")}getHsl(){return ot(this.color,"hsl")}getRgba(){return ot(this.color,"rgba")}format(t="hex"){return gu(this,t)}getContrastingColor(){return new e({type:"hex",value:mu(this.getHex())})}},q2=(e,t)=>{let o=e.getBoundingClientRect(),r,a;if("touches"in t){let u=t.touches[0]||t.changedTouches[0];r=u.clientX,a=u.clientY}else r=t.clientX,a=t.clientY;let n=r-o.left,l=a-o.top,i=A1(n/o.width,0,1),s=A1(l/o.height,0,1);return{left:i,top:s}},Ra=({onMove:e,onMoveEnd:t,onKey:o,children:r,className:a,...n})=>{let l=Go(null),i=Go(!1),s=Ke(C=>{!i.current||!l.current||(C.preventDefault(),e(q2(l.current,C)))},[e]),u=Ke(()=>{i.current=!1,t(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,t]),d=Ke(C=>{let m=l.current;m&&(C.preventDefault(),i.current=!0,e(q2(m,C.nativeEvent)),document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",u))},[e,s,u]),c=Ke(C=>{if(!o)return;let m=C.which||C.keyCode;m<37||m>40||(C.preventDefault(),o({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},[o]);return ya(()=>()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,u]),_e.jsx("div",{ref:l,className:yt("rounded-inherit absolute inset-0 touch-none outline-none","focus:[&_.react-colorful-pointer]:scale-110",a),onTouchStart:d,onMouseDown:d,onKeyDown:c,tabIndex:0,role:"slider",...n,children:r})},Ha=({className:e,top:t=.5,left:o,color:r})=>_e.jsx("div",{className:yt("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}%`}}),vu=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=Ke(s=>{t({a:s.left},!1)},[t]),n=Ke(s=>{t({a:A1(e.a+s.left,0,1)},!0)},[e.a,t]),l=Wo(()=>new at({type:"hsva",h:e.h,s:e.s,v:e.v,a:0}).format("hsla"),[e.h,e.s,e.v]),i=Wo(()=>new at({type:"hsva",h:e.h,s:e.s,v:e.v,a:1}).format("hsla"),[e.h,e.s,e.v]);return _e.jsx("div",{className:yt("relative h-full w-full",o),children:_e.jsxs(Ra,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Alpha","aria-valuetext":`${rt(e.a*100)}%`,"aria-valuenow":rt(e.a*100),"aria-valuemin":0,"aria-valuemax":100,className:"h-full w-full rounded-lg",children:[_e.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>')`}}),_e.jsx("div",{className:"absolute inset-0 rounded-lg",style:{backgroundImage:`linear-gradient(90deg, ${l}, ${i})`}}),_e.jsx(Ha,{className:"z-[1]",top:.5,left:e.a,color:""})]})})},xu=({hue:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=Ke(l=>{let i=rt(A1(360*l.left,0,360));t({h:i},!1)},[t]),n=Ke(l=>{t({h:A1(e+l.left*360,0,360)},!0)},[e,t]);return _e.jsx("div",{className:yt("relative h-full w-full",o),children:_e.jsxs(Ra,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Hue","aria-valuenow":rt(e),"aria-valuemax":360,"aria-valuemin":0,className:"h-full w-full rounded-lg",children:[_e.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%)"}}),_e.jsx(Ha,{className:"z-[2]",top:.5,left:e/360,color:""})]})})},Lu=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=Ke(i=>{let s=rt(A1(i.left*100,0,100)),u=rt(A1(100-i.top*100,0,100));t({s,v:u},!1)},[t]),n=Ke(i=>{t({s:A1(e.s+i.left*100,0,100),v:A1(e.v-i.top*100,0,100)},!0)},[e.s,e.v,t]),l=`hsl(${e.h}, 100%, 50%)`;return _e.jsx("div",{className:yt("relative h-full w-full rounded-xl",o),children:_e.jsxs(Ra,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Color","aria-valuetext":`Saturation ${rt(e.s)}%, Brightness ${rt(e.v)}%`,className:"rounded-inherit h-full w-full",children:[_e.jsx("div",{className:"rounded-inherit absolute inset-0 rounded-b-none",style:{backgroundColor:l,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)"}}),_e.jsx(Ha,{className:"z-[3]",top:1-e.v/100,left:e.s/100,color:""})]})})},a9=Ss(null),Qo=()=>{let e=Rs(a9);if(!e)throw new Error("ColorPicker compound components must be used within a ColorPicker");return e};function z2(e){return"type"in e?new at(e):e}var wu=({color:e,onChange:t,className:o,children:r,defaultColor:a,...n})=>{let[l,i]=Ma(z2(e??a??{h:340,s:58,v:100,a:1,type:"hsva"})),s=Go(!1),u=Go(l);ya(()=>{!s.current&&e&&(u.current=z2(e),i(u.current))},[e]);let d=Ke((f,S)=>{let L=new at({type:"hsva",...u.current.getHsva(),...f});u.current=L,i(L),s.current=!S,t?.(L)},[t]),c=Ke(()=>{s.current=!1},[]),C=Ke(async()=>{if(!("EyeDropper"in window)){console.log("EyeDropper API not supported");return}try{let f=await new window.EyeDropper().open();f.sRGBHex&&d(ot({type:"hex",value:f.sRGBHex},"hsva"),!0)}catch(f){console.log("EyeDropper cancelled or failed:",f)}},[t]),m={hsva:l.getHsva(),updateHsva:d,handleEyeDropper:C,onFinishedUpdates:c};return _e.jsx(a9.Provider,{value:m,children:_e.jsx("div",{...n,className:yt("relative flex h-[280px] w-[280px] cursor-default flex-col rounded-2xl bg-white shadow-lg select-none",o),children:r})})},bu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=Ke((n,l)=>{o(n,l)},[o]);return _e.jsx(Lu,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},Iu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=Ke((n,l)=>{o(n,l)},[o]);return _e.jsx(xu,{hue:t.h,onChange:a,className:e,onFinishedUpdates:r})},yu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=Ke((n,l)=>{o(n,l)},[o]);return _e.jsx(vu,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},Mu=({className:e,title:t="Pick color from screen",children:o})=>{let{handleEyeDropper:r}=Qo(),[a,n]=Ma(!1);return ya(()=>{typeof window<"u"&&"EyeDropper"in window&&n(!0)},[]),a?_e.jsx("button",{onClick:r,className:yt("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},Zt=Object.assign(wu,{Saturation:bu,Hue:Iu,Alpha:yu,EyeDropper:Mu});function Su(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:Xo()}}var n9=(e={type:"hex",value:"#ff6b9d"})=>{let[t,o]=Ma(()=>{let l=typeof e=="function"?e():e;return{color:new at(l),type:l.type}}),r=Wo(()=>Su(t.color,t.type),[t.color,t.type]),a=Wo(()=>{let l=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:l,alpha:l.a}},[t.color]),n=Ke(l=>{try{let i="type"in l?new at(l):l;o(s=>({color:i,type:s.type}))}catch(i){console.warn("Invalid color input:",l,i)}},[]);return[{colorInput:r,colorState:a},n]};import{createPortal as s7}from"react-dom";import{useRef as w1,useMemo as Ru,useEffect as Hu,useState as Vf,useCallback as _f}from"react";function l9(e,t,o,r){var a=this,n=w1(null),l=w1(0),i=w1(0),s=w1(null),u=w1([]),d=w1(),c=w1(),C=w1(e),m=w1(!0),f=w1(),S=w1();C.current=e;var L=typeof window<"u",I=!t&&t!==0&&L;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,b=!("trailing"in o)||!!o.trailing,y=!!o.flushOnExit&&b,H="maxWait"in o,$="debounceOnServer"in o&&!!o.debounceOnServer,D=H?Math.max(+o.maxWait||0,t):null,w=Ru(function(){var E=function(z){var T=u.current,A=d.current;return u.current=d.current=null,l.current=z,i.current=i.current||z,c.current=C.current.apply(A,T)},M=function(z,T){I&&cancelAnimationFrame(s.current),s.current=I?requestAnimationFrame(z):setTimeout(z,T)},P=function(z){if(!m.current)return!1;var T=z-n.current;return!n.current||T>=t||T<0||H&&z-l.current>=D},K=function(z){return s.current=null,b&&u.current?E(z):(u.current=d.current=null,c.current)},W=function z(){var T=Date.now();if(v&&i.current===l.current&&Q(),P(T))return K(T);if(m.current){var A=t-(T-n.current),F=H?Math.min(A,D-(T-l.current)):A;M(z,F)}},Q=function(){r&&r({})},te=function(){if(L||$){var z,T=Date.now(),A=P(T);if(u.current=[].slice.call(arguments),d.current=a,n.current=T,y&&!f.current&&(f.current=function(){var F;((F=globalThis.document)==null?void 0:F.visibilityState)==="hidden"&&S.current.flush()},(z=globalThis.document)==null||z.addEventListener==null||z.addEventListener("visibilitychange",f.current)),A){if(!s.current&&m.current)return l.current=n.current,M(W,t),v?E(n.current):c.current;if(H)return M(W,t),E(n.current)}return s.current||M(W,t),c.current}};return te.cancel=function(){var z=s.current;z&&(I?cancelAnimationFrame(s.current):clearTimeout(s.current)),l.current=0,u.current=n.current=d.current=s.current=null,z&&r&&r({})},te.isPending=function(){return!!s.current},te.flush=function(){return s.current?K(Date.now()):c.current},te},[v,H,t,D,b,y,I,L,$,r]);return S.current=w,Hu(function(){return m.current=!0,function(){var E;y&&S.current.flush(),f.current&&((E=globalThis.document)==null||E.removeEventListener==null||E.removeEventListener("visibilitychange",f.current),f.current=null),m.current=!1}},[y]),w}import Je from"react";function Z1(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 i9='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Yo({computePosition:e,onClose:t,autoFocus:o=!0,trapFocus:r=!1,restoreFocusOnOutside:a=!0}={}){let[n,l]=Je.useState(!1),[i,s]=Je.useState({top:0,left:0}),u=Je.useRef(null),d=Je.useRef(null),c=Je.useRef(!1),C=Je.useRef(e);C.current=e;let m=Je.useRef(t);m.current=t;let f=Je.useRef(r);f.current=r;let S=Je.useCallback((...b)=>{!u.current||!C.current||s(C.current(u.current,...b))},[]),L=Je.useCallback(()=>{S(),c.current=!0,l(!0)},[S]),I=Je.useCallback((b=!0)=>{m.current&&m.current(),c.current=!1,l(!1),b&&u.current?.focus()},[]),v=Je.useCallback(()=>{c.current?I():L()},[L,I]);return Je.useEffect(()=>{if(!n)return;let b=H=>{if(H.key==="Escape"&&(H.preventDefault(),I()),f.current&&H.key==="Tab"){let $=d.current;if(!$)return;let D=Array.from($.querySelectorAll(i9)).filter(M=>!M.hasAttribute("disabled")),w=D[0],E=D.at(-1);if(!w||!E)return;H.shiftKey&&document.activeElement===w?(H.preventDefault(),E.focus()):!H.shiftKey&&document.activeElement===E&&(H.preventDefault(),w.focus())}},y=H=>{let $=d.current,D=u.current;if(!$||!D)return;let w=typeof H.composedPath=="function"?H.composedPath():[],E=w.includes($)||H.target instanceof Node&&$.contains(H.target),M=w.includes(D)||H.target instanceof Node&&D.contains(H.target);!E&&!M&&I(a)};return document.addEventListener("keydown",b),document.addEventListener("mousedown",y),document.addEventListener("touchstart",y),()=>{document.removeEventListener("keydown",b),document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y)}},[n,I,a]),Je.useEffect(()=>{if(!n||!o||!d.current)return;let b=d.current.querySelector(i9);b&&b.focus()},[n,o]),Je.useEffect(()=>{if(!n||!u.current)return;let b=Z1(u.current);if(!b)return;let y=()=>I();return b.addEventListener("scroll",y,{passive:!0}),()=>b.removeEventListener("scroll",y)},[n,I]),{isOpen:n,open:L,close:I,toggle:v,triggerRef:u,popoverRef:d,position:i,reposition:S}}var ku=(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}}},Jo=ku;var Pu={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},s9=Pu;var Tu=e=>Jo(s9[e.toLowerCase()],6),u9=Tu;var Vu=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,_u=e=>{let t;return(t=e.match(Vu))?Jo(parseInt(t[1],16),t[1].length):void 0},d9=_u;var e1="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",jf=`(?:${e1}|none)`,Mt=`${e1}%`,Kf=`(?:${e1}%|none)`,po=`(?:${e1}%|${e1})`,Eu=`(?:${e1}%|${e1}|none)`,c9=`(?:${e1}(deg|grad|rad|turn)|${e1})`,Gf=`(?:${e1}(deg|grad|rad|turn)|${e1}|none)`,nt="\\s*,\\s*";var Wf=new RegExp("^"+Eu+"$");var Du=new RegExp(`^rgba?\\(\\s*${e1}${nt}${e1}${nt}${e1}\\s*(?:,\\s*${po}\\s*)?\\)$`),Ou=new RegExp(`^rgba?\\(\\s*${Mt}${nt}${Mt}${nt}${Mt}\\s*(?:,\\s*${po}\\s*)?\\)$`),Bu=e=>{let t={mode:"rgb"},o;if(o=e.match(Du))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(Ou))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},f9=Bu;var Au=(e,t)=>e===void 0?void 0:typeof e!="object"?St(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,er=Au;var Zu=(e="rgb")=>t=>(t=er(t,e))!==void 0?t.mode===e?t:b1[t.mode][e]?b1[t.mode][e](t):e==="rgb"?b1[t.mode].rgb(t):b1.rgb[e](b1[t.mode].rgb(t)):void 0,s1=Zu;var b1={},p9={},Co=[],ka={},Fu=e=>e,ge=e=>(b1[e.mode]={...b1[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{b1[t]||(b1[t]={}),b1[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=Fu)}),p9[e.mode]=e,(e.parse||[]).forEach(t=>{$u(t,e.mode)}),s1(e.mode)),tr=e=>p9[e],$u=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");ka[e]=t}else typeof e=="function"&&Co.indexOf(e)<0&&Co.push(e)};var Pa=/[^\x00-\x7F]|[a-zA-Z_]/,Nu=/[^\x00-\x7F]|[-\w]/,_={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},le=0;function or(e){let t=e[le],o=e[le+1];return t==="-"||t==="+"?/\d/.test(o)||o==="."&&/\d/.test(e[le+2]):t==="."?/\d/.test(o):/\d/.test(t)}function Ta(e){if(le>=e.length)return!1;let t=e[le];if(Pa.test(t))return!0;if(t==="-"){if(e.length-le<2)return!1;let o=e[le+1];return!!(o==="-"||Pa.test(o))}return!1}var Uu={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function mo(e){let t="";if((e[le]==="-"||e[le]==="+")&&(t+=e[le++]),t+=rr(e),e[le]==="."&&/\d/.test(e[le+1])&&(t+=e[le++]+rr(e)),(e[le]==="e"||e[le]==="E")&&((e[le+1]==="-"||e[le+1]==="+")&&/\d/.test(e[le+2])?t+=e[le++]+e[le++]+rr(e):/\d/.test(e[le+1])&&(t+=e[le++]+rr(e))),Ta(e)){let o=ar(e);return o==="deg"||o==="rad"||o==="turn"||o==="grad"?{type:_.Hue,value:t*Uu[o]}:void 0}return e[le]==="%"?(le++,{type:_.Percentage,value:+t}):{type:_.Number,value:+t}}function rr(e){let t="";for(;/\d/.test(e[le]);)t+=e[le++];return t}function ar(e){let t="";for(;le<e.length&&Nu.test(e[le]);)t+=e[le++];return t}function qu(e){let t=ar(e);return e[le]==="("?(le++,{type:_.Function,value:t}):t==="none"?{type:_.None,value:void 0}:{type:_.Ident,value:t}}function zu(e=""){let t=e.trim(),o=[],r;for(le=0;le<t.length;){if(r=t[le++],r===`
2
- `||r===" "||r===" "){for(;le<t.length&&(t[le]===`
3
- `||t[le]===" "||t[le]===" ");)le++;continue}if(r===",")return;if(r===")"){o.push({type:_.ParenClose});continue}if(r==="+"){if(le--,or(t)){o.push(mo(t));continue}return}if(r==="-"){if(le--,or(t)){o.push(mo(t));continue}if(Ta(t)){o.push({type:_.Ident,value:ar(t)});continue}return}if(r==="."){if(le--,or(t)){o.push(mo(t));continue}return}if(r==="/"){for(;le<t.length&&(t[le]===`
4
- `||t[le]===" "||t[le]===" ");)le++;let a;if(or(t)&&(a=mo(t),a.type!==_.Hue)){o.push({type:_.Alpha,value:a});continue}if(Ta(t)&&ar(t)==="none"){o.push({type:_.Alpha,value:{type:_.None,value:void 0}});continue}return}if(/\d/.test(r)){le--,o.push(mo(t));continue}if(Pa.test(r)){le--,o.push(qu(t));continue}return}return o}function ju(e){e._i=0;let t=e[e._i++];if(!t||t.type!==_.Function||t.value!=="color"||(t=e[e._i++],t.type!==_.Ident))return;let o=ka[t.value];if(!o)return;let r={mode:o},a=C9(e,!1);if(!a)return;let n=tr(o).channels;for(let l=0,i,s;l<n.length;l++)i=a[l],s=n[l],i.type!==_.None&&(r[s]=i.type===_.Number?i.value:i.value/100,s==="alpha"&&(r[s]=Math.max(0,Math.min(1,r[s]))));return r}function C9(e,t){let o=[],r;for(;e._i<e.length;){if(r=e[e._i++],r.type===_.None||r.type===_.Number||r.type===_.Alpha||r.type===_.Percentage||t&&r.type===_.Hue){o.push(r);continue}if(r.type===_.ParenClose){if(e._i<e.length)return;continue}return}if(!(o.length<3||o.length>4)){if(o.length===4){if(o[3].type!==_.Alpha)return;o[3]=o[3].value}return o.length===3&&o.push({type:_.None,value:void 0}),o.every(a=>a.type!==_.Alpha)?o:void 0}}function Ku(e,t){e._i=0;let o=e[e._i++];if(!o||o.type!==_.Function)return;let r=C9(e,t);if(r)return r.unshift(o.value),r}var Gu=e=>{if(typeof e!="string")return;let t=zu(e),o=t?Ku(t,!0):void 0,r,a=0,n=Co.length;for(;a<n;)if((r=Co[a++](e,o))!==void 0)return r;return t?ju(t):void 0},St=Gu;function Wu(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let o={mode:"rgb"},[,r,a,n,l]=t;if(!(r.type===_.Hue||a.type===_.Hue||n.type===_.Hue))return r.type!==_.None&&(o.r=r.type===_.Number?r.value/255:r.value/100),a.type!==_.None&&(o.g=a.type===_.Number?a.value/255:a.value/100),n.type!==_.None&&(o.b=n.type===_.Number?n.value/255:n.value/100),l.type!==_.None&&(o.alpha=Math.min(1,Math.max(0,l.type===_.Number?l.value:l.value/100))),o}var m9=Wu;var Xu=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,g9=Xu;var h9=(e,t,o)=>e+o*(t-e);var Qu=e=>{let t=[];for(let o=0;o<e.length-1;o++){let r=e[o],a=e[o+1];r===void 0&&a===void 0?t.push(void 0):r!==void 0&&a!==void 0?t.push([r,a]):t.push(r!==void 0?[r,r]:[a,a])}return t},v9=e=>t=>{let o=Qu(t);return r=>{let a=r*o.length,n=r>=1?o.length-1:Math.max(Math.floor(a),0),l=o[n];return l===void 0?void 0:e(l[0],l[1],a-n)}};var B=v9(h9);var ce=e=>{let t=!1,o=e.map(r=>r!==void 0?(t=!0,r):1);return t?o:e};var Yu={mode:"rgb",channels:["r","g","b","alpha"],parse:[m9,d9,f9,u9,g9,"srgb"],serialize:"srgb",interpolate:{r:B,g:B,b:B,alpha:{use:B,fixup:ce}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},f1=Yu;var Va=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),Ju=e=>{let t=Va(e.r),o=Va(e.g),r=Va(e.b),a={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*o+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*o+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*o+.9913375368376386*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},_a=Ju;var Ea=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),ed=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"a98",r:Ea(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*o),g:Ea(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*o),b:Ea(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*o)};return r!==void 0&&(a.alpha=r),a},Da=ed;var Oa=(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)},td=({r:e,g:t,b:o,alpha:r})=>{let a={mode:"lrgb",r:Oa(e),g:Oa(t),b:Oa(o)};return r!==void 0&&(a.alpha=r),a},p1=td;var od=e=>{let{r:t,g:o,b:r,alpha:a}=p1(e),n={mode:"xyz65",x:.4123907992659593*t+.357584339383878*o+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*o+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*o+.9505321522496607*r};return a!==void 0&&(n.alpha=a),n},o1=od;var Ba=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},rd=({r:e,g:t,b:o,alpha:r},a="rgb")=>{let n={mode:a,r:Ba(e),g:Ba(t),b:Ba(o)};return r!==void 0&&(n.alpha=r),n},C1=rd;var ad=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=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 r!==void 0&&(a.alpha=r),a},r1=ad;var nd={...f1,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Da(o1(e)),xyz65:Da},toMode:{rgb:e=>r1(_a(e)),xyz65:_a}},x9=nd;var ld=e=>(e=e%360)<0?e+360:e,Le=ld;var id=(e,t)=>e.map((o,r,a)=>{if(o===void 0)return o;let n=Le(o);return r===0||e[r-1]===void 0?n:t(n-Le(a[r-1]))}).reduce((o,r)=>!o.length||r===void 0||o[o.length-1]===void 0?(o.push(r),o):(o.push(r+o[o.length-1]),o),[]),$e=e=>id(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var De=[-.14861,1.78277,-.29227,-.90649,1.97294,0],L9=Math.PI/180,w9=180/Math.PI;var b9=De[3]*De[4],I9=De[1]*De[4],y9=De[1]*De[2]-De[0]*De[3],sd=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(y9*o+e*b9-t*I9)/(y9+b9-I9),n=o-a,l=(De[4]*(t-a)-De[2]*n)/De[3],i={mode:"cubehelix",l:a,s:a===0||a===1?void 0:Math.sqrt(n*n+l*l)/(De[4]*a*(1-a))};return i.s&&(i.h=Math.atan2(l,n)*w9-120),r!==void 0&&(i.alpha=r),i},M9=sd;var ud=({h:e,s:t,l:o,alpha:r})=>{let a={mode:"rgb"};e=(e===void 0?0:e+120)*L9,o===void 0&&(o=0);let n=t===void 0?0:t*o*(1-o),l=Math.cos(e),i=Math.sin(e);return a.r=o+n*(De[0]*l+De[1]*i),a.g=o+n*(De[2]*l+De[3]*i),a.b=o+n*(De[4]*l+De[5]*i),r!==void 0&&(a.alpha=r),a},S9=ud;var lt=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let o=Le(e.h),r=Le(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*a},R9=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let o=Le(e.h),r=Le(t.h);return Math.abs(r-o)>180?o-(r-360*Math.sign(r-o)):r-o},it=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let o=Le(e.h),r=Le(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*a};var Ne=e=>{let t=e.reduce((r,a)=>{if(a!==void 0){let n=a*Math.PI/180;r.sin+=Math.sin(n),r.cos+=Math.cos(n)}return r},{sin:0,cos:0}),o=Math.atan2(t.sin,t.cos)*180/Math.PI;return o<0?360+o:o};var dd={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:M9},toMode:{rgb:S9},interpolate:{h:{use:B,fixup:$e},s:B,l:B,alpha:{use:B,fixup:ce}},difference:{h:lt},average:{h:Ne}},H9=dd;var cd=({l:e,a:t,b:o,alpha:r},a="lch")=>{t===void 0&&(t=0),o===void 0&&(o=0);let n=Math.sqrt(t*t+o*o),l={mode:a,l:e,c:n};return n&&(l.h=Le(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},u1=cd;var fd=({l:e,c:t,h:o,alpha:r},a="lab")=>{o===void 0&&(o=0);let n={mode:a,l:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(n.alpha=r),n},d1=fd;var nr=Math.pow(29,3)/Math.pow(3,3),lr=Math.pow(6,3)/Math.pow(29,3);var ke={X:.9642956764295677,Y:1,Z:.8251046025104602},st={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},sp=Math.pow(29,3)/Math.pow(3,3),up=Math.pow(6,3)/Math.pow(29,3);var Aa=e=>Math.pow(e,3)>lr?Math.pow(e,3):(116*e-16)/nr,pd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz65",x:Aa(n)*st.X,y:Aa(a)*st.Y,z:Aa(l)*st.Z};return r!==void 0&&(i.alpha=r),i},ir=pd;var Cd=e=>r1(ir(e)),ut=Cd;var Za=e=>e>lr?Math.cbrt(e):(nr*e+16)/116,md=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Za(e/st.X),n=Za(t/st.Y),l=Za(o/st.Z),i={mode:"lab65",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},sr=md;var gd=e=>{let t=sr(o1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},dt=gd;var Rt=.14444444444444443*Math.PI,Ft=Math.cos(Rt),$t=Math.sin(Rt),ur=100/Math.log(139/100);var hd=({l:e,c:t,h:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"lab65",l:(Math.exp(e*1/ur)-1)/.0039},n=(Math.exp(.0435*t*1*1)-1)/.075,l=n*Math.cos(o/180*Math.PI-Rt),i=n*Math.sin(o/180*Math.PI-Rt);return a.a=l*Ft-i/.83*$t,a.b=l*$t+i/.83*Ft,r!==void 0&&(a.alpha=r),a},ho=hd;var vd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=t*Ft+o*$t,n=.83*(o*Ft-t*$t),l=Math.sqrt(a*a+n*n),i={mode:"dlch",l:ur/1*Math.log(1+.0039*e),c:Math.log(1+.075*l)/(.0435*1*1)};return i.c&&(i.h=Le((Math.atan2(n,a)+Rt)/Math.PI*180)),r!==void 0&&(i.alpha=r),i},vo=vd;var k9=e=>ho(u1(e,"dlch")),P9=e=>d1(vo(e),"dlab"),xd={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:k9,rgb:e=>ut(k9(e))},fromMode:{lab65:P9,rgb:e=>P9(dt(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:B,a:B,b:B,alpha:{use:B,fixup:ce}}},T9=xd;var Ld={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:ho,dlab:e=>d1(e,"dlab"),rgb:e=>ut(ho(e))},fromMode:{lab65:vo,dlab:e=>u1(e,"dlch"),rgb:e=>vo(dt(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:B,c:B,h:{use:B,fixup:$e},alpha:{use:B,fixup:ce}},difference:{h:it},average:{h:Ne}},V9=Ld;function $a({h:e,s:t,i:o,alpha:r}){e=Le(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1-t)};break;case 1:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1+t*(3/(2-a)-1)),b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o*(1+t*(3/(2-a)-1)),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;case 3:n={r:o*(1-t),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1+t*(3/(2-a)-1))};break;case 4:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3/(2-a)-1))};break;case 5:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function Na({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsi",s:e+t+o===0?0:1-3*n/(e+t+o),i:(e+t+o)/3};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var wd={mode:"hsi",toMode:{rgb:$a},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Na},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:B,fixup:$e},s:B,i:B,alpha:{use:B,fixup:ce}},difference:{h:lt},average:{h:Ne}},_9=wd;function Ua({h:e,s:t,l:o,alpha:r}){e=Le(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=o+t*(o<.5?o:1-o),n=a-(a-o)*2*Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:a,g:n,b:2*o-a};break;case 1:l={r:n,g:a,b:2*o-a};break;case 2:l={r:2*o-a,g:a,b:n};break;case 3:l={r:2*o-a,g:n,b:a};break;case 4:l={r:n,g:2*o-a,b:a};break;case 5:l={r:a,g:2*o-a,b:n};break;default:l={r:2*o-a,g:2*o-a,b:2*o-a}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function qa({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsl",s:a===n?0:(a-n)/(1-Math.abs(a+n-1)),l:.5*(a+n)};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var bd=(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}},E9=bd;var Id=new RegExp(`^hsla?\\(\\s*${c9}${nt}${Mt}${nt}${Mt}\\s*(?:,\\s*${po}\\s*)?\\)$`),yd=e=>{let t=e.match(Id);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=E9(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},D9=yd;function Md(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let o={mode:"hsl"},[,r,a,n,l]=t;if(r.type!==_.None){if(r.type===_.Percentage)return;o.h=r.value}if(a.type!==_.None){if(a.type===_.Hue)return;o.s=a.value/100}if(n.type!==_.None){if(n.type===_.Hue)return;o.l=n.value/100}return l.type!==_.None&&(o.alpha=Math.min(1,Math.max(0,l.type===_.Number?l.value:l.value/100))),o}var O9=Md;var Sd={mode:"hsl",toMode:{rgb:Ua},fromMode:{rgb:qa},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[O9,D9],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:B,fixup:$e},s:B,l:B,alpha:{use:B,fixup:ce}},difference:{h:lt},average:{h:Ne}},dr=Sd;function xo({h:e,s:t,v:o,alpha:r}){e=Le(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o,g:o*(1-t*a),b:o*(1-t)};break;case 1:n={r:o*(1-t*a),g:o,b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o,b:o*(1-t*a)};break;case 3:n={r:o*(1-t),g:o*(1-t*a),b:o};break;case 4:n={r:o*(1-t*a),g:o*(1-t),b:o};break;case 5:n={r:o,g:o*(1-t),b:o*(1-t*a)};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function Lo({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsv",s:a===0?0:1-n/a,v:a};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Rd={mode:"hsv",toMode:{rgb:xo},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:Lo},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:B,fixup:$e},s:B,v:B,alpha:{use:B,fixup:ce}},difference:{h:lt},average:{h:Ne}},cr=Rd;function za({h:e,w:t,b:o,alpha:r}){if(t===void 0&&(t=0),o===void 0&&(o=0),t+o>1){let a=t+o;t/=a,o/=a}return xo({h:e,s:o===1?1:1-t/(1-o),v:1-o,alpha:r})}function ja(e){let t=Lo(e);if(t===void 0)return;let o=t.s!==void 0?t.s:0,r=t.v!==void 0?t.v:0,a={mode:"hwb",w:(1-o)*r,b:1-r};return t.h!==void 0&&(a.h=t.h),t.alpha!==void 0&&(a.alpha=t.alpha),a}function Hd(e,t){if(!t||t[0]!=="hwb")return;let o={mode:"hwb"},[,r,a,n,l]=t;if(r.type!==_.None){if(r.type===_.Percentage)return;o.h=r.value}if(a.type!==_.None){if(a.type===_.Hue)return;o.w=a.value/100}if(n.type!==_.None){if(n.type===_.Hue)return;o.b=n.value/100}return l.type!==_.None&&(o.alpha=Math.min(1,Math.max(0,l.type===_.Number?l.value:l.value/100))),o}var B9=Hd;var kd={mode:"hwb",toMode:{rgb:za},fromMode:{rgb:ja},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[B9],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:B,fixup:$e},w:B,b:B,alpha:{use:B,fixup:ce}},difference:{h:R9},average:{h:Ne}},A9=kd;var Nt=.1593017578125,Z9=78.84375,Ut=.8359375,qt=18.8515625,zt=18.6875;function fr(e){if(e<0)return 0;let t=Math.pow(e,1/Z9);return 1e4*Math.pow(Math.max(0,t-Ut)/(qt-zt*t),1/Nt)}function pr(e){if(e<0)return 0;let t=Math.pow(e/1e4,Nt);return Math.pow((Ut+qt*t)/(1+zt*t),Z9)}var Ka=e=>Math.max(e/203,0),Td=({i:e,t,p:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=fr(e+.008609037037932761*t+.11102962500302593*o),n=fr(e-.00860903703793275*t-.11102962500302599*o),l=fr(e+.5600313357106791*t-.32062717498731885*o),i={mode:"xyz65",x:Ka(2.070152218389422*a-1.3263473389671556*n+.2066510476294051*l),y:Ka(.3647385209748074*a+.680566024947227*n-.0453045459220346*l),z:Ka(-.049747207535812*a-.0492609666966138*n+1.1880659249923042*l)};return r!==void 0&&(i.alpha=r),i},Ga=Td;var Wa=(e=0)=>Math.max(e*203,0),Vd=({x:e,y:t,z:o,alpha:r})=>{let a=Wa(e),n=Wa(t),l=Wa(o),i=pr(.3592832590121217*a+.6976051147779502*n-.0358915932320289*l),s=pr(-.1920808463704995*a+1.1004767970374323*n+.0753748658519118*l),u=pr(.0070797844607477*a+.0748396662186366*n+.8433265453898765*l),d=.5*i+.5*s,c=1.61376953125*i-3.323486328125*s+1.709716796875*u,C=4.378173828125*i-4.24560546875*s-.132568359375*u,m={mode:"itp",i:d,t:c,p:C};return r!==void 0&&(m.alpha=r),m},Xa=Vd;var _d={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Ga,rgb:e=>r1(Ga(e))},fromMode:{xyz65:Xa,rgb:e=>Xa(o1(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:B,t:B,p:B,alpha:{use:B,fixup:ce}}},F9=_d;var Ed=134.03437499999998,Dd=16295499532821565e-27,Qa=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,Nt);return Math.pow((Ut+qt*t)/(1+zt*t),Ed)},Ya=(e=0)=>Math.max(e*203,0),Od=({x:e,y:t,z:o,alpha:r})=>{e=Ya(e),t=Ya(t),o=Ya(o);let a=1.15*e-.15*o,n=.66*t+.34*e,l=Qa(.41478972*a+.579999*n+.014648*o),i=Qa(-.20151*a+1.120649*n+.0531008*o),s=Qa(-.0166008*a+.2648*n+.6684799*o),u=(l+i)/2,d={mode:"jab",j:.44*u/(1-.56*u)-Dd,a:3.524*l-4.066708*i+.542708*s,b:.199076*l+1.096799*i-1.295875*s};return r!==void 0&&(d.alpha=r),d},Cr=Od;var Bd=134.03437499999998,$9=16295499532821565e-27,Ja=e=>{if(e<0)return 0;let t=Math.pow(e,1/Bd);return 1e4*Math.pow((Ut-t)/(zt*t-qt),1/Nt)},en=e=>e/203,Ad=({j:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+$9)/(.44+.56*(e+$9)),n=Ja(a+.13860504*t+.058047316*o),l=Ja(a-.13860504*t-.058047316*o),i=Ja(a-.096019242*t-.8118919*o),s={mode:"xyz65",x:en(1.661373024652174*n-.914523081304348*l+.23136208173913045*i),y:en(-.3250758611844533*n+1.571847026732543*l-.21825383453227928*i),z:en(-.090982811*n-.31272829*l+1.5227666*i)};return r!==void 0&&(s.alpha=r),s},mr=Ad;var Zd=e=>{let t=Cr(o1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},gr=Zd;var Fd=e=>r1(mr(e)),hr=Fd;var $d={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:gr,xyz65:Cr},toMode:{rgb:hr,xyz65:mr},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:B,a:B,b:B,alpha:{use:B,fixup:ce}}},N9=$d;var Nd=({j:e,a:t,b:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"jch",j:e,c:a};return a&&(n.h=Le(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},tn=Nd;var Ud=({j:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={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 r!==void 0&&(a.alpha=r),a},on=Ud;var qd={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:on,rgb:e=>hr(on(e))},fromMode:{rgb:e=>tn(gr(e)),jab:tn},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:B,fixup:$e},c:B,j:B,alpha:{use:B,fixup:ce}},difference:{h:it},average:{h:Ne}},U9=qd;var ct=Math.pow(29,3)/Math.pow(3,3),jt=Math.pow(6,3)/Math.pow(29,3);var rn=e=>Math.pow(e,3)>jt?Math.pow(e,3):(116*e-16)/ct,zd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz50",x:rn(n)*ke.X,y:rn(a)*ke.Y,z:rn(l)*ke.Z};return r!==void 0&&(i.alpha=r),i},Kt=zd;var jd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=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 r!==void 0&&(a.alpha=r),a},S1=jd;var Kd=e=>S1(Kt(e)),vr=Kd;var Gd=e=>{let{r:t,g:o,b:r,alpha:a}=p1(e),n={mode:"xyz50",x:.436065742824811*t+.3851514688337912*o+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*o+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*o+.7140993584005155*r};return a!==void 0&&(n.alpha=a),n},R1=Gd;var an=e=>e>jt?Math.cbrt(e):(ct*e+16)/116,Wd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=an(e/ke.X),n=an(t/ke.Y),l=an(o/ke.Z),i={mode:"lab",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},Gt=Wd;var Xd=e=>{let t=Gt(R1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},xr=Xd;function Qd(e,t){if(!t||t[0]!=="lab")return;let o={mode:"lab"},[,r,a,n,l]=t;if(!(r.type===_.Hue||a.type===_.Hue||n.type===_.Hue))return r.type!==_.None&&(o.l=Math.min(Math.max(0,r.value),100)),a.type!==_.None&&(o.a=a.type===_.Number?a.value:a.value*125/100),n.type!==_.None&&(o.b=n.type===_.Number?n.value:n.value*125/100),l.type!==_.None&&(o.alpha=Math.min(1,Math.max(0,l.type===_.Number?l.value:l.value/100))),o}var q9=Qd;var Yd={mode:"lab",toMode:{xyz50:Kt,rgb:vr},fromMode:{xyz50:Gt,rgb:xr},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[q9],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:B,a:B,b:B,alpha:{use:B,fixup:ce}}},Wt=Yd;var Jd={...Wt,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:ir,rgb:ut},fromMode:{xyz65:sr,rgb:dt},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},z9=Jd;function e3(e,t){if(!t||t[0]!=="lch")return;let o={mode:"lch"},[,r,a,n,l]=t;if(r.type!==_.None){if(r.type===_.Hue)return;o.l=Math.min(Math.max(0,r.value),100)}if(a.type!==_.None&&(o.c=Math.max(0,a.type===_.Number?a.value:a.value*150/100)),n.type!==_.None){if(n.type===_.Percentage)return;o.h=n.value}return l.type!==_.None&&(o.alpha=Math.min(1,Math.max(0,l.type===_.Number?l.value:l.value/100))),o}var j9=e3;var t3={mode:"lch",toMode:{lab:d1,rgb:e=>vr(d1(e))},fromMode:{rgb:e=>u1(xr(e)),lab:u1},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[j9],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:B,fixup:$e},c:B,l:B,alpha:{use:B,fixup:ce}},difference:{h:it},average:{h:Ne}},Xt=t3;var o3={...Xt,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>d1(e,"lab65"),rgb:e=>ut(d1(e,"lab65"))},fromMode:{rgb:e=>u1(dt(e),"lch65"),lab65:e=>u1(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},K9=o3;var r3=({l:e,u:t,v:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"lchuv",l:e,c:a};return a&&(n.h=Le(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},nn=r3;var a3=({l:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={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 r!==void 0&&(a.alpha=r),a},ln=a3;var G9=(e,t,o)=>4*e/(e+15*t+3*o),W9=(e,t,o)=>9*t/(e+15*t+3*o),n3=G9(ke.X,ke.Y,ke.Z),l3=W9(ke.X,ke.Y,ke.Z),i3=e=>e<=jt?ct*e:116*Math.cbrt(e)-16,s3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=i3(t/ke.Y),n=G9(e,t,o),l=W9(e,t,o);!isFinite(n)||!isFinite(l)?a=n=l=0:(n=13*a*(n-n3),l=13*a*(l-l3));let i={mode:"luv",l:a,u:n,v:l};return r!==void 0&&(i.alpha=r),i},wo=s3;var u3=(e,t,o)=>4*e/(e+15*t+3*o),d3=(e,t,o)=>9*t/(e+15*t+3*o),c3=u3(ke.X,ke.Y,ke.Z),f3=d3(ke.X,ke.Y,ke.Z),p3=({l:e,u:t,v:o,alpha:r})=>{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 a=t/(13*e)+c3,n=o/(13*e)+f3,l=ke.Y*(e<=8?e/ct:Math.pow((e+16)/116,3)),i=l*(9*a)/(4*n),s=l*(12-3*a-20*n)/(4*n),u={mode:"xyz50",x:i,y:l,z:s};return r!==void 0&&(u.alpha=r),u},bo=p3;var C3=e=>nn(wo(R1(e))),m3=e=>S1(bo(ln(e))),g3={mode:"lchuv",toMode:{luv:ln,rgb:m3},fromMode:{rgb:C3,luv:nn},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:B,fixup:$e},c:B,l:B,alpha:{use:B,fixup:ce}},difference:{h:it},average:{h:Ne}},X9=g3;var h3={...f1,mode:"lrgb",toMode:{rgb:C1},fromMode:{rgb:p1},parse:["srgb-linear"],serialize:"srgb-linear"},Q9=h3;var v3={mode:"luv",toMode:{xyz50:bo,rgb:e=>S1(bo(e))},fromMode:{xyz50:wo,rgb:e=>wo(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:B,u:B,v:B,alpha:{use:B,fixup:ce}}},Y9=v3;var x3=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*o),n=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*o),l=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*o),i={mode:"oklab",l:.210454268309314*a+.7936177747023054*n-.0040720430116193*l,a:1.9779985324311684*a-2.42859224204858*n+.450593709617411*l,b:.0259040424655478*a+.7827717124575296*n-.8086757549230774*l};return r!==void 0&&(i.alpha=r),i},Lr=x3;var L3=e=>{let t=Lr(p1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ft=L3;var w3=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.pow(e+.3963377773761749*t+.2158037573099136*o,3),n=Math.pow(e-.1055613458156586*t-.0638541728258133*o,3),l=Math.pow(e-.0894841775298119*t-1.2914855480194092*o,3),i={mode:"lrgb",r:4.076741636075957*a-3.3077115392580616*n+.2309699031821044*l,g:-1.2684379732850317*a+2.6097573492876887*n-.3413193760026573*l,b:-.0041960761386756*a-.7034186179359362*n+1.7076146940746117*l};return r!==void 0&&(i.alpha=r),i},H1=w3;var b3=e=>C1(H1(e)),pt=b3;function Io(e){let r=1.170873786407767;return .5*(r*e-.206+Math.sqrt((r*e-.206)*(r*e-.206)+4*.03*r*e))}function Ht(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function I3(e,t){let o,r,a,n,l,i,s,u;-1.88170328*e-.80936493*t>1?(o=1.19086277,r=1.76576728,a=.59662641,n=.75515197,l=.56771245,i=4.0767416621,s=-3.3077115913,u=.2309699292):1.81444104*e-1.19445276*t>1?(o=.73956515,r=-.45954404,a=.08285427,n=.1254107,l=.14503204,i=-1.2684380046,s=2.6097574011,u=-.3413193965):(o=1.35733652,r=-.00915799,a=-1.1513021,n=-.50559606,l=.00692167,i=-.0041960863,s=-.7034186147,u=1.707614701);let d=o+r*e+a*t+n*e*e+l*e*t,c=.3963377774*e+.2158037573*t,C=-.1055613458*e-.0638541728*t,m=-.0894841775*e-1.291485548*t;{let f=1+d*c,S=1+d*C,L=1+d*m,I=f*f*f,v=S*S*S,b=L*L*L,y=3*c*f*f,H=3*C*S*S,$=3*m*L*L,D=6*c*c*f,w=6*C*C*S,E=6*m*m*L,M=i*I+s*v+u*b,P=i*y+s*H+u*$,K=i*D+s*w+u*E;d=d-M*P/(P*P-.5*M*K)}return d}function sn(e,t){let o=I3(e,t),r=H1({l:1,a:o*e,b:o*t}),a=Math.cbrt(1/Math.max(r.r,r.g,r.b)),n=a*o;return[a,n]}function y3(e,t,o,r,a,n=null){n||(n=sn(e,t));let l;if((o-a)*n[1]-(n[0]-a)*r<=0)l=n[1]*a/(r*n[0]+n[1]*(a-o));else{l=n[1]*(a-1)/(r*(n[0]-1)+n[1]*(a-o));{let i=o-a,s=r,u=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,c=-.0894841775*e-1.291485548*t,C=i+s*u,m=i+s*d,f=i+s*c;{let S=a*(1-l)+l*o,L=l*r,I=S+L*u,v=S+L*d,b=S+L*c,y=I*I*I,H=v*v*v,$=b*b*b,D=3*C*I*I,w=3*m*v*v,E=3*f*b*b,M=6*C*C*I,P=6*m*m*v,K=6*f*f*b,W=4.0767416621*y-3.3077115913*H+.2309699292*$-1,Q=4.0767416621*D-3.3077115913*w+.2309699292*E,te=4.0767416621*M-3.3077115913*P+.2309699292*K,z=Q/(Q*Q-.5*W*te),T=-W*z,A=-1.2684380046*y+2.6097574011*H-.3413193965*$-1,F=-1.2684380046*D+2.6097574011*w-.3413193965*E,x=-1.2684380046*M+2.6097574011*P-.3413193965*K,j=F/(F*F-.5*A*x),N=-A*j,X=-.0041960863*y-.7034186147*H+1.707614701*$-1,g=-.0041960863*D-.7034186147*w+1.707614701*E,O=-.0041960863*M-.7034186147*P+1.707614701*K,V=g/(g*g-.5*X*O),p=-X*V;T=z>=0?T:1e6,N=j>=0?N:1e6,p=V>=0?p:1e6,l+=Math.min(T,Math.min(N,p))}}}return l}function yo(e,t,o=null){o||(o=sn(e,t));let r=o[0],a=o[1];return[a/r,a/(1-r)]}function wr(e,t,o){let r=sn(t,o),a=y3(t,o,e,1,e,r),n=yo(t,o,r),l=.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=a/Math.min(e*n[0],(1-e)*n[1]),u=e*l,d=(1-e)*i,c=.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))),c,a]}function br(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a={mode:"okhsl",l:Io(t)};e.alpha!==void 0&&(a.alpha=e.alpha);let n=Math.sqrt(o*o+r*r);if(!n)return a.s=0,a;let[l,i,s]=wr(t,o/n,r/n),u;if(n<i){let d=0,c=.8*l,C=1-c/i;u=(n-d)/(c+C*(n-d))*.8}else{let d=i,c=.2*i*i*1.25*1.25/l,C=1-c/(s-i);u=.8+.2*((n-d)/(c+C*(n-d)))}return u&&(a.s=u,a.h=Le(Math.atan2(r,o)*180/Math.PI)),a}function Ir(e){let t=e.h!==void 0?e.h:0,o=e.s!==void 0?e.s:0,r=e.l!==void 0?e.l:0,a={mode:"oklab",l:Ht(r)};if(e.alpha!==void 0&&(a.alpha=e.alpha),!o||r===1)return a.a=a.b=0,a;let n=Math.cos(t/180*Math.PI),l=Math.sin(t/180*Math.PI),[i,s,u]=wr(a.l,n,l),d,c,C,m;o<.8?(d=1.25*o,c=0,C=.8*i,m=1-C/s):(d=5*(o-.8),c=s,C=.2*s*s*1.25*1.25/i,m=1-C/(u-s));let f=c+d*C/(1-m*d);return a.a=f*n,a.b=f*l,a}var M3={...dr,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:br,rgb:e=>br(ft(e))},toMode:{oklab:Ir,rgb:e=>pt(Ir(e))}},J9=M3;function yr(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a=Math.sqrt(o*o+r*r),n=a?o/a:1,l=a?r/a:1,[i,s]=yo(n,l),u=.5,d=1-u/i,c=s/(a+t*s),C=c*t,m=c*a,f=Ht(C),S=m*f/C,L=H1({l:f,a:n*S,b:l*S}),I=Math.cbrt(1/Math.max(L.r,L.g,L.b,0));t=t/I,a=a/I*Io(t)/t,t=Io(t);let v={mode:"okhsv",s:a?(u+s)*m/(s*u+s*d*m):0,v:t?t/C:0};return v.s&&(v.h=Le(Math.atan2(r,o)*180/Math.PI)),e.alpha!==void 0&&(v.alpha=e.alpha),v}function Mr(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let o=e.h!==void 0?e.h:0,r=e.s!==void 0?e.s:0,a=e.v!==void 0?e.v:0,n=Math.cos(o/180*Math.PI),l=Math.sin(o/180*Math.PI),[i,s]=yo(n,l),u=.5,d=1-u/i,c=1-r*u/(u+s-s*d*r),C=r*s*u/(u+s-s*d*r),m=Ht(c),f=C*m/c,S=H1({l:m,a:n*f,b:l*f}),L=Math.cbrt(1/Math.max(S.r,S.g,S.b,0)),I=Ht(a*c),v=C*I/c;return t.l=I*L,t.a=v*n*L,t.b=v*l*L,t}var S3={...cr,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:yr,rgb:e=>yr(ft(e))},toMode:{oklab:Mr,rgb:e=>pt(Mr(e))}},e0=S3;function R3(e,t){if(!t||t[0]!=="oklab")return;let o={mode:"oklab"},[,r,a,n,l]=t;if(!(r.type===_.Hue||a.type===_.Hue||n.type===_.Hue))return r.type!==_.None&&(o.l=Math.min(Math.max(0,r.type===_.Number?r.value:r.value/100),1)),a.type!==_.None&&(o.a=a.type===_.Number?a.value:a.value*.4/100),n.type!==_.None&&(o.b=n.type===_.Number?n.value:n.value*.4/100),l.type!==_.None&&(o.alpha=Math.min(1,Math.max(0,l.type===_.Number?l.value:l.value/100))),o}var t0=R3;var H3={...Wt,mode:"oklab",toMode:{lrgb:H1,rgb:pt},fromMode:{lrgb:Lr,rgb:ft},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[t0],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}`:""})`},o0=H3;function k3(e,t){if(!t||t[0]!=="oklch")return;let o={mode:"oklch"},[,r,a,n,l]=t;if(r.type!==_.None){if(r.type===_.Hue)return;o.l=Math.min(Math.max(0,r.type===_.Number?r.value:r.value/100),1)}if(a.type!==_.None&&(o.c=Math.max(0,a.type===_.Number?a.value:a.value*.4/100)),n.type!==_.None){if(n.type===_.Percentage)return;o.h=n.value}return l.type!==_.None&&(o.alpha=Math.min(1,Math.max(0,l.type===_.Number?l.value:l.value/100))),o}var r0=k3;var P3={...Xt,mode:"oklch",toMode:{oklab:e=>d1(e,"oklab"),rgb:e=>pt(d1(e,"oklab"))},fromMode:{rgb:e=>u1(ft(e),"oklch"),oklab:e=>u1(e,"oklch")},parse:[r0],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]}},a0=P3;var T3=e=>{let{r:t,g:o,b:r,alpha:a}=p1(e),n={mode:"xyz65",x:.486570948648216*t+.265667693169093*o+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*o+.079286914093745*r,z:0*t+.0451133818589026*o+1.043944368900976*r};return a!==void 0&&(n.alpha=a),n},un=T3;var V3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=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 r!==void 0&&(a.alpha=r),a},dn=V3;var _3={...f1,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>dn(o1(e)),xyz65:dn},toMode:{rgb:e=>r1(un(e)),xyz65:un}},n0=_3;var cn=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},E3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"prophoto",r:cn(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*o),g:cn(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*o),b:cn(e*0+t*0+1.2119675456389452*o)};return r!==void 0&&(a.alpha=r),a},fn=E3;var pn=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},D3=e=>{let t=pn(e.r),o=pn(e.g),r=pn(e.b),a={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*o+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*o+899369387256e-16*r,z:0*t+0*o+.8251046025104602*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},Cn=D3;var O3={...f1,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:fn,rgb:e=>fn(R1(e))},toMode:{xyz50:Cn,rgb:e=>S1(Cn(e))}},l0=O3;var i0=1.09929682680944,B3=.018053968510807,mn=e=>{let t=Math.abs(e);return t>B3?(Math.sign(e)||1)*(i0*Math.pow(t,.45)-(i0-1)):4.5*e},A3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rec2020",r:mn(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*o),g:mn(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*o),b:mn(e*.0176398574453108-t*.0427706132578085+.9421031212354739*o)};return r!==void 0&&(a.alpha=r),a},gn=A3;var s0=1.09929682680944,Z3=.018053968510807,hn=(e=0)=>{let t=Math.abs(e);return t<Z3*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+s0-1)/s0,1/.45)},F3=e=>{let t=hn(e.r),o=hn(e.g),r=hn(e.b),a={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*o+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*o+.059301716469862*r,z:0*t+.0280726930490874*o+1.0609850577107909*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},vn=F3;var $3={...f1,mode:"rec2020",fromMode:{xyz65:gn,rgb:e=>gn(o1(e))},toMode:{xyz65:vn,rgb:e=>r1(vn(e))},parse:["rec2020"],serialize:"rec2020"},u0=$3;var F1=.0037930732552754493,Sr=Math.cbrt(F1);var xn=e=>Math.cbrt(e)-Sr,N3=e=>{let{r:t,g:o,b:r,alpha:a}=p1(e),n=xn(.3*t+.622*o+.078*r+F1),l=xn(.23*t+.692*o+.078*r+F1),i=xn(.2434226892454782*t+.2047674442449682*o+.5518098665095535*r+F1),s={mode:"xyb",x:(n-l)/2,y:(n+l)/2,b:i-(n+l)/2};return a!==void 0&&(s.alpha=a),s},d0=N3;var Ln=e=>Math.pow(e+Sr,3),U3=({x:e,y:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Ln(e+t)-F1,n=Ln(t-e)-F1,l=Ln(o+t)-F1,i=C1({r:11.031566904639861*a-9.866943908131562*n-.16462299650829934*l,g:-3.2541473810744237*a+4.418770377582723*n-.16462299650829934*l,b:-3.6588512867136815*a+2.7129230459360922*n+1.9459282407775895*l});return r!==void 0&&(i.alpha=r),i},c0=U3;var q3={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:c0},fromMode:{rgb:d0},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:B,y:B,b:B,alpha:{use:B,fixup:ce}}},f0=q3;var z3={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:S1,lab:Gt},fromMode:{rgb:R1,lab:Kt},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:B,y:B,z:B,alpha:{use:B,fixup:ce}}},p0=z3;var j3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*o-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*o-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*o+.7518742899580008*r};return a!==void 0&&(n.alpha=a),n},C0=j3;var K3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*o+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*o+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*o+1.3303659366080753*r};return a!==void 0&&(n.alpha=a),n},m0=K3;var G3={mode:"xyz65",toMode:{rgb:r1,xyz50:C0},fromMode:{rgb:o1,xyz50:m0},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:B,y:B,z:B,alpha:{use:B,fixup:ce}}},g0=G3;var W3=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*o,i:.59597799*e-.2741761*t-.32180189*o,q:.21147017*e-.52261711*t+.31114694*o};return r!==void 0&&(a.alpha=r),a},h0=W3;var X3=({y:e,i:t,q:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rgb",r:e+.95608445*t+.6208885*o,g:e-.27137664*t-.6486059*o,b:e-1.10561724*t+1.70250126*o};return r!==void 0&&(a.alpha=r),a},v0=X3;var Q3={mode:"yiq",toMode:{rgb:v0},fromMode:{rgb:h0},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:B,i:B,q:B,alpha:{use:B,fixup:ce}}},x0=Q3;var Y3=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,J3=(e=4)=>t=>typeof t=="number"?Y3(t,e):t,Mo=J3;var Sx=Mo(2);var Rx=s1("rgb"),Hx=s1("hsl");var wn=e=>{let t=er(e);if(!t)return;let o=tr(t.mode);if(!o.serialize||typeof o.serialize=="string"){let r=`color(${o.serialize||`--${t.mode}`} `;return o.channels.forEach((a,n)=>{a!=="alpha"&&(r+=(n?" ":"")+(t[a]!==void 0?t[a]:"none"))}),t.alpha!==void 0&&t.alpha<1&&(r+=` / ${t.alpha}`),r+")"}if(typeof o.serialize=="function")return o.serialize(t)};var mL=ge(x9),gL=ge(H9),hL=ge(T9),vL=ge(V9),xL=ge(_9),LL=ge(dr),wL=ge(cr),bL=ge(A9),IL=ge(F9),yL=ge(N9),ML=ge(U9),SL=ge(Wt),RL=ge(z9),HL=ge(Xt),kL=ge(K9),PL=ge(X9),TL=ge(Q9),VL=ge(Y9),_L=ge(J9),EL=ge(e0),DL=ge(o0),OL=ge(a0),BL=ge(n0),AL=ge(l0),ZL=ge(u0),FL=ge(f1),$L=ge(f0),NL=ge(p0),UL=ge(g0),qL=ge(x0);var In=s1("rgb"),e7=s1("hsl"),t7=s1("oklch"),o7=s1("oklab"),r7=s1("lch"),a7=s1("lab"),n7=Mo(3),bn=null;function l7(){return bn??(bn=document.createElement("canvas").getContext("2d")),bn}function L0(e){try{let t=l7();if(!t)return null;t.fillStyle="#000000",t.fillStyle=e;let o=t.fillStyle;t.fillStyle="#ffffff",t.fillStyle=e;let r=t.fillStyle;return o===r?o:null}catch{return null}}function w0(e){if(!e||typeof e!="string")return!1;let t=e.trim();return St(t)!==void 0?!0:L0(t)!==null}function Ct(e){let t={r:255,g:255,b:255,a:1};if(!e||typeof e!="string")return t;let o=e.trim(),r=St(o);if(r){let n=In(r);if(n&&"r"in n&&"g"in n&&"b"in n)return{r:Math.round(Math.min(255,Math.max(0,n.r*255))),g:Math.round(Math.min(255,Math.max(0,n.g*255))),b:Math.round(Math.min(255,Math.max(0,n.b*255))),a:n.alpha??1}}let a=L0(o);if(a){if(a.startsWith("#")){let l=a.slice(1);return{r:parseInt(l.slice(0,2),16),g:parseInt(l.slice(2,4),16),b:parseInt(l.slice(4,6),16),a:1}}let n=a.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(n&&n[1]!=null&&n[2]!=null&&n[3]!=null)return{r:+n[1],g:+n[2],b:+n[3],a:n[4]!=null?+n[4]:1}}return t}var i7=new Set(["initial","inherit","unset","revert","revert-layer"]);function Rr(e){return i7.has((e??"").trim().toLowerCase())}function b0(e){let t=(e??"").trim();if(t===""||Rr(t))return!1;let o=t.toLowerCase();return o!=="currentcolor"&&!o.includes("var(")}function Qt(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),r=Math.round(Math.min(255,Math.max(0,e.b))),a=Math.round(Math.min(1,Math.max(0,e.a))*100)/100;return a>=1?`rgb(${t}, ${o}, ${r})`:`rgba(${t}, ${o}, ${r}, ${a})`}function So(e){let t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]+$/.test(t)&&[3,4,6,8].includes(t.length)}function Ro(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),r=Math.round(Math.min(255,Math.max(0,e.b))),a=Math.min(1,Math.max(0,e.a)),n=`#${[t,o,r].map(l=>l.toString(16).padStart(2,"0")).join("")}`;return a<1?n+Math.round(a*255).toString(16).padStart(2,"0"):n}function I0(e){return!e||typeof e!="string"?"rgb":St(e.trim())?.mode??"rgb"}function a1(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 t7(o);case"oklab":return o7(o);case"lch":return r7(o);case"lab":return a7(o);default:return o}}function yn(e){let t=e?In(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 Mn(e){if(!e)return"";let t={...e},o=t;for(let r of Object.keys(o)){let a=o[r];typeof a=="number"&&(o[r]=n7(a))}return wn(t)}function Ho(e){let t={mode:"rgb",r:e.r/255,g:e.g/255,b:e.b/255},o=e7(t);return o?{h:o.h??0,s:o.s*100,l:o.l*100}:{h:0,s:0,l:0}}function Sn(e){let t={mode:"hsl",h:e.h,s:e.s/100,l:e.l/100},o=In(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)}}function Rn(e){let t=(e??"").trim();return t===""||t.toLowerCase()==="none"||Rr(t)?"":t}function $1(e){return Rn(e)!==""}function Hr(e){return(e??"").trim().toLowerCase()==="text"}function k1(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function y0(e,t,o){let r=k1(e),a=k1(t.toLowerCase());if(r.length===0||a.length===0)return"";let n=o.toLowerCase();return r.filter((l,i)=>a[i%a.length]===n&&$1(l)).join(", ")}function M0(e,t){let o=k1(e);if(o.length===0)return"";let r=k1(t.toLowerCase());return o.filter((a,n)=>(r.length===0||!Hr(r[n%r.length]))&&$1(a)).join(", ")}function Hn(e,t){let o=k1(t.toLowerCase());if(o.length===0)return!1;let r=k1(e).length||1;return Hr(o[(r-1)%o.length])}function S0(e,t,o,r){let a=k1(e);if(a.length===0)return"";let n=k1(t.toLowerCase());return n.length===0?r==="unchanged"?e:a.map(()=>"none").join(", "):a.map((l,i)=>o(n[i%n.length])?"none":l).join(", ")}function R0(e,t){return S0(e,t,Hr,"unchanged")}function H0(e,t){return S0(e,t,o=>!Hr(o),"clearAll")}function k0(e,t){let o=k1(t.toLowerCase());if(o.length===0)return t;let a=((k1(e).length||1)-1)%o.length;return o.map((n,l)=>l===a?"border-box":n).join(", ")}function kn(e,t,o=!1){let r=(e??"").trim();return r===""||Rr(r)||r.toLowerCase()==="currentcolor"?!1:o||t==null?!0:r.toLowerCase()!==t.trim().toLowerCase()}function P0(e,t,o,r,a=$1,n="none"){if(e.trim()==="")return[];let l=(r??"").trim();if(l.toLowerCase()===n.toLowerCase())return[];let i=l||(o??"");return a(i)?[{property:t,oldValue:i,newValue:n}]:[]}import{jsx as Ue,jsxs as P1}from"react/jsx-runtime";var Pn=16,Yt=4,u7=245,T0=260,d7=200,c7="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%)",f7=["oklch","oklab","lch","lab","hsl"],V0=["oklch","oklab","lch","lab"],Tn=["rgb","hsl","oklch","oklab","lch","lab"];function Vn(e){let t=I0(e);return f7.includes(t)?t:"rgb"}function ko(e,t){let o=Ho({r:e.r,g:e.g,b:e.b}),r=a1(e,"oklch"),a=a1(e,"oklab"),n=a1(e,"lch"),l=a1(e,"lab");return{hex:g7(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(r.l*100),oklch_c:Math.round(r.c*1e3)/10,oklch_h:Math.round(r.h||0),oklab_l:Math.round(a.l*100),oklab_a:Math.round(a.a*1e3)/10,oklab_b:Math.round(a.b*1e3)/10,lch_l:Math.round(n.l),lch_c:Math.round(n.c),lch_h:Math.round(n.h||0),lab_l:Math.round(l.l),lab_a:Math.round(l.a),lab_b:Math.round(l.b)}}function En(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 p7(e){let t=Z1(e);return t?t.getBoundingClientRect():{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}}function C7(e,t=u7){let o=e.getBoundingClientRect(),r=p7(e),a=r.bottom-o.bottom-Yt,n=o.top-r.top-Yt,i=a<t&&n>=t?o.top-t-Yt:o.bottom+Yt;i=Math.max(r.top+Yt,Math.min(i,r.bottom-t-Yt));let s=o.left;return s+T0>r.right&&(s=r.right-T0-Pn),s<r.left+Pn&&(s=r.left+Pn),{top:i,left:s}}function Dn(e){return e!=null&&typeof e=="string"?e:"#ffffff"}function _n(e){let{r:t,g:o,b:r,a}=Ct(Dn(e));return{type:"rgba",r:t,g:o,b:r,a}}function m7(e,t){let o=e||Qt(t);return t.a>=1?{backgroundColor:o}:{backgroundColor:o,backgroundImage:`linear-gradient(0deg, ${o}, ${o}), ${c7}`,backgroundSize:"100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:"0 0, 0 0, 0 4px, 4px -4px, -4px 0"}}function g7(e,t){let o=typeof e=="string"?e.trim():"";return So(o)?o:Ro(t)}var h7=e=>e.preventDefault(),v7=e=>{e.key==="Enter"&&e.currentTarget.blur()};function x7(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:r,b:a,a:n}=t,l=Ho({r:o,g:r,b:a}),i={r:o,g:r,b:a,a:n/100},s=a1(i,"oklch"),u=a1(i,"oklab"),d=a1(i,"lch"),c=a1(i,"lab");return{...e,hex:Ro(i),r:o,g:r,b:a,h:Math.round(l.h),s:Math.round(l.s),l:Math.round(l.l),a:n,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(c.l),lab_a:Math.round(c.a),lab_b:Math.round(c.b)}}case"SET_HEX":return{...e,hex:t.hex};case"SET_CHANNEL":{let o={...e,[t.channel]:t.value},r;if(e.format==="rgb")r={r:o.r,g:o.g,b:o.b,a:o.a/100};else if(e.format==="hsl"){let u=Sn({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),r={r:o.r,g:o.g,b:o.b,a:o.a/100}}else{let u=En(e.format,o);r=yn(u),o.r=r.r,o.g=r.g,o.b=r.b}let a=Ho({r:o.r,g:o.g,b:o.b}),n=a1(r,"oklch"),l=a1(r,"oklab"),i=a1(r,"lch"),s=a1(r,"lab");return{...o,hex:Ro(r),h:Math.round(a.h),s:Math.round(a.s),l:Math.round(a.l),oklch_l:Math.round(n.l*100),oklch_c:Math.round(n.c*1e3)/10,oklch_h:Math.round(n.h||0),oklab_l:Math.round(l.l*100),oklab_a:Math.round(l.a*1e3)/10,oklab_b:Math.round(l.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 L7={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 On({label:e,value:t,onChange:o,id:r="color",aria:a,backgroundImage:n}){let l=v1(L7,a),i=`${r}-trigger`,s=`${r}-popover`,u=Dn(t),[{colorInput:d,colorState:c},C]=n9(()=>_n(u)),[m,f]=Pe.useReducer(x7,u,h=>{let R=Ct(h),G=ko(R,h);return{format:Vn(h),...G}}),S=Pe.useRef(m);S.current=m;let L=Pe.useRef(null),I=Pe.useRef(t),v=Pe.useRef(o);v.current=o;let b=Pe.useCallback(h=>{let R=S.current.format,G;if(V0.includes(R)){let ee=a1(h,R);G=Mn(ee)}else if(R==="hsl"){let ee=Ho({r:h.r,g:h.g,b:h.b}),xe=Math.round(h.a*100)/100;G=xe>=1?`hsl(${Math.round(ee.h)}, ${Math.round(ee.s)}%, ${Math.round(ee.l)}%)`:`hsla(${Math.round(ee.h)}, ${Math.round(ee.s)}%, ${Math.round(ee.l)}%, ${xe})`}else G=Qt(h);G!==L.current&&(L.current=G,I.current=G,typeof v.current=="function"&&v.current(G))},[]),y=l9(b,d7),H=Yo({computePosition:C7,onClose:y.flush,trapFocus:!0});Pe.useEffect(()=>{let h=Dn(t);if(h===I.current)return;I.current=h;let R=Ct(h);C(_n(t));let G=ko(R,h),ee=Vn(h);f({type:"SET_ALL",...G}),ee!==S.current.format&&f({type:"SET_FORMAT",format:ee})},[t,C]);let $=Pe.useCallback(h=>{y.cancel();let R=h.target.value;if((!R||!R.startsWith("#"))&&(R="#"+R.replace(/^#+/,"")),So(R)){C({type:"hex",value:R});let G=Ct(R),ee=ko(G,R);f({type:"SET_ALL",...ee})}else f({type:"SET_HEX",hex:R})},[y,C]),D=Pe.useCallback(()=>{y.cancel();let h=S.current.hex.trim();if(So(h)){let R=Ct(h),G=ko(R,h);f({type:"SET_ALL",...G}),b(R)}else{let R=S.current;f({type:"SET_HEX",hex:Ro({r:R.r,g:R.g,b:R.b,a:R.a/100})})}},[y,b]),w=Pe.useMemo(()=>{switch(m.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}]}},[m.format]),E=Pe.useCallback((h,R)=>{y.cancel();let G=String(R).trim(),ee=["oklch_c","oklab_a","oklab_b"].includes(h),xe=G===""?0:ee?parseFloat(G):parseInt(G,10);if(Number.isNaN(xe))return;let he=S.current,ze=w.find(we=>we.key===h),Ie=0,ye=100;ze?(Ie=ze.min,ye=ze.max):h==="a"?(Ie=0,ye=100):h==="h"?(Ie=0,ye=360):he.format==="rgb"&&(Ie=0,ye=255);let Me=Math.min(ye,Math.max(Ie,xe));f({type:"SET_CHANNEL",channel:h,value:Me});let Ce={...he,[h]:Me},je;if(he.format==="rgb")je={r:Ce.r,g:Ce.g,b:Ce.b,a:Ce.a/100};else if(he.format==="hsl"){let we=Sn({h:Ce.h,s:Ce.s,l:Ce.l});je={r:we.r,g:we.g,b:we.b,a:Ce.a/100}}else{let we=En(he.format,Ce);je=yn(we)}C({type:"rgba",...je}),b(je)},[y,C,b,w]),M=Pe.useCallback(h=>{C(h);let R=h.getRgba();f({type:"SET_RGBA",r:Math.round(R.r),g:Math.round(R.g),b:Math.round(R.b),a:Math.round(R.a*100)}),y({r:R.r,g:R.g,b:R.b,a:R.a})},[C,y]),P=Pe.useCallback(h=>{let R=h.target.closest('[role="slider"]');R instanceof HTMLElement&&R.focus()},[]);Pe.useLayoutEffect(()=>{if(!H.isOpen||!H.popoverRef.current)return;let h=H.popoverRef.current.offsetHeight;h<=0||H.reposition(h)},[H.isOpen,H.reposition]);let K=c?.rgba??{r:255,g:255,b:255,a:1},W=c?.hsva??{h:0,s:0,v:100,a:1},Q=Math.round(W.s),te=Math.round(W.v);Pe.useEffect(()=>{let h=H.popoverRef.current;if(!H.isOpen||!h)return;let R=ee=>h.querySelector(`.${ee} [role="slider"]`)??null,G=R("colorEditor-picker-saturation");G&&(G.setAttribute("aria-label",e),G.setAttribute("aria-valuetext",Ve(l.ariaSaturation,[Q,te])),G.setAttribute("aria-valuenow",String(Q)),G.setAttribute("aria-valuemin","0"),G.setAttribute("aria-valuemax","100")),R("colorEditor-picker-hue")?.setAttribute("aria-label",l.ariaHue),R("colorEditor-picker-alpha")?.setAttribute("aria-label",l.ariaAlphaSlider)});let T=Pe.useCallback(()=>{let h=m.format,R=m.a/100;if(V0.includes(h)){let G=En(h,m);return Mn(G)}else return h==="hsl"?R>=1?`hsl(${m.h}, ${m.s}%, ${m.l}%)`:`hsla(${m.h}, ${m.s}%, ${m.l}%, ${R})`:Qt({r:m.r,g:m.g,b:m.b,a:R})},[m])(),A=Rn(n),F=A!==""&&K.a===0,x=/url\(/i.test(A)?l.imageValue:l.gradientValue,j=F?x:T,N=F?{backgroundImage:A,backgroundSize:"cover",backgroundPosition:"center"}:m7(T,K),[X,g]=Pe.useState(T),O=Pe.useRef(X);O.current=X,Pe.useEffect(()=>{g(T)},[T]);let V=Pe.useCallback(h=>{let R=h.target.value;g(R)},[]),p=Pe.useCallback(()=>{y.cancel();let h=O.current.trim();if(h&&!h.startsWith("#")&&So(h)&&(h="#"+h),!h||!w0(h)){g(T);return}let R=Ct(h),G=Qt(R),ee=Qt(Ct(T));if(G!==ee){C(_n(h));let xe=ko(R,h),he=Vn(h);f({type:"SET_ALL",...xe}),he!==S.current.format&&f({type:"SET_FORMAT",format:he}),h!==L.current&&(L.current=h,I.current=h,typeof v.current=="function"&&v.current(h))}else g(T)},[y,T,C]),Z=Pe.useCallback(h=>{h.key==="Enter"&&h.currentTarget.blur()},[]),U=Pe.useCallback(()=>{let h=Tn.indexOf(m.format),R=Tn[(h+1)%Tn.length]??m.format;f({type:"SET_FORMAT",format:R})},[m.format]),q=Pe.useMemo(()=>{let h=H.triggerRef.current;if(!h)return document.body;let R=h.getRootNode();return R instanceof ShadowRoot?R:document.body},[H.isOpen,H.triggerRef]);return Ue(c1,{label:e,id:r,className:"colorEditor-fieldset",children:P1("div",{className:"colorEditor-wrapper",children:[Ue("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":Ve(l.ariaOpenPicker,[e,j]),children:Ue("span",{style:N,"aria-hidden":"true",className:"colorEditor-swatch"})}),Ue("input",{type:"text",className:"colorEditor-value-input",value:F?j:X,readOnly:F,onChange:V,onBlur:p,onKeyDown:Z,"aria-label":Ve(l.ariaValue,[e]),placeholder:l.placeholder,spellCheck:"false",autoComplete:"off"}),H.isOpen&&s7(P1("div",{ref:H.popoverRef,id:s,role:"dialog","aria-modal":"true","aria-label":Ve(l.ariaPicker,[e]),style:{top:H.position.top,left:H.position.left},onDragStart:h7,onMouseUp:P,className:"colorEditor-popover",children:[P1(Zt,{color:d,onChange:M,className:"colorEditor-picker",children:[Ue(Zt.Saturation,{className:"colorEditor-picker-saturation"}),P1("div",{className:"colorEditor-picker-toolbar",children:[Ue(Zt.EyeDropper,{title:l.ariaEyedropper,children:Ue(uo,{size:18,"aria-hidden":"true"})}),P1("div",{className:"colorEditor-picker-sliders",children:[Ue(Zt.Hue,{className:"h-4 colorEditor-picker-hue"}),Ue(Zt.Alpha,{className:"h-4 colorEditor-picker-alpha"})]})]})]}),P1("div",{className:"colorEditor-input-wrapper",children:[P1("div",{className:"colorEditor-input-group",children:[Ue("input",{type:"text",value:m.hex,onChange:$,onBlur:D,onKeyDown:v7,"aria-label":l.ariaHex,className:"colorEditor-input-hex",spellCheck:"false",autoComplete:"off"}),Ue("label",{className:"colorEditor-input-label","aria-hidden":"true",children:"HEX"})]}),P1("div",{className:"colorEditor-channels-wrapper",children:[P1("div",{className:"colorEditor-input-container",children:[w.map(h=>Ue("div",{className:"colorEditor-input-group-no-label",children:Ue("input",{type:"number",min:h.min,max:h.max,step:h.step||1,value:m[h.key],onChange:R=>E(h.key,R.target.value),onBlur:R=>E(h.key,R.target.value),"aria-label":Ve(l.ariaChannel,[h.label,m.format.toUpperCase(),h.min,h.max]),"aria-valuemin":h.min,"aria-valuemax":h.max,"aria-valuenow":m[h.key],className:"colorEditor-input-rgba"})},h.key)),Ue("div",{className:"colorEditor-input-group-no-label",children:Ue("input",{type:"number",min:0,max:100,value:m.a,onChange:h=>E("a",h.target.value),onBlur:h=>E("a",h.target.value),"aria-label":l.ariaAlphaInput,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m.a,className:"colorEditor-input-rgba"})})]}),Ue("div",{className:"colorEditor-format-selector",children:P1("button",{type:"button",className:"colorEditor-format-picker",onClick:U,"aria-label":Ve(l.ariaFormatCycle,[m.format.toUpperCase()]),"aria-live":"polite",title:l.titleFormatCycle,children:[w.map(h=>Ue("span",{className:"colorEditor-format-letter","aria-hidden":"true",children:h.label},h.key)),Ue("span",{className:"colorEditor-format-letter","aria-hidden":"true",children:"A"})]})})]})]})]}),q)]})})}import We from"react";import{jsx as N1,jsxs as Bn}from"react/jsx-runtime";var w7={ariaValue:"{0} value",ariaActions:"{0} options",useNormalLineHeight:"Normal",useNormalSpacing:"Normal",useInherit:"Inherited",invalidRange:"Set a value between {0} and {1}."};function _0(e){let t=Z1(e)?.getBoundingClientRect();return{top:Math.max(0,t?.top??0),left:Math.max(0,t?.left??0),bottom:Math.min(window.innerHeight,t?.bottom??window.innerHeight),right:Math.min(window.innerWidth,t?.right??window.innerWidth)}}function kr({label:e,value:t,onChange:o,id:r="dimension",aria:a,unit:n,icon:l,constraints:i,presets:s,normalLabelKey:u,displayValue:d,measurement:c,resetVersion:C}){let m=v1(w7,a),f=u!==void 0,S=io(n,i),[L,I]=We.useState({}),v=Yo({restoreFocusOnOutside:!1,computePosition:(p,Z=200,U=76)=>{let q=p.getBoundingClientRect(),h=_0(p);U=Math.min(U,Math.max(0,h.bottom-h.top-8)),Z=Math.min(Z,Math.max(0,h.right-h.left-8));let R=q.bottom+U+4>h.bottom?q.top-U-4:q.bottom+4;return{top:Math.max(h.top+4,Math.min(R,h.bottom-U-4)),left:Math.max(h.left+4,Math.min(q.right-Z,h.right-Z-4))}}});We.useLayoutEffect(()=>{if(!v.isOpen||!v.popoverRef.current||!v.triggerRef.current)return;let p=_0(v.triggerRef.current);I({maxHeight:Math.max(0,p.bottom-p.top-8),maxWidth:Math.max(0,p.right-p.left-8)})},[v.isOpen]),We.useLayoutEffect(()=>{if(!v.isOpen||!v.popoverRef.current)return;let{width:p,height:Z}=v.popoverRef.current.getBoundingClientRect();v.reposition(p,Z)},[v.isOpen,v.reposition,L]);let[b,y]=We.useState(d),H=We.useRef(o);H.current=o;let $=We.useRef(t),D=We.useRef(!1),w=We.useRef(d),E=We.useRef(d),M=We.useRef(c),P=We.useRef(!1),K=We.useRef(C),[W,Q]=We.useState(!1),te=We.useRef(void 0),z=()=>{clearTimeout(te.current),te.current=void 0};We.useEffect(()=>()=>clearTimeout(te.current),[]),We.useEffect(()=>{let p=C!==K.current;K.current=C;let Z=t!==$.current,U=d!==E.current&&w.current===E.current||c!==M.current;E.current=d,M.current=c,$.current=t,p||(Z||U)&&!D.current?(z(),y(d),w.current=d,D.current=!1,P.current=!1,Q(!1)):U&&(P.current=!0)},[t,d,c,C]);let T=p=>t1(p)&&t1(w.current)&&Number(p)===Number(w.current),A=p=>{let Z=p.trim().toLowerCase();return!t1(Z)||T(Z)?!0:Number(Z)>=S.min&&Number(Z)<=S.max},F=p=>{z(),Q(!1),te.current=setTimeout(()=>{te.current=void 0,Q(!A(p))},300)},x=(p,Z=!1)=>{z();let U=P.current,q=p.trim().toLowerCase(),h=q==="inherit"||f&&q==="normal";if(!h&&!t1(q)){Q(!1),(U||$.current?.trim().toLowerCase()==="inherit")&&(w.current=d),P.current=!1,y(w.current),D.current=!1;return}if(!A(p)){Q(!0);return}if(Q(!1),P.current=!1,!Z&&(q===w.current||T(q))){U&&(w.current=d),y(w.current),D.current=!1;return}let R=q==="inherit"?d:h?q:String(Ca(Number(q),n,i)),G=R===w.current;if(D.current=!1,y(R),G&&!Z&&q!=="inherit")return;w.current=R;let ee=h?q:`${R}${n}`;ee!==$.current&&($.current=ee,H.current(ee))},j=p=>{if(p.key==="Enter"){D.current&&x(b),p.currentTarget.blur();return}if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault();let Z=b.trim().toLowerCase();if(!D.current&&t?.trim().toLowerCase()==="inherit"||Z==="inherit"||f&&Z==="normal")return;if(D.current&&!A(b)){z(),Q(!0);return}if(!t1(b.trim()))return;x(L2(b,p.key,p.shiftKey,n,i))}},N=`${r}-input`,X=p=>{let Z=t?.trim().toLowerCase()??"";if(!t1(p))return Z===p;let U=Z.match(b2);if(!U)return!1;let q=Number(U[1]);return Number.isFinite(q)&&q===Number(p)&&(U[2]===n||q===0)},g=[...u?[{label:m[u],value:"normal"}]:[],{label:m.useInherit,value:"inherit"}],O=s.map(p=>({label:String(p),value:String(p)})),V=p=>N1("button",{type:"button",role:"menuitemcheckbox","aria-checked":X(p.value),tabIndex:-1,onClick:()=>{x(p.value,!0),v.close()},children:p.label},p.value);return N1(c1,{label:e,id:r,className:"dimensionEditor-fieldset",children:Bn("div",{onBlur:p=>{p.relatedTarget instanceof Node&&p.currentTarget.contains(p.relatedTarget)||v.isOpen&&v.close(!1)},children:[Bn("div",{className:`dimensionEditor-row${W?" dimensionEditor-row--invalid":""}`,children:[N1("span",{className:"dimensionEditor-icon","aria-hidden":"true",children:N1(l,{size:14,width:14,height:14})}),N1("input",{id:N,type:"text",className:"dimensionEditor-input dimensionEditor-input--with-icon",value:b,onChange:p=>{y(p.target.value),D.current=!0,F(p.target.value)},onPaste:p=>{p.preventDefault();let Z=p.currentTarget,U=b.slice(0,Z.selectionStart??0)+p.clipboardData.getData("text")+b.slice(Z.selectionEnd??b.length);y(U),D.current=!0,F(U)},onBlur:()=>{D.current&&x(b)},onKeyDown:j,"aria-label":Ve(m.ariaValue,[e]),"aria-invalid":W||void 0,"aria-describedby":W?`${r}-error`:void 0,autoComplete:"off",spellCheck:"false"}),N1("button",{type:"button",className:"dimensionEditor-actions",ref:v.triggerRef,"aria-label":Ve(m.ariaActions,[e]),"aria-haspopup":"menu","aria-expanded":v.isOpen,"aria-controls":v.isOpen?`${r}-actions`:void 0,onClick:v.toggle,onKeyDown:p=>{(p.key==="ArrowDown"||p.key==="ArrowUp")&&(p.preventDefault(),v.open())},children:N1(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),v.isOpen&&Bn("div",{id:`${r}-actions`,role:"menu","aria-label":Ve(m.ariaActions,[e]),className:"dimensionEditor-menu",ref:v.popoverRef,style:{...L,top:v.position.top,left:v.position.left},onKeyDown:p=>{if(p.key==="Tab"){v.close();return}let Z=Array.from(p.currentTarget.querySelectorAll("button")),U=Z.indexOf(p.target),q;if(p.key==="Home")q=0;else if(p.key==="End")q=Z.length-1;else if(p.key==="ArrowDown")q=(U+1)%Z.length;else if(p.key==="ArrowUp")q=(U+Z.length-1)%Z.length;else return;p.preventDefault(),Z[q]?.focus()},children:[g.map(V),N1("div",{role:"separator"}),O.map(V)]}),W&&N1("span",{id:`${r}-error`,role:"alert",className:"dimensionEditor-error",children:Ve(m.invalidRange,[String(S.min),String(S.max)])})]})})}function n1(e,t){if(e==null)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;o[r]=e[r]}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 r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},ie.apply(null,arguments)}var re=l2($0(),1),R7=l2(z0(),1);import*as pe from"react";import{cloneElement as $w,Component as Nw,useRef as g1,useCallback as fe,useEffect as T1,useMemo as Jt}from"react";var j0=e=>typeof e=="object"&&e!=null&&e.nodeType===1,K0=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Fr=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let o=getComputedStyle(e,null);return K0(o.overflowY,t)||K0(o.overflowX,t)||(r=>{let a=(n=>{if(!n.ownerDocument||!n.ownerDocument.defaultView)return null;try{return n.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!a&&(a.clientHeight<r.scrollHeight||a.clientWidth<r.scrollWidth)})(e)}return!1},$r=(e,t,o,r,a,n,l,i)=>n<e&&l>t||n>e&&l<t?0:n<=e&&i<=o||l>=t&&i>=o?n-e-r:l>t&&i<o||n<e&&i>o?l-t+a:0,S7=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)},G0=(e,t)=>{var o,r,a,n;if(typeof document>"u")return[];let{scrollMode:l,block:i,inline:s,boundary:u,skipOverflowHiddenElements:d}=t,c=typeof u=="function"?u:z=>z!==u;if(!j0(e))throw new TypeError("Invalid target");let C=document.scrollingElement||document.documentElement,m=[],f=e;for(;j0(f)&&c(f);){if(f=S7(f),f===C){m.push(f);break}f!=null&&f===document.body&&Fr(f)&&!Fr(document.documentElement)||f!=null&&Fr(f,d)&&m.push(f)}let S=(r=(o=window.visualViewport)==null?void 0:o.width)!=null?r:innerWidth,L=(n=(a=window.visualViewport)==null?void 0:a.height)!=null?n:innerHeight,{scrollX:I,scrollY:v}=window,{height:b,width:y,top:H,right:$,bottom:D,left:w}=e.getBoundingClientRect(),{top:E,right:M,bottom:P,left:K}=(z=>{let T=window.getComputedStyle(z);return{top:parseFloat(T.scrollMarginTop)||0,right:parseFloat(T.scrollMarginRight)||0,bottom:parseFloat(T.scrollMarginBottom)||0,left:parseFloat(T.scrollMarginLeft)||0}})(e),W=i==="start"||i==="nearest"?H-E:i==="end"?D+P:H+b/2-E+P,Q=s==="center"?w+y/2-K+M:s==="end"?$+M:w-K,te=[];for(let z=0;z<m.length;z++){let T=m[z],{height:A,width:F,top:x,right:j,bottom:N,left:X}=T.getBoundingClientRect();if(l==="if-needed"&&H>=0&&w>=0&&D<=L&&$<=S&&(T===C&&!Fr(T)||H>=x&&D<=N&&w>=X&&$<=j))return te;let g=getComputedStyle(T),O=parseInt(g.borderLeftWidth,10),V=parseInt(g.borderTopWidth,10),p=parseInt(g.borderRightWidth,10),Z=parseInt(g.borderBottomWidth,10),U=0,q=0,h="offsetWidth"in T?T.offsetWidth-T.clientWidth-O-p:0,R="offsetHeight"in T?T.offsetHeight-T.clientHeight-V-Z:0,G="offsetWidth"in T?T.offsetWidth===0?0:F/T.offsetWidth:0,ee="offsetHeight"in T?T.offsetHeight===0?0:A/T.offsetHeight:0;if(C===T)U=i==="start"?W:i==="end"?W-L:i==="nearest"?$r(v,v+L,L,V,Z,v+W,v+W+b,b):W-L/2,q=s==="start"?Q:s==="center"?Q-S/2:s==="end"?Q-S:$r(I,I+S,S,O,p,I+Q,I+Q+y,y),U=Math.max(0,U+v),q=Math.max(0,q+I);else{U=i==="start"?W-x-V:i==="end"?W-N+Z+R:i==="nearest"?$r(x,N,A,V,Z+R,W,W+b,b):W-(x+A/2)+R/2,q=s==="start"?Q-X-O:s==="center"?Q-(X+F/2)+h/2:s==="end"?Q-j+p+h:$r(X,j,F,O,p+h,Q,Q+y,y);let{scrollLeft:xe,scrollTop:he}=T;U=ee===0?0:Math.max(0,Math.min(he+U/ee,T.scrollHeight-A/ee+R)),q=G===0?0:Math.max(0,Math.min(xe+q/G,T.scrollWidth-F/G+h)),W+=he-U,Q+=xe-q}te.push({el:T,top:U,left:q})}return te};var H7=0;function ti(){return String(H7++)}function Vo(e){var t=pe.useRef(e);return t.current=e,t}function k7(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function Fn(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function oi(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}var P7=oi(function(e){ri(e).textContent=""},500);function ri(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 T7(e,t){if(!(!e||!t)){var o=ri(t);o.textContent=e,P7(t)}}function V7(e){var t=e?.getElementById("a11y-status-message");t&&t.remove()}function _o(){}var Nn=_o;function Ur(e,t){if(!t)return e;var o=Object.keys(e);return o.reduce(function(r,a){return t[a]!==void 0&&(r[a]=t[a]),r},ie({},e))}function _7(e,t){if(e){var o=G0(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});o.forEach(function(r){var a=r.el,n=r.top,l=r.left;a.scrollTop=n,a.scrollLeft=l})}}function W0(e,t,o){var r=e===t||t instanceof o.Node&&e.contains&&e.contains(t);return r}function E7(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}function Ee(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function U1(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function D7(e,t){return e[t]!==void 0}function qr(e){var t=e.key,o=e.keyCode;return o>=37&&o<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function mt(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(n===0)return-1;var l=n-1;(typeof e!="number"||e<0||e>l)&&(e=t>0?-1:l+1);var i=e+t;i<0?i=a?l:0:i>l&&(i=a?0:l);var s=eo(i,t<0,o,r,a);return s===-1?e>=n?-1:e:s}function eo(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(t){for(var l=e;l>=0;l--)if(!r(o[l],l))return l}else for(var i=e;i<n;i++)if(!r(o[i],i))return i;return a?eo(t?n-1:0,t,o,r):-1}function X0(e,t,o,r){return r===void 0&&(r=!0),o&&t.some(function(a){return a&&(W0(a,e,o)||r&&W0(a,o.document.activeElement,o))})}function Un(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function O7(e,t,o,r){for(var a=e.type,n={},l=Object.keys(o),i=0,s=l;i<s.length;i++){var u=s[i];B7(u,e,t,o,r),r[u]!==o[u]&&(n[u]=r[u])}t.onStateChange&&Object.keys(n).length&&t.onStateChange(ie({type:a},n))}function B7(e,t,o,r,a){if(a[e]!==r[e]){var n="on"+Un(e)+"Change",l=o[n];if(typeof l=="function"){var i=t.type;l(ie({type:i},a))}}}function ai(e,t,o,r){var a=pe.useRef(null),n=pe.useRef(void 0),l=Vo(t),i=pe.useCallback(function(C,m){n.current=m,C=Ur(C,l.current);var f=e(C,l.current,m),S=l.current.stateReducer(C,ie({},m,{changes:f}));return ie({},C,S)},[l,e]),s=pe.useReducer(i,t,o),u=s[0],d=s[1],c=n.current;return pe.useEffect(function(){var C,m=Ur((C=a.current)!=null?C:{},l.current),f=c&&a.current&&!r(m,u);f&&O7(c,l.current,m,u),a.current=u},[u,c,r,l]),[u,d]}function qn(e,t,o,r){var a=ai(e,t,o,r),n=a[0],l=a[1];return[Ur(n,t),l]}function zn(e,t,o,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){var a=o.indexOf(e);if(a<0)throw new Error(r);return[e,o.indexOf(e)]}if(t!==void 0){var n=o[t];if(n===void 0)throw new Error(r);return[n,t]}throw new Error(r)}function Xr(){var e=pe.useRef(!0);return pe.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function A7(e,t){return t.changes}var Z7={environment:re.default.shape({addEventListener:re.default.func.isRequired,removeEventListener:re.default.func.isRequired,document:re.default.shape({createElement:re.default.func.isRequired,getElementById:re.default.func.isRequired,activeElement:re.default.any.isRequired,body:re.default.any.isRequired}).isRequired,Node:re.default.func.isRequired}),itemToKey:re.default.func,stateReducer:re.default.func};function V1(e,t,o){var r=e["default"+Un(t)];return r!==void 0?r:o[t]}function kt(e,t,o){var r=e[t];if(r!==void 0)return r;var a=e["initial"+Un(t)];return a!==void 0?a:V1(e,t,o)}var Q0=oi(function(e,t){T7(e,t)},200);function jn(e,t,o,r){var a=r?.document,n=Xr();pe.useEffect(function(){if(!(!e||n||!a)){var l=e(t);Q0(l,a)}},o),pe.useEffect(function(){return function(){Q0.cancel(),V7(a)}},[a])}var Po=ie({},Z7,{getA11yStatusMessage:re.default.func,highlightedIndex:re.default.number,defaultHighlightedIndex:re.default.number,initialHighlightedIndex:re.default.number,isOpen:re.default.bool,defaultIsOpen:re.default.bool,initialIsOpen:re.default.bool,selectedItem:re.default.any,initialSelectedItem:re.default.any,defaultSelectedItem:re.default.any,id:re.default.string,labelId:re.default.string,menuId:re.default.string,getItemId:re.default.func,toggleButtonId:re.default.string,onSelectedItemChange:re.default.func,onHighlightedIndexChange:re.default.func,onStateChange:re.default.func,onIsOpenChange:re.default.func,scrollIntoView:re.default.func}),To={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:A7,scrollIntoView:_7,environment:typeof window>"u"?void 0:window},l1={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},F7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?pe.useLayoutEffect:pe.useEffect;function $7(e){return/^\S{1}$/.test(e)}function ni(e){var t=kt(e,"selectedItem",l1),o=kt(e,"isOpen",l1),r=N7(e),a=kt(e,"inputValue",l1);return{highlightedIndex:r<0&&t&&o?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:o,selectedItem:t,inputValue:a}}function Pt(e,t,o){var r=e.items,a=e.initialHighlightedIndex,n=e.defaultHighlightedIndex,l=e.isItemDisabled,i=e.itemToKey,s=t.selectedItem,u=t.highlightedIndex;return r.length===0?-1:a!==void 0&&u===a&&!l(r[a],a)?a:n!==void 0&&!l(r[n],n)?n:s?r.findIndex(function(d){return i(s)===i(d)}):o<0&&!l(r[r.length-1],r.length-1)?r.length-1:o>0&&!l(r[0],0)?0:-1}function li(e,t,o){var r=pe.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),a=pe.useCallback(function(){return o.map(function(n){return n.current})},[o]);return pe.useEffect(function(){if(!e)return _o;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function l(d){r.current.isMouseDown=!1,X0(d.target,a(),e)||t()}function i(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function u(d){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!X0(d.target,a(),e,!1)&&t()}return e.addEventListener("mousedown",n),e.addEventListener("mouseup",l),e.addEventListener("touchstart",i),e.addEventListener("touchmove",s),e.addEventListener("touchend",u),function(){e.removeEventListener("mousedown",n),e.removeEventListener("mouseup",l),e.removeEventListener("touchstart",i),e.removeEventListener("touchmove",s),e.removeEventListener("touchend",u)}},[e,a,t]),r.current}var Kn=function(){return _o};function ii(e){var t=e.highlightedIndex,o=e.isOpen,r=e.itemRefs,a=e.getItemNodeFromIndex,n=e.menuElement,l=e.scrollIntoView,i=pe.useRef(!0);return F7(function(){t<0||!o||!Object.keys(r.current).length||(i.current===!1?i.current=!0:l(a(t),n))},[t]),i}var Gn=_o;function zr(e,t,o){var r;o===void 0&&(o=!0);var a=((r=e.items)==null?void 0:r.length)&&t>=0;return ie({isOpen:!1,highlightedIndex:-1},a&&ie({selectedItem:e.items[t],isOpen:V1(e,"isOpen",l1),highlightedIndex:V1(e,"highlightedIndex",l1)},o&&{inputValue:e.itemToString(e.items[t])}))}function si(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function jr(e){var t=V1(e,"highlightedIndex",l1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function N7(e){var t=kt(e,"highlightedIndex",l1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function ui(e,t,o,r){var a=o.type,n;switch(a){case r.ItemMouseMove:n={highlightedIndex:o.disabled?-1:o.index};break;case r.MenuMouseLeave:n={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Pt(t,e,0)};break;case r.FunctionOpenMenu:n={isOpen:!0,highlightedIndex:Pt(t,e,0)};break;case r.FunctionCloseMenu:n={isOpen:!1};break;case r.FunctionSetHighlightedIndex:n={highlightedIndex:t.isItemDisabled(t.items[o.highlightedIndex],o.highlightedIndex)?-1:o.highlightedIndex};break;case r.FunctionSetInputValue:n={inputValue:o.inputValue};break;case r.FunctionReset:n={highlightedIndex:jr(t),isOpen:V1(t,"isOpen",l1),selectedItem:V1(t,"selectedItem",l1),inputValue:V1(t,"inputValue",l1)};break;default:throw new Error("Reducer called without proper action type.")}return ie({},e,n)}var U7=ie({},Po,{items:re.default.array.isRequired,isItemDisabled:re.default.func}),q7=ie({},To,{isItemDisabled:function(){return!1}});function z7(e){for(var t=e.keysSoFar,o=e.highlightedIndex,r=e.items,a=e.itemToString,n=e.isItemDisabled,l=t.toLowerCase(),i=0;i<r.length;i++){var s=(i+o+(t.length<2?1:0))%r.length,u=r[s];if(u!==void 0&&a(u).toLowerCase().startsWith(l)&&!n(u,s))return s}return o}var Nr=0,Wn=1,Xn=2,Kr=3,Qn=4,Yn=5,Jn=6,el=7,tl=8,ol=9,rl=10,Gr=11,di=12,ci=13,al=14,fi=15,pi=16,Ci=17,mi=18,nl=19,$n=20,gi=21,hi=Object.freeze({__proto__:null,FunctionCloseMenu:Ci,FunctionOpenMenu:pi,FunctionReset:gi,FunctionSelectItem:nl,FunctionSetHighlightedIndex:mi,FunctionSetInputValue:$n,FunctionToggleMenu:fi,ItemClick:al,ItemMouseMove:ci,MenuMouseLeave:di,ToggleButtonBlur:Gr,ToggleButtonClick:Nr,ToggleButtonKeyDownArrowDown:Wn,ToggleButtonKeyDownArrowUp:Xn,ToggleButtonKeyDownCharacter:Kr,ToggleButtonKeyDownEnd:Jn,ToggleButtonKeyDownEnter:el,ToggleButtonKeyDownEscape:Qn,ToggleButtonKeyDownHome:Yn,ToggleButtonKeyDownPageDown:rl,ToggleButtonKeyDownPageUp:ol,ToggleButtonKeyDownSpaceButton:tl});function j7(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case al:l={isOpen:V1(t,"isOpen",l1),highlightedIndex:jr(t),selectedItem:t.items[o.index]};break;case Kr:{var i=o.key,s=""+e.inputValue+i,u=!e.isOpen&&e.selectedItem?t.items.findIndex(function(m){return t.itemToKey(m)===t.itemToKey(e.selectedItem)}):e.highlightedIndex,d=z7({keysSoFar:s,highlightedIndex:u,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled});l={inputValue:s,highlightedIndex:d,isOpen:!0}}break;case Wn:{var c=e.isOpen?mt(e.highlightedIndex,1,t.items,t.isItemDisabled):n&&e.selectedItem==null?-1:Pt(t,e,1);l={highlightedIndex:c,isOpen:!0}}break;case Xn:if(e.isOpen&&n)l=zr(t,e.highlightedIndex,!1);else{var C=e.isOpen?mt(e.highlightedIndex,-1,t.items,t.isItemDisabled):Pt(t,e,-1);l={highlightedIndex:C,isOpen:!0}}break;case el:case tl:l=zr(t,e.highlightedIndex,!1);break;case Yn:l={highlightedIndex:eo(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case Jn:l={highlightedIndex:eo(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case ol:l={highlightedIndex:mt(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case rl:l={highlightedIndex:mt(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case Qn:l={isOpen:!1,highlightedIndex:-1};break;case Gr:l=ie({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&{selectedItem:t.items[e.highlightedIndex]});break;case nl:l={selectedItem:o.selectedItem};break;default:return ui(e,t,o,hi)}return ie({},e,l)}var K7=ie({},pe),vi=K7.useId,xi=typeof vi=="function"?G7:W7;function G7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i="downshift-"+vi();t||(t=i);var s=pe.useMemo(function(){return{labelId:o??t+"-label",menuId:r??t+"-menu",getItemId:a??function(u){return t+"-item-"+u},toggleButtonId:n??t+"-toggle-button",inputId:l??t+"-input"}},[a,t,l,o,r,n]);return s}function W7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i=pe.useRef(t??"downshift-"+ti()),s=i.current,u=pe.useMemo(function(){return{labelId:o??s+"-label",menuId:r??s+"-menu",getItemId:a??function(d){return s+"-item-"+d},toggleButtonId:n??s+"-toggle-button",inputId:l??s+"-input"}},[a,l,o,r,n,s]);return u}var X7=["onClick"],Q7=["onMouseLeave","refKey","ref"],Y7=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],J7=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];Eo.stateChangeTypes=hi;function Eo(e){e===void 0&&(e={}),Nn(e,Eo,U7);var t=ie({},q7,e),o=t.scrollIntoView,r=t.environment,a=t.getA11yStatusMessage,n=qn(j7,t,ni,si),l=n[0],i=n[1],s=l.isOpen,u=l.highlightedIndex,d=l.selectedItem,c=l.inputValue,C=g1(null),m=g1(null),f=g1({}),S=g1(null),L=xi(t),I=Vo({state:l,props:t}),v=fe(function(x){return f.current[L.getItemId(x)]},[L]);jn(a,l,[s,u,d,c],r);var b=ii({menuElement:m.current,highlightedIndex:u,isOpen:s,itemRefs:f,scrollIntoView:o,getItemNodeFromIndex:v});T1(function(){return S.current=E7(function(x){x({type:$n,inputValue:""})},500),function(){S.current.cancel()}},[]),T1(function(){c&&S.current(i)},[i,c]),Gn({props:t,state:l}),T1(function(){var x=kt(t,"isOpen",l1);x&&C.current&&C.current.focus()},[]);var y=fe(function(){I.current.state.isOpen&&i({type:Gr})},[i,I]),H=Jt(function(){return[m,C]},[]),$=li(r,y,H),D=Kn("getMenuProps","getToggleButtonProps");T1(function(){s||(f.current={})},[s]);var w=Jt(function(){return{ArrowDown:function(j){j.preventDefault(),i({type:Wn,altKey:j.altKey})},ArrowUp:function(j){j.preventDefault(),i({type:Xn,altKey:j.altKey})},Home:function(j){j.preventDefault(),i({type:Yn})},End:function(j){j.preventDefault(),i({type:Jn})},Escape:function(){I.current.state.isOpen&&i({type:Qn})},Enter:function(j){j.preventDefault(),i({type:I.current.state.isOpen?el:Nr})},PageUp:function(j){I.current.state.isOpen&&(j.preventDefault(),i({type:ol}))},PageDown:function(j){I.current.state.isOpen&&(j.preventDefault(),i({type:rl}))}," ":function(j){j.preventDefault();var N=I.current.state;if(!N.isOpen){i({type:Nr});return}N.inputValue?i({type:Kr,key:" "}):i({type:tl})}}},[i,I]),E=fe(function(){i({type:fi})},[i]),M=fe(function(){i({type:Ci})},[i]),P=fe(function(){i({type:pi})},[i]),K=fe(function(x){i({type:mi,highlightedIndex:x})},[i]),W=fe(function(x){i({type:nl,selectedItem:x})},[i]),Q=fe(function(){i({type:gi})},[i]),te=fe(function(x){i({type:$n,inputValue:x})},[i]),z=fe(function(x){var j=x===void 0?{}:x,N=j.onClick,X=n1(j,X7),g=function(){var V;(V=C.current)==null||V.focus()};return ie({id:L.labelId,htmlFor:L.toggleButtonId,onClick:Ee(N,g)},X)},[L]),T=fe(function(x,j){var N,X=x===void 0?{}:x,g=X.onMouseLeave,O=X.refKey,V=O===void 0?"ref":O,p=X.ref,Z=n1(X,Q7),U=j===void 0?{}:j,q=U.suppressRefError,h=q===void 0?!1:q,R=function(){i({type:di})};return D("getMenuProps",h,V,m),ie((N={},N[V]=U1(p,function(G){m.current=G}),N.id=L.menuId,N.role="listbox",N["aria-labelledby"]=Z&&Z["aria-label"]?void 0:""+L.labelId,N.onMouseLeave=Ee(g,R),N),Z)},[i,D,L]),A=fe(function(x,j){var N,X=x===void 0?{}:x,g=X.onBlur,O=X.onClick;X.onPress;var V=X.onKeyDown,p=X.refKey,Z=p===void 0?"ref":p,U=X.ref,q=n1(X,Y7),h=j===void 0?{}:j,R=h.suppressRefError,G=R===void 0?!1:R,ee=I.current.state,xe=function(){i({type:Nr})},he=function(){ee.isOpen&&!$.isMouseDown&&i({type:Gr})},ze=function(Me){var Ce=qr(Me);Ce&&w[Ce]?w[Ce](Me):$7(Ce)&&i({type:Kr,key:Ce})},Ie=ie((N={},N[Z]=U1(U,function(ye){C.current=ye}),N["aria-activedescendant"]=ee.isOpen&&ee.highlightedIndex>-1?L.getItemId(ee.highlightedIndex):"",N["aria-controls"]=L.menuId,N["aria-expanded"]=I.current.state.isOpen,N["aria-haspopup"]="listbox",N["aria-labelledby"]=q&&q["aria-label"]?void 0:""+L.labelId,N.id=L.toggleButtonId,N.role="combobox",N.tabIndex=0,N.onBlur=Ee(g,he),N),q);return q.disabled||(Ie.onClick=Ee(O,xe),Ie.onKeyDown=Ee(V,ze)),D("getToggleButtonProps",G,Z,C),Ie},[i,L,I,$,D,w]),F=fe(function(x){var j,N=x===void 0?{}:x,X=N.item,g=N.index,O=N.onMouseMove,V=N.onClick,p=N.onMouseDown;N.onPress;var Z=N.refKey,U=Z===void 0?"ref":Z,q=N.disabled,h=N.ref,R=n1(N,J7);q!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var G=I.current,ee=G.state,xe=G.props,he=zn(X,g,xe.items,"Pass either item or index to getItemProps!"),ze=he[0],Ie=he[1],ye=xe.isItemDisabled(ze,Ie),Me=function(){$.isTouchEnd||Ie===ee.highlightedIndex||(b.current=!1,i({type:ci,index:Ie,disabled:ye}))},Ce=function(){i({type:al,index:Ie})},je=function(k){return k.preventDefault()},we=ie((j={},j[U]=U1(h,function(Ye){Ye&&(f.current[L.getItemId(Ie)]=Ye)}),j["aria-disabled"]=ye,j["aria-selected"]=ze===ee.selectedItem,j.id=L.getItemId(Ie),j.role="option",j),R);return ye||(we.onClick=Ee(V,Ce)),we.onMouseMove=Ee(O,Me),we.onMouseDown=Ee(p,je),we},[I,L,$,b,i]);return{getToggleButtonProps:A,getLabelProps:z,getMenuProps:T,getItemProps:F,toggleMenu:E,openMenu:P,closeMenu:M,setHighlightedIndex:K,selectItem:W,reset:Q,setInputValue:te,highlightedIndex:u,isOpen:s,selectedItem:d,inputValue:c}}var ll=0,il=1,sl=2,ul=3,dl=4,cl=5,fl=6,pl=7,Cl=8,Wr=9,ml=10,Li=11,wi=12,gl=13,bi=14,Ii=15,yi=16,Mi=17,Si=18,hl=19,Ri=20,Hi=21,vl=22,ki=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:vl,FunctionCloseMenu:Mi,FunctionOpenMenu:yi,FunctionReset:Hi,FunctionSelectItem:hl,FunctionSetHighlightedIndex:Si,FunctionSetInputValue:Ri,FunctionToggleMenu:Ii,InputBlur:Wr,InputChange:Cl,InputClick:ml,InputKeyDownArrowDown:ll,InputKeyDownArrowUp:il,InputKeyDownEnd:dl,InputKeyDownEnter:pl,InputKeyDownEscape:sl,InputKeyDownHome:ul,InputKeyDownPageDown:fl,InputKeyDownPageUp:cl,ItemClick:gl,ItemMouseMove:wi,MenuMouseLeave:Li,ToggleButtonClick:bi});function e4(e){var t=ni(e),o=t.selectedItem,r=t.inputValue;return r===""&&o&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(o)),ie({},t,{inputValue:r})}var t4=ie({},Po,{items:re.default.array.isRequired,isItemDisabled:re.default.func,inputValue:re.default.string,defaultInputValue:re.default.string,initialInputValue:re.default.string,inputId:re.default.string,onInputValueChange:re.default.func});function o4(e,t,o,r){var a=g1(),n=ai(e,t,o,r),l=n[0],i=n[1],s=Xr();return T1(function(){if(D7(t,"selectedItem")){if(!s){var u=t.itemToKey(t.selectedItem)!==t.itemToKey(a.current);u&&i({type:vl,inputValue:t.itemToString(t.selectedItem)})}a.current=l.selectedItem===a.current?t.selectedItem:l.selectedItem}},[l.selectedItem,t.selectedItem]),[Ur(l,t),i]}var r4=ie({},To,{isItemDisabled:function(){return!1}});function a4(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case gl:l={isOpen:V1(t,"isOpen",l1),highlightedIndex:jr(t),selectedItem:t.items[o.index],inputValue:t.itemToString(t.items[o.index])};break;case ll:e.isOpen?l={highlightedIndex:mt(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:n&&e.selectedItem==null?-1:Pt(t,e,1),isOpen:t.items.length>=0};break;case il:e.isOpen?n?l=zr(t,e.highlightedIndex):l={highlightedIndex:mt(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:Pt(t,e,-1),isOpen:t.items.length>=0};break;case pl:l=zr(t,e.highlightedIndex);break;case sl:l=ie({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case cl:l={highlightedIndex:mt(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case fl:l={highlightedIndex:mt(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case ul:l={highlightedIndex:eo(0,!1,t.items,t.isItemDisabled)};break;case dl:l={highlightedIndex:eo(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Wr:l=ie({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&o.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case Cl:l={isOpen:!0,highlightedIndex:jr(t),inputValue:o.inputValue};break;case ml:l={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Pt(t,e,0)};break;case hl:l={selectedItem:o.selectedItem,inputValue:t.itemToString(o.selectedItem)};break;case vl:l={inputValue:o.inputValue};break;default:return ui(e,t,o,ki)}return ie({},e,l)}var n4=["onMouseLeave","refKey","ref"],l4=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],i4=["onClick","onPress","refKey","ref"],s4=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];Pi.stateChangeTypes=ki;function Pi(e){e===void 0&&(e={}),Nn(e,Pi,t4);var t=ie({},r4,e),o=t.items,r=t.scrollIntoView,a=t.environment,n=t.getA11yStatusMessage,l=o4(a4,t,e4,si),i=l[0],s=l[1],u=i.isOpen,d=i.highlightedIndex,c=i.selectedItem,C=i.inputValue,m=g1(null),f=g1({}),S=g1(null),L=g1(null),I=Xr(),v=xi(t),b=g1(),y=Vo({state:i,props:t}),H=fe(function(g){return f.current[v.getItemId(g)]},[v]);jn(n,i,[u,d,c,C],a);var $=ii({menuElement:m.current,highlightedIndex:d,isOpen:u,itemRefs:f,scrollIntoView:r,getItemNodeFromIndex:H});Gn({props:t,state:i}),T1(function(){var g=kt(t,"isOpen",l1);g&&S.current&&S.current.focus()},[]),T1(function(){I||(b.current=o.length)});var D=fe(function(){y.current.state.isOpen&&s({type:Wr})},[s,y]),w=Jt(function(){return[m,L,S]},[]),E=li(a,D,w),M=Kn("getInputProps","getMenuProps");T1(function(){u||(f.current={})},[u]),T1(function(){var g;!u||!(a!=null&&a.document)||!(S!=null&&(g=S.current)!=null&&g.focus)||a.document.activeElement!==S.current&&S.current.focus()},[u,a]);var P=Jt(function(){return{ArrowDown:function(O){O.preventDefault(),s({type:ll,altKey:O.altKey})},ArrowUp:function(O){O.preventDefault(),s({type:il,altKey:O.altKey})},Home:function(O){y.current.state.isOpen&&(O.preventDefault(),s({type:ul}))},End:function(O){y.current.state.isOpen&&(O.preventDefault(),s({type:dl}))},Escape:function(O){var V=y.current.state;(V.isOpen||V.inputValue||V.selectedItem||V.highlightedIndex>-1)&&(O.preventDefault(),s({type:sl}))},Enter:function(O){var V=y.current.state;!V.isOpen||O.which===229||(O.preventDefault(),s({type:pl}))},PageUp:function(O){y.current.state.isOpen&&(O.preventDefault(),s({type:cl}))},PageDown:function(O){y.current.state.isOpen&&(O.preventDefault(),s({type:fl}))}}},[s,y]),K=fe(function(g){return ie({id:v.labelId,htmlFor:v.inputId},g)},[v]),W=fe(function(g,O){var V,p=g===void 0?{}:g,Z=p.onMouseLeave,U=p.refKey,q=U===void 0?"ref":U,h=p.ref,R=n1(p,n4),G=O===void 0?{}:O,ee=G.suppressRefError,xe=ee===void 0?!1:ee;return M("getMenuProps",xe,q,m),ie((V={},V[q]=U1(h,function(he){m.current=he}),V.id=v.menuId,V.role="listbox",V["aria-labelledby"]=R&&R["aria-label"]?void 0:""+v.labelId,V.onMouseLeave=Ee(Z,function(){s({type:Li})}),V),R)},[s,M,v]),Q=fe(function(g){var O,V,p=g===void 0?{}:g,Z=p.item,U=p.index,q=p.refKey,h=q===void 0?"ref":q,R=p.ref,G=p.onMouseMove,ee=p.onMouseDown,xe=p.onClick;p.onPress;var he=p.disabled,ze=n1(p,l4);he!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var Ie=y.current,ye=Ie.props,Me=Ie.state,Ce=zn(Z,U,ye.items,"Pass either item or index to getItemProps!"),je=Ce[0],we=Ce[1],Ye=ye.isItemDisabled(je,we),k="onClick",ne=xe,oe=function(){E.isTouchEnd||we===Me.highlightedIndex||($.current=!1,s({type:wi,index:we,disabled:Ye}))},Se=function(){s({type:gl,index:we})},Re=function(y1){return y1.preventDefault()};return ie((O={},O[h]=U1(R,function(He){He&&(f.current[v.getItemId(we)]=He)}),O["aria-disabled"]=Ye,O["aria-selected"]=we===Me.highlightedIndex,O.id=v.getItemId(we),O.role="option",O),!Ye&&(V={},V[k]=Ee(ne,Se),V),{onMouseMove:Ee(G,oe),onMouseDown:Ee(ee,Re)},ze)},[s,v,y,E,$]),te=fe(function(g){var O,V=g===void 0?{}:g,p=V.onClick;V.onPress;var Z=V.refKey,U=Z===void 0?"ref":Z,q=V.ref,h=n1(V,i4),R=y.current.state,G=function(){s({type:bi})};return ie((O={},O[U]=U1(q,function(ee){L.current=ee}),O["aria-controls"]=v.menuId,O["aria-expanded"]=R.isOpen,O.id=v.toggleButtonId,O.tabIndex=-1,O),!h.disabled&&ie({},{onClick:Ee(p,G)}),h)},[s,y,v]),z=fe(function(g,O){var V,p=g===void 0?{}:g,Z=p.onKeyDown,U=p.onChange,q=p.onInput,h=p.onBlur;p.onChangeText;var R=p.onClick,G=p.refKey,ee=G===void 0?"ref":G,xe=p.ref,he=n1(p,s4),ze=O===void 0?{}:O,Ie=ze.suppressRefError,ye=Ie===void 0?!1:Ie;M("getInputProps",ye,ee,S);var Me=y.current.state,Ce=function(Re){var He=qr(Re);He&&P[He]&&P[He](Re)},je=function(Re){s({type:Cl,inputValue:Re.target.value})},we=function(Re){if(a!=null&&a.document&&Me.isOpen&&!E.isMouseDown){var He=Re.relatedTarget===null&&a.document.activeElement!==a.document.body;s({type:Wr,selectItem:!He})}},Ye=function(){s({type:ml})},k="onChange",ne={};if(!he.disabled){var oe;ne=(oe={},oe[k]=Ee(U,q,je),oe.onKeyDown=Ee(Z,Ce),oe.onBlur=Ee(h,we),oe.onClick=Ee(R,Ye),oe)}return ie((V={},V[ee]=U1(xe,function(Se){S.current=Se}),V["aria-activedescendant"]=Me.isOpen&&Me.highlightedIndex>-1?v.getItemId(Me.highlightedIndex):"",V["aria-autocomplete"]="list",V["aria-controls"]=v.menuId,V["aria-expanded"]=Me.isOpen,V["aria-labelledby"]=he&&he["aria-label"]?void 0:v.labelId,V.autoComplete="off",V.id=v.inputId,V.role="combobox",V.value=Me.inputValue,V),ne,he)},[s,v,a,P,y,E,M]),T=fe(function(){s({type:Ii})},[s]),A=fe(function(){s({type:Mi})},[s]),F=fe(function(){s({type:yi})},[s]),x=fe(function(g){s({type:Si,highlightedIndex:g})},[s]),j=fe(function(g){s({type:hl,selectedItem:g})},[s]),N=fe(function(g){s({type:Ri,inputValue:g})},[s]),X=fe(function(){s({type:Hi})},[s]);return{getItemProps:Q,getLabelProps:K,getMenuProps:W,getInputProps:z,getToggleButtonProps:te,toggleMenu:T,openMenu:F,closeMenu:A,setHighlightedIndex:x,setInputValue:N,selectItem:j,reset:X,highlightedIndex:d,isOpen:u,selectedItem:c,inputValue:C}}var Ti={activeIndex:-1,selectedItems:[]};function Y0(e,t){return kt(e,t,Ti)}function J0(e,t){return V1(e,t,Ti)}function u4(e){var t=Y0(e,"activeIndex"),o=Y0(e,"selectedItems");return{activeIndex:t,selectedItems:o}}function ei(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 d4(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var qw={stateReducer:Po.stateReducer,itemToKey:Po.itemToKey,environment:Po.environment,selectedItems:re.default.array,initialSelectedItems:re.default.array,defaultSelectedItems:re.default.array,getA11yStatusMessage:re.default.func,activeIndex:re.default.number,initialActiveIndex:re.default.number,defaultActiveIndex:re.default.number,onActiveIndexChange:re.default.func,onSelectedItemsChange:re.default.func,keyNavigationNext:re.default.string,keyNavigationPrevious:re.default.string},c4={itemToKey:To.itemToKey,stateReducer:To.stateReducer,environment:To.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},f4=_o,xl=0,Ll=1,wl=2,bl=3,Il=4,yl=5,Ml=6,Sl=7,Rl=8,Hl=9,kl=10,Pl=11,Tl=12,p4=Object.freeze({__proto__:null,DropdownClick:Sl,DropdownKeyDownBackspace:Ml,DropdownKeyDownNavigationPrevious:yl,FunctionAddSelectedItem:Rl,FunctionRemoveSelectedItem:Hl,FunctionReset:Tl,FunctionSetActiveIndex:Pl,FunctionSetSelectedItems:kl,SelectedItemClick:xl,SelectedItemKeyDownBackspace:wl,SelectedItemKeyDownDelete:Ll,SelectedItemKeyDownNavigationNext:bl,SelectedItemKeyDownNavigationPrevious:Il});function C4(e,t,o){var r=o.type,a=o.index,n=o.selectedItem,l=e.activeIndex,i=e.selectedItems,s;switch(r){case xl:s={activeIndex:a};break;case Il:s={activeIndex:l-1<0?0:l-1};break;case bl:s={activeIndex:l+1>=i.length?-1:l+1};break;case wl:case Ll:{if(l<0)break;var u=l;i.length===1?u=-1:l===i.length-1&&(u=i.length-2),s=ie({selectedItems:[].concat(i.slice(0,l),i.slice(l+1))},{activeIndex:u});break}case yl:s={activeIndex:i.length-1};break;case Ml:s={selectedItems:i.slice(0,i.length-1)};break;case Rl:s={selectedItems:[].concat(i,[n])};break;case Sl:s={activeIndex:-1};break;case Hl:{var d=l,c=i.findIndex(function(f){return t.itemToKey(f)===t.itemToKey(n)});if(c<0)break;i.length===1?d=-1:c===i.length-1&&(d=i.length-2),s={selectedItems:[].concat(i.slice(0,c),i.slice(c+1)),activeIndex:d};break}case kl:{var C=o.selectedItems;s={selectedItems:C};break}case Pl:{var m=o.activeIndex;s={activeIndex:m};break}case Tl:s={activeIndex:J0(t,"activeIndex"),selectedItems:J0(t,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return ie({},e,s)}var m4=["refKey","ref","onClick","onKeyDown","selectedItem","index"],g4=["refKey","ref","onKeyDown","onClick","preventKeyAction"];Vi.stateChangeTypes=p4;function Vi(e){e===void 0&&(e={}),f4(e,Vi);var t=ie({},c4,e),o=t.getA11yStatusMessage,r=t.environment,a=t.keyNavigationNext,n=t.keyNavigationPrevious,l=qn(C4,t,u4,d4),i=l[0],s=l[1],u=i.activeIndex,d=i.selectedItems,c=Xr(),C=g1(null),m=g1();m.current=[];var f=Vo({state:i,props:t});jn(o,i,[u,d],r),T1(function(){c||(u===-1&&C.current?C.current.focus():m.current[u]&&m.current[u].focus())},[u]),Gn({props:t,state:i});var S=Kn("getDropdownProps"),L=Jt(function(){var E;return E={},E[n]=function(){s({type:Il})},E[a]=function(){s({type:bl})},E.Delete=function(){s({type:Ll})},E.Backspace=function(){s({type:wl})},E},[s,a,n]),I=Jt(function(){var E;return E={},E[n]=function(M){ei(M)&&s({type:yl})},E.Backspace=function(P){ei(P)&&s({type:Ml})},E},[s,n]),v=fe(function(E){var M,P=E===void 0?{}:E,K=P.refKey,W=K===void 0?"ref":K,Q=P.ref,te=P.onClick,z=P.onKeyDown,T=P.selectedItem,A=P.index,F=n1(P,m4),x=f.current.state,j=zn(T,A,x.selectedItems,"Pass either item or index to getSelectedItemProps!"),N=j[1],X=N>-1&&N===x.activeIndex,g=function(){s({type:xl,index:N})},O=function(p){var Z=qr(p);Z&&L[Z]&&L[Z](p)};return ie((M={},M[W]=U1(Q,function(V){V&&m.current.push(V)}),M.tabIndex=X?0:-1,M.onClick=Ee(te,g),M.onKeyDown=Ee(z,O),M),F)},[s,f,L]),b=fe(function(E,M){var P,K=E===void 0?{}:E,W=K.refKey,Q=W===void 0?"ref":W,te=K.ref,z=K.onKeyDown,T=K.onClick,A=K.preventKeyAction,F=A===void 0?!1:A,x=n1(K,g4),j=M===void 0?{}:M,N=j.suppressRefError,X=N===void 0?!1:N;S("getDropdownProps",X,Q,C);var g=function(p){var Z=qr(p);Z&&I[Z]&&I[Z](p)},O=function(){s({type:Sl})};return ie((P={},P[Q]=U1(te,function(V){V&&(C.current=V)}),P),!F&&{onKeyDown:Ee(z,g),onClick:Ee(T,O)},x)},[s,I,S]),y=fe(function(E){s({type:Rl,selectedItem:E})},[s]),H=fe(function(E){s({type:Hl,selectedItem:E})},[s]),$=fe(function(E){s({type:kl,selectedItems:E})},[s]),D=fe(function(E){s({type:Pl,activeIndex:E})},[s]),w=fe(function(){s({type:Tl})},[s]);return{getSelectedItemProps:v,getDropdownProps:b,addSelectedItem:y,removeSelectedItem:H,setSelectedItems:$,setActiveIndex:D,reset:w,selectedItems:d,activeIndex:u}}var Vl=0,_l=1,El=2,Dl=3,Ol=4,Bl=5,Al=6,h4=Object.freeze({__proto__:null,FunctionAddItem:Al,TagClick:Vl,TagGroupKeyDownArrowLeft:_l,TagGroupKeyDownArrowRight:El,TagGroupKeyDownBackspace:Ol,TagGroupKeyDownDelete:Dl,TagRemoveClick:Bl});function v4(e,t,o){var r=o.type,a;switch(r){case Vl:a={activeIndex:o.index};break;case _l:a={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case El:a={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case Ol:case Dl:{var n=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),l=n.length===0?-1:n.length===e.activeIndex?e.activeIndex-1:e.activeIndex;a={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:l};break}case Bl:{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;a={items:i,activeIndex:s}}break;case Al:{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;a={items:u,activeIndex:d};break}default:throw new Error("Invalid useTagGroup reducer action.")}return ie({},e,a)}var x4=ie({},pe),_i=x4.useId,L4=typeof _i=="function"?w4:b4;function w4(e){var t=e.id,o=e.tagGroupId,r=e.getTagId,a="downshift-"+_i();t||(t=a);var n=pe.useMemo(function(){return{tagGroupId:o??t+"-tag-group",getTagId:r??function(l){return t+"-tag-"+l}}},[r,t,o]);return n}function b4(e){var t=e.id,o=e.getTagId,r=e.tagGroupId,a=pe.useRef(t??"downshift-"+ti()),n=a.current,l=pe.useMemo(function(){return{tagGroupId:r??n+"-tag-group",getTagId:o??function(i){return n+"-tag-"+i}}},[o,n,r]);return l}function I4(e){var t,o,r,a,n=(t=(o=e.items)!=null?o:e.initialItems)!=null?t:[],l=(r=(a=e.activeIndex)!=null?a:e.initialActiveIndex)!=null?r:n.length===0?-1:0;return{activeIndex:l,items:n}}function y4(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var Ei="tag-group-a11y-description";function M4(e,t){pe.useEffect(function(){if(e){var o=e.createElement("div");return o.setAttribute("id",Ei),o.style.display="none",o.textContent=t,e.body.appendChild(o),function(){o.remove()}}},[t,e])}function S4(e){return ie({stateReducer:function(o,r){var a=r.changes;return a},environment:typeof window>"u"?void 0:window,removeElementDescription:"Press Delete or Backspace to remove tag."},e)}function R4(e,t,o){var r=pe.useRef({}),a=pe.useRef(e),n=pe.useRef(t);return pe.useEffect(function(){if(e!==-1&&a.current!==-1&&e!==a.current||n.current===t+1){var l;(l=r.current[o(e)])==null||l.focus()}a.current=e,n.current=t},[e,o,t]),r}var H4={isItemDisabled:re.default.func},k4=["onKeyDown"],P4=["index","refKey","ref","onClick"],T4=["index","onClick"],Di=function(t){var o;t===void 0&&(t={}),Nn(t,Di,H4);var r=S4(t),a=qn(v4,r,I4,y4),n=a[0],l=a[1],i=n.activeIndex,s=n.items,u=Vo({state:n,props:r}),d=L4({getTagId:r.getTagId,id:r.id,tagGroupId:r.tagGroupId});M4((o=r.environment)==null?void 0:o.document,r.removeElementDescription);var c=R4(i,s.length,d.getTagId),C=fe(function(L){var I=L??{},v=I.onKeyDown,b=n1(I,k4),y=function(D){switch(D.key){case"ArrowLeft":l({type:_l});break;case"ArrowRight":l({type:El});break;case"Delete":l({type:Dl});break;case"Backspace":l({type:Ol});break}},H=ie({id:d.tagGroupId,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions",role:"listbox",onKeyDown:Fn(v,y)},b);return H},[l,d.tagGroupId]),m=fe(function(L){var I,v=L.index,b=L.refKey,y=b===void 0?"ref":b,H=L.ref,$=L.onClick,D=n1(L,P4);if(!Number.isInteger(v)||v<0)throw new Error("Pass correct item index to getTagProps!");var w=u.current.state,E=function(){l({type:Vl,index:v})},M=d.getTagId(v);return ie((I={"aria-describedby":Ei},I[y]=k7(H,function(P){P&&(c.current[M]=P)}),I["aria-labelledby"]=M,I.role="option",I.id=M,I.onClick=Fn($,E),I.tabIndex=w.activeIndex===v?0:-1,I),D)},[l,d,u,c]),f=fe(function(L){var I=L.index,v=L.onClick,b=n1(L,T4);if(!Number.isInteger(I)||I<0)throw new Error("Pass correct item index to getTagRemoveProps!");var y=function(w){w.stopPropagation(),l({type:Bl,index:I})},H=d.getTagId(I),$=H+"-remove";return ie({id:$,tabIndex:-1,"aria-labelledby":$+" "+H,onClick:Fn(v,y)},b)},[d,l]),S=fe(function(L,I){l({type:Al,item:L,index:I})},[l]);return{activeIndex:i,addItem:S,getTagGroupProps:C,getTagProps:m,getTagRemoveProps:f,items:s}};Di.stateChangeTypes=h4;import q1 from"react";import{createPortal as V4}from"react-dom";import{jsx as Tt,jsxs as Zl}from"react/jsx-runtime";var _4=260,Qr=4;function E4(e){let t=e.getBoundingClientRect(),o=Z1(e),r=o?o.getBoundingClientRect():{top:0,bottom:window.innerHeight},a=r.bottom-t.bottom-Qr,n=t.top-r.top-Qr,l=a<_4&&n>a;return{top:l?t.top-Qr:t.bottom+Qr,left:t.left,width:t.width,openAbove:l}}function Yr({label:e,options:t,dividerAfterValue:o,selectedItem:r,onChange:a,id:n="picklist",getOptionStyle:l,triggerLabel:i,triggerStyle:s}){let[u,d]=q1.useState({top:0,left:0,width:0,openAbove:!1}),c=q1.useRef(null),C=q1.useMemo(()=>{let M=new Map;return{document,Node:window.Node,addEventListener(P,K,W){let Q=te=>{let z={target:te.composedPath()[0]??te.target};typeof K=="function"?K(z):K.handleEvent(z)};M.set(K,Q),window.addEventListener(P,Q,W)},removeEventListener(P,K,W){let Q=M.get(K);Q&&window.removeEventListener(P,Q,W),M.delete(K)}}},[]),m=`${n}-legend`,{isOpen:f,closeMenu:S,highlightedIndex:L,getToggleButtonProps:I,getMenuProps:v,getItemProps:b}=Eo({environment:C,items:t,itemToString:M=>M?M.label:"",selectedItem:r,stateReducer:(M,{type:P,changes:K})=>P===Eo.stateChangeTypes.ToggleButtonBlur?{...K,selectedItem:M.selectedItem}:K,onSelectedItemChange:({selectedItem:M})=>{typeof a=="function"&&M&&M.value!==r?.value&&a(M.value)},onIsOpenChange:({isOpen:M})=>{M&&c.current&&d(E4(c.current))},id:n,labelId:m}),y=JSON.stringify(t.map(M=>M.value)),H=q1.useRef(y);q1.useLayoutEffect(()=>{H.current!==y&&S(),H.current=y},[y,S]),q1.useEffect(()=>{if(!f||!c.current)return;let M=Z1(c.current);if(!M)return;let P=()=>S();return M.addEventListener("scroll",P,{passive:!0}),()=>M.removeEventListener("scroll",P)},[f,S]);let $="picklistEditor-dropdown"+(f?" picklistEditor-dropdown--open":""),D=f?{top:u.top,left:u.left,width:u.width,...u.openAbove?{transform:"translateY(-100%)"}:void 0}:void 0,[w,E]=q1.useState(null);return q1.useLayoutEffect(()=>{let P=c.current?.getRootNode();E(P instanceof ShadowRoot?P:document.body)},[]),Tt(c1,{label:e,id:n,className:"picklistEditor-fieldset",children:Zl("div",{className:"picklistEditor-wrapper",children:[Zl("button",{type:"button",className:"picklistEditor-trigger",style:s,...I({ref:c}),children:[Tt("span",{className:"picklistEditor-trigger-label",children:i??r?.label??"Default"}),Tt("span",{className:"picklistEditor-trigger-chevron","aria-hidden":"true",children:Tt(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),V4(Tt("ul",{className:$,style:D,...v(),children:f&&t.map((M,P)=>Zl(q1.Fragment,{children:[Tt("li",{className:"picklistEditor-option"+(L===P?" picklistEditor-option--highlighted":"")+(r?.value===M.value?" picklistEditor-option--selected":""),style:l?l(M):void 0,...b({item:M,index:P}),children:M.label}),M.value===o&&Tt("li",{className:"picklistEditor-divider",role:"presentation","aria-hidden":"true"})]},M.value))}),w??document.body)]})})}import{jsx as O4}from"react/jsx-runtime";var Oi=[{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 Fl(e){return(e.split(",")[0]??"").trim().replace(/['"]/g,"")}function Bi(e,t){if(!e)return null;let o=Fl(e).toLowerCase();return o?t.find(r=>Fl(r.value).toLowerCase()===o)??null:null}function Ai(e){return Bi(e,Oi)!==null}var D4=e=>e.value?{fontFamily:e.value}:void 0;function Zi({label:e="Font family",value:t,computedValue:o,options:r,onChange:a,matchOption:n=Bi,id:l="font-family",useInheritLabel:i="Inherited"}){let s=r??Oi,u={value:"inherit",label:i},d=t==="inherit"?u:n(t,s),c=o??t,C=c==="inherit"?void 0:c,m=n(C,s),f="Default";m?f=m.label:C&&(f=Fl(C)||"Default");let S=C?{fontFamily:C}:void 0;return O4(Yr,{label:e,options:[u,...s],dividerAfterValue:"inherit",selectedItem:d,triggerLabel:f,triggerStyle:S,onChange:a,id:l,getOptionStyle:D4})}import{jsx as F4}from"react/jsx-runtime";var B4=[{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 A4(e){return B4.map(t=>{let o=e?.[t.labelKey]??t.defaultWord;return{value:t.value,label:o}})}function Z4(e,t){if(!e)return null;let o=String(e).trim();return t.find(r=>r.value===o)??null}function Fi({label:e="Font weight",value:t,computedValue:o,fontFamily:r,options:a,onChange:n,matchOption:l=Z4,id:i="font-weight",useInheritLabel:s="Inherited",optionLabels:u}){let d=a??A4(u),c=!a&&Ai(r)?d.filter(v=>v.value==="400"||v.value==="700"):d,C={value:"inherit",label:s},m=t==="inherit"?C:l(t,c),f=o??t,S=f==="inherit"?void 0:f,I=l(S,d)?.label??(S||"Default");return F4(Yr,{label:e,options:[C,...c],dividerAfterValue:"inherit",selectedItem:m,triggerLabel:I,onChange:n,id:i})}import ae from"react";import{createPortal as N4}from"react-dom";import{jsx as $i,jsxs as $4}from"react/jsx-runtime";function Ni({id:e,className:t,text:o}){return $4("p",{id:e,className:t?`fieldNotice ${t}`:"fieldNotice",children:[$i("svg",{className:"fieldNotice-icon",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:$i("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),o]})}import{Fragment as Ui,jsx as se,jsxs as Xe}from"react/jsx-runtime";var U4={tabCms:"CMS",tabLocal:"Local",tabUrl:"URL",ariaTablist:"Image source",clearImage:"Clear image",chooseFile:"Choose File...",ariaChooseFile:"Choose an image file from your computer",ariaImageUrl:"Image URL",urlPlaceholder:"https://example.com/image.png",previewAlt:"Preview",altText:"Alt Text",altPlaceholder:"Describe the image",sourceFromData:"This image comes from data, so you can't edit it here.",sourceNotEditable:"You can't edit this image here.",altFromData:"This alt text comes from data, so you can't edit it here.",altNotEditable:"You can't edit this alt text here.",sourceShared:"This image is used {0} times on this page. Changing it changes all of them.",altShared:"This alt text is used on {0} images. Changing it changes all of them.",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}"},to=["local","url"];function q4({labels:e,workspaceName:t,folderId:o,portalTarget:r,folderItemsResult:a,contentDetail:n,thumbnailResult:l,onFetchFolderItems:i,onFetchContentDetail:s,onFetchThumbnail:u,onCancel:d,onConfirm:c}){let[C,m]=ae.useState([]),[f,S]=ae.useState(0),[L,I]=ae.useState(!0),[v,b]=ae.useState(!1),[y,H]=ae.useState(null),[$,D]=ae.useState(null),[w,E]=ae.useState({}),[M,P]=ae.useState({}),K=ae.useRef(new Set),W=ae.useRef(new Set),Q=ae.useCallback(F=>{v||typeof i=="function"&&(b(!0),H(null),i(o,F,20))},[o,v,i]);ae.useEffect(()=>{Q(0)},[o]),ae.useEffect(()=>{let F=x=>{x.key==="Escape"&&(x.stopPropagation(),d())};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[d]);let te=ae.useRef(null);ae.useEffect(()=>{te.current?.focus()},[]),ae.useEffect(()=>{if(!a)return;let F=(a.items??[]).map(x=>({contentKey:x.contentKey,title:x.title??e.untitled,mimeType:x.mimeType??"image/png"}));m(x=>a.page===0?F:[...x,...F]),I(!!a.hasMore),S(a.page??0),b(!1),a.error&&H(String(a.error))},[a]),ae.useEffect(()=>{if(!n)return;let F=n.contentKey;if(!F||n.error)return;let x=n.url??"",j=n.mimeType??"image/png",N=n.title??"";E(X=>X[F]?X:{...X,[F]:{url:x,mimeType:j,title:N}}),x&&!W.current.has(F)&&typeof u=="function"&&(W.current.add(F),u(F,x,j))},[n,u]),ae.useEffect(()=>{if(!l)return;let{imageId:F,thumbnailUrl:x}=l;F&&x&&P(j=>({...j,[F]:x}))},[l]);let z=ae.useRef(null);ae.useEffect(()=>{let F=z.current;if(!F||!L||v)return;let x=new IntersectionObserver(j=>{j.some(X=>X.isIntersecting)&&Q(f+1)});return x.observe(F),()=>x.disconnect()},[L,v,f,Q]);let T=ae.useCallback(F=>{K.current.has(F)||typeof s=="function"&&(K.current.add(F),s(F))},[s]),A=()=>{if(!$)return;let F=w[$],x=C.find(j=>j.contentKey===$);!F||!x||c({contentKey:$,title:x.title,url:F.url,mimeType:F.mimeType||x.mimeType})};return N4(se("div",{ref:te,tabIndex:-1,className:"cmsPicker-overlay",role:"dialog","aria-modal":"true","aria-label":Ve(e.pickerTitle,[t]),onClick:F=>{F.target===F.currentTarget&&d()},children:Xe("div",{className:"cmsPicker-dialog",children:[Xe("div",{className:"cmsPicker-header",children:[se("span",{className:"cmsPicker-title",children:Ve(e.pickerTitle,[t])}),se("button",{type:"button",className:"cmsPicker-close",onClick:d,"aria-label":e.closePicker,title:e.closePicker,children:"\u2715"})]}),Xe("div",{className:"cmsPicker-body",children:[C.length===0&&v&&se("div",{className:"cmsPicker-empty",children:e.loadingImages}),C.length===0&&!v&&!y&&se("div",{className:"cmsPicker-empty",children:e.noImages}),y&&se("div",{className:"cmsPicker-empty",children:Ve(e.pickerError,[y])}),Xe("div",{className:"cmsPicker-grid",children:[C.map(F=>se(z4,{item:F,selected:$===F.contentKey,thumbnailDataUrl:M[F.contentKey],onIntersect:()=>T(F.contentKey),onClick:()=>D(F.contentKey)},F.contentKey)),L&&se("div",{className:"cmsPicker-sentinel",ref:z,children:v?e.loadingMore:""})]})]}),Xe("div",{className:"cmsPicker-footer",children:[se("button",{type:"button",className:"cmsPicker-btn",onClick:d,children:e.cancel}),se("button",{type:"button",className:"cmsPicker-btn cmsPicker-btn--primary",disabled:!$||!w[$??""],onClick:A,children:e.done})]})]})}),r)}function z4({item:e,selected:t,thumbnailDataUrl:o,onIntersect:r,onClick:a}){let n=ae.useRef(null),l=ae.useRef(!1);return ae.useEffect(()=>{let i=n.current;if(!i||l.current)return;let s=new IntersectionObserver(u=>{u.some(c=>c.isIntersecting)&&!l.current&&(l.current=!0,r(),s.disconnect())});return s.observe(i),()=>s.disconnect()},[r]),Xe("button",{ref:n,type:"button",className:`cmsPicker-thumb${t?" cmsPicker-thumb--selected":""}`,onClick:a,title:e.title,"aria-pressed":t,children:[se("div",{className:"cmsPicker-thumb-img",children:o?se("img",{src:o,alt:e.title}):se("div",{className:"cmsPicker-thumb-placeholder","aria-hidden":"true",children:"\u2026"})}),se("span",{className:"cmsPicker-thumb-label",children:e.title})]})}function j4({labels:e,spaces:t,spacesLoading:o,selectedSpaceId:r,onSpaceSelect:a,onOpenPicker:n}){return o?se("div",{className:"imageEditor-cms",children:se("div",{className:"imageEditor-cms-loading",children:e.loadingWorkspaces})}):t.length===0?se("div",{className:"imageEditor-cms",children:se("div",{className:"imageEditor-cms-empty",children:e.noWorkspaces})}):Xe("div",{className:"imageEditor-cms",children:[Xe("div",{className:"imageEditor-cms-channel",children:[se("label",{className:"imageEditor-cms-channel-label",htmlFor:"cms-space-select",children:e.workspace}),Xe("select",{id:"cms-space-select",className:"imageEditor-input imageEditor-cms-channel-select",value:r,onChange:l=>a(l.target.value),children:[se("option",{value:"",children:e.selectWorkspace}),t.map(l=>se("option",{value:l.id,children:l.name},l.id))]})]}),se("button",{type:"button",className:"imageEditor-cms-pick-btn",onClick:n,disabled:!r,children:e.selectImage})]})}function K4({labels:e,onPick:t}){return se("div",{className:"imageEditor-local",children:se("button",{className:"imageEditor-local-pick",onClick:t,type:"button","aria-label":e.ariaChooseFile,"aria-haspopup":"dialog",children:e.chooseFile})})}function qi({src:e,alt:t,className:o}){let[r,a]=ae.useState(!1);return ae.useEffect(()=>{a(!1)},[e]),r?null:se("img",{src:e,alt:t,className:o,onError:()=>a(!0)})}function G4({labels:e,input:t,onInputChange:o,onApply:r,currentUrl:a}){return Xe("div",{className:"imageEditor-url",children:[se("input",{type:"text",value:t,"aria-label":e.ariaImageUrl,placeholder:e.urlPlaceholder,className:"imageEditor-input",onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"&&t&&r(t)},onBlur:()=>{t&&t!==a&&r(t)}}),t&&se("div",{className:"imageEditor-url-preview",children:se(qi,{src:t,alt:e.previewAlt,className:"imageEditor-preview-thumb"})})]})}function W4({id:e,label:t,value:o,placeholder:r,readOnly:a,describedBy:n,onCommit:l}){let[i,s]=ae.useState(o),u=ae.useRef(l);u.current=l;let d=ae.useRef(o);ae.useEffect(()=>{o!==d.current&&(d.current=o,s(o))},[o]);let c=()=>{!a&&i!==o&&(d.current=i,u.current(i))};return Xe("div",{className:"imageEditor-attr",children:[se("label",{className:"imageEditor-attr-label",htmlFor:e,children:t}),se("input",{id:e,type:"text",value:i,placeholder:r,className:"imageEditor-input",disabled:a,"aria-describedby":n,onChange:C=>s(C.target.value),onKeyDown:C=>{C.key==="Enter"&&c()},onBlur:c})]})}function X4({labels:e,attributes:t,altReadOnly:o,describedBy:r,onAttributeChange:a}){return se("div",{className:"imageEditor-attrs",children:se(W4,{id:"design-img-alt",label:e.altText,value:t.alt,placeholder:e.altPlaceholder,readOnly:o,describedBy:r,onCommit:n=>a("alt",n)})})}function $l({label:e,value:t,onChange:o,id:r="image",attributes:a,onAttributeChange:n,sourceReadOnly:l,altReadOnly:i,sharedCount:s,cmsSpaces:u,cmsSpacesLoading:d,onFetchCmsSpaces:c,cmsFolderItemsResult:C,onFetchCmsFolderItems:m,cmsContentDetail:f,onFetchCmsContentDetail:S,cmsThumbnailResult:L,onFetchCmsThumbnail:I,onImportCmsImage:v,cmsImportResult:b,onPickLocalFile:y,localPreview:H,imageLabels:$}){let D=v1(U4,$),w=!!(a&&n),E=w&&!!i,M=l&&(l==="from-data"?D.sourceFromData:D.sourceNotEditable),P=E&&(i==="from-data"?D.altFromData:D.altNotEditable),K=s!==void 0&&s>1?s:void 0,W=K===void 0?void 0:l?w&&!E?Ve(D.altShared,[K]):void 0:Ve(D.sourceShared,[K]),Q=[M||P,W].filter(Boolean).join(" ")||void 0,te=`${r}-notice`,z={cms:D.tabCms,local:D.tabLocal,url:D.tabUrl},[T,A]=ae.useState("local"),[F,x]=ae.useState(""),[j,N]=ae.useState(!1),X=ae.useRef(o);X.current=o;let g=ae.useRef(t);g.current=t;let O=ae.useRef(!!l);O.current=!!l;let V=ae.useRef(H);ae.useEffect(()=>{if(!H||H===V.current||(V.current=H,O.current))return;let k=H.devUrl||H.webviewUri;k&&k!==g.current&&X.current(k)},[H]);let p=k=>k?.startsWith("data:")?"":k??"",[Z,U]=ae.useState(()=>p(t)),q=ae.useRef(t??"");ae.useEffect(()=>{let k=t??"";k!==q.current&&(q.current=k,U(p(k)))},[t]);let[h,R]=ae.useState("idle"),G=ae.useRef(null),ee=ae.useRef(null),xe=ae.useCallback(()=>{let k=ee.current?.getRootNode();return k instanceof ShadowRoot?k:document.body},[]),he=ae.useRef({}),ze=ae.useCallback(k=>{A(k),he.current[k]?.focus()},[]),Ie=ae.useCallback((k,ne)=>{let oe=null;switch(k.key){case"ArrowRight":oe=(ne+1)%to.length;break;case"ArrowLeft":oe=(ne-1+to.length)%to.length;break;case"Home":oe=0;break;case"End":oe=to.length-1;break;default:return}k.preventDefault();let Se=to[oe];Se&&ze(Se)},[ze]),ye=u??[],Me=d??!1,Ce=t||"";ae.useEffect(()=>{if(b){if(O.current){R("idle");return}if(b.success&&b.devUrl)o(b.devUrl),R("success");else{let k=G.current?.url;k?(o(k),R("success")):R("error")}}},[b,o]),ae.useEffect(()=>{T==="cms"&&ye.length===0&&!Me&&typeof c=="function"&&c()},[T]);let je=ae.useMemo(()=>ye.find(k=>k.id===F)??null,[ye,F]),we=ae.useCallback(k=>{if(O.current){N(!1);return}let ne={id:k.contentKey,title:k.title,url:k.url,thumbnailUrl:"",contentType:k.mimeType};G.current=ne,N(!1),typeof v=="function"&&ne.url?(R("importing"),v(ne)):ne.url&&o(ne.url)},[o,v]),Ye=se(c1,{label:e,id:r,className:"imageEditor-fieldset",children:Xe("div",{ref:ee,className:"imageEditor-root",children:[Ce&&Xe("div",{className:`imageEditor-current${l?" imageEditor-current--readonly":""}`,children:[se(qi,{src:Ce,alt:"",className:"imageEditor-current-thumb"}),se("span",{className:"imageEditor-current-url",title:Ce,children:Ce.length>30?`...${Ce.slice(-30)}`:Ce}),!l&&se("button",{className:"imageEditor-clear",onClick:()=>o(""),title:D.clearImage,"aria-label":D.clearImage,type:"button",children:"\u2715"})]}),!l&&Xe(Ui,{children:[se("div",{className:"imageEditor-tabs",role:"tablist","aria-label":D.ariaTablist,"aria-describedby":W?te:void 0,children:to.map((k,ne)=>se("button",{id:`${r}-tab-${k}`,ref:oe=>{he.current[k]=oe},role:"tab",type:"button","aria-selected":T===k,"aria-controls":`${r}-tabpanel`,tabIndex:T===k?0:-1,className:`imageEditor-tab${T===k?" imageEditor-tab--active":""}`,onClick:()=>A(k),onKeyDown:oe=>Ie(oe,ne),children:z[k]},k))}),Xe("div",{className:"imageEditor-tab-content",role:"tabpanel",id:`${r}-tabpanel`,"aria-labelledby":`${r}-tab-${T}`,children:[T==="cms"&&se(j4,{labels:D,spaces:ye,spacesLoading:Me,selectedSpaceId:F,onSpaceSelect:x,onOpenPicker:()=>N(!0)}),T==="cms"&&h==="importing"&&se("div",{className:"imageEditor-cms-loading",children:D.downloadingImage}),T==="cms"&&h==="error"&&se("div",{className:"imageEditor-cms-empty",children:D.downloadFailed}),T==="local"&&se(K4,{labels:D,onPick:()=>y?.()}),T==="url"&&se(G4,{labels:D,input:Z,onInputChange:U,onApply:k=>{q.current=k,o(k)},currentUrl:Ce})]})]}),a&&n&&se(X4,{labels:D,attributes:a,altReadOnly:!!i,describedBy:Q&&(i||W)?te:void 0,onAttributeChange:n}),j&&je&&se(q4,{labels:D,workspaceName:je.name,folderId:je.rootFolderId,portalTarget:xe(),folderItemsResult:C,contentDetail:f,thumbnailResult:L,onFetchFolderItems:m,onFetchContentDetail:S,onFetchThumbnail:I,onCancel:()=>N(!1),onConfirm:we})]})});return Xe(Ui,{children:[Q&&se(Ni,{id:te,className:"imageEditor-notice",text:Q}),Ye]})}import I1 from"react";import*as z1 from"react";import{jsx as Q4}from"react/jsx-runtime";function oo(e,t=[]){let o=[];function r(n,l){let i=z1.createContext(l),s=o.length;o=[...o,l];let u=c=>{let{scope:C,children:m,...f}=c,S=C?.[e]?.[s]||i,L=z1.useMemo(()=>f,Object.values(f));return Q4(S.Provider,{value:L,children:m})};u.displayName=n+"Provider";function d(c,C){let m=C?.[e]?.[s]||i,f=z1.useContext(m);if(f)return f;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let a=()=>{let n=o.map(l=>z1.createContext(l));return function(i){let s=i?.[e]||n;return z1.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[r,Y4(a,...t)]}function Y4(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){let l=r.reduce((i,{useScope:s,scopeName:u})=>{let c=s(n)[`__scope${u}`];return{...i,...c}},{});return z1.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return o.scopeName=t.scopeName,o}import*as Wi from"react";import*as nc from"react-dom";import*as Be from"react";import*as J4 from"react";function zi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ji(...e){return t=>{let o=!1,r=e.map(a=>{let n=zi(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():zi(e[a],null)}}}}import{Fragment as wb,jsx as Ki}from"react/jsx-runtime";function Gi(e){let t=ec(e),o=Be.forwardRef((r,a)=>{let{children:n,...l}=r,i=Be.Children.toArray(n),s=i.find(oc);if(s){let u=s.props.children,d=i.map(c=>c===s?Be.Children.count(u)>1?Be.Children.only(null):Be.isValidElement(u)?u.props.children:null:c);return Ki(t,{...l,ref:a,children:Be.isValidElement(u)?Be.cloneElement(u,void 0,d):null})}return Ki(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function ec(e){let t=Be.forwardRef((o,r)=>{let{children:a,...n}=o;if(Be.isValidElement(a)){let l=ac(a),i=rc(n,a.props);return a.type!==Be.Fragment&&(i.ref=r?ji(r,l):l),Be.cloneElement(a,i)}return Be.Children.count(a)>1?Be.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tc=Symbol("radix.slottable");function oc(e){return Be.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tc}function rc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function ac(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 lc}from"react/jsx-runtime";var ic=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nl=ic.reduce((e,t)=>{let o=Gi(`Primitive.${t}`),r=Wi.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),lc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as qe from"react";var Sb=!!(typeof window<"u"&&window.document&&window.document.createElement);function j1(e,t,{checkForDefaultPrevented:o=!0}={}){return function(a){if(e?.(a),o===!1||!a.defaultPrevented)return t?.(a)}}import Vt from"react";import*as Qi from"react";function Xi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ul(...e){return t=>{let o=!1,r=e.map(a=>{let n=Xi(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():Xi(e[a],null)}}}}function ql(...e){return Qi.useCallback(Ul(...e),e)}import*as Ae from"react";import{Fragment as Tb,jsx as Yi}from"react/jsx-runtime";function zl(e){let t=sc(e),o=Ae.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ae.Children.toArray(n),s=i.find(dc);if(s){let u=s.props.children,d=i.map(c=>c===s?Ae.Children.count(u)>1?Ae.Children.only(null):Ae.isValidElement(u)?u.props.children:null:c);return Yi(t,{...l,ref:a,children:Ae.isValidElement(u)?Ae.cloneElement(u,void 0,d):null})}return Yi(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function sc(e){let t=Ae.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ae.isValidElement(a)){let l=fc(a),i=cc(n,a.props);return a.type!==Ae.Fragment&&(i.ref=r?Ul(r,l):l),Ae.cloneElement(a,i)}return Ae.Children.count(a)>1?Ae.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uc=Symbol("radix.slottable");function dc(e){return Ae.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uc}function cc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function fc(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 jl}from"react/jsx-runtime";import Nb from"react";import{jsx as qb}from"react/jsx-runtime";function Ji(e){let t=e+"CollectionProvider",[o,r]=oo(t),[a,n]=o(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{let{scope:L,children:I}=S,v=Vt.useRef(null),b=Vt.useRef(new Map).current;return jl(a,{scope:L,itemMap:b,collectionRef:v,children:I})};l.displayName=t;let i=e+"CollectionSlot",s=zl(i),u=Vt.forwardRef((S,L)=>{let{scope:I,children:v}=S,b=n(i,I),y=ql(L,b.collectionRef);return jl(s,{ref:y,children:v})});u.displayName=i;let d=e+"CollectionItemSlot",c="data-radix-collection-item",C=zl(d),m=Vt.forwardRef((S,L)=>{let{scope:I,children:v,...b}=S,y=Vt.useRef(null),H=ql(L,y),$=n(d,I);return Vt.useEffect(()=>($.itemMap.set(y,{ref:y,...b}),()=>{$.itemMap.delete(y)})),jl(C,{[c]:"",ref:H,children:v})});m.displayName=d;function f(S){let L=n(e+"CollectionConsumer",S);return Vt.useCallback(()=>{let v=L.collectionRef.current;if(!v)return[];let b=Array.from(v.querySelectorAll(`[${c}]`));return Array.from(L.itemMap.values()).sort(($,D)=>b.indexOf($.ref.current)-b.indexOf(D.ref.current))},[L.collectionRef,L.itemMap])}return[{Provider:l,Slot:u,ItemSlot:m},f,r]}import*as t5 from"react";function e5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kl(...e){return t=>{let o=!1,r=e.map(a=>{let n=e5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():e5(e[a],null)}}}}function o5(...e){return t5.useCallback(Kl(...e),e)}import*as Gl from"react";import*as r5 from"react";var Jr=globalThis?.document?r5.useLayoutEffect:()=>{};var pc=Gl[" useId ".trim().toString()]||(()=>{}),Cc=0;function a5(e){let[t,o]=Gl.useState(pc());return Jr(()=>{e||o(r=>r??String(Cc++))},[e]),e||(t?`radix-${t}`:"")}import*as i5 from"react";import*as Lc from"react-dom";import*as Ze from"react";import{Fragment as Jb,jsx as n5}from"react/jsx-runtime";function l5(e){let t=mc(e),o=Ze.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ze.Children.toArray(n),s=i.find(hc);if(s){let u=s.props.children,d=i.map(c=>c===s?Ze.Children.count(u)>1?Ze.Children.only(null):Ze.isValidElement(u)?u.props.children:null:c);return n5(t,{...l,ref:a,children:Ze.isValidElement(u)?Ze.cloneElement(u,void 0,d):null})}return n5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function mc(e){let t=Ze.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ze.isValidElement(a)){let l=xc(a),i=vc(n,a.props);return a.type!==Ze.Fragment&&(i.ref=r?Kl(r,l):l),Ze.cloneElement(a,i)}return Ze.Children.count(a)>1?Ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gc=Symbol("radix.slottable");function hc(e){return Ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gc}function vc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function xc(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 wc}from"react/jsx-runtime";var bc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wl=bc.reduce((e,t)=>{let o=l5(`Primitive.${t}`),r=i5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),wc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as ro from"react";function s5(e){let t=ro.useRef(e);return ro.useEffect(()=>{t.current=e}),ro.useMemo(()=>(...o)=>t.current?.(...o),[])}import*as h1 from"react";import*as ea from"react";var Ic=h1[" useInsertionEffect ".trim().toString()]||Jr;function _t({prop:e,defaultProp:t,onChange:o=()=>{},caller:r}){let[a,n,l]=yc({defaultProp:t,onChange:o}),i=e!==void 0,s=i?e:a;{let d=h1.useRef(e!==void 0);h1.useEffect(()=>{let c=d.current;c!==i&&console.warn(`${r} is changing from ${c?"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,r])}let u=h1.useCallback(d=>{if(i){let c=Mc(d)?d(e):d;c!==e&&l.current?.(c)}else n(d)},[i,e,n,l]);return[s,u]}function yc({defaultProp:e,onChange:t}){let[o,r]=h1.useState(e),a=h1.useRef(o),n=h1.useRef(t);return Ic(()=>{n.current=t},[t]),h1.useEffect(()=>{a.current!==o&&(n.current?.(o),a.current=o)},[o,a]),[o,r,n]}function Mc(e){return typeof e=="function"}import*as ta from"react";import{jsx as sI}from"react/jsx-runtime";var Sc=ta.createContext(void 0);function oa(e){let t=ta.useContext(Sc);return e||t||"ltr"}import{jsx as Et}from"react/jsx-runtime";var Xl="rovingFocusGroup.onEntryFocus",Rc={bubbles:!1,cancelable:!0},Do="RovingFocusGroup",[Ql,u5,Hc]=Ji(Do),[kc,Yl]=oo(Do,[Hc]),[Pc,Tc]=kc(Do),d5=qe.forwardRef((e,t)=>Et(Ql.Provider,{scope:e.__scopeRovingFocusGroup,children:Et(Ql.Slot,{scope:e.__scopeRovingFocusGroup,children:Et(Vc,{...e,ref:t})})}));d5.displayName=Do;var Vc=qe.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:n,currentTabStopId:l,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,C=qe.useRef(null),m=o5(t,C),f=oa(n),[S,L]=_t({prop:l,defaultProp:i??null,onChange:s,caller:Do}),[I,v]=qe.useState(!1),b=s5(u),y=u5(o),H=qe.useRef(!1),[$,D]=qe.useState(0);return qe.useEffect(()=>{let w=C.current;if(w)return w.addEventListener(Xl,b),()=>w.removeEventListener(Xl,b)},[b]),Et(Pc,{scope:o,orientation:r,dir:f,loop:a,currentTabStopId:S,onItemFocus:qe.useCallback(w=>L(w),[L]),onItemShiftTab:qe.useCallback(()=>v(!0),[]),onFocusableItemAdd:qe.useCallback(()=>D(w=>w+1),[]),onFocusableItemRemove:qe.useCallback(()=>D(w=>w-1),[]),children:Et(Wl.div,{tabIndex:I||$===0?-1:0,"data-orientation":r,...c,ref:m,style:{outline:"none",...e.style},onMouseDown:j1(e.onMouseDown,()=>{H.current=!0}),onFocus:j1(e.onFocus,w=>{let E=!H.current;if(w.target===w.currentTarget&&E&&!I){let M=new CustomEvent(Xl,Rc);if(w.currentTarget.dispatchEvent(M),!M.defaultPrevented){let P=y().filter(z=>z.focusable),K=P.find(z=>z.active),W=P.find(z=>z.id===S),te=[K,W,...P].filter(Boolean).map(z=>z.ref.current);p5(te,d)}}H.current=!1}),onBlur:j1(e.onBlur,()=>v(!1))})})}),c5="RovingFocusGroupItem",f5=qe.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:n,children:l,...i}=e,s=a5(),u=n||s,d=Tc(c5,o),c=d.currentTabStopId===u,C=u5(o),{onFocusableItemAdd:m,onFocusableItemRemove:f,currentTabStopId:S}=d;return qe.useEffect(()=>{if(r)return m(),()=>f()},[r,m,f]),Et(Ql.ItemSlot,{scope:o,id:u,focusable:r,active:a,children:Et(Wl.span,{tabIndex:c?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:j1(e.onMouseDown,L=>{r?d.onItemFocus(u):L.preventDefault()}),onFocus:j1(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:j1(e.onKeyDown,L=>{if(L.key==="Tab"&&L.shiftKey){d.onItemShiftTab();return}if(L.target!==L.currentTarget)return;let I=Dc(L,d.orientation,d.dir);if(I!==void 0){if(L.metaKey||L.ctrlKey||L.altKey||L.shiftKey)return;L.preventDefault();let b=C().filter(y=>y.focusable).map(y=>y.ref.current);if(I==="last")b.reverse();else if(I==="prev"||I==="next"){I==="prev"&&b.reverse();let y=b.indexOf(L.currentTarget);b=d.loop?Oc(b,y+1):b.slice(y+1)}setTimeout(()=>p5(b))}}),children:typeof l=="function"?l({isCurrentTabStop:c,hasTabStop:S!=null}):l})})});f5.displayName=c5;var _c={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ec(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Dc(e,t,o){let r=Ec(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _c[r]}function p5(e,t=!1){let o=document.activeElement;for(let r of e)if(r===o||(r.focus({preventScroll:t}),document.activeElement!==o))return}function Oc(e,t){return e.map((o,r)=>e[(t+r)%e.length])}var C5=d5,m5=f5;import*as b5 from"react";import*as L5 from"react";import*as qc from"react-dom";import*as Fe from"react";import*as Ac from"react";function g5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function h5(...e){return t=>{let o=!1,r=e.map(a=>{let n=g5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():g5(e[a],null)}}}}import{Fragment as II,jsx as v5}from"react/jsx-runtime";function x5(e){let t=Zc(e),o=Fe.forwardRef((r,a)=>{let{children:n,...l}=r,i=Fe.Children.toArray(n),s=i.find($c);if(s){let u=s.props.children,d=i.map(c=>c===s?Fe.Children.count(u)>1?Fe.Children.only(null):Fe.isValidElement(u)?u.props.children:null:c);return v5(t,{...l,ref:a,children:Fe.isValidElement(u)?Fe.cloneElement(u,void 0,d):null})}return v5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function Zc(e){let t=Fe.forwardRef((o,r)=>{let{children:a,...n}=o;if(Fe.isValidElement(a)){let l=Uc(a),i=Nc(n,a.props);return a.type!==Fe.Fragment&&(i.ref=r?h5(r,l):l),Fe.cloneElement(a,i)}return Fe.Children.count(a)>1?Fe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fc=Symbol("radix.slottable");function $c(e){return Fe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fc}function Nc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function Uc(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 zc}from"react/jsx-runtime";var jc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],w5=jc.reduce((e,t)=>{let o=x5(`Primitive.${t}`),r=L5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),zc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import{jsx as Kc}from"react/jsx-runtime";var I5="Toggle",Jl=b5.forwardRef((e,t)=>{let{pressed:o,defaultPressed:r,onPressedChange:a,...n}=e,[l,i]=_t({prop:o,onChange:a,defaultProp:r??!1,caller:I5});return Kc(w5.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...n,ref:t,onClick:j1(e.onClick,()=>{e.disabled||i(!l)})})});Jl.displayName=I5;import{jsx as i1}from"react/jsx-runtime";var gt="ToggleGroup",[M5,$I]=oo(gt,[Yl]),S5=Yl(),e2=I1.forwardRef((e,t)=>{let{type:o,...r}=e;if(o==="single")return i1(Gc,{...r,ref:t});if(o==="multiple")return i1(Wc,{...r,ref:t});throw new Error(`Missing prop \`type\` expected on \`${gt}\``)});e2.displayName=gt;var[R5,H5]=M5(gt),Gc=I1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=_t({prop:o,defaultProp:r??"",onChange:a,caller:gt});return i1(R5,{scope:e.__scopeToggleGroup,type:"single",value:I1.useMemo(()=>l?[l]:[],[l]),onItemActivate:i,onItemDeactivate:I1.useCallback(()=>i(""),[i]),children:i1(k5,{...n,ref:t})})}),Wc=I1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=_t({prop:o,defaultProp:r??[],onChange:a,caller:gt}),s=I1.useCallback(d=>i((c=[])=>[...c,d]),[i]),u=I1.useCallback(d=>i((c=[])=>c.filter(C=>C!==d)),[i]);return i1(R5,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:s,onItemDeactivate:u,children:i1(k5,{...n,ref:t})})});e2.displayName=gt;var[Xc,Qc]=M5(gt),k5=I1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,disabled:r=!1,rovingFocus:a=!0,orientation:n,dir:l,loop:i=!0,...s}=e,u=S5(o),d=oa(l),c={role:"group",dir:d,...s};return i1(Xc,{scope:o,rovingFocus:a,disabled:r,children:a?i1(C5,{asChild:!0,...u,orientation:n,dir:d,loop:i,children:i1(Nl.div,{...c,ref:t})}):i1(Nl.div,{...c,ref:t})})}),ra="ToggleGroupItem",P5=I1.forwardRef((e,t)=>{let o=H5(ra,e.__scopeToggleGroup),r=Qc(ra,e.__scopeToggleGroup),a=S5(e.__scopeToggleGroup),n=o.value.includes(e.value),l=r.disabled||e.disabled,i={...e,pressed:n,disabled:l},s=I1.useRef(null);return r.rovingFocus?i1(m5,{asChild:!0,...a,focusable:!l,active:n,ref:s,children:i1(y5,{...i,ref:t})}):i1(y5,{...i,ref:t})});P5.displayName=ra;var y5=I1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,value:r,...a}=e,n=H5(ra,o),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=n.type==="single"?l:void 0;return i1(Jl,{...i,...a,ref:t,onPressedChange:s=>{s?n.onItemActivate(r):n.onItemDeactivate(r)}})}),t2=e2,T5=P5;import{jsx as aa}from"react/jsx-runtime";function na(e){let t=e.options.map(o=>aa(T5,{value:o.value,className:"buttonGroupEditor-item","aria-label":o.label,title:o.label,children:o.icon??o.label},o.value));return aa(c1,{label:e.label,id:e.id,children:e.type==="single"?aa(t2,{type:"single",value:e.value,onValueChange:o=>{o&&e.onChange(o)},className:"buttonGroupEditor-root","aria-label":e.label,children:t}):aa(t2,{type:"multiple",value:e.value,onValueChange:e.onChange,className:"buttonGroupEditor-root",children:t})})}import{jsx as V5}from"react/jsx-runtime";var Jc={uppercase:"M3.04 8.96L3.04 1.96L0.50 1.96L0.50 0.50L7.34 0.50L7.34 1.96L4.81 1.96L4.81 8.96ZM11.20 8.96L11.20 1.96L8.66 1.96L8.66 0.50L15.51 0.50L15.51 1.96L12.97 1.96L12.97 8.96Z",italic:"M380 123v-13a20 20 0 0 0-20-20H220a20 20 0 0 0-20 20v20c0 11 9 20 20 20 17 0 30 16 26 32l-36 176a27 27 0 0 1-26 22h-24a20 20 0 0 0-20 20v20c0 11 9 20 20 20h140a20 20 0 0 0 20-20v-20a20 20 0 0 0-20-20c-17 0-30-16-26-32l36-176a27 27 0 0 1 26-22h17c15 0 27-12 27-27",underline:"M445 420H75c-8 0-15 7-15 15v30c0 8 7 15 15 15h370c8 0 15-7 15-15v-30c0-8-7-15-15-15m-192-40a143 143 0 0 1-133-144V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v137c0 43 32 80 75 83a80 80 0 0 0 85-80V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v140a140 140 0 0 1-147 140",left_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-80 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",center_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-60 120c0-8-7-15-15-15H115c-8 0-15 7-15 15v30c0 8 7 15 15 15h290c8 0 15-7 15-15zm-20 240c0-8-7-15-15-15H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h250c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",right_align_text:"M465 50H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15V65c0-8-7-15-15-15m0 120H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0 240H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0-120H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15v-30c0-8-7-15-15-15",justify_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z"};function K1({name:e}){return V5("svg",{className:"slds-button__icon",width:e==="uppercase"?16.01:14,height:e==="uppercase"?9.46:14,viewBox:e==="uppercase"?"0 0 16.01 9.46":"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:V5("path",{d:Jc[e]})})}import{jsx as Oo}from"react/jsx-runtime";var e8=[{value:"left",labelKey:"left",defaultLabel:"Left",icon:Oo(K1,{name:"left_align_text"})},{value:"center",labelKey:"center",defaultLabel:"Center",icon:Oo(K1,{name:"center_align_text"})},{value:"right",labelKey:"right",defaultLabel:"Right",icon:Oo(K1,{name:"right_align_text"})},{value:"justify",labelKey:"justify",defaultLabel:"Justify",icon:Oo(K1,{name:"justify_text"})}],t8={start:"left",end:"right"};function _5({label:e="Text Align",value:t,onChange:o,id:r="text-align",optionLabels:a}){let n=t8[t||""]||t||"left",l=e8.map(i=>({value:i.value,label:a?.[i.labelKey]??i.defaultLabel,icon:i.icon}));return Oo(na,{type:"single",label:e,options:l,value:n,onChange:o,id:r})}import{jsx as la}from"react/jsx-runtime";function E5({label:e="Text Styling",id:t="text-style",fontStyle:o,textDecoration:r,textTransform:a,onChange:n,optionLabels:l}){let i=[{property:"fontStyle",label:l?.italic??"Italic",pressed:o?.trim().toLowerCase()==="italic",on:"italic",off:"normal",icon:la(K1,{name:"italic"})},{property:"textDecoration",label:l?.underline??"Underline",pressed:r?.trim().toLowerCase().split(/\s+/).includes("underline")??!1,on:"underline",off:"none",icon:la(K1,{name:"underline"})},{property:"textTransform",label:l?.uppercase??"Uppercase",pressed:a?.trim().toLowerCase()==="uppercase",on:"uppercase",off:"none",icon:la(K1,{name:"uppercase"})}];return la(na,{type:"multiple",label:e,id:t,options:i.map(s=>({...s,value:s.property})),value:i.filter(s=>s.pressed).map(s=>s.property),onChange:s=>{for(let u of i){let d=s.includes(u.property);d!==u.pressed&&n(u.property,d?u.on:u.off)}}})}var D5="textContent";var o8=e=>e!=null&&typeof e=="object"&&"property"in e,r8=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 O5(e){let t=[],o=new Map,r=n=>{let l=r8(n);if(!l)return;let{sourceFile:i,lineNumber:s,columnNumber:u}=l,d=`${i}\0${s}:${u}`,c=o.get(d);return c||(c={byProperty:new Map,baselineByProperty:new Map,mediaByAttribute:new Map,debugSource:l},o.set(d,c),t.push(c)),c},a=(n,l,i)=>{n.baselineByProperty.has(l)||n.baselineByProperty.set(l,String(i??""))};for(let n of e){let l=n.data;if(n.type==="style"&&l?.property!=null){let i=r(l);if(i){let s=String(l.property);a(i,s,n.oldValue),i.byProperty.set(s,String(n.newValue??""))}}else if(n.type==="style-batch"&&Array.isArray(l?.changes)){let i=r(l);for(let s of l.changes)if(i&&o8(s)&&s.property!=null){let u=String(s.property);a(i,u,s.oldValue),i.byProperty.set(u,String(s.newValue??""))}}else if(n.type==="text")r(l)?.byProperty.set(D5,String(n.newValue??""));else if(n.type==="media"&&typeof l?.attribute=="string"&&l.attribute!==""){let i=r(l),s=String(n.newValue??""),u=i?.mediaByAttribute.get(l.attribute);u?u.value=s:i?.mediaByAttribute.set(l.attribute,{oldValue:String(n.oldValue??""),value:s})}}return t.map(n=>{let l=[...n.byProperty].map(([u,d])=>({property:u,value:d})).filter(u=>u.property===D5||u.value!==""||n.baselineByProperty.get(u.property)!==""),i=[...n.mediaByAttribute].filter(([,u])=>u.value!==u.oldValue).map(([u,d])=>({changeType:"attribute",attribute:u,value:d.value,oldValue:d.oldValue})),s=[...l,...i];return{debugSource:n.debugSource,commands:s}}).filter(n=>n.commands.length>0)}var ht={CHANGED:"history-changed",COMMAND_PUSHED:"command-pushed",COMMAND_UNDONE:"command-undone",COMMAND_REDONE:"command-redone",CLEARED:"history-cleared"},ia=class{constructor(t={}){bt(this,"undoStack",[]);bt(this,"redoStack",[]);bt(this,"maxHistorySize");bt(this,"listeners",new Set);bt(this,"_isProcessing",!1);bt(this,"commandExecutor");if(this.maxHistorySize=t.maxHistorySize??200,!t.commandExecutor)throw new Error("CommandExecutor is required");this.commandExecutor=t.commandExecutor}createCommand(t,o,r,a){return Object.freeze({id:this._generateCommandId(),type:t,oldValue:o,newValue:r,data:a})}_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 r=Object.freeze({type:t,timestamp:Date.now(),canUndo:this.canUndo(),canRedo:this.canRedo(),undoCount:this.getUndoCount(),redoCount:this.getRedoCount(),...o}),a=Array.from(this.listeners);for(let n of a)try{n(r)}catch(l){console.error("[HistoryManager] Error in listener:",l)}}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(ht.COMMAND_PUSHED,{command:t}),this._notify(ht.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(r){return console.error("[HistoryManager] Error applying command:",r,t),!1}}_createInverseCommand(t,o){let r=this.commandExecutor.getCurrentValue(t);return Object.freeze({id:this._generateCommandId(),type:t.type,oldValue:o?t.oldValue:r,newValue:o?r: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 r=this._createInverseCommand(t,!1);this.redoStack.push(r)}else this.undoStack.push(t),console.warn("[HistoryManager] Undo failed, command restored to stack");return this._notify(ht.COMMAND_UNDONE,{command:t,appliedValue:t.oldValue}),this._notify(ht.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 r=this._createInverseCommand(t,!0);this.undoStack.push(r),this._trimStack()}else this.redoStack.push(t),console.warn("[HistoryManager] Redo failed, command restored to stack");return this._notify(ht.COMMAND_REDONE,{command:t,appliedValue:t.newValue}),this._notify(ht.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(ht.CLEARED),this._notify(ht.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 a8=(e,t)=>{let o=t?e.oldValue:e.newValue;return typeof o=="string"?o:String(o??"")},sa=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}},n8=e=>typeof e=="object"&&e!==null&&"property"in e&&typeof e.property=="string",l8=e=>typeof e=="object"&&e!==null&&Array.isArray(e.changes)&&e.changes.every(t=>t!=null&&typeof t.property=="string"),i8=e=>typeof e=="object"&&e!==null&&"tag"in e&&typeof e.tag=="string"&&"attribute"in e&&typeof e.attribute=="string",B5=(e,t,o)=>{let r=new Map;return{execute:(a,n)=>{let l=a8(a,n);r.set(a.id,l);try{if(a.type==="style"&&n8(a.data)){let i=sa(a.data);return e(a.data.property,l,i),!0}else if(a.type==="style-batch"&&l8(a.data)){let i=sa(a.data);for(let s of a.data.changes)e(s.property,n?s.oldValue:s.newValue,i);return!0}else if(a.type==="text"){let i=sa(a.data);return t(l,i),!0}else if(a.type==="media"&&i8(a.data)){if(!o)return!1;let i=sa(a.data);return o(a.data.tag,{[a.data.attribute]:l},i),!0}}catch{return!1}return!1},getCurrentValue:a=>r.get(a.id)??a.newValue,canHandle:a=>a==="style"||a==="style-batch"||a==="text"||a==="media"&&typeof o=="function"}};function A5(e,t,o){let r=B5(e,t,o),a=new ia({commandExecutor:r});return{recordStyleChange(n,l,i,s){let u=a.createCommand("style",l,i,{...s,property:n});a.pushCommand(u)},recordStyleBatch(n,l){if(n.length===0)return;let i=n[0],s=a.createCommand("style-batch",i.oldValue,i.newValue,{...l,changes:n});a.pushCommand(s)},recordTextChange(n,l,i){let s=a.createCommand("text",n,l,{...i});a.pushCommand(s)},recordMediaChange(n,l,i,s,u){let d=a.createCommand("media",i,s,{...u,tag:n,attribute:l});a.pushCommand(d)},undo:()=>a.undo(),redo:()=>a.redo(),canUndo:()=>a.canUndo(),canRedo:()=>a.canRedo(),subscribe:n=>a.subscribe(n),getHistoryStack:()=>a.getUndoStackSnapshot(),clear:()=>a.clear(),getUndoCount:()=>a.getUndoCount(),getMaxHistorySize:()=>a.getMaxHistorySize()}}var o2=`url\\(\\s*(['"]?)([^'")]+)\\1\\s*\\)`,s8=new RegExp(o2,"i");function ua(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function r2(e){let t=ua((e??"").trim());for(let o=0;o<t.length;o++){let r=t[o]??"",a=s8.exec(r);if(a?.[2])return{index:o,layer:r,path:a[2].trim()}}return null}var u8=new RegExp(o2,"i");function d8(e,t){let o=`url("${t}")`,r=(e??"").trim();if(!$1(r))return o;let a=r2(r),n=ua(r);return a?n.map((l,i)=>i===a.index?l.replace(u8,()=>o):l).join(", "):[o,...n].join(", ")}function c8(e){let t=(e??"").trim();if(!$1(t))return"none";let o=r2(t);if(!o)return t;let r=ua(t);return r.splice(o.index,1),r.length===0?"none":r.join(", ")}function Z5(e,t){return t.trim()===""?c8(e):d8(e,t)}import{Fragment as H8,jsx as ue,jsxs as Qe}from"react/jsx-runtime";var ca=["top","right","bottom","left"];function n2(e,t,o){let r=O1[e];return r.some(a=>o?.[a]!=null)?Object.fromEntries(r.map((a,n)=>[ca[n],t[a]??""])):et(t[e]??"")}function Ao(e,t){let o=ca.map(n=>t[n].trim().split(/\s+/)),r=e==="borderRadius";if(o.some(n=>n.length>(r?2:1)||n.some(l=>{let i=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(px|%)?$/i.exec(l);return!i||!Number.isFinite(Number(i[1]))||e!=="margin"&&Number(i[1])<0||(i[2]==="%"?!r:!i[2]&&Number(i[1])!==0)})))return;let a=o.map(n=>n[0]).join(" ");return r&&o.some(n=>n.length===2)?`${a} / ${o.map(n=>n[1]??n[0]).join(" ")}`:a}function Bo(e,t,o){if((t==="fontFamily"||t==="fontWeight")&&o&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(o.trim())&&!/\bvar\(/i.test(o))return{...e,[t]:o};if(!(t in O1))return e;let r=et(o);return{...e,[t]:o,...Object.fromEntries(O1[t].map((a,n)=>[a,r[ca[n]]]))}}function U5(e,t,o){if(t===o)return!0;if(e!=="fontFamily")return!1;let r=a=>a.replace(/['"]/g,"").replace(/\s*,\s*/g,",");return r(t)===r(o)}function F5(e){let t=e?.trim()??"";return t.endsWith("px")&&t1(t.slice(0,-2))?Number(t.slice(0,-2)):void 0}function a2(e,t,o){let r=t[e];if(r==="normal"){let l=o[e]?.trim().toLowerCase()??"";return/^[+-]?(?:0+(?:\.0*)?|\.0+)(?:[a-z]+|%)?$/i.test(l)||l==="inherit"&&e==="letterSpacing"?"0":r}let a=F5(r);if(a===void 0)return"";if(e==="fontSize")return String(Number(a.toFixed(2)));let n=F5(t.fontSize);return n!==void 0&&n>0?String(Number((a/n).toFixed(e==="letterSpacing"?3:2))):""}var p8="Edit this element's text on the canvas.",C8="You can't edit this element's text because it contains dynamic content.",m8={opacity:.4},g8=new Set(g2),h8="designMode.imageSourceEditorEnabled",v8=!1;function x8(){try{let e=window.localStorage.getItem(h8);return e==null?void 0:e==="true"}catch{return}}var L8={general:{headerTitle:"Selected Element",emptyPlaceholder:"To edit an element, select it on the canvas.",inlineEditEditable:p8,inlineEditNonEditable:C8,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:"Typography"},instances:{imageSource:"Source",backgroundColor:"Background Color",padding:"Padding",margin:"Margin",borderRadius:"Border Radius",fontFamily:"Font Family",fontSize:"Font Size",fontWeight:"Font Style",textStyling:"Text Styling",textColor:"Text Color",textAlignment:"Text Alignment",lineHeight:"Line Height",letterSpacing:"Letter Spacing"},history:{changeLimitTitle:"You're at the edit limit",changeLimitBody:"To continue editing, save your changes."}};function $5(e,t){let o=e.get(t);return{baseStyles:o?.styles??G1,baseComputed:o?.computedStyles??G1,edits:o?.sessionEdits??new Set}}function w8({size:e=16}){return ue("svg",{width:e,height:e,viewBox:"-1 0 252 302",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:ue("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 b8({size:e=12}){return ue("svg",{width:e,height:e,viewBox:"0 0 12 12","aria-hidden":"true",style:{display:"block",flexShrink:0},children:ue("rect",{x:"1",y:"1",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2.5 2"})})}function I8(e,t){let o=e[t];return o!=null?String(o):""}function da(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 y8({component:e,onOpenSourceFile:t,showOpenSourceFile:o,showComponentName:r,generalLabels:a}){if(!e||!e.name)return ue("section",{id:"property-panel-selected-component",className:"property-panel-selected-component",children:ue("p",{className:"property-panel-selected-component-placeholder",id:"component-info",children:a.emptyPlaceholder})});let n=e.tagName?e.tagName.toLowerCase():"",l=n?`${e.name} > ${n}`:e.name,i=null;if(o&&e.debugSource){let{sourceFile:s,lineNumber:u,columnNumber:d}=e.debugSource,c=s.split("/").pop()||s,C=`:${u}:${d}`;i=Qe("a",{href:"#",className:"property-panel-selected-component-source",onClick:f=>{f.preventDefault(),t?.({sourceFile:s,lineNumber:u,columnNumber:d})},title:`${s}${C}`,children:[c,C]})}return!r&&!i?null:ue("section",{id:"property-panel-selected-component",className:"property-panel-selected-component","aria-label":a.ariaSelectedComponent,children:Qe("div",{id:"component-info",className:"property-panel-selected-component-info",children:[r&&ue("span",{className:"property-panel-selected-component-name",children:l}),i&&Qe("span",{className:"property-panel-selected-component-source-row",children:["\u21B3 ",i]})]})})}var M8=me.forwardRef(function({title:t,body:o},r){return Qe("section",{ref:r,role:"alert","aria-live":"assertive","aria-labelledby":"property-panel-change-limit-title",className:"property-panel-change-limit-message",tabIndex:-1,children:[ue("svg",{className:"property-panel-change-limit-icon",viewBox:"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:ue("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"})}),Qe("div",{className:"property-panel-change-limit-content",children:[ue("h2",{id:"property-panel-change-limit-title",className:"property-panel-change-limit-title",children:t}),ue("p",{className:"property-panel-change-limit-body",children:o})]})]})});function N5(e,t){let o=t==="src"?e.srcKind:e.altKind;if(o===void 0)return"not-editable";if(!(o==="literal"||t==="src"&&o==="asset-import"))return"from-data"}function S8({styles:e,computedStyles:t,measuredStyles:o,editorResetVersion:r,hasSelection:a,onStyleChange:n,onBoxSidesChange:l,generalLabels:i,sectionLabels:s,instanceLabels:u,editorLabels:d,component:c,onImageAttributeChange:C,imageSource:m,imageSourceEditorEnabled:f}){let S=a?"visible":"",L=f&&c?.media?.tag==="img"?c.media:null,I=f&&c?.media?.tag==="background-image"?c.media:null,v=x=>o?.[x]?.computed!=null?o:void 0,b=me.useMemo(()=>Object.fromEntries(Object.keys(O1).map(x=>[x,n2(x,t,o)])),[t,o]),y=e.backgroundImage||t.backgroundImage,H=e.backgroundClip||t.backgroundClip,$=y0(y??"",H??"","text"),D=$!=="",w=M0(y??"",H??""),E=Hn(y??"",H??""),M=$1(w)?"rgba(0, 0, 0, 0)":"#ffffff",P=x=>b0(x)?x:void 0,K=P(e.backgroundColor),W=P(t.backgroundColor),Q=P(e.color),te=P(t.color),z=e.webkitTextFillColor||t.webkitTextFillColor,T=e.color||t.color,A=kn(z,T),F=x=>{let j=e[x],N=o?.[x];return N&&U5(x,j??"",N.inline??"")&&N.computed?N.computed:j&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(j.trim())&&!/\bvar\(/i.test(j)?j:t[x]};return ue("section",{className:"property-panel-style-properties-container"+(S?" "+S:""),"aria-label":i.ariaElementStyling,"aria-hidden":!a,children:Qe("div",{className:"property-panel-style-properties",children:[Qe(J1,{title:s.typography,children:[ue(Zi,{label:u.fontFamily,id:"design-font-family",value:e.fontFamily,computedValue:t.fontFamily,onChange:x=>n("fontFamily",x),useInheritLabel:d?.dimension?.useInherit}),Qe("div",{className:"property-panel-typography-row",children:[ue(Fi,{label:u.fontWeight,id:"design-font-weight",value:e.fontWeight,computedValue:t.fontWeight,fontFamily:t.fontFamily,onChange:x=>n("fontWeight",x),optionLabels:d?.fontWeight?.options,useInheritLabel:d?.dimension?.useInherit}),ue(kr,{label:u.fontSize,id:"design-font-size",value:e.fontSize,...Fo.fontSize,displayValue:a2("fontSize",t,e),measurement:v("fontSize"),resetVersion:r,onChange:x=>n("fontSize",x),aria:d?.dimension})]}),ue(_5,{label:u.textAlignment,id:"design-text-align",value:e.textAlign||t.textAlign,onChange:x=>n("textAlign",x),optionLabels:d?.textAlignment?.options}),ue(E5,{label:u.textStyling,id:"design-text-style",fontStyle:F("fontStyle"),textDecoration:F("textDecoration"),textTransform:F("textTransform"),onChange:n,optionLabels:d?.textStyle?.options}),Qe("div",{className:"property-panel-typography-row",children:[ue(kr,{label:u.lineHeight,id:"design-line-height",value:e.lineHeight,...Fo.lineHeight,displayValue:a2("lineHeight",t,e),measurement:v("lineHeight"),resetVersion:r,onChange:x=>n("lineHeight",x),aria:d?.dimension}),ue(kr,{label:u.letterSpacing,id:"design-letter-spacing",value:e.letterSpacing,...Fo.letterSpacing,displayValue:a2("letterSpacing",t,e),measurement:v("letterSpacing"),resetVersion:r,onChange:x=>n("letterSpacing",x),aria:d?.dimension})]})]}),ue(J1,{title:u.textColor,children:ue(On,{label:u.textColor,value:A?z:Q||te||(D?"rgba(0, 0, 0, 0)":"#000000"),onChange:x=>n("color",x),id:"design-text-color",aria:d?.color,backgroundImage:D?$:void 0})}),Qe(J1,{title:s.spacing,children:[ue(Uo,{label:u.padding,id:"design-padding",displayValue:t.padding??"",displaySides:b.padding,measurement:v("padding"),resetVersion:r,paired:!0,onSidesChange:x=>l("padding",x),aria:d?.boxDimension}),ue(Uo,{label:u.margin,id:"design-margin",displayValue:t.margin??"",displaySides:b.margin,measurement:v("margin"),resetVersion:r,paired:!0,onSidesChange:x=>l("margin",x),allowNegative:!0,aria:d?.boxDimension})]}),ue(J1,{title:s.background,children:ue(On,{label:u.backgroundColor,value:E?"rgba(0, 0, 0, 0)":K||W||M,onChange:x=>n("backgroundColor",x),id:"design-bg-color",aria:d?.color,backgroundImage:w||void 0})}),ue(J1,{title:s.border,children:ue(Uo,{label:u.borderRadius,id:"design-border-radius",displayValue:t.borderRadius??"",displaySides:b.borderRadius,measurement:v("borderRadius"),resetVersion:r,onSidesChange:x=>l("borderRadius",x),uniform:!0,sideLabelKind:"corners",aria:d?.boxDimension})}),L&&ue(J1,{title:s.imageSource,children:ue($l,{label:u.imageSource,value:L.src,onChange:x=>C("src",x),id:"design-img-src",attributes:{alt:L.alt},onAttributeChange:C,sourceReadOnly:N5(L,"src"),altReadOnly:N5(L,"alt"),sharedCount:c?.instanceCount,imageLabels:d?.image,...m})}),I&&ue(J1,{title:s.imageSource,children:ue($l,{label:u.imageSource,value:I.src,onChange:x=>n("backgroundImage",Z5(y,x)),id:"design-bg-img-src",imageLabels:d?.image,...m})})]})})}var q5=["padding","margin","backgroundColor","backgroundImage","backgroundClip","borderRadius","color","webkitTextFillColor","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform",...Object.values(O1).flat()],G1=Object.fromEntries(q5.map(e=>[e,""]));function vt(e,t,o,r,a=G1){let n={...t};for(let l of q5){let i=e[l];r==="computed"&&(l==="fontFamily"||l==="fontWeight")&&o.has(l)&&!U5(l,a[l]??"",i?.inline??"")||(r==="computed"&&v2.has(l)?n[l]=i?.computed??"":i!=null&&(!o.has(l)||r==="computed"&&(h2.has(l)||a[l]===""&&(i.inline??"")===""))&&(n[l]=i[r]??t[l]??""))}if(r==="computed"){let l=Object.fromEntries(Object.entries(e).map(([s,u])=>[s,u.inline??""])),i=s=>{let u=s.trim().split(/\s+/).map(d=>`${Number.parseFloat(d)}${d.endsWith("%")?"%":"px"}`);return[u[0],u[1]??u[0]].join(" ")};for(let[s,u]of Object.entries(O1)){if(!o.has(s))continue;let d=Ao(s,et(a[s]??"")),c=document.createElement("div").style;c[s]=d??"";let C=et(c[s]),m=n2(s,l,e);if(Ao(s,C)!==void 0&&Ao(s,m)!==void 0&&ca.every(f=>i(C[f])===i(m[f]))){u.some(f=>e[f]!=null)||(n=Bo(n,s,n[s]??""));continue}for(let f of[s,...u])n[f]=t[f]??""}}return n}var z5=me.forwardRef(function(t,o){let{component:r,styles:a,onStyleChange:n,onTextChange:l,onHistoryStateChange:i,onAddToChatContext:s,onOpenSourceFile:u,onClose:d,onMediaChange:c,showAddToChatContext:C=!0,showOpenSourceFile:m=!0,compactHeader:f=!1,labels:S,imageSource:L,imageSourceEditorEnabled:I}=t,v=me.useMemo(()=>I??x8()??v8,[I]),b=v1(L8,S),[y,H]=me.useState(()=>vt(a||{},G1,new Set,"inline")),[$,D]=me.useState(()=>vt(a||{},G1,new Set,"computed")),[w,E]=me.useState(()=>new Set),M=me.useRef(y);M.current=y;let P=me.useRef($);P.current=$;let K=me.useRef(w);K.current=w;let W=me.useCallback(k=>{k.styles&&(M.current=k.styles,H(k.styles)),k.computed&&(P.current=k.computed,D(k.computed)),k.edits&&(K.current=k.edits,E(k.edits))},[]),Q=me.useRef(a);Q.current=a;let te=me.useRef(new Map),z=me.useRef(n);z.current=n;let T=me.useRef(l);T.current=l;let A=me.useRef(c);A.current=c;let F=me.useRef(null);F.current||(F.current=A5((k,ne,oe)=>z.current(k,ne,oe,!0),(k,ne)=>T.current?.(k,ne),(k,ne,oe)=>A.current?.(k,ne,oe)));let x=F.current,j=me.useRef(i);j.current=i;let[N,X]=me.useState(()=>x.getUndoCount()),[g,O]=me.useState(0),V=x.getMaxHistorySize(),p=me.useRef("none");me.useEffect(()=>{let k=oe=>{if(j.current?.({canUndo:oe.canUndo,canRedo:oe.canRedo}),X(oe.undoCount),!(oe.type==="command-undone"||oe.type==="command-redone"))return;let Re=oe.type==="command-undone",He=oe.command?.data?.property,y1=oe.command?.data?.changes,_1=[];if(typeof He=="string"?_1=[[He,typeof oe.appliedValue=="string"?oe.appliedValue:""]]:Array.isArray(y1)&&(_1=y1.filter(Te=>Te!=null&&typeof Te.property=="string").map(Te=>[Te.property,String((Re?Te.oldValue:Te.newValue)??"")])),_1.length===0)return;let E1=oe.command?.data,Dt=E1&&typeof E1.componentName=="string"?`${E1.sourceFile??""}-${E1.componentName}-${E1.tagName??""}-${E1.lineNumber??""}-${E1.columnNumber??""}`:null;if(Dt!==null&&Dt!==p.current){let Te=te.current.get(Dt);if(!Te)return;let W1={...Te.styles},Lt=Te.computedStyles,be=new Set(Te.sessionEdits);for(let[X1,wt]of _1)W1[X1]=wt,Lt=Bo(Lt,X1,wt),be.add(X1);te.current.set(Dt,{...Te,styles:W1,computedStyles:Lt,sessionEdits:be});return}O(Te=>Te+1);let ao={...M.current},xt=P.current,D1=new Set(K.current);for(let[Te,W1]of _1)ao[Te]=W1,xt=Bo(xt,Te,W1),D1.add(Te);W({styles:ao,computed:xt,edits:D1})},ne=x.subscribe(k);return j.current?.({canUndo:x.canUndo(),canRedo:x.canRedo()}),X(x.getUndoCount()),ne},[x,W]);let Z=N>=V,U=me.useRef(null),q=me.useRef(!1);me.useEffect(()=>{Z&&!q.current&&U.current?.focus(),q.current=Z},[Z]),me.useImperativeHandle(o,()=>({undo:()=>x.undo(),redo:()=>x.redo(),clearHistory:k=>{if(O(ne=>ne+1),x.clear(),te.current.clear(),k?.keepSelectedStyles){let ne=Q.current||{},oe=new Set;W({styles:vt(ne,G1,oe,"inline"),computed:vt(ne,G1,oe,"computed"),edits:new Set})}else W({styles:G1,computed:G1,edits:new Set});X(0)},getHistoryStack:()=>x.getHistoryStack(),getChangeSet:()=>O5(x.getHistoryStack()),recordTextChange:(k,ne,oe)=>x.recordTextChange(k,ne,oe),canUndo:()=>x.canUndo(),canRedo:()=>x.canRedo()}),[x,W]);let h=r?`${r.debugSource?.sourceFile??""}-${r.name}-${r.tagName??""}-${r.debugSource?.lineNumber??""}-${r.debugSource?.columnNumber??""}`:"none";p.current=h;let R=me.useRef("none");me.useEffect(()=>{let k=R.current,ne,oe,Se;h!==k?(k!=="none"&&(K.current.size>0?te.current.set(k,{styles:M.current,computedStyles:P.current,sessionEdits:K.current}):te.current.delete(k)),R.current=h,{baseStyles:ne,baseComputed:oe,edits:Se}=$5(te.current,h)):(ne=M.current,oe=P.current,Se=K.current);let Re=a||{};W({styles:vt(Re,ne,Se,"inline"),computed:vt(Re,oe,Se,"computed",ne),edits:Se})},[h,a,W]);let ee=h!==R.current?$5(te.current,h):void 0,xe=ee?vt(a||{},ee.baseStyles,ee.edits,"inline"):y,he=ee?vt(a||{},ee.baseComputed,ee.edits,"computed",ee.baseStyles):$,ze=(k,ne)=>{let oe=n2(k,P.current,Q.current),Se=Ao(k,oe),Re=Ao(k,{...oe,...ne});if(Se===void 0||Re===void 0)return!1;if(Se===Re)return!0;let He=new Set(K.current);return He.add(k),W({styles:{...M.current,[k]:Re},computed:Bo(P.current,k,Re),edits:He}),x.recordStyleChange(k,Se,Re,da(r)),n(k,Re,r?.debugSource),!0},Ie=me.useCallback((k,ne)=>{let oe=I8(M.current,k),Se=da(r),Re=r?.debugSource?{sourceFile:r.debugSource.sourceFile,lineNumber:r.debugSource.lineNumber,columnNumber:r.debugSource.columnNumber}:void 0,He=M.current.backgroundImage||P.current.backgroundImage||"",y1=M.current.backgroundClip||P.current.backgroundClip||"",_1=Hn(He,y1),E1=M.current.color||P.current.color||"",Dt=!!M.current.webkitTextFillColor?.trim(),ao={property:"webkitTextFillColor",isOccluding:be=>kn(be,E1,Dt),resetValue:"currentcolor"},xt=[];k==="backgroundColor"?xt=_1?[ao]:[]:k==="color"&&(xt=[ao]);let D1=xt.flatMap(({property:be,isOccluding:X1,resetValue:wt})=>P0(ne,be,P.current[be],M.current[be],X1,wt)),Te=(be,X1,wt)=>{wt!==X1&&D1.push({property:be,oldValue:X1,newValue:wt})};if(ne.trim()!==""&&($1(He)||_1))if(k==="backgroundColor"){let be=_1?k0(He,y1):y1;Te("backgroundClip",y1,be),Te("backgroundImage",He,H0(He,be))}else k==="color"&&Te("backgroundImage",He,R0(He,y1));n(k,ne,Re);for(let be of D1)n(be.property,be.newValue,Re);D1.length===0?x.recordStyleChange(k,oe,ne,Se):x.recordStyleBatch([{property:k,oldValue:oe,newValue:ne},...D1.map(be=>({property:be.property,oldValue:be.oldValue,newValue:be.newValue}))],Se);let W1={...M.current,[k]:ne};for(let be of D1)W1[be.property]=be.newValue;W({styles:W1,computed:Bo(P.current,k,ne)}),k==="color"&&D(be=>({...be,webkitTextFillColor:ne}));let Lt=new Set(K.current);Lt.add(k);for(let be of D1)Lt.add(be.property);W({edits:Lt})},[n,x,r,W]),ye=me.useCallback((k,ne)=>{let oe=r?.media;if(!oe)return;let Se=r?.debugSource;c?.(oe.tag,{[k]:ne},Se);let Re=String(oe[k]??"");x.recordMediaChange(oe.tag,k,Re,ne,da(r))},[r,c,x]),Me=!!(r&&r.name),Ce=me.useCallback(()=>{let k=da(r);k&&s?.(k)},[r,s]),je=Me&&r&&r.tagName&&g8.has(r.tagName.toUpperCase()),we=r?.hasNonEditableText?b.general.inlineEditNonEditable:b.general.inlineEditEditable,Ye=r?.tagName?r.tagName.toLowerCase():r?.name;return Qe("div",{role:"complementary","aria-label":b.general.ariaPropertyPanel,className:"property-panel-container",children:[Qe("header",{className:f?"property-panel-header property-panel-header-compact":"property-panel-header",children:[f?Me&&Qe("span",{className:"property-panel-selected-pill",children:[ue(b8,{size:12}),ue("span",{className:"property-panel-selected-pill-tag",children:Ye})]}):ue("h2",{id:"design-property-panel-title",className:"property-panel-title",children:b.general.headerTitle}),(Me||d)&&Qe("div",{className:"property-panel-header-actions",children:[Me&&Qe(H8,{children:[je&&ue("span",{className:"property-panel-selected-component-action property-panel-selected-component-action-help","data-tooltip":we,"aria-label":we,children:ue(c2,{width:14,height:14,style:r.hasNonEditableText?m8:void 0})}),C&&!Z&&ue("button",{type:"button",className:"property-panel-selected-component-action",onClick:Ce,"data-tooltip":b.general.addToChatContext,"aria-label":b.general.addToChatContext,children:ue(w8,{size:14})})]}),d&&ue("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:ue(s2,{width:14,height:14,"aria-hidden":"true"})})]})]}),Qe("div",{className:"property-panel-content","aria-labelledby":f?void 0:"design-property-panel-title",children:[ue(y8,{component:r,onOpenSourceFile:u,showOpenSourceFile:m,showComponentName:!f,generalLabels:b.general}),Z?ue(M8,{ref:U,title:b.history.changeLimitTitle,body:b.history.changeLimitBody}):ue(S8,{editorResetVersion:g,styles:xe,computedStyles:he,measuredStyles:a,hasSelection:Me,onStyleChange:Ie,onBoxSidesChange:ze,generalLabels:b.general,sectionLabels:b.sections,instanceLabels:b.instances,editorLabels:S?.editors,component:r,onImageAttributeChange:ye,imageSource:L,imageSourceEditorEnabled:v},h)]})]})});function R8(e,t,o){if(!e)return;f8(e).render(me.createElement(z5,{...t,ref:o}))}export{z5 as DesignPropertyPanel,x2 as REQUIRED_LABEL_KEYS,Ve as interpolate,R8 as mountDesignPropertyPanel,ps as validateLabels};
1
+ var Q5=Object.create;var ha=Object.defineProperty;var Y5=Object.getOwnPropertyDescriptor;var J5=Object.getOwnPropertyNames;var es=Object.getPrototypeOf,ts=Object.prototype.hasOwnProperty;var os=(e,t,o)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var uo=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var rs=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of J5(t))!ts.call(e,a)&&a!==o&&ha(e,a,{get:()=>t[a],enumerable:!(r=Y5(t,a))||r.enumerable});return e};var s2=(e,t,o)=>(o=e!=null?Q5(es(e)):{},rs(t||!e||!e.__esModule?ha(o,"default",{value:e,enumerable:!0}):o,e));var Ht=(e,t,o)=>os(e,typeof t!="symbol"?t+"":t,o);var A0=uo((Ow,B0)=>{"use strict";var h7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";B0.exports=h7});var N0=uo((_w,$0)=>{"use strict";var v7=A0();function Z0(){}function F0(){}F0.resetWarningCache=Z0;$0.exports=function(){function e(r,a,n,l,i,s){if(s!==v7){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:F0,resetWarningCache:Z0};return o.PropTypes=o,o}});var q0=uo((Zw,U0)=>{U0.exports=N0()();var Bw,Aw});var j0=uo(ve=>{"use strict";var An=Symbol.for("react.element"),Zn=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),Vr=Symbol.for("react.strict_mode"),Er=Symbol.for("react.profiler"),Dr=Symbol.for("react.provider"),Or=Symbol.for("react.context"),x7=Symbol.for("react.server_context"),_r=Symbol.for("react.forward_ref"),Br=Symbol.for("react.suspense"),Ar=Symbol.for("react.suspense_list"),Zr=Symbol.for("react.memo"),Fr=Symbol.for("react.lazy"),L7=Symbol.for("react.offscreen"),z0;z0=Symbol.for("react.module.reference");function L1(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case An:switch(e=e.type,e){case Tr:case Er:case Vr:case Br:case Ar:return e;default:switch(e=e&&e.$$typeof,e){case x7:case Or:case _r:case Fr:case Zr:case Dr:return e;default:return t}}case Zn:return t}}}ve.ContextConsumer=Or;ve.ContextProvider=Dr;ve.Element=An;ve.ForwardRef=_r;ve.Fragment=Tr;ve.Lazy=Fr;ve.Memo=Zr;ve.Portal=Zn;ve.Profiler=Er;ve.StrictMode=Vr;ve.Suspense=Br;ve.SuspenseList=Ar;ve.isAsyncMode=function(){return!1};ve.isConcurrentMode=function(){return!1};ve.isContextConsumer=function(e){return L1(e)===Or};ve.isContextProvider=function(e){return L1(e)===Dr};ve.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===An};ve.isForwardRef=function(e){return L1(e)===_r};ve.isFragment=function(e){return L1(e)===Tr};ve.isLazy=function(e){return L1(e)===Fr};ve.isMemo=function(e){return L1(e)===Zr};ve.isPortal=function(e){return L1(e)===Zn};ve.isProfiler=function(e){return L1(e)===Er};ve.isStrictMode=function(e){return L1(e)===Vr};ve.isSuspense=function(e){return L1(e)===Br};ve.isSuspenseList=function(e){return L1(e)===Ar};ve.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tr||e===Er||e===Vr||e===Br||e===Ar||e===L7||typeof e=="object"&&e!==null&&(e.$$typeof===Fr||e.$$typeof===Zr||e.$$typeof===Dr||e.$$typeof===Or||e.$$typeof===_r||e.$$typeof===z0||e.getModuleId!==void 0)};ve.typeOf=L1});var G0=uo(($w,K0)=>{"use strict";K0.exports=j0()});import{forwardRef as rt,createElement as Qe}from"react";function at(e,t){if(e==null)return{};var o={},r=Object.keys(e),a,n;for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&(o[a]=e[a]);return o}var as=["color"],Zo=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,as);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ns=["color"],u2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ns);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ls=["color"],d2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ls);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var is=["color"],c2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,is);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M2 2.5C2 2.22386 2.22386 2 2.5 2H5.5C5.77614 2 6 2.22386 6 2.5C6 2.77614 5.77614 3 5.5 3H3V5.5C3 5.77614 2.77614 6 2.5 6C2.22386 6 2 5.77614 2 5.5V2.5ZM9 2.5C9 2.22386 9.22386 2 9.5 2H12.5C12.7761 2 13 2.22386 13 2.5V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3H9.5C9.22386 3 9 2.77614 9 2.5ZM2.5 9C2.77614 9 3 9.22386 3 9.5V12H5.5C5.77614 12 6 12.2239 6 12.5C6 12.7761 5.77614 13 5.5 13H2.5C2.22386 13 2 12.7761 2 12.5V9.5C2 9.22386 2.22386 9 2.5 9ZM12.5 9C12.7761 9 13 9.22386 13 9.5V12.5C13 12.7761 12.7761 13 12.5 13H9.5C9.22386 13 9 12.7761 9 12.5C9 12.2239 9.22386 12 9.5 12H12V9.5C12 9.22386 12.2239 9 12.5 9Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ss=["color"],f2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ss);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var us=["color"],p2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,us);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ds=["color"],C2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ds);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});var cs=["color"],m2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,cs);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});import Ce from"react";import{createRoot as u8}from"react-dom/client";import g2 from"react";import{jsx as va,jsxs as h2}from"react/jsx-runtime";function nt({title:e,defaultOpen:t=!0,children:o}){let[r,a]=g2.useState(t),n=g2.useCallback(l=>{a(l.currentTarget.open)},[]);return h2("details",{className:"property-panel-section",open:r,onToggle:n,children:[h2("summary",{className:"property-panel-section-trigger",children:[va("span",{children:e}),va(u2,{className:"property-panel-section-chevron",width:12,height:12,"aria-hidden":"true"})]}),va("div",{className:"property-panel-section-content",children:o})]})}var v2=["H1","H2","H3","H4","H5","H6","P","SPAN","A","BUTTON","LABEL","DIV","LI","TD","TH","CAPTION","FIGCAPTION","BLOCKQUOTE","LEGEND","SUMMARY","DT","DD","EM","STRONG"];var x2=new Set(["fontFamily","fontWeight","fontSize","lineHeight","letterSpacing"]),$1={padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"],margin:["marginTop","marginRight","marginBottom","marginLeft"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},L2=new Set([...Object.keys($1),...Object.values($1).flat()]);import S1 from"react";import{jsx as Cs,jsxs as ms}from"react/jsx-runtime";var fs={border:"none",margin:0,padding:0,minWidth:0},ps={color:"var(--dmp-color-foreground)",fontSize:"var(--dmp-font-size-label)",display:"block",marginBottom:"5px",padding:0};function m1({label:e,id:t,className:o,children:r}){let a=`${t}-legend`;return ms("fieldset",{style:fs,className:o,"aria-labelledby":a,children:[Cs("legend",{id:a,style:ps,children:e}),r]})}function Re(e,t){return e.replace(/\{(\d+)\}/g,(o,r)=>{let a=t[Number(r)];return a===void 0?o:String(a)})}function M1(e,t){if(t==null||typeof t!="object"||typeof e!="object")return e;let o={...e},r=t;for(let a of Object.keys(o)){let n=o[a],l=r[a];n!==null&&typeof n=="object"&&!Array.isArray(n)?o[a]=M1(n,l):typeof l=="string"&&(o[a]=l)}return o}var w2=[{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:"instances.imageSource"},{path:"instances.backgroundColor"},{path:"instances.padding"},{path:"instances.margin"},{path:"instances.borderRadius"},{path:"instances.fontFamily"},{path:"instances.fontSize"},{path:"instances.fontWeight"},{path:"instances.textStyling"},{path:"instances.textColor"},{path:"instances.textAlignment"},{path:"instances.lineHeight"},{path:"instances.letterSpacing"},{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.ariaImageUrl"},{path:"editors.image.urlPlaceholder"},{path:"editors.image.previewAlt"},{path:"editors.image.altText"},{path:"editors.image.altPlaceholder"},{path:"editors.image.sourceFromData"},{path:"editors.image.sourceNotEditable"},{path:"editors.image.altFromData"},{path:"editors.image.altNotEditable"},{path:"editors.image.sourceShared",placeholders:[0]},{path:"editors.image.altShared",placeholders:[0]},{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.allCorners"},{path:"editors.boxDimension.expandCorners"},{path:"editors.boxDimension.collapseCorners"},{path:"editors.boxDimension.matchCornersAndCollapse"},{path:"editors.boxDimension.vertical"},{path:"editors.boxDimension.horizontal"},{path:"editors.boxDimension.expand"},{path:"editors.boxDimension.collapse"},{path:"editors.boxDimension.matchAndCollapse"},{path:"editors.boxDimension.collapseUnavailable"},{path:"editors.boxDimension.measurementUnavailable"},{path:"editors.boxDimension.invalidNumber"},{path:"editors.boxDimension.invalidNonNegative"},{path:"editors.boxDimension.ariaSide",placeholders:[0,1]},{path:"editors.dimension.ariaValue",placeholders:[0]},{path:"editors.dimension.ariaActions",placeholders:[0]},{path:"editors.dimension.useNormalLineHeight"},{path:"editors.dimension.useNormalSpacing"},{path:"editors.dimension.useInherit"},{path:"editors.dimension.invalidRange",placeholders:[0,1]},{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.ariaOpacity",placeholders:[0]},{path:"editors.color.invalidHex"},{path:"editors.color.invalidOpacity"},{path:"editors.color.invalidChannel"},{path:"editors.color.gradientValue"},{path:"editors.color.imageValue"},{path:"editors.color.ariaRecentColors"},{path:"editors.color.ariaApplyRecentColor",placeholders:[0,1]},{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.textStyle.options.italic"},{path:"editors.textStyle.options.underline"},{path:"editors.textStyle.options.uppercase"},{path:"editors.textAlignment.options.left"},{path:"editors.textAlignment.options.center"},{path:"editors.textAlignment.options.right"},{path:"editors.textAlignment.options.justify"},{path:"history.changeLimitTitle"},{path:"history.changeLimitBody"}];function gs(e,t){return t.split(".").reduce((o,r)=>{if(o&&typeof o=="object")return o[r]},e)}function hs(e){let t=new Set;for(let o of e.matchAll(/\{(\d+)\}/g))t.add(Number(o[1]));return Array.from(t).sort((o,r)=>o-r)}function vs(e){let t=[];if(!e||typeof e!="object")return["labels is not an object"];for(let o of w2){let{path:r,placeholders:a}=o,n=gs(e,r);if(typeof n!="string"){t.push(`missing or non-string label: ${r}`);continue}if(a){let l=hs(n),i=[...a].sort((u,d)=>u-d);(l.length!==i.length||l.some((u,d)=>u!==i[d]))&&t.push(`placeholder mismatch at ${r}: expected {${i.join(",")}}, got {${l.join(",")}}`)}}return t}var co={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}},xs=co.px??{min:0,max:1e4,step:1,decimals:0};function fo(e,t=co){return t[e]||xs}function Ls(e,t,o=co){let r=fo(t,o);return Math.min(r.max,Math.max(r.min,e))}function xa(e,t,o=co){if(e===""||e==null||isNaN(e))return"";let r=fo(t,o);return Number(Number(e).toFixed(r.decimals))}function I2(e,t,o,r,a=co){let n=parseFloat(e)||0,l=fo(r,a),i=o?10:1,s=(t==="ArrowUp"?1:-1)*l.step*i,u=Ls(n+s,r,a);return String(xa(u,r,a))}var b2=String.raw`[+-]?(?:\d+(?:\.\d*)?|\.\d+)`,ws=new RegExp(`^${b2}$`),y2=new RegExp(`^(${b2})([a-z%]*)$`);function a1(e){return ws.test(e)&&Number.isFinite(Number(e))}var Fo={fontSize:{unit:"px",icon:f2,constraints:{px:{min:1,max:200,step:1,decimals:2}},presets:[8,9,10,11,12,14,18,24,30,36,48,60,72,96]},lineHeight:{unit:"",icon:m2,constraints:{"":{min:.1,max:3,step:.1,decimals:2}},presets:[1,1.2,1.4,1.5,1.6,2],normalLabelKey:"useNormalLineHeight"},letterSpacing:{unit:"em",icon:C2,constraints:{em:{min:-.1,max:.5,step:.01,decimals:3}},presets:[-.05,-.025,0,.025,.05,.1],normalLabelKey:"useNormalSpacing"}};import{jsx as T1,jsxs as po}from"react/jsx-runtime";var R1=["top","right","bottom","left"],Is=["top","right","left","bottom"],No={top:"",right:"",bottom:"",left:""},bs={sides:{top:"Top",right:"Right",bottom:"Bottom",left:"Left"},corners:{topLeft:"Top Left",topRight:"Top Right",bottomRight:"Bottom Right",bottomLeft:"Bottom Left"},allCorners:"All corners",expandCorners:"Show all corners",collapseCorners:"Collapse",matchCornersAndCollapse:"Match all corners and collapse",vertical:"Vertical",horizontal:"Horizontal",expand:"Show all sides",collapse:"Collapse",matchAndCollapse:"Match opposite sides and collapse",collapseUnavailable:"Finish editing and resolve all measurements before collapsing.",measurementUnavailable:"Wait for all side measurements before editing this box.",invalidNumber:"Enter a finite number in pixels.",invalidNonNegative:"Enter a number greater than or equal to 0.",ariaSide:"{0} {1}"};function lt(e){let t=[],o=0,r=0,a=-1,n=e.trim();for(let d=0;d<=n.length;d++){let c=n[d];if(c==="("&&o++,c===")"&&o--,o<0)return{...No};if(c==="/"&&o===0){if(a!==-1)return{...No};a=d}(d===n.length||o===0&&/\s/.test(c??""))&&(d>r&&t.push(n.slice(r,d)),r=d+1)}if(a!==-1){let d=lt(n.slice(0,a)),c=lt(n.slice(a+1));return Object.fromEntries(R1.map(p=>[p,d[p]&&c[p]?d[p]===c[p]?d[p]:`${d[p]} ${c[p]}`:""]))}if(o!==0||t.length===0||t.length>4)return{...No};let[l="",i=l,s=l,u=i]=t;return{top:l,right:i,bottom:s,left:u}}function H2(e){return String(Number(e.toFixed(2)))}var ys=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)px$/i,M2=9999;function S2(e,t){let o=t??lt(e),r={top:null,right:null,bottom:null,left:null},a={...No};for(let n of R1){let l=(o[n]??"").trim(),i=ys.exec(l)?.[1]??(a1(l)&&Number(l)===0?l:void 0),s=Number(i);if(i!==void 0&&Number.isFinite(s)){let u=Math.max(-M2,Math.min(M2,s));r[n]=s,a[n]=H2(u)}else a[n]=l}return{raw:r,display:a}}function k2(e){return R1.every(t=>e[t]!==null)&&e.top===e.bottom&&e.right===e.left}function Ms(e){return k2(e)&&e.top===e.right}function La(e,t){return t?Ms(e):k2(e)}var R2={top:"top",right:"right",bottom:"top",left:"right"},$o={uniform:{compact:"M1 4V3a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V4",sides:{top:"M1 5V3a2 2 0 0 1 2-2h2",right:"M7 1h2a2 2 0 0 1 2 2v2",bottom:"M11 7v2a2 2 0 0 1-2 2H7",left:"M5 11H3a2 2 0 0 1-2-2V7"}},paired:{compact:{top:"M1 1h10M1 11h10",right:"M1 1v10M11 1v10"},sides:{top:"M1 1h10",right:"M11 1v10",bottom:"M1 11h10",left:"M1 1v10"}}};function Ss(e,t,o){return e?t?$o.uniform.compact:$o.uniform.sides[o]:t?$o.paired.compact[o==="top"?"top":"right"]:$o.paired.sides[o]}function Uo({label:e,displayValue:t,displaySides:o,measurement:r,resetVersion:a,paired:n=!1,uniform:l=!1,onSidesChange:i,id:s,allowNegative:u=!1,sideLabelKind:d="sides",aria:c}){let p=S1.useId(),g=s||p,f=M1(bs,c),x=l||!l&&n&&d==="sides",[w]=S1.useState(()=>S2(t,o)),[h,S]=S1.useState(()=>!La(w.raw,l)),H=S1.useRef(!0),k=x&&!h,[Z,V]=S1.useState(w.display),[L,y]=S1.useState({}),R=S1.useRef({}),_=S1.useRef({...w.display}),N=S1.useRef({...w.raw}),K=S1.useRef({displayValue:t,displaySides:o,measurement:r,resetVersion:a});S1.useEffect(()=>{let m=K.current,I=a!==m.resetVersion,C=(o===void 0?m.displaySides!==void 0||t!==m.displayValue:m.displaySides===void 0||R1.some(v=>o[v]!==m.displaySides?.[v]))||r!==m.measurement;if(K.current={displayValue:t,displaySides:o,measurement:r,resetVersion:a},!I&&!C)return;let $=S2(t,o);_.current=$.display,N.current=$.raw,I&&(R.current={},y({})),V(v=>{let b={...$.display};for(let G of R1)R.current[G]&&(b[G]=v[G]);return b}),La($.raw,l)?H.current&&Object.keys(R.current).length===0&&S(!1):S(!0)},[t,o,r,a,l]);let z=m=>k&&l?R1:k?m==="top"?["top","bottom"]:["right","left"]:[m],W=(m,I)=>{var P;H.current=!1,(P=R.current)[m]??(P[m]={baseline:_.current[m],sides:z(m)}),V(C=>({...C,[m]:I})),y(C=>({...C,[m]:void 0}))},F=m=>{delete R.current[m],y(I=>({...I,[m]:void 0})),V(I=>({...I,[m]:_.current[m]}))},D=(m,I)=>{let P=R.current[m]?.sides??z(m),C=I.trim(),$=R.current[m]?.baseline??_.current[m],v=a1(C);if(C===""||v&&a1($)&&Number(C)===Number($)){F(m);return}if(!v||!u&&Number(C)<0){y(oe=>({...oe,[m]:v?"negative":"number"}));return}let b=Number(C),G={};for(let oe of P)G[oe]=`${b}px`;if(i(G)===!1){y(oe=>({...oe,[m]:"measurement"}));return}H.current=k;let J=H2(b);for(let oe of P)_.current[oe]=J,N.current[oe]=b;delete R.current[m],y(oe=>({...oe,[m]:void 0})),V(oe=>{let ce={...oe};for(let he of P)R.current[he]||(ce[he]=J);return ce})},B=[f.corners.topLeft,f.corners.topRight,f.corners.bottomRight,f.corners.bottomLeft],U=(d==="corners"?Is:R1).filter(m=>!k||m==="top"||!l&&m==="right"),A=`${g}-sides`,q=`${g}-collapse-description`,T=R1.every(m=>N.current[m]!==null)&&Object.keys(R.current).length===0,j=h?La(N.current,l)?l?f.collapseCorners:f.collapse:l?f.matchCornersAndCollapse:f.matchAndCollapse:l?f.expandCorners:f.expand;return po(m1,{label:e,id:g,className:"boxDimensionEditor-fieldset",children:[po("div",{className:`boxDimensionEditor-layout${k?l?" boxDimensionEditor-layout--uniform-compact":" boxDimensionEditor-layout--paired-compact":""}`,children:[T1("div",{id:A,className:"boxDimensionEditor-grid",children:U.map(m=>{let I=R1.indexOf(m),P=k?l?f.allCorners:m==="top"?f.vertical:f.horizontal:d==="corners"?B[I]:f.sides[m],C=Re(f.ariaSide,[e,P??""]),$=`${g}-${m}-error`;return po("div",{className:"boxDimensionEditor-cell",children:[T1("label",{htmlFor:`${g}-${m}`,className:"boxDimensionEditor-label",children:P}),po("div",{className:"boxDimensionEditor-input-row",children:[x&&T1("span",{className:"boxDimensionEditor-input-icon","aria-hidden":"true",title:C,children:po("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",className:"boxDimensionEditor-pair-icon",children:[T1("rect",{x:1,y:1,width:10,height:10,rx:l?2:void 0}),T1("path",{d:Ss(l,k,m)})]})}),T1("input",{id:`${g}-${m}`,type:"text",inputMode:"decimal",className:`boxDimensionEditor-input${x?" boxDimensionEditor-input--with-icon":""}`,value:Z[m],onChange:v=>W(m,v.target.value),onPaste:v=>{v.preventDefault();let b=v.currentTarget;W(m,Z[m].slice(0,b.selectionStart??0)+v.clipboardData.getData("text")+Z[m].slice(b.selectionEnd??Z[m].length))},onBlur:()=>{R.current[m]&&D(m,Z[m])},onKeyDown:v=>{if(v.key==="Enter")R.current[m]&&D(m,Z[m]),v.currentTarget.blur();else if(v.key==="Escape")F(m);else if(v.key==="ArrowUp"||v.key==="ArrowDown"){v.preventDefault(),H.current=!1;let b=R.current[m]?v.currentTarget.value:_.current[m];if(!a1(b.trim()))return;if(!u&&Number(b)<0){D(m,b);return}let G=(v.key==="ArrowUp"?1:-1)*(v.shiftKey?10:1),J=Number(b)+G;D(m,String(u?J:Math.max(0,J)))}},"aria-label":C,"aria-invalid":L[m]?!0:void 0,"aria-describedby":L[m]?$:void 0,autoComplete:"off",spellCheck:"false"})]}),L[m]&&T1("span",{id:$,role:"alert",className:"boxDimensionEditor-error",children:L[m]==="measurement"?f.measurementUnavailable:L[m]==="negative"?f.invalidNonNegative:f.invalidNumber})]},m)})}),x&&T1("button",{type:"button",className:"boxDimensionEditor-expand","aria-label":j,"aria-expanded":h,"aria-controls":A,"aria-disabled":h&&!T?!0:void 0,"aria-describedby":h&&!T?q:void 0,title:h&&!T?f.collapseUnavailable:j,onPointerDown:m=>{h&&!T&&m.preventDefault()},onClick:()=>{if(h){if(!T)return;let m=N.current,I={};for(let P of R1){let C=l?"top":R2[P];m[P]!==m[C]&&(I[P]=`${m[C]}px`)}if(Object.keys(I).length>0&&i(I)===!1)return;for(let P of R1){let C=I[P];C!==void 0&&(m[P]=Number.parseFloat(C),_.current[P]=_.current[l?"top":R2[P]])}V({..._.current})}H.current=h,S(!h)},children:T1(c2,{width:12,height:12,"aria-hidden":"true"})})]}),x&&h&&!T&&T1("span",{id:q,className:"boxDimensionEditor-collapseDescription",children:f.collapseUnavailable})]})}import{forwardRef as Hs,createElement as ks}from"react";var qo=(...e)=>e.filter((t,o,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===o).join(" ").trim();var P2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var T2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,r)=>r?r.toUpperCase():o.toLowerCase());var wa=e=>{let t=T2(e);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Rs,createElement as D2}from"react";var V2={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 E2=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var O2=Rs(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:n,iconNode:l,...i},s)=>D2("svg",{ref:s,...V2,width:t,height:t,stroke:e,strokeWidth:r?Number(o)*24/Number(t):o,className:qo("lucide",a),...!n&&!E2(i)&&{"aria-hidden":"true"},...i},[...l.map(([u,d])=>D2(u,d)),...Array.isArray(n)?n:[n]]));var _2=(e,t)=>{let o=Hs(({className:r,...a},n)=>ks(O2,{ref:n,iconNode:t,className:qo(`lucide-${P2(wa(e))}`,`lucide-${e}`,r),...a}));return o.displayName=wa(e),o};var Ps=[["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"}]],Co=_2("pipette",Ps);import ye from"react";import{useRef as Go,useCallback as We,useEffect as ka,useMemo as Wo,useState as Pa,createContext as Ts,useContext as Vs}from"react";var B2={exports:{}},mo={};var A2;function Es(){if(A2)return mo;A2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(r,a,n){var l=null;if(n!==void 0&&(l=""+n),a.key!==void 0&&(l=""+a.key),"key"in a){n={};for(var i in a)i!=="key"&&(n[i]=a[i])}else n=a;return a=n.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:n}}return mo.Fragment=t,mo.jsx=o,mo.jsxs=o,mo}var Z2;function Ds(){return Z2||(Z2=1,B2.exports=Es()),B2.exports}var ke=Ds();function G2(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=G2(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Os(){for(var e,t,o=0,r="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=G2(e))&&(r&&(r+=" "),r+=t);return r}var Ta="-",_s=e=>{let t=As(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let n=a.split(Ta);return n[0]===""&&n.length!==1&&n.shift(),W2(n,t)||Bs(a)},getConflictingClassGroupIds:(a,n)=>{let l=o[a]||[];return n&&r[a]?[...l,...r[a]]:l}}},W2=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?W2(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(Ta);return t.validators.find(({validator:l})=>l(n))?.classGroupId},F2=/^\[(.+)\]$/,Bs=e=>{if(F2.test(e)){let t=F2.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},As=e=>{let{theme:t,classGroups:o}=e,r={nextPart:new Map,validators:[]};for(let a in o)ya(o[a],r,a,t);return r},ya=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:$2(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Zs(a)){ya(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,l])=>{ya(l,$2(t,n),o,r)})})},$2=(e,t)=>{let o=e;return t.split(Ta).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Zs=e=>e.isThemeGetter,Fs=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=r.get(n))!==void 0)return a(n,l),l},set(n,l){o.has(n)?o.set(n,l):a(n,l)}}},Ma="!",Sa=":",$s=Sa.length,Ns=e=>{let{prefix:t,experimentalParseClassName:o}=e,r=a=>{let n=[],l=0,i=0,s=0,u;for(let f=0;f<a.length;f++){let M=a[f];if(l===0&&i===0){if(M===Sa){n.push(a.slice(s,f)),s=f+$s;continue}if(M==="/"){u=f;continue}}M==="["?l++:M==="]"?l--:M==="("?i++:M===")"&&i--}let d=n.length===0?a:a.substring(s),c=Us(d),p=c!==d,g=u&&u>s?u-s:void 0;return{modifiers:n,hasImportantModifier:p,baseClassName:c,maybePostfixModifierPosition:g}};if(t){let a=t+Sa,n=r;r=l=>l.startsWith(a)?n(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(o){let a=r;r=n=>o({className:n,parseClassName:a})}return r},Us=e=>e.endsWith(Ma)?e.substring(0,e.length-1):e.startsWith(Ma)?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 r=[],a=[];return o.forEach(n=>{n[0]==="["||t[n]?(r.push(...a.sort(),n),a=[]):a.push(n)}),r.push(...a.sort()),r}},zs=e=>({cache:Fs(e.cacheSize),parseClassName:Ns(e),sortModifiers:qs(e),..._s(e)}),js=/\s+/,Ks=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:n}=t,l=[],i=e.trim().split(js),s="";for(let u=i.length-1;u>=0;u-=1){let d=i[u],{isExternal:c,modifiers:p,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:M}=o(d);if(c){s=d+(s.length>0?" "+s:s);continue}let x=!!M,w=r(x?f.substring(0,M):f);if(!w){if(!x){s=d+(s.length>0?" "+s:s);continue}if(w=r(f),!w){s=d+(s.length>0?" "+s:s);continue}x=!1}let h=n(p).join(":"),S=g?h+Ma:h,H=S+w;if(l.includes(H))continue;l.push(H);let k=a(w,x);for(let Z=0;Z<k.length;++Z){let V=k[Z];l.push(S+V)}s=d+(s.length>0?" "+s:s)}return s};function Gs(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=X2(t))&&(r&&(r+=" "),r+=o);return r}var X2=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=X2(e[r]))&&(o&&(o+=" "),o+=t);return o};function Ws(e,...t){let o,r,a,n=l;function l(s){let u=t.reduce((d,c)=>c(d),e());return o=zs(u),r=o.cache.get,a=o.cache.set,n=i,i(s)}function i(s){let u=r(s);if(u)return u;let d=Ks(s,o);return a(s,d),d}return function(){return n(Gs.apply(null,arguments))}}var _e=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Q2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Y2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xs=/^\d+\/\d+$/,Qs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ys=/\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$/,Js=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>Xs.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),it=e=>!!e&&Number.isInteger(Number(e)),Ia=e=>e.endsWith("%")&&de(e.slice(0,-1)),N1=e=>Qs.test(e),ou=()=>!0,ru=e=>Ys.test(e)&&!Js.test(e),J2=()=>!1,au=e=>eu.test(e),nu=e=>tu.test(e),lu=e=>!X(e)&&!Q(e),iu=e=>Nt(e,o9,J2),X=e=>Q2.test(e),kt=e=>Nt(e,r9,ru),ba=e=>Nt(e,fu,de),N2=e=>Nt(e,e9,J2),su=e=>Nt(e,t9,nu),zo=e=>Nt(e,a9,au),Q=e=>Y2.test(e),go=e=>Ut(e,r9),uu=e=>Ut(e,pu),U2=e=>Ut(e,e9),du=e=>Ut(e,o9),cu=e=>Ut(e,t9),jo=e=>Ut(e,a9,!0),Nt=(e,t,o)=>{let r=Q2.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},Ut=(e,t,o=!1)=>{let r=Y2.exec(e);return r?r[1]?t(r[1]):o:!1},e9=e=>e==="position"||e==="percentage",t9=e=>e==="image"||e==="url",o9=e=>e==="length"||e==="size"||e==="bg-size",r9=e=>e==="length",fu=e=>e==="number",pu=e=>e==="family-name",a9=e=>e==="shadow",Cu=()=>{let e=_e("color"),t=_e("font"),o=_e("text"),r=_e("font-weight"),a=_e("tracking"),n=_e("leading"),l=_e("breakpoint"),i=_e("container"),s=_e("spacing"),u=_e("radius"),d=_e("shadow"),c=_e("inset-shadow"),p=_e("text-shadow"),g=_e("drop-shadow"),f=_e("blur"),M=_e("perspective"),x=_e("aspect"),w=_e("ease"),h=_e("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...H(),Q,X],Z=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],L=()=>[Q,X,s],y=()=>[$t,"full","auto",...L()],R=()=>[it,"none","subgrid",Q,X],_=()=>["auto",{span:["full",it,Q,X]},it,Q,X],N=()=>[it,"auto",Q,X],K=()=>["auto","min","max","fr",Q,X],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...L()],D=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],B=()=>[e,Q,X],U=()=>[...H(),U2,N2,{position:[Q,X]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",du,iu,{size:[Q,X]}],T=()=>[Ia,go,kt],j=()=>["","none","full",u,Q,X],m=()=>["",de,go,kt],I=()=>["solid","dashed","dotted","double"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>[de,Ia,U2,N2],$=()=>["","none",f,Q,X],v=()=>["none",de,Q,X],b=()=>["none",de,Q,X],G=()=>[de,Q,X],J=()=>[$t,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[N1],breakpoint:[N1],color:[ou],container:[N1],"drop-shadow":[N1],ease:["in","out","in-out"],font:[lu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[N1],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[N1],shadow:[N1],spacing:["px",de],text:[N1],"text-shadow":[N1],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,X,Q,x]}],container:["container"],columns:[{columns:[de,X,Q,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:k()}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:y()}],"inset-x":[{"inset-x":y()}],"inset-y":[{"inset-y":y()}],start:[{start:y()}],end:[{end:y()}],top:[{top:y()}],right:[{right:y()}],bottom:[{bottom:y()}],left:[{left:y()}],visibility:["visible","invisible","collapse"],z:[{z:[it,"auto",Q,X]}],basis:[{basis:[$t,"full","auto",i,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,$t,"auto","initial","none",X]}],grow:[{grow:["",de,Q,X]}],shrink:[{shrink:["",de,Q,X]}],order:[{order:[it,"first","last","none",Q,X]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[i,"screen",...D()]}],"min-w":[{"min-w":[i,"screen","none",...D()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",o,go,kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Q,ba]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ia,X]}],"font-family":[{font:[uu,X,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:[a,Q,X]}],"line-clamp":[{"line-clamp":[de,"none",Q,ba]}],leading:[{leading:[n,...L()]}],"list-image":[{"list-image":["none",Q,X]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Q,X]}],"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:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:[de,"from-font","auto",Q,kt]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[de,"auto",Q,X]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q,X]}],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",Q,X]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},it,Q,X],radial:["",Q,X],conic:[it,Q,X]},cu,su]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:m()}],"border-w-x":[{"border-x":m()}],"border-w-y":[{"border-y":m()}],"border-w-s":[{"border-s":m()}],"border-w-e":[{"border-e":m()}],"border-w-t":[{"border-t":m()}],"border-w-r":[{"border-r":m()}],"border-w-b":[{"border-b":m()}],"border-w-l":[{"border-l":m()}],"divide-x":[{"divide-x":m()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":m()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...I(),"hidden","none"]}],"divide-style":[{divide:[...I(),"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:[...I(),"none","hidden"]}],"outline-offset":[{"outline-offset":[de,Q,X]}],"outline-w":[{outline:["",de,go,kt]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",d,jo,zo]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",c,jo,zo]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:m()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[de,kt]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":m()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",p,jo,zo]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[de,Q,X]}],"mix-blend":[{"mix-blend":[...P(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":P()}],"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":[de]}],"mask-image-linear-from-pos":[{"mask-linear-from":C()}],"mask-image-linear-to-pos":[{"mask-linear-to":C()}],"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":C()}],"mask-image-t-to-pos":[{"mask-t-to":C()}],"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":C()}],"mask-image-r-to-pos":[{"mask-r-to":C()}],"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":C()}],"mask-image-b-to-pos":[{"mask-b-to":C()}],"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":C()}],"mask-image-l-to-pos":[{"mask-l-to":C()}],"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":C()}],"mask-image-x-to-pos":[{"mask-x-to":C()}],"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":C()}],"mask-image-y-to-pos":[{"mask-y-to":C()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Q,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":C()}],"mask-image-radial-to-pos":[{"mask-radial-to":C()}],"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":H()}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":C()}],"mask-image-conic-to-pos":[{"mask-conic-to":C()}],"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:U()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Q,X]}],filter:[{filter:["","none",Q,X]}],blur:[{blur:$()}],brightness:[{brightness:[de,Q,X]}],contrast:[{contrast:[de,Q,X]}],"drop-shadow":[{"drop-shadow":["","none",g,jo,zo]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",de,Q,X]}],"hue-rotate":[{"hue-rotate":[de,Q,X]}],invert:[{invert:["",de,Q,X]}],saturate:[{saturate:[de,Q,X]}],sepia:[{sepia:["",de,Q,X]}],"backdrop-filter":[{"backdrop-filter":["","none",Q,X]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[de,Q,X]}],"backdrop-contrast":[{"backdrop-contrast":[de,Q,X]}],"backdrop-grayscale":[{"backdrop-grayscale":["",de,Q,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[de,Q,X]}],"backdrop-invert":[{"backdrop-invert":["",de,Q,X]}],"backdrop-opacity":[{"backdrop-opacity":[de,Q,X]}],"backdrop-saturate":[{"backdrop-saturate":[de,Q,X]}],"backdrop-sepia":[{"backdrop-sepia":["",de,Q,X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Q,X]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[de,"initial",Q,X]}],ease:[{ease:["linear","initial",w,Q,X]}],delay:[{delay:[de,Q,X]}],animate:[{animate:["none",h,Q,X]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[M,Q,X]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:v()}],"rotate-x":[{"rotate-x":v()}],"rotate-y":[{"rotate-y":v()}],"rotate-z":[{"rotate-z":v()}],scale:[{scale:b()}],"scale-x":[{"scale-x":b()}],"scale-y":[{"scale-y":b()}],"scale-z":[{"scale-z":b()}],"scale-3d":["scale-3d"],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Q,X,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:J()}],"translate-x":[{"translate-x":J()}],"translate-y":[{"translate-y":J()}],"translate-z":[{"translate-z":J()}],"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",Q,X]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Q,X]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[de,go,kt,ba]}],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"]}},mu=Ws(Cu),gu=(e,t,o)=>Math.min(Math.max(e,t),o),Ko=e=>Math.round(gu(e,0,255)),n9=e=>{let t=e.replace("#",""),o=parseInt(t,16);return{r:o>>16&255,g:o>>8&255,b:o&255}},hu=({r:e,g:t,b:o})=>{let r=a=>Ko(a).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(o)}`},Ra=({h:e,s:t,v:o})=>{e=e/360,t=t/100,o=o/100;let r=Math.floor(e*6),a=e*6-r,n=o*(1-t),l=o*(1-a*t),i=o*(1-(1-a)*t),s,u,d;switch(r%6){case 0:s=o,u=i,d=n;break;case 1:s=l,u=o,d=n;break;case 2:s=n,u=o,d=i;break;case 3:s=n,u=l,d=o;break;case 4:s=i,u=n,d=o;break;case 5:s=o,u=n,d=l;break;default:s=u=d=0}return{r:Ko(s*255),g:Ko(u*255),b:Ko(d*255)}},Ha=({r:e,g:t,b:o})=>{e/=255,t/=255,o/=255;let r=Math.max(e,t,o),a=Math.min(e,t,o),n=r-a,l=0,i=r===0?0:n/r,s=r;if(n!==0)switch(r){case e:l=((t-o)/n+(t<o?6:0))/6;break;case t:l=((o-e)/n+2)/6;break;case o:l=((e-t)/n+4)/6;break}return{h:Math.round(l*360),s:Math.round(i*100),v:Math.round(s*100)}},vu=e=>hu(Ra(e)),xu=e=>Ha(n9(e));var q2=({h:e,s:t,v:o})=>{let r=o*(2-t/100)/2,a=r!==0&&r!==100?(o-r)/Math.min(r,100-r)*100:0;return{h:e,s:Math.round(a),l:Math.round(r)}},z2=({h:e,s:t,l:o})=>{let r=o+t*Math.min(o,100-o)/100,a=r===0?0:2*(1-o/r)*100;return{h:e,s:Math.round(a),v:Math.round(r)}},Lu=e=>{let{r:t,g:o,b:r}=n9(e);return(.299*t+.587*o+.114*r)/255>.5?"#000000":"#ffffff"};var wu=(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 r=e.getRgba();return`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`;case"hsl":let a=e.getHsl();return`hsl(${a.h}, ${a.s}%, ${a.l}%)`;case"hsla":let n=e.getHsla();return`hsla(${n.h}, ${n.s}%, ${n.l}%, ${n.a})`;default:Xo()}};function Iu(e){switch(e.type){case"hex":return{...xu(e.value),a:1};case"rgb":return{...Ha(e),a:1};case"rgba":return{...Ha(e),a:e.a};case"hsl":return{...z2(e),a:1};case"hsla":return{...z2(e),a:1};case"hsv":return{...e,a:1};case"hsva":return{...e};default:Xo()}}function st(e,t){let o=Iu(e);switch(t){case"hex":return vu(o);case"rgb":return Ra(o);case"rgba":return{...Ra(o),a:o.a};case"hsl":return q2(o);case"hsla":return{...q2(o),a:o.a};case"hsv":return{h:o.h,s:o.s,v:o.v};case"hsva":return o;default:Xo()}}var Pt=(...e)=>mu(Os(e)),U1=(e,t,o)=>Math.min(Math.max(e,t),o),ut=e=>Math.round(e);function Xo(e){throw new Error("You should never get here.")}var dt=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 st(this.color,"rgb")}getHsv(){return st(this.color,"hsv")}getHsla(){return st(this.color,"hsla")}getHsva(){return st(this.color,"hsva")}getHex(){return st(this.color,"hex")}getHsl(){return st(this.color,"hsl")}getRgba(){return st(this.color,"rgba")}format(t="hex"){return wu(this,t)}getContrastingColor(){return new e({type:"hex",value:Lu(this.getHex())})}},j2=(e,t)=>{let o=e.getBoundingClientRect(),r,a;if("touches"in t){let u=t.touches[0]||t.changedTouches[0];r=u.clientX,a=u.clientY}else r=t.clientX,a=t.clientY;let n=r-o.left,l=a-o.top,i=U1(n/o.width,0,1),s=U1(l/o.height,0,1);return{left:i,top:s}},Va=({onMove:e,onMoveEnd:t,onKey:o,children:r,className:a,...n})=>{let l=Go(null),i=Go(!1),s=We(p=>{!i.current||!l.current||(p.preventDefault(),e(j2(l.current,p)))},[e]),u=We(()=>{i.current=!1,t(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,t]),d=We(p=>{let g=l.current;g&&(p.preventDefault(),i.current=!0,e(j2(g,p.nativeEvent)),document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",u))},[e,s,u]),c=We(p=>{if(!o)return;let g=p.which||p.keyCode;g<37||g>40||(p.preventDefault(),o({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},[o]);return ka(()=>()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,u]),ke.jsx("div",{ref:l,className:Pt("rounded-inherit absolute inset-0 touch-none outline-none","focus:[&_.react-colorful-pointer]:scale-110",a),onTouchStart:d,onMouseDown:d,onKeyDown:c,tabIndex:0,role:"slider",...n,children:r})},Ea=({className:e,top:t=.5,left:o,color:r})=>ke.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}%`}}),bu=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(s=>{t({a:s.left},!1)},[t]),n=We(s=>{t({a:U1(e.a+s.left,0,1)},!0)},[e.a,t]),l=Wo(()=>new dt({type:"hsva",h:e.h,s:e.s,v:e.v,a:0}).format("hsla"),[e.h,e.s,e.v]),i=Wo(()=>new dt({type:"hsva",h:e.h,s:e.s,v:e.v,a:1}).format("hsla"),[e.h,e.s,e.v]);return ke.jsx("div",{className:Pt("relative h-full w-full",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Alpha","aria-valuetext":`${ut(e.a*100)}%`,"aria-valuenow":ut(e.a*100),"aria-valuemin":0,"aria-valuemax":100,className:"h-full w-full rounded-lg",children:[ke.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>')`}}),ke.jsx("div",{className:"absolute inset-0 rounded-lg",style:{backgroundImage:`linear-gradient(90deg, ${l}, ${i})`}}),ke.jsx(Ea,{className:"z-[1]",top:.5,left:e.a,color:""})]})})},yu=({hue:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(l=>{let i=ut(U1(360*l.left,0,360));t({h:i},!1)},[t]),n=We(l=>{t({h:U1(e+l.left*360,0,360)},!0)},[e,t]);return ke.jsx("div",{className:Pt("relative h-full w-full",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Hue","aria-valuenow":ut(e),"aria-valuemax":360,"aria-valuemin":0,className:"h-full w-full rounded-lg",children:[ke.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%)"}}),ke.jsx(Ea,{className:"z-[2]",top:.5,left:e/360,color:""})]})})},Mu=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(i=>{let s=ut(U1(i.left*100,0,100)),u=ut(U1(100-i.top*100,0,100));t({s,v:u},!1)},[t]),n=We(i=>{t({s:U1(e.s+i.left*100,0,100),v:U1(e.v-i.top*100,0,100)},!0)},[e.s,e.v,t]),l=`hsl(${e.h}, 100%, 50%)`;return ke.jsx("div",{className:Pt("relative h-full w-full rounded-xl",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Color","aria-valuetext":`Saturation ${ut(e.s)}%, Brightness ${ut(e.v)}%`,className:"rounded-inherit h-full w-full",children:[ke.jsx("div",{className:"rounded-inherit absolute inset-0 rounded-b-none",style:{backgroundColor:l,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)"}}),ke.jsx(Ea,{className:"z-[3]",top:1-e.v/100,left:e.s/100,color:""})]})})},l9=Ts(null),Qo=()=>{let e=Vs(l9);if(!e)throw new Error("ColorPicker compound components must be used within a ColorPicker");return e};function K2(e){return"type"in e?new dt(e):e}var Su=({color:e,onChange:t,className:o,children:r,defaultColor:a,...n})=>{let[l,i]=Pa(K2(e??a??{h:340,s:58,v:100,a:1,type:"hsva"})),s=Go(!1),u=Go(l);ka(()=>{!s.current&&e&&(u.current=K2(e),i(u.current))},[e]);let d=We((f,M)=>{let x=new dt({type:"hsva",...u.current.getHsva(),...f});u.current=x,i(x),s.current=!M,t?.(x)},[t]),c=We(()=>{s.current=!1},[]),p=We(async()=>{if(!("EyeDropper"in window)){console.log("EyeDropper API not supported");return}try{let f=await new window.EyeDropper().open();f.sRGBHex&&d(st({type:"hex",value:f.sRGBHex},"hsva"),!0)}catch(f){console.log("EyeDropper cancelled or failed:",f)}},[t]),g={hsva:l.getHsva(),updateHsva:d,handleEyeDropper:p,onFinishedUpdates:c};return ke.jsx(l9.Provider,{value:g,children:ke.jsx("div",{...n,className:Pt("relative flex h-[280px] w-[280px] cursor-default flex-col rounded-2xl bg-white shadow-lg select-none",o),children:r})})},Ru=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(Mu,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},Hu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(yu,{hue:t.h,onChange:a,className:e,onFinishedUpdates:r})},ku=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(bu,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},Pu=({className:e,title:t="Pick color from screen",children:o})=>{let{handleEyeDropper:r}=Qo(),[a,n]=Pa(!1);return ka(()=>{typeof window<"u"&&"EyeDropper"in window&&n(!0)},[]),a?ke.jsx("button",{onClick:r,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},qt=Object.assign(Su,{Saturation:Ru,Hue:Hu,Alpha:ku,EyeDropper:Pu});function Tu(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:Xo()}}var i9=(e={type:"hex",value:"#ff6b9d"})=>{let[t,o]=Pa(()=>{let l=typeof e=="function"?e():e;return{color:new dt(l),type:l.type}}),r=Wo(()=>Tu(t.color,t.type),[t.color,t.type]),a=Wo(()=>{let l=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:l,alpha:l.a}},[t.color]),n=We(l=>{try{let i="type"in l?new dt(l):l;o(s=>({color:i,type:s.type}))}catch(i){console.warn("Invalid color input:",l,i)}},[]);return[{colorInput:r,colorState:a},n]};import{createPortal as u7}from"react-dom";import{useRef as H1,useMemo as Vu,useEffect as Eu,useState as kf,useCallback as Pf}from"react";function s9(e,t,o,r){var a=this,n=H1(null),l=H1(0),i=H1(0),s=H1(null),u=H1([]),d=H1(),c=H1(),p=H1(e),g=H1(!0),f=H1(),M=H1();p.current=e;var x=typeof window<"u",w=!t&&t!==0&&x;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var h=!!(o=o||{}).leading,S=!("trailing"in o)||!!o.trailing,H=!!o.flushOnExit&&S,k="maxWait"in o,Z="debounceOnServer"in o&&!!o.debounceOnServer,V=k?Math.max(+o.maxWait||0,t):null,L=Vu(function(){var y=function(F){var D=u.current,B=d.current;return u.current=d.current=null,l.current=F,i.current=i.current||F,c.current=p.current.apply(B,D)},R=function(F,D){w&&cancelAnimationFrame(s.current),s.current=w?requestAnimationFrame(F):setTimeout(F,D)},_=function(F){if(!g.current)return!1;var D=F-n.current;return!n.current||D>=t||D<0||k&&F-l.current>=V},N=function(F){return s.current=null,S&&u.current?y(F):(u.current=d.current=null,c.current)},K=function F(){var D=Date.now();if(h&&i.current===l.current&&z(),_(D))return N(D);if(g.current){var B=t-(D-n.current),U=k?Math.min(B,V-(D-l.current)):B;R(F,U)}},z=function(){r&&r({})},W=function(){if(x||Z){var F,D=Date.now(),B=_(D);if(u.current=[].slice.call(arguments),d.current=a,n.current=D,H&&!f.current&&(f.current=function(){var U;((U=globalThis.document)==null?void 0:U.visibilityState)==="hidden"&&M.current.flush()},(F=globalThis.document)==null||F.addEventListener==null||F.addEventListener("visibilitychange",f.current)),B){if(!s.current&&g.current)return l.current=n.current,R(K,t),h?y(n.current):c.current;if(k)return R(K,t),y(n.current)}return s.current||R(K,t),c.current}};return W.cancel=function(){var F=s.current;F&&(w?cancelAnimationFrame(s.current):clearTimeout(s.current)),l.current=0,u.current=n.current=d.current=s.current=null,F&&r&&r({})},W.isPending=function(){return!!s.current},W.flush=function(){return s.current?N(Date.now()):c.current},W},[h,k,t,V,S,H,w,x,Z,r]);return M.current=L,Eu(function(){return g.current=!0,function(){var y;H&&M.current.flush(),f.current&&((y=globalThis.document)==null||y.removeEventListener==null||y.removeEventListener("visibilitychange",f.current),f.current=null),g.current=!1}},[H]),L}import t1 from"react";function q1(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 u9='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Yo({computePosition:e,onClose:t,autoFocus:o=!0,trapFocus:r=!1,restoreFocusOnOutside:a=!0}={}){let[n,l]=t1.useState(!1),[i,s]=t1.useState({top:0,left:0}),u=t1.useRef(null),d=t1.useRef(null),c=t1.useRef(!1),p=t1.useRef(e);p.current=e;let g=t1.useRef(t);g.current=t;let f=t1.useRef(r);f.current=r;let M=t1.useCallback((...S)=>{!u.current||!p.current||s(p.current(u.current,...S))},[]),x=t1.useCallback(()=>{M(),c.current=!0,l(!0)},[M]),w=t1.useCallback((S=!0)=>{g.current&&g.current(),c.current=!1,l(!1),S&&u.current?.focus()},[]),h=t1.useCallback(()=>{c.current?w():x()},[x,w]);return t1.useEffect(()=>{if(!n)return;let S=k=>{if(k.key==="Escape"&&(k.preventDefault(),w()),f.current&&k.key==="Tab"){let Z=d.current;if(!Z)return;let V=Array.from(Z.querySelectorAll(u9)).filter(R=>!R.hasAttribute("disabled")),L=V[0],y=V.at(-1);if(!L||!y)return;k.shiftKey&&document.activeElement===L?(k.preventDefault(),y.focus()):!k.shiftKey&&document.activeElement===y&&(k.preventDefault(),L.focus())}},H=k=>{let Z=d.current,V=u.current;if(!Z||!V)return;let L=typeof k.composedPath=="function"?k.composedPath():[],y=L.includes(Z)||k.target instanceof Node&&Z.contains(k.target),R=L.includes(V)||k.target instanceof Node&&V.contains(k.target);!y&&!R&&w(a)};return document.addEventListener("keydown",S),document.addEventListener("mousedown",H),document.addEventListener("touchstart",H),()=>{document.removeEventListener("keydown",S),document.removeEventListener("mousedown",H),document.removeEventListener("touchstart",H)}},[n,w,a]),t1.useEffect(()=>{if(!n||!o||!d.current)return;let S=d.current.querySelector(u9);S&&S.focus()},[n,o]),t1.useEffect(()=>{if(!n||!u.current)return;let S=q1(u.current);if(!S)return;let H=()=>w();return S.addEventListener("scroll",H,{passive:!0}),()=>S.removeEventListener("scroll",H)},[n,w]),{isOpen:n,open:x,close:w,toggle:h,triggerRef:u,popoverRef:d,position:i,reposition:M}}var Du=(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}}},Jo=Du;var Ou={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},d9=Ou;var _u=e=>Jo(d9[e.toLowerCase()],6),c9=_u;var Bu=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Au=e=>{let t;return(t=e.match(Bu))?Jo(parseInt(t[1],16),t[1].length):void 0},f9=Au;var o1="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Uf=`(?:${o1}|none)`,Tt=`${o1}%`,qf=`(?:${o1}%|none)`,ho=`(?:${o1}%|${o1})`,Zu=`(?:${o1}%|${o1}|none)`,p9=`(?:${o1}(deg|grad|rad|turn)|${o1})`,zf=`(?:${o1}(deg|grad|rad|turn)|${o1}|none)`,ct="\\s*,\\s*";var jf=new RegExp("^"+Zu+"$");var Fu=new RegExp(`^rgba?\\(\\s*${o1}${ct}${o1}${ct}${o1}\\s*(?:,\\s*${ho}\\s*)?\\)$`),$u=new RegExp(`^rgba?\\(\\s*${Tt}${ct}${Tt}${ct}${Tt}\\s*(?:,\\s*${ho}\\s*)?\\)$`),Nu=e=>{let t={mode:"rgb"},o;if(o=e.match(Fu))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($u))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},C9=Nu;var Uu=(e,t)=>e===void 0?void 0:typeof e!="object"?z1(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,er=Uu;var qu=(e="rgb")=>t=>(t=er(t,e))!==void 0?t.mode===e?t:k1[t.mode][e]?k1[t.mode][e](t):e==="rgb"?k1[t.mode].rgb(t):k1.rgb[e](k1[t.mode].rgb(t)):void 0,r1=qu;var k1={},m9={},vo=[],Da={},zu=e=>e,ge=e=>(k1[e.mode]={...k1[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{k1[t]||(k1[t]={}),k1[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=zu)}),m9[e.mode]=e,(e.parse||[]).forEach(t=>{ju(t,e.mode)}),r1(e.mode)),tr=e=>m9[e],ju=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Da[e]=t}else typeof e=="function"&&vo.indexOf(e)<0&&vo.push(e)};var Oa=/[^\x00-\x7F]|[a-zA-Z_]/,Ku=/[^\x00-\x7F]|[-\w]/,E={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},ae=0;function or(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 _a(e){if(ae>=e.length)return!1;let t=e[ae];if(Oa.test(t))return!0;if(t==="-"){if(e.length-ae<2)return!1;let o=e[ae+1];return!!(o==="-"||Oa.test(o))}return!1}var Gu={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function xo(e){let t="";if((e[ae]==="-"||e[ae]==="+")&&(t+=e[ae++]),t+=rr(e),e[ae]==="."&&/\d/.test(e[ae+1])&&(t+=e[ae++]+rr(e)),(e[ae]==="e"||e[ae]==="E")&&((e[ae+1]==="-"||e[ae+1]==="+")&&/\d/.test(e[ae+2])?t+=e[ae++]+e[ae++]+rr(e):/\d/.test(e[ae+1])&&(t+=e[ae++]+rr(e))),_a(e)){let o=ar(e);return o==="deg"||o==="rad"||o==="turn"||o==="grad"?{type:E.Hue,value:t*Gu[o]}:void 0}return e[ae]==="%"?(ae++,{type:E.Percentage,value:+t}):{type:E.Number,value:+t}}function rr(e){let t="";for(;/\d/.test(e[ae]);)t+=e[ae++];return t}function ar(e){let t="";for(;ae<e.length&&Ku.test(e[ae]);)t+=e[ae++];return t}function Wu(e){let t=ar(e);return e[ae]==="("?(ae++,{type:E.Function,value:t}):t==="none"?{type:E.None,value:void 0}:{type:E.Ident,value:t}}function Xu(e=""){let t=e.trim(),o=[],r;for(ae=0;ae<t.length;){if(r=t[ae++],r===`
2
+ `||r===" "||r===" "){for(;ae<t.length&&(t[ae]===`
3
+ `||t[ae]===" "||t[ae]===" ");)ae++;continue}if(r===",")return;if(r===")"){o.push({type:E.ParenClose});continue}if(r==="+"){if(ae--,or(t)){o.push(xo(t));continue}return}if(r==="-"){if(ae--,or(t)){o.push(xo(t));continue}if(_a(t)){o.push({type:E.Ident,value:ar(t)});continue}return}if(r==="."){if(ae--,or(t)){o.push(xo(t));continue}return}if(r==="/"){for(;ae<t.length&&(t[ae]===`
4
+ `||t[ae]===" "||t[ae]===" ");)ae++;let a;if(or(t)&&(a=xo(t),a.type!==E.Hue)){o.push({type:E.Alpha,value:a});continue}if(_a(t)&&ar(t)==="none"){o.push({type:E.Alpha,value:{type:E.None,value:void 0}});continue}return}if(/\d/.test(r)){ae--,o.push(xo(t));continue}if(Oa.test(r)){ae--,o.push(Wu(t));continue}return}return o}function Qu(e){e._i=0;let t=e[e._i++];if(!t||t.type!==E.Function||t.value!=="color"||(t=e[e._i++],t.type!==E.Ident))return;let o=Da[t.value];if(!o)return;let r={mode:o},a=g9(e,!1);if(!a)return;let n=tr(o).channels;for(let l=0,i,s;l<n.length;l++)i=a[l],s=n[l],i.type!==E.None&&(r[s]=i.type===E.Number?i.value:i.value/100,s==="alpha"&&(r[s]=Math.max(0,Math.min(1,r[s]))));return r}function g9(e,t){let o=[],r;for(;e._i<e.length;){if(r=e[e._i++],r.type===E.None||r.type===E.Number||r.type===E.Alpha||r.type===E.Percentage||t&&r.type===E.Hue){o.push(r);continue}if(r.type===E.ParenClose){if(e._i<e.length)return;continue}return}if(!(o.length<3||o.length>4)){if(o.length===4){if(o[3].type!==E.Alpha)return;o[3]=o[3].value}return o.length===3&&o.push({type:E.None,value:void 0}),o.every(a=>a.type!==E.Alpha)?o:void 0}}function Yu(e,t){e._i=0;let o=e[e._i++];if(!o||o.type!==E.Function)return;let r=g9(e,t);if(r)return r.unshift(o.value),r}var Ju=e=>{if(typeof e!="string")return;let t=Xu(e),o=t?Yu(t,!0):void 0,r,a=0,n=vo.length;for(;a<n;)if((r=vo[a++](e,o))!==void 0)return r;return t?Qu(t):void 0},z1=Ju;function ed(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let o={mode:"rgb"},[,r,a,n,l]=t;if(!(r.type===E.Hue||a.type===E.Hue||n.type===E.Hue))return r.type!==E.None&&(o.r=r.type===E.Number?r.value/255:r.value/100),a.type!==E.None&&(o.g=a.type===E.Number?a.value/255:a.value/100),n.type!==E.None&&(o.b=n.type===E.Number?n.value/255:n.value/100),l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var h9=ed;var td=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,v9=td;var x9=(e,t,o)=>e+o*(t-e);var od=e=>{let t=[];for(let o=0;o<e.length-1;o++){let r=e[o],a=e[o+1];r===void 0&&a===void 0?t.push(void 0):r!==void 0&&a!==void 0?t.push([r,a]):t.push(r!==void 0?[r,r]:[a,a])}return t},L9=e=>t=>{let o=od(t);return r=>{let a=r*o.length,n=r>=1?o.length-1:Math.max(Math.floor(a),0),l=o[n];return l===void 0?void 0:e(l[0],l[1],a-n)}};var O=L9(x9);var fe=e=>{let t=!1,o=e.map(r=>r!==void 0?(t=!0,r):1);return t?o:e};var rd={mode:"rgb",channels:["r","g","b","alpha"],parse:[h9,f9,C9,c9,v9,"srgb"],serialize:"srgb",interpolate:{r:O,g:O,b:O,alpha:{use:O,fixup:fe}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},g1=rd;var Ba=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),ad=e=>{let t=Ba(e.r),o=Ba(e.g),r=Ba(e.b),a={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*o+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*o+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*o+.9913375368376386*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},Aa=ad;var Za=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),nd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"a98",r:Za(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*o),g:Za(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*o),b:Za(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*o)};return r!==void 0&&(a.alpha=r),a},Fa=nd;var $a=(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)},ld=({r:e,g:t,b:o,alpha:r})=>{let a={mode:"lrgb",r:$a(e),g:$a(t),b:$a(o)};return r!==void 0&&(a.alpha=r),a},h1=ld;var id=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz65",x:.4123907992659593*t+.357584339383878*o+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*o+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*o+.9505321522496607*r};return a!==void 0&&(n.alpha=a),n},n1=id;var Na=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},sd=({r:e,g:t,b:o,alpha:r},a="rgb")=>{let n={mode:a,r:Na(e),g:Na(t),b:Na(o)};return r!==void 0&&(n.alpha=r),n},v1=sd;var ud=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({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 r!==void 0&&(a.alpha=r),a},l1=ud;var dd={...g1,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Fa(n1(e)),xyz65:Fa},toMode:{rgb:e=>l1(Aa(e)),xyz65:Aa}},w9=dd;var cd=e=>(e=e%360)<0?e+360:e,xe=cd;var fd=(e,t)=>e.map((o,r,a)=>{if(o===void 0)return o;let n=xe(o);return r===0||e[r-1]===void 0?n:t(n-xe(a[r-1]))}).reduce((o,r)=>!o.length||r===void 0||o[o.length-1]===void 0?(o.push(r),o):(o.push(r+o[o.length-1]),o),[]),qe=e=>fd(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var Ee=[-.14861,1.78277,-.29227,-.90649,1.97294,0],I9=Math.PI/180,b9=180/Math.PI;var y9=Ee[3]*Ee[4],M9=Ee[1]*Ee[4],S9=Ee[1]*Ee[2]-Ee[0]*Ee[3],pd=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(S9*o+e*y9-t*M9)/(S9+y9-M9),n=o-a,l=(Ee[4]*(t-a)-Ee[2]*n)/Ee[3],i={mode:"cubehelix",l:a,s:a===0||a===1?void 0:Math.sqrt(n*n+l*l)/(Ee[4]*a*(1-a))};return i.s&&(i.h=Math.atan2(l,n)*b9-120),r!==void 0&&(i.alpha=r),i},R9=pd;var Cd=({h:e,s:t,l:o,alpha:r})=>{let a={mode:"rgb"};e=(e===void 0?0:e+120)*I9,o===void 0&&(o=0);let n=t===void 0?0:t*o*(1-o),l=Math.cos(e),i=Math.sin(e);return a.r=o+n*(Ee[0]*l+Ee[1]*i),a.g=o+n*(Ee[2]*l+Ee[3]*i),a.b=o+n*(Ee[4]*l+Ee[5]*i),r!==void 0&&(a.alpha=r),a},H9=Cd;var ft=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let o=xe(e.h),r=xe(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*a},k9=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let o=xe(e.h),r=xe(t.h);return Math.abs(r-o)>180?o-(r-360*Math.sign(r-o)):r-o},pt=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let o=xe(e.h),r=xe(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*a};var ze=e=>{let t=e.reduce((r,a)=>{if(a!==void 0){let n=a*Math.PI/180;r.sin+=Math.sin(n),r.cos+=Math.cos(n)}return r},{sin:0,cos:0}),o=Math.atan2(t.sin,t.cos)*180/Math.PI;return o<0?360+o:o};var md={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:R9},toMode:{rgb:H9},interpolate:{h:{use:O,fixup:qe},s:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},P9=md;var gd=({l:e,a:t,b:o,alpha:r},a="lch")=>{t===void 0&&(t=0),o===void 0&&(o=0);let n=Math.sqrt(t*t+o*o),l={mode:a,l:e,c:n};return n&&(l.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},c1=gd;var hd=({l:e,c:t,h:o,alpha:r},a="lab")=>{o===void 0&&(o=0);let n={mode:a,l:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(n.alpha=r),n},f1=hd;var nr=Math.pow(29,3)/Math.pow(3,3),lr=Math.pow(6,3)/Math.pow(29,3);var be={X:.9642956764295677,Y:1,Z:.8251046025104602},Ct={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},np=Math.pow(29,3)/Math.pow(3,3),lp=Math.pow(6,3)/Math.pow(29,3);var Ua=e=>Math.pow(e,3)>lr?Math.pow(e,3):(116*e-16)/nr,vd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz65",x:Ua(n)*Ct.X,y:Ua(a)*Ct.Y,z:Ua(l)*Ct.Z};return r!==void 0&&(i.alpha=r),i},ir=vd;var xd=e=>l1(ir(e)),mt=xd;var qa=e=>e>lr?Math.cbrt(e):(nr*e+16)/116,Ld=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=qa(e/Ct.X),n=qa(t/Ct.Y),l=qa(o/Ct.Z),i={mode:"lab65",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},sr=Ld;var wd=e=>{let t=sr(n1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},gt=wd;var Vt=.14444444444444443*Math.PI,zt=Math.cos(Vt),jt=Math.sin(Vt),ur=100/Math.log(139/100);var Id=({l:e,c:t,h:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"lab65",l:(Math.exp(e*1/ur)-1)/.0039},n=(Math.exp(.0435*t*1*1)-1)/.075,l=n*Math.cos(o/180*Math.PI-Vt),i=n*Math.sin(o/180*Math.PI-Vt);return a.a=l*zt-i/.83*jt,a.b=l*jt+i/.83*zt,r!==void 0&&(a.alpha=r),a},wo=Id;var bd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=t*zt+o*jt,n=.83*(o*zt-t*jt),l=Math.sqrt(a*a+n*n),i={mode:"dlch",l:ur/1*Math.log(1+.0039*e),c:Math.log(1+.075*l)/(.0435*1*1)};return i.c&&(i.h=xe((Math.atan2(n,a)+Vt)/Math.PI*180)),r!==void 0&&(i.alpha=r),i},Io=bd;var T9=e=>wo(c1(e,"dlch")),V9=e=>f1(Io(e),"dlab"),yd={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:T9,rgb:e=>mt(T9(e))},fromMode:{lab65:V9,rgb:e=>V9(gt(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:O,a:O,b:O,alpha:{use:O,fixup:fe}}},E9=yd;var Md={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:wo,dlab:e=>f1(e,"dlab"),rgb:e=>mt(wo(e))},fromMode:{lab65:Io,dlab:e=>c1(e,"dlch"),rgb:e=>Io(gt(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:O,c:O,h:{use:O,fixup:qe},alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},D9=Md;function ja({h:e,s:t,i:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1-t)};break;case 1:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1+t*(3/(2-a)-1)),b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o*(1+t*(3/(2-a)-1)),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;case 3:n={r:o*(1-t),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1+t*(3/(2-a)-1))};break;case 4:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3/(2-a)-1))};break;case 5:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function Ka({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsi",s:e+t+o===0?0:1-3*n/(e+t+o),i:(e+t+o)/3};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Sd={mode:"hsi",toMode:{rgb:ja},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Ka},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:O,fixup:qe},s:O,i:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},O9=Sd;function Ga({h:e,s:t,l:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=o+t*(o<.5?o:1-o),n=a-(a-o)*2*Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:a,g:n,b:2*o-a};break;case 1:l={r:n,g:a,b:2*o-a};break;case 2:l={r:2*o-a,g:a,b:n};break;case 3:l={r:2*o-a,g:n,b:a};break;case 4:l={r:n,g:2*o-a,b:a};break;case 5:l={r:a,g:2*o-a,b:n};break;default:l={r:2*o-a,g:2*o-a,b:2*o-a}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function Wa({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsl",s:a===n?0:(a-n)/(1-Math.abs(a+n-1)),l:.5*(a+n)};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Rd=(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}},_9=Rd;var Hd=new RegExp(`^hsla?\\(\\s*${p9}${ct}${Tt}${ct}${Tt}\\s*(?:,\\s*${ho}\\s*)?\\)$`),kd=e=>{let t=e.match(Hd);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=_9(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},B9=kd;function Pd(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let o={mode:"hsl"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Percentage)return;o.h=r.value}if(a.type!==E.None){if(a.type===E.Hue)return;o.s=a.value/100}if(n.type!==E.None){if(n.type===E.Hue)return;o.l=n.value/100}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var A9=Pd;var Td={mode:"hsl",toMode:{rgb:Ga},fromMode:{rgb:Wa},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[A9,B9],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:O,fixup:qe},s:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},dr=Td;function bo({h:e,s:t,v:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o,g:o*(1-t*a),b:o*(1-t)};break;case 1:n={r:o*(1-t*a),g:o,b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o,b:o*(1-t*a)};break;case 3:n={r:o*(1-t),g:o*(1-t*a),b:o};break;case 4:n={r:o*(1-t*a),g:o*(1-t),b:o};break;case 5:n={r:o,g:o*(1-t),b:o*(1-t*a)};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function yo({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsv",s:a===0?0:1-n/a,v:a};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Vd={mode:"hsv",toMode:{rgb:bo},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:yo},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:O,fixup:qe},s:O,v:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},cr=Vd;function Xa({h:e,w:t,b:o,alpha:r}){if(t===void 0&&(t=0),o===void 0&&(o=0),t+o>1){let a=t+o;t/=a,o/=a}return bo({h:e,s:o===1?1:1-t/(1-o),v:1-o,alpha:r})}function Qa(e){let t=yo(e);if(t===void 0)return;let o=t.s!==void 0?t.s:0,r=t.v!==void 0?t.v:0,a={mode:"hwb",w:(1-o)*r,b:1-r};return t.h!==void 0&&(a.h=t.h),t.alpha!==void 0&&(a.alpha=t.alpha),a}function Ed(e,t){if(!t||t[0]!=="hwb")return;let o={mode:"hwb"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Percentage)return;o.h=r.value}if(a.type!==E.None){if(a.type===E.Hue)return;o.w=a.value/100}if(n.type!==E.None){if(n.type===E.Hue)return;o.b=n.value/100}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var Z9=Ed;var Dd={mode:"hwb",toMode:{rgb:Xa},fromMode:{rgb:Qa},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Z9],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:O,fixup:qe},w:O,b:O,alpha:{use:O,fixup:fe}},difference:{h:k9},average:{h:ze}},F9=Dd;var Kt=.1593017578125,$9=78.84375,Gt=.8359375,Wt=18.8515625,Xt=18.6875;function fr(e){if(e<0)return 0;let t=Math.pow(e,1/$9);return 1e4*Math.pow(Math.max(0,t-Gt)/(Wt-Xt*t),1/Kt)}function pr(e){if(e<0)return 0;let t=Math.pow(e/1e4,Kt);return Math.pow((Gt+Wt*t)/(1+Xt*t),$9)}var Ya=e=>Math.max(e/203,0),_d=({i:e,t,p:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=fr(e+.008609037037932761*t+.11102962500302593*o),n=fr(e-.00860903703793275*t-.11102962500302599*o),l=fr(e+.5600313357106791*t-.32062717498731885*o),i={mode:"xyz65",x:Ya(2.070152218389422*a-1.3263473389671556*n+.2066510476294051*l),y:Ya(.3647385209748074*a+.680566024947227*n-.0453045459220346*l),z:Ya(-.049747207535812*a-.0492609666966138*n+1.1880659249923042*l)};return r!==void 0&&(i.alpha=r),i},Ja=_d;var en=(e=0)=>Math.max(e*203,0),Bd=({x:e,y:t,z:o,alpha:r})=>{let a=en(e),n=en(t),l=en(o),i=pr(.3592832590121217*a+.6976051147779502*n-.0358915932320289*l),s=pr(-.1920808463704995*a+1.1004767970374323*n+.0753748658519118*l),u=pr(.0070797844607477*a+.0748396662186366*n+.8433265453898765*l),d=.5*i+.5*s,c=1.61376953125*i-3.323486328125*s+1.709716796875*u,p=4.378173828125*i-4.24560546875*s-.132568359375*u,g={mode:"itp",i:d,t:c,p};return r!==void 0&&(g.alpha=r),g},tn=Bd;var Ad={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Ja,rgb:e=>l1(Ja(e))},fromMode:{xyz65:tn,rgb:e=>tn(n1(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:O,t:O,p:O,alpha:{use:O,fixup:fe}}},N9=Ad;var Zd=134.03437499999998,Fd=16295499532821565e-27,on=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,Kt);return Math.pow((Gt+Wt*t)/(1+Xt*t),Zd)},rn=(e=0)=>Math.max(e*203,0),$d=({x:e,y:t,z:o,alpha:r})=>{e=rn(e),t=rn(t),o=rn(o);let a=1.15*e-.15*o,n=.66*t+.34*e,l=on(.41478972*a+.579999*n+.014648*o),i=on(-.20151*a+1.120649*n+.0531008*o),s=on(-.0166008*a+.2648*n+.6684799*o),u=(l+i)/2,d={mode:"jab",j:.44*u/(1-.56*u)-Fd,a:3.524*l-4.066708*i+.542708*s,b:.199076*l+1.096799*i-1.295875*s};return r!==void 0&&(d.alpha=r),d},Cr=$d;var Nd=134.03437499999998,U9=16295499532821565e-27,an=e=>{if(e<0)return 0;let t=Math.pow(e,1/Nd);return 1e4*Math.pow((Gt-t)/(Xt*t-Wt),1/Kt)},nn=e=>e/203,Ud=({j:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+U9)/(.44+.56*(e+U9)),n=an(a+.13860504*t+.058047316*o),l=an(a-.13860504*t-.058047316*o),i=an(a-.096019242*t-.8118919*o),s={mode:"xyz65",x:nn(1.661373024652174*n-.914523081304348*l+.23136208173913045*i),y:nn(-.3250758611844533*n+1.571847026732543*l-.21825383453227928*i),z:nn(-.090982811*n-.31272829*l+1.5227666*i)};return r!==void 0&&(s.alpha=r),s},mr=Ud;var qd=e=>{let t=Cr(n1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},gr=qd;var zd=e=>l1(mr(e)),hr=zd;var jd={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:gr,xyz65:Cr},toMode:{rgb:hr,xyz65:mr},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:O,a:O,b:O,alpha:{use:O,fixup:fe}}},q9=jd;var Kd=({j:e,a:t,b:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"jch",j:e,c:a};return a&&(n.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},ln=Kd;var Gd=({j:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={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 r!==void 0&&(a.alpha=r),a},sn=Gd;var Wd={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:sn,rgb:e=>hr(sn(e))},fromMode:{rgb:e=>ln(gr(e)),jab:ln},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:O,fixup:qe},c:O,j:O,alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},z9=Wd;var ht=Math.pow(29,3)/Math.pow(3,3),Qt=Math.pow(6,3)/Math.pow(29,3);var un=e=>Math.pow(e,3)>Qt?Math.pow(e,3):(116*e-16)/ht,Xd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz50",x:un(n)*be.X,y:un(a)*be.Y,z:un(l)*be.Z};return r!==void 0&&(i.alpha=r),i},Yt=Xd;var Qd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({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 r!==void 0&&(a.alpha=r),a},V1=Qd;var Yd=e=>V1(Yt(e)),vr=Yd;var Jd=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz50",x:.436065742824811*t+.3851514688337912*o+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*o+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*o+.7140993584005155*r};return a!==void 0&&(n.alpha=a),n},E1=Jd;var dn=e=>e>Qt?Math.cbrt(e):(ht*e+16)/116,e3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=dn(e/be.X),n=dn(t/be.Y),l=dn(o/be.Z),i={mode:"lab",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},Jt=e3;var t3=e=>{let t=Jt(E1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},xr=t3;function o3(e,t){if(!t||t[0]!=="lab")return;let o={mode:"lab"},[,r,a,n,l]=t;if(!(r.type===E.Hue||a.type===E.Hue||n.type===E.Hue))return r.type!==E.None&&(o.l=Math.min(Math.max(0,r.value),100)),a.type!==E.None&&(o.a=a.type===E.Number?a.value:a.value*125/100),n.type!==E.None&&(o.b=n.type===E.Number?n.value:n.value*125/100),l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var j9=o3;var r3={mode:"lab",toMode:{xyz50:Yt,rgb:vr},fromMode:{xyz50:Jt,rgb:xr},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[j9],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:O,a:O,b:O,alpha:{use:O,fixup:fe}}},eo=r3;var a3={...eo,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:ir,rgb:mt},fromMode:{xyz65:sr,rgb:gt},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},K9=a3;function n3(e,t){if(!t||t[0]!=="lch")return;let o={mode:"lch"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Hue)return;o.l=Math.min(Math.max(0,r.value),100)}if(a.type!==E.None&&(o.c=Math.max(0,a.type===E.Number?a.value:a.value*150/100)),n.type!==E.None){if(n.type===E.Percentage)return;o.h=n.value}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var G9=n3;var l3={mode:"lch",toMode:{lab:f1,rgb:e=>vr(f1(e))},fromMode:{rgb:e=>c1(xr(e)),lab:c1},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[G9],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:O,fixup:qe},c:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},to=l3;var i3={...to,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>f1(e,"lab65"),rgb:e=>mt(f1(e,"lab65"))},fromMode:{rgb:e=>c1(gt(e),"lch65"),lab65:e=>c1(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},W9=i3;var s3=({l:e,u:t,v:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"lchuv",l:e,c:a};return a&&(n.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},cn=s3;var u3=({l:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={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 r!==void 0&&(a.alpha=r),a},fn=u3;var X9=(e,t,o)=>4*e/(e+15*t+3*o),Q9=(e,t,o)=>9*t/(e+15*t+3*o),d3=X9(be.X,be.Y,be.Z),c3=Q9(be.X,be.Y,be.Z),f3=e=>e<=Qt?ht*e:116*Math.cbrt(e)-16,p3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=f3(t/be.Y),n=X9(e,t,o),l=Q9(e,t,o);!isFinite(n)||!isFinite(l)?a=n=l=0:(n=13*a*(n-d3),l=13*a*(l-c3));let i={mode:"luv",l:a,u:n,v:l};return r!==void 0&&(i.alpha=r),i},Mo=p3;var C3=(e,t,o)=>4*e/(e+15*t+3*o),m3=(e,t,o)=>9*t/(e+15*t+3*o),g3=C3(be.X,be.Y,be.Z),h3=m3(be.X,be.Y,be.Z),v3=({l:e,u:t,v:o,alpha:r})=>{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 a=t/(13*e)+g3,n=o/(13*e)+h3,l=be.Y*(e<=8?e/ht:Math.pow((e+16)/116,3)),i=l*(9*a)/(4*n),s=l*(12-3*a-20*n)/(4*n),u={mode:"xyz50",x:i,y:l,z:s};return r!==void 0&&(u.alpha=r),u},So=v3;var x3=e=>cn(Mo(E1(e))),L3=e=>V1(So(fn(e))),w3={mode:"lchuv",toMode:{luv:fn,rgb:L3},fromMode:{rgb:x3,luv:cn},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:O,fixup:qe},c:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},Y9=w3;var I3={...g1,mode:"lrgb",toMode:{rgb:v1},fromMode:{rgb:h1},parse:["srgb-linear"],serialize:"srgb-linear"},J9=I3;var b3={mode:"luv",toMode:{xyz50:So,rgb:e=>V1(So(e))},fromMode:{xyz50:Mo,rgb:e=>Mo(E1(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:O,u:O,v:O,alpha:{use:O,fixup:fe}}},e0=b3;var y3=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*o),n=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*o),l=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*o),i={mode:"oklab",l:.210454268309314*a+.7936177747023054*n-.0040720430116193*l,a:1.9779985324311684*a-2.42859224204858*n+.450593709617411*l,b:.0259040424655478*a+.7827717124575296*n-.8086757549230774*l};return r!==void 0&&(i.alpha=r),i},Lr=y3;var M3=e=>{let t=Lr(h1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},vt=M3;var S3=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.pow(e+.3963377773761749*t+.2158037573099136*o,3),n=Math.pow(e-.1055613458156586*t-.0638541728258133*o,3),l=Math.pow(e-.0894841775298119*t-1.2914855480194092*o,3),i={mode:"lrgb",r:4.076741636075957*a-3.3077115392580616*n+.2309699031821044*l,g:-1.2684379732850317*a+2.6097573492876887*n-.3413193760026573*l,b:-.0041960761386756*a-.7034186179359362*n+1.7076146940746117*l};return r!==void 0&&(i.alpha=r),i},D1=S3;var R3=e=>v1(D1(e)),xt=R3;function Ro(e){let r=1.170873786407767;return .5*(r*e-.206+Math.sqrt((r*e-.206)*(r*e-.206)+4*.03*r*e))}function Et(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function H3(e,t){let o,r,a,n,l,i,s,u;-1.88170328*e-.80936493*t>1?(o=1.19086277,r=1.76576728,a=.59662641,n=.75515197,l=.56771245,i=4.0767416621,s=-3.3077115913,u=.2309699292):1.81444104*e-1.19445276*t>1?(o=.73956515,r=-.45954404,a=.08285427,n=.1254107,l=.14503204,i=-1.2684380046,s=2.6097574011,u=-.3413193965):(o=1.35733652,r=-.00915799,a=-1.1513021,n=-.50559606,l=.00692167,i=-.0041960863,s=-.7034186147,u=1.707614701);let d=o+r*e+a*t+n*e*e+l*e*t,c=.3963377774*e+.2158037573*t,p=-.1055613458*e-.0638541728*t,g=-.0894841775*e-1.291485548*t;{let f=1+d*c,M=1+d*p,x=1+d*g,w=f*f*f,h=M*M*M,S=x*x*x,H=3*c*f*f,k=3*p*M*M,Z=3*g*x*x,V=6*c*c*f,L=6*p*p*M,y=6*g*g*x,R=i*w+s*h+u*S,_=i*H+s*k+u*Z,N=i*V+s*L+u*y;d=d-R*_/(_*_-.5*R*N)}return d}function pn(e,t){let o=H3(e,t),r=D1({l:1,a:o*e,b:o*t}),a=Math.cbrt(1/Math.max(r.r,r.g,r.b)),n=a*o;return[a,n]}function k3(e,t,o,r,a,n=null){n||(n=pn(e,t));let l;if((o-a)*n[1]-(n[0]-a)*r<=0)l=n[1]*a/(r*n[0]+n[1]*(a-o));else{l=n[1]*(a-1)/(r*(n[0]-1)+n[1]*(a-o));{let i=o-a,s=r,u=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,c=-.0894841775*e-1.291485548*t,p=i+s*u,g=i+s*d,f=i+s*c;{let M=a*(1-l)+l*o,x=l*r,w=M+x*u,h=M+x*d,S=M+x*c,H=w*w*w,k=h*h*h,Z=S*S*S,V=3*p*w*w,L=3*g*h*h,y=3*f*S*S,R=6*p*p*w,_=6*g*g*h,N=6*f*f*S,K=4.0767416621*H-3.3077115913*k+.2309699292*Z-1,z=4.0767416621*V-3.3077115913*L+.2309699292*y,W=4.0767416621*R-3.3077115913*_+.2309699292*N,F=z/(z*z-.5*K*W),D=-K*F,B=-1.2684380046*H+2.6097574011*k-.3413193965*Z-1,U=-1.2684380046*V+2.6097574011*L-.3413193965*y,A=-1.2684380046*R+2.6097574011*_-.3413193965*N,q=U/(U*U-.5*B*A),T=-B*q,j=-.0041960863*H-.7034186147*k+1.707614701*Z-1,m=-.0041960863*V-.7034186147*L+1.707614701*y,I=-.0041960863*R-.7034186147*_+1.707614701*N,P=m/(m*m-.5*j*I),C=-j*P;D=F>=0?D:1e6,T=q>=0?T:1e6,C=P>=0?C:1e6,l+=Math.min(D,Math.min(T,C))}}}return l}function Ho(e,t,o=null){o||(o=pn(e,t));let r=o[0],a=o[1];return[a/r,a/(1-r)]}function wr(e,t,o){let r=pn(t,o),a=k3(t,o,e,1,e,r),n=Ho(t,o,r),l=.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=a/Math.min(e*n[0],(1-e)*n[1]),u=e*l,d=(1-e)*i,c=.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))),c,a]}function Ir(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a={mode:"okhsl",l:Ro(t)};e.alpha!==void 0&&(a.alpha=e.alpha);let n=Math.sqrt(o*o+r*r);if(!n)return a.s=0,a;let[l,i,s]=wr(t,o/n,r/n),u;if(n<i){let d=0,c=.8*l,p=1-c/i;u=(n-d)/(c+p*(n-d))*.8}else{let d=i,c=.2*i*i*1.25*1.25/l,p=1-c/(s-i);u=.8+.2*((n-d)/(c+p*(n-d)))}return u&&(a.s=u,a.h=xe(Math.atan2(r,o)*180/Math.PI)),a}function br(e){let t=e.h!==void 0?e.h:0,o=e.s!==void 0?e.s:0,r=e.l!==void 0?e.l:0,a={mode:"oklab",l:Et(r)};if(e.alpha!==void 0&&(a.alpha=e.alpha),!o||r===1)return a.a=a.b=0,a;let n=Math.cos(t/180*Math.PI),l=Math.sin(t/180*Math.PI),[i,s,u]=wr(a.l,n,l),d,c,p,g;o<.8?(d=1.25*o,c=0,p=.8*i,g=1-p/s):(d=5*(o-.8),c=s,p=.2*s*s*1.25*1.25/i,g=1-p/(u-s));let f=c+d*p/(1-g*d);return a.a=f*n,a.b=f*l,a}var P3={...dr,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:Ir,rgb:e=>Ir(vt(e))},toMode:{oklab:br,rgb:e=>xt(br(e))}},t0=P3;function yr(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a=Math.sqrt(o*o+r*r),n=a?o/a:1,l=a?r/a:1,[i,s]=Ho(n,l),u=.5,d=1-u/i,c=s/(a+t*s),p=c*t,g=c*a,f=Et(p),M=g*f/p,x=D1({l:f,a:n*M,b:l*M}),w=Math.cbrt(1/Math.max(x.r,x.g,x.b,0));t=t/w,a=a/w*Ro(t)/t,t=Ro(t);let h={mode:"okhsv",s:a?(u+s)*g/(s*u+s*d*g):0,v:t?t/p:0};return h.s&&(h.h=xe(Math.atan2(r,o)*180/Math.PI)),e.alpha!==void 0&&(h.alpha=e.alpha),h}function Mr(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let o=e.h!==void 0?e.h:0,r=e.s!==void 0?e.s:0,a=e.v!==void 0?e.v:0,n=Math.cos(o/180*Math.PI),l=Math.sin(o/180*Math.PI),[i,s]=Ho(n,l),u=.5,d=1-u/i,c=1-r*u/(u+s-s*d*r),p=r*s*u/(u+s-s*d*r),g=Et(c),f=p*g/c,M=D1({l:g,a:n*f,b:l*f}),x=Math.cbrt(1/Math.max(M.r,M.g,M.b,0)),w=Et(a*c),h=p*w/c;return t.l=w*x,t.a=h*n*x,t.b=h*l*x,t}var T3={...cr,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:yr,rgb:e=>yr(vt(e))},toMode:{oklab:Mr,rgb:e=>xt(Mr(e))}},o0=T3;function V3(e,t){if(!t||t[0]!=="oklab")return;let o={mode:"oklab"},[,r,a,n,l]=t;if(!(r.type===E.Hue||a.type===E.Hue||n.type===E.Hue))return r.type!==E.None&&(o.l=Math.min(Math.max(0,r.type===E.Number?r.value:r.value/100),1)),a.type!==E.None&&(o.a=a.type===E.Number?a.value:a.value*.4/100),n.type!==E.None&&(o.b=n.type===E.Number?n.value:n.value*.4/100),l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var r0=V3;var E3={...eo,mode:"oklab",toMode:{lrgb:D1,rgb:xt},fromMode:{lrgb:Lr,rgb:vt},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[r0],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}`:""})`},a0=E3;function D3(e,t){if(!t||t[0]!=="oklch")return;let o={mode:"oklch"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Hue)return;o.l=Math.min(Math.max(0,r.type===E.Number?r.value:r.value/100),1)}if(a.type!==E.None&&(o.c=Math.max(0,a.type===E.Number?a.value:a.value*.4/100)),n.type!==E.None){if(n.type===E.Percentage)return;o.h=n.value}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var n0=D3;var O3={...to,mode:"oklch",toMode:{oklab:e=>f1(e,"oklab"),rgb:e=>xt(f1(e,"oklab"))},fromMode:{rgb:e=>c1(vt(e),"oklch"),oklab:e=>c1(e,"oklch")},parse:[n0],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]}},l0=O3;var _3=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz65",x:.486570948648216*t+.265667693169093*o+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*o+.079286914093745*r,z:0*t+.0451133818589026*o+1.043944368900976*r};return a!==void 0&&(n.alpha=a),n},Cn=_3;var B3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({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 r!==void 0&&(a.alpha=r),a},mn=B3;var A3={...g1,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>mn(n1(e)),xyz65:mn},toMode:{rgb:e=>l1(Cn(e)),xyz65:Cn}},i0=A3;var gn=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},Z3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"prophoto",r:gn(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*o),g:gn(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*o),b:gn(e*0+t*0+1.2119675456389452*o)};return r!==void 0&&(a.alpha=r),a},hn=Z3;var vn=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},F3=e=>{let t=vn(e.r),o=vn(e.g),r=vn(e.b),a={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*o+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*o+899369387256e-16*r,z:0*t+0*o+.8251046025104602*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},xn=F3;var $3={...g1,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:hn,rgb:e=>hn(E1(e))},toMode:{xyz50:xn,rgb:e=>V1(xn(e))}},s0=$3;var u0=1.09929682680944,N3=.018053968510807,Ln=e=>{let t=Math.abs(e);return t>N3?(Math.sign(e)||1)*(u0*Math.pow(t,.45)-(u0-1)):4.5*e},U3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rec2020",r:Ln(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*o),g:Ln(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*o),b:Ln(e*.0176398574453108-t*.0427706132578085+.9421031212354739*o)};return r!==void 0&&(a.alpha=r),a},wn=U3;var d0=1.09929682680944,q3=.018053968510807,In=(e=0)=>{let t=Math.abs(e);return t<q3*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+d0-1)/d0,1/.45)},z3=e=>{let t=In(e.r),o=In(e.g),r=In(e.b),a={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*o+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*o+.059301716469862*r,z:0*t+.0280726930490874*o+1.0609850577107909*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},bn=z3;var j3={...g1,mode:"rec2020",fromMode:{xyz65:wn,rgb:e=>wn(n1(e))},toMode:{xyz65:bn,rgb:e=>l1(bn(e))},parse:["rec2020"],serialize:"rec2020"},c0=j3;var j1=.0037930732552754493,Sr=Math.cbrt(j1);var yn=e=>Math.cbrt(e)-Sr,K3=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n=yn(.3*t+.622*o+.078*r+j1),l=yn(.23*t+.692*o+.078*r+j1),i=yn(.2434226892454782*t+.2047674442449682*o+.5518098665095535*r+j1),s={mode:"xyb",x:(n-l)/2,y:(n+l)/2,b:i-(n+l)/2};return a!==void 0&&(s.alpha=a),s},f0=K3;var Mn=e=>Math.pow(e+Sr,3),G3=({x:e,y:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Mn(e+t)-j1,n=Mn(t-e)-j1,l=Mn(o+t)-j1,i=v1({r:11.031566904639861*a-9.866943908131562*n-.16462299650829934*l,g:-3.2541473810744237*a+4.418770377582723*n-.16462299650829934*l,b:-3.6588512867136815*a+2.7129230459360922*n+1.9459282407775895*l});return r!==void 0&&(i.alpha=r),i},p0=G3;var W3={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:p0},fromMode:{rgb:f0},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:O,y:O,b:O,alpha:{use:O,fixup:fe}}},C0=W3;var X3={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:V1,lab:Jt},fromMode:{rgb:E1,lab:Yt},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:O,y:O,z:O,alpha:{use:O,fixup:fe}}},m0=X3;var Q3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*o-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*o-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*o+.7518742899580008*r};return a!==void 0&&(n.alpha=a),n},g0=Q3;var Y3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*o+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*o+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*o+1.3303659366080753*r};return a!==void 0&&(n.alpha=a),n},h0=Y3;var J3={mode:"xyz65",toMode:{rgb:l1,xyz50:g0},fromMode:{rgb:n1,xyz50:h0},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:O,y:O,z:O,alpha:{use:O,fixup:fe}}},v0=J3;var e7=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*o,i:.59597799*e-.2741761*t-.32180189*o,q:.21147017*e-.52261711*t+.31114694*o};return r!==void 0&&(a.alpha=r),a},x0=e7;var t7=({y:e,i:t,q:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rgb",r:e+.95608445*t+.6208885*o,g:e-.27137664*t-.6486059*o,b:e-1.10561724*t+1.70250126*o};return r!==void 0&&(a.alpha=r),a},L0=t7;var o7={mode:"yiq",toMode:{rgb:L0},fromMode:{rgb:x0},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:O,i:O,q:O,alpha:{use:O,fixup:fe}}},w0=o7;var r7=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,a7=(e=4)=>t=>typeof t=="number"?r7(t,e):t,ko=a7;var bx=ko(2);var yx=r1("rgb"),Mx=r1("hsl");var Rr=e=>{let t=er(e);if(!t)return;let o=tr(t.mode);if(!o.serialize||typeof o.serialize=="string"){let r=`color(${o.serialize||`--${t.mode}`} `;return o.channels.forEach((a,n)=>{a!=="alpha"&&(r+=(n?" ":"")+(t[a]!==void 0?t[a]:"none"))}),t.alpha!==void 0&&t.alpha<1&&(r+=` / ${t.alpha}`),r+")"}if(typeof o.serialize=="function")return o.serialize(t)};var fL=ge(w9),pL=ge(P9),CL=ge(E9),mL=ge(D9),gL=ge(O9),hL=ge(dr),vL=ge(cr),xL=ge(F9),LL=ge(N9),wL=ge(q9),IL=ge(z9),bL=ge(eo),yL=ge(K9),ML=ge(to),SL=ge(W9),RL=ge(Y9),HL=ge(J9),kL=ge(e0),PL=ge(t0),TL=ge(o0),VL=ge(a0),EL=ge(l0),DL=ge(i0),OL=ge(s0),_L=ge(c0),BL=ge(g1),AL=ge(C0),ZL=ge(m0),FL=ge(v0),$L=ge(w0);var n7=r1("rgb"),GL=r1("hsl"),WL=r1("oklch"),XL=r1("oklab"),QL=r1("lch"),YL=r1("lab"),JL=ko(3),Sn=null;function l7(){return Sn??(Sn=document.createElement("canvas").getContext("2d")),Sn}function i7(e){try{let t=l7();if(!t)return null;t.fillStyle="#000000",t.fillStyle=e;let o=t.fillStyle;t.fillStyle="#ffffff",t.fillStyle=e;let r=t.fillStyle;return o===r?o:null}catch{return null}}function Rn(e){let t={r:255,g:255,b:255,a:1};if(!e||typeof e!="string")return t;let o=e.trim(),r=z1(o);if(r){let n=n7(r);if(n)return{r:Math.round(Math.min(255,Math.max(0,(n.r??0)*255))),g:Math.round(Math.min(255,Math.max(0,(n.g??0)*255))),b:Math.round(Math.min(255,Math.max(0,(n.b??0)*255))),a:n.alpha??1}}let a=i7(o);if(a){if(a.startsWith("#")){let l=a.slice(1);return{r:parseInt(l.slice(0,2),16),g:parseInt(l.slice(2,4),16),b:parseInt(l.slice(4,6),16),a:1}}let n=a.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(n&&n[1]!=null&&n[2]!=null&&n[3]!=null)return{r:+n[1],g:+n[2],b:+n[3],a:n[4]!=null?+n[4]:1}}return t}var s7=new Set(["initial","inherit","unset","revert","revert-layer"]);function Hr(e){return s7.has((e??"").trim().toLowerCase())}function I0(e){let t=(e??"").trim();if(t===""||Hr(t))return!1;let o=t.toLowerCase();return o!=="currentcolor"&&!o.includes("var(")}function b0(e){let t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]+$/.test(t)&&[3,4,6,8].includes(t.length)}function y0(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),r=Math.round(Math.min(255,Math.max(0,e.b))),a=Math.min(1,Math.max(0,e.a)),n=`#${[t,o,r].map(l=>l.toString(16).padStart(2,"0")).join("")}`;return a<1?n+Math.round(a*255).toString(16).padStart(2,"0"):n}function Lt(e="#ffffff"){let t=Rn(e);return{declaration:e,native:z1(e)??{mode:"rgb",r:t.r/255,g:t.g/255,b:t.b/255,alpha:t.a},rgba:t,hex:y0({...t,a:1}).slice(1).toUpperCase()}}function Hn(e){return String(Math.round(e*1e4)/100)}function kn(e){let t=e.trim();if(!/^(?:\d+(?:\.\d{1,2})?|\.\d{1,2})$/.test(t))return;let o=Number(t);return Number.isFinite(o)&&o>=0&&o<=100?o:void 0}function M0(e,t,o){return Math.min(100,Math.max(0,Math.round((Number(e)+t*(o?10:1))*100)/100))}function Po({r:e,g:t,b:o,a:r}){let a=[e,t,o].map(Math.round).join(", ");return r===1?`rgb(${a})`:`rgba(${a}, ${r})`}function Pn(e,t){let o=t/100;return o===e.rgba.a?e:Lt(Rr({...e.native,alpha:o}))}function S0(e,t){let o=t.trim().replace(/^#/,""),r=Rn(`#${o}`);return(o.length===3||o.length===6)&&(r.a=e.rgba.a),Lt(Po(r))}function Tn(e){let t=(e??"").trim();return t===""||t.toLowerCase()==="none"||Hr(t)?"":t}function K1(e){return Tn(e)!==""}function kr(e){return(e??"").trim().toLowerCase()==="text"}function O1(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function R0(e,t,o){let r=O1(e),a=O1(t.toLowerCase());if(r.length===0||a.length===0)return"";let n=o.toLowerCase();return r.filter((l,i)=>a[i%a.length]===n&&K1(l)).join(", ")}function H0(e,t){let o=O1(e);if(o.length===0)return"";let r=O1(t.toLowerCase());return o.filter((a,n)=>(r.length===0||!kr(r[n%r.length]))&&K1(a)).join(", ")}function Vn(e,t){let o=O1(t.toLowerCase());if(o.length===0)return!1;let r=O1(e).length||1;return kr(o[(r-1)%o.length])}function k0(e,t,o,r){let a=O1(e);if(a.length===0)return"";let n=O1(t.toLowerCase());return n.length===0?r==="unchanged"?e:a.map(()=>"none").join(", "):a.map((l,i)=>o(n[i%n.length])?"none":l).join(", ")}function P0(e,t){return k0(e,t,kr,"unchanged")}function T0(e,t){return k0(e,t,o=>!kr(o),"clearAll")}function V0(e,t){let o=O1(t.toLowerCase());if(o.length===0)return t;let a=((O1(e).length||1)-1)%o.length;return o.map((n,l)=>l===a?"border-box":n).join(", ")}function En(e,t,o=!1){let r=(e??"").trim();return r===""||Hr(r)||r.toLowerCase()==="currentcolor"?!1:o||t==null?!0:r.toLowerCase()!==t.trim().toLowerCase()}function E0(e,t,o,r,a=K1,n="none"){if(e.trim()==="")return[];let l=(r??"").trim();if(l.toLowerCase()===n.toLowerCase())return[];let i=l||(o??"");return a(i)?[{property:t,oldValue:i,newValue:n}]:[]}import{jsx as Be,jsxs as x1}from"react/jsx-runtime";var Dn=16,oo=4,d7=280,D0=284,c7=200,f7="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%)";function p7(e){let t=q1(e);return t?t.getBoundingClientRect():{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}}function C7(e,t=d7){let o=e.getBoundingClientRect(),r=p7(e),a=r.bottom-o.bottom-oo,n=o.top-r.top-oo,i=a<t&&n>=t?o.top-t-oo:o.bottom+oo;i=Math.max(r.top+oo,Math.min(i,r.bottom-t-oo));let s=o.left;return s+D0>r.right&&(s=r.right-D0-Dn),s<r.left+Dn&&(s=r.left+Dn),{top:i,left:s}}function O0(e,t){let o=e||Po(t);return t.a>=1?{backgroundColor:o}:{backgroundColor:o,backgroundImage:`linear-gradient(0deg, ${o}, ${o}), ${f7}`,backgroundSize:"100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:"0 0, 0 0, 0 4px, 4px -4px, -4px 0"}}var m7={placeholder:"Enter six-digit HEX",ariaValue:"{0} HEX 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",ariaOpacity:"{0} opacity, 0 to 100 percent",invalidHex:"Enter a HEX color with 3, 4, 6, or 8 digits, with or without #.",invalidOpacity:"Enter an opacity from 0 to 100 with up to two decimal places.",invalidChannel:"Enter a whole number from 0 to 255.",gradientValue:"Gradient",imageValue:"Image",ariaRecentColors:"Recently applied colors",ariaApplyRecentColor:"Apply color {0}, opacity {1}%"};function On({value:e,label:t,className:o,validate:r,error:a,onCommit:n,opacity:l=!1,resetVersion:i,readOnly:s=!1,placeholder:u}){let[d,c]=ye.useState(e),[p,g]=ye.useState(!1),f=ye.useRef(!1),M=ye.useId();ye.useEffect(()=>{f.current||c(e)},[e]),ye.useEffect(()=>{f.current=!1,c(e),g(!1)},[i]);let x=()=>{if(!f.current)return;if(d.trim()===""){f.current=!1,c(e),g(!1);return}if(!r(d)){g(!0);return}f.current=!1,c(e),g(!1),(l?Number(d)!==Number(e):d.trim().replace(/^#/,"").toUpperCase()!==e.toUpperCase())&&n(d.trim())};return x1("div",{className:`colorEditor-control ${l?"colorEditor-opacity":""}`,children:[x1("div",{className:"colorEditor-input-suffix",children:[Be("input",{type:"text",inputMode:l?"decimal":void 0,className:o,value:s?e:d,readOnly:s,placeholder:u,"aria-label":t,"aria-invalid":p||void 0,"aria-describedby":p?M:void 0,onChange:w=>{let h=w.target.value;f.current=!0,c(h),g(h.trim()!==""&&!r(h))},onBlur:x,onKeyDown:w=>{if(w.key==="Enter"&&(x(),w.currentTarget.blur()),w.key==="Escape"&&(f.current=!1,c(e),g(!1)),l&&(w.key==="ArrowUp"||w.key==="ArrowDown")){w.preventDefault();let h=kn(d)===void 0?e:d,S=String(M0(h,w.key==="ArrowUp"?1:-1,w.shiftKey));f.current=!1,c(S),g(!1),S!==e&&n(S)}},spellCheck:!1,autoComplete:"off"}),l&&Be("span",{className:"colorEditor-percent","aria-hidden":"true",children:"%"})]}),p&&Be("span",{id:M,className:"colorEditor-error",role:"alert",children:a})]})}function _n({label:e,value:t,onChange:o,id:r="color",aria:a,backgroundImage:n,resetVersion:l,recentColors:i=[],onColorApplied:s}){let u=M1(m7,a),d=`${r}-trigger`,c=`${r}-popover`,[p,g]=ye.useState(()=>Lt(t)),f=ye.useRef(p);f.current=p;let[{colorInput:M,colorState:x},w]=i9(()=>({type:"rgba",...p.rgba})),h=ye.useRef(o);h.current=o;let S=ye.useRef(s);S.current=s;let H=ye.useRef(void 0),k=ye.useRef(null),Z=ye.useCallback(()=>{let v=H.current;H.current=void 0,v!==void 0&&S.current?.(v)},[]),V=ye.useCallback(v=>{h.current(v),H.current=v},[]),L=s9(V,c7),y=Yo({computePosition:C7,onClose:()=>{L.flush(),Z()},trapFocus:!0}),R=ye.useRef(t);ye.useEffect(()=>{if(R.current===t||(R.current=t,t===f.current.declaration))return;H.current=void 0,L.cancel();let v=Lt(t);f.current=v,g(v),w({type:"rgba",...v.rgba})},[t,w,L]),ye.useEffect(()=>()=>{L.cancel(),Z()},[L,Z]),ye.useEffect(()=>{if(!y.isOpen)return;let v=()=>{L.flush()};return document.addEventListener("mouseup",v),document.addEventListener("touchend",v),()=>{document.removeEventListener("mouseup",v),document.removeEventListener("touchend",v)}},[y.isOpen,L]);let _=(v,b=!1,G=!1)=>{!G&&v.declaration===f.current.declaration||(L.cancel(),f.current=v,g(v),w({type:"rgba",...v.rgba}),b?L(v.declaration):V(v.declaration))},N=ye.useRef(_);N.current=_;let K=ye.useCallback(v=>{let b=v.getRgba(),G=f.current;z.current?N.current(Pn(G,b.a*100),!0):N.current(Lt(Po({...b,a:G.rgba.a})),!0)},[]),z=ye.useRef(!1),W=v=>{let b=v.target;z.current=!!b.closest(".colorEditor-picker-alpha"),b.closest('[role="slider"]')?.focus({preventScroll:!0})},F=(v,b=!1)=>{let G=v.relatedTarget;G instanceof Node&&(k.current?.contains(G)||y.popoverRef.current?.contains(G))||y.isOpen&&(b||G===null)||(L.flush(),Z())},D=v=>{let b=v.target.closest('[role="slider"]');b instanceof HTMLElement&&b.focus(),L.flush()};ye.useLayoutEffect(()=>{if(!y.isOpen||!y.popoverRef.current)return;let v=y.popoverRef.current.offsetHeight;v<=0||y.reposition(v)},[y.isOpen,y.reposition,i.length]);let B=x?.hsva??{h:0,s:0,v:100,a:1},U=Math.round(B.s),A=Math.round(B.v);ye.useEffect(()=>{let v=y.popoverRef.current;if(!y.isOpen||!v)return;let b=(oe,ce,he)=>{oe&&oe.getAttribute(ce)!==he&&oe.setAttribute(ce,he)},G=()=>{let oe=v.querySelector(".colorEditor-picker-saturation [role=slider]");b(oe,"aria-label",e),b(oe,"aria-valuetext",Re(u.ariaSaturation,[U,A])),b(oe,"aria-valuenow",String(U)),b(oe,"aria-valuemin","0"),b(oe,"aria-valuemax","100"),b(v.querySelector(".colorEditor-picker-hue [role=slider]"),"aria-label",u.ariaHue),b(v.querySelector(".colorEditor-picker-alpha [role=slider]"),"aria-label",u.ariaAlphaSlider)};G();let J=new MutationObserver(G);return J.observe(v,{subtree:!0,attributes:!0,attributeFilter:["aria-valuetext"]}),()=>J.disconnect()});let q=p.rgba,T=Tn(n),j=T!==""&&q.a===0,m=j?/url\(/i.test(T)?u.imageValue:u.gradientValue:p.hex,I=j?{backgroundImage:T,backgroundSize:"cover",backgroundPosition:"center"}:O0(p.declaration,q),P=v=>Be(On,{value:v?m:p.hex,label:v?Re(u.ariaValue,[e]):u.ariaHex,className:v?"colorEditor-value-input":"colorEditor-input-hex",placeholder:v?u.placeholder:void 0,validate:b=>b0(b.trim()),error:u.invalidHex,onCommit:b=>_(S0(f.current,b)),resetVersion:l,readOnly:v&&j}),C=v=>Be(On,{value:Hn(q.a),label:v?Re(u.ariaOpacity,[e]):u.ariaAlphaInput,className:v?"colorEditor-value-input":"colorEditor-input-rgba",validate:b=>kn(b)!==void 0,error:u.invalidOpacity,onCommit:b=>_(Pn(f.current,Number(b))),resetVersion:l,opacity:!0}),$=ye.useMemo(()=>{let v=y.triggerRef.current;if(!v)return document.body;let b=v.getRootNode();return b instanceof ShadowRoot?b:document.body},[y.isOpen,y.triggerRef]);return x1(m1,{label:e,id:r,className:"colorEditor-fieldset",children:[x1("div",{ref:k,className:"colorEditor-wrapper",onBlur:v=>F(v,!0),children:[Be("button",{ref:y.triggerRef,id:d,type:"button",className:"colorEditor-swatch-only",onClick:y.toggle,"aria-expanded":y.isOpen,"aria-haspopup":"dialog","aria-controls":c,"aria-label":Re(u.ariaOpenPicker,[e,m]),children:Be("span",{style:I,"aria-hidden":"true",className:"colorEditor-swatch"})}),P(!0),!j&&C(!0)]}),y.isOpen&&u7(x1("div",{ref:y.popoverRef,id:c,role:"dialog","aria-modal":"true","aria-label":Re(u.ariaPicker,[e]),style:{top:y.position.top,left:y.position.left},onDragStart:v=>v.preventDefault(),onMouseUp:D,onMouseDownCapture:W,onTouchStartCapture:W,onPointerDownCapture:W,onKeyDownCapture:v=>{z.current=!!v.target.closest(".colorEditor-picker-alpha")},className:"colorEditor-popover",onBlur:F,children:[x1(qt,{color:M,onChange:K,className:"colorEditor-picker",children:[Be(qt.Saturation,{className:"colorEditor-picker-saturation"}),x1("div",{className:"colorEditor-picker-toolbar",children:[Be(qt.EyeDropper,{title:u.ariaEyedropper,children:Be(Co,{size:18,"aria-hidden":"true"})}),x1("div",{className:"colorEditor-picker-sliders",children:[Be(qt.Hue,{className:"colorEditor-picker-hue"}),Be(qt.Alpha,{className:"colorEditor-picker-alpha"})]})]})]}),x1("div",{className:"colorEditor-input-wrapper",children:[x1("div",{className:"colorEditor-input-group",children:[P(!1),Be("span",{className:"colorEditor-input-label",children:"HEX"})]}),["r","g","b"].map(v=>x1("div",{className:"colorEditor-input-group",children:[Be(On,{value:String(q[v]),className:"colorEditor-input-rgba",label:Re(u.ariaChannel,[v.toUpperCase(),"RGB",0,255]),validate:b=>/^\d+$/.test(b.trim())&&Number(b)<=255,error:u.invalidChannel,resetVersion:l,onCommit:b=>_(Lt(Po({...f.current.rgba,[v]:Number(b)})))}),Be("span",{className:"colorEditor-input-label",children:v.toUpperCase()})]},v)),x1("div",{className:"colorEditor-input-group",children:[C(!1),Be("span",{className:"colorEditor-input-label",children:"A"})]})]}),i.length>0&&Be("div",{className:"colorEditor-recent-colors",role:"group","aria-label":u.ariaRecentColors,children:i.slice(0,20).map(v=>{let b=Lt(v),G=Re(u.ariaApplyRecentColor,[`#${b.hex}`,Hn(b.rgba.a)]);return Be("button",{type:"button",className:"colorEditor-recent-color","aria-label":G,title:`#${b.hex}`,onClick:()=>_(b,!1,!0),children:Be("span",{className:"colorEditor-swatch",style:O0(v,b.rgba),"aria-hidden":"true"})},v)})})]}),$)]})}import Ye from"react";import{jsx as G1,jsxs as Bn}from"react/jsx-runtime";var g7={ariaValue:"{0} value",ariaActions:"{0} options",useNormalLineHeight:"Normal",useNormalSpacing:"Normal",useInherit:"Inherited",invalidRange:"Set a value between {0} and {1}."};function _0(e){let t=q1(e)?.getBoundingClientRect();return{top:Math.max(0,t?.top??0),left:Math.max(0,t?.left??0),bottom:Math.min(window.innerHeight,t?.bottom??window.innerHeight),right:Math.min(window.innerWidth,t?.right??window.innerWidth)}}function Pr({label:e,value:t,onChange:o,id:r="dimension",aria:a,unit:n,icon:l,constraints:i,presets:s,normalLabelKey:u,displayValue:d,measurement:c,resetVersion:p}){let g=M1(g7,a),f=u!==void 0,M=fo(n,i),[x,w]=Ye.useState({}),h=Yo({restoreFocusOnOutside:!1,computePosition:(C,$=200,v=76)=>{let b=C.getBoundingClientRect(),G=_0(C);v=Math.min(v,Math.max(0,G.bottom-G.top-8)),$=Math.min($,Math.max(0,G.right-G.left-8));let J=b.bottom+v+4>G.bottom?b.top-v-4:b.bottom+4;return{top:Math.max(G.top+4,Math.min(J,G.bottom-v-4)),left:Math.max(G.left+4,Math.min(b.right-$,G.right-$-4))}}});Ye.useLayoutEffect(()=>{if(!h.isOpen||!h.popoverRef.current||!h.triggerRef.current)return;let C=_0(h.triggerRef.current);w({maxHeight:Math.max(0,C.bottom-C.top-8),maxWidth:Math.max(0,C.right-C.left-8)})},[h.isOpen]),Ye.useLayoutEffect(()=>{if(!h.isOpen||!h.popoverRef.current)return;let{width:C,height:$}=h.popoverRef.current.getBoundingClientRect();h.reposition(C,$)},[h.isOpen,h.reposition,x]);let[S,H]=Ye.useState(d),k=Ye.useRef(o);k.current=o;let Z=Ye.useRef(t),V=Ye.useRef(!1),L=Ye.useRef(d),y=Ye.useRef(d),R=Ye.useRef(c),_=Ye.useRef(!1),N=Ye.useRef(p),[K,z]=Ye.useState(!1),W=Ye.useRef(void 0),F=()=>{clearTimeout(W.current),W.current=void 0};Ye.useEffect(()=>()=>clearTimeout(W.current),[]),Ye.useEffect(()=>{let C=p!==N.current;N.current=p;let $=t!==Z.current,v=d!==y.current&&L.current===y.current||c!==R.current;y.current=d,R.current=c,Z.current=t,C||($||v)&&!V.current?(F(),H(d),L.current=d,V.current=!1,_.current=!1,z(!1)):v&&(_.current=!0)},[t,d,c,p]);let D=C=>a1(C)&&a1(L.current)&&Number(C)===Number(L.current),B=C=>{let $=C.trim().toLowerCase();return!a1($)||D($)?!0:Number($)>=M.min&&Number($)<=M.max},U=C=>{F(),z(!1),W.current=setTimeout(()=>{W.current=void 0,z(!B(C))},300)},A=(C,$=!1)=>{F();let v=_.current,b=C.trim().toLowerCase(),G=b==="inherit"||f&&b==="normal";if(!G&&!a1(b)){z(!1),(v||Z.current?.trim().toLowerCase()==="inherit")&&(L.current=d),_.current=!1,H(L.current),V.current=!1;return}if(!B(C)){z(!0);return}if(z(!1),_.current=!1,!$&&(b===L.current||D(b))){v&&(L.current=d),H(L.current),V.current=!1;return}let J=b==="inherit"?d:G?b:String(xa(Number(b),n,i)),oe=J===L.current;if(V.current=!1,H(J),oe&&!$&&b!=="inherit")return;L.current=J;let ce=G?b:`${J}${n}`;ce!==Z.current&&(Z.current=ce,k.current(ce))},q=C=>{if(C.key==="Enter"){V.current&&A(S),C.currentTarget.blur();return}if(C.key==="ArrowUp"||C.key==="ArrowDown"){C.preventDefault();let $=S.trim().toLowerCase();if(!V.current&&t?.trim().toLowerCase()==="inherit"||$==="inherit"||f&&$==="normal")return;if(V.current&&!B(S)){F(),z(!0);return}if(!a1(S.trim()))return;A(I2(S,C.key,C.shiftKey,n,i))}},T=`${r}-input`,j=C=>{let $=t?.trim().toLowerCase()??"";if(!a1(C))return $===C;let v=$.match(y2);if(!v)return!1;let b=Number(v[1]);return Number.isFinite(b)&&b===Number(C)&&(v[2]===n||b===0)},m=[...u?[{label:g[u],value:"normal"}]:[],{label:g.useInherit,value:"inherit"}],I=s.map(C=>({label:String(C),value:String(C)})),P=C=>G1("button",{type:"button",role:"menuitemcheckbox","aria-checked":j(C.value),tabIndex:-1,onClick:()=>{A(C.value,!0),h.close()},children:C.label},C.value);return G1(m1,{label:e,id:r,className:"dimensionEditor-fieldset",children:Bn("div",{onBlur:C=>{C.relatedTarget instanceof Node&&C.currentTarget.contains(C.relatedTarget)||h.isOpen&&h.close(!1)},children:[Bn("div",{className:`dimensionEditor-row${K?" dimensionEditor-row--invalid":""}`,children:[G1("span",{className:"dimensionEditor-icon","aria-hidden":"true",children:G1(l,{size:14,width:14,height:14})}),G1("input",{id:T,type:"text",className:"dimensionEditor-input dimensionEditor-input--with-icon",value:S,onChange:C=>{H(C.target.value),V.current=!0,U(C.target.value)},onPaste:C=>{C.preventDefault();let $=C.currentTarget,v=S.slice(0,$.selectionStart??0)+C.clipboardData.getData("text")+S.slice($.selectionEnd??S.length);H(v),V.current=!0,U(v)},onBlur:()=>{V.current&&A(S)},onKeyDown:q,"aria-label":Re(g.ariaValue,[e]),"aria-invalid":K||void 0,"aria-describedby":K?`${r}-error`:void 0,autoComplete:"off",spellCheck:"false"}),G1("button",{type:"button",className:"dimensionEditor-actions",ref:h.triggerRef,"aria-label":Re(g.ariaActions,[e]),"aria-haspopup":"menu","aria-expanded":h.isOpen,"aria-controls":h.isOpen?`${r}-actions`:void 0,onClick:h.toggle,onKeyDown:C=>{(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),h.open())},children:G1(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),h.isOpen&&Bn("div",{id:`${r}-actions`,role:"menu","aria-label":Re(g.ariaActions,[e]),className:"dimensionEditor-menu",ref:h.popoverRef,style:{...x,top:h.position.top,left:h.position.left},onKeyDown:C=>{if(C.key==="Tab"){h.close();return}let $=Array.from(C.currentTarget.querySelectorAll("button")),v=$.indexOf(C.target),b;if(C.key==="Home")b=0;else if(C.key==="End")b=$.length-1;else if(C.key==="ArrowDown")b=(v+1)%$.length;else if(C.key==="ArrowUp")b=(v+$.length-1)%$.length;else return;C.preventDefault(),$[b]?.focus()},children:[m.map(P),G1("div",{role:"separator"}),I.map(P)]}),K&&G1("span",{id:`${r}-error`,role:"alert",className:"dimensionEditor-error",children:Re(g.invalidRange,[String(M.min),String(M.max)])})]})})}function i1(e,t){if(e==null)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;o[r]=e[r]}return o}function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},ne.apply(null,arguments)}var ee=s2(q0(),1),I7=s2(G0(),1);import*as me from"react";import{cloneElement as Gw,Component as Ww,useRef as w1,useCallback as pe,useEffect as _1,useMemo as ro}from"react";var W0=e=>typeof e=="object"&&e!=null&&e.nodeType===1,X0=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",$r=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let o=getComputedStyle(e,null);return X0(o.overflowY,t)||X0(o.overflowX,t)||(r=>{let a=(n=>{if(!n.ownerDocument||!n.ownerDocument.defaultView)return null;try{return n.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!a&&(a.clientHeight<r.scrollHeight||a.clientWidth<r.scrollWidth)})(e)}return!1},Nr=(e,t,o,r,a,n,l,i)=>n<e&&l>t||n>e&&l<t?0:n<=e&&i<=o||l>=t&&i>=o?n-e-r:l>t&&i<o||n<e&&i>o?l-t+a:0,w7=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)},Q0=(e,t)=>{var o,r,a,n;if(typeof document>"u")return[];let{scrollMode:l,block:i,inline:s,boundary:u,skipOverflowHiddenElements:d}=t,c=typeof u=="function"?u:F=>F!==u;if(!W0(e))throw new TypeError("Invalid target");let p=document.scrollingElement||document.documentElement,g=[],f=e;for(;W0(f)&&c(f);){if(f=w7(f),f===p){g.push(f);break}f!=null&&f===document.body&&$r(f)&&!$r(document.documentElement)||f!=null&&$r(f,d)&&g.push(f)}let M=(r=(o=window.visualViewport)==null?void 0:o.width)!=null?r:innerWidth,x=(n=(a=window.visualViewport)==null?void 0:a.height)!=null?n:innerHeight,{scrollX:w,scrollY:h}=window,{height:S,width:H,top:k,right:Z,bottom:V,left:L}=e.getBoundingClientRect(),{top:y,right:R,bottom:_,left:N}=(F=>{let D=window.getComputedStyle(F);return{top:parseFloat(D.scrollMarginTop)||0,right:parseFloat(D.scrollMarginRight)||0,bottom:parseFloat(D.scrollMarginBottom)||0,left:parseFloat(D.scrollMarginLeft)||0}})(e),K=i==="start"||i==="nearest"?k-y:i==="end"?V+_:k+S/2-y+_,z=s==="center"?L+H/2-N+R:s==="end"?Z+R:L-N,W=[];for(let F=0;F<g.length;F++){let D=g[F],{height:B,width:U,top:A,right:q,bottom:T,left:j}=D.getBoundingClientRect();if(l==="if-needed"&&k>=0&&L>=0&&V<=x&&Z<=M&&(D===p&&!$r(D)||k>=A&&V<=T&&L>=j&&Z<=q))return W;let m=getComputedStyle(D),I=parseInt(m.borderLeftWidth,10),P=parseInt(m.borderTopWidth,10),C=parseInt(m.borderRightWidth,10),$=parseInt(m.borderBottomWidth,10),v=0,b=0,G="offsetWidth"in D?D.offsetWidth-D.clientWidth-I-C:0,J="offsetHeight"in D?D.offsetHeight-D.clientHeight-P-$:0,oe="offsetWidth"in D?D.offsetWidth===0?0:U/D.offsetWidth:0,ce="offsetHeight"in D?D.offsetHeight===0?0:B/D.offsetHeight:0;if(p===D)v=i==="start"?K:i==="end"?K-x:i==="nearest"?Nr(h,h+x,x,P,$,h+K,h+K+S,S):K-x/2,b=s==="start"?z:s==="center"?z-M/2:s==="end"?z-M:Nr(w,w+M,M,I,C,w+z,w+z+H,H),v=Math.max(0,v+h),b=Math.max(0,b+w);else{v=i==="start"?K-A-P:i==="end"?K-T+$+J:i==="nearest"?Nr(A,T,B,P,$+J,K,K+S,S):K-(A+B/2)+J/2,b=s==="start"?z-j-I:s==="center"?z-(j+U/2)+G/2:s==="end"?z-q+C+G:Nr(j,q,U,I,C+G,z,z+H,H);let{scrollLeft:he,scrollTop:Me}=D;v=ce===0?0:Math.max(0,Math.min(Me+v/ce,D.scrollHeight-B/ce+J)),b=oe===0?0:Math.max(0,Math.min(he+b/oe,D.scrollWidth-U/oe+G)),K+=Me-v,z+=he-b}W.push({el:D,top:v,left:b})}return W};var b7=0;function ai(){return String(b7++)}function Eo(e){var t=me.useRef(e);return t.current=e,t}function y7(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function Fn(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function ni(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}var M7=ni(function(e){li(e).textContent=""},500);function li(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 S7(e,t){if(!(!e||!t)){var o=li(t);o.textContent=e,M7(t)}}function R7(e){var t=e?.getElementById("a11y-status-message");t&&t.remove()}function Do(){}var Nn=Do;function qr(e,t){if(!t)return e;var o=Object.keys(e);return o.reduce(function(r,a){return t[a]!==void 0&&(r[a]=t[a]),r},ne({},e))}function H7(e,t){if(e){var o=Q0(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});o.forEach(function(r){var a=r.el,n=r.top,l=r.left;a.scrollTop=n,a.scrollLeft=l})}}function Y0(e,t,o){var r=e===t||t instanceof o.Node&&e.contains&&e.contains(t);return r}function k7(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}function Pe(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function W1(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function P7(e,t){return e[t]!==void 0}function zr(e){var t=e.key,o=e.keyCode;return o>=37&&o<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function wt(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(n===0)return-1;var l=n-1;(typeof e!="number"||e<0||e>l)&&(e=t>0?-1:l+1);var i=e+t;i<0?i=a?l:0:i>l&&(i=a?0:l);var s=ao(i,t<0,o,r,a);return s===-1?e>=n?-1:e:s}function ao(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(t){for(var l=e;l>=0;l--)if(!r(o[l],l))return l}else for(var i=e;i<n;i++)if(!r(o[i],i))return i;return a?ao(t?n-1:0,t,o,r):-1}function J0(e,t,o,r){return r===void 0&&(r=!0),o&&t.some(function(a){return a&&(Y0(a,e,o)||r&&Y0(a,o.document.activeElement,o))})}function Un(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function T7(e,t,o,r){for(var a=e.type,n={},l=Object.keys(o),i=0,s=l;i<s.length;i++){var u=s[i];V7(u,e,t,o,r),r[u]!==o[u]&&(n[u]=r[u])}t.onStateChange&&Object.keys(n).length&&t.onStateChange(ne({type:a},n))}function V7(e,t,o,r,a){if(a[e]!==r[e]){var n="on"+Un(e)+"Change",l=o[n];if(typeof l=="function"){var i=t.type;l(ne({type:i},a))}}}function ii(e,t,o,r){var a=me.useRef(null),n=me.useRef(void 0),l=Eo(t),i=me.useCallback(function(p,g){n.current=g,p=qr(p,l.current);var f=e(p,l.current,g),M=l.current.stateReducer(p,ne({},g,{changes:f}));return ne({},p,M)},[l,e]),s=me.useReducer(i,t,o),u=s[0],d=s[1],c=n.current;return me.useEffect(function(){var p,g=qr((p=a.current)!=null?p:{},l.current),f=c&&a.current&&!r(g,u);f&&T7(c,l.current,g,u),a.current=u},[u,c,r,l]),[u,d]}function qn(e,t,o,r){var a=ii(e,t,o,r),n=a[0],l=a[1];return[qr(n,t),l]}function zn(e,t,o,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){var a=o.indexOf(e);if(a<0)throw new Error(r);return[e,o.indexOf(e)]}if(t!==void 0){var n=o[t];if(n===void 0)throw new Error(r);return[n,t]}throw new Error(r)}function Qr(){var e=me.useRef(!0);return me.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function E7(e,t){return t.changes}var D7={environment:ee.default.shape({addEventListener:ee.default.func.isRequired,removeEventListener:ee.default.func.isRequired,document:ee.default.shape({createElement:ee.default.func.isRequired,getElementById:ee.default.func.isRequired,activeElement:ee.default.any.isRequired,body:ee.default.any.isRequired}).isRequired,Node:ee.default.func.isRequired}),itemToKey:ee.default.func,stateReducer:ee.default.func};function B1(e,t,o){var r=e["default"+Un(t)];return r!==void 0?r:o[t]}function Dt(e,t,o){var r=e[t];if(r!==void 0)return r;var a=e["initial"+Un(t)];return a!==void 0?a:B1(e,t,o)}var ei=ni(function(e,t){S7(e,t)},200);function jn(e,t,o,r){var a=r?.document,n=Qr();me.useEffect(function(){if(!(!e||n||!a)){var l=e(t);ei(l,a)}},o),me.useEffect(function(){return function(){ei.cancel(),R7(a)}},[a])}var To=ne({},D7,{getA11yStatusMessage:ee.default.func,highlightedIndex:ee.default.number,defaultHighlightedIndex:ee.default.number,initialHighlightedIndex:ee.default.number,isOpen:ee.default.bool,defaultIsOpen:ee.default.bool,initialIsOpen:ee.default.bool,selectedItem:ee.default.any,initialSelectedItem:ee.default.any,defaultSelectedItem:ee.default.any,id:ee.default.string,labelId:ee.default.string,menuId:ee.default.string,getItemId:ee.default.func,toggleButtonId:ee.default.string,onSelectedItemChange:ee.default.func,onHighlightedIndexChange:ee.default.func,onStateChange:ee.default.func,onIsOpenChange:ee.default.func,scrollIntoView:ee.default.func}),Vo={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:E7,scrollIntoView:H7,environment:typeof window>"u"?void 0:window},s1={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},O7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?me.useLayoutEffect:me.useEffect;function _7(e){return/^\S{1}$/.test(e)}function si(e){var t=Dt(e,"selectedItem",s1),o=Dt(e,"isOpen",s1),r=B7(e),a=Dt(e,"inputValue",s1);return{highlightedIndex:r<0&&t&&o?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:o,selectedItem:t,inputValue:a}}function Ot(e,t,o){var r=e.items,a=e.initialHighlightedIndex,n=e.defaultHighlightedIndex,l=e.isItemDisabled,i=e.itemToKey,s=t.selectedItem,u=t.highlightedIndex;return r.length===0?-1:a!==void 0&&u===a&&!l(r[a],a)?a:n!==void 0&&!l(r[n],n)?n:s?r.findIndex(function(d){return i(s)===i(d)}):o<0&&!l(r[r.length-1],r.length-1)?r.length-1:o>0&&!l(r[0],0)?0:-1}function ui(e,t,o){var r=me.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),a=me.useCallback(function(){return o.map(function(n){return n.current})},[o]);return me.useEffect(function(){if(!e)return Do;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function l(d){r.current.isMouseDown=!1,J0(d.target,a(),e)||t()}function i(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function u(d){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!J0(d.target,a(),e,!1)&&t()}return e.addEventListener("mousedown",n),e.addEventListener("mouseup",l),e.addEventListener("touchstart",i),e.addEventListener("touchmove",s),e.addEventListener("touchend",u),function(){e.removeEventListener("mousedown",n),e.removeEventListener("mouseup",l),e.removeEventListener("touchstart",i),e.removeEventListener("touchmove",s),e.removeEventListener("touchend",u)}},[e,a,t]),r.current}var Kn=function(){return Do};function di(e){var t=e.highlightedIndex,o=e.isOpen,r=e.itemRefs,a=e.getItemNodeFromIndex,n=e.menuElement,l=e.scrollIntoView,i=me.useRef(!0);return O7(function(){t<0||!o||!Object.keys(r.current).length||(i.current===!1?i.current=!0:l(a(t),n))},[t]),i}var Gn=Do;function jr(e,t,o){var r;o===void 0&&(o=!0);var a=((r=e.items)==null?void 0:r.length)&&t>=0;return ne({isOpen:!1,highlightedIndex:-1},a&&ne({selectedItem:e.items[t],isOpen:B1(e,"isOpen",s1),highlightedIndex:B1(e,"highlightedIndex",s1)},o&&{inputValue:e.itemToString(e.items[t])}))}function ci(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Kr(e){var t=B1(e,"highlightedIndex",s1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function B7(e){var t=Dt(e,"highlightedIndex",s1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function fi(e,t,o,r){var a=o.type,n;switch(a){case r.ItemMouseMove:n={highlightedIndex:o.disabled?-1:o.index};break;case r.MenuMouseLeave:n={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ot(t,e,0)};break;case r.FunctionOpenMenu:n={isOpen:!0,highlightedIndex:Ot(t,e,0)};break;case r.FunctionCloseMenu:n={isOpen:!1};break;case r.FunctionSetHighlightedIndex:n={highlightedIndex:t.isItemDisabled(t.items[o.highlightedIndex],o.highlightedIndex)?-1:o.highlightedIndex};break;case r.FunctionSetInputValue:n={inputValue:o.inputValue};break;case r.FunctionReset:n={highlightedIndex:Kr(t),isOpen:B1(t,"isOpen",s1),selectedItem:B1(t,"selectedItem",s1),inputValue:B1(t,"inputValue",s1)};break;default:throw new Error("Reducer called without proper action type.")}return ne({},e,n)}var A7=ne({},To,{items:ee.default.array.isRequired,isItemDisabled:ee.default.func}),Z7=ne({},Vo,{isItemDisabled:function(){return!1}});function F7(e){for(var t=e.keysSoFar,o=e.highlightedIndex,r=e.items,a=e.itemToString,n=e.isItemDisabled,l=t.toLowerCase(),i=0;i<r.length;i++){var s=(i+o+(t.length<2?1:0))%r.length,u=r[s];if(u!==void 0&&a(u).toLowerCase().startsWith(l)&&!n(u,s))return s}return o}var Ur=0,Wn=1,Xn=2,Gr=3,Qn=4,Yn=5,Jn=6,el=7,tl=8,ol=9,rl=10,Wr=11,pi=12,Ci=13,al=14,mi=15,gi=16,hi=17,vi=18,nl=19,$n=20,xi=21,Li=Object.freeze({__proto__:null,FunctionCloseMenu:hi,FunctionOpenMenu:gi,FunctionReset:xi,FunctionSelectItem:nl,FunctionSetHighlightedIndex:vi,FunctionSetInputValue:$n,FunctionToggleMenu:mi,ItemClick:al,ItemMouseMove:Ci,MenuMouseLeave:pi,ToggleButtonBlur:Wr,ToggleButtonClick:Ur,ToggleButtonKeyDownArrowDown:Wn,ToggleButtonKeyDownArrowUp:Xn,ToggleButtonKeyDownCharacter:Gr,ToggleButtonKeyDownEnd:Jn,ToggleButtonKeyDownEnter:el,ToggleButtonKeyDownEscape:Qn,ToggleButtonKeyDownHome:Yn,ToggleButtonKeyDownPageDown:rl,ToggleButtonKeyDownPageUp:ol,ToggleButtonKeyDownSpaceButton:tl});function $7(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case al:l={isOpen:B1(t,"isOpen",s1),highlightedIndex:Kr(t),selectedItem:t.items[o.index]};break;case Gr:{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=F7({keysSoFar:s,highlightedIndex:u,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled});l={inputValue:s,highlightedIndex:d,isOpen:!0}}break;case Wn:{var c=e.isOpen?wt(e.highlightedIndex,1,t.items,t.isItemDisabled):n&&e.selectedItem==null?-1:Ot(t,e,1);l={highlightedIndex:c,isOpen:!0}}break;case Xn:if(e.isOpen&&n)l=jr(t,e.highlightedIndex,!1);else{var p=e.isOpen?wt(e.highlightedIndex,-1,t.items,t.isItemDisabled):Ot(t,e,-1);l={highlightedIndex:p,isOpen:!0}}break;case el:case tl:l=jr(t,e.highlightedIndex,!1);break;case Yn:l={highlightedIndex:ao(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case Jn:l={highlightedIndex:ao(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case ol:l={highlightedIndex:wt(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case rl:l={highlightedIndex:wt(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case Qn:l={isOpen:!1,highlightedIndex:-1};break;case Wr:l=ne({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&{selectedItem:t.items[e.highlightedIndex]});break;case nl:l={selectedItem:o.selectedItem};break;default:return fi(e,t,o,Li)}return ne({},e,l)}var N7=ne({},me),wi=N7.useId,Ii=typeof wi=="function"?U7:q7;function U7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i="downshift-"+wi();t||(t=i);var s=me.useMemo(function(){return{labelId:o??t+"-label",menuId:r??t+"-menu",getItemId:a??function(u){return t+"-item-"+u},toggleButtonId:n??t+"-toggle-button",inputId:l??t+"-input"}},[a,t,l,o,r,n]);return s}function q7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i=me.useRef(t??"downshift-"+ai()),s=i.current,u=me.useMemo(function(){return{labelId:o??s+"-label",menuId:r??s+"-menu",getItemId:a??function(d){return s+"-item-"+d},toggleButtonId:n??s+"-toggle-button",inputId:l??s+"-input"}},[a,l,o,r,n,s]);return u}var z7=["onClick"],j7=["onMouseLeave","refKey","ref"],K7=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],G7=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];Oo.stateChangeTypes=Li;function Oo(e){e===void 0&&(e={}),Nn(e,Oo,A7);var t=ne({},Z7,e),o=t.scrollIntoView,r=t.environment,a=t.getA11yStatusMessage,n=qn($7,t,si,ci),l=n[0],i=n[1],s=l.isOpen,u=l.highlightedIndex,d=l.selectedItem,c=l.inputValue,p=w1(null),g=w1(null),f=w1({}),M=w1(null),x=Ii(t),w=Eo({state:l,props:t}),h=pe(function(A){return f.current[x.getItemId(A)]},[x]);jn(a,l,[s,u,d,c],r);var S=di({menuElement:g.current,highlightedIndex:u,isOpen:s,itemRefs:f,scrollIntoView:o,getItemNodeFromIndex:h});_1(function(){return M.current=k7(function(A){A({type:$n,inputValue:""})},500),function(){M.current.cancel()}},[]),_1(function(){c&&M.current(i)},[i,c]),Gn({props:t,state:l}),_1(function(){var A=Dt(t,"isOpen",s1);A&&p.current&&p.current.focus()},[]);var H=pe(function(){w.current.state.isOpen&&i({type:Wr})},[i,w]),k=ro(function(){return[g,p]},[]),Z=ui(r,H,k),V=Kn("getMenuProps","getToggleButtonProps");_1(function(){s||(f.current={})},[s]);var L=ro(function(){return{ArrowDown:function(q){q.preventDefault(),i({type:Wn,altKey:q.altKey})},ArrowUp:function(q){q.preventDefault(),i({type:Xn,altKey:q.altKey})},Home:function(q){q.preventDefault(),i({type:Yn})},End:function(q){q.preventDefault(),i({type:Jn})},Escape:function(){w.current.state.isOpen&&i({type:Qn})},Enter:function(q){q.preventDefault(),i({type:w.current.state.isOpen?el:Ur})},PageUp:function(q){w.current.state.isOpen&&(q.preventDefault(),i({type:ol}))},PageDown:function(q){w.current.state.isOpen&&(q.preventDefault(),i({type:rl}))}," ":function(q){q.preventDefault();var T=w.current.state;if(!T.isOpen){i({type:Ur});return}T.inputValue?i({type:Gr,key:" "}):i({type:tl})}}},[i,w]),y=pe(function(){i({type:mi})},[i]),R=pe(function(){i({type:hi})},[i]),_=pe(function(){i({type:gi})},[i]),N=pe(function(A){i({type:vi,highlightedIndex:A})},[i]),K=pe(function(A){i({type:nl,selectedItem:A})},[i]),z=pe(function(){i({type:xi})},[i]),W=pe(function(A){i({type:$n,inputValue:A})},[i]),F=pe(function(A){var q=A===void 0?{}:A,T=q.onClick,j=i1(q,z7),m=function(){var P;(P=p.current)==null||P.focus()};return ne({id:x.labelId,htmlFor:x.toggleButtonId,onClick:Pe(T,m)},j)},[x]),D=pe(function(A,q){var T,j=A===void 0?{}:A,m=j.onMouseLeave,I=j.refKey,P=I===void 0?"ref":I,C=j.ref,$=i1(j,j7),v=q===void 0?{}:q,b=v.suppressRefError,G=b===void 0?!1:b,J=function(){i({type:pi})};return V("getMenuProps",G,P,g),ne((T={},T[P]=W1(C,function(oe){g.current=oe}),T.id=x.menuId,T.role="listbox",T["aria-labelledby"]=$&&$["aria-label"]?void 0:""+x.labelId,T.onMouseLeave=Pe(m,J),T),$)},[i,V,x]),B=pe(function(A,q){var T,j=A===void 0?{}:A,m=j.onBlur,I=j.onClick;j.onPress;var P=j.onKeyDown,C=j.refKey,$=C===void 0?"ref":C,v=j.ref,b=i1(j,K7),G=q===void 0?{}:q,J=G.suppressRefError,oe=J===void 0?!1:J,ce=w.current.state,he=function(){i({type:Ur})},Me=function(){ce.isOpen&&!Z.isMouseDown&&i({type:Wr})},p1=function(De){var Se=zr(De);Se&&L[Se]?L[Se](De):_7(Se)&&i({type:Gr,key:Se})},we=ne((T={},T[$]=W1(v,function(Te){p.current=Te}),T["aria-activedescendant"]=ce.isOpen&&ce.highlightedIndex>-1?x.getItemId(ce.highlightedIndex):"",T["aria-controls"]=x.menuId,T["aria-expanded"]=w.current.state.isOpen,T["aria-haspopup"]="listbox",T["aria-labelledby"]=b&&b["aria-label"]?void 0:""+x.labelId,T.id=x.toggleButtonId,T.role="combobox",T.tabIndex=0,T.onBlur=Pe(m,Me),T),b);return b.disabled||(we.onClick=Pe(I,he),we.onKeyDown=Pe(P,p1)),V("getToggleButtonProps",oe,$,p),we},[i,x,w,Z,V,L]),U=pe(function(A){var q,T=A===void 0?{}:A,j=T.item,m=T.index,I=T.onMouseMove,P=T.onClick,C=T.onMouseDown;T.onPress;var $=T.refKey,v=$===void 0?"ref":$,b=T.disabled,G=T.ref,J=i1(T,G7);b!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var oe=w.current,ce=oe.state,he=oe.props,Me=zn(j,m,he.items,"Pass either item or index to getItemProps!"),p1=Me[0],we=Me[1],Te=he.isItemDisabled(p1,we),De=function(){Z.isTouchEnd||we===ce.highlightedIndex||(S.current=!1,i({type:Ci,index:we,disabled:Te}))},Se=function(){i({type:al,index:we})},b1=function(re){return re.preventDefault()},Ne=ne((q={},q[v]=W1(G,function(Oe){Oe&&(f.current[x.getItemId(we)]=Oe)}),q["aria-disabled"]=Te,q["aria-selected"]=p1===ce.selectedItem,q.id=x.getItemId(we),q.role="option",q),J);return Te||(Ne.onClick=Pe(P,Se)),Ne.onMouseMove=Pe(I,De),Ne.onMouseDown=Pe(C,b1),Ne},[w,x,Z,S,i]);return{getToggleButtonProps:B,getLabelProps:F,getMenuProps:D,getItemProps:U,toggleMenu:y,openMenu:_,closeMenu:R,setHighlightedIndex:N,selectItem:K,reset:z,setInputValue:W,highlightedIndex:u,isOpen:s,selectedItem:d,inputValue:c}}var ll=0,il=1,sl=2,ul=3,dl=4,cl=5,fl=6,pl=7,Cl=8,Xr=9,ml=10,bi=11,yi=12,gl=13,Mi=14,Si=15,Ri=16,Hi=17,ki=18,hl=19,Pi=20,Ti=21,vl=22,Vi=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:vl,FunctionCloseMenu:Hi,FunctionOpenMenu:Ri,FunctionReset:Ti,FunctionSelectItem:hl,FunctionSetHighlightedIndex:ki,FunctionSetInputValue:Pi,FunctionToggleMenu:Si,InputBlur:Xr,InputChange:Cl,InputClick:ml,InputKeyDownArrowDown:ll,InputKeyDownArrowUp:il,InputKeyDownEnd:dl,InputKeyDownEnter:pl,InputKeyDownEscape:sl,InputKeyDownHome:ul,InputKeyDownPageDown:fl,InputKeyDownPageUp:cl,ItemClick:gl,ItemMouseMove:yi,MenuMouseLeave:bi,ToggleButtonClick:Mi});function W7(e){var t=si(e),o=t.selectedItem,r=t.inputValue;return r===""&&o&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(o)),ne({},t,{inputValue:r})}var X7=ne({},To,{items:ee.default.array.isRequired,isItemDisabled:ee.default.func,inputValue:ee.default.string,defaultInputValue:ee.default.string,initialInputValue:ee.default.string,inputId:ee.default.string,onInputValueChange:ee.default.func});function Q7(e,t,o,r){var a=w1(),n=ii(e,t,o,r),l=n[0],i=n[1],s=Qr();return _1(function(){if(P7(t,"selectedItem")){if(!s){var u=t.itemToKey(t.selectedItem)!==t.itemToKey(a.current);u&&i({type:vl,inputValue:t.itemToString(t.selectedItem)})}a.current=l.selectedItem===a.current?t.selectedItem:l.selectedItem}},[l.selectedItem,t.selectedItem]),[qr(l,t),i]}var Y7=ne({},Vo,{isItemDisabled:function(){return!1}});function J7(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case gl:l={isOpen:B1(t,"isOpen",s1),highlightedIndex:Kr(t),selectedItem:t.items[o.index],inputValue:t.itemToString(t.items[o.index])};break;case ll:e.isOpen?l={highlightedIndex:wt(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:n&&e.selectedItem==null?-1:Ot(t,e,1),isOpen:t.items.length>=0};break;case il:e.isOpen?n?l=jr(t,e.highlightedIndex):l={highlightedIndex:wt(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:Ot(t,e,-1),isOpen:t.items.length>=0};break;case pl:l=jr(t,e.highlightedIndex);break;case sl:l=ne({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case cl:l={highlightedIndex:wt(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case fl:l={highlightedIndex:wt(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case ul:l={highlightedIndex:ao(0,!1,t.items,t.isItemDisabled)};break;case dl:l={highlightedIndex:ao(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Xr:l=ne({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&o.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case Cl:l={isOpen:!0,highlightedIndex:Kr(t),inputValue:o.inputValue};break;case ml:l={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ot(t,e,0)};break;case hl:l={selectedItem:o.selectedItem,inputValue:t.itemToString(o.selectedItem)};break;case vl:l={inputValue:o.inputValue};break;default:return fi(e,t,o,Vi)}return ne({},e,l)}var e4=["onMouseLeave","refKey","ref"],t4=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],o4=["onClick","onPress","refKey","ref"],r4=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];Ei.stateChangeTypes=Vi;function Ei(e){e===void 0&&(e={}),Nn(e,Ei,X7);var t=ne({},Y7,e),o=t.items,r=t.scrollIntoView,a=t.environment,n=t.getA11yStatusMessage,l=Q7(J7,t,W7,ci),i=l[0],s=l[1],u=i.isOpen,d=i.highlightedIndex,c=i.selectedItem,p=i.inputValue,g=w1(null),f=w1({}),M=w1(null),x=w1(null),w=Qr(),h=Ii(t),S=w1(),H=Eo({state:i,props:t}),k=pe(function(m){return f.current[h.getItemId(m)]},[h]);jn(n,i,[u,d,c,p],a);var Z=di({menuElement:g.current,highlightedIndex:d,isOpen:u,itemRefs:f,scrollIntoView:r,getItemNodeFromIndex:k});Gn({props:t,state:i}),_1(function(){var m=Dt(t,"isOpen",s1);m&&M.current&&M.current.focus()},[]),_1(function(){w||(S.current=o.length)});var V=pe(function(){H.current.state.isOpen&&s({type:Xr})},[s,H]),L=ro(function(){return[g,x,M]},[]),y=ui(a,V,L),R=Kn("getInputProps","getMenuProps");_1(function(){u||(f.current={})},[u]),_1(function(){var m;!u||!(a!=null&&a.document)||!(M!=null&&(m=M.current)!=null&&m.focus)||a.document.activeElement!==M.current&&M.current.focus()},[u,a]);var _=ro(function(){return{ArrowDown:function(I){I.preventDefault(),s({type:ll,altKey:I.altKey})},ArrowUp:function(I){I.preventDefault(),s({type:il,altKey:I.altKey})},Home:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:ul}))},End:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:dl}))},Escape:function(I){var P=H.current.state;(P.isOpen||P.inputValue||P.selectedItem||P.highlightedIndex>-1)&&(I.preventDefault(),s({type:sl}))},Enter:function(I){var P=H.current.state;!P.isOpen||I.which===229||(I.preventDefault(),s({type:pl}))},PageUp:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:cl}))},PageDown:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:fl}))}}},[s,H]),N=pe(function(m){return ne({id:h.labelId,htmlFor:h.inputId},m)},[h]),K=pe(function(m,I){var P,C=m===void 0?{}:m,$=C.onMouseLeave,v=C.refKey,b=v===void 0?"ref":v,G=C.ref,J=i1(C,e4),oe=I===void 0?{}:I,ce=oe.suppressRefError,he=ce===void 0?!1:ce;return R("getMenuProps",he,b,g),ne((P={},P[b]=W1(G,function(Me){g.current=Me}),P.id=h.menuId,P.role="listbox",P["aria-labelledby"]=J&&J["aria-label"]?void 0:""+h.labelId,P.onMouseLeave=Pe($,function(){s({type:bi})}),P),J)},[s,R,h]),z=pe(function(m){var I,P,C=m===void 0?{}:m,$=C.item,v=C.index,b=C.refKey,G=b===void 0?"ref":b,J=C.ref,oe=C.onMouseMove,ce=C.onMouseDown,he=C.onClick;C.onPress;var Me=C.disabled,p1=i1(C,t4);Me!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var we=H.current,Te=we.props,De=we.state,Se=zn($,v,Te.items,"Pass either item or index to getItemProps!"),b1=Se[0],Ne=Se[1],Oe=Te.isItemDisabled(b1,Ne),re="onClick",Ge=he,He=function(){y.isTouchEnd||Ne===De.highlightedIndex||(Z.current=!1,s({type:yi,index:Ne,disabled:Oe}))},C1=function(){s({type:gl,index:Ne})},y1=function(Y){return Y.preventDefault()};return ne((I={},I[G]=W1(J,function(e1){e1&&(f.current[h.getItemId(Ne)]=e1)}),I["aria-disabled"]=Oe,I["aria-selected"]=Ne===De.highlightedIndex,I.id=h.getItemId(Ne),I.role="option",I),!Oe&&(P={},P[re]=Pe(Ge,C1),P),{onMouseMove:Pe(oe,He),onMouseDown:Pe(ce,y1)},p1)},[s,h,H,y,Z]),W=pe(function(m){var I,P=m===void 0?{}:m,C=P.onClick;P.onPress;var $=P.refKey,v=$===void 0?"ref":$,b=P.ref,G=i1(P,o4),J=H.current.state,oe=function(){s({type:Mi})};return ne((I={},I[v]=W1(b,function(ce){x.current=ce}),I["aria-controls"]=h.menuId,I["aria-expanded"]=J.isOpen,I.id=h.toggleButtonId,I.tabIndex=-1,I),!G.disabled&&ne({},{onClick:Pe(C,oe)}),G)},[s,H,h]),F=pe(function(m,I){var P,C=m===void 0?{}:m,$=C.onKeyDown,v=C.onChange,b=C.onInput,G=C.onBlur;C.onChangeText;var J=C.onClick,oe=C.refKey,ce=oe===void 0?"ref":oe,he=C.ref,Me=i1(C,r4),p1=I===void 0?{}:I,we=p1.suppressRefError,Te=we===void 0?!1:we;R("getInputProps",Te,ce,M);var De=H.current.state,Se=function(y1){var e1=zr(y1);e1&&_[e1]&&_[e1](y1)},b1=function(y1){s({type:Cl,inputValue:y1.target.value})},Ne=function(y1){if(a!=null&&a.document&&De.isOpen&&!y.isMouseDown){var e1=y1.relatedTarget===null&&a.document.activeElement!==a.document.body;s({type:Xr,selectItem:!e1})}},Oe=function(){s({type:ml})},re="onChange",Ge={};if(!Me.disabled){var He;Ge=(He={},He[re]=Pe(v,b,b1),He.onKeyDown=Pe($,Se),He.onBlur=Pe(G,Ne),He.onClick=Pe(J,Oe),He)}return ne((P={},P[ce]=W1(he,function(C1){M.current=C1}),P["aria-activedescendant"]=De.isOpen&&De.highlightedIndex>-1?h.getItemId(De.highlightedIndex):"",P["aria-autocomplete"]="list",P["aria-controls"]=h.menuId,P["aria-expanded"]=De.isOpen,P["aria-labelledby"]=Me&&Me["aria-label"]?void 0:h.labelId,P.autoComplete="off",P.id=h.inputId,P.role="combobox",P.value=De.inputValue,P),Ge,Me)},[s,h,a,_,H,y,R]),D=pe(function(){s({type:Si})},[s]),B=pe(function(){s({type:Hi})},[s]),U=pe(function(){s({type:Ri})},[s]),A=pe(function(m){s({type:ki,highlightedIndex:m})},[s]),q=pe(function(m){s({type:hl,selectedItem:m})},[s]),T=pe(function(m){s({type:Pi,inputValue:m})},[s]),j=pe(function(){s({type:Ti})},[s]);return{getItemProps:z,getLabelProps:N,getMenuProps:K,getInputProps:F,getToggleButtonProps:W,toggleMenu:D,openMenu:U,closeMenu:B,setHighlightedIndex:A,setInputValue:T,selectItem:q,reset:j,highlightedIndex:d,isOpen:u,selectedItem:c,inputValue:p}}var Di={activeIndex:-1,selectedItems:[]};function ti(e,t){return Dt(e,t,Di)}function oi(e,t){return B1(e,t,Di)}function a4(e){var t=ti(e,"activeIndex"),o=ti(e,"selectedItems");return{activeIndex:t,selectedItems:o}}function ri(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 n4(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var Qw={stateReducer:To.stateReducer,itemToKey:To.itemToKey,environment:To.environment,selectedItems:ee.default.array,initialSelectedItems:ee.default.array,defaultSelectedItems:ee.default.array,getA11yStatusMessage:ee.default.func,activeIndex:ee.default.number,initialActiveIndex:ee.default.number,defaultActiveIndex:ee.default.number,onActiveIndexChange:ee.default.func,onSelectedItemsChange:ee.default.func,keyNavigationNext:ee.default.string,keyNavigationPrevious:ee.default.string},l4={itemToKey:Vo.itemToKey,stateReducer:Vo.stateReducer,environment:Vo.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},i4=Do,xl=0,Ll=1,wl=2,Il=3,bl=4,yl=5,Ml=6,Sl=7,Rl=8,Hl=9,kl=10,Pl=11,Tl=12,s4=Object.freeze({__proto__:null,DropdownClick:Sl,DropdownKeyDownBackspace:Ml,DropdownKeyDownNavigationPrevious:yl,FunctionAddSelectedItem:Rl,FunctionRemoveSelectedItem:Hl,FunctionReset:Tl,FunctionSetActiveIndex:Pl,FunctionSetSelectedItems:kl,SelectedItemClick:xl,SelectedItemKeyDownBackspace:wl,SelectedItemKeyDownDelete:Ll,SelectedItemKeyDownNavigationNext:Il,SelectedItemKeyDownNavigationPrevious:bl});function u4(e,t,o){var r=o.type,a=o.index,n=o.selectedItem,l=e.activeIndex,i=e.selectedItems,s;switch(r){case xl:s={activeIndex:a};break;case bl:s={activeIndex:l-1<0?0:l-1};break;case Il:s={activeIndex:l+1>=i.length?-1:l+1};break;case wl:case Ll:{if(l<0)break;var u=l;i.length===1?u=-1:l===i.length-1&&(u=i.length-2),s=ne({selectedItems:[].concat(i.slice(0,l),i.slice(l+1))},{activeIndex:u});break}case yl:s={activeIndex:i.length-1};break;case Ml:s={selectedItems:i.slice(0,i.length-1)};break;case Rl:s={selectedItems:[].concat(i,[n])};break;case Sl:s={activeIndex:-1};break;case Hl:{var d=l,c=i.findIndex(function(f){return t.itemToKey(f)===t.itemToKey(n)});if(c<0)break;i.length===1?d=-1:c===i.length-1&&(d=i.length-2),s={selectedItems:[].concat(i.slice(0,c),i.slice(c+1)),activeIndex:d};break}case kl:{var p=o.selectedItems;s={selectedItems:p};break}case Pl:{var g=o.activeIndex;s={activeIndex:g};break}case Tl:s={activeIndex:oi(t,"activeIndex"),selectedItems:oi(t,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return ne({},e,s)}var d4=["refKey","ref","onClick","onKeyDown","selectedItem","index"],c4=["refKey","ref","onKeyDown","onClick","preventKeyAction"];Oi.stateChangeTypes=s4;function Oi(e){e===void 0&&(e={}),i4(e,Oi);var t=ne({},l4,e),o=t.getA11yStatusMessage,r=t.environment,a=t.keyNavigationNext,n=t.keyNavigationPrevious,l=qn(u4,t,a4,n4),i=l[0],s=l[1],u=i.activeIndex,d=i.selectedItems,c=Qr(),p=w1(null),g=w1();g.current=[];var f=Eo({state:i,props:t});jn(o,i,[u,d],r),_1(function(){c||(u===-1&&p.current?p.current.focus():g.current[u]&&g.current[u].focus())},[u]),Gn({props:t,state:i});var M=Kn("getDropdownProps"),x=ro(function(){var y;return y={},y[n]=function(){s({type:bl})},y[a]=function(){s({type:Il})},y.Delete=function(){s({type:Ll})},y.Backspace=function(){s({type:wl})},y},[s,a,n]),w=ro(function(){var y;return y={},y[n]=function(R){ri(R)&&s({type:yl})},y.Backspace=function(_){ri(_)&&s({type:Ml})},y},[s,n]),h=pe(function(y){var R,_=y===void 0?{}:y,N=_.refKey,K=N===void 0?"ref":N,z=_.ref,W=_.onClick,F=_.onKeyDown,D=_.selectedItem,B=_.index,U=i1(_,d4),A=f.current.state,q=zn(D,B,A.selectedItems,"Pass either item or index to getSelectedItemProps!"),T=q[1],j=T>-1&&T===A.activeIndex,m=function(){s({type:xl,index:T})},I=function(C){var $=zr(C);$&&x[$]&&x[$](C)};return ne((R={},R[K]=W1(z,function(P){P&&g.current.push(P)}),R.tabIndex=j?0:-1,R.onClick=Pe(W,m),R.onKeyDown=Pe(F,I),R),U)},[s,f,x]),S=pe(function(y,R){var _,N=y===void 0?{}:y,K=N.refKey,z=K===void 0?"ref":K,W=N.ref,F=N.onKeyDown,D=N.onClick,B=N.preventKeyAction,U=B===void 0?!1:B,A=i1(N,c4),q=R===void 0?{}:R,T=q.suppressRefError,j=T===void 0?!1:T;M("getDropdownProps",j,z,p);var m=function(C){var $=zr(C);$&&w[$]&&w[$](C)},I=function(){s({type:Sl})};return ne((_={},_[z]=W1(W,function(P){P&&(p.current=P)}),_),!U&&{onKeyDown:Pe(F,m),onClick:Pe(D,I)},A)},[s,w,M]),H=pe(function(y){s({type:Rl,selectedItem:y})},[s]),k=pe(function(y){s({type:Hl,selectedItem:y})},[s]),Z=pe(function(y){s({type:kl,selectedItems:y})},[s]),V=pe(function(y){s({type:Pl,activeIndex:y})},[s]),L=pe(function(){s({type:Tl})},[s]);return{getSelectedItemProps:h,getDropdownProps:S,addSelectedItem:H,removeSelectedItem:k,setSelectedItems:Z,setActiveIndex:V,reset:L,selectedItems:d,activeIndex:u}}var Vl=0,El=1,Dl=2,Ol=3,_l=4,Bl=5,Al=6,f4=Object.freeze({__proto__:null,FunctionAddItem:Al,TagClick:Vl,TagGroupKeyDownArrowLeft:El,TagGroupKeyDownArrowRight:Dl,TagGroupKeyDownBackspace:_l,TagGroupKeyDownDelete:Ol,TagRemoveClick:Bl});function p4(e,t,o){var r=o.type,a;switch(r){case Vl:a={activeIndex:o.index};break;case El:a={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case Dl:a={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case _l:case Ol:{var n=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),l=n.length===0?-1:n.length===e.activeIndex?e.activeIndex-1:e.activeIndex;a={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:l};break}case Bl:{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;a={items:i,activeIndex:s}}break;case Al:{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;a={items:u,activeIndex:d};break}default:throw new Error("Invalid useTagGroup reducer action.")}return ne({},e,a)}var C4=ne({},me),_i=C4.useId,m4=typeof _i=="function"?g4:h4;function g4(e){var t=e.id,o=e.tagGroupId,r=e.getTagId,a="downshift-"+_i();t||(t=a);var n=me.useMemo(function(){return{tagGroupId:o??t+"-tag-group",getTagId:r??function(l){return t+"-tag-"+l}}},[r,t,o]);return n}function h4(e){var t=e.id,o=e.getTagId,r=e.tagGroupId,a=me.useRef(t??"downshift-"+ai()),n=a.current,l=me.useMemo(function(){return{tagGroupId:r??n+"-tag-group",getTagId:o??function(i){return n+"-tag-"+i}}},[o,n,r]);return l}function v4(e){var t,o,r,a,n=(t=(o=e.items)!=null?o:e.initialItems)!=null?t:[],l=(r=(a=e.activeIndex)!=null?a:e.initialActiveIndex)!=null?r:n.length===0?-1:0;return{activeIndex:l,items:n}}function x4(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var Bi="tag-group-a11y-description";function L4(e,t){me.useEffect(function(){if(e){var o=e.createElement("div");return o.setAttribute("id",Bi),o.style.display="none",o.textContent=t,e.body.appendChild(o),function(){o.remove()}}},[t,e])}function w4(e){return ne({stateReducer:function(o,r){var a=r.changes;return a},environment:typeof window>"u"?void 0:window,removeElementDescription:"Press Delete or Backspace to remove tag."},e)}function I4(e,t,o){var r=me.useRef({}),a=me.useRef(e),n=me.useRef(t);return me.useEffect(function(){if(e!==-1&&a.current!==-1&&e!==a.current||n.current===t+1){var l;(l=r.current[o(e)])==null||l.focus()}a.current=e,n.current=t},[e,o,t]),r}var b4={isItemDisabled:ee.default.func},y4=["onKeyDown"],M4=["index","refKey","ref","onClick"],S4=["index","onClick"],Ai=function(t){var o;t===void 0&&(t={}),Nn(t,Ai,b4);var r=w4(t),a=qn(p4,r,v4,x4),n=a[0],l=a[1],i=n.activeIndex,s=n.items,u=Eo({state:n,props:r}),d=m4({getTagId:r.getTagId,id:r.id,tagGroupId:r.tagGroupId});L4((o=r.environment)==null?void 0:o.document,r.removeElementDescription);var c=I4(i,s.length,d.getTagId),p=pe(function(x){var w=x??{},h=w.onKeyDown,S=i1(w,y4),H=function(V){switch(V.key){case"ArrowLeft":l({type:El});break;case"ArrowRight":l({type:Dl});break;case"Delete":l({type:Ol});break;case"Backspace":l({type:_l});break}},k=ne({id:d.tagGroupId,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions",role:"listbox",onKeyDown:Fn(h,H)},S);return k},[l,d.tagGroupId]),g=pe(function(x){var w,h=x.index,S=x.refKey,H=S===void 0?"ref":S,k=x.ref,Z=x.onClick,V=i1(x,M4);if(!Number.isInteger(h)||h<0)throw new Error("Pass correct item index to getTagProps!");var L=u.current.state,y=function(){l({type:Vl,index:h})},R=d.getTagId(h);return ne((w={"aria-describedby":Bi},w[H]=y7(k,function(_){_&&(c.current[R]=_)}),w["aria-labelledby"]=R,w.role="option",w.id=R,w.onClick=Fn(Z,y),w.tabIndex=L.activeIndex===h?0:-1,w),V)},[l,d,u,c]),f=pe(function(x){var w=x.index,h=x.onClick,S=i1(x,S4);if(!Number.isInteger(w)||w<0)throw new Error("Pass correct item index to getTagRemoveProps!");var H=function(L){L.stopPropagation(),l({type:Bl,index:w})},k=d.getTagId(w),Z=k+"-remove";return ne({id:Z,tabIndex:-1,"aria-labelledby":Z+" "+k,onClick:Fn(h,H)},S)},[d,l]),M=pe(function(x,w){l({type:Al,item:x,index:w})},[l]);return{activeIndex:i,addItem:M,getTagGroupProps:p,getTagProps:g,getTagRemoveProps:f,items:s}};Ai.stateChangeTypes=f4;import X1 from"react";import{createPortal as R4}from"react-dom";import{jsx as _t,jsxs as Zl}from"react/jsx-runtime";var H4=260,Yr=4;function k4(e){let t=e.getBoundingClientRect(),o=q1(e),r=o?o.getBoundingClientRect():{top:0,bottom:window.innerHeight},a=r.bottom-t.bottom-Yr,n=t.top-r.top-Yr,l=a<H4&&n>a;return{top:l?t.top-Yr:t.bottom+Yr,left:t.left,width:t.width,openAbove:l}}function Jr({label:e,options:t,dividerAfterValue:o,selectedItem:r,onChange:a,id:n="picklist",getOptionStyle:l,triggerLabel:i,triggerStyle:s}){let[u,d]=X1.useState({top:0,left:0,width:0,openAbove:!1}),c=X1.useRef(null),p=X1.useMemo(()=>{let R=new Map;return{document,Node:window.Node,addEventListener(_,N,K){let z=W=>{let F={target:W.composedPath()[0]??W.target};typeof N=="function"?N(F):N.handleEvent(F)};R.set(N,z),window.addEventListener(_,z,K)},removeEventListener(_,N,K){let z=R.get(N);z&&window.removeEventListener(_,z,K),R.delete(N)}}},[]),g=`${n}-legend`,{isOpen:f,closeMenu:M,highlightedIndex:x,getToggleButtonProps:w,getMenuProps:h,getItemProps:S}=Oo({environment:p,items:t,itemToString:R=>R?R.label:"",selectedItem:r,stateReducer:(R,{type:_,changes:N})=>_===Oo.stateChangeTypes.ToggleButtonBlur?{...N,selectedItem:R.selectedItem}:N,onSelectedItemChange:({selectedItem:R})=>{typeof a=="function"&&R&&R.value!==r?.value&&a(R.value)},onIsOpenChange:({isOpen:R})=>{R&&c.current&&d(k4(c.current))},id:n,labelId:g}),H=JSON.stringify(t.map(R=>R.value)),k=X1.useRef(H);X1.useLayoutEffect(()=>{k.current!==H&&M(),k.current=H},[H,M]),X1.useEffect(()=>{if(!f||!c.current)return;let R=q1(c.current);if(!R)return;let _=()=>M();return R.addEventListener("scroll",_,{passive:!0}),()=>R.removeEventListener("scroll",_)},[f,M]);let Z="picklistEditor-dropdown"+(f?" picklistEditor-dropdown--open":""),V=f?{top:u.top,left:u.left,width:u.width,...u.openAbove?{transform:"translateY(-100%)"}:void 0}:void 0,[L,y]=X1.useState(null);return X1.useLayoutEffect(()=>{let _=c.current?.getRootNode();y(_ instanceof ShadowRoot?_:document.body)},[]),_t(m1,{label:e,id:n,className:"picklistEditor-fieldset",children:Zl("div",{className:"picklistEditor-wrapper",children:[Zl("button",{type:"button",className:"picklistEditor-trigger",style:s,...w({ref:c}),children:[_t("span",{className:"picklistEditor-trigger-label",children:i??r?.label??"Default"}),_t("span",{className:"picklistEditor-trigger-chevron","aria-hidden":"true",children:_t(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),R4(_t("ul",{className:Z,style:V,...h(),children:f&&t.map((R,_)=>Zl(X1.Fragment,{children:[_t("li",{className:"picklistEditor-option"+(x===_?" picklistEditor-option--highlighted":"")+(r?.value===R.value?" picklistEditor-option--selected":""),style:l?l(R):void 0,...S({item:R,index:_}),children:R.label}),R.value===o&&_t("li",{className:"picklistEditor-divider",role:"presentation","aria-hidden":"true"})]},R.value))}),L??document.body)]})})}import{jsx as T4}from"react/jsx-runtime";var Zi=[{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 Fl(e){return(e.split(",")[0]??"").trim().replace(/['"]/g,"")}function Fi(e,t){if(!e)return null;let o=Fl(e).toLowerCase();return o?t.find(r=>Fl(r.value).toLowerCase()===o)??null:null}function $i(e){return Fi(e,Zi)!==null}var P4=e=>e.value?{fontFamily:e.value}:void 0;function Ni({label:e="Font family",value:t,computedValue:o,options:r,onChange:a,matchOption:n=Fi,id:l="font-family",useInheritLabel:i="Inherited"}){let s=r??Zi,u={value:"inherit",label:i},d=t==="inherit"?u:n(t,s),c=o??t,p=c==="inherit"?void 0:c,g=n(p,s),f="Default";g?f=g.label:p&&(f=Fl(p)||"Default");let M=p?{fontFamily:p}:void 0;return T4(Jr,{label:e,options:[u,...s],dividerAfterValue:"inherit",selectedItem:d,triggerLabel:f,triggerStyle:M,onChange:a,id:l,getOptionStyle:P4})}import{jsx as O4}from"react/jsx-runtime";var V4=[{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 E4(e){return V4.map(t=>{let o=e?.[t.labelKey]??t.defaultWord;return{value:t.value,label:o}})}function D4(e,t){if(!e)return null;let o=String(e).trim();return t.find(r=>r.value===o)??null}function Ui({label:e="Font weight",value:t,computedValue:o,fontFamily:r,options:a,onChange:n,matchOption:l=D4,id:i="font-weight",useInheritLabel:s="Inherited",optionLabels:u}){let d=a??E4(u),c=!a&&$i(r)?d.filter(h=>h.value==="400"||h.value==="700"):d,p={value:"inherit",label:s},g=t==="inherit"?p:l(t,c),f=o??t,M=f==="inherit"?void 0:f,w=l(M,d)?.label??(M||"Default");return O4(Jr,{label:e,options:[p,...c],dividerAfterValue:"inherit",selectedItem:g,triggerLabel:w,onChange:n,id:i})}import te from"react";import{createPortal as B4}from"react-dom";import{jsx as qi,jsxs as _4}from"react/jsx-runtime";function zi({id:e,className:t,text:o}){return _4("p",{id:e,className:t?`fieldNotice ${t}`:"fieldNotice",children:[qi("svg",{className:"fieldNotice-icon",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:qi("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),o]})}import{Fragment as ji,jsx as le,jsxs as Je}from"react/jsx-runtime";var A4={tabCms:"CMS",tabLocal:"Local",tabUrl:"URL",ariaTablist:"Image source",clearImage:"Clear image",chooseFile:"Choose File...",ariaChooseFile:"Choose an image file from your computer",ariaImageUrl:"Image URL",urlPlaceholder:"https://example.com/image.png",previewAlt:"Preview",altText:"Alt Text",altPlaceholder:"Describe the image",sourceFromData:"This image comes from data, so you can't edit it here.",sourceNotEditable:"You can't edit this image here.",altFromData:"This alt text comes from data, so you can't edit it here.",altNotEditable:"You can't edit this alt text here.",sourceShared:"This image is used {0} times on this page. Changing it changes all of them.",altShared:"This alt text is used on {0} images. Changing it changes all of them.",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}"},no=["local","url"];function Z4({labels:e,workspaceName:t,folderId:o,portalTarget:r,folderItemsResult:a,contentDetail:n,thumbnailResult:l,onFetchFolderItems:i,onFetchContentDetail:s,onFetchThumbnail:u,onCancel:d,onConfirm:c}){let[p,g]=te.useState([]),[f,M]=te.useState(0),[x,w]=te.useState(!0),[h,S]=te.useState(!1),[H,k]=te.useState(null),[Z,V]=te.useState(null),[L,y]=te.useState({}),[R,_]=te.useState({}),N=te.useRef(new Set),K=te.useRef(new Set),z=te.useCallback(U=>{h||typeof i=="function"&&(S(!0),k(null),i(o,U,20))},[o,h,i]);te.useEffect(()=>{z(0)},[o]),te.useEffect(()=>{let U=A=>{A.key==="Escape"&&(A.stopPropagation(),d())};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[d]);let W=te.useRef(null);te.useEffect(()=>{W.current?.focus()},[]),te.useEffect(()=>{if(!a)return;let U=(a.items??[]).map(A=>({contentKey:A.contentKey,title:A.title??e.untitled,mimeType:A.mimeType??"image/png"}));g(A=>a.page===0?U:[...A,...U]),w(!!a.hasMore),M(a.page??0),S(!1),a.error&&k(String(a.error))},[a]),te.useEffect(()=>{if(!n)return;let U=n.contentKey;if(!U||n.error)return;let A=n.url??"",q=n.mimeType??"image/png",T=n.title??"";y(j=>j[U]?j:{...j,[U]:{url:A,mimeType:q,title:T}}),A&&!K.current.has(U)&&typeof u=="function"&&(K.current.add(U),u(U,A,q))},[n,u]),te.useEffect(()=>{if(!l)return;let{imageId:U,thumbnailUrl:A}=l;U&&A&&_(q=>({...q,[U]:A}))},[l]);let F=te.useRef(null);te.useEffect(()=>{let U=F.current;if(!U||!x||h)return;let A=new IntersectionObserver(q=>{q.some(j=>j.isIntersecting)&&z(f+1)});return A.observe(U),()=>A.disconnect()},[x,h,f,z]);let D=te.useCallback(U=>{N.current.has(U)||typeof s=="function"&&(N.current.add(U),s(U))},[s]),B=()=>{if(!Z)return;let U=L[Z],A=p.find(q=>q.contentKey===Z);!U||!A||c({contentKey:Z,title:A.title,url:U.url,mimeType:U.mimeType||A.mimeType})};return B4(le("div",{ref:W,tabIndex:-1,className:"cmsPicker-overlay",role:"dialog","aria-modal":"true","aria-label":Re(e.pickerTitle,[t]),onClick:U=>{U.target===U.currentTarget&&d()},children:Je("div",{className:"cmsPicker-dialog",children:[Je("div",{className:"cmsPicker-header",children:[le("span",{className:"cmsPicker-title",children:Re(e.pickerTitle,[t])}),le("button",{type:"button",className:"cmsPicker-close",onClick:d,"aria-label":e.closePicker,title:e.closePicker,children:"\u2715"})]}),Je("div",{className:"cmsPicker-body",children:[p.length===0&&h&&le("div",{className:"cmsPicker-empty",children:e.loadingImages}),p.length===0&&!h&&!H&&le("div",{className:"cmsPicker-empty",children:e.noImages}),H&&le("div",{className:"cmsPicker-empty",children:Re(e.pickerError,[H])}),Je("div",{className:"cmsPicker-grid",children:[p.map(U=>le(F4,{item:U,selected:Z===U.contentKey,thumbnailDataUrl:R[U.contentKey],onIntersect:()=>D(U.contentKey),onClick:()=>V(U.contentKey)},U.contentKey)),x&&le("div",{className:"cmsPicker-sentinel",ref:F,children:h?e.loadingMore:""})]})]}),Je("div",{className:"cmsPicker-footer",children:[le("button",{type:"button",className:"cmsPicker-btn",onClick:d,children:e.cancel}),le("button",{type:"button",className:"cmsPicker-btn cmsPicker-btn--primary",disabled:!Z||!L[Z??""],onClick:B,children:e.done})]})]})}),r)}function F4({item:e,selected:t,thumbnailDataUrl:o,onIntersect:r,onClick:a}){let n=te.useRef(null),l=te.useRef(!1);return te.useEffect(()=>{let i=n.current;if(!i||l.current)return;let s=new IntersectionObserver(u=>{u.some(c=>c.isIntersecting)&&!l.current&&(l.current=!0,r(),s.disconnect())});return s.observe(i),()=>s.disconnect()},[r]),Je("button",{ref:n,type:"button",className:`cmsPicker-thumb${t?" cmsPicker-thumb--selected":""}`,onClick:a,title:e.title,"aria-pressed":t,children:[le("div",{className:"cmsPicker-thumb-img",children:o?le("img",{src:o,alt:e.title}):le("div",{className:"cmsPicker-thumb-placeholder","aria-hidden":"true",children:"\u2026"})}),le("span",{className:"cmsPicker-thumb-label",children:e.title})]})}function $4({labels:e,spaces:t,spacesLoading:o,selectedSpaceId:r,onSpaceSelect:a,onOpenPicker:n}){return o?le("div",{className:"imageEditor-cms",children:le("div",{className:"imageEditor-cms-loading",children:e.loadingWorkspaces})}):t.length===0?le("div",{className:"imageEditor-cms",children:le("div",{className:"imageEditor-cms-empty",children:e.noWorkspaces})}):Je("div",{className:"imageEditor-cms",children:[Je("div",{className:"imageEditor-cms-channel",children:[le("label",{className:"imageEditor-cms-channel-label",htmlFor:"cms-space-select",children:e.workspace}),Je("select",{id:"cms-space-select",className:"imageEditor-input imageEditor-cms-channel-select",value:r,onChange:l=>a(l.target.value),children:[le("option",{value:"",children:e.selectWorkspace}),t.map(l=>le("option",{value:l.id,children:l.name},l.id))]})]}),le("button",{type:"button",className:"imageEditor-cms-pick-btn",onClick:n,disabled:!r,children:e.selectImage})]})}function N4({labels:e,onPick:t}){return le("div",{className:"imageEditor-local",children:le("button",{className:"imageEditor-local-pick",onClick:t,type:"button","aria-label":e.ariaChooseFile,"aria-haspopup":"dialog",children:e.chooseFile})})}function Ki({src:e,alt:t,className:o}){let[r,a]=te.useState(!1);return te.useEffect(()=>{a(!1)},[e]),r?null:le("img",{src:e,alt:t,className:o,onError:()=>a(!0)})}function U4({labels:e,input:t,onInputChange:o,onApply:r,currentUrl:a}){return Je("div",{className:"imageEditor-url",children:[le("input",{type:"text",value:t,"aria-label":e.ariaImageUrl,placeholder:e.urlPlaceholder,className:"imageEditor-input",onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"&&t&&r(t)},onBlur:()=>{t&&t!==a&&r(t)}}),t&&le("div",{className:"imageEditor-url-preview",children:le(Ki,{src:t,alt:e.previewAlt,className:"imageEditor-preview-thumb"})})]})}function q4({id:e,label:t,value:o,placeholder:r,readOnly:a,describedBy:n,onCommit:l}){let[i,s]=te.useState(o),u=te.useRef(l);u.current=l;let d=te.useRef(o);te.useEffect(()=>{o!==d.current&&(d.current=o,s(o))},[o]);let c=()=>{!a&&i!==o&&(d.current=i,u.current(i))};return Je("div",{className:"imageEditor-attr",children:[le("label",{className:"imageEditor-attr-label",htmlFor:e,children:t}),le("input",{id:e,type:"text",value:i,placeholder:r,className:"imageEditor-input",disabled:a,"aria-describedby":n,onChange:p=>s(p.target.value),onKeyDown:p=>{p.key==="Enter"&&c()},onBlur:c})]})}function z4({labels:e,attributes:t,altReadOnly:o,describedBy:r,onAttributeChange:a}){return le("div",{className:"imageEditor-attrs",children:le(q4,{id:"design-img-alt",label:e.altText,value:t.alt,placeholder:e.altPlaceholder,readOnly:o,describedBy:r,onCommit:n=>a("alt",n)})})}function $l({label:e,value:t,onChange:o,id:r="image",attributes:a,onAttributeChange:n,sourceReadOnly:l,altReadOnly:i,sharedCount:s,cmsSpaces:u,cmsSpacesLoading:d,onFetchCmsSpaces:c,cmsFolderItemsResult:p,onFetchCmsFolderItems:g,cmsContentDetail:f,onFetchCmsContentDetail:M,cmsThumbnailResult:x,onFetchCmsThumbnail:w,onImportCmsImage:h,cmsImportResult:S,onPickLocalFile:H,localPreview:k,imageLabels:Z}){let V=M1(A4,Z),L=!!(a&&n),y=L&&!!i,R=l&&(l==="from-data"?V.sourceFromData:V.sourceNotEditable),_=y&&(i==="from-data"?V.altFromData:V.altNotEditable),N=s!==void 0&&s>1?s:void 0,K=N===void 0?void 0:l?L&&!y?Re(V.altShared,[N]):void 0:Re(V.sourceShared,[N]),z=[R||_,K].filter(Boolean).join(" ")||void 0,W=`${r}-notice`,F={cms:V.tabCms,local:V.tabLocal,url:V.tabUrl},[D,B]=te.useState("local"),[U,A]=te.useState(""),[q,T]=te.useState(!1),j=te.useRef(o);j.current=o;let m=te.useRef(t);m.current=t;let I=te.useRef(!!l);I.current=!!l;let P=te.useRef(k);te.useEffect(()=>{if(!k||k===P.current||(P.current=k,I.current))return;let re=k.devUrl||k.webviewUri;re&&re!==m.current&&j.current(re)},[k]);let C=re=>re?.startsWith("data:")?"":re??"",[$,v]=te.useState(()=>C(t)),b=te.useRef(t??"");te.useEffect(()=>{let re=t??"";re!==b.current&&(b.current=re,v(C(re)))},[t]);let[G,J]=te.useState("idle"),oe=te.useRef(null),ce=te.useRef(null),he=te.useCallback(()=>{let re=ce.current?.getRootNode();return re instanceof ShadowRoot?re:document.body},[]),Me=te.useRef({}),p1=te.useCallback(re=>{B(re),Me.current[re]?.focus()},[]),we=te.useCallback((re,Ge)=>{let He=null;switch(re.key){case"ArrowRight":He=(Ge+1)%no.length;break;case"ArrowLeft":He=(Ge-1+no.length)%no.length;break;case"Home":He=0;break;case"End":He=no.length-1;break;default:return}re.preventDefault();let C1=no[He];C1&&p1(C1)},[p1]),Te=u??[],De=d??!1,Se=t||"";te.useEffect(()=>{if(S){if(I.current){J("idle");return}if(S.success&&S.devUrl)o(S.devUrl),J("success");else{let re=oe.current?.url;re?(o(re),J("success")):J("error")}}},[S,o]),te.useEffect(()=>{D==="cms"&&Te.length===0&&!De&&typeof c=="function"&&c()},[D]);let b1=te.useMemo(()=>Te.find(re=>re.id===U)??null,[Te,U]),Ne=te.useCallback(re=>{if(I.current){T(!1);return}let Ge={id:re.contentKey,title:re.title,url:re.url,thumbnailUrl:"",contentType:re.mimeType};oe.current=Ge,T(!1),typeof h=="function"&&Ge.url?(J("importing"),h(Ge)):Ge.url&&o(Ge.url)},[o,h]),Oe=le(m1,{label:e,id:r,className:"imageEditor-fieldset",children:Je("div",{ref:ce,className:"imageEditor-root",children:[Se&&Je("div",{className:`imageEditor-current${l?" imageEditor-current--readonly":""}`,children:[le(Ki,{src:Se,alt:"",className:"imageEditor-current-thumb"}),le("span",{className:"imageEditor-current-url",title:Se,children:Se.length>30?`...${Se.slice(-30)}`:Se}),!l&&le("button",{className:"imageEditor-clear",onClick:()=>o(""),title:V.clearImage,"aria-label":V.clearImage,type:"button",children:"\u2715"})]}),!l&&Je(ji,{children:[le("div",{className:"imageEditor-tabs",role:"tablist","aria-label":V.ariaTablist,"aria-describedby":K?W:void 0,children:no.map((re,Ge)=>le("button",{id:`${r}-tab-${re}`,ref:He=>{Me.current[re]=He},role:"tab",type:"button","aria-selected":D===re,"aria-controls":`${r}-tabpanel`,tabIndex:D===re?0:-1,className:`imageEditor-tab${D===re?" imageEditor-tab--active":""}`,onClick:()=>B(re),onKeyDown:He=>we(He,Ge),children:F[re]},re))}),Je("div",{className:"imageEditor-tab-content",role:"tabpanel",id:`${r}-tabpanel`,"aria-labelledby":`${r}-tab-${D}`,children:[D==="cms"&&le($4,{labels:V,spaces:Te,spacesLoading:De,selectedSpaceId:U,onSpaceSelect:A,onOpenPicker:()=>T(!0)}),D==="cms"&&G==="importing"&&le("div",{className:"imageEditor-cms-loading",children:V.downloadingImage}),D==="cms"&&G==="error"&&le("div",{className:"imageEditor-cms-empty",children:V.downloadFailed}),D==="local"&&le(N4,{labels:V,onPick:()=>H?.()}),D==="url"&&le(U4,{labels:V,input:$,onInputChange:v,onApply:re=>{b.current=re,o(re)},currentUrl:Se})]})]}),a&&n&&le(z4,{labels:V,attributes:a,altReadOnly:!!i,describedBy:z&&(i||K)?W:void 0,onAttributeChange:n}),q&&b1&&le(Z4,{labels:V,workspaceName:b1.name,folderId:b1.rootFolderId,portalTarget:he(),folderItemsResult:p,contentDetail:f,thumbnailResult:x,onFetchFolderItems:g,onFetchContentDetail:M,onFetchThumbnail:w,onCancel:()=>T(!1),onConfirm:Ne})]})});return Je(ji,{children:[z&&le(zi,{id:W,className:"imageEditor-notice",text:z}),Oe]})}import P1 from"react";import*as Q1 from"react";import{jsx as j4}from"react/jsx-runtime";function lo(e,t=[]){let o=[];function r(n,l){let i=Q1.createContext(l),s=o.length;o=[...o,l];let u=c=>{let{scope:p,children:g,...f}=c,M=p?.[e]?.[s]||i,x=Q1.useMemo(()=>f,Object.values(f));return j4(M.Provider,{value:x,children:g})};u.displayName=n+"Provider";function d(c,p){let g=p?.[e]?.[s]||i,f=Q1.useContext(g);if(f)return f;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let a=()=>{let n=o.map(l=>Q1.createContext(l));return function(i){let s=i?.[e]||n;return Q1.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[r,K4(a,...t)]}function K4(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){let l=r.reduce((i,{useScope:s,scopeName:u})=>{let c=s(n)[`__scope${u}`];return{...i,...c}},{});return Q1.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return o.scopeName=t.scopeName,o}import*as Yi from"react";import*as ec from"react-dom";import*as Ae from"react";import*as G4 from"react";function Gi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wi(...e){return t=>{let o=!1,r=e.map(a=>{let n=Gi(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():Gi(e[a],null)}}}}import{Fragment as HI,jsx as Xi}from"react/jsx-runtime";function Qi(e){let t=W4(e),o=Ae.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ae.Children.toArray(n),s=i.find(Q4);if(s){let u=s.props.children,d=i.map(c=>c===s?Ae.Children.count(u)>1?Ae.Children.only(null):Ae.isValidElement(u)?u.props.children:null:c);return Xi(t,{...l,ref:a,children:Ae.isValidElement(u)?Ae.cloneElement(u,void 0,d):null})}return Xi(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function W4(e){let t=Ae.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ae.isValidElement(a)){let l=J4(a),i=Y4(n,a.props);return a.type!==Ae.Fragment&&(i.ref=r?Wi(r,l):l),Ae.cloneElement(a,i)}return Ae.Children.count(a)>1?Ae.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var X4=Symbol("radix.slottable");function Q4(e){return Ae.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===X4}function Y4(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function J4(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 tc}from"react/jsx-runtime";var oc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nl=oc.reduce((e,t)=>{let o=Qi(`Primitive.${t}`),r=Yi.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),tc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as je from"react";var EI=!!(typeof window<"u"&&window.document&&window.document.createElement);function Y1(e,t,{checkForDefaultPrevented:o=!0}={}){return function(a){if(e?.(a),o===!1||!a.defaultPrevented)return t?.(a)}}import Bt from"react";import*as e5 from"react";function Ji(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ul(...e){return t=>{let o=!1,r=e.map(a=>{let n=Ji(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():Ji(e[a],null)}}}}function ql(...e){return e5.useCallback(Ul(...e),e)}import*as Ze from"react";import{Fragment as AI,jsx as t5}from"react/jsx-runtime";function zl(e){let t=rc(e),o=Ze.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ze.Children.toArray(n),s=i.find(nc);if(s){let u=s.props.children,d=i.map(c=>c===s?Ze.Children.count(u)>1?Ze.Children.only(null):Ze.isValidElement(u)?u.props.children:null:c);return t5(t,{...l,ref:a,children:Ze.isValidElement(u)?Ze.cloneElement(u,void 0,d):null})}return t5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function rc(e){let t=Ze.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ze.isValidElement(a)){let l=ic(a),i=lc(n,a.props);return a.type!==Ze.Fragment&&(i.ref=r?Ul(r,l):l),Ze.cloneElement(a,i)}return Ze.Children.count(a)>1?Ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ac=Symbol("radix.slottable");function nc(e){return Ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ac}function lc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function ic(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 jl}from"react/jsx-runtime";import WI from"react";import{jsx as QI}from"react/jsx-runtime";function o5(e){let t=e+"CollectionProvider",[o,r]=lo(t),[a,n]=o(t,{collectionRef:{current:null},itemMap:new Map}),l=M=>{let{scope:x,children:w}=M,h=Bt.useRef(null),S=Bt.useRef(new Map).current;return jl(a,{scope:x,itemMap:S,collectionRef:h,children:w})};l.displayName=t;let i=e+"CollectionSlot",s=zl(i),u=Bt.forwardRef((M,x)=>{let{scope:w,children:h}=M,S=n(i,w),H=ql(x,S.collectionRef);return jl(s,{ref:H,children:h})});u.displayName=i;let d=e+"CollectionItemSlot",c="data-radix-collection-item",p=zl(d),g=Bt.forwardRef((M,x)=>{let{scope:w,children:h,...S}=M,H=Bt.useRef(null),k=ql(x,H),Z=n(d,w);return Bt.useEffect(()=>(Z.itemMap.set(H,{ref:H,...S}),()=>{Z.itemMap.delete(H)})),jl(p,{[c]:"",ref:k,children:h})});g.displayName=d;function f(M){let x=n(e+"CollectionConsumer",M);return Bt.useCallback(()=>{let h=x.collectionRef.current;if(!h)return[];let S=Array.from(h.querySelectorAll(`[${c}]`));return Array.from(x.itemMap.values()).sort((Z,V)=>S.indexOf(Z.ref.current)-S.indexOf(V.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:l,Slot:u,ItemSlot:g},f,r]}import*as a5 from"react";function r5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kl(...e){return t=>{let o=!1,r=e.map(a=>{let n=r5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():r5(e[a],null)}}}}function n5(...e){return a5.useCallback(Kl(...e),e)}import*as Gl from"react";import*as l5 from"react";var ea=globalThis?.document?l5.useLayoutEffect:()=>{};var sc=Gl[" useId ".trim().toString()]||(()=>{}),uc=0;function i5(e){let[t,o]=Gl.useState(sc());return ea(()=>{e||o(r=>r??String(uc++))},[e]),e||(t?`radix-${t}`:"")}import*as d5 from"react";import*as mc from"react-dom";import*as Fe from"react";import{Fragment as lb,jsx as s5}from"react/jsx-runtime";function u5(e){let t=dc(e),o=Fe.forwardRef((r,a)=>{let{children:n,...l}=r,i=Fe.Children.toArray(n),s=i.find(fc);if(s){let u=s.props.children,d=i.map(c=>c===s?Fe.Children.count(u)>1?Fe.Children.only(null):Fe.isValidElement(u)?u.props.children:null:c);return s5(t,{...l,ref:a,children:Fe.isValidElement(u)?Fe.cloneElement(u,void 0,d):null})}return s5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function dc(e){let t=Fe.forwardRef((o,r)=>{let{children:a,...n}=o;if(Fe.isValidElement(a)){let l=Cc(a),i=pc(n,a.props);return a.type!==Fe.Fragment&&(i.ref=r?Kl(r,l):l),Fe.cloneElement(a,i)}return Fe.Children.count(a)>1?Fe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cc=Symbol("radix.slottable");function fc(e){return Fe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cc}function pc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function Cc(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 gc}from"react/jsx-runtime";var hc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wl=hc.reduce((e,t)=>{let o=u5(`Primitive.${t}`),r=d5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),gc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as io from"react";function c5(e){let t=io.useRef(e);return io.useEffect(()=>{t.current=e}),io.useMemo(()=>(...o)=>t.current?.(...o),[])}import*as I1 from"react";import*as ta from"react";var vc=I1[" useInsertionEffect ".trim().toString()]||ea;function At({prop:e,defaultProp:t,onChange:o=()=>{},caller:r}){let[a,n,l]=xc({defaultProp:t,onChange:o}),i=e!==void 0,s=i?e:a;{let d=I1.useRef(e!==void 0);I1.useEffect(()=>{let c=d.current;c!==i&&console.warn(`${r} is changing from ${c?"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,r])}let u=I1.useCallback(d=>{if(i){let c=Lc(d)?d(e):d;c!==e&&l.current?.(c)}else n(d)},[i,e,n,l]);return[s,u]}function xc({defaultProp:e,onChange:t}){let[o,r]=I1.useState(e),a=I1.useRef(o),n=I1.useRef(t);return vc(()=>{n.current=t},[t]),I1.useEffect(()=>{a.current!==o&&(n.current?.(o),a.current=o)},[o,a]),[o,r,n]}function Lc(e){return typeof e=="function"}import*as oa from"react";import{jsx as mb}from"react/jsx-runtime";var wc=oa.createContext(void 0);function ra(e){let t=oa.useContext(wc);return e||t||"ltr"}import{jsx as Zt}from"react/jsx-runtime";var Xl="rovingFocusGroup.onEntryFocus",Ic={bubbles:!1,cancelable:!0},_o="RovingFocusGroup",[Ql,f5,bc]=o5(_o),[yc,Yl]=lo(_o,[bc]),[Mc,Sc]=yc(_o),p5=je.forwardRef((e,t)=>Zt(Ql.Provider,{scope:e.__scopeRovingFocusGroup,children:Zt(Ql.Slot,{scope:e.__scopeRovingFocusGroup,children:Zt(Rc,{...e,ref:t})})}));p5.displayName=_o;var Rc=je.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:n,currentTabStopId:l,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,p=je.useRef(null),g=n5(t,p),f=ra(n),[M,x]=At({prop:l,defaultProp:i??null,onChange:s,caller:_o}),[w,h]=je.useState(!1),S=c5(u),H=f5(o),k=je.useRef(!1),[Z,V]=je.useState(0);return je.useEffect(()=>{let L=p.current;if(L)return L.addEventListener(Xl,S),()=>L.removeEventListener(Xl,S)},[S]),Zt(Mc,{scope:o,orientation:r,dir:f,loop:a,currentTabStopId:M,onItemFocus:je.useCallback(L=>x(L),[x]),onItemShiftTab:je.useCallback(()=>h(!0),[]),onFocusableItemAdd:je.useCallback(()=>V(L=>L+1),[]),onFocusableItemRemove:je.useCallback(()=>V(L=>L-1),[]),children:Zt(Wl.div,{tabIndex:w||Z===0?-1:0,"data-orientation":r,...c,ref:g,style:{outline:"none",...e.style},onMouseDown:Y1(e.onMouseDown,()=>{k.current=!0}),onFocus:Y1(e.onFocus,L=>{let y=!k.current;if(L.target===L.currentTarget&&y&&!w){let R=new CustomEvent(Xl,Ic);if(L.currentTarget.dispatchEvent(R),!R.defaultPrevented){let _=H().filter(F=>F.focusable),N=_.find(F=>F.active),K=_.find(F=>F.id===M),W=[N,K,..._].filter(Boolean).map(F=>F.ref.current);g5(W,d)}}k.current=!1}),onBlur:Y1(e.onBlur,()=>h(!1))})})}),C5="RovingFocusGroupItem",m5=je.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:n,children:l,...i}=e,s=i5(),u=n||s,d=Sc(C5,o),c=d.currentTabStopId===u,p=f5(o),{onFocusableItemAdd:g,onFocusableItemRemove:f,currentTabStopId:M}=d;return je.useEffect(()=>{if(r)return g(),()=>f()},[r,g,f]),Zt(Ql.ItemSlot,{scope:o,id:u,focusable:r,active:a,children:Zt(Wl.span,{tabIndex:c?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:Y1(e.onMouseDown,x=>{r?d.onItemFocus(u):x.preventDefault()}),onFocus:Y1(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Y1(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;let w=Pc(x,d.orientation,d.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=p().filter(H=>H.focusable).map(H=>H.ref.current);if(w==="last")S.reverse();else if(w==="prev"||w==="next"){w==="prev"&&S.reverse();let H=S.indexOf(x.currentTarget);S=d.loop?Tc(S,H+1):S.slice(H+1)}setTimeout(()=>g5(S))}}),children:typeof l=="function"?l({isCurrentTabStop:c,hasTabStop:M!=null}):l})})});m5.displayName=C5;var Hc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pc(e,t,o){let r=kc(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Hc[r]}function g5(e,t=!1){let o=document.activeElement;for(let r of e)if(r===o||(r.focus({preventScroll:t}),document.activeElement!==o))return}function Tc(e,t){return e.map((o,r)=>e[(t+r)%e.length])}var h5=p5,v5=m5;import*as M5 from"react";import*as b5 from"react";import*as Zc from"react-dom";import*as $e from"react";import*as Ec from"react";function x5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function L5(...e){return t=>{let o=!1,r=e.map(a=>{let n=x5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():x5(e[a],null)}}}}import{Fragment as Pb,jsx as w5}from"react/jsx-runtime";function I5(e){let t=Dc(e),o=$e.forwardRef((r,a)=>{let{children:n,...l}=r,i=$e.Children.toArray(n),s=i.find(_c);if(s){let u=s.props.children,d=i.map(c=>c===s?$e.Children.count(u)>1?$e.Children.only(null):$e.isValidElement(u)?u.props.children:null:c);return w5(t,{...l,ref:a,children:$e.isValidElement(u)?$e.cloneElement(u,void 0,d):null})}return w5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function Dc(e){let t=$e.forwardRef((o,r)=>{let{children:a,...n}=o;if($e.isValidElement(a)){let l=Ac(a),i=Bc(n,a.props);return a.type!==$e.Fragment&&(i.ref=r?L5(r,l):l),$e.cloneElement(a,i)}return $e.Children.count(a)>1?$e.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oc=Symbol("radix.slottable");function _c(e){return $e.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oc}function Bc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function Ac(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 Fc}from"react/jsx-runtime";var $c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],y5=$c.reduce((e,t)=>{let o=I5(`Primitive.${t}`),r=b5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Fc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import{jsx as Nc}from"react/jsx-runtime";var S5="Toggle",Jl=M5.forwardRef((e,t)=>{let{pressed:o,defaultPressed:r,onPressedChange:a,...n}=e,[l,i]=At({prop:o,onChange:a,defaultProp:r??!1,caller:S5});return Nc(y5.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...n,ref:t,onClick:Y1(e.onClick,()=>{e.disabled||i(!l)})})});Jl.displayName=S5;import{jsx as u1}from"react/jsx-runtime";var It="ToggleGroup",[H5,Gb]=lo(It,[Yl]),k5=Yl(),e2=P1.forwardRef((e,t)=>{let{type:o,...r}=e;if(o==="single")return u1(Uc,{...r,ref:t});if(o==="multiple")return u1(qc,{...r,ref:t});throw new Error(`Missing prop \`type\` expected on \`${It}\``)});e2.displayName=It;var[P5,T5]=H5(It),Uc=P1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=At({prop:o,defaultProp:r??"",onChange:a,caller:It});return u1(P5,{scope:e.__scopeToggleGroup,type:"single",value:P1.useMemo(()=>l?[l]:[],[l]),onItemActivate:i,onItemDeactivate:P1.useCallback(()=>i(""),[i]),children:u1(V5,{...n,ref:t})})}),qc=P1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=At({prop:o,defaultProp:r??[],onChange:a,caller:It}),s=P1.useCallback(d=>i((c=[])=>[...c,d]),[i]),u=P1.useCallback(d=>i((c=[])=>c.filter(p=>p!==d)),[i]);return u1(P5,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:s,onItemDeactivate:u,children:u1(V5,{...n,ref:t})})});e2.displayName=It;var[zc,jc]=H5(It),V5=P1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,disabled:r=!1,rovingFocus:a=!0,orientation:n,dir:l,loop:i=!0,...s}=e,u=k5(o),d=ra(l),c={role:"group",dir:d,...s};return u1(zc,{scope:o,rovingFocus:a,disabled:r,children:a?u1(h5,{asChild:!0,...u,orientation:n,dir:d,loop:i,children:u1(Nl.div,{...c,ref:t})}):u1(Nl.div,{...c,ref:t})})}),aa="ToggleGroupItem",E5=P1.forwardRef((e,t)=>{let o=T5(aa,e.__scopeToggleGroup),r=jc(aa,e.__scopeToggleGroup),a=k5(e.__scopeToggleGroup),n=o.value.includes(e.value),l=r.disabled||e.disabled,i={...e,pressed:n,disabled:l},s=P1.useRef(null);return r.rovingFocus?u1(v5,{asChild:!0,...a,focusable:!l,active:n,ref:s,children:u1(R5,{...i,ref:t})}):u1(R5,{...i,ref:t})});E5.displayName=aa;var R5=P1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,value:r,...a}=e,n=T5(aa,o),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=n.type==="single"?l:void 0;return u1(Jl,{...i,...a,ref:t,onPressedChange:s=>{s?n.onItemActivate(r):n.onItemDeactivate(r)}})}),t2=e2,D5=E5;import{jsx as na}from"react/jsx-runtime";function la(e){let t=e.options.map(o=>na(D5,{value:o.value,className:"buttonGroupEditor-item","aria-label":o.label,title:o.label,children:o.icon??o.label},o.value));return na(m1,{label:e.label,id:e.id,children:e.type==="single"?na(t2,{type:"single",value:e.value,onValueChange:o=>{o&&e.onChange(o)},className:"buttonGroupEditor-root","aria-label":e.label,children:t}):na(t2,{type:"multiple",value:e.value,onValueChange:e.onChange,className:"buttonGroupEditor-root",children:t})})}import{jsx as O5}from"react/jsx-runtime";var Gc={uppercase:"M3.04 8.96L3.04 1.96L0.50 1.96L0.50 0.50L7.34 0.50L7.34 1.96L4.81 1.96L4.81 8.96ZM11.20 8.96L11.20 1.96L8.66 1.96L8.66 0.50L15.51 0.50L15.51 1.96L12.97 1.96L12.97 8.96Z",italic:"M380 123v-13a20 20 0 0 0-20-20H220a20 20 0 0 0-20 20v20c0 11 9 20 20 20 17 0 30 16 26 32l-36 176a27 27 0 0 1-26 22h-24a20 20 0 0 0-20 20v20c0 11 9 20 20 20h140a20 20 0 0 0 20-20v-20a20 20 0 0 0-20-20c-17 0-30-16-26-32l36-176a27 27 0 0 1 26-22h17c15 0 27-12 27-27",underline:"M445 420H75c-8 0-15 7-15 15v30c0 8 7 15 15 15h370c8 0 15-7 15-15v-30c0-8-7-15-15-15m-192-40a143 143 0 0 1-133-144V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v137c0 43 32 80 75 83a80 80 0 0 0 85-80V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v140a140 140 0 0 1-147 140",left_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-80 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",center_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-60 120c0-8-7-15-15-15H115c-8 0-15 7-15 15v30c0 8 7 15 15 15h290c8 0 15-7 15-15zm-20 240c0-8-7-15-15-15H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h250c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",right_align_text:"M465 50H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15V65c0-8-7-15-15-15m0 120H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0 240H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0-120H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15v-30c0-8-7-15-15-15",justify_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z"};function J1({name:e}){return O5("svg",{className:"slds-button__icon",width:e==="uppercase"?16.01:14,height:e==="uppercase"?9.46:14,viewBox:e==="uppercase"?"0 0 16.01 9.46":"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:O5("path",{d:Gc[e]})})}import{jsx as Bo}from"react/jsx-runtime";var Wc=[{value:"left",labelKey:"left",defaultLabel:"Left",icon:Bo(J1,{name:"left_align_text"})},{value:"center",labelKey:"center",defaultLabel:"Center",icon:Bo(J1,{name:"center_align_text"})},{value:"right",labelKey:"right",defaultLabel:"Right",icon:Bo(J1,{name:"right_align_text"})},{value:"justify",labelKey:"justify",defaultLabel:"Justify",icon:Bo(J1,{name:"justify_text"})}],Xc={start:"left",end:"right"};function _5({label:e="Text Align",value:t,onChange:o,id:r="text-align",optionLabels:a}){let n=Xc[t||""]||t||"left",l=Wc.map(i=>({value:i.value,label:a?.[i.labelKey]??i.defaultLabel,icon:i.icon}));return Bo(la,{type:"single",label:e,options:l,value:n,onChange:o,id:r})}import{jsx as ia}from"react/jsx-runtime";function B5({label:e="Text Styling",id:t="text-style",fontStyle:o,textDecoration:r,textTransform:a,onChange:n,optionLabels:l}){let i=[{property:"fontStyle",label:l?.italic??"Italic",pressed:o?.trim().toLowerCase()==="italic",on:"italic",off:"normal",icon:ia(J1,{name:"italic"})},{property:"textDecoration",label:l?.underline??"Underline",pressed:r?.trim().toLowerCase().split(/\s+/).includes("underline")??!1,on:"underline",off:"none",icon:ia(J1,{name:"underline"})},{property:"textTransform",label:l?.uppercase??"Uppercase",pressed:a?.trim().toLowerCase()==="uppercase",on:"uppercase",off:"none",icon:ia(J1,{name:"uppercase"})}];return ia(la,{type:"multiple",label:e,id:t,options:i.map(s=>({...s,value:s.property})),value:i.filter(s=>s.pressed).map(s=>s.property),onChange:s=>{for(let u of i){let d=s.includes(u.property);d!==u.pressed&&n(u.property,d?u.on:u.off)}}})}var A5="textContent";var Qc=e=>e!=null&&typeof e=="object"&&"property"in e,Yc=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 Z5(e){let t=[],o=new Map,r=n=>{let l=Yc(n);if(!l)return;let{sourceFile:i,lineNumber:s,columnNumber:u}=l,d=`${i}\0${s}:${u}`,c=o.get(d);return c||(c={byProperty:new Map,baselineByProperty:new Map,mediaByAttribute:new Map,debugSource:l},o.set(d,c),t.push(c)),c},a=(n,l,i)=>{n.baselineByProperty.has(l)||n.baselineByProperty.set(l,String(i??""))};for(let n of e){let l=n.data;if(n.type==="style"&&l?.property!=null){let i=r(l);if(i){let s=String(l.property);a(i,s,n.oldValue),i.byProperty.set(s,String(n.newValue??""))}}else if(n.type==="style-batch"&&Array.isArray(l?.changes)){let i=r(l);for(let s of l.changes)if(i&&Qc(s)&&s.property!=null){let u=String(s.property);a(i,u,s.oldValue),i.byProperty.set(u,String(s.newValue??""))}}else if(n.type==="text")r(l)?.byProperty.set(A5,String(n.newValue??""));else if(n.type==="media"&&typeof l?.attribute=="string"&&l.attribute!==""){let i=r(l),s=String(n.newValue??""),u=i?.mediaByAttribute.get(l.attribute);u?u.value=s:i?.mediaByAttribute.set(l.attribute,{oldValue:String(n.oldValue??""),value:s})}}return t.map(n=>{let l=[...n.byProperty].map(([u,d])=>({property:u,value:d})).filter(u=>u.property===A5||u.value!==""||n.baselineByProperty.get(u.property)!==""),i=[...n.mediaByAttribute].filter(([,u])=>u.value!==u.oldValue).map(([u,d])=>({changeType:"attribute",attribute:u,value:d.value,oldValue:d.oldValue})),s=[...l,...i];return{debugSource:n.debugSource,commands:s}}).filter(n=>n.commands.length>0)}var bt={CHANGED:"history-changed",COMMAND_PUSHED:"command-pushed",COMMAND_UNDONE:"command-undone",COMMAND_REDONE:"command-redone",CLEARED:"history-cleared"},sa=class{constructor(t={}){Ht(this,"undoStack",[]);Ht(this,"redoStack",[]);Ht(this,"maxHistorySize");Ht(this,"listeners",new Set);Ht(this,"_isProcessing",!1);Ht(this,"commandExecutor");if(this.maxHistorySize=t.maxHistorySize??200,!t.commandExecutor)throw new Error("CommandExecutor is required");this.commandExecutor=t.commandExecutor}createCommand(t,o,r,a){return Object.freeze({id:this._generateCommandId(),type:t,oldValue:o,newValue:r,data:a})}_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 r=Object.freeze({type:t,timestamp:Date.now(),canUndo:this.canUndo(),canRedo:this.canRedo(),undoCount:this.getUndoCount(),redoCount:this.getRedoCount(),...o}),a=Array.from(this.listeners);for(let n of a)try{n(r)}catch(l){console.error("[HistoryManager] Error in listener:",l)}}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(bt.COMMAND_PUSHED,{command:t}),this._notify(bt.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(r){return console.error("[HistoryManager] Error applying command:",r,t),!1}}_createInverseCommand(t,o){let r=this.commandExecutor.getCurrentValue(t);return Object.freeze({id:this._generateCommandId(),type:t.type,oldValue:o?t.oldValue:r,newValue:o?r: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 r=this._createInverseCommand(t,!1);this.redoStack.push(r)}else this.undoStack.push(t),console.warn("[HistoryManager] Undo failed, command restored to stack");return this._notify(bt.COMMAND_UNDONE,{command:t,appliedValue:t.oldValue}),this._notify(bt.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 r=this._createInverseCommand(t,!0);this.undoStack.push(r),this._trimStack()}else this.redoStack.push(t),console.warn("[HistoryManager] Redo failed, command restored to stack");return this._notify(bt.COMMAND_REDONE,{command:t,appliedValue:t.newValue}),this._notify(bt.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(bt.CLEARED),this._notify(bt.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 Jc=(e,t)=>{let o=t?e.oldValue:e.newValue;return typeof o=="string"?o:String(o??"")},ua=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}},e8=e=>typeof e=="object"&&e!==null&&"property"in e&&typeof e.property=="string",t8=e=>typeof e=="object"&&e!==null&&Array.isArray(e.changes)&&e.changes.every(t=>t!=null&&typeof t.property=="string"),o8=e=>typeof e=="object"&&e!==null&&"tag"in e&&typeof e.tag=="string"&&"attribute"in e&&typeof e.attribute=="string",F5=(e,t,o)=>{let r=new Map;return{execute:(a,n)=>{let l=Jc(a,n);r.set(a.id,l);try{if(a.type==="style"&&e8(a.data)){let i=ua(a.data);return e(a.data.property,l,i),!0}else if(a.type==="style-batch"&&t8(a.data)){let i=ua(a.data);for(let s of a.data.changes)e(s.property,n?s.oldValue:s.newValue,i);return!0}else if(a.type==="text"){let i=ua(a.data);return t(l,i),!0}else if(a.type==="media"&&o8(a.data)){if(!o)return!1;let i=ua(a.data);return o(a.data.tag,{[a.data.attribute]:l},i),!0}}catch{return!1}return!1},getCurrentValue:a=>r.get(a.id)??a.newValue,canHandle:a=>a==="style"||a==="style-batch"||a==="text"||a==="media"&&typeof o=="function"}};function $5(e,t,o){let r=F5(e,t,o),a=new sa({commandExecutor:r});return{recordStyleChange(n,l,i,s){let u=a.createCommand("style",l,i,{...s,property:n});a.pushCommand(u)},recordStyleBatch(n,l){if(n.length===0)return;let i=n[0],s=a.createCommand("style-batch",i.oldValue,i.newValue,{...l,changes:n});a.pushCommand(s)},recordTextChange(n,l,i){let s=a.createCommand("text",n,l,{...i});a.pushCommand(s)},recordMediaChange(n,l,i,s,u){let d=a.createCommand("media",i,s,{...u,tag:n,attribute:l});a.pushCommand(d)},undo:()=>a.undo(),redo:()=>a.redo(),canUndo:()=>a.canUndo(),canRedo:()=>a.canRedo(),subscribe:n=>a.subscribe(n),getHistoryStack:()=>a.getUndoStackSnapshot(),clear:()=>a.clear(),getUndoCount:()=>a.getUndoCount(),getMaxHistorySize:()=>a.getMaxHistorySize()}}import da from"react";var r8=20,o2="design-mode:recent-colors:v1:",a8=r1("rgb");function fa(e){if(!Array.isArray(e))return[];let t=new Set,o=[];for(let r of e){if(typeof r!="string"||r.length>512||/^[\da-f]+$/i.test(r.trim()))continue;let a=z1(r);if(!a)continue;let n=a8(a),l=JSON.stringify([...[n.r,n.g,n.b].map(i=>Number((i??0).toFixed(12))),n.alpha??1]);if(!t.has(l)&&(t.add(l),o.push(r),o.length===r8))break}return o}function ca(e){if(!e)return[];let t;try{t=localStorage.getItem(o2+e)}catch{return}try{return fa(JSON.parse(t??"[]"))}catch{return[]}}function N5(e){let t=da.useRef([]),[o,r]=da.useState(()=>({applicationId:e,colors:ca(e)??[]})),a=o;o.applicationId!==e&&(t.current=[],a={applicationId:e,colors:ca(e)??[]},r(a));let n=da.useRef(a);n.current=a,da.useEffect(()=>{if(!e)return;let i=s=>{if(s.storageArea&&s.storageArea!==localStorage||s.key!==null&&s.key!==o2+e)return;let u=s.key===null||s.newValue===null;u&&(t.current=[]);let d={applicationId:e,colors:u?[]:fa([...t.current,...ca(e)??n.current.colors])};n.current=d,r(d)};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[e]);let l=i=>{let s=e?ca(e)??n.current.colors:n.current.colors,u=fa([i,...t.current,...s]),d={applicationId:e,colors:u};if(n.current=d,r(d),!!e)try{localStorage.setItem(o2+e,JSON.stringify(u)),t.current=[]}catch{t.current=fa([i,...t.current])}};return{recentColors:a.colors,recordColor:l}}var r2=`url\\(\\s*(['"]?)([^'")]+)\\1\\s*\\)`,n8=new RegExp(r2,"i");function pa(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function a2(e){let t=pa((e??"").trim());for(let o=0;o<t.length;o++){let r=t[o]??"",a=n8.exec(r);if(a?.[2])return{index:o,layer:r,path:a[2].trim()}}return null}var l8=new RegExp(r2,"i");function i8(e,t){let o=`url("${t}")`,r=(e??"").trim();if(!K1(r))return o;let a=a2(r),n=pa(r);return a?n.map((l,i)=>i===a.index?l.replace(l8,()=>o):l).join(", "):[o,...n].join(", ")}function s8(e){let t=(e??"").trim();if(!K1(t))return"none";let o=a2(t);if(!o)return t;let r=pa(t);return r.splice(o.index,1),r.length===0?"none":r.join(", ")}function U5(e,t){return t.trim()===""?s8(e):i8(e,t)}import{Fragment as l2,jsx as ie,jsxs as Ke}from"react/jsx-runtime";var ga=["top","right","bottom","left"];function i2(e,t,o){let r=$1[e];return r.some(a=>o?.[a]!=null)?Object.fromEntries(r.map((a,n)=>[ga[n],t[a]??""])):lt(t[e]??"")}function Ao(e,t){let o=ga.map(n=>t[n].trim().split(/\s+/)),r=e==="borderRadius";if(o.some(n=>n.length>(r?2:1)||n.some(l=>{let i=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(px|%)?$/i.exec(l);return!i||!Number.isFinite(Number(i[1]))||e!=="margin"&&Number(i[1])<0||(i[2]==="%"?!r:!i[2]&&Number(i[1])!==0)})))return;let a=o.map(n=>n[0]).join(" ");return r&&o.some(n=>n.length===2)?`${a} / ${o.map(n=>n[1]??n[0]).join(" ")}`:a}function ma(e,t,o){if((t==="fontFamily"||t==="fontWeight")&&o&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(o.trim())&&!/\bvar\(/i.test(o))return{...e,[t]:o};if(!(t in $1))return e;let r=lt(o);return{...e,[t]:o,...Object.fromEntries($1[t].map((a,n)=>[a,r[ga[n]]]))}}function q5(e,t,o){let r=ma(e,t,o);return t==="color"?{...r,webkitTextFillColor:o||e.color||""}:r}function G5(e,t,o){if(t===o)return!0;if(e!=="fontFamily")return!1;let r=a=>a.replace(/['"]/g,"").replace(/\s*,\s*/g,",");return r(t)===r(o)}function z5(e){let t=e?.trim()??"";return t.endsWith("px")&&a1(t.slice(0,-2))?Number(t.slice(0,-2)):void 0}function n2(e,t,o){let r=t[e];if(r==="normal"){let l=o[e]?.trim().toLowerCase()??"";return/^[+-]?(?:0+(?:\.0*)?|\.0+)(?:[a-z]+|%)?$/i.test(l)||l==="inherit"&&e==="letterSpacing"?"0":r}let a=z5(r);if(a===void 0)return"";if(e==="fontSize")return String(Number(a.toFixed(2)));let n=z5(t.fontSize);return n!==void 0&&n>0?String(Number((a/n).toFixed(e==="letterSpacing"?3:2))):""}var d8="Edit this element's text on the canvas.",c8="You can't edit this element's text because it contains dynamic content.",f8={opacity:.4},p8=new Set(v2),C8="designMode.imageSourceEditorEnabled",m8=!1;function g8(){try{let e=window.localStorage.getItem(C8);return e==null?void 0:e==="true"}catch{return}}var h8={general:{headerTitle:"Selected Element",emptyPlaceholder:"To edit an element, select it on the canvas.",inlineEditEditable:d8,inlineEditNonEditable:c8,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:"Typography"},instances:{imageSource:"Source",backgroundColor:"Background Color",padding:"Padding",margin:"Margin",borderRadius:"Border Radius",fontFamily:"Font Family",fontSize:"Font Size",fontWeight:"Font Style",textStyling:"Text Styling",textColor:"Text Color",textAlignment:"Text Alignment",lineHeight:"Line Height",letterSpacing:"Letter Spacing"},history:{changeLimitTitle:"You're at the edit limit",changeLimitBody:"To continue editing, save your changes."}};function j5(e,t){let o=e.get(t);return{baseStyles:o?.styles??et,baseComputed:o?.computedStyles??et,edits:o?.sessionEdits??new Set}}function v8({size:e=16}){return ie("svg",{width:e,height:e,viewBox:"-1 0 252 302",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:ie("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 x8({size:e=12}){return ie("svg",{width:e,height:e,viewBox:"0 0 12 12","aria-hidden":"true",style:{display:"block",flexShrink:0},children:ie("rect",{x:"1",y:"1",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2.5 2"})})}function L8(e,t){let o=e[t];return o!=null?String(o):""}function Ca(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 w8({component:e,onOpenSourceFile:t,showOpenSourceFile:o,showComponentName:r,generalLabels:a}){if(!e||!e.name)return ie("section",{id:"property-panel-selected-component",className:"property-panel-selected-component",children:ie("p",{className:"property-panel-selected-component-placeholder",id:"component-info",children:a.emptyPlaceholder})});let n=e.tagName?e.tagName.toLowerCase():"",l=n?`${e.name} > ${n}`:e.name,i=null;if(o&&e.debugSource){let{sourceFile:s,lineNumber:u,columnNumber:d}=e.debugSource,c=s.split("/").pop()||s,p=`:${u}:${d}`;i=Ke("a",{href:"#",className:"property-panel-selected-component-source",onClick:f=>{f.preventDefault(),t?.({sourceFile:s,lineNumber:u,columnNumber:d})},title:`${s}${p}`,children:[c,p]})}return!r&&!i?null:ie("section",{id:"property-panel-selected-component",className:"property-panel-selected-component","aria-label":a.ariaSelectedComponent,children:Ke("div",{id:"component-info",className:"property-panel-selected-component-info",children:[r&&ie("span",{className:"property-panel-selected-component-name",children:l}),i&&Ke("span",{className:"property-panel-selected-component-source-row",children:["\u21B3 ",i]})]})})}var I8=Ce.forwardRef(function({title:t,body:o},r){return Ke("section",{ref:r,role:"alert","aria-live":"assertive","aria-labelledby":"property-panel-change-limit-title",className:"property-panel-change-limit-message",tabIndex:-1,children:[ie("svg",{className:"property-panel-change-limit-icon",viewBox:"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:ie("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"})}),Ke("div",{className:"property-panel-change-limit-content",children:[ie("h2",{id:"property-panel-change-limit-title",className:"property-panel-change-limit-title",children:t}),ie("p",{className:"property-panel-change-limit-body",children:o})]})]})});function K5(e,t){let o=t==="src"?e.srcKind:e.altKind;if(o===void 0)return"not-editable";if(!(o==="literal"||t==="src"&&o==="asset-import"))return"from-data"}function b8({recentColors:e,onColorApplied:t,styles:o,computedStyles:r,measuredStyles:a,editorResetVersion:n,colorResetVersion:l,hasSelection:i,onStyleChange:s,onBoxSidesChange:u,generalLabels:d,sectionLabels:c,instanceLabels:p,editorLabels:g,component:f,onImageAttributeChange:M,imageSource:x,imageSourceEditorEnabled:w}){let h=i?"visible":"",S=f?.tagName?.toUpperCase()??"",H=f?.propertyEditorCapabilities??{text:!"IMG SVG CANVAS VIDEO AUDIO IFRAME OBJECT EMBED HR BR SCRIPT STYLE TEMPLATE".split(" ").includes(S),box:!["SCRIPT","STYLE","TEMPLATE","OPTION","OPTGROUP","SVG"].includes(S)},k=w&&f?.media?.tag==="img"?f.media:null,Z=w&&f?.media?.tag==="background-image"?f.media:null,V=I=>a?.[I]?.computed!=null?a:void 0,L=Ce.useMemo(()=>Object.fromEntries(Object.keys($1).map(I=>[I,i2(I,r,a)])),[r,a]);if(!i)return null;let y=o.backgroundImage||r.backgroundImage,R=o.backgroundClip||r.backgroundClip,_=R0(y??"",R??"","text"),N=_!=="",K=H0(y??"",R??""),z=Vn(y??"",R??""),W=K1(K)?"rgba(0, 0, 0, 0)":"#ffffff",F=I=>I0(I)?I:void 0,D=F(o.backgroundColor),B=F(r.backgroundColor),U=F(o.color),A=F(r.color),q=o.webkitTextFillColor||r.webkitTextFillColor,T=o.color||r.color,j=En(q,T),m=I=>{let P=o[I],C=a?.[I];return C&&G5(I,P??"",C.inline??"")&&C.computed?C.computed:P&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(P.trim())&&!/\bvar\(/i.test(P)?P:r[I]};return ie("section",{className:"property-panel-style-properties-container"+(h?" "+h:""),"aria-label":d.ariaElementStyling,"aria-hidden":!i,children:Ke("div",{className:"property-panel-style-properties",children:[H.text&&Ke(l2,{children:[Ke(nt,{title:c.typography,children:[ie(Ni,{label:p.fontFamily,id:"design-font-family",value:o.fontFamily,computedValue:r.fontFamily,onChange:I=>s("fontFamily",I),useInheritLabel:g?.dimension?.useInherit}),Ke("div",{className:"property-panel-typography-row",children:[ie(Ui,{label:p.fontWeight,id:"design-font-weight",value:o.fontWeight,computedValue:r.fontWeight,fontFamily:r.fontFamily,onChange:I=>s("fontWeight",I),optionLabels:g?.fontWeight?.options,useInheritLabel:g?.dimension?.useInherit}),ie(Pr,{label:p.fontSize,id:"design-font-size",value:o.fontSize,...Fo.fontSize,displayValue:n2("fontSize",r,o),measurement:V("fontSize"),resetVersion:n,onChange:I=>s("fontSize",I),aria:g?.dimension})]}),ie(_5,{label:p.textAlignment,id:"design-text-align",value:o.textAlign||r.textAlign,onChange:I=>s("textAlign",I),optionLabels:g?.textAlignment?.options}),ie(B5,{label:p.textStyling,id:"design-text-style",fontStyle:m("fontStyle"),textDecoration:m("textDecoration"),textTransform:m("textTransform"),onChange:s,optionLabels:g?.textStyle?.options}),Ke("div",{className:"property-panel-typography-row",children:[ie(Pr,{label:p.lineHeight,id:"design-line-height",value:o.lineHeight,...Fo.lineHeight,displayValue:n2("lineHeight",r,o),measurement:V("lineHeight"),resetVersion:n,onChange:I=>s("lineHeight",I),aria:g?.dimension}),ie(Pr,{label:p.letterSpacing,id:"design-letter-spacing",value:o.letterSpacing,...Fo.letterSpacing,displayValue:n2("letterSpacing",r,o),measurement:V("letterSpacing"),resetVersion:n,onChange:I=>s("letterSpacing",I),aria:g?.dimension})]})]}),ie(nt,{title:p.textColor,children:ie(_n,{label:p.textColor,recentColors:e,onColorApplied:t,value:j?q:U||A||(N?"rgba(0, 0, 0, 0)":"#000000"),onChange:I=>s("color",I),id:"design-text-color",aria:g?.color,resetVersion:l,backgroundImage:N?_:void 0})})]}),H.box&&Ke(l2,{children:[Ke(nt,{title:c.spacing,children:[ie(Uo,{label:p.padding,id:"design-padding",displayValue:r.padding??"",displaySides:L.padding,measurement:V("padding"),resetVersion:n,paired:!0,onSidesChange:I=>u("padding",I),aria:g?.boxDimension}),ie(Uo,{label:p.margin,id:"design-margin",displayValue:r.margin??"",displaySides:L.margin,measurement:V("margin"),resetVersion:n,paired:!0,onSidesChange:I=>u("margin",I),allowNegative:!0,aria:g?.boxDimension})]}),ie(nt,{title:c.background,children:ie(_n,{label:p.backgroundColor,recentColors:e,onColorApplied:t,value:z?"rgba(0, 0, 0, 0)":D||B||W,onChange:I=>s("backgroundColor",I),id:"design-bg-color",aria:g?.color,resetVersion:l,backgroundImage:K||void 0})}),ie(nt,{title:c.border,children:ie(Uo,{label:p.borderRadius,id:"design-border-radius",displayValue:r.borderRadius??"",displaySides:L.borderRadius,measurement:V("borderRadius"),resetVersion:n,onSidesChange:I=>u("borderRadius",I),uniform:!0,sideLabelKind:"corners",aria:g?.boxDimension})})]}),k&&ie(nt,{title:c.imageSource,children:ie($l,{label:p.imageSource,value:k.src,onChange:I=>M("src",I),id:"design-img-src",attributes:{alt:k.alt},onAttributeChange:M,sourceReadOnly:K5(k,"src"),altReadOnly:K5(k,"alt"),sharedCount:f?.instanceCount,imageLabels:g?.image,...x})}),Z&&ie(nt,{title:c.imageSource,children:ie($l,{label:p.imageSource,value:Z.src,onChange:I=>s("backgroundImage",U5(y,I)),id:"design-bg-img-src",imageLabels:g?.image,...x})})]})})}var W5=["padding","margin","backgroundColor","backgroundImage","backgroundClip","borderRadius","color","webkitTextFillColor","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform",...Object.values($1).flat()],et=Object.fromEntries(W5.map(e=>[e,""]));function yt(e,t,o,r,a=et){let n={...t};for(let l of W5){let i=e[l];r==="computed"&&(l==="fontFamily"||l==="fontWeight")&&o.has(l)&&!G5(l,a[l]??"",i?.inline??"")||(r==="computed"&&L2.has(l)?n[l]=i?.computed??"":i!=null&&(!o.has(l)||r==="computed"&&(x2.has(l)||a[l]===""&&(i.inline??"")===""))&&(n[l]=i[r]??t[l]??""))}if(r==="computed"){let l=Object.fromEntries(Object.entries(e).map(([s,u])=>[s,u.inline??""])),i=s=>{let u=s.trim().split(/\s+/).map(d=>`${Number.parseFloat(d)}${d.endsWith("%")?"%":"px"}`);return[u[0],u[1]??u[0]].join(" ")};for(let[s,u]of Object.entries($1)){if(!o.has(s))continue;let d=Ao(s,lt(a[s]??"")),c=document.createElement("div").style;c[s]=d??"";let p=lt(c[s]),g=i2(s,l,e);if(Ao(s,p)!==void 0&&Ao(s,g)!==void 0&&ga.every(f=>i(p[f])===i(g[f]))){u.some(f=>e[f]!=null)||(n=ma(n,s,n[s]??""));continue}for(let f of[s,...u])n[f]=t[f]??""}}return n}var X5=Ce.forwardRef(function(t,o){return ie(y8,{...t,ref:o},t.applicationId)}),y8=Ce.forwardRef(function(t,o){let{component:r,styles:a,onStyleChange:n,onTextChange:l,onHistoryStateChange:i,onAddToChatContext:s,onOpenSourceFile:u,onClose:d,onMediaChange:c,showAddToChatContext:p=!0,showOpenSourceFile:g=!0,compactHeader:f=!1,labels:M,imageSource:x,imageSourceEditorEnabled:w}=t,{recentColors:h,recordColor:S}=N5(t.applicationId),H=Ce.useMemo(()=>w??g8()??m8,[w]),k=M1(h8,M),[Z,V]=Ce.useState(()=>yt(a||{},et,new Set,"inline")),[L,y]=Ce.useState(()=>yt(a||{},et,new Set,"computed")),[R,_]=Ce.useState(()=>new Set),N=Ce.useRef(Z);N.current=Z;let K=Ce.useRef(L);K.current=L;let z=Ce.useRef(R);z.current=R;let W=Ce.useCallback(Y=>{Y.styles&&(N.current=Y.styles,V(Y.styles)),Y.computed&&(K.current=Y.computed,y(Y.computed)),Y.edits&&(z.current=Y.edits,_(Y.edits))},[]),F=Ce.useRef(a);F.current=a;let D=Ce.useRef(new Map),B=Ce.useRef(n);B.current=n;let U=Ce.useRef(l);U.current=l;let A=Ce.useRef(c);A.current=c;let q=Ce.useRef(null);q.current||(q.current=$5((Y,se,ue)=>B.current(Y,se,ue,!0),(Y,se)=>U.current?.(Y,se),(Y,se,ue)=>A.current?.(Y,se,ue)));let T=q.current,j=Ce.useRef(i);j.current=i;let[m,I]=Ce.useState(()=>T.getUndoCount()),[P,C]=Ce.useState(0),[$,v]=Ce.useState(0),b=T.getMaxHistorySize(),G=Ce.useRef("none");Ce.useEffect(()=>{let Y=ue=>{if(j.current?.({canUndo:ue.canUndo,canRedo:ue.canRedo}),I(ue.undoCount),!(ue.type==="command-undone"||ue.type==="command-redone"))return;let Ue=ue.type==="command-undone",Xe=ue.command?.data?.property,d1=ue.command?.data?.changes,A1=[];if(typeof Xe=="string"?A1=[[Xe,typeof ue.appliedValue=="string"?ue.appliedValue:""]]:Array.isArray(d1)&&(A1=d1.filter(Ie=>Ie!=null&&typeof Ie.property=="string").map(Ie=>[Ie.property,String((Ue?Ie.oldValue:Ie.newValue)??"")])),A1.length===0)return;let Z1=ue.command?.data,Ft=Z1&&typeof Z1.componentName=="string"?`${Z1.sourceFile??""}-${Z1.componentName}-${Z1.tagName??""}-${Z1.lineNumber??""}-${Z1.columnNumber??""}`:null;if(Ft!==null&&Ft!==G.current){let Ie=D.current.get(Ft);if(!Ie)return;let tt={...Ie.styles},St=Ie.computedStyles,Le=new Set(Ie.sessionEdits);for(let[ot,Rt]of A1)tt[ot]=Rt,St=q5(St,ot,Rt),Le.add(ot);D.current.set(Ft,{...Ie,styles:tt,computedStyles:St,sessionEdits:Le});return}C(Ie=>Ie+1),v(Ie=>Ie+1);let so={...N.current},Mt=K.current,F1=new Set(z.current);for(let[Ie,tt]of A1)so[Ie]=tt,Mt=q5(Mt,Ie,tt),F1.add(Ie);W({styles:so,computed:Mt,edits:F1})},se=T.subscribe(Y);return j.current?.({canUndo:T.canUndo(),canRedo:T.canRedo()}),I(T.getUndoCount()),se},[T,W]);let J=m>=b,oe=Ce.useRef(null),ce=Ce.useRef(!1);Ce.useEffect(()=>{J&&!ce.current&&oe.current?.focus(),ce.current=J},[J]),Ce.useImperativeHandle(o,()=>({undo:()=>T.undo(),redo:()=>T.redo(),clearHistory:Y=>{if(Y?.keepSelectedStyles||v(se=>se+1),C(se=>se+1),T.clear(),D.current.clear(),Y?.keepSelectedStyles){let se=F.current||{},ue=new Set;W({styles:yt(se,et,ue,"inline"),computed:yt(se,et,ue,"computed"),edits:new Set})}else W({styles:et,computed:et,edits:new Set});I(0)},getHistoryStack:()=>T.getHistoryStack(),getChangeSet:()=>Z5(T.getHistoryStack()),recordTextChange:(Y,se,ue)=>T.recordTextChange(Y,se,ue),canUndo:()=>T.canUndo(),canRedo:()=>T.canRedo()}),[T,W]);let he=r?`${r.debugSource?.sourceFile??""}-${r.name}-${r.tagName??""}-${r.debugSource?.lineNumber??""}-${r.debugSource?.columnNumber??""}`:"none";G.current=he;let Me=Ce.useRef("none");Ce.useEffect(()=>{let Y=Me.current,se,ue,Ve;he!==Y?(Y!=="none"&&(z.current.size>0?D.current.set(Y,{styles:N.current,computedStyles:K.current,sessionEdits:z.current}):D.current.delete(Y)),Me.current=he,{baseStyles:se,baseComputed:ue,edits:Ve}=j5(D.current,he)):(se=N.current,ue=K.current,Ve=z.current);let Ue=a||{};W({styles:yt(Ue,se,Ve,"inline"),computed:yt(Ue,ue,Ve,"computed",se),edits:Ve})},[he,a,W]);let we=he!==Me.current?j5(D.current,he):void 0,Te=we?yt(a||{},we.baseStyles,we.edits,"inline"):Z,De=we?yt(a||{},we.baseComputed,we.edits,"computed",we.baseStyles):L,Se=(Y,se)=>{let ue=i2(Y,K.current,F.current),Ve=Ao(Y,ue),Ue=Ao(Y,{...ue,...se});if(Ve===void 0||Ue===void 0)return!1;if(Ve===Ue)return!0;let Xe=new Set(z.current);return Xe.add(Y),W({styles:{...N.current,[Y]:Ue},computed:ma(K.current,Y,Ue),edits:Xe}),T.recordStyleChange(Y,Ve,Ue,Ca(r)),n(Y,Ue,r?.debugSource),!0},b1=Ce.useCallback((Y,se)=>{let ue=L8(N.current,Y),Ve=Ca(r),Ue=r?.debugSource?{sourceFile:r.debugSource.sourceFile,lineNumber:r.debugSource.lineNumber,columnNumber:r.debugSource.columnNumber}:void 0,Xe=N.current.backgroundImage||K.current.backgroundImage||"",d1=N.current.backgroundClip||K.current.backgroundClip||"",A1=Vn(Xe,d1),Z1=N.current.color||K.current.color||"",Ft=!!N.current.webkitTextFillColor?.trim(),so={property:"webkitTextFillColor",isOccluding:Le=>En(Le,Z1,Ft),resetValue:"currentcolor"},Mt=[];Y==="backgroundColor"?Mt=A1?[so]:[]:Y==="color"&&(Mt=[so]);let F1=Mt.flatMap(({property:Le,isOccluding:ot,resetValue:Rt})=>E0(se,Le,K.current[Le],N.current[Le],ot,Rt)),Ie=(Le,ot,Rt)=>{Rt!==ot&&F1.push({property:Le,oldValue:ot,newValue:Rt})};if(se.trim()!==""&&(K1(Xe)||A1))if(Y==="backgroundColor"){let Le=A1?V0(Xe,d1):d1;Ie("backgroundClip",d1,Le),Ie("backgroundImage",Xe,T0(Xe,Le))}else Y==="color"&&Ie("backgroundImage",Xe,P0(Xe,d1));n(Y,se,Ue);for(let Le of F1)n(Le.property,Le.newValue,Ue);F1.length===0?T.recordStyleChange(Y,ue,se,Ve):T.recordStyleBatch([{property:Y,oldValue:ue,newValue:se},...F1.map(Le=>({property:Le.property,oldValue:Le.oldValue,newValue:Le.newValue}))],Ve);let tt={...N.current,[Y]:se};for(let Le of F1)tt[Le.property]=Le.newValue;W({styles:tt,computed:ma(K.current,Y,se)}),Y==="color"&&y(Le=>({...Le,webkitTextFillColor:se}));let St=new Set(z.current);St.add(Y);for(let Le of F1)St.add(Le.property);W({edits:St})},[n,T,r,W]),Ne=Ce.useCallback((Y,se)=>{let ue=r?.media;if(!ue)return;let Ve=r?.debugSource;c?.(ue.tag,{[Y]:se},Ve);let Ue=String(ue[Y]??"");T.recordMediaChange(ue.tag,Y,Ue,se,Ca(r))},[r,c,T]),Oe=!!(r&&r.name),re=Ce.useCallback(()=>{let Y=Ca(r);Y&&s?.(Y)},[r,s]),Ge=Oe&&r&&r.tagName&&p8.has(r.tagName.toUpperCase()),He=r?.hasNonEditableText?k.general.inlineEditNonEditable:k.general.inlineEditEditable,C1=r?.tagName?r.tagName.toLowerCase():r?.name,y1=Ce.useRef(null),e1=Ce.useRef(null);return Ce.useLayoutEffect(()=>{let Y=e1.current,se=y1.current;if(!Y||Y.isConnected||!se)return;let ue=se.getRootNode(),Ve=se.ownerDocument.activeElement,Ue=ue instanceof ShadowRoot?ue.host:null,Xe=!1;if(Ve?.tagName==="IFRAME")try{let d1=Ve.contentDocument;Xe=!!(d1&&(!d1.activeElement||d1.activeElement===d1.body))}catch{}(Ve===se.ownerDocument.body||Ve===Ue&&!ue.activeElement||Xe)&&se.focus(),e1.current=null}),Ke("div",{ref:y1,tabIndex:-1,onFocusCapture:Y=>{e1.current=Y.target},role:"complementary","aria-label":k.general.ariaPropertyPanel,className:"property-panel-container",children:[Ke("header",{className:f?"property-panel-header property-panel-header-compact":"property-panel-header",children:[f?Oe&&Ke("span",{className:"property-panel-selected-pill",children:[ie(x8,{size:12}),ie("span",{className:"property-panel-selected-pill-tag",children:C1})]}):ie("h2",{id:"design-property-panel-title",className:"property-panel-title",children:k.general.headerTitle}),(Oe||d)&&Ke("div",{className:"property-panel-header-actions",children:[Oe&&Ke(l2,{children:[Ge&&ie("span",{className:"property-panel-selected-component-action property-panel-selected-component-action-help","data-tooltip":He,"aria-label":He,children:ie(p2,{width:14,height:14,style:r.hasNonEditableText?f8:void 0})}),p&&!J&&ie("button",{type:"button",className:"property-panel-selected-component-action",onClick:re,"data-tooltip":k.general.addToChatContext,"aria-label":k.general.addToChatContext,children:ie(v8,{size:14})})]}),d&&ie("button",{type:"button",className:"property-panel-selected-component-action property-panel-close",onClick:d,"data-tooltip":k.general.closePanel,"aria-label":k.general.closePanel,children:ie(d2,{width:14,height:14,"aria-hidden":"true"})})]})]}),Ke("div",{className:"property-panel-content","aria-labelledby":f?void 0:"design-property-panel-title",children:[ie(w8,{component:r,onOpenSourceFile:u,showOpenSourceFile:g,showComponentName:!f,generalLabels:k.general}),J?ie(I8,{ref:oe,title:k.history.changeLimitTitle,body:k.history.changeLimitBody}):ie(b8,{recentColors:h,onColorApplied:S,editorResetVersion:P,colorResetVersion:$,styles:Te,computedStyles:De,measuredStyles:a,hasSelection:Oe,onStyleChange:b1,onBoxSidesChange:Se,generalLabels:k.general,sectionLabels:k.sections,instanceLabels:k.instances,editorLabels:M?.editors,component:r,onImageAttributeChange:Ne,imageSource:x,imageSourceEditorEnabled:H},he)]})]})});function M8(e,t,o){if(!e)return;u8(e).render(Ce.createElement(X5,{...t,ref:o}))}export{X5 as DesignPropertyPanel,w2 as REQUIRED_LABEL_KEYS,Re as interpolate,M8 as mountDesignPropertyPanel,vs as validateLabels};
5
5
  /*! Bundled license information:
6
6
 
7
7
  react-is/cjs/react-is.production.min.js: