UNPKG

@gbm-tech/select

Version:

GBM Tech & Control - Select

911 lines (883 loc) 286 kB
import * as React from 'react'; import React__default, { createContext, useMemo, createElement, useContext, useCallback, forwardRef, Children, isValidElement, cloneElement, Fragment, useEffect, useRef, useState, useLayoutEffect } from 'react'; import * as ReactDOM from 'react-dom'; import ReactDOM__default, { flushSync, createPortal } from 'react-dom'; function unwrapExports$1 (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function createCommonjsModule$1(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var _extends_1$1 = createCommonjsModule$1(function (module) { function _extends() { module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }, module.exports.__esModule = true, module.exports["default"] = module.exports; return _extends.apply(this, arguments); } module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; }); var _extends$2 = unwrapExports$1(_extends_1$1); var objectWithoutPropertiesLoose$1 = createCommonjsModule$1(function (module) { function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; }); var _objectWithoutPropertiesLoose$2 = unwrapExports$1(objectWithoutPropertiesLoose$1); function unwrapExports (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var _extends_1 = createCommonjsModule(function (module) { function _extends() { module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }, module.exports.__esModule = true, module.exports["default"] = module.exports; return _extends.apply(this, arguments); } module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; }); var _extends$1 = unwrapExports(_extends_1); var objectWithoutPropertiesLoose = createCommonjsModule(function (module) { function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; }); var _objectWithoutPropertiesLoose$1 = unwrapExports(objectWithoutPropertiesLoose); var light$1 = { text: '#404A59', strokebar: '#E5E9F1', card: '#FFFFFF', header: '#F9FBFC', background: '#FFFFFF', sidebar: '#FFFFFF' }; var dark$1 = { text: '#FFFFFF', strokebar: '#51595C', card: '#3A3D41', header: '#3A3D41', background: '#323538', sidebar: '#292C2D' }; var rainbow$1 = { white: '#FFFFFF', black: '#000000', gray: { '50': '#F9F9F9', '100': '#ECEEF2', '200': '#D5DBE2', '300': '#B0BBC9', '400': '#8595AB', '500': '#667991', '600': '#52627A', '700': '#424F62', '800': '#394353', '900': '#333B47' }, blue: { '50': '#EEF8FF', '100': '#D8EFFF', '200': '#B9E4FF', '300': '#8AD4FF', '400': '#52BCFF', '500': '#2A9CFF', '600': '#137DFD', '700': '#0C63E4', '800': '#1151BC', '900': '#144794' }, sucess: { '50': '#EEFFF6', '100': '#D7FFEB', '200': '#B1FFD9', '300': '#75FFBC', '400': '#32F696', '500': '#07D471', '600': '#00BA60', '700': '#04914E', '800': '#097241', '900': '#0A5D37' }, link: { '50': '#EBFEFF', '100': '#CDF9FF', '200': '#A2F1FF', '300': '#62E5FE', '400': '#19CEF5', '500': '#00B1DB', '600': '#028DB8', '700': '#097195', '800': '#125B78', '900': '#134B66' }, warning: { '50': '#FFF7EB', '100': '#FDE8C8', '200': '#FBD18C', '300': '#F8B351', '400': '#F79C31', '500': '#F07510', '600': '#D5520A', '700': '#B1350C', '800': '#8F2A11', '900': '#762411' }, error: { '50': '#FFF1F2', '100': '#FFE4E6', '200': '#FFCCD3', '300': '#FEA3AE', '400': '#FD6F84', '500': '#F63858', '600': '#E31B46', '700': '#C0103A', '800': '#A11038', '900': '#891236' }, yellow: { '50': '#FEFCEC', '100': '#FDF5C8', '200': '#FAEB8D', '300': '#F7DB52', '400': '#F6CE3C', '500': '#EFAA11', '600': '#D3840C', '700': '#AF5E0E', '800': '#8E4912', '900': '#753C12' }, gbm: { sky: '#0C63E4', ocean: '#094FB9', blue: '#033278' }, componentColors: { stroke: '#dae0e7' } }; var themes$1 = { light: light$1, dark: dark$1, rainbow: rainbow$1 }; var e$1="colors",t$1="sizes",r$1="space",n$1={gap:r$1,gridGap:r$1,columnGap:r$1,gridColumnGap:r$1,rowGap:r$1,gridRowGap:r$1,inset:r$1,insetBlock:r$1,insetBlockEnd:r$1,insetBlockStart:r$1,insetInline:r$1,insetInlineEnd:r$1,insetInlineStart:r$1,margin:r$1,marginTop:r$1,marginRight:r$1,marginBottom:r$1,marginLeft:r$1,marginBlock:r$1,marginBlockEnd:r$1,marginBlockStart:r$1,marginInline:r$1,marginInlineEnd:r$1,marginInlineStart:r$1,padding:r$1,paddingTop:r$1,paddingRight:r$1,paddingBottom:r$1,paddingLeft:r$1,paddingBlock:r$1,paddingBlockEnd:r$1,paddingBlockStart:r$1,paddingInline:r$1,paddingInlineEnd:r$1,paddingInlineStart:r$1,top:r$1,right:r$1,bottom:r$1,left:r$1,scrollMargin:r$1,scrollMarginTop:r$1,scrollMarginRight:r$1,scrollMarginBottom:r$1,scrollMarginLeft:r$1,scrollMarginX:r$1,scrollMarginY:r$1,scrollMarginBlock:r$1,scrollMarginBlockEnd:r$1,scrollMarginBlockStart:r$1,scrollMarginInline:r$1,scrollMarginInlineEnd:r$1,scrollMarginInlineStart:r$1,scrollPadding:r$1,scrollPaddingTop:r$1,scrollPaddingRight:r$1,scrollPaddingBottom:r$1,scrollPaddingLeft:r$1,scrollPaddingX:r$1,scrollPaddingY:r$1,scrollPaddingBlock:r$1,scrollPaddingBlockEnd:r$1,scrollPaddingBlockStart:r$1,scrollPaddingInline:r$1,scrollPaddingInlineEnd:r$1,scrollPaddingInlineStart:r$1,fontSize:"fontSizes",background:e$1,backgroundColor:e$1,backgroundImage:e$1,borderImage:e$1,border:e$1,borderBlock:e$1,borderBlockEnd:e$1,borderBlockStart:e$1,borderBottom:e$1,borderBottomColor:e$1,borderColor:e$1,borderInline:e$1,borderInlineEnd:e$1,borderInlineStart:e$1,borderLeft:e$1,borderLeftColor:e$1,borderRight:e$1,borderRightColor:e$1,borderTop:e$1,borderTopColor:e$1,caretColor:e$1,color:e$1,columnRuleColor:e$1,fill:e$1,outline:e$1,outlineColor:e$1,stroke:e$1,textDecorationColor:e$1,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t$1,minBlockSize:t$1,maxBlockSize:t$1,inlineSize:t$1,minInlineSize:t$1,maxInlineSize:t$1,width:t$1,minWidth:t$1,maxWidth:t$1,height:t$1,minHeight:t$1,maxHeight:t$1,flexBasis:t$1,gridTemplateColumns:t$1,gridTemplateRows:t$1,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i$1=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,o$1=()=>{const e=Object.create(null);return (t,r,...n)=>{const o=(e=>JSON.stringify(e,i$1))(t);return o in e?e[o]:e[o]=r(t,...n)}},l$1=Symbol.for("sxs.internal"),s$1=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),a$1=e=>{for(const t in e)return !0;return !1},{hasOwnProperty:c$1}=Object.prototype,d$1=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),g$1=/\s+(?![^()]*\))/,p$1=e=>t=>e(..."string"==typeof t?String(t).split(g$1):[t]),u$1={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:p$1(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:p$1(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:p$1(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:p$1(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:p$1(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:p$1(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},h$1=/([\d.]+)([^]*)/,f$1=(e,t)=>e.length?e.reduce(((e,r)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(e)?`:is(${r})`:r):r+" "+e))),e)),[]):t,m$1=(e,t)=>e in b$1&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,r,n,i)=>r+("stretch"===n?`-moz-available${i};${d$1(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${d$1(e)}:${r}fit-content`)+i)):String(t),b$1={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$1=e=>e?e+"-":"",k$1=(e,t,r)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((e,n,i,o,l)=>"$"==o==!!i?e:(n||"--"==o?"calc(":"")+"var(--"+("$"===o?S$1(t)+(l.includes("$")?"":S$1(r))+l.replace(/\$/g,"-"):l)+")"+(n||"--"==o?"*"+(n||"")+(i||"1")+")":""))),y$1=/\s*,\s*(?![^()]*\))/,B$1=Object.prototype.toString,$$1=(e,t,r,n,i)=>{let o,l,s;const a=(e,t,r)=>{let c,g;const p=e=>{for(c in e){const R=64===c.charCodeAt(0),z=R&&Array.isArray(e[c])?e[c]:[e[c]];for(g of z){const e=/[A-Z]/.test($=c)?$:$.replace(/-[^]/g,(e=>e[1].toUpperCase())),z="object"==typeof g&&g&&g.toString===B$1&&(!n.utils[e]||!t.length);if(e in n.utils&&!z){const t=n.utils[e];if(t!==l){l=t,p(t(g)),l=null;continue}}else if(e in u$1){const t=u$1[e];if(t!==s){s=t,p(t(g)),s=null;continue}}if(R&&(b=c.slice(1)in n.media?"@media "+n.media[c.slice(1)]:c,c=b.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,r,n,i,o)=>{const l=h$1.test(t),s=.0625*(l?-1:1),[a,c]=l?[n,t]:[t,n];return "("+("="===r[0]?"":">"===r[0]===l?"max-":"min-")+a+":"+("="!==r[0]&&1===r.length?c.replace(h$1,((e,t,n)=>Number(t)+s*(">"===r?1:-1)+n)):c)+(i?") and ("+(">"===i[0]?"min-":"max-")+a+":"+(1===i.length?o.replace(h$1,((e,t,r)=>Number(t)+s*(">"===i?-1:1)+r)):o):"")+")"}))),z){const e=R?r.concat(c):[...r],n=R?[...t]:f$1(t,c.split(y$1));void 0!==o&&i(x$1(...o)),o=void 0,a(g,n,e);}else void 0===o&&(o=[[],t,r]),c=R||36!==c.charCodeAt(0)?c:`--${S$1(n.prefix)}${c.slice(1).replace(/\$/g,"-")}`,g=z?g:"number"==typeof g?g&&e in I$1?String(g)+"px":String(g):k$1(m$1(e,null==g?"":g),n.prefix,n.themeMap[e]),o[0].push(`${R?`${c} `:`${d$1(c)}:`}${g}`);}}var b,$;};p(e),void 0!==o&&i(x$1(...o)),o=void 0;};a(e,t,r);},x$1=(e,t,r)=>`${r.map((e=>`${e}{`)).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(r.length?r.length+1:0).join("}")}`,I$1={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=e=>String.fromCharCode(e+(e>25?39:97)),z$1=e=>(e=>{let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=R$1(t%52)+r;return R$1(t%52)+r})(((e,t)=>{let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e})(5381,JSON.stringify(e))>>>0),W$1=["themed","global","styled","onevar","resonevar","allvar","inline"],j$1=e=>{if(e.href&&!e.href.startsWith(location.origin))return !1;try{return !!e.cssRules}catch(e){return !1}},E$1=e=>{let t;const r=()=>{const{cssRules:e}=t.sheet;return [].map.call(e,((r,n)=>{const{cssText:i}=r;let o="";if(i.startsWith("--sxs"))return "";if(e[n-1]&&(o=e[n-1].cssText).startsWith("--sxs")){if(!r.cssRules.length)return "";for(const e in t.rules)if(t.rules[e].group===r)return `--sxs{--sxs:${[...t.rules[e].cache].join(" ")}}${i}`;return r.cssRules.length?`${o}${i}`:""}return i})).join("")},n=()=>{if(t){const{rules:e,sheet:r}=t;if(!r.deleteRule){for(;3===Object(Object(r.cssRules)[0]).type;)r.cssRules.splice(0,1);r.cssRules=[];}for(const t in e)delete e[t];}const i=Object(e).styleSheets||[];for(const e of i)if(j$1(e)){for(let i=0,o=e.cssRules;o[i];++i){const l=Object(o[i]);if(1!==l.type)continue;const s=Object(o[i+1]);if(4!==s.type)continue;++i;const{cssText:a}=l;if(!a.startsWith("--sxs"))continue;const c=a.slice(14,-3).trim().split(/\s+/),d=W$1[c[0]];d&&(t||(t={sheet:e,reset:n,rules:{},toString:r}),t.rules[d]={group:s,index:i,cache:new Set(c)});}if(t)break}if(!t){const i=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,i(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4));},get cssText(){return "@media{}"===e?`@media{${[].map.call(this.cssRules,(e=>e.cssText)).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:i("","text/css"),rules:{},reset:n,toString:r};}const{sheet:o,rules:l}=t;for(let e=W$1.length-1;e>=0;--e){const t=W$1[e];if(!l[t]){const r=W$1[e+1],n=l[r]?l[r].index:o.cssRules.length;o.insertRule("@media{}",n),o.insertRule(`--sxs{--sxs:${e}}`,n),l[t]={group:o.cssRules[n+1],index:n,cache:new Set([e])};}v$1(l[t]);}};return n(),t},v$1=e=>{const t=e.group;let r=t.cssRules.length;e.apply=e=>{try{t.insertRule(e,r),++r;}catch(e){}};},T$1=Symbol(),w$1=o$1(),M$1=(e,t)=>w$1(e,(()=>(...r)=>{let n={type:null,composers:new Set};for(const t of r)if(null!=t)if(t[l$1]){null==n.type&&(n.type=t[l$1].type);for(const e of t[l$1].composers)n.composers.add(e);}else t.constructor!==Object||t.$$typeof?null==n.type&&(n.type=t):n.composers.add(C$1(t,e));return null==n.type&&(n.type="span"),n.composers.size||n.composers.add(["PJLV",{},[],[],{},[]]),P$1(e,n,t)})),C$1=({variants:e,compoundVariants:t,defaultVariants:r,...n},i)=>{const o=`${S$1(i.prefix)}c-${z$1(n)}`,l=[],s=[],d=Object.create(null),g=[];for(const e in r)d[e]=String(r[e]);if("object"==typeof e&&e)for(const t in e){p=d,u=t,c$1.call(p,u)||(d[t]="undefined");const r=e[t];for(const e in r){const n={[t]:String(e)};"undefined"===String(e)&&g.push(t);const i=r[e],o=[n,i,!a$1(i)];l.push(o);}}var p,u;if("object"==typeof t&&t)for(const e of t){let{css:t,...r}=e;t="object"==typeof t&&t||{};for(const e in r)r[e]=String(r[e]);const n=[r,t,!a$1(t)];s.push(n);}return [o,n,l,s,d,g]},P$1=(e,t,r)=>{const[n,i,o,a]=L$1(t.composers),c="function"==typeof t.type||t.type.$$typeof?(e=>{function t(){for(let r=0;r<t[T$1].length;r++){const[n,i]=t[T$1][r];e.rules[n].apply(i);}return t[T$1]=[],null}return t[T$1]=[],t.rules={},W$1.forEach((e=>t.rules[e]={apply:r=>t[T$1].push([e,r])})),t})(r):null,d=(c||r).rules,g=`.${n}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,p=l=>{l="object"==typeof l&&l||A$1;const{css:s,...p}=l,u={};for(const e in o)if(delete p[e],e in l){let t=l[e];"object"==typeof t&&t?u[e]={"@initial":o[e],...t}:(t=String(t),u[e]="undefined"!==t||a.has(e)?t:o[e]);}else u[e]=o[e];const h=new Set([...i]);for(const[n,i,o,l]of t.composers){r.rules.styled.cache.has(n)||(r.rules.styled.cache.add(n),$$1(i,[`.${n}`],[],e,(e=>{d.styled.apply(e);})));const t=O$1(o,u,e.media),s=O$1(l,u,e.media,!0);for(const i of t)if(void 0!==i)for(const[t,o,l]of i){const i=`${n}-${z$1(o)}-${t}`;h.add(i);const s=(l?r.rules.resonevar:r.rules.onevar).cache,a=l?d.resonevar:d.onevar;s.has(i)||(s.add(i),$$1(o,[`.${i}`],[],e,(e=>{a.apply(e);})));}for(const t of s)if(void 0!==t)for(const[i,o]of t){const t=`${n}-${z$1(o)}-${i}`;h.add(t),r.rules.allvar.cache.has(t)||(r.rules.allvar.cache.add(t),$$1(o,[`.${t}`],[],e,(e=>{d.allvar.apply(e);})));}}if("object"==typeof s&&s){const t=`${n}-i${z$1(s)}-css`;h.add(t),r.rules.inline.cache.has(t)||(r.rules.inline.cache.add(t),$$1(s,[`.${t}`],[],e,(e=>{d.inline.apply(e);})));}for(const e of String(l.className||"").trim().split(/\s+/))e&&h.add(e);const f=p.className=[...h].join(" ");return {type:t.type,className:f,selector:g,props:p,toString:()=>f,deferredInjector:c}};return s$1(p,{className:n,selector:g,[l$1]:t,toString:()=>(r.rules.styled.cache.has(n)||p(),n)})},L$1=e=>{let t="";const r=[],n={},i=[];for(const[o,,,,l,s]of e){""===t&&(t=o),r.push(o),i.push(...s);for(const e in l){const t=l[e];(void 0===n[e]||"undefined"!==t||s.includes(t))&&(n[e]=t);}}return [t,r,n,new Set(i)]},O$1=(e,t,r,n)=>{const i=[];e:for(let[o,l,s]of e){if(s)continue;let e,a=0,c=!1;for(e in o){const n=o[e];let i=t[e];if(i!==n){if("object"!=typeof i||!i)continue e;{let e,t,o=0;for(const l in i){if(n===String(i[l])){if("@initial"!==l){const e=l.slice(1);(t=t||[]).push(e in r?r[e]:l.replace(/^@media ?/,"")),c=!0;}a+=o,e=!0;}++o;}if(t&&t.length&&(l={["@media "+t.join(", ")]:l}),!e)continue e}}}(i[a]=i[a]||[]).push([n?"cv":`${e}-${o[e]}`,l,c]);}return i},A$1={},N$1=o$1(),D$1=(e,t)=>N$1(e,(()=>(...r)=>{const n=()=>{for(let n of r){n="object"==typeof n&&n||{};let r=z$1(n);if(!t.rules.global.cache.has(r)){if(t.rules.global.cache.add(r),"@import"in n){let e=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let r of [].concat(n["@import"]))r=r.includes('"')||r.includes("'")?r:`"${r}"`,t.sheet.insertRule(`@import ${r};`,e++);delete n["@import"];}$$1(n,[],[],e,(e=>{t.rules.global.apply(e);}));}}return ""};return s$1(n,{toString:n})})),H$1=o$1(),V$1=(e,t)=>H$1(e,(()=>r=>{const n=`${S$1(e.prefix)}k-${z$1(r)}`,i=()=>{if(!t.rules.global.cache.has(n)){t.rules.global.cache.add(n);const i=[];$$1(r,[],[],e,(e=>i.push(e)));const o=`@keyframes ${n}{${i.join("")}}`;t.rules.global.apply(o);}return n};return s$1(i,{get name(){return i()},toString:i})})),G$1=class G{constructor(e,t,r,n){this.token=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==r?"":String(r),this.prefix=null==n?"":String(n);}get computedValue(){return "var("+this.variable+")"}get variable(){return "--"+S$1(this.prefix)+S$1(this.scale)+this.token}toString(){return this.computedValue}},F$1=o$1(),J$1=(e,t)=>F$1(e,(()=>(r,n)=>{n="object"==typeof r&&r||Object(n);const i=`.${r=(r="string"==typeof r?r:"")||`${S$1(e.prefix)}t-${z$1(n)}`}`,o={},l=[];for(const t in n){o[t]={};for(const r in n[t]){const i=`--${S$1(e.prefix)}${t}-${r}`,s=k$1(String(n[t][r]),e.prefix,t);o[t][r]=new G$1(r,s,t,e.prefix),l.push(`${i}:${s}`);}}const s=()=>{if(l.length&&!t.rules.themed.cache.has(r)){t.rules.themed.cache.add(r);const i=`${n===e.theme?":root,":""}.${r}{${l.join(";")}}`;t.rules.themed.apply(i);}return r};return {...o,get className(){return s()},selector:i,toString:s}})),U$1=o$1();var Y$1=o$1(),q$1=e=>{const t=(e=>{let t=!1;const r=U$1(e,(e=>{t=!0;const r="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",i="object"==typeof e.media&&e.media||{},o="object"==typeof e.root?e.root||null:globalThis.document||null,l="object"==typeof e.theme&&e.theme||{},s={prefix:r,media:i,theme:l,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...n$1},utils:"object"==typeof e.utils&&e.utils||{}},a=E$1(o),c={css:M$1(s,a),globalCss:D$1(s,a),keyframes:V$1(s,a),createTheme:J$1(s,a),reset(){a.reset(),c.theme.toString();},theme:{},sheet:a,config:s,prefix:r,getCssText:a.toString,toString:a.toString};return String(c.theme=c.createTheme(l)),c}));return t||r.reset(),r})(e);return t.styled=(({config:e,sheet:t})=>Y$1(e,(()=>{const r=M$1(e,t);return (...e)=>{const t=r(...e),n=t[l$1].type,i=React__default.forwardRef(((e,r)=>{const i=e&&e.as||n,{props:o,deferredInjector:l}=t(e);return delete o.as,o.ref=r,l?React__default.createElement(React__default.Fragment,null,React__default.createElement(i,o),React__default.createElement(l,null)):React__default.createElement(i,o)}));return i.className=t.className,i.displayName=`Styled.${n.displayName||n.name||n}`,i.selector=t.selector,i.toString=()=>t.selector,i[l$1]=t[l$1],i}})))(t),t};//# sourceMappingUrl=index.map var _createStitches$1 = q$1({ theme: { colors: { // Default White & Black white: themes$1.rainbow.white, black: themes$1.rainbow.black, // Light Theme lightText: themes$1.light.text, lightStrokebar: themes$1.light.strokebar, lightCard: themes$1.light.card, lightHeader: themes$1.light.header, lightBackground: themes$1.light.background, lightSidebar: themes$1.light.sidebar, // Dark Theme darkText: themes$1.dark.text, darkStrokebar: themes$1.dark.strokebar, darkCard: themes$1.dark.card, darkHeader: themes$1.dark.header, darkBackground: themes$1.dark.background, darkSidebar: themes$1.dark.sidebar, // Rainbow Colors gray50: themes$1.rainbow.gray[50], gray100: themes$1.rainbow.gray[100], gray200: themes$1.rainbow.gray[200], gray300: themes$1.rainbow.gray[300], gray400: themes$1.rainbow.gray[400], gray500: themes$1.rainbow.gray[500], gray600: themes$1.rainbow.gray[600], gray700: themes$1.rainbow.gray[700], gray800: themes$1.rainbow.gray[800], gray900: themes$1.rainbow.gray[900], blue50: themes$1.rainbow.blue[50], blue100: themes$1.rainbow.blue[100], blue200: themes$1.rainbow.blue[200], blue300: themes$1.rainbow.blue[300], blue400: themes$1.rainbow.blue[400], blue500: themes$1.rainbow.blue[500], blue600: themes$1.rainbow.blue[600], blue700: themes$1.rainbow.blue[700], blue800: themes$1.rainbow.blue[800], blue900: themes$1.rainbow.blue[900], sucess50: themes$1.rainbow.sucess[50], sucess100: themes$1.rainbow.sucess[100], sucess200: themes$1.rainbow.sucess[200], sucess300: themes$1.rainbow.sucess[300], sucess400: themes$1.rainbow.sucess[400], sucess500: themes$1.rainbow.sucess[500], sucess600: themes$1.rainbow.sucess[600], sucess700: themes$1.rainbow.sucess[700], sucess800: themes$1.rainbow.sucess[800], sucess900: themes$1.rainbow.sucess[900], link50: themes$1.rainbow.link[50], link100: themes$1.rainbow.link[100], link200: themes$1.rainbow.link[200], link300: themes$1.rainbow.link[300], link400: themes$1.rainbow.link[400], link500: themes$1.rainbow.link[500], link600: themes$1.rainbow.link[600], link700: themes$1.rainbow.link[700], link800: themes$1.rainbow.link[800], link900: themes$1.rainbow.link[900], warning50: themes$1.rainbow.warning[50], warning100: themes$1.rainbow.warning[100], warning200: themes$1.rainbow.warning[200], warning300: themes$1.rainbow.warning[300], warning400: themes$1.rainbow.warning[400], warning500: themes$1.rainbow.warning[500], warning600: themes$1.rainbow.warning[600], warning700: themes$1.rainbow.warning[700], warning800: themes$1.rainbow.warning[800], warning900: themes$1.rainbow.warning[900], error50: themes$1.rainbow.error[50], error100: themes$1.rainbow.error[100], error200: themes$1.rainbow.error[200], error300: themes$1.rainbow.error[300], error400: themes$1.rainbow.error[400], error500: themes$1.rainbow.error[500], error600: themes$1.rainbow.error[600], error700: themes$1.rainbow.error[700], error800: themes$1.rainbow.error[800], error900: themes$1.rainbow.error[900], yellow50: themes$1.rainbow.yellow[50], yellow100: themes$1.rainbow.yellow[100], yellow200: themes$1.rainbow.yellow[200], yellow300: themes$1.rainbow.yellow[300], yellow400: themes$1.rainbow.yellow[400], yellow500: themes$1.rainbow.yellow[500], yellow600: themes$1.rainbow.yellow[600], yellow700: themes$1.rainbow.yellow[700], yellow800: themes$1.rainbow.yellow[800], yellow900: themes$1.rainbow.yellow[900], gbmSky: themes$1.rainbow.gbm.sky, gbmOcean: themes$1.rainbow.gbm.ocean, gbmBlue: themes$1.rainbow.gbm.blue }, fontSizes: {}, breakpoints: breakpoints$1 }, utils: { size: function size(value) { return { width: value, height: value }; }, maxSize: function maxSize(value) { return { maxWidth: value, maxHeight: value }; }, minSize: function minSize(value) { return { minWidth: value, minHeight: value }; } }, media: { xs: '(min-width: 320px)', sm: '(min-width: 576px)', md: '(min-width: 768px)', lg: '(min-width: 992px)', xl: '(min-width: 1200px)', xxl: '(min-width: 1400px)', xxxl: '(min-width: 1872px)' } }); _createStitches$1.config; var styled$1 = _createStitches$1.styled; _createStitches$1.css; var globalCss$1 = _createStitches$1.globalCss; _createStitches$1.keyframes; _createStitches$1.getCssText; _createStitches$1.theme; _createStitches$1.createTheme; globalCss$1({ '@import': ["url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;500;600;700;800&family=Rubik+Microbe&display=swap')"], '@font-face': [{ fontFamily: 'Poppins', src: "url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;500;600;700;800&family=Rubik+Microbe&display=swap')" }], '*': { margin: '0', padding: '0', outline: '0', boxSizing: 'border-box', fontFamily: "'Poppins', sans-serif" }, ':root, html': { fontSize: '62.5%' }, html: { overflow: 'hidden' }, body: { backgroundColor: '$background' }, 'html, body': { height: '100vh', textRendering: 'optimizeLegibility' }, 'button, a': { cursor: 'pointer' } }); var breakpoints$1 = { xs: '320px', sm: '576px', md: '768px', lg: '992px', xl: '1200px', xxl: '1400px', xxxl: '1872px' }; var HeadingBaseStyle = { color: '$gray800' }; var HeadingWeightMediumStyle = { fontWeight: 500 }; var HeadingWeightSemiBoldStyle = { fontWeight: 600 }; var HeadingWeightBoldStyle = { fontWeight: 700 }; styled$1('h1', _extends$1({ fontSize: '3.6rem', lineHeight: '5.4rem', fontWeight: 400 }, HeadingBaseStyle, { variants: { weight: { regular: {}, medium: _extends$1({}, HeadingWeightMediumStyle), semibold: _extends$1({}, HeadingWeightSemiBoldStyle), bold: _extends$1({}, HeadingWeightBoldStyle) } } })); styled$1('h2', _extends$1({ fontSize: '3.2rem', lineHeight: '4.8rem', fontWeight: 400 }, HeadingBaseStyle, { variants: { weight: { regular: {}, medium: _extends$1({}, HeadingWeightMediumStyle), semibold: _extends$1({}, HeadingWeightSemiBoldStyle), bold: _extends$1({}, HeadingWeightBoldStyle) } } })); styled$1('h3', _extends$1({ fontSize: '2.4rem', lineHeight: '3.6rem', fontWeight: 400 }, HeadingBaseStyle, { variants: { weight: { regular: {}, medium: _extends$1({}, HeadingWeightMediumStyle), semibold: _extends$1({}, HeadingWeightSemiBoldStyle), bold: _extends$1({}, HeadingWeightBoldStyle) } } })); styled$1('h4', _extends$1({ fontSize: '2.0rem', lineHeight: '3.0rem', fontWeight: 400 }, HeadingBaseStyle, { variants: { weight: { regular: {}, medium: _extends$1({}, HeadingWeightMediumStyle), semibold: _extends$1({}, HeadingWeightSemiBoldStyle), bold: _extends$1({}, HeadingWeightBoldStyle) } } })); styled$1('h5', _extends$1({ fontSize: '1.6rem', lineHeight: '2.4rem', fontWeight: 400 }, HeadingBaseStyle, { variants: { weight: { regular: {}, medium: _extends$1({}, HeadingWeightMediumStyle), semibold: _extends$1({}, HeadingWeightSemiBoldStyle), bold: _extends$1({}, HeadingWeightBoldStyle) } } })); styled$1('h6', _extends$1({ fontSize: '1.4rem', lineHeight: '2.1rem', fontWeight: 400 }, HeadingBaseStyle, { variants: { weight: { regular: {}, medium: _extends$1({}, HeadingWeightMediumStyle), semibold: _extends$1({}, HeadingWeightSemiBoldStyle), bold: _extends$1({}, HeadingWeightBoldStyle) } } })); var TextColorDarkStyle = { color: '$gray800' }; var TextColorLightStyle = { color: '$gray400' }; var TextWeightMediumStyle = { fontWeight: 500 }; var TextWeightSemiBoldStyle = { fontWeight: 600 }; var TextWeightBoldStyle = { fontWeight: 700 }; var TextXLContainer = styled$1('p', _extends$1({ fontSize: '1.8rem', lineHeight: '3.2rem', fontWeight: 400 }, TextColorDarkStyle, { variants: { textColor: { light: _extends$1({}, TextColorLightStyle), dark: _extends$1({}, TextColorDarkStyle) }, weight: { regular: {}, medium: _extends$1({}, TextWeightMediumStyle), semibold: _extends$1({}, TextWeightSemiBoldStyle), bold: _extends$1({}, TextWeightBoldStyle) } } })); var TextLGContainer = styled$1('p', _extends$1({ fontSize: '1.6rem', lineHeight: '2.8rem', fontWeight: 400 }, TextColorDarkStyle, { variants: { textColor: { light: _extends$1({}, TextColorLightStyle), dark: _extends$1({}, TextColorDarkStyle) }, weight: { regular: {}, medium: _extends$1({}, TextWeightMediumStyle), semibold: _extends$1({}, TextWeightSemiBoldStyle), bold: _extends$1({}, TextWeightBoldStyle) } } })); var TextMDContainer = styled$1('p', _extends$1({ fontSize: '1.4rem', lineHeight: '2.4rem', fontWeight: 400 }, TextColorDarkStyle, { variants: { textColor: { light: _extends$1({}, TextColorLightStyle), dark: _extends$1({}, TextColorDarkStyle) }, weight: { regular: {}, medium: _extends$1({}, TextWeightMediumStyle), semibold: _extends$1({}, TextWeightSemiBoldStyle), bold: _extends$1({}, TextWeightBoldStyle) } } })); var TextSMContainer = styled$1('p', _extends$1({ fontSize: '1.2rem', lineHeight: '2.0rem', fontWeight: 400 }, TextColorDarkStyle, { variants: { textColor: { light: _extends$1({}, TextColorLightStyle), dark: _extends$1({}, TextColorDarkStyle) }, weight: { regular: {}, medium: _extends$1({}, TextWeightMediumStyle), semibold: _extends$1({}, TextWeightSemiBoldStyle), bold: _extends$1({}, TextWeightBoldStyle) } } })); var _excluded$1 = ["children", "weight", "size", "textColor"]; var Text = function Text(_ref) { var children = _ref.children, _ref$weight = _ref.weight, weight = _ref$weight === void 0 ? 'regular' : _ref$weight, _ref$size = _ref.size, size = _ref$size === void 0 ? 'lg' : _ref$size, _ref$textColor = _ref.textColor, textColor = _ref$textColor === void 0 ? 'dark' : _ref$textColor, props = _objectWithoutPropertiesLoose$1(_ref, _excluded$1); switch (size) { case 'sm': return React__default.createElement(TextSMContainer, _extends$1({ textColor: textColor, weight: weight }, props), children); case 'md': return React__default.createElement(TextMDContainer, _extends$1({ textColor: textColor, weight: weight }, props), children); case 'lg': return React__default.createElement(TextLGContainer, _extends$1({ textColor: textColor, weight: weight }, props), children); case 'xl': return React__default.createElement(TextXLContainer, _extends$1({ textColor: textColor, weight: weight }, props), children); default: return React__default.createElement(TextMDContainer, _extends$1({ textColor: textColor, weight: weight }, props), children); } }; function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) { return Math.min(max, Math.max(min, value)); } function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) { return function handleEvent(event) { originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event); if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event); }; } /* ------------------------------------------------------------------------------------------------- * createContextScope * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) { let defaultContexts = []; /* ----------------------------------------------------------------------------------------------- * createContext * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { const BaseContext = /*#__PURE__*/ createContext(defaultContext); const index = defaultContexts.length; defaultContexts = [ ...defaultContexts, defaultContext ]; function Provider(props) { const { scope: scope , children: children , ...context } = props; const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change // eslint-disable-next-line react-hooks/exhaustive-deps const value = useMemo(()=>context , Object.values(context)); return /*#__PURE__*/ createElement(Context.Provider, { value: value }, children); } function useContext$1(consumerName, scope) { const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; const context = useContext(Context); if (context) return context; if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } Provider.displayName = rootComponentName + 'Provider'; return [ Provider, useContext$1 ]; } /* ----------------------------------------------------------------------------------------------- * createScope * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{ const scopeContexts = defaultContexts.map((defaultContext)=>{ return /*#__PURE__*/ createContext(defaultContext); }); return function useScope(scope) { const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts; return useMemo(()=>({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }) , [ scope, contexts ]); }; }; createScope.scopeName = scopeName; return [ $c512c27ab02ef895$export$fd42f52fd3ae1109, $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps) ]; } /* ------------------------------------------------------------------------------------------------- * composeContextScopes * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) { const baseScope = scopes[0]; if (scopes.length === 1) return baseScope; const createScope1 = ()=>{ const scopeHooks = scopes.map((createScope)=>({ useScope: createScope(), scopeName: createScope.scopeName }) ); return function useComposedScopes(overrideScopes) { const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{ // We are calling a hook inside a callback which React warns against to avoid inconsistent // renders, however, scoping doesn't have render side effects so we ignore the rule. // eslint-disable-next-line react-hooks/rules-of-hooks const scopeProps = useScope(overrideScopes); const currentScope = scopeProps[`__scope${scopeName}`]; return { ...nextScopes, ...currentScope }; }, {}); return useMemo(()=>({ [`__scope${baseScope.scopeName}`]: nextScopes1 }) , [ nextScopes1 ]); }; }; createScope1.scopeName = baseScope.scopeName; return createScope1; } /** * Set a given ref to a given value * This utility takes care of different types of refs: callback refs and RefObject(s) */ function $6ed0406888f73fc4$var$setRef(ref, value) { if (typeof ref === 'function') ref(value); else if (ref !== null && ref !== undefined) ref.current = value; } /** * A utility to compose multiple refs together * Accepts callback refs and RefObject(s) */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) { return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node) ) ; } /** * A custom hook that composes multiple refs * Accepts callback refs and RefObject(s) */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) { // eslint-disable-next-line react-hooks/exhaustive-deps return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs); } /* ------------------------------------------------------------------------------------------------- * Slot * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{ const { children: children , ...slotProps } = props; const childrenArray = Children.toArray(children); const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable); if (slottable) { // the new element to render is the one passed as a child of `Slottable` const newElement = slottable.props.children; const newChildren = childrenArray.map((child)=>{ if (child === slottable) { // because the new element will be the one rendered, we are only interested // in grabbing its children (`newElement.props.children`) if (Children.count(newElement) > 1) return Children.only(null); return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null; } else return child; }); return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, { ref: forwardedRef }), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null); } return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, { ref: forwardedRef }), children); }); $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot'; /* ------------------------------------------------------------------------------------------------- * SlotClone * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{ const { children: children , ...slotProps } = props; if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, { ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props), ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) }); return Children.count(children) > 1 ? Children.only(null) : null; }); $5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone'; /* ------------------------------------------------------------------------------------------------- * Slottable * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{ return /*#__PURE__*/ createElement(Fragment, null, children); }; /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) { return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45; } function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) { // all child props should override const overrideProps = { ...childProps }; for(const propName in childProps){ const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { // if the handler exists on both, we compose them if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{ childPropValue(...args); slotPropValue(...args); }; else if (slotPropValue) overrideProps[propName] = slotPropValue; } else if (propName === 'style') overrideProps[propName] = { ...slotPropValue, ...childPropValue }; else if (propName === 'className') overrideProps[propName] = [ slotPropValue, childPropValue ].filter(Boolean).join(' '); } return { ...slotProps, ...overrideProps }; } // We have resorted to returning slots directly rather than exposing primitives that can then // be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`. // This is because we encountered issues with generic types that cannot be statically analysed // due to creating them dynamically via createCollection. function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) { /* ----------------------------------------------------------------------------------------------- * CollectionProvider * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider'; const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME); const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: new Map() }); const CollectionProvider = (props)=>{ const { scope: scope , children: children } = props; const ref = React__default.useRef(null); const itemMap = React__default.useRef(new Map()).current; return /*#__PURE__*/ React__default.createElement(CollectionProviderImpl, { scope: scope, itemMap: itemMap, collectionRef: ref }, children); }; /* ----------------------------------------------------------------------------------------------- * CollectionSlot * ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot'; const CollectionSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{ const { scope: scope , children: children } = props; const context = useCollectionContext(COLLECTION_SLOT_NAME, scope); const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef); return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { ref: composedRefs }, children); }); /* ----------------------------------------------------------------------------------------------- * CollectionItem * ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot'; const ITEM_DATA_ATTR = 'data-radix-collection-item'; const CollectionItemSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{ const { scope: scope , children: children , ...itemData } = props; const ref = React__default.useRef(null); const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); const context = useCollectionContext(ITEM_SLOT_NAME, scope); React__default.useEffect(()=>{ context.itemMap.set(ref, { ref: ref, ...itemData }); return ()=>void context.itemMap.delete(ref) ; }); return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { [ITEM_DATA_ATTR]: '', ref: composedRefs }, children); }); /* ----------------------------------------------------------------------------------------------- * useCollection * ---------------------------------------------------------------------------------------------*/ function useCollection(scope) { const context = useCollectionContext(name + 'CollectionConsumer', scope); const getItems = React__default.useCallback(()=>{ const collectionNode = context.collectionRef.current; if (!collectionNode) return []; const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); const items = Array.from(context.itemMap.values()); const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current) );