@lokalise/harmony 1.5.6 → 1.6.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.
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.mjs +285 -286
- package/dist/types/src/components/Sidebar/Sidebar.stories.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileMenu.test.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/types.d.ts +8 -6
- package/package.json +1 -1
package/dist/harmony.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),h=require("react"),f=require("@lokalise/louis"),Ae=require("date-fns"),Je=require("date-fns-tz");function Ke(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const k=Ke(h);var B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z,fe;function ae(){if(fe)return z;fe=1;function e(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}return z=e,z}var F,me;function Qe(){if(me)return F;me=1;var e=typeof B=="object"&&B&&B.Object===Object&&B;return F=e,F}var W,ge;function qe(){if(ge)return W;ge=1;var e=Qe(),n=typeof self=="object"&&self&&self.Object===Object&&self,t=e||n||Function("return this")();return W=t,W}var H,be;function en(){if(be)return H;be=1;var e=qe(),n=function(){return e.Date.now()};return H=n,H}var G,pe;function nn(){if(pe)return G;pe=1;var e=/\s/;function n(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}return G=n,G}var V,he;function tn(){if(he)return V;he=1;var e=nn(),n=/^\s+/;function t(r){return r&&r.slice(0,e(r)+1).replace(n,"")}return V=t,V}var Y,_e;function De(){if(_e)return Y;_e=1;var e=qe(),n=e.Symbol;return Y=n,Y}var Z,ve;function rn(){if(ve)return Z;ve=1;var e=De(),n=Object.prototype,t=n.hasOwnProperty,r=n.toString,a=e?e.toStringTag:void 0;function s(c){var l=t.call(c,a),u=c[a];try{c[a]=void 0;var o=!0}catch{}var d=r.call(c);return o&&(l?c[a]=u:delete c[a]),d}return Z=s,Z}var X,je;function an(){if(je)return X;je=1;var e=Object.prototype,n=e.toString;function t(r){return n.call(r)}return X=t,X}var J,xe;function sn(){if(xe)return J;xe=1;var e=De(),n=rn(),t=an(),r="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function c(l){return l==null?l===void 0?a:r:s&&s in Object(l)?n(l):t(l)}return J=c,J}var K,Te;function on(){if(Te)return K;Te=1;function e(n){return n!=null&&typeof n=="object"}return K=e,K}var Q,Ie;function cn(){if(Ie)return Q;Ie=1;var e=sn(),n=on(),t="[object Symbol]";function r(a){return typeof a=="symbol"||n(a)&&e(a)==t}return Q=r,Q}var ee,Ne;function ln(){if(Ne)return ee;Ne=1;var e=tn(),n=ae(),t=cn(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(o){if(typeof o=="number")return o;if(t(o))return r;if(n(o)){var d=typeof o.valueOf=="function"?o.valueOf():o;o=n(d)?d+"":d}if(typeof o!="string")return o===0?o:+o;o=e(o);var p=s.test(o);return p||c.test(o)?l(o.slice(2),p?2:8):a.test(o)?r:+o}return ee=u,ee}var ne,we;function Be(){if(we)return ne;we=1;var e=ae(),n=en(),t=ln(),r="Expected a function",a=Math.max,s=Math.min;function c(l,u,o){var d,p,j,x,b,T,N=0,y=!1,g=!1,w=!0;if(typeof l!="function")throw new TypeError(r);u=t(u)||0,e(o)&&(y=!!o.leading,g="maxWait"in o,j=g?a(t(o.maxWait)||0,u):j,w="trailing"in o?!!o.trailing:w);function v(m){var S=d,O=p;return d=p=void 0,N=m,x=l.apply(O,S),x}function _(m){return N=m,b=setTimeout(D,u),y?v(m):x}function q(m){var S=m-T,O=m-N,de=u-S;return g?s(de,j-O):de}function le(m){var S=m-T,O=m-N;return T===void 0||S>=u||S<0||g&&O>=j}function D(){var m=n();if(le(m))return ue(m);b=setTimeout(D,q(m))}function ue(m){return b=void 0,w&&d?v(m):(d=p=void 0,x)}function Ze(){b!==void 0&&clearTimeout(b),N=0,d=T=p=b=void 0}function Xe(){return b===void 0?x:ue(n())}function $(){var m=n(),S=le(m);if(d=arguments,p=this,T=m,S){if(b===void 0)return _(T);if(g)return clearTimeout(b),b=setTimeout(D,u),v(T)}return b===void 0&&(b=setTimeout(D,u)),x}return $.cancel=Ze,$.flush=Xe,$}return ne=c,ne}var un=Be();const dn=Me(un);var te,ye;function fn(){if(ye)return te;ye=1;var e=Be(),n=ae(),t="Expected a function";function r(a,s,c){var l=!0,u=!0;if(typeof a!="function")throw new TypeError(t);return n(c)&&(l="leading"in c?!!c.leading:l,u="trailing"in c?!!c.trailing:u),e(a,s,{leading:l,maxWait:s,trailing:u})}return te=r,te}var mn=fn();const gn=Me(mn),bn=(e,n,t,r)=>{switch(n){case"debounce":return dn(e,t,r);case"throttle":return gn(e,t,r);default:return e}},pn=e=>{const n=k.useRef(e);return k.useEffect(()=>{n.current=e}),k.useMemo(()=>(...t)=>{var r;return(r=n.current)===null||r===void 0?void 0:r.call(n,...t)},[])},hn=e=>{const[n,t]=k.useState((e==null?void 0:e.current)||null);return e&&setTimeout(()=>{e.current!==n&&t(e.current)},0),{refProxy:k.useMemo(()=>new Proxy(a=>{a!==n&&t(a)},{get(a,s){return s==="current"?n:a[s]},set(a,s,c){return s==="current"?t(c):a[s]=c,!0}}),[n]),refElement:n,setRefElement:t}},_n=(e,n)=>n==="border-box"?{width:e.borderBoxSize[0].inlineSize,height:e.borderBoxSize[0].blockSize}:n==="content-box"?{width:e.contentBoxSize[0].inlineSize,height:e.contentBoxSize[0].blockSize}:{width:e.contentRect.width,height:e.contentRect.height};function vn({skipOnMount:e=!1,refreshMode:n,refreshRate:t=1e3,refreshOptions:r,handleWidth:a=!0,handleHeight:s=!0,targetRef:c,observerOptions:l,onResize:u}={}){const o=h.useRef(e),d=pn(u),[p,j]=h.useState({width:void 0,height:void 0}),{refProxy:x,refElement:b}=hn(c),{box:T}=l||{},N=h.useCallback(g=>{if(!a&&!s)return;if(o.current){o.current=!1;return}const w=(v,_)=>a&&v.width!==_.width||s&&v.height!==_.height;g.forEach(v=>{const _=_n(v,T);j(q=>w(q,_)?(d==null||d({width:_.width,height:_.height,entry:v}),_):q)})},[a,s,o,T]),y=h.useCallback(bn(N,n,t,r),[N,n,t,r]);return h.useEffect(()=>{let g;return b?(g=new window.ResizeObserver(y),g.observe(b,l)):(p.width||p.height)&&(d==null||d({width:null,height:null,entry:null}),j({width:void 0,height:void 0})),()=>{var w,v,_;(w=g==null?void 0:g.disconnect)===null||w===void 0||w.call(g),(_=(v=y).cancel)===null||_===void 0||_.call(v)}},[y,b]),Object.assign({ref:x},p)}function Ue(e){var n,t,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(t=Ue(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function L(){for(var e,n,t=0,r="",a=arguments.length;t<a;t++)(e=arguments[t])&&(n=Ue(e))&&(r&&(r+=" "),r+=n);return r}const jn="_headerContainer_1cubo_1",xn="_navigationTabList_1cubo_8",Tn="_navigationTab_1cubo_8",In="_headerContent_1cubo_34",Nn="_staticEnabled_1cubo_50",C={headerContainer:jn,navigationTabList:xn,navigationTab:Tn,headerContent:In,staticEnabled:Nn},wn=77,A=({sticky:e,children:n})=>{const{ref:t,height:r}=vn({refreshMode:"debounce",refreshRate:0}),[a,s]=h.useState(!1),c=()=>a?!e:!0;h.useEffect(()=>{const u=()=>{s(window.scrollY>0)};return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]);const l=`${r||wn}px`;return i.jsx("div",{style:{minHeight:l},children:i.jsx("div",{children:i.jsxs("div",{ref:t,className:L(C.headerContent,{[C.staticEnabled]:c()}),children:[i.jsx(A.Header,{}),i.jsx(A.Tabs,{}),n]})})})};A.Header=({children:e})=>i.jsx("div",{className:C.headerContainer,children:e});A.Tabs=({children:e})=>i.jsx("div",{className:"flex justify-between gap-2 nowrap",children:e});const yn="_sidebarContainer_bmdti_1",Sn={sidebarContainer:yn},Pn="_logoLink_1baxb_1",En={logoLink:Pn},Ln=({src:e,href:n="/",ariaLabel:t="Home",alt:r="Lokalise"})=>i.jsx("a",{className:En.logoLink,href:n,"aria-label":t,children:i.jsx("img",{src:e,alt:r})}),Rn="_link_1weq1_1",Cn="_active_1weq1_18",Se={link:Rn,active:Cn},On=({label:e,to:n,icon:t})=>i.jsx(f.Tooltip,{placement:"right",tooltip:e,children:i.jsx(f.Link,{className:L(Se.link,{[Se.active]:window.location.pathname.startsWith(n)}),href:n,children:i.jsx(t,{size:"25px"})})}),kn="_dropdownButton_hwh0c_1",An="_dropdownButtonActive_hwh0c_18",Pe={dropdownButton:kn,dropdownButtonActive:An},Mn=({children:e,icon:n})=>i.jsx(f.Menu,{menuButton:({opened:t})=>i.jsx(f.Tooltip,{placement:"right",tooltip:"Help",children:i.jsx("button",{type:"button",className:L(Pe.dropdownButton,{[Pe.dropdownButtonActive]:t}),children:i.jsx(n,{size:"25px"})})}),children:i.jsx(f.MenuList,{placement:"right-start",children:e})}),qn="_iconContainer_nz34m_1",Dn={iconContainer:qn},$e=({className:e=""})=>i.jsx("div",{"aria-label":"Upgrade Icon",className:L(Dn.iconContainer,"flex-row","items-center","justify-center",e),children:i.jsx(f.CaretUpIcon,{})}),Bn="_menuContainer_wbu3u_5",Un="_profileButton_wbu3u_16",$n="_profileImage_wbu3u_29",zn="_profileImageHighlight_wbu3u_37",Fn="_profileImageUpgradeIcon_wbu3u_41",Wn="_userIconWrapper_wbu3u_47",P={menuContainer:Bn,profileButton:Un,profileImage:$n,profileImageHighlight:zn,profileImageUpgradeIcon:Fn,userIconWrapper:Wn},ze=h.createContext({}),M=()=>h.useContext(ze),Hn=({children:e})=>{const{currentTeam:n,otherTeams:t,showUpgradeCta:r,showBillingButton:a,allowTeamCreation:s,isLimitedView:c,isProviderAlpha:l,canAccessTeamSettings:u,isEndOfTrialActive:o,isTeamSuspended:d}=M();return i.jsx(f.Menu,{menuButton:()=>i.jsxs("button",{className:P.profileButton,"aria-label":"Profile menu",type:"button",children:[n!=null&&n.logoUrl?i.jsx("img",{src:n.logoUrl,className:L(P.profileImage,{[P.profileImageHighlight]:r}),alt:"Team Logo"}):i.jsx("div",{className:L(P.userIconWrapper,"flex-row","align-center","items-center",{[P.profileImageHighlight]:r}),children:i.jsx(f.UserIcon,{size:"25px"})}),r&&i.jsx($e,{className:P.profileImageUpgradeIcon})]}),children:i.jsx(f.MenuList,{placement:"right-end",className:P.menuContainer,children:e({allowTeamCreation:s,otherTeams:t,isLimitedView:c,canAccessTeamSettings:u,isEndOfTrialActive:o,isTeamSuspended:d,showBillingButton:a,isProviderAlpha:l})})})},se=0,Fe=9999,We=[150,151,250,251],He=[152,153,252,253],Ge=[154,155,157,158,254,255,258,354,355,358],Ve=[156,159,160,256,259,260],oe=9998,U=e=>e===se,ce=e=>e===Fe,Gn=e=>We.includes(e),Vn=e=>He.includes(e),Yn=e=>Ge.includes(e),Zn=e=>Ve.includes(e),Xn=e=>e>se&&e<oe,Jn=e=>e===oe,Kn=/\n/,Ee=(e,n,t)=>e.split(n).flatMap((r,a)=>a!==0?[h.cloneElement(t,{key:Math.random().toString(32).slice(0,10)}),r]:r),Qn=(e,n,t)=>typeof e=="string"?Ee(e,n,t):e.flatMap(r=>typeof r=="string"?Ee(r,n,t):r),et=e=>Qn(e,Kn,i.jsx("br",{})),nt=/(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi,tt=e=>e.match(nt)??[],Le=(e,n,t)=>{const r=e.split(n);if(r.length===1)return e;const a=[];return r[0]!==""&&a.push(r[0]),r.shift(),r[r.length-1]===""&&r.pop(),a.push(i.jsx("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:n},n+t)),a.push(r.join(n)),a.filter(s=>s!=="")},Re=e=>{const n=tt(e);return n!=null&&n.length?n.reduce((t,r,a)=>typeof t=="string"?Le(t,r,a):t.flatMap(s=>typeof s=="string"?Le(s,r,a):s),e):e},rt=e=>typeof e=="string"?Re(e):e.flatMap(n=>typeof n=="string"?Re(n):n,e),it=(e,n="PP")=>Ae.format(e,n),at=(e,n,t="PP")=>Ae.format(Je.toZonedTime(e,n),t),st=e=>{h.useEffect(e,[])},ot=({children:e,config:n})=>{const{teams:t,currentTeamId:r,planId:a,isLimitedView:s,isTeamSuspended:c,canAccessTeamSettings:l,isEndOfTrialActive:u}=n,o=t.find(g=>g.id===r),d=t.filter(g=>g.id!==r),p=(o==null?void 0:o.role)??"",j=["biller","owner"].includes(p),x=U(a)||ce(a),y={...n,currentTeam:o,otherTeams:d,canChangeBilling:j,isOnFreeOrTrialPlan:x,showUpgradeCta:!s&&x&&j&&!c,showBillingButton:!s&&l&&j,allowTeamCreation:!s&&!u};return i.jsx(ze.Provider,{value:y,children:e})},ct=({config:e,children:n})=>i.jsx(ot,{config:e,children:i.jsx(Hn,{children:n})}),lt="_container_q5pot_1",ut="_profileEmail_q5pot_5",Ce={container:lt,profileEmail:ut},dt=({href:e,onClick:n,userEmail:t,hideBottomDivider:r})=>{const{isEndOfTrialActive:a,isTeamSuspended:s}=M();return a||s?null:i.jsxs(i.Fragment,{children:[i.jsx(f.MenuItem,{href:e,onClick:()=>{n==null||n()},children:i.jsxs("div",{className:`flex-col ${Ce.container}`,children:[i.jsx("span",{children:"Profile Settings"}),i.jsx("span",{className:Ce.profileEmail,children:t})]})}),!r&&i.jsx(f.MenuDivider,{})]})},ft="_wrapper_15d85_1",mt="_profileImage_15d85_14",gt="_teamName_15d85_22",bt="_planLabel_15d85_29",pt="_membership_15d85_38",ht="_defaultProfileImage_15d85_44",R={wrapper:ft,profileImage:mt,teamName:gt,planLabel:bt,membership:pt,defaultProfileImage:ht},Ye=({team:e,onClick:n,hidePlanLabel:t})=>{const{currentTeam:r,planId:a}=M(),s=e||r;if(!s)return null;const c=U(a)?"Free":ce(a)?"Trial":void 0,l=n?f.MenuItem:"div";return i.jsxs(l,{className:`flex-row gap-2 flex-nowrap items-center ${R.wrapper}`,...n&&{onClick:()=>n(s)},children:[s.logoUrl?i.jsx("img",{className:R.profileImage,src:s.logoUrl,alt:"Team Logo"}):i.jsx("span",{className:`flex-row justify-center items-center ${R.defaultProfileImage}`,children:i.jsx(f.UserIcon,{size:"25px"})}),i.jsxs("div",{className:"flex-col items-start",children:[i.jsxs("div",{className:"flex-row items-center flex-nowrap gap-2",children:[i.jsx("span",{title:s.name,className:R.teamName,children:s.name}),c&&!t&&i.jsx("span",{className:`flex-row justify-center items-center ${R.planLabel}`,children:c})]}),i.jsx("span",{className:R.membership,children:s.role})]})]})},_t="_teamsContainer_1t68g_1",vt={teamsContainer:_t},jt=({onSwitchTeam:e})=>{const{otherTeams:n}=M();return n.length===0?null:i.jsx("div",{className:`flex-col items-stretch ${vt.teamsContainer}`,children:n.map(t=>i.jsx(Ye,{team:t,onClick:e,hidePlanLabel:!0},t.id))})},xt="_container_1u995_1",Tt="_planCta_1u995_15",It="_upgradeIconWrapper_1u995_19",re={container:xt,planCta:Tt,upgradeIconWrapper:It},Nt=({upgradeOptionHref:e})=>{const{planId:n,trialDaysLeft:t,showUpgradeCta:r}=M();if(!r)return null;const c=U(n)?"Your team is currently on the Free plan":`Free trial ends in ${t} ${t===1?"day":"days"}`;return i.jsxs(f.MenuItem,{href:e,className:`flex-col gap-1 items-start ${re.container}`,children:[i.jsx("span",{className:re.planCta,children:c}),i.jsxs("div",{className:`flex-row items-center gap-1 ${re.upgradeIconWrapper}`,children:[i.jsx($e,{}),i.jsx("span",{children:"See upgrade options"})]})]})},I=({children:e,...n})=>i.jsx("nav",{...n,className:Sn.sidebarContainer,children:e});I.Top=({children:e})=>i.jsx("div",{children:e});I.Bottom=({children:e})=>i.jsx("div",{children:e});I.Avatar=Ln;I.IconLink=On;I.Menu=Mn;I.ProfileMenu=ct;I.TeamSwitch=jt;I.TeamMenuItem=Ye;I.UpgradeMenuItem=Nt;I.ProfileSettingsMenuItem=dt;const wt="_breadcrumbsItem_1hm6a_1",yt="_breadcrumbs_1hm6a_1",Oe={breadcrumbsItem:wt,breadcrumbs:yt},St=({items:e})=>i.jsx("nav",{"aria-label":"breadcrumb",className:Oe.breadcrumbs,children:e.map((n,t)=>i.jsxs(h.Fragment,{children:[i.jsx(f.Link,{className:Oe.breadcrumbsItem,href:n.link,rel:"noreferrer",children:n.name}),t<e.length-1&&i.jsx("span",{children:" — "})]},`${n.link}-${n.name}`))}),Pt=({items:e})=>i.jsx(i.Fragment,{children:e.map((n,t)=>i.jsxs(h.Fragment,{children:[!!t&&n.some(r=>r.visible)&&i.jsx(f.MenuDivider,{}),n.filter(({visible:r})=>r).map(({link:r,label:a,onClick:s})=>i.jsx(f.MenuItem,{href:r||"#","aria-label":a,onClick:s,children:a},a))]},n[0].label))}),Et="_badge_1pc1v_1",Lt="_tag_1pc1v_15",Rt="_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21",Ct="_disabled_1pc1v_57",Ot="_projectNavigationItem_1pc1v_61",kt="_projectNavigationItemDisabled_1pc1v_67",E={badge:Et,tag:Lt,withNavLinkStyle:Rt,disabled:Ct,projectNavigationItem:Ot,projectNavigationItemDisabled:kt},ke=({label:e,badge:n,novel:t})=>i.jsxs("div",{className:"flex gap-1",children:[i.jsxs("div",{children:[i.jsx("span",{children:e}),!!n&&i.jsx("div",{className:E.badge,"aria-label":`${n} items requiring attention`,children:n>9?"9+":n})]}),!!t&&i.jsx(f.Tag,{className:E.tag,children:t})]}),ie=h.forwardRef(({label:e,href:n="",disabled:t=!1,badge:r,onClick:a,novel:s},c)=>i.jsx(f.Tooltip,{tooltip:"You do not have access to this function",show:t,children:i.jsx("div",{className:t?E.projectNavigationItemDisabled:E.projectNavigationItem,children:a||t||!n?i.jsx("button",{type:"button",ref:c,className:L(E.withNavLinkStyle,{[E.disabled]:t}),disabled:t,onClick:a,children:i.jsx(ke,{label:e,badge:r,novel:s})}):i.jsx("a",{href:n,className:E.withNavLinkStyle,children:i.jsx(ke,{label:e,badge:r,novel:s})})})}));ie.displayName="NavigationTabsItem";const At=e=>(e==null?void 0:e.some(n=>n.some(t=>t.visible)))??!1,Mt=e=>e.visible&&(!e.dropdown||At(e.dropdown)),qt=({navigation:e,activeItem:n})=>i.jsx("nav",{"aria-label":"Project",children:i.jsx("ul",{className:C.navigationTabList,"aria-orientation":"horizontal",children:e.filter(Mt).map(t=>{var r,a,s;return t.dropdown?i.jsx("li",{className:C.navigationTab,"data-testid":t.key,"aria-selected":(r=t.isActive)==null?void 0:r.call(t,n),children:i.jsx(f.Menu,{menuButton:({opened:c})=>i.jsx(ie,{label:t.label,disabled:t.disabled,active:c}),children:i.jsx(f.MenuList,{children:i.jsx(Pt,{items:t.dropdown})})})},t.key):i.jsx("li",{className:C.navigationTab,"data-testid":t.key,"aria-selected":(a=t.isActive)==null?void 0:a.call(t,n),children:i.jsx(ie,{label:t.label,href:t.link,onClick:t.onClick,disabled:t.disabled,badge:t.badge,novel:t.novel,active:(s=t.isActive)==null?void 0:s.call(t,n)})},t.key)})})});exports.Breadcrumbs=St;exports.ENTERPRISE_OPENSOURCE_PLAN_ID=oe;exports.ENTERPRISE_PLAN_IDS=Ve;exports.ESSENTIAL_PLAN_IDS=He;exports.FREE_PLAN_ID=se;exports.NavigationPanel=A;exports.NavigationTabs=qt;exports.PRO_PLAN_IDS=Ge;exports.START_PLAN_IDS=We;exports.Sidebar=I;exports.TRIAL_PLAN_ID=Fe;exports.convertNewLineToBreakTag=et;exports.formatDate=it;exports.formatDateTz=at;exports.isEnterpriseOpenSourcePlan=Jn;exports.isEnterprisePlan=Zn;exports.isEssentialPlan=Vn;exports.isFreePlan=U;exports.isPaidPlan=Xn;exports.isProPlan=Yn;exports.isStartPlan=Gn;exports.isTrialPlan=ce;exports.makeUrlClickable=rt;exports.useEffectOnce=st;
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),h=require("react"),f=require("@lokalise/louis"),qe=require("date-fns"),Qe=require("date-fns-tz");function en(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const k=en(h);var B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z,fe;function ae(){if(fe)return z;fe=1;function e(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}return z=e,z}var F,me;function nn(){if(me)return F;me=1;var e=typeof B=="object"&&B&&B.Object===Object&&B;return F=e,F}var W,ge;function Be(){if(ge)return W;ge=1;var e=nn(),n=typeof self=="object"&&self&&self.Object===Object&&self,t=e||n||Function("return this")();return W=t,W}var H,be;function tn(){if(be)return H;be=1;var e=Be(),n=function(){return e.Date.now()};return H=n,H}var G,he;function rn(){if(he)return G;he=1;var e=/\s/;function n(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}return G=n,G}var V,pe;function an(){if(pe)return V;pe=1;var e=rn(),n=/^\s+/;function t(r){return r&&r.slice(0,e(r)+1).replace(n,"")}return V=t,V}var Y,_e;function $e(){if(_e)return Y;_e=1;var e=Be(),n=e.Symbol;return Y=n,Y}var Z,ve;function sn(){if(ve)return Z;ve=1;var e=$e(),n=Object.prototype,t=n.hasOwnProperty,r=n.toString,a=e?e.toStringTag:void 0;function s(o){var l=t.call(o,a),u=o[a];try{o[a]=void 0;var c=!0}catch{}var d=r.call(o);return c&&(l?o[a]=u:delete o[a]),d}return Z=s,Z}var X,je;function on(){if(je)return X;je=1;var e=Object.prototype,n=e.toString;function t(r){return n.call(r)}return X=t,X}var J,xe;function cn(){if(xe)return J;xe=1;var e=$e(),n=sn(),t=on(),r="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?a:r:s&&s in Object(l)?n(l):t(l)}return J=o,J}var K,Te;function ln(){if(Te)return K;Te=1;function e(n){return n!=null&&typeof n=="object"}return K=e,K}var Q,Ie;function un(){if(Ie)return Q;Ie=1;var e=cn(),n=ln(),t="[object Symbol]";function r(a){return typeof a=="symbol"||n(a)&&e(a)==t}return Q=r,Q}var ee,Ne;function dn(){if(Ne)return ee;Ne=1;var e=an(),n=ae(),t=un(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function u(c){if(typeof c=="number")return c;if(t(c))return r;if(n(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=n(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var b=s.test(c);return b||o.test(c)?l(c.slice(2),b?2:8):a.test(c)?r:+c}return ee=u,ee}var ne,we;function Ue(){if(we)return ne;we=1;var e=ae(),n=tn(),t=dn(),r="Expected a function",a=Math.max,s=Math.min;function o(l,u,c){var d,b,T,w,g,j,I=0,N=!1,p=!1,y=!0;if(typeof l!="function")throw new TypeError(r);u=t(u)||0,e(c)&&(N=!!c.leading,p="maxWait"in c,T=p?a(t(c.maxWait)||0,u):T,y="trailing"in c?!!c.trailing:y);function v(m){var S=d,O=b;return d=b=void 0,I=m,w=l.apply(O,S),w}function _(m){return I=m,g=setTimeout(D,u),N?v(m):w}function q(m){var S=m-j,O=m-I,de=u-S;return p?s(de,T-O):de}function le(m){var S=m-j,O=m-I;return j===void 0||S>=u||S<0||p&&O>=T}function D(){var m=n();if(le(m))return ue(m);g=setTimeout(D,q(m))}function ue(m){return g=void 0,y&&d?v(m):(d=b=void 0,w)}function Je(){g!==void 0&&clearTimeout(g),I=0,d=j=b=g=void 0}function Ke(){return g===void 0?w:ue(n())}function U(){var m=n(),S=le(m);if(d=arguments,b=this,j=m,S){if(g===void 0)return _(j);if(p)return clearTimeout(g),g=setTimeout(D,u),v(j)}return g===void 0&&(g=setTimeout(D,u)),w}return U.cancel=Je,U.flush=Ke,U}return ne=o,ne}var fn=Ue();const mn=De(fn);var te,ye;function gn(){if(ye)return te;ye=1;var e=Ue(),n=ae(),t="Expected a function";function r(a,s,o){var l=!0,u=!0;if(typeof a!="function")throw new TypeError(t);return n(o)&&(l="leading"in o?!!o.leading:l,u="trailing"in o?!!o.trailing:u),e(a,s,{leading:l,maxWait:s,trailing:u})}return te=r,te}var bn=gn();const hn=De(bn),pn=(e,n,t,r)=>{switch(n){case"debounce":return mn(e,t,r);case"throttle":return hn(e,t,r);default:return e}},_n=e=>{const n=k.useRef(e);return k.useEffect(()=>{n.current=e}),k.useMemo(()=>(...t)=>{var r;return(r=n.current)===null||r===void 0?void 0:r.call(n,...t)},[])},vn=e=>{const[n,t]=k.useState((e==null?void 0:e.current)||null);return e&&setTimeout(()=>{e.current!==n&&t(e.current)},0),{refProxy:k.useMemo(()=>new Proxy(a=>{a!==n&&t(a)},{get(a,s){return s==="current"?n:a[s]},set(a,s,o){return s==="current"?t(o):a[s]=o,!0}}),[n]),refElement:n,setRefElement:t}},jn=(e,n)=>n==="border-box"?{width:e.borderBoxSize[0].inlineSize,height:e.borderBoxSize[0].blockSize}:n==="content-box"?{width:e.contentBoxSize[0].inlineSize,height:e.contentBoxSize[0].blockSize}:{width:e.contentRect.width,height:e.contentRect.height};function xn({skipOnMount:e=!1,refreshMode:n,refreshRate:t=1e3,refreshOptions:r,handleWidth:a=!0,handleHeight:s=!0,targetRef:o,observerOptions:l,onResize:u}={}){const c=h.useRef(e),d=_n(u),[b,T]=h.useState({width:void 0,height:void 0}),{refProxy:w,refElement:g}=vn(o),{box:j}=l||{},I=h.useCallback(p=>{if(!a&&!s)return;if(c.current){c.current=!1;return}const y=(v,_)=>a&&v.width!==_.width||s&&v.height!==_.height;p.forEach(v=>{const _=jn(v,j);T(q=>y(q,_)?(d==null||d({width:_.width,height:_.height,entry:v}),_):q)})},[a,s,c,j]),N=h.useCallback(pn(I,n,t,r),[I,n,t,r]);return h.useEffect(()=>{let p;return g?(p=new window.ResizeObserver(N),p.observe(g,l)):(b.width||b.height)&&(d==null||d({width:null,height:null,entry:null}),T({width:void 0,height:void 0})),()=>{var y,v,_;(y=p==null?void 0:p.disconnect)===null||y===void 0||y.call(p),(_=(v=N).cancel)===null||_===void 0||_.call(v)}},[N,g]),Object.assign({ref:w},b)}function ze(e){var n,t,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(t=ze(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function L(){for(var e,n,t=0,r="",a=arguments.length;t<a;t++)(e=arguments[t])&&(n=ze(e))&&(r&&(r+=" "),r+=n);return r}const Tn="_headerContainer_1cubo_1",In="_navigationTabList_1cubo_8",Nn="_navigationTab_1cubo_8",wn="_headerContent_1cubo_34",yn="_staticEnabled_1cubo_50",C={headerContainer:Tn,navigationTabList:In,navigationTab:Nn,headerContent:wn,staticEnabled:yn},Sn=77,A=({sticky:e,children:n})=>{const{ref:t,height:r}=xn({refreshMode:"debounce",refreshRate:0}),[a,s]=h.useState(!1),o=()=>a?!e:!0;h.useEffect(()=>{const u=()=>{s(window.scrollY>0)};return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]);const l=`${r||Sn}px`;return i.jsx("div",{style:{minHeight:l},children:i.jsx("div",{children:i.jsxs("div",{ref:t,className:L(C.headerContent,{[C.staticEnabled]:o()}),children:[i.jsx(A.Header,{}),i.jsx(A.Tabs,{}),n]})})})};A.Header=({children:e})=>i.jsx("div",{className:C.headerContainer,children:e});A.Tabs=({children:e})=>i.jsx("div",{className:"flex justify-between gap-2 nowrap",children:e});const Pn="_sidebarContainer_bmdti_1",En={sidebarContainer:Pn},Ln="_logoLink_1baxb_1",Rn={logoLink:Ln},Cn=({src:e,href:n="/",ariaLabel:t="Home",alt:r="Lokalise"})=>i.jsx("a",{className:Rn.logoLink,href:n,"aria-label":t,children:i.jsx("img",{src:e,alt:r})}),On="_link_1weq1_1",kn="_active_1weq1_18",Se={link:On,active:kn},An=({label:e,to:n,icon:t})=>i.jsx(f.Tooltip,{placement:"right",tooltip:e,children:i.jsx(f.Link,{className:L(Se.link,{[Se.active]:window.location.pathname.startsWith(n)}),href:n,children:i.jsx(t,{size:"25px"})})}),Mn="_dropdownButton_hwh0c_1",qn="_dropdownButtonActive_hwh0c_18",Pe={dropdownButton:Mn,dropdownButtonActive:qn},Dn=({children:e,icon:n})=>i.jsx(f.Menu,{menuButton:({opened:t})=>i.jsx(f.Tooltip,{placement:"right",tooltip:"Help",children:i.jsx("button",{type:"button",className:L(Pe.dropdownButton,{[Pe.dropdownButtonActive]:t}),children:i.jsx(n,{size:"25px"})})}),children:i.jsx(f.MenuList,{placement:"right-start",children:e})}),Bn="_iconContainer_nz34m_1",$n={iconContainer:Bn},Fe=({className:e=""})=>i.jsx("div",{"aria-label":"Upgrade Icon",className:L($n.iconContainer,"flex-row","items-center","justify-center",e),children:i.jsx(f.CaretUpIcon,{})}),Un="_menuContainer_wbu3u_5",zn="_profileButton_wbu3u_16",Fn="_profileImage_wbu3u_29",Wn="_profileImageHighlight_wbu3u_37",Hn="_profileImageUpgradeIcon_wbu3u_41",Gn="_userIconWrapper_wbu3u_47",P={menuContainer:Un,profileButton:zn,profileImage:Fn,profileImageHighlight:Wn,profileImageUpgradeIcon:Hn,userIconWrapper:Gn},We=h.createContext({}),M=()=>h.useContext(We),Vn=({children:e})=>{const{currentTeam:n,otherTeams:t,showUpgradeCta:r,showBillingButton:a,allowTeamCreation:s,isProviderAlpha:o,canAccessTeamSettings:l,isEndOfTrialActive:u,isTeamSuspended:c,isFullyAuthenticated:d}=M();return i.jsx(f.Menu,{menuButton:()=>i.jsxs("button",{className:P.profileButton,"aria-label":"Profile menu",type:"button",children:[n!=null&&n.logoUrl?i.jsx("img",{src:n.logoUrl,className:L(P.profileImage,{[P.profileImageHighlight]:r}),alt:"Team Logo"}):i.jsx("div",{className:L(P.userIconWrapper,"flex-row","align-center","items-center",{[P.profileImageHighlight]:r}),children:i.jsx(f.UserIcon,{size:"25px"})}),r&&i.jsx(Fe,{className:P.profileImageUpgradeIcon})]}),children:i.jsx(f.MenuList,{placement:"right-end",className:P.menuContainer,children:e({allowTeamCreation:s,otherTeams:t,canAccessTeamSettings:l,isEndOfTrialActive:u,isTeamSuspended:c,showBillingButton:a,isProviderAlpha:o,isFullyAuthenticated:d})})})},se=0,He=9999,Ge=[150,151,250,251],Ve=[152,153,252,253],Ye=[154,155,157,158,254,255,258,354,355,358],Ze=[156,159,160,256,259,260],oe=9998,$=e=>e===se,ce=e=>e===He,Yn=e=>Ge.includes(e),Zn=e=>Ve.includes(e),Xn=e=>Ye.includes(e),Jn=e=>Ze.includes(e),Kn=e=>e>se&&e<oe,Qn=e=>e===oe,et=/\n/,Ee=(e,n,t)=>e.split(n).flatMap((r,a)=>a!==0?[h.cloneElement(t,{key:Math.random().toString(32).slice(0,10)}),r]:r),nt=(e,n,t)=>typeof e=="string"?Ee(e,n,t):e.flatMap(r=>typeof r=="string"?Ee(r,n,t):r),tt=e=>nt(e,et,i.jsx("br",{})),rt=/(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi,it=e=>e.match(rt)??[],Le=(e,n,t)=>{const r=e.split(n);if(r.length===1)return e;const a=[];return r[0]!==""&&a.push(r[0]),r.shift(),r[r.length-1]===""&&r.pop(),a.push(i.jsx("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:n},n+t)),a.push(r.join(n)),a.filter(s=>s!=="")},Re=e=>{const n=it(e);return n!=null&&n.length?n.reduce((t,r,a)=>typeof t=="string"?Le(t,r,a):t.flatMap(s=>typeof s=="string"?Le(s,r,a):s),e):e},at=e=>typeof e=="string"?Re(e):e.flatMap(n=>typeof n=="string"?Re(n):n,e),st=(e,n="PP")=>qe.format(e,n),ot=(e,n,t="PP")=>qe.format(Qe.toZonedTime(e,n),t),ct=e=>{h.useEffect(e,[])},Ce={biller:"biller",owner:"owner"},Oe=[Ce.biller,Ce.owner],lt=({children:e,config:n})=>{const{teams:t,currentTeamId:r,planId:a,isEndOfTrialActive:s,isFullyAuthenticated:o,userTeamRole:l}=n,u=t.find(N=>N.id===r),c=t.filter(N=>N.id!==r),d=Oe.includes(l),b=Oe.includes(l),T=$(a)||ce(a),I={...n,currentTeam:u,otherTeams:c,canChangeBilling:d,canAccessTeamSettings:b,isOnFreeOrTrialPlan:T,showUpgradeCta:o&&T&&d,showBillingButton:o&&b&&d,allowTeamCreation:o&&!s};return i.jsx(We.Provider,{value:I,children:e})},ut=({config:e,children:n})=>i.jsx(lt,{config:e,children:i.jsx(Vn,{children:n})}),dt="_container_q5pot_1",ft="_profileEmail_q5pot_5",ke={container:dt,profileEmail:ft},mt=({href:e,onClick:n,userEmail:t,hideBottomDivider:r})=>{const{isEndOfTrialActive:a,isTeamSuspended:s}=M();return a||s?null:i.jsxs(i.Fragment,{children:[i.jsx(f.MenuItem,{href:e,onClick:()=>{n==null||n()},children:i.jsxs("div",{className:`flex-col ${ke.container}`,children:[i.jsx("span",{children:"Profile Settings"}),i.jsx("span",{className:ke.profileEmail,children:t})]})}),!r&&i.jsx(f.MenuDivider,{})]})},gt="_wrapper_15d85_1",bt="_profileImage_15d85_14",ht="_teamName_15d85_22",pt="_planLabel_15d85_29",_t="_membership_15d85_38",vt="_defaultProfileImage_15d85_44",R={wrapper:gt,profileImage:bt,teamName:ht,planLabel:pt,membership:_t,defaultProfileImage:vt},Xe=({team:e,onClick:n,hidePlanLabel:t})=>{const{currentTeam:r,planId:a}=M(),s=e||r;if(!s)return null;const o=$(a)?"Free":ce(a)?"Trial":void 0,l=n?f.MenuItem:"div";return i.jsxs(l,{className:`flex-row gap-2 flex-nowrap items-center ${R.wrapper}`,...n&&{onClick:()=>n(s)},children:[s.logoUrl?i.jsx("img",{className:R.profileImage,src:s.logoUrl,alt:"Team Logo"}):i.jsx("span",{className:`flex-row justify-center items-center ${R.defaultProfileImage}`,children:i.jsx(f.UserIcon,{size:"25px"})}),i.jsxs("div",{className:"flex-col items-start",children:[i.jsxs("div",{className:"flex-row items-center flex-nowrap gap-2",children:[i.jsx("span",{title:s.name,className:R.teamName,children:s.name}),o&&!t&&i.jsx("span",{className:`flex-row justify-center items-center ${R.planLabel}`,children:o})]}),i.jsx("span",{className:R.membership,children:s.role})]})]})},jt="_teamsContainer_1t68g_1",xt={teamsContainer:jt},Tt=({onSwitchTeam:e})=>{const{otherTeams:n}=M();return n.length===0?null:i.jsx("div",{className:`flex-col items-stretch ${xt.teamsContainer}`,children:n.map(t=>i.jsx(Xe,{team:t,onClick:e,hidePlanLabel:!0},t.id))})},It="_container_1u995_1",Nt="_planCta_1u995_15",wt="_upgradeIconWrapper_1u995_19",re={container:It,planCta:Nt,upgradeIconWrapper:wt},yt=({upgradeOptionHref:e})=>{const{planId:n,trialDaysLeft:t,showUpgradeCta:r}=M();if(!r)return null;const o=$(n)?"Your team is currently on the Free plan":`Free trial ends in ${t} ${t===1?"day":"days"}`;return i.jsxs(f.MenuItem,{href:e,className:`flex-col gap-1 items-start ${re.container}`,children:[i.jsx("span",{className:re.planCta,children:o}),i.jsxs("div",{className:`flex-row items-center gap-1 ${re.upgradeIconWrapper}`,children:[i.jsx(Fe,{}),i.jsx("span",{children:"See upgrade options"})]})]})},x=({children:e,...n})=>i.jsx("nav",{...n,className:En.sidebarContainer,children:e});x.Top=({children:e})=>i.jsx("div",{children:e});x.Bottom=({children:e})=>i.jsx("div",{children:e});x.Avatar=Cn;x.IconLink=An;x.Menu=Dn;x.ProfileMenu=ut;x.TeamSwitch=Tt;x.TeamMenuItem=Xe;x.UpgradeMenuItem=yt;x.ProfileSettingsMenuItem=mt;const St="_breadcrumbsItem_1hm6a_1",Pt="_breadcrumbs_1hm6a_1",Ae={breadcrumbsItem:St,breadcrumbs:Pt},Et=({items:e})=>i.jsx("nav",{"aria-label":"breadcrumb",className:Ae.breadcrumbs,children:e.map((n,t)=>i.jsxs(h.Fragment,{children:[i.jsx(f.Link,{className:Ae.breadcrumbsItem,href:n.link,rel:"noreferrer",children:n.name}),t<e.length-1&&i.jsx("span",{children:" — "})]},`${n.link}-${n.name}`))}),Lt=({items:e})=>i.jsx(i.Fragment,{children:e.map((n,t)=>i.jsxs(h.Fragment,{children:[!!t&&n.some(r=>r.visible)&&i.jsx(f.MenuDivider,{}),n.filter(({visible:r})=>r).map(({link:r,label:a,onClick:s})=>i.jsx(f.MenuItem,{href:r||"#","aria-label":a,onClick:s,children:a},a))]},n[0].label))}),Rt="_badge_1pc1v_1",Ct="_tag_1pc1v_15",Ot="_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21",kt="_disabled_1pc1v_57",At="_projectNavigationItem_1pc1v_61",Mt="_projectNavigationItemDisabled_1pc1v_67",E={badge:Rt,tag:Ct,withNavLinkStyle:Ot,disabled:kt,projectNavigationItem:At,projectNavigationItemDisabled:Mt},Me=({label:e,badge:n,novel:t})=>i.jsxs("div",{className:"flex gap-1",children:[i.jsxs("div",{children:[i.jsx("span",{children:e}),!!n&&i.jsx("div",{className:E.badge,"aria-label":`${n} items requiring attention`,children:n>9?"9+":n})]}),!!t&&i.jsx(f.Tag,{className:E.tag,children:t})]}),ie=h.forwardRef(({label:e,href:n="",disabled:t=!1,badge:r,onClick:a,novel:s},o)=>i.jsx(f.Tooltip,{tooltip:"You do not have access to this function",show:t,children:i.jsx("div",{className:t?E.projectNavigationItemDisabled:E.projectNavigationItem,children:a||t||!n?i.jsx("button",{type:"button",ref:o,className:L(E.withNavLinkStyle,{[E.disabled]:t}),disabled:t,onClick:a,children:i.jsx(Me,{label:e,badge:r,novel:s})}):i.jsx("a",{href:n,className:E.withNavLinkStyle,children:i.jsx(Me,{label:e,badge:r,novel:s})})})}));ie.displayName="NavigationTabsItem";const qt=e=>(e==null?void 0:e.some(n=>n.some(t=>t.visible)))??!1,Dt=e=>e.visible&&(!e.dropdown||qt(e.dropdown)),Bt=({navigation:e,activeItem:n})=>i.jsx("nav",{"aria-label":"Project",children:i.jsx("ul",{className:C.navigationTabList,"aria-orientation":"horizontal",children:e.filter(Dt).map(t=>{var r,a,s;return t.dropdown?i.jsx("li",{className:C.navigationTab,"data-testid":t.key,"aria-selected":(r=t.isActive)==null?void 0:r.call(t,n),children:i.jsx(f.Menu,{menuButton:({opened:o})=>i.jsx(ie,{label:t.label,disabled:t.disabled,active:o}),children:i.jsx(f.MenuList,{children:i.jsx(Lt,{items:t.dropdown})})})},t.key):i.jsx("li",{className:C.navigationTab,"data-testid":t.key,"aria-selected":(a=t.isActive)==null?void 0:a.call(t,n),children:i.jsx(ie,{label:t.label,href:t.link,onClick:t.onClick,disabled:t.disabled,badge:t.badge,novel:t.novel,active:(s=t.isActive)==null?void 0:s.call(t,n)})},t.key)})})});exports.Breadcrumbs=Et;exports.ENTERPRISE_OPENSOURCE_PLAN_ID=oe;exports.ENTERPRISE_PLAN_IDS=Ze;exports.ESSENTIAL_PLAN_IDS=Ve;exports.FREE_PLAN_ID=se;exports.NavigationPanel=A;exports.NavigationTabs=Bt;exports.PRO_PLAN_IDS=Ye;exports.START_PLAN_IDS=Ge;exports.Sidebar=x;exports.TRIAL_PLAN_ID=He;exports.convertNewLineToBreakTag=tt;exports.formatDate=st;exports.formatDateTz=ot;exports.isEnterpriseOpenSourcePlan=Qn;exports.isEnterprisePlan=Jn;exports.isEssentialPlan=Zn;exports.isFreePlan=$;exports.isPaidPlan=Kn;exports.isProPlan=Xn;exports.isStartPlan=Yn;exports.isTrialPlan=ce;exports.makeUrlClickable=at;exports.useEffectOnce=ct;
|
package/dist/harmony.mjs
CHANGED
@@ -1,48 +1,48 @@
|
|
1
|
-
import { jsx as i, jsxs as b, Fragment as
|
1
|
+
import { jsx as i, jsxs as b, Fragment as $e } from "react/jsx-runtime";
|
2
2
|
import * as k from "react";
|
3
|
-
import { useRef as
|
4
|
-
import { Tooltip as ae, Link as
|
5
|
-
import { format as
|
6
|
-
import { toZonedTime as
|
3
|
+
import { useRef as on, useState as Ue, useCallback as me, useEffect as ie, useContext as sn, createContext as cn, cloneElement as ln, Fragment as De, forwardRef as un } from "react";
|
4
|
+
import { Tooltip as ae, Link as ze, Menu as oe, MenuList as se, CaretUpIcon as dn, UserIcon as Fe, MenuItem as $, MenuDivider as We, Tag as fn } from "@lokalise/louis";
|
5
|
+
import { format as He } from "date-fns";
|
6
|
+
import { toZonedTime as mn } from "date-fns-tz";
|
7
7
|
var B = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
8
|
-
function
|
8
|
+
function Ge(e) {
|
9
9
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
10
10
|
}
|
11
|
-
var D,
|
11
|
+
var D, he;
|
12
12
|
function ce() {
|
13
|
-
if (
|
14
|
-
|
13
|
+
if (he) return D;
|
14
|
+
he = 1;
|
15
15
|
function e(n) {
|
16
16
|
var t = typeof n;
|
17
17
|
return n != null && (t == "object" || t == "function");
|
18
18
|
}
|
19
19
|
return D = e, D;
|
20
20
|
}
|
21
|
-
var z,
|
22
|
-
function
|
23
|
-
if (
|
24
|
-
|
21
|
+
var z, ge;
|
22
|
+
function hn() {
|
23
|
+
if (ge) return z;
|
24
|
+
ge = 1;
|
25
25
|
var e = typeof B == "object" && B && B.Object === Object && B;
|
26
26
|
return z = e, z;
|
27
27
|
}
|
28
|
-
var
|
29
|
-
function
|
30
|
-
if (pe) return
|
28
|
+
var F, pe;
|
29
|
+
function Ve() {
|
30
|
+
if (pe) return F;
|
31
31
|
pe = 1;
|
32
|
-
var e =
|
33
|
-
return
|
32
|
+
var e = hn(), n = typeof self == "object" && self && self.Object === Object && self, t = e || n || Function("return this")();
|
33
|
+
return F = t, F;
|
34
34
|
}
|
35
|
-
var
|
36
|
-
function
|
37
|
-
if (be) return
|
35
|
+
var W, be;
|
36
|
+
function gn() {
|
37
|
+
if (be) return W;
|
38
38
|
be = 1;
|
39
|
-
var e =
|
39
|
+
var e = Ve(), n = function() {
|
40
40
|
return e.Date.now();
|
41
41
|
};
|
42
|
-
return
|
42
|
+
return W = n, W;
|
43
43
|
}
|
44
44
|
var H, _e;
|
45
|
-
function
|
45
|
+
function pn() {
|
46
46
|
if (_e) return H;
|
47
47
|
_e = 1;
|
48
48
|
var e = /\s/;
|
@@ -54,41 +54,41 @@ function gn() {
|
|
54
54
|
return H = n, H;
|
55
55
|
}
|
56
56
|
var G, ve;
|
57
|
-
function
|
57
|
+
function bn() {
|
58
58
|
if (ve) return G;
|
59
59
|
ve = 1;
|
60
|
-
var e =
|
60
|
+
var e = pn(), n = /^\s+/;
|
61
61
|
function t(r) {
|
62
62
|
return r && r.slice(0, e(r) + 1).replace(n, "");
|
63
63
|
}
|
64
64
|
return G = t, G;
|
65
65
|
}
|
66
66
|
var V, Te;
|
67
|
-
function
|
67
|
+
function Ye() {
|
68
68
|
if (Te) return V;
|
69
69
|
Te = 1;
|
70
|
-
var e =
|
70
|
+
var e = Ve(), n = e.Symbol;
|
71
71
|
return V = n, V;
|
72
72
|
}
|
73
73
|
var Y, we;
|
74
|
-
function
|
74
|
+
function _n() {
|
75
75
|
if (we) return Y;
|
76
76
|
we = 1;
|
77
|
-
var e =
|
78
|
-
function o(
|
79
|
-
var l = t.call(
|
77
|
+
var e = Ye(), n = Object.prototype, t = n.hasOwnProperty, r = n.toString, a = e ? e.toStringTag : void 0;
|
78
|
+
function o(s) {
|
79
|
+
var l = t.call(s, a), u = s[a];
|
80
80
|
try {
|
81
|
-
|
82
|
-
var
|
81
|
+
s[a] = void 0;
|
82
|
+
var c = !0;
|
83
83
|
} catch {
|
84
84
|
}
|
85
|
-
var d = r.call(
|
86
|
-
return
|
85
|
+
var d = r.call(s);
|
86
|
+
return c && (l ? s[a] = u : delete s[a]), d;
|
87
87
|
}
|
88
88
|
return Y = o, Y;
|
89
89
|
}
|
90
90
|
var Z, Ie;
|
91
|
-
function
|
91
|
+
function vn() {
|
92
92
|
if (Ie) return Z;
|
93
93
|
Ie = 1;
|
94
94
|
var e = Object.prototype, n = e.toString;
|
@@ -98,17 +98,17 @@ function bn() {
|
|
98
98
|
return Z = t, Z;
|
99
99
|
}
|
100
100
|
var X, ye;
|
101
|
-
function
|
101
|
+
function Tn() {
|
102
102
|
if (ye) return X;
|
103
103
|
ye = 1;
|
104
|
-
var e =
|
105
|
-
function
|
104
|
+
var e = Ye(), n = _n(), t = vn(), r = "[object Null]", a = "[object Undefined]", o = e ? e.toStringTag : void 0;
|
105
|
+
function s(l) {
|
106
106
|
return l == null ? l === void 0 ? a : r : o && o in Object(l) ? n(l) : t(l);
|
107
107
|
}
|
108
|
-
return X =
|
108
|
+
return X = s, X;
|
109
109
|
}
|
110
110
|
var J, Ne;
|
111
|
-
function
|
111
|
+
function wn() {
|
112
112
|
if (Ne) return J;
|
113
113
|
Ne = 1;
|
114
114
|
function e(n) {
|
@@ -117,103 +117,103 @@ function vn() {
|
|
117
117
|
return J = e, J;
|
118
118
|
}
|
119
119
|
var K, Se;
|
120
|
-
function
|
120
|
+
function In() {
|
121
121
|
if (Se) return K;
|
122
122
|
Se = 1;
|
123
|
-
var e =
|
123
|
+
var e = Tn(), n = wn(), t = "[object Symbol]";
|
124
124
|
function r(a) {
|
125
125
|
return typeof a == "symbol" || n(a) && e(a) == t;
|
126
126
|
}
|
127
127
|
return K = r, K;
|
128
128
|
}
|
129
129
|
var Q, Ee;
|
130
|
-
function
|
130
|
+
function yn() {
|
131
131
|
if (Ee) return Q;
|
132
132
|
Ee = 1;
|
133
|
-
var e =
|
134
|
-
function u(
|
135
|
-
if (typeof
|
136
|
-
return
|
137
|
-
if (t(
|
133
|
+
var e = bn(), n = ce(), t = In(), r = NaN, a = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, s = /^0o[0-7]+$/i, l = parseInt;
|
134
|
+
function u(c) {
|
135
|
+
if (typeof c == "number")
|
136
|
+
return c;
|
137
|
+
if (t(c))
|
138
138
|
return r;
|
139
|
-
if (n(
|
140
|
-
var d = typeof
|
141
|
-
|
139
|
+
if (n(c)) {
|
140
|
+
var d = typeof c.valueOf == "function" ? c.valueOf() : c;
|
141
|
+
c = n(d) ? d + "" : d;
|
142
142
|
}
|
143
|
-
if (typeof
|
144
|
-
return
|
145
|
-
|
146
|
-
var h = o.test(
|
147
|
-
return h ||
|
143
|
+
if (typeof c != "string")
|
144
|
+
return c === 0 ? c : +c;
|
145
|
+
c = e(c);
|
146
|
+
var h = o.test(c);
|
147
|
+
return h || s.test(c) ? l(c.slice(2), h ? 2 : 8) : a.test(c) ? r : +c;
|
148
148
|
}
|
149
149
|
return Q = u, Q;
|
150
150
|
}
|
151
151
|
var ee, Pe;
|
152
|
-
function
|
152
|
+
function Ze() {
|
153
153
|
if (Pe) return ee;
|
154
154
|
Pe = 1;
|
155
|
-
var e = ce(), n =
|
156
|
-
function
|
157
|
-
var d, h,
|
155
|
+
var e = ce(), n = gn(), t = yn(), r = "Expected a function", a = Math.max, o = Math.min;
|
156
|
+
function s(l, u, c) {
|
157
|
+
var d, h, T, N, m, v, w = 0, I = !1, g = !1, S = !0;
|
158
158
|
if (typeof l != "function")
|
159
159
|
throw new TypeError(r);
|
160
|
-
u = t(u) || 0, e(
|
160
|
+
u = t(u) || 0, e(c) && (I = !!c.leading, g = "maxWait" in c, T = g ? a(t(c.maxWait) || 0, u) : T, S = "trailing" in c ? !!c.trailing : S);
|
161
161
|
function _(f) {
|
162
|
-
var E = d,
|
163
|
-
return d = h = void 0,
|
162
|
+
var E = d, L = h;
|
163
|
+
return d = h = void 0, w = f, N = l.apply(L, E), N;
|
164
164
|
}
|
165
165
|
function p(f) {
|
166
|
-
return
|
166
|
+
return w = f, m = setTimeout(q, u), I ? _(f) : N;
|
167
167
|
}
|
168
168
|
function A(f) {
|
169
|
-
var E = f -
|
170
|
-
return
|
169
|
+
var E = f - v, L = f - w, fe = u - E;
|
170
|
+
return g ? o(fe, T - L) : fe;
|
171
171
|
}
|
172
172
|
function ue(f) {
|
173
|
-
var E = f -
|
174
|
-
return
|
173
|
+
var E = f - v, L = f - w;
|
174
|
+
return v === void 0 || E >= u || E < 0 || g && L >= T;
|
175
175
|
}
|
176
176
|
function q() {
|
177
177
|
var f = n();
|
178
178
|
if (ue(f))
|
179
179
|
return de(f);
|
180
|
-
|
180
|
+
m = setTimeout(q, A(f));
|
181
181
|
}
|
182
182
|
function de(f) {
|
183
|
-
return
|
183
|
+
return m = void 0, S && d ? _(f) : (d = h = void 0, N);
|
184
184
|
}
|
185
|
-
function
|
186
|
-
|
185
|
+
function rn() {
|
186
|
+
m !== void 0 && clearTimeout(m), w = 0, d = v = h = m = void 0;
|
187
187
|
}
|
188
|
-
function
|
189
|
-
return
|
188
|
+
function an() {
|
189
|
+
return m === void 0 ? N : de(n());
|
190
190
|
}
|
191
191
|
function U() {
|
192
192
|
var f = n(), E = ue(f);
|
193
|
-
if (d = arguments, h = this,
|
194
|
-
if (
|
195
|
-
return p(
|
196
|
-
if (
|
197
|
-
return clearTimeout(
|
193
|
+
if (d = arguments, h = this, v = f, E) {
|
194
|
+
if (m === void 0)
|
195
|
+
return p(v);
|
196
|
+
if (g)
|
197
|
+
return clearTimeout(m), m = setTimeout(q, u), _(v);
|
198
198
|
}
|
199
|
-
return
|
199
|
+
return m === void 0 && (m = setTimeout(q, u)), N;
|
200
200
|
}
|
201
|
-
return U.cancel =
|
201
|
+
return U.cancel = rn, U.flush = an, U;
|
202
202
|
}
|
203
|
-
return ee =
|
203
|
+
return ee = s, ee;
|
204
204
|
}
|
205
|
-
var
|
206
|
-
const
|
205
|
+
var Nn = Ze();
|
206
|
+
const Sn = /* @__PURE__ */ Ge(Nn);
|
207
207
|
var ne, je;
|
208
|
-
function
|
208
|
+
function En() {
|
209
209
|
if (je) return ne;
|
210
210
|
je = 1;
|
211
|
-
var e =
|
212
|
-
function r(a, o,
|
211
|
+
var e = Ze(), n = ce(), t = "Expected a function";
|
212
|
+
function r(a, o, s) {
|
213
213
|
var l = !0, u = !0;
|
214
214
|
if (typeof a != "function")
|
215
215
|
throw new TypeError(t);
|
216
|
-
return n(
|
216
|
+
return n(s) && (l = "leading" in s ? !!s.leading : l, u = "trailing" in s ? !!s.trailing : u), e(a, o, {
|
217
217
|
leading: l,
|
218
218
|
maxWait: o,
|
219
219
|
trailing: u
|
@@ -221,17 +221,17 @@ function Nn() {
|
|
221
221
|
}
|
222
222
|
return ne = r, ne;
|
223
223
|
}
|
224
|
-
var
|
225
|
-
const
|
224
|
+
var Pn = En();
|
225
|
+
const jn = /* @__PURE__ */ Ge(Pn), Rn = (e, n, t, r) => {
|
226
226
|
switch (n) {
|
227
227
|
case "debounce":
|
228
|
-
return
|
228
|
+
return Sn(e, t, r);
|
229
229
|
case "throttle":
|
230
|
-
return
|
230
|
+
return jn(e, t, r);
|
231
231
|
default:
|
232
232
|
return e;
|
233
233
|
}
|
234
|
-
},
|
234
|
+
}, xn = (
|
235
235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
236
236
|
(e) => {
|
237
237
|
const n = k.useRef(e);
|
@@ -242,7 +242,7 @@ const En = /* @__PURE__ */ Fe(Sn), Pn = (e, n, t, r) => {
|
|
242
242
|
return (r = n.current) === null || r === void 0 ? void 0 : r.call(n, ...t);
|
243
243
|
}, []);
|
244
244
|
}
|
245
|
-
),
|
245
|
+
), Cn = (
|
246
246
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
247
247
|
(e) => {
|
248
248
|
const [n, t] = k.useState((e == null ? void 0 : e.current) || null);
|
@@ -254,12 +254,12 @@ const En = /* @__PURE__ */ Fe(Sn), Pn = (e, n, t, r) => {
|
|
254
254
|
get(a, o) {
|
255
255
|
return o === "current" ? n : a[o];
|
256
256
|
},
|
257
|
-
set(a, o,
|
258
|
-
return o === "current" ? t(
|
257
|
+
set(a, o, s) {
|
258
|
+
return o === "current" ? t(s) : a[o] = s, !0;
|
259
259
|
}
|
260
260
|
}), [n]), refElement: n, setRefElement: t };
|
261
261
|
}
|
262
|
-
),
|
262
|
+
), Ln = (e, n) => n === "border-box" ? {
|
263
263
|
width: e.borderBoxSize[0].inlineSize,
|
264
264
|
height: e.borderBoxSize[0].blockSize
|
265
265
|
} : n === "content-box" ? {
|
@@ -269,81 +269,81 @@ const En = /* @__PURE__ */ Fe(Sn), Pn = (e, n, t, r) => {
|
|
269
269
|
width: e.contentRect.width,
|
270
270
|
height: e.contentRect.height
|
271
271
|
};
|
272
|
-
function
|
273
|
-
const
|
272
|
+
function kn({ skipOnMount: e = !1, refreshMode: n, refreshRate: t = 1e3, refreshOptions: r, handleWidth: a = !0, handleHeight: o = !0, targetRef: s, observerOptions: l, onResize: u } = {}) {
|
273
|
+
const c = on(e), d = xn(u), [h, T] = Ue({
|
274
274
|
width: void 0,
|
275
275
|
height: void 0
|
276
|
-
}), { refProxy:
|
276
|
+
}), { refProxy: N, refElement: m } = Cn(s), { box: v } = l || {}, w = me((g) => {
|
277
277
|
if (!a && !o)
|
278
278
|
return;
|
279
|
-
if (
|
280
|
-
|
279
|
+
if (c.current) {
|
280
|
+
c.current = !1;
|
281
281
|
return;
|
282
282
|
}
|
283
|
-
const
|
284
|
-
|
285
|
-
const p =
|
286
|
-
|
283
|
+
const S = (_, p) => a && _.width !== p.width || o && _.height !== p.height;
|
284
|
+
g.forEach((_) => {
|
285
|
+
const p = Ln(_, v);
|
286
|
+
T((A) => S(A, p) ? (d == null || d({
|
287
287
|
width: p.width,
|
288
288
|
height: p.height,
|
289
289
|
entry: _
|
290
290
|
}), p) : A);
|
291
291
|
});
|
292
|
-
}, [a, o,
|
293
|
-
|
292
|
+
}, [a, o, c, v]), I = me(Rn(w, n, t, r), [
|
293
|
+
w,
|
294
294
|
n,
|
295
295
|
t,
|
296
296
|
r
|
297
297
|
]);
|
298
298
|
return ie(() => {
|
299
|
-
let
|
300
|
-
return
|
299
|
+
let g;
|
300
|
+
return m ? (g = new window.ResizeObserver(I), g.observe(m, l)) : (h.width || h.height) && (d == null || d({
|
301
301
|
width: null,
|
302
302
|
height: null,
|
303
303
|
entry: null
|
304
|
-
}),
|
305
|
-
var
|
306
|
-
(
|
304
|
+
}), T({ width: void 0, height: void 0 })), () => {
|
305
|
+
var S, _, p;
|
306
|
+
(S = g == null ? void 0 : g.disconnect) === null || S === void 0 || S.call(g), (p = (_ = I).cancel) === null || p === void 0 || p.call(_);
|
307
307
|
};
|
308
|
-
}, [
|
308
|
+
}, [I, m]), Object.assign({ ref: N }, h);
|
309
309
|
}
|
310
|
-
function
|
310
|
+
function Xe(e) {
|
311
311
|
var n, t, r = "";
|
312
312
|
if (typeof e == "string" || typeof e == "number") r += e;
|
313
313
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
314
314
|
var a = e.length;
|
315
|
-
for (n = 0; n < a; n++) e[n] && (t =
|
315
|
+
for (n = 0; n < a; n++) e[n] && (t = Xe(e[n])) && (r && (r += " "), r += t);
|
316
316
|
} else for (t in e) e[t] && (r && (r += " "), r += t);
|
317
317
|
return r;
|
318
318
|
}
|
319
|
-
function
|
320
|
-
for (var e, n, t = 0, r = "", a = arguments.length; t < a; t++) (e = arguments[t]) && (n =
|
319
|
+
function R() {
|
320
|
+
for (var e, n, t = 0, r = "", a = arguments.length; t < a; t++) (e = arguments[t]) && (n = Xe(e)) && (r && (r += " "), r += n);
|
321
321
|
return r;
|
322
322
|
}
|
323
|
-
const
|
324
|
-
headerContainer:
|
325
|
-
navigationTabList:
|
326
|
-
navigationTab:
|
327
|
-
headerContent:
|
328
|
-
staticEnabled:
|
329
|
-
},
|
330
|
-
const { ref: t, height: r } =
|
323
|
+
const On = "_headerContainer_1cubo_1", An = "_navigationTabList_1cubo_8", qn = "_navigationTab_1cubo_8", Bn = "_headerContent_1cubo_34", Mn = "_staticEnabled_1cubo_50", C = {
|
324
|
+
headerContainer: On,
|
325
|
+
navigationTabList: An,
|
326
|
+
navigationTab: qn,
|
327
|
+
headerContent: Bn,
|
328
|
+
staticEnabled: Mn
|
329
|
+
}, $n = 77, M = ({ sticky: e, children: n }) => {
|
330
|
+
const { ref: t, height: r } = kn({
|
331
331
|
refreshMode: "debounce",
|
332
332
|
refreshRate: 0
|
333
|
-
}), [a, o] =
|
333
|
+
}), [a, o] = Ue(!1), s = () => a ? !e : !0;
|
334
334
|
ie(() => {
|
335
335
|
const u = () => {
|
336
336
|
o(window.scrollY > 0);
|
337
337
|
};
|
338
338
|
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
339
339
|
}, []);
|
340
|
-
const l = `${r ||
|
340
|
+
const l = `${r || $n}px`;
|
341
341
|
return /* @__PURE__ */ i("div", { style: { minHeight: l }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ b(
|
342
342
|
"div",
|
343
343
|
{
|
344
344
|
ref: t,
|
345
|
-
className:
|
346
|
-
[C.staticEnabled]:
|
345
|
+
className: R(C.headerContent, {
|
346
|
+
[C.staticEnabled]: s()
|
347
347
|
}),
|
348
348
|
children: [
|
349
349
|
/* @__PURE__ */ i(M.Header, {}),
|
@@ -355,33 +355,33 @@ const Rn = "_headerContainer_1cubo_1", kn = "_navigationTabList_1cubo_8", On = "
|
|
355
355
|
};
|
356
356
|
M.Header = ({ children: e }) => /* @__PURE__ */ i("div", { className: C.headerContainer, children: e });
|
357
357
|
M.Tabs = ({ children: e }) => /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
358
|
-
const
|
359
|
-
sidebarContainer:
|
360
|
-
},
|
361
|
-
logoLink:
|
362
|
-
},
|
363
|
-
link:
|
364
|
-
active:
|
365
|
-
},
|
366
|
-
|
358
|
+
const Un = "_sidebarContainer_bmdti_1", Dn = {
|
359
|
+
sidebarContainer: Un
|
360
|
+
}, zn = "_logoLink_1baxb_1", Fn = {
|
361
|
+
logoLink: zn
|
362
|
+
}, Wn = ({ src: e, href: n = "/", ariaLabel: t = "Home", alt: r = "Lokalise" }) => /* @__PURE__ */ i("a", { className: Fn.logoLink, href: n, "aria-label": t, children: /* @__PURE__ */ i("img", { src: e, alt: r }) }), Hn = "_link_1weq1_1", Gn = "_active_1weq1_18", Re = {
|
363
|
+
link: Hn,
|
364
|
+
active: Gn
|
365
|
+
}, Vn = ({ label: e, to: n, icon: t }) => /* @__PURE__ */ i(ae, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
|
366
|
+
ze,
|
367
367
|
{
|
368
|
-
className:
|
369
|
-
[
|
368
|
+
className: R(Re.link, {
|
369
|
+
[Re.active]: window.location.pathname.startsWith(n)
|
370
370
|
}),
|
371
371
|
href: n,
|
372
372
|
children: /* @__PURE__ */ i(t, { size: "25px" })
|
373
373
|
}
|
374
|
-
) }),
|
375
|
-
dropdownButton:
|
376
|
-
dropdownButtonActive:
|
377
|
-
},
|
374
|
+
) }), Yn = "_dropdownButton_hwh0c_1", Zn = "_dropdownButtonActive_hwh0c_18", xe = {
|
375
|
+
dropdownButton: Yn,
|
376
|
+
dropdownButtonActive: Zn
|
377
|
+
}, Xn = ({ children: e, icon: n }) => /* @__PURE__ */ i(
|
378
378
|
oe,
|
379
379
|
{
|
380
380
|
menuButton: ({ opened: t }) => /* @__PURE__ */ i(ae, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
|
381
381
|
"button",
|
382
382
|
{
|
383
383
|
type: "button",
|
384
|
-
className:
|
384
|
+
className: R(xe.dropdownButton, {
|
385
385
|
[xe.dropdownButtonActive]: t
|
386
386
|
}),
|
387
387
|
children: /* @__PURE__ */ i(n, { size: "25px" })
|
@@ -389,40 +389,40 @@ const Mn = "_sidebarContainer_bmdti_1", $n = {
|
|
389
389
|
) }),
|
390
390
|
children: /* @__PURE__ */ i(se, { placement: "right-start", children: e })
|
391
391
|
}
|
392
|
-
),
|
393
|
-
iconContainer:
|
394
|
-
},
|
392
|
+
), Jn = "_iconContainer_nz34m_1", Kn = {
|
393
|
+
iconContainer: Jn
|
394
|
+
}, Je = ({ className: e = "" }) => /* @__PURE__ */ i(
|
395
395
|
"div",
|
396
396
|
{
|
397
397
|
"aria-label": "Upgrade Icon",
|
398
|
-
className:
|
399
|
-
|
398
|
+
className: R(
|
399
|
+
Kn.iconContainer,
|
400
400
|
"flex-row",
|
401
401
|
"items-center",
|
402
402
|
"justify-center",
|
403
403
|
e
|
404
404
|
),
|
405
|
-
children: /* @__PURE__ */ i(
|
405
|
+
children: /* @__PURE__ */ i(dn, {})
|
406
406
|
}
|
407
|
-
),
|
408
|
-
menuContainer:
|
409
|
-
profileButton:
|
410
|
-
profileImage:
|
411
|
-
profileImageHighlight:
|
412
|
-
profileImageUpgradeIcon:
|
413
|
-
userIconWrapper:
|
414
|
-
},
|
407
|
+
), Qn = "_menuContainer_wbu3u_5", et = "_profileButton_wbu3u_16", nt = "_profileImage_wbu3u_29", tt = "_profileImageHighlight_wbu3u_37", rt = "_profileImageUpgradeIcon_wbu3u_41", it = "_userIconWrapper_wbu3u_47", P = {
|
408
|
+
menuContainer: Qn,
|
409
|
+
profileButton: et,
|
410
|
+
profileImage: nt,
|
411
|
+
profileImageHighlight: tt,
|
412
|
+
profileImageUpgradeIcon: rt,
|
413
|
+
userIconWrapper: it
|
414
|
+
}, Ke = cn({}), O = () => sn(Ke), at = ({ children: e }) => {
|
415
415
|
const {
|
416
416
|
currentTeam: n,
|
417
417
|
otherTeams: t,
|
418
418
|
showUpgradeCta: r,
|
419
419
|
showBillingButton: a,
|
420
420
|
allowTeamCreation: o,
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
421
|
+
isProviderAlpha: s,
|
422
|
+
canAccessTeamSettings: l,
|
423
|
+
isEndOfTrialActive: u,
|
424
|
+
isTeamSuspended: c,
|
425
|
+
isFullyAuthenticated: d
|
426
426
|
} = O();
|
427
427
|
return /* @__PURE__ */ i(
|
428
428
|
oe,
|
@@ -432,7 +432,7 @@ const Mn = "_sidebarContainer_bmdti_1", $n = {
|
|
432
432
|
"img",
|
433
433
|
{
|
434
434
|
src: n.logoUrl,
|
435
|
-
className:
|
435
|
+
className: R(P.profileImage, {
|
436
436
|
[P.profileImageHighlight]: r
|
437
437
|
}),
|
438
438
|
alt: "Team Logo"
|
@@ -440,27 +440,27 @@ const Mn = "_sidebarContainer_bmdti_1", $n = {
|
|
440
440
|
) : /* @__PURE__ */ i(
|
441
441
|
"div",
|
442
442
|
{
|
443
|
-
className:
|
443
|
+
className: R(P.userIconWrapper, "flex-row", "align-center", "items-center", {
|
444
444
|
[P.profileImageHighlight]: r
|
445
445
|
}),
|
446
|
-
children: /* @__PURE__ */ i(
|
446
|
+
children: /* @__PURE__ */ i(Fe, { size: "25px" })
|
447
447
|
}
|
448
448
|
),
|
449
|
-
r && /* @__PURE__ */ i(
|
449
|
+
r && /* @__PURE__ */ i(Je, { className: P.profileImageUpgradeIcon })
|
450
450
|
] }),
|
451
451
|
children: /* @__PURE__ */ i(se, { placement: "right-end", className: P.menuContainer, children: e({
|
452
452
|
allowTeamCreation: o,
|
453
453
|
otherTeams: t,
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
isTeamSuspended: d,
|
454
|
+
canAccessTeamSettings: l,
|
455
|
+
isEndOfTrialActive: u,
|
456
|
+
isTeamSuspended: c,
|
458
457
|
showBillingButton: a,
|
459
|
-
isProviderAlpha:
|
458
|
+
isProviderAlpha: s,
|
459
|
+
isFullyAuthenticated: d
|
460
460
|
}) })
|
461
461
|
}
|
462
462
|
);
|
463
|
-
},
|
463
|
+
}, Qe = 0, ot = 9999, st = [150, 151, 250, 251], ct = [152, 153, 252, 253], lt = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], ut = [156, 159, 160, 256, 259, 260], en = 9998, le = (e) => e === Qe, nn = (e) => e === ot, Zt = (e) => st.includes(e), Xt = (e) => ct.includes(e), Jt = (e) => lt.includes(e), Kt = (e) => ut.includes(e), Qt = (e) => e > Qe && e < en, er = (e) => e === en, dt = /\n/, Ce = (e, n, t) => e.split(n).flatMap((r, a) => a !== 0 ? [ln(t, { key: Math.random().toString(32).slice(0, 10) }), r] : r), ft = (e, n, t) => typeof e == "string" ? Ce(e, n, t) : e.flatMap((r) => typeof r == "string" ? Ce(r, n, t) : r), nr = (e) => ft(e, dt, /* @__PURE__ */ i("br", {})), mt = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, ht = (e) => e.match(mt) ?? [], Le = (e, n, t) => {
|
464
464
|
const r = e.split(n);
|
465
465
|
if (r.length === 1)
|
466
466
|
return e;
|
@@ -469,41 +469,40 @@ const Mn = "_sidebarContainer_bmdti_1", $n = {
|
|
469
469
|
/* @__PURE__ */ i("a", { href: n, target: "_blank", rel: "noreferrer noopener", children: n }, n + t)
|
470
470
|
), a.push(r.join(n)), a.filter((o) => o !== "");
|
471
471
|
}, ke = (e) => {
|
472
|
-
const n =
|
473
|
-
return n != null && n.length ? n.reduce((t, r, a) => typeof t == "string" ?
|
474
|
-
},
|
472
|
+
const n = ht(e);
|
473
|
+
return n != null && n.length ? n.reduce((t, r, a) => typeof t == "string" ? Le(t, r, a) : t.flatMap((o) => typeof o == "string" ? Le(o, r, a) : o), e) : e;
|
474
|
+
}, tr = (e) => typeof e == "string" ? ke(e) : e.flatMap((n) => typeof n == "string" ? ke(n) : n, e), rr = (e, n = "PP") => He(e, n), ir = (e, n, t = "PP") => He(mn(e, n), t), ar = (e) => {
|
475
475
|
ie(e, []);
|
476
|
-
},
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
isEndOfTrialActive: u
|
485
|
-
} = n, s = t.find((m) => m.id === r), d = t.filter((m) => m.id !== r), h = (s == null ? void 0 : s.role) ?? "", v = ["biller", "owner"].includes(h), T = le(a) || Qe(a), S = {
|
476
|
+
}, Oe = {
|
477
|
+
biller: "biller",
|
478
|
+
owner: "owner"
|
479
|
+
}, Ae = [
|
480
|
+
Oe.biller,
|
481
|
+
Oe.owner
|
482
|
+
], gt = ({ children: e, config: n }) => {
|
483
|
+
const { teams: t, currentTeamId: r, planId: a, isEndOfTrialActive: o, isFullyAuthenticated: s, userTeamRole: l } = n, u = t.find((I) => I.id === r), c = t.filter((I) => I.id !== r), d = Ae.includes(l), h = Ae.includes(l), T = le(a) || nn(a), w = {
|
486
484
|
...n,
|
487
|
-
currentTeam:
|
488
|
-
otherTeams:
|
489
|
-
canChangeBilling:
|
485
|
+
currentTeam: u,
|
486
|
+
otherTeams: c,
|
487
|
+
canChangeBilling: d,
|
488
|
+
canAccessTeamSettings: h,
|
490
489
|
isOnFreeOrTrialPlan: T,
|
491
|
-
showUpgradeCta:
|
492
|
-
showBillingButton:
|
493
|
-
allowTeamCreation:
|
490
|
+
showUpgradeCta: s && T && d,
|
491
|
+
showBillingButton: s && h && d,
|
492
|
+
allowTeamCreation: s && !o
|
494
493
|
};
|
495
|
-
return /* @__PURE__ */ i(
|
496
|
-
},
|
497
|
-
container:
|
498
|
-
profileEmail:
|
499
|
-
},
|
494
|
+
return /* @__PURE__ */ i(Ke.Provider, { value: w, children: e });
|
495
|
+
}, pt = ({ config: e, children: n }) => /* @__PURE__ */ i(gt, { config: e, children: /* @__PURE__ */ i(at, { children: n }) }), bt = "_container_q5pot_1", _t = "_profileEmail_q5pot_5", qe = {
|
496
|
+
container: bt,
|
497
|
+
profileEmail: _t
|
498
|
+
}, vt = ({
|
500
499
|
href: e,
|
501
500
|
onClick: n,
|
502
501
|
userEmail: t,
|
503
502
|
hideBottomDivider: r
|
504
503
|
}) => {
|
505
504
|
const { isEndOfTrialActive: a, isTeamSuspended: o } = O();
|
506
|
-
return a || o ? null : /* @__PURE__ */ b(
|
505
|
+
return a || o ? null : /* @__PURE__ */ b($e, { children: [
|
507
506
|
/* @__PURE__ */ i(
|
508
507
|
$,
|
509
508
|
{
|
@@ -511,99 +510,99 @@ const Mn = "_sidebarContainer_bmdti_1", $n = {
|
|
511
510
|
onClick: () => {
|
512
511
|
n == null || n();
|
513
512
|
},
|
514
|
-
children: /* @__PURE__ */ b("div", { className: `flex-col ${
|
513
|
+
children: /* @__PURE__ */ b("div", { className: `flex-col ${qe.container}`, children: [
|
515
514
|
/* @__PURE__ */ i("span", { children: "Profile Settings" }),
|
516
|
-
/* @__PURE__ */ i("span", { className:
|
515
|
+
/* @__PURE__ */ i("span", { className: qe.profileEmail, children: t })
|
517
516
|
] })
|
518
517
|
}
|
519
518
|
),
|
520
|
-
!r && /* @__PURE__ */ i(
|
519
|
+
!r && /* @__PURE__ */ i(We, {})
|
521
520
|
] });
|
522
|
-
},
|
523
|
-
wrapper:
|
524
|
-
profileImage:
|
525
|
-
teamName:
|
526
|
-
planLabel:
|
527
|
-
membership:
|
528
|
-
defaultProfileImage:
|
529
|
-
},
|
521
|
+
}, Tt = "_wrapper_15d85_1", wt = "_profileImage_15d85_14", It = "_teamName_15d85_22", yt = "_planLabel_15d85_29", Nt = "_membership_15d85_38", St = "_defaultProfileImage_15d85_44", x = {
|
522
|
+
wrapper: Tt,
|
523
|
+
profileImage: wt,
|
524
|
+
teamName: It,
|
525
|
+
planLabel: yt,
|
526
|
+
membership: Nt,
|
527
|
+
defaultProfileImage: St
|
528
|
+
}, tn = ({ team: e, onClick: n, hidePlanLabel: t }) => {
|
530
529
|
const { currentTeam: r, planId: a } = O(), o = e || r;
|
531
530
|
if (!o)
|
532
531
|
return null;
|
533
|
-
const
|
532
|
+
const s = le(a) ? "Free" : nn(a) ? "Trial" : void 0;
|
534
533
|
return /* @__PURE__ */ b(
|
535
534
|
n ? $ : "div",
|
536
535
|
{
|
537
536
|
className: `flex-row gap-2 flex-nowrap items-center ${x.wrapper}`,
|
538
537
|
...n && { onClick: () => n(o) },
|
539
538
|
children: [
|
540
|
-
o.logoUrl ? /* @__PURE__ */ i("img", { className: x.profileImage, src: o.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${x.defaultProfileImage}`, children: /* @__PURE__ */ i(
|
539
|
+
o.logoUrl ? /* @__PURE__ */ i("img", { className: x.profileImage, src: o.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${x.defaultProfileImage}`, children: /* @__PURE__ */ i(Fe, { size: "25px" }) }),
|
541
540
|
/* @__PURE__ */ b("div", { className: "flex-col items-start", children: [
|
542
541
|
/* @__PURE__ */ b("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
543
542
|
/* @__PURE__ */ i("span", { title: o.name, className: x.teamName, children: o.name }),
|
544
|
-
|
543
|
+
s && !t && /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${x.planLabel}`, children: s })
|
545
544
|
] }),
|
546
545
|
/* @__PURE__ */ i("span", { className: x.membership, children: o.role })
|
547
546
|
] })
|
548
547
|
]
|
549
548
|
}
|
550
549
|
);
|
551
|
-
},
|
552
|
-
teamsContainer:
|
553
|
-
},
|
550
|
+
}, Et = "_teamsContainer_1t68g_1", Pt = {
|
551
|
+
teamsContainer: Et
|
552
|
+
}, jt = ({ onSwitchTeam: e }) => {
|
554
553
|
const { otherTeams: n } = O();
|
555
|
-
return n.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${
|
556
|
-
},
|
557
|
-
container:
|
558
|
-
planCta:
|
559
|
-
upgradeIconWrapper:
|
560
|
-
},
|
554
|
+
return n.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${Pt.teamsContainer}`, children: n.map((t) => /* @__PURE__ */ i(tn, { team: t, onClick: e, hidePlanLabel: !0 }, t.id)) });
|
555
|
+
}, Rt = "_container_1u995_1", xt = "_planCta_1u995_15", Ct = "_upgradeIconWrapper_1u995_19", te = {
|
556
|
+
container: Rt,
|
557
|
+
planCta: xt,
|
558
|
+
upgradeIconWrapper: Ct
|
559
|
+
}, Lt = ({ upgradeOptionHref: e }) => {
|
561
560
|
const { planId: n, trialDaysLeft: t, showUpgradeCta: r } = O();
|
562
561
|
if (!r)
|
563
562
|
return null;
|
564
|
-
const
|
563
|
+
const s = le(n) ? "Your team is currently on the Free plan" : `Free trial ends in ${t} ${t === 1 ? "day" : "days"}`;
|
565
564
|
return /* @__PURE__ */ b($, { href: e, className: `flex-col gap-1 items-start ${te.container}`, children: [
|
566
|
-
/* @__PURE__ */ i("span", { className: te.planCta, children:
|
565
|
+
/* @__PURE__ */ i("span", { className: te.planCta, children: s }),
|
567
566
|
/* @__PURE__ */ b("div", { className: `flex-row items-center gap-1 ${te.upgradeIconWrapper}`, children: [
|
568
|
-
/* @__PURE__ */ i(
|
567
|
+
/* @__PURE__ */ i(Je, {}),
|
569
568
|
/* @__PURE__ */ i("span", { children: "See upgrade options" })
|
570
569
|
] })
|
571
570
|
] });
|
572
|
-
},
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
const
|
584
|
-
breadcrumbsItem:
|
585
|
-
breadcrumbs:
|
586
|
-
},
|
587
|
-
/* @__PURE__ */ i(
|
571
|
+
}, y = ({ children: e, ...n }) => /* @__PURE__ */ i("nav", { ...n, className: Dn.sidebarContainer, children: e });
|
572
|
+
y.Top = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
573
|
+
y.Bottom = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
574
|
+
y.Avatar = Wn;
|
575
|
+
y.IconLink = Vn;
|
576
|
+
y.Menu = Xn;
|
577
|
+
y.ProfileMenu = pt;
|
578
|
+
y.TeamSwitch = jt;
|
579
|
+
y.TeamMenuItem = tn;
|
580
|
+
y.UpgradeMenuItem = Lt;
|
581
|
+
y.ProfileSettingsMenuItem = vt;
|
582
|
+
const kt = "_breadcrumbsItem_1hm6a_1", Ot = "_breadcrumbs_1hm6a_1", Be = {
|
583
|
+
breadcrumbsItem: kt,
|
584
|
+
breadcrumbs: Ot
|
585
|
+
}, or = ({ items: e }) => /* @__PURE__ */ i("nav", { "aria-label": "breadcrumb", className: Be.breadcrumbs, children: e.map((n, t) => /* @__PURE__ */ b(De, { children: [
|
586
|
+
/* @__PURE__ */ i(ze, { className: Be.breadcrumbsItem, href: n.link, rel: "noreferrer", children: n.name }),
|
588
587
|
t < e.length - 1 && /* @__PURE__ */ i("span", { children: " — " })
|
589
|
-
] }, `${n.link}-${n.name}`)) }),
|
590
|
-
!!t && n.some((r) => r.visible) && /* @__PURE__ */ i(
|
588
|
+
] }, `${n.link}-${n.name}`)) }), At = ({ items: e }) => /* @__PURE__ */ i($e, { children: e.map((n, t) => /* @__PURE__ */ b(De, { children: [
|
589
|
+
!!t && n.some((r) => r.visible) && /* @__PURE__ */ i(We, {}),
|
591
590
|
n.filter(({ visible: r }) => r).map(({ link: r, label: a, onClick: o }) => /* @__PURE__ */ i($, { href: r || "#", "aria-label": a, onClick: o, children: a }, a))
|
592
|
-
] }, n[0].label)) }),
|
593
|
-
badge:
|
594
|
-
tag:
|
595
|
-
withNavLinkStyle:
|
596
|
-
disabled:
|
597
|
-
projectNavigationItem:
|
598
|
-
projectNavigationItemDisabled:
|
599
|
-
},
|
591
|
+
] }, n[0].label)) }), qt = "_badge_1pc1v_1", Bt = "_tag_1pc1v_15", Mt = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", $t = "_disabled_1pc1v_57", Ut = "_projectNavigationItem_1pc1v_61", Dt = "_projectNavigationItemDisabled_1pc1v_67", j = {
|
592
|
+
badge: qt,
|
593
|
+
tag: Bt,
|
594
|
+
withNavLinkStyle: Mt,
|
595
|
+
disabled: $t,
|
596
|
+
projectNavigationItem: Ut,
|
597
|
+
projectNavigationItemDisabled: Dt
|
598
|
+
}, Me = ({ label: e, badge: n, novel: t }) => /* @__PURE__ */ b("div", { className: "flex gap-1", children: [
|
600
599
|
/* @__PURE__ */ b("div", { children: [
|
601
600
|
/* @__PURE__ */ i("span", { children: e }),
|
602
601
|
!!n && /* @__PURE__ */ i("div", { className: j.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
|
603
602
|
] }),
|
604
|
-
!!t && /* @__PURE__ */ i(
|
605
|
-
] }), re =
|
606
|
-
({ label: e, href: n = "", disabled: t = !1, badge: r, onClick: a, novel: o },
|
603
|
+
!!t && /* @__PURE__ */ i(fn, { className: j.tag, children: t })
|
604
|
+
] }), re = un(
|
605
|
+
({ label: e, href: n = "", disabled: t = !1, badge: r, onClick: a, novel: o }, s) => /* @__PURE__ */ i(ae, { tooltip: "You do not have access to this function", show: t, children: /* @__PURE__ */ i(
|
607
606
|
"div",
|
608
607
|
{
|
609
608
|
className: t ? j.projectNavigationItemDisabled : j.projectNavigationItem,
|
@@ -611,20 +610,20 @@ const Ct = "_breadcrumbsItem_1hm6a_1", Rt = "_breadcrumbs_1hm6a_1", Ae = {
|
|
611
610
|
"button",
|
612
611
|
{
|
613
612
|
type: "button",
|
614
|
-
ref:
|
615
|
-
className:
|
613
|
+
ref: s,
|
614
|
+
className: R(j.withNavLinkStyle, {
|
616
615
|
[j.disabled]: t
|
617
616
|
}),
|
618
617
|
disabled: t,
|
619
618
|
onClick: a,
|
620
|
-
children: /* @__PURE__ */ i(
|
619
|
+
children: /* @__PURE__ */ i(Me, { label: e, badge: r, novel: o })
|
621
620
|
}
|
622
|
-
) : /* @__PURE__ */ i("a", { href: n, className: j.withNavLinkStyle, children: /* @__PURE__ */ i(
|
621
|
+
) : /* @__PURE__ */ i("a", { href: n, className: j.withNavLinkStyle, children: /* @__PURE__ */ i(Me, { label: e, badge: r, novel: o }) })
|
623
622
|
}
|
624
623
|
) })
|
625
624
|
);
|
626
625
|
re.displayName = "NavigationTabsItem";
|
627
|
-
const
|
626
|
+
const zt = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible))) ?? !1, Ft = (e) => e.visible && (!e.dropdown || zt(e.dropdown)), sr = ({ navigation: e, activeItem: n }) => /* @__PURE__ */ i("nav", { "aria-label": "Project", children: /* @__PURE__ */ i("ul", { className: C.navigationTabList, "aria-orientation": "horizontal", children: e.filter(Ft).map((t) => {
|
628
627
|
var r, a, o;
|
629
628
|
return t.dropdown ? /* @__PURE__ */ i(
|
630
629
|
"li",
|
@@ -635,8 +634,8 @@ const Ut = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible)))
|
|
635
634
|
children: /* @__PURE__ */ i(
|
636
635
|
oe,
|
637
636
|
{
|
638
|
-
menuButton: ({ opened:
|
639
|
-
children: /* @__PURE__ */ i(se, { children: /* @__PURE__ */ i(
|
637
|
+
menuButton: ({ opened: s }) => /* @__PURE__ */ i(re, { label: t.label, disabled: t.disabled, active: s }),
|
638
|
+
children: /* @__PURE__ */ i(se, { children: /* @__PURE__ */ i(At, { items: t.dropdown }) })
|
640
639
|
}
|
641
640
|
)
|
642
641
|
},
|
@@ -664,28 +663,28 @@ const Ut = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible)))
|
|
664
663
|
);
|
665
664
|
}) }) });
|
666
665
|
export {
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
666
|
+
or as Breadcrumbs,
|
667
|
+
en as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
668
|
+
ut as ENTERPRISE_PLAN_IDS,
|
669
|
+
ct as ESSENTIAL_PLAN_IDS,
|
670
|
+
Qe as FREE_PLAN_ID,
|
672
671
|
M as NavigationPanel,
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
672
|
+
sr as NavigationTabs,
|
673
|
+
lt as PRO_PLAN_IDS,
|
674
|
+
st as START_PLAN_IDS,
|
675
|
+
y as Sidebar,
|
676
|
+
ot as TRIAL_PLAN_ID,
|
677
|
+
nr as convertNewLineToBreakTag,
|
678
|
+
rr as formatDate,
|
679
|
+
ir as formatDateTz,
|
680
|
+
er as isEnterpriseOpenSourcePlan,
|
681
|
+
Kt as isEnterprisePlan,
|
682
|
+
Xt as isEssentialPlan,
|
684
683
|
le as isFreePlan,
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
684
|
+
Qt as isPaidPlan,
|
685
|
+
Jt as isProPlan,
|
686
|
+
Zt as isStartPlan,
|
687
|
+
nn as isTrialPlan,
|
688
|
+
tr as makeUrlClickable,
|
689
|
+
ar as useEffectOnce
|
691
690
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,22 +1,24 @@
|
|
1
|
-
import { SidebarTeam } from '../../types';
|
1
|
+
import { SidebarTeam, SidebarTeamRole } from '../../types';
|
2
2
|
export type SidebarProfileMenuConfig = {
|
3
3
|
teams: SidebarTeam[];
|
4
|
-
currentTeamId: number;
|
5
|
-
planId: number;
|
6
|
-
isLimitedView: boolean;
|
7
4
|
isTeamSuspended: boolean;
|
8
|
-
canAccessTeamSettings: boolean;
|
9
5
|
isEndOfTrialActive: boolean;
|
10
6
|
trialDaysLeft: number;
|
7
|
+
currentTeamId: number;
|
8
|
+
planId: number;
|
9
|
+
isFullyAuthenticated: boolean;
|
11
10
|
isProviderAlpha: boolean;
|
11
|
+
userTeamRole: SidebarTeamRole;
|
12
|
+
userEmail: string;
|
12
13
|
};
|
13
14
|
export type SidebarProfileMenuContextProps = SidebarProfileMenuConfig & {
|
14
15
|
currentTeam?: SidebarTeam;
|
15
16
|
otherTeams: SidebarTeam[];
|
16
17
|
canChangeBilling: boolean;
|
18
|
+
canAccessTeamSettings: boolean;
|
17
19
|
isOnFreeOrTrialPlan: boolean;
|
18
20
|
showUpgradeCta: boolean;
|
19
21
|
showBillingButton: boolean;
|
20
22
|
allowTeamCreation: boolean;
|
21
23
|
};
|
22
|
-
export type SidebarProfileMenuRenderProps = Pick<SidebarProfileMenuContextProps, 'otherTeams' | 'allowTeamCreation' | '
|
24
|
+
export type SidebarProfileMenuRenderProps = Pick<SidebarProfileMenuContextProps, 'otherTeams' | 'allowTeamCreation' | 'isEndOfTrialActive' | 'canAccessTeamSettings' | 'showBillingButton' | 'isProviderAlpha' | 'isFullyAuthenticated' | 'isTeamSuspended'>;
|