@cocalc/static
Version:
CoCalc's static frontend Webpack-based build system and framework
1 lines • 4.73 kB
JavaScript
;(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[2566],{74269:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(18938),o=r(95813),i=r(67635),c=r(44972),u=r(59151),a=r(56336),l=function(e,t){return new a.C(e).setAlpha(t).toRgbString()},s=function(e,t){return new a.C(e).lighten(t).toHexString()},f=function(e){var t=(0,i.generate)(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},d=function(e,t){var r=e||"#000",n=t||"#fff";return{colorBgBase:r,colorTextBase:n,colorText:l(n,.85),colorTextSecondary:l(n,.65),colorTextTertiary:l(n,.45),colorTextQuaternary:l(n,.25),colorFill:l(n,.18),colorFillSecondary:l(n,.12),colorFillTertiary:l(n,.08),colorFillQuaternary:l(n,.04),colorBgElevated:s(r,12),colorBgContainer:s(r,8),colorBgLayout:s(r,0),colorBgSpotlight:s(r,26),colorBorder:s(r,26),colorBorderSecondary:s(r,19)}};var h=r(71596),b=r(58418);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const v={defaultConfig:n.u_,defaultSeed:n.u_.token,useToken:function(){var e,t,r=(e=(0,n.dQ)(),t=3,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],c=!0,u=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return{theme:r[0],token:r[1],hashId:r[2]}},defaultAlgorithm:o.Z,darkAlgorithm:function(e,t){var r=Object.keys(c.M).map((function(t){var r=(0,i.generate)(e[t],{theme:"dark"});return new Array(10).fill(1).reduce((function(e,n,o){return e["".concat(t,"-").concat(o+1)]=r[o],e}),{})})).reduce((function(e,t){return Object.assign(Object.assign({},e),t)}),{}),n=null!=t?t:(0,o.Z)(e);return Object.assign(Object.assign(Object.assign({},n),r),(0,u.Z)(e,{generateColorPalettes:f,generateNeutralColorPalettes:d}))},compactAlgorithm:function(e,t){var r=null!=t?t:(0,o.Z)(e),n=r.fontSizeSM,i=r.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),function(e){var t=e.sizeUnit,r=e.sizeStep-2;return{sizeXXL:t*(r+10),sizeXL:t*(r+6),sizeLG:t*(r+2),sizeMD:t*(r+2),sizeMS:t*(r+1),size:t*r,sizeSM:t*r,sizeXS:t*(r-1),sizeXXS:t*(r-1)}}(null!=t?t:e)),(0,b.Z)(n)),{controlHeight:i}),(0,h.Z)(Object.assign(Object.assign({},r),{controlHeight:i})))}}},83389:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(63505);var o=function(e,t,r){return e[t]?e[t][0]?e[t][0][r]:e[t][r]:"contentBoxSize"===t?e.contentRect["inlineSize"===r?"width":"height"]:void 0};function i(e){void 0===e&&(e={});var t=e.onResize,r=(0,n.useRef)(void 0);r.current=t;var i=e.round||Math.round,c=(0,n.useRef)(),u=(0,n.useState)({width:void 0,height:void 0}),a=u[0],l=u[1],s=(0,n.useRef)(!1);(0,n.useEffect)((function(){return function(){s.current=!0}}),[]);var f,d,h,b,g,v,y=(0,n.useRef)({width:void 0,height:void 0}),S=(f=(0,n.useCallback)((function(t){return c.current&&c.current.box===e.box&&c.current.round===i||(c.current={box:e.box,round:i,instance:new ResizeObserver((function(t){var n=t[0],c="border-box"===e.box?"borderBoxSize":"device-pixel-content-box"===e.box?"devicePixelContentBoxSize":"contentBoxSize",u=o(n,c,"inlineSize"),a=o(n,c,"blockSize"),f=u?i(u):void 0,d=a?i(a):void 0;if(y.current.width!==f||y.current.height!==d){var h={width:f,height:d};y.current.width=f,y.current.height=d,r.current?r.current(h):s.current||l(h)}}))}),c.current.instance.observe(t,{box:e.box}),function(){c.current&&c.current.instance.unobserve(t)}}),[e.box,i]),d=e.ref,h=(0,n.useRef)(null),b=(0,n.useRef)(null),g=(0,n.useRef)(),v=(0,n.useCallback)((function(){var e,t,r=null;h.current?r=h.current:d&&(e=d,r=(null!=(t=HTMLElement)&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t)?d:d.current),b.current&&b.current.element===r&&b.current.reporter===v||(g.current&&(g.current(),g.current=null),b.current={reporter:v,element:r},r&&(g.current=f(r)))}),[d,f]),(0,n.useEffect)((function(){v()}),[v]),(0,n.useCallback)((function(e){h.current=e,v()}),[v]));return(0,n.useMemo)((function(){return{ref:S,width:a.width,height:a.height}}),[S,a?a.width:null,a?a.height:null])}}}]);