export function getEnvironmentColor(_0x2f6c9a){let _0x1b5b47=0x0;for(let _0x1045ff=0x0;_0x1045ff<_0x2f6c9a['length'];_0x1045ff++){_0x1b5b47=_0x2f6c9a['charCodeAt'](_0x1045ff)+((_0x1b5b47<<0x5)-_0x1b5b47);}const _0x6bbe7=Math['abs'](_0x1b5b47)%0x168;return'hsl('+_0x6bbe7+',\x2055%,\x2048%)';}export function getEnvironmentInitials(_0x422227){const _0x5acad1=_0x422227['split'](/[-_.\s]+/)['filter'](Boolean);if(_0x5acad1['length']>=0x2)return(_0x5acad1[0x0][0x0]+_0x5acad1[0x1][0x0])['toUpperCase']();return _0x422227['substring'](0x0,0x2)['toUpperCase']();}const ICON_REPO_SVG='<svg\x20class=\x22env-meta-icon\x22\x20width=\x2213\x22\x20height=\x2213\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M22\x2019a2\x202\x200\x200\x201-2\x202H4a2\x202\x200\x200\x201-2-2V5a2\x202\x200\x200\x201\x202-2h5l2\x203h9a2\x202\x200\x200\x201\x202\x202z\x22></path></svg>',ICON_TEMPLATE_SVG='<svg\x20class=\x22env-meta-icon\x22\x20width=\x2213\x22\x20height=\x2213\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M14\x202H6a2\x202\x200\x200\x200-2\x202v16a2\x202\x200\x200\x200\x202\x202h12a2\x202\x200\x200\x200\x202-2V8z\x22></path><polyline\x20points=\x2214\x202\x2014\x208\x2020\x208\x22></polyline></svg>';export function renderEnvironmentOption(_0x486e87,_0x3c761d){const _0x379bb3=_0x3c761d['value'];if(!_0x379bb3){_0x486e87['textContent']=_0x3c761d['textContent'];return;}const _0x587576=_0x3c761d['getAttribute']('data-description')||'',_0x2f2b0d=parseInt(_0x3c761d['getAttribute']('data-repo-count')||'0',0xa),_0x5253c5=parseInt(_0x3c761d['getAttribute']('data-template-count')||'0',0xa),_0xdb78e8=_0x3c761d['getAttribute']('data-custom-color')||getEnvironmentColor(_0x379bb3),_0x1745b9=_0x3c761d['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x379bb3);_0x486e87['classList']['add']('env-rich-option');const _0x24cc9e=document['createElement']('span');_0x24cc9e['className']='env-option-avatar',_0x24cc9e['style']['background']=_0xdb78e8,_0x24cc9e['textContent']=_0x1745b9,_0x486e87['appendChild'](_0x24cc9e);const _0x1a62cb=document['createElement']('span');_0x1a62cb['className']='env-option-content';const _0x444a3b=document['createElement']('span');_0x444a3b['className']='env-option-name',_0x444a3b['textContent']=_0x379bb3,_0x1a62cb['appendChild'](_0x444a3b);if(_0x587576){const _0xf8f815=document['createElement']('span');_0xf8f815['className']='env-option-desc',_0xf8f815['textContent']=_0x587576,_0x1a62cb['appendChild'](_0xf8f815);}const _0x874366=document['createElement']('span');_0x874366['className']='env-option-meta';const _0x289311=[];if(_0x2f2b0d>0x0)_0x289311['push'](ICON_REPO_SVG+'\x20'+_0x2f2b0d+'\x20repo'+(_0x2f2b0d!==0x1?'s':''));if(_0x5253c5>0x0)_0x289311['push'](ICON_TEMPLATE_SVG+'\x20'+_0x5253c5+'\x20template'+(_0x5253c5!==0x1?'s':''));_0x289311['length']>0x0&&(_0x874366['innerHTML']=_0x289311['join']('<span\x20class=\x22env-meta-sep\x22></span>'),_0x1a62cb['appendChild'](_0x874366)),_0x486e87['appendChild'](_0x1a62cb);}export function renderEnvironmentTrigger(_0x5d6feb,_0x48e8d4){const _0x27366b=_0x48e8d4['value'];if(!_0x27366b){_0x5d6feb['textContent']=_0x48e8d4['textContent'];return;}const _0x185c83=_0x48e8d4['getAttribute']('data-custom-color')||getEnvironmentColor(_0x27366b),_0x313424=_0x48e8d4['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x27366b),_0x64a540=document['createElement']('span');_0x64a540['className']='env-trigger-avatar',_0x64a540['style']['background']=_0x185c83,_0x64a540['textContent']=_0x313424;const _0x2c916=document['createElement']('span');_0x2c916['className']='env-trigger-name',_0x2c916['textContent']=_0x27366b,_0x5d6feb['appendChild'](_0x64a540),_0x5d6feb['appendChild'](_0x2c916);}