1"use strict";(self.rspackChunkcircle=self.rspackChunkcircle||[]).push([[18608],{582021(r,e,t){function n(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var o=/^var\(--([^)]+)\)$/,a=function(r){var e=r.value,t=r.cssVariables,l=r.visitedVars,i=void 0===l?new Set:l;if(!e)return e;var u=o.exec(e);if(!u)return e;var c=(function(r){if(Array.isArray(r))return r}(u)||function(r){var e,t,n=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var o=[],a=!0,l=!1;try{for(n=n.call(r);!(a=(e=n.next()).done)&&(o.push(e.value),2!==o.length);a=!0);}catch(r){l=!0,t=r}finally{try{a||null==n.return||n.return()}finally{if(l)throw t}}return o}}(u)||function(r){if(r){if("string"==typeof r)return n(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return n(r,2)}}(u)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];if(i.has(c))return console.warn('Circular reference detected for CSS variable "'.concat(c,'"')),e;var s=t[c];if(!s)return console.warn('CSS variable "'.concat(c,'" not found in cssVariables')),e;var f=new Set(i);return f.add(c),o.test(s)?a({value:s,cssVariables:t,visitedVars:f}):s};t.d(e,{q:()=>a})},490825(r,e,t){t.d(e,{R:()=>ry,U:()=>rm});var n=t(391426),o=t(451430),a=t(933578),l=t(417980),i=t(674251),u=t(428266),c=(0,a.createContext)(void 0);c.displayName="PickerContext";var s=function(r){var e=r.initialColor,t=void 0===e?"#123123":e,o=r.onColorChange,l=r.popperOptions,i=void 0===l?[]:l,u=r.themeColors,s=r.customColors,f=r.currentView,p=r.setCurrentView,b=r.shouldRenderThemeColors,d=void 0!==b&&b,y=r.onAddCustomColor,m=r.children,v=r.cssVariables,h=(0,a.useMemo)(function(){return{initialColor:t,onColorChange:o,popperOptions:i,themeColors:u,customColors:s,currentView:f,setCurrentView:p,shouldRenderThemeColors:d,onAddCustomColor:y,cssVariables:v}},[t,o,i,u,s,f,p,d,y,v]);return(0,n.jsx)(c.Provider,{value:h,children:m})},f=function(){var r=(0,a.useContext)(c);if(void 0===r)throw Error("usePickerContext must be used within a PickerProvider");return r},p=(0,a.createContext)({onClose:o.noop});p.displayName="PopoverPortalContext";var b=function(){return(0,a.useContext)(p)},d=function(){var r=f(),e=r.currentView,t=r.setCurrentView,o=r.shouldRenderThemeColors,a=b().onClose,c=e===ry.THEME_COLORS?(0,l.t)("color_picker_v2.color_picker"):(0,l.t)("color_picker_v2.custom_color");return(0,n.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,n.jsx)(i.o.LabelMd,{color:"text-dark",children:c}),(0,n.jsx)(u.K,{name:"16-close-v2",buttonSize:24,iconSize:16,ariaLabel:(0,l.t)("close"),onClick:function(){a(),o&&t(ry.THEME_COLORS)}})]})},y=t(235685),m=t(292365),v=t(387099),h=t(288513),g=t(568316),j=t(570310);let x=t.p+"static/react/components/shared/ColorPickerV2/checkerboard-pattern-196732249639f09d.png";var O=t(551842),C=t(973646),w=function(){var r=f().setCurrentView;return(0,n.jsx)("button",{type:"button",className:"bg-secondary border-primary flex size-6 items-center justify-center rounded-full border border-dashed",onClick:function(){return r(ry.PICKER)},children:(0,n.jsx)(C.In,{type:"plus"})})},S=function(r){var e;return null!=(e=null==r?void 0:r.startsWith("var("))&&e};function P(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var k=function(r){var e=r.isThemeColorsSwatches,t=void 0!==e&&e,o=f(),a=o.customColors,l=o.themeColors,i=o.initialColor,u=o.onColorChange,c=t?l:a;if(!c)return null;var s=t?function(r,e){e.preventDefault(),S(r)&&(null==u||u(r))}:function(r,e){e.preventDefault();try{var t=m.lr.convert("hex",r);null==u||u(t.hex)}catch(e){console.warn("Failed to convert color: ".concat(r)),null==u||u(r)}},p=Object.entries(c).map(function(r){var e=function(r){if(Array.isArray(r))return r}(r)||function(r){var e,t,n=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var o=[],a=!0,l=!1;try{for(n=n.call(r);!(a=(e=n.next()).done)&&(o.push(e.value),2!==o.length);a=!0);}catch(r){l=!0,t=r}finally{try{a||null==n.return||n.return()}finally{if(l)throw t}}return o}}(r)||function(r){if(r){if("string"==typeof r)return P(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return P(r,2)}}
1(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],o=e[1];return{key:n,displayValue:t?n:o}});return(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[p.map(function(r){var e=r.key,o=r.displayValue,a=i===o||i===c[o];return(0,n.jsx)("button",{type:"button",style:{backgroundColor:o,backgroundImage:(0,O.K)(o)?"url(".concat(x,")"):""},title:o,className:(0,j.x)("border bg-cover",{"border-darkest border-2":a,"border-primary":!a,"h-8 w-8 rounded-md":t,"h-6 w-6 rounded-full":!t}),"aria-label":o,onClick:function(r){return s(o,r)}},e)}),!t&&(0,n.jsx)(w,{})]})},A=function(){return f().customColors?(0,n.jsxs)("div",{className:"flex w-full flex-col items-start justify-start gap-2",children:[(0,n.jsx)(g.o.LabelXs,{weight:"semibold",children:(0,l.t)("color_picker_v2.theme_picker.my_colors")}),(0,n.jsx)(k,{})]}):null},E=function(){return f().themeColors?(0,n.jsxs)("div",{className:"flex w-full flex-col items-start justify-start gap-2",children:[(0,n.jsx)(g.o.LabelXs,{weight:"semibold",children:(0,l.t)("color_picker_v2.theme_picker.theme_colors")}),(0,n.jsx)(k,{isThemeColorsSwatches:!0})]}):null};function I(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function N(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var T=function(){var r=f().cssVariables,e=r?Object.entries(r).reduce(function(r,e){var t,n,o=function(r){if(Array.isArray(r))return r}(e)||function(r){var e,t,n=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var o=[],a=!0,l=!1;try{for(n=n.call(r);!(a=(e=n.next()).done)&&(o.push(e.value),2!==o.length);a=!0);}catch(r){l=!0,t=r}finally{try{a||null==n.return||n.return()}finally{if(l)throw t}}return o}}(e)||function(r){if(r){if("string"==typeof r)return I(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return I(r,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],l=o[1];return t=function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(e){N(r,e,t[e])})}return r}({},r),n=null!=(n=N({},"--".concat(a),l))?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(r){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e.push.apply(e,t)}return e})(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}),t},{}):{};return(0,n.jsxs)("div",{className:"mt-3 flex w-full flex-col items-start justify-start gap-4",style:e,children:[(0,n.jsx)(E,{}),(0,n.jsx)(A,{})]})},_=t(529648),M=t(922896);function D(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var V=function(r){var e;return{r:(0,o.round)(r.rgb.r),g:(0,o.round)(r.rgb.g),b:(0,o.round)(r.rgb.b),a:(0,o.round)(null!=(e=r.rgb.a)?e:1,1)}},R=function(r){var e;return{h:(0,o.round)(r.hsv.h),s:(0,o.round)(r.hsv.s),v:(0,o.round)(r.hsv.v),a:(0,o.round)(null!=(e=r.hsv.a)?e:1,1)}},L=function(r){var e=r.value,t=r.onChange,o=r.min,a=r.max,l=r.step;return(0,n.jsx)("input",{type:"number",value:e,onChange:function(r){var e=Number(r.target.value);Number.isNaN(e)||t(e)},min:o,max:a,step:void 0===l?1:l,className:"border-primary bg-primary text-dark group-hover:border-darkest focus:border-darkest group-focus-within:border-darkest w-1/4 rounded-md border px-2 py-1 text-center [appearance:textfield] focus:!outline-none focus:!ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"})};function $(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function U(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}
1var H=(0,a.memo)(function(r){var e,t=r.color,l=r.setColor,i=function(r){if(Array.isArray(r))return r}(e=(0,a.useState)(R(t)))||function(r){var e,t,n=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var o=[],a=!0,l=!1;try{for(n=n.call(r);!(a=(e=n.next()).done)&&(o.push(e.value),2!==o.length);a=!0);}catch(r){l=!0,t=r}finally{try{a||null==n.return||n.return()}finally{if(l)throw t}}return o}}(e)||function(r){if(r){if("string"==typeof r)return $(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return $(r,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=i[0],c=i[1],s=(0,a.useRef)(null),f=(0,a.useCallback)(function(r){var e=(0,M.Mj)({h:r.h,s:r.s,v:r.v,a:r.a}).toHsv();l(m.lr.convert("hsv",e))},[l]);(0,a.useEffect)(function(){return s.current=(0,o.debounce)(f,500),function(){s.current&&s.current.cancel()}},[f]);var p=(0,a.useCallback)(function(r,e){c(function(t){var n,o,a=(n=function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(e){U(r,e,t[e])})}return r}({},t),o=null!=(o=U({},r,e))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(r){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e.push.apply(e,t)}return e})(Object(o)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(o,r))}),n);return s.current&&s.current(a),a})},[]);return(0,a.useEffect)(function(){c(R(t))},[t]),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(L,{value:u.h,onChange:function(r){return p("h",r)},min:0,max:360},"h"),(0,n.jsx)(L,{value:u.s,onChange:function(r){return p("s",r)},min:0,max:100},"s"),(0,n.jsx)(L,{value:u.v,onChange:function(r){return p("v",r)},min:0,max:100},"v"),(0,n.jsx)(L,{value:u.a,onChange:function(r){return p("a",r)},min:0,max:1,step:.01},"a")]})});function z(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function K(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}H.displayName="HSVInput";var B=(0,a.memo)(function(r){var e,t=r.color,l=r.setColor,i=function(r){if(Array.isArray(r))return r}(e=(0,a.useState)(V(t)))||function(r){var e,t,n=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var o=[],a=!0,l=!1;try{for(n=n.call(r);!(a=(e=n.next()).done)&&(o.push(e.value),2!==o.length);a=!0);}catch(r){l=!0,t=r}finally{try{a||null==n.return||n.return()}finally{if(l)throw t}}return o}}(e)||function(r){if(r){if("string"==typeof r)return z(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return z(r,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=i[0],c=i[1],s=(0,a.useRef)(null),f=(0,a.useCallback)(function(r){var e=(0,M.Mj)(r).toRgb();l(m.lr.convert("rgb",e))},[l]);(0,a.useEffect)(function(){return s.current=(0,o.debounce)(f,500),function(){s.current&&s.current.cancel()}},[f]);var p=(0,a.useCallback)(function(r,e){c(function(t){var n,o,a=(n=function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}
1))),n.forEach(function(e){K(r,e,t[e])})}return r}({},t),o=null!=(o=K({},r,e))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(r){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e.push.apply(e,t)}return e})(Object(o)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(o,r))}),n);return s.current&&s.current(a),a})},[]);return(0,a.useEffect)(function(){c(V(t))},[t]),(0,n.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,n.jsx)(L,{value:u.r,onChange:function(r){return p("r",r)},min:0,max:255},"r"),(0,n.jsx)(L,{value:u.g,onChange:function(r){return p("g",r)},min:0,max:255},"g"),(0,n.jsx)(L,{value:u.b,onChange:function(r){return p("b",r)},min:0,max:255},"b"),(0,n.jsx)(L,{value:u.a,onChange:function(r){return p("a",r)},min:0,max:1,step:.01},"a")]})});B.displayName="RGBInput";var W={hex:function(r){var e,t=r.color,l=r.setColor,i=function(r){if(Array.isArray(r))return r}(e=(0,a.useState)(t.hex))||function(r){var e,t,n=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var o=[],a=!0,l=!1;try{for(n=n.call(r);!(a=(e=n.next()).done)&&(o.push(e.value),2!==o.length);a=!0);}catch(r){l=!0,t=r}finally{try{a||null==n.return||n.return()}finally{if(l)throw t}}return o}}(e)||function(r){if(r){if("string"==typeof r)return D(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return D(r,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=i[0],c=i[1],s=(0,a.useRef)(null),f=(0,a.useCallback)(function(r){(0,M.Mj)(r).isValid()?l(m.lr.convert("hex",r)):console.warn("Invalid hex value",r)},[l]);(0,a.useEffect)(function(){return s.current=(0,o.debounce)(f,500),function(){s.current&&s.current.cancel()}},[f]);var p=(0,a.useCallback)(function(r){var e=r.target.value.trim();c(e),s.current&&s.current(e)},[]);return(0,a.useEffect)(function(){c(t.hex)},[t.hex]),(0,n.jsx)("div",{className:"flex flex-col items-center",children:(0,n.jsx)("input",{type:"text",value:u,onChange:p,className:"border-primary bg-primary text-dark group-hover:border-darkest focus:border-darkest group-focus-within:border-darkest w-full appearance-none rounded-md border px-2 py-1 text-center focus:!outline-none focus:!ring-0","data-testid":"color-picker-hex-input"})})},rgb:B,hsv:H},F={modifiers:[{name:"offset",options:{offset:[8,8]}}]},X=function(r){var e=r.model,t=r.onChange;return(0,n.jsxs)(_.ms,{size:"small",className:"border-primary bg-primary text-dark group-hover:border-darkest focus:border-darkest group-focus-within:border-darkest appearance-none rounded-md border px-2 py-1 text-center uppercase focus:!outline-none focus:!ring-0",menuItemsClassName:"!p-2",popperOptions:F,button:(0,n.jsxs)(_.ms.MenuButton,{className:"flex w-full items-center justify-between !py-0",children:[(0,n.jsx)(g.o.LabelSm,{textTransform:"uppercase",children:e}),(0,n.jsx)(C.In,{type:"12-chevron-down",size:12})]}),children:[(0,n.jsx)(_.ms.ItemWithLink,{onClick:function(){return t("hex")},children:(0,n.jsx)(g.o.LabelSm,{textTransform:"uppercase",children:(0,l.t)("color_picker_v2.hex")})}),(0,n.jsx)(_.ms.ItemWithLink,{onClick:function(){return t("rgb")},children:(0,n.jsx)(g.o.LabelSm,{textTransform:"uppercase",children:(0,l.t)("color_picker_v2.rgb")})}),(0,n.jsx)(_.ms.ItemWithLink,{onClick:function(){return t("hsv")},children:(0,n.jsx)(g.o.LabelSm,{textTransform:"uppercase",children:(0,l.t)("color_picker_v2.hsv")})})]})};function q(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function G(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t,n,o=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(r);!(l=(t=o.next()).done)&&(a.push(t.value),!e||a.length!==e);l=!0);}catch(r){i=!0,n=r}finally{try{l||null==o.return||o.return()}finally{if(i)throw n}}return a}}(r,e)||function(r,e){if(r){if("string"==typeof r)return q(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if("Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return q(r,e)}}
1(r,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var J=function(r){var e=r.value,t=void 0===e?100:e,o=r.onChange,l=G((0,a.useState)("".concat(t,"%")),2),i=l[0],u=l[1],c=G((0,a.useState)(!1),2),s=c[0],f=c[1];return(0,a.useEffect)(function(){s||u("".concat(t,"%"))},[t,s]),(0,n.jsx)("input",{type:"text",value:i,onChange:function(r){u(r.target.value)},onFocus:function(r){f(!0),u(r.target.value.replace("%",""))},onBlur:function(r){f(!1);var e=parseFloat(r.target.value);e=isNaN(e)?t:Math.max(0,Math.min(100,e)),u("".concat(e,"%")),o(e)},className:"border-primary bg-primary text-dark group-hover:border-darkest focus:border-darkest group-focus-within:border-darkest w-full rounded-md border px-2 py-1 text-center [appearance:textfield] focus:!outline-none focus:!ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"})};function Q(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Y(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(e){var n;n=t[e],e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n})}return r}function Z(r,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):(function(r){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e.push.apply(e,t)}return e}
1)(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r}function rr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t,n,o=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(r);!(l=(t=o.next()).done)&&(a.push(t.value),!e||a.length!==e);l=!0);}catch(r){i=!0,n=r}finally{try{l||null==o.return||o.return()}finally{if(i)throw n}}return a}}(r,e)||function(r,e){if(r){if("string"==typeof r)return Q(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if("Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Q(r,e)}}(r,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var re=function(r){var e=r.shouldShowAlpha,t=void 0===e||e,o=r.shouldShowThemeColors,i=r.useCompassColorPicker,u=f(),c=u.initialColor,s=void 0===c?"#000000":c,p=u.onColorChange,d=u.onAddCustomColor,g=u.currentView,j=u.setCurrentView,x=u.themeColors,O=u.shouldRenderThemeColors,C=(0,a.useCallback)(function(r){return S(r)&&x?x[r]||"#000000":r},[x]),w=b().onClose,P=rr((0,m.by)(C(s)),2),k=P[0],A=P[1],E=rr((0,a.useState)("hex"),2),I=E[0],N=E[1],_=(0,a.useRef)(k),M=rr((0,a.useState)("#000000"),2),D=M[0],V=M[1];(0,a.useEffect)(function(){var r=C(s);A(m.lr.convert("hex",r));try{var e=m.lr.convert("hex",r),t=e.rgb.a<1?m.lr.convert("rgb",e.rgb).hex:e.hex;V(t)}catch(r){V("#000000")}},[s,A,C]);var R=W[I];return void 0!==i&&i?g===ry.THEME_COLORS?(0,n.jsx)(T,{}):(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsx)(y.s,{value:D,onChange:function(r){return V(r)},supportTransparency:t,className:"w-full max-w-full","aria-label":(0,l.t)("color_picker_v2.custom_color")}),(0,n.jsx)("div",{className:"flex w-full justify-end",children:(0,n.jsx)(v.$,{variant:"circle",type:"button",onClick:function(){null==p||p(D),null==d||d(D),O?j(ry.THEME_COLORS):w()},small:!0,children:(0,l.t)("save")})})]}):(0,n.jsxs)("div",{className:(0,h._h)("color-picker--v2-revamp"),children:[(0,n.jsx)("div",{className:"w-[264px]",children:(0,n.jsx)(m.sk,{color:k,onChange:function(r){A(r),_.current=r},height:157,hideInput:!0})}),(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsx)("div",{children:R&&(0,n.jsx)(R,{color:k,setColor:function(r){A(r),_.current=r}})}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsx)(X,{model:I,onChange:function(r){N(r)}}),t&&(0,n.jsx)(J,{value:void 0!=k.rgb.a?Math.round(100*k.rgb.a):100,onChange:function(r){var e=r/100,t=Z(Y({},k),{rgb:Z(Y({},k.rgb),{a:e}),hsv:Z(Y({},k.hsv),{a:e}),hex:k.hex});A(t),_.current=t}})]})]}),void 0!==o&&o&&(0,n.jsx)(T,{}),(0,n.jsx)("div",{className:"flex w-full justify-end",children:(0,n.jsx)(v.$,{variant:"circle",type:"button",onClick:function(){null==p||p(_.current.hex),null==d||d(_.current.hex),O?j(ry.THEME_COLORS):w()},small:!0,children:(0,l.t)("save")})})]})},rt=t(790389),rn=t(268342),ro=t(532786),ra=t(574795),rl=t(982607),ri=t(231127);function ru(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function rc(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(e){var n;n=t[e],e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n})}return r}function rs(r,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):(function(r){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e.push.apply(e,t)}return e}
1)(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r}function rf(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t,n,o=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(r);!(l=(t=o.next()).done)&&(a.push(t.value),!e||a.length!==e);l=!0);}catch(r){i=!0,n=r}finally{try{l||null==o.return||o.return()}finally{if(i)throw n}}return a}}(r,e)||rp(r,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rp(r,e){if(r){if("string"==typeof r)return ru(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if("Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ru(r,e)}}var rb=function(r){var e,t=r.children,o=r.popoverButtonClassName,l=r.popoverPanelClassName,i=r.popperPlacement,u=r.useCompassPopover,c=void 0!==u&&u,s=(0,rn.r)(),b=f(),d=b.initialColor,y=void 0===d?"#000000":d,v=b.popperOptions,h=rf((0,m.by)(y.startsWith("var(")?"#000000":y),2),g=h[0],C=h[1],w=rf((0,a.useState)(null),2),S=w[0],P=w[1],k=rf((0,a.useState)(null),2),A=k[0],E=k[1],I=(0,ri.T)("circle_v4_popover_enabled"),N=rf((0,a.useState)(!1),2),T=N[0],_=N[1],M=y.startsWith("var("),D=(0,rl.E)(S,A,{placement:void 0===i?"bottom-start":i,modifiers:[{name:"offset",options:{offset:[0,8]}}].concat(function(r){if(Array.isArray(r))return ru(r)}(e=void 0===v?[]:v)||function(r){if("u">typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(e)||rp(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),V=D.styles,R=D.attributes;(0,a.useEffect)(function(){M||C(m.lr.convert("hex",y))},[y,C,M]);var L=M?y:g.hex;if(!I&&!c)return(0,n.jsx)(ro.A,{as:"div",className:"relative flex",children:function(r){var e,a=r.open,i=r.close,u=null!=(e=null==s?void 0:s.portalContainer)?e:document.body;return(0,n.jsxs)(p.Provider,{value:{open:a,onClose:i},children:[(0,n.jsx)(ro.A.Button,{ref:P,className:(0,j.x)("size-7 rounded-md border border-primary","bg-contain font-bold transition-colors duration-200 focus-visible:!outline focus-visible:!outline-2 focus-visible:!outline-offset-2 focus-visible:!outline-secondary",o),style:{backgroundColor:L,backgroundImage:(0,O.K)(L)?"url(".concat(x,")"):""},"data-testid":"color-picker-v2"}),(0,ra.createPortal)((0,n.jsx)(ro.A.Panel,rs(rc({ref:E,style:rs(rc({},V.popper),{pointerEvents:"auto"})},R.popper),{className:(0,j.x)("z-[9999] flex w-[20rem] flex-col items-center justify-center rounded-md border border-primary bg-primary pb-4 shadow-2xl",l),children:t})),u)]})}});var $=(0,n.jsx)("button",{type:"button",ref:P,className:(0,j.x)("size-7 rounded-md border border-primary","bg-contain font-bold transition-colors duration-200 focus-visible:!outline focus-visible:!outline-2 focus-visible:!outline-offset-2 focus-visible:!outline-secondary",o),style:{backgroundColor:L,backgroundImage:(0,O.K)(L)?"url(".concat(x,")"):""},"data-testid":"color-picker-v2"});return(0,n.jsx)(p.Provider,{value:{open:T,onClose:function(){return _(!1)}},children:(0,n.jsx)(rt.A,{trigger:$,open:T,onOpenChange:_,side:"bottom",align:c?"end":"start",sideOffset:8,className:(0,j.x)("w-[20rem]",l),children:(0,n.jsx)("div",{className:"flex flex-col gap-3",children:t})})})};function rd(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var ry={PICKER:"picker",THEME_COLORS:"themeColors"},rm=function(r){var e,t,l,i=r.initialColor,u=r.onColorChange,c=r.popperOptions,f=r.shouldRenderThemeColors,p=void 0!==f&&f,b=r.shouldShowAlpha,y=r.useCompassColorPicker,m=void 0!==y&&y,v=r.themeColors,h=r.customColors,g=r.cssVariables,j=r.onAddCustomColor,x=r.popoverButtonClassName,O=r.popoverPanelClassName,C=r.popperPlacement,w=p?ry.THEME_COLORS:ry.PICKER,S=function(r){if(Array.isArray(r))return r}(e=(0,a.useState)(w))||function(r){var e,t,n=null==r?null:"u">typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var o=[],a=!0,l=!1;try{for(n=n.call(r);!(a=(e=n.next()).done)&&(o.push(e.value),2!==o.length);a=!0);}catch(r){l=!0,t=r}finally{try{a||null==n.return||n.return()}finally{if(l)throw t}}return o}}(e)||function(r){if(r){if("string"==typeof r)return rd(r,2);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rd(r,2)}}
1(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),P=S[0],k=S[1],A=p&&!(0,o.isEmpty)(v);return(0,n.jsx)(s,(t=function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(e){var n;n=t[e],e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n})}return r}({},{initialColor:i,onColorChange:u,popperOptions:c,themeColors:v,customColors:h,currentView:P,setCurrentView:k,shouldRenderThemeColors:p,onAddCustomColor:j,cssVariables:g}),l=l={children:(0,n.jsxs)(rb,{popoverButtonClassName:x,popoverPanelClassName:O,popperPlacement:C,useCompassPopover:m,children:[(0,n.jsx)(d,{}),(0,n.jsx)(re,{shouldShowAlpha:void 0===b||b,shouldShowThemeColors:A,useCompassColorPicker:m})]})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):(function(r){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e.push.apply(e,t)}return e}
1)(Object(l)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(l,r))}),t))}},551842(r,e,t){var n=t(922896),o=function(r){if(!r||r.startsWith("var("))return!1;try{var e=(0,n.Mj)(r);return 0===e.alpha()}catch(r){return!1}};t.d(e,{K:()=>o})}}]); 2//# sourceMappingURL=/packs/js/18608-87f816eb1722319b.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.