@lokalise/harmony 1.12.4 → 1.12.6
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.css +1 -1
- package/dist/harmony.mjs +31 -31
- package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +1 -1
- package/dist/types/src/features/publicApi/projects.d.ts +3 -3
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +3 -3
- package/package.json +1 -1
package/dist/harmony.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var At=Object.defineProperty;var Ct=(e,t,n)=>t in e?At(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var we=(e,t,n)=>Ct(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),b=require("react"),f=require("@lokalise/louis"),tt=require("date-fns"),kt=require("date-fns-tz"),r=require("zod"),I=require("@lokalise/frontend-http-client"),nt=require("@lokalise/universal-ts-utils/api-contracts/apiContracts"),C=require("@tanstack/react-query"),B=require("@lokalise/universal-ts-utils/node");function Lt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=Lt(b);var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V,Ie;function be(){if(Ie)return V;Ie=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return V=e,V}var Z,Re;function Ot(){if(Re)return Z;Re=1;var e=typeof F=="object"&&F&&F.Object===Object&&F;return Z=e,Z}var X,xe;function st(){if(xe)return X;xe=1;var e=Ot(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return X=n,X}var ee,Ne;function qt(){if(Ne)return ee;Ne=1;var e=st(),t=function(){return e.Date.now()};return ee=t,ee}var te,Ae;function Mt(){if(Ae)return te;Ae=1;var e=/\s/;function t(n){for(var s=n.length;s--&&e.test(n.charAt(s)););return s}return te=t,te}var ne,Ce;function Ut(){if(Ce)return ne;Ce=1;var e=Mt(),t=/^\s+/;function n(s){return s&&s.slice(0,e(s)+1).replace(t,"")}return ne=n,ne}var re,ke;function at(){if(ke)return re;ke=1;var e=st(),t=e.Symbol;return re=t,re}var se,Le;function Bt(){if(Le)return se;Le=1;var e=at(),t=Object.prototype,n=t.hasOwnProperty,s=t.toString,a=e?e.toStringTag:void 0;function i(c){var l=n.call(c,a),d=c[a];try{c[a]=void 0;var u=!0}catch{}var m=s.call(c);return u&&(l?c[a]=d:delete c[a]),m}return se=i,se}var ae,Oe;function Gt(){if(Oe)return ae;Oe=1;var e=Object.prototype,t=e.toString;function n(s){return t.call(s)}return ae=n,ae}var oe,qe;function Ht(){if(qe)return oe;qe=1;var e=at(),t=Bt(),n=Gt(),s="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function c(l){return l==null?l===void 0?a:s:i&&i in Object(l)?t(l):n(l)}return oe=c,oe}var ie,Me;function Dt(){if(Me)return ie;Me=1;function e(t){return t!=null&&typeof t=="object"}return ie=e,ie}var ce,Ue;function $t(){if(Ue)return ce;Ue=1;var e=Ht(),t=Dt(),n="[object Symbol]";function s(a){return typeof a=="symbol"||t(a)&&e(a)==n}return ce=s,ce}var ue,Be;function Ft(){if(Be)return ue;Be=1;var e=Ut(),t=be(),n=$t(),s=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function d(u){if(typeof u=="number")return u;if(n(u))return s;if(t(u)){var m=typeof u.valueOf=="function"?u.valueOf():u;u=t(m)?m+"":m}if(typeof u!="string")return u===0?u:+u;u=e(u);var h=i.test(u);return h||c.test(u)?l(u.slice(2),h?2:8):a.test(u)?s:+u}return ue=d,ue}var le,Ge;function ot(){if(Ge)return le;Ge=1;var e=be(),t=qt(),n=Ft(),s="Expected a function",a=Math.max,i=Math.min;function c(l,d,u){var m,h,z,P,g,v,S=0,E=!1,p=!1,w=!0;if(typeof l!="function")throw new TypeError(s);d=n(d)||0,e(u)&&(E=!!u.leading,p="maxWait"in u,z=p?a(n(u.maxWait)||0,d):z,w="trailing"in u?!!u.trailing:w);function y(_){var R=m,q=h;return m=h=void 0,S=_,P=l.apply(q,R),P}function T(_){return S=_,g=setTimeout($,d),E?y(_):P}function D(_){var R=_-v,q=_-S,Pe=d-R;return p?i(Pe,z-q):Pe}function Se(_){var R=_-v,q=_-S;return v===void 0||R>=d||R<0||p&&q>=z}function $(){var _=t();if(Se(_))return Ee(_);g=setTimeout($,D(_))}function Ee(_){return g=void 0,w&&m?y(_):(m=h=void 0,P)}function xt(){g!==void 0&&clearTimeout(g),S=0,m=v=h=g=void 0}function Nt(){return g===void 0?P:Ee(t())}function Y(){var _=t(),R=Se(_);if(m=arguments,h=this,v=_,R){if(g===void 0)return T(v);if(p)return clearTimeout(g),g=setTimeout($,d),y(v)}return g===void 0&&(g=setTimeout($,d)),P}return Y.cancel=xt,Y.flush=Nt,Y}return le=c,le}var Qt=ot();const Kt=rt(Qt);var de,He;function Jt(){if(He)return de;He=1;var e=ot(),t=be(),n="Expected a function";function s(a,i,c){var l=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(c)&&(l="leading"in c?!!c.leading:l,d="trailing"in c?!!c.trailing:d),e(a,i,{leading:l,maxWait:i,trailing:d})}return de=s,de}var Wt=Jt();const Yt=rt(Wt),Vt=(e,t,n,s)=>{switch(t){case"debounce":return Kt(e,n,s);case"throttle":return Yt(e,n,s);default:return e}},Zt=e=>{const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>{var s;return(s=t.current)===null||s===void 0?void 0:s.call(t,...n)},[])},Xt=e=>{const[t,n]=M.useState((e==null?void 0:e.current)||null);return e&&setTimeout(()=>{e.current!==t&&n(e.current)},0),{refProxy:M.useMemo(()=>new Proxy(a=>{a!==t&&n(a)},{get(a,i){return i==="current"?t:a[i]},set(a,i,c){return i==="current"?n(c):a[i]=c,!0}}),[t]),refElement:t,setRefElement:n}},en=(e,t)=>t==="border-box"?{width:e.borderBoxSize[0].inlineSize,height:e.borderBoxSize[0].blockSize}:t==="content-box"?{width:e.contentBoxSize[0].inlineSize,height:e.contentBoxSize[0].blockSize}:{width:e.contentRect.width,height:e.contentRect.height};function tn({skipOnMount:e=!1,refreshMode:t,refreshRate:n=1e3,refreshOptions:s,handleWidth:a=!0,handleHeight:i=!0,targetRef:c,observerOptions:l,onResize:d}={}){const u=b.useRef(e),m=Zt(d),[h,z]=b.useState({width:void 0,height:void 0}),{refProxy:P,refElement:g}=Xt(c),{box:v}=l||{},S=b.useCallback(p=>{if(!a&&!i)return;if(u.current){u.current=!1;return}const w=(y,T)=>a&&y.width!==T.width||i&&y.height!==T.height;p.forEach(y=>{const T=en(y,v);z(D=>w(D,T)?(m==null||m({width:T.width,height:T.height,entry:y}),T):D)})},[a,i,u,v]),E=b.useCallback(Vt(S,t,n,s),[S,t,n,s]);return b.useEffect(()=>{let p;return g?(p=new window.ResizeObserver(E),p.observe(g,l)):(h.width||h.height)&&(m==null||m({width:null,height:null,entry:null}),z({width:void 0,height:void 0})),()=>{var w,y,T;(w=p==null?void 0:p.disconnect)===null||w===void 0||w.call(p),(T=(y=E).cancel)===null||T===void 0||T.call(y)}},[E,g]),Object.assign({ref:P},h)}function it(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=it(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function A(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=it(e))&&(s&&(s+=" "),s+=t);return s}const nn="_headerContainer_1cubo_1",rn="_navigationTabList_1cubo_8",sn="_navigationTab_1cubo_8",an="_headerContent_1cubo_34",on="_staticEnabled_1cubo_50",L={headerContainer:nn,navigationTabList:rn,navigationTab:sn,headerContent:an,staticEnabled:on},cn=77,U=({sticky:e,children:t})=>{const{ref:n,height:s}=tn({refreshMode:"debounce",refreshRate:0}),[a,i]=b.useState(!1),c=()=>a?!e:!0;b.useEffect(()=>{const d=()=>{i(window.scrollY>0)};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]);const l=`${s||cn}px`;return o.jsx("div",{style:{minHeight:l},children:o.jsx("div",{children:o.jsxs("div",{ref:n,className:A(L.headerContent,{[L.staticEnabled]:c()}),children:[o.jsx(U.Header,{}),o.jsx(U.Tabs,{}),t]})})})};U.Header=({children:e})=>o.jsx("div",{className:L.headerContainer,children:e});U.Tabs=({children:e})=>o.jsx("div",{className:"flex justify-between gap-2 nowrap",children:e});const un="_sidebarContainer_bmdti_1",ln={sidebarContainer:un},dn="_logoLink_1baxb_1",mn={logoLink:dn},fn=({src:e,href:t="/",ariaLabel:n="Home",alt:s="Lokalise"})=>o.jsx("a",{className:mn.logoLink,href:t,"aria-label":n,children:o.jsx("img",{src:e,alt:s})}),_n="_link_1weq1_1",bn="_active_1weq1_18",De={link:_n,active:bn},gn=({label:e,to:t,icon:n})=>o.jsx(f.Tooltip,{placement:"right",tooltip:e,children:o.jsx(f.Link,{className:A(De.link,{[De.active]:window.location.pathname.startsWith(t)}),href:t,children:o.jsx(n,{size:"25px"})})}),hn="_dropdownButton_hwh0c_1",pn="_dropdownButtonActive_hwh0c_18",$e={dropdownButton:hn,dropdownButtonActive:pn},Tn=({children:e,icon:t})=>o.jsx(f.Menu,{menuButton:({opened:n})=>o.jsx(f.Tooltip,{placement:"right",tooltip:"Help",children:o.jsx("button",{type:"button",className:A($e.dropdownButton,{[$e.dropdownButtonActive]:n}),children:o.jsx(t,{size:"25px"})})}),children:o.jsx(f.MenuList,{placement:"right-start",children:e})}),yn="_iconContainer_nz34m_1",vn={iconContainer:yn},ct=({className:e=""})=>o.jsx("div",{"aria-label":"Upgrade Icon",className:A(vn.iconContainer,"flex-row","items-center","justify-center",e),children:o.jsx(f.CaretUpIcon,{})}),jn="_menuContainer_wbu3u_5",zn="_profileButton_wbu3u_16",Sn="_profileImage_wbu3u_29",En="_profileImageHighlight_wbu3u_37",Pn="_profileImageUpgradeIcon_wbu3u_41",wn="_userIconWrapper_wbu3u_47",x={menuContainer:jn,profileButton:zn,profileImage:Sn,profileImageHighlight:En,profileImageUpgradeIcon:Pn,userIconWrapper:wn},ut=b.createContext({}),G=()=>b.useContext(ut),In=({children:e})=>{const{currentTeam:t,otherTeams:n,showUpgradeCta:s,showBillingButton:a,allowTeamCreation:i,isProviderAlpha:c,canAccessTeamSettings:l,isEndOfTrialActive:d,isTeamSuspended:u,isFullyAuthenticated:m}=G();return o.jsx(f.Menu,{menuButton:()=>o.jsxs("button",{className:x.profileButton,"aria-label":"Profile menu",type:"button",children:[t!=null&&t.logoUrl?o.jsx("img",{src:t.logoUrl,className:A(x.profileImage,{[x.profileImageHighlight]:s}),alt:"Team Logo"}):o.jsx("div",{className:A(x.userIconWrapper,"flex-row","align-center","items-center",{[x.profileImageHighlight]:s}),children:o.jsx(f.UserIcon,{size:"25px"})}),s&&o.jsx(ct,{className:x.profileImageUpgradeIcon})]}),children:o.jsx(f.MenuList,{placement:"right-end",className:x.menuContainer,children:e({allowTeamCreation:i,otherTeams:n,canAccessTeamSettings:l,isEndOfTrialActive:d,isTeamSuspended:u,showBillingButton:a,isProviderAlpha:c,isFullyAuthenticated:m})})})},ge=0,lt=9999,dt=[150,151,250,251],mt=[152,153,252,253],ft=[154,155,157,158,254,255,258,354,355,358],_t=[156,159,160,256,259,260],he=9998,J=e=>e===ge,pe=e=>e===lt,Rn=e=>dt.includes(e),xn=e=>mt.includes(e),Nn=e=>ft.includes(e),An=e=>_t.includes(e),Cn=e=>e>ge&&e<he,kn=e=>e===he,Ln=/\n/,Fe=(e,t,n)=>e.split(t).flatMap((s,a)=>a!==0?[b.cloneElement(n,{key:Math.random().toString(32).slice(0,10)}),s]:s),On=(e,t,n)=>typeof e=="string"?Fe(e,t,n):e.flatMap(s=>typeof s=="string"?Fe(s,t,n):s),qn=e=>On(e,Ln,o.jsx("br",{})),Mn=/(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi,Un=e=>e.match(Mn)??[],Qe=(e,t,n)=>{const s=e.split(t);if(s.length===1)return e;const a=[];return s[0]!==""&&a.push(s[0]),s.shift(),s[s.length-1]===""&&s.pop(),a.push(o.jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:t},t+n)),a.push(s.join(t)),a.filter(i=>i!=="")},Ke=e=>{const t=Un(e);return t!=null&&t.length?t.reduce((n,s,a)=>typeof n=="string"?Qe(n,s,a):n.flatMap(i=>typeof i=="string"?Qe(i,s,a):i),e):e},Bn=e=>typeof e=="string"?Ke(e):e.flatMap(t=>typeof t=="string"?Ke(t):t,e),Gn=(e,t="PP")=>tt.format(e,t),Hn=(e,t,n="PP")=>tt.format(kt.toZonedTime(e,t),n),Dn=e=>{b.useEffect(e,[])},Je={biller:"biller",owner:"owner"},We=[Je.biller,Je.owner],$n=({children:e,config:t})=>{const{teams:n,currentTeamId:s,planId:a,isEndOfTrialActive:i,isFullyAuthenticated:c,userTeamRole:l}=t,d=n.find(E=>E.id===s),u=n.filter(E=>E.id!==s),m=We.includes(l),h=We.includes(l),z=J(a)||pe(a),S={...t,currentTeam:d,otherTeams:u,canChangeBilling:m,canAccessTeamSettings:h,isOnFreeOrTrialPlan:z,showUpgradeCta:c&&z&&m,showBillingButton:c&&h&&m,allowTeamCreation:c&&!i};return o.jsx(ut.Provider,{value:S,children:e})},Fn=({config:e,children:t})=>o.jsx($n,{config:e,children:o.jsx(In,{children:t})}),Qn="_container_q5pot_1",Kn="_profileEmail_q5pot_5",Ye={container:Qn,profileEmail:Kn},Jn=({href:e,onClick:t,userEmail:n,hideBottomDivider:s})=>{const{isEndOfTrialActive:a,isTeamSuspended:i}=G();return a||i?null:o.jsxs(o.Fragment,{children:[o.jsx(f.MenuItem,{href:e,onClick:()=>{t==null||t()},children:o.jsxs("div",{className:`flex-col ${Ye.container}`,children:[o.jsx("span",{children:"Profile Settings"}),o.jsx("span",{className:Ye.profileEmail,children:n})]})}),!s&&o.jsx(f.MenuDivider,{})]})},Wn="_wrapper_15d85_1",Yn="_profileImage_15d85_14",Vn="_teamName_15d85_22",Zn="_planLabel_15d85_29",Xn="_membership_15d85_38",er="_defaultProfileImage_15d85_44",k={wrapper:Wn,profileImage:Yn,teamName:Vn,planLabel:Zn,membership:Xn,defaultProfileImage:er},bt=({team:e,onClick:t,hidePlanLabel:n})=>{const{currentTeam:s,planId:a}=G(),i=e||s;if(!i)return null;const c=J(a)?"Free":pe(a)?"Trial":void 0,l=t?f.MenuItem:"div";return o.jsxs(l,{className:`flex-row gap-2 flex-nowrap items-center ${k.wrapper}`,...t&&{onClick:()=>t(i)},children:[i.logoUrl?o.jsx("img",{className:k.profileImage,src:i.logoUrl,alt:"Team Logo"}):o.jsx("span",{className:`flex-row justify-center items-center ${k.defaultProfileImage}`,children:o.jsx(f.UserIcon,{size:"25px"})}),o.jsxs("div",{className:"flex-col items-start",children:[o.jsxs("div",{className:"flex-row items-center flex-nowrap gap-2",children:[o.jsx("span",{title:i.name,className:k.teamName,children:i.name}),c&&!n&&o.jsx("span",{className:`flex-row justify-center items-center ${k.planLabel}`,children:c})]}),o.jsx("span",{className:k.membership,children:i.role})]})]})},tr="_teamsContainer_1t68g_1",nr={teamsContainer:tr},rr=({onSwitchTeam:e})=>{const{otherTeams:t}=G();return t.length===0?null:o.jsx("div",{className:`flex-col items-stretch ${nr.teamsContainer}`,children:t.map(n=>o.jsx(bt,{team:n,onClick:e,hidePlanLabel:!0},n.id))})},sr="_container_1u995_1",ar="_planCta_1u995_15",or="_upgradeIconWrapper_1u995_19",me={container:sr,planCta:ar,upgradeIconWrapper:or},ir=({upgradeOptionHref:e})=>{const{planId:t,trialDaysLeft:n,showUpgradeCta:s}=G();if(!s)return null;const c=J(t)?"Your team is currently on the Free plan":`Free trial ends in ${n} ${n===1?"day":"days"}`;return o.jsxs(f.MenuItem,{href:e,className:`flex-col gap-1 items-start ${me.container}`,children:[o.jsx("span",{className:me.planCta,children:c}),o.jsxs("div",{className:`flex-row items-center gap-1 ${me.upgradeIconWrapper}`,children:[o.jsx(ct,{}),o.jsx("span",{children:"See upgrade options"})]})]})},j=({children:e,...t})=>o.jsx("nav",{...t,className:ln.sidebarContainer,children:e}),cr=({children:e})=>o.jsx("div",{children:e});j.Top=cr;const ur=({children:e})=>o.jsx("div",{children:e});j.Bottom=ur;j.Avatar=fn;j.IconLink=gn;j.Menu=Tn;j.ProfileMenu=Fn;j.TeamSwitch=rr;j.TeamMenuItem=bt;j.UpgradeMenuItem=ir;j.ProfileSettingsMenuItem=Jn;const lr="_breadcrumbsItem_1hm6a_1",dr="_breadcrumbs_1hm6a_1",Ve={breadcrumbsItem:lr,breadcrumbs:dr},mr=({items:e})=>o.jsx("nav",{"aria-label":"breadcrumb",className:Ve.breadcrumbs,children:e.map((t,n)=>o.jsxs(b.Fragment,{children:[o.jsx(f.Link,{className:Ve.breadcrumbsItem,href:t.link,rel:"noreferrer",children:t.name}),n<e.length-1&&o.jsx("span",{children:" — "})]},`${t.link}-${t.name}`))}),fr=({items:e})=>o.jsx(o.Fragment,{children:e.map((t,n)=>o.jsxs(b.Fragment,{children:[!!n&&t.some(s=>s.visible)&&o.jsx(f.MenuDivider,{}),t.filter(({visible:s})=>s).map(({link:s,label:a,onClick:i})=>o.jsx(f.MenuItem,{href:s||"#","aria-label":a,onClick:i,children:a},a))]},t[0].label))}),_r="_badge_1pc1v_1",br="_tag_1pc1v_15",gr="_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21",hr="_disabled_1pc1v_57",pr="_projectNavigationItem_1pc1v_61",Tr="_projectNavigationItemDisabled_1pc1v_67",N={badge:_r,tag:br,withNavLinkStyle:gr,disabled:hr,projectNavigationItem:pr,projectNavigationItemDisabled:Tr},Ze=({label:e,badge:t,novel:n})=>o.jsxs("div",{className:"flex gap-1",children:[o.jsxs("div",{children:[o.jsx("span",{children:e}),!!t&&o.jsx("div",{className:N.badge,"aria-label":`${t} items requiring attention`,children:t>9?"9+":t})]}),!!n&&o.jsx(f.Tag,{className:N.tag,children:n})]}),fe=b.forwardRef(({label:e,href:t="",disabled:n=!1,badge:s,onClick:a,novel:i},c)=>o.jsx(f.Tooltip,{tooltip:"You do not have access to this function",show:n,children:o.jsx("div",{className:n?N.projectNavigationItemDisabled:N.projectNavigationItem,children:a||n||!t?o.jsx("button",{type:"button",ref:c,className:A(N.withNavLinkStyle,{[N.disabled]:n}),disabled:n,onClick:a,children:o.jsx(Ze,{label:e,badge:s,novel:i})}):o.jsx("a",{href:t,className:N.withNavLinkStyle,children:o.jsx(Ze,{label:e,badge:s,novel:i})})})}));fe.displayName="NavigationTabsItem";const yr=e=>(e==null?void 0:e.some(t=>t.some(n=>n.visible)))??!1,vr=e=>e.visible&&(!e.dropdown||yr(e.dropdown)),jr=({navigation:e,activeItem:t})=>o.jsx("nav",{"aria-label":"Project",children:o.jsx("ul",{className:L.navigationTabList,"aria-orientation":"horizontal",children:e.filter(vr).map(n=>{var s,a,i;return n.dropdown?o.jsx("li",{className:L.navigationTab,"data-testid":n.key,"aria-selected":(s=n.isActive)==null?void 0:s.call(n,t),children:o.jsx(f.Menu,{menuButton:({opened:c})=>o.jsx(fe,{label:n.label,disabled:n.disabled,active:c}),children:o.jsx(f.MenuList,{children:o.jsx(fr,{items:n.dropdown})})})},n.key):o.jsx("li",{className:L.navigationTab,"data-testid":n.key,"aria-selected":(a=n.isActive)==null?void 0:a.call(n,t),children:o.jsx(fe,{label:n.label,href:n.link,onClick:n.onClick,disabled:n.disabled,badge:n.badge,novel:n.novel,active:(i=n.isActive)==null?void 0:i.call(n,t)})},n.key)})})}),zr=r.z.object({accessToken:r.z.string(),refreshToken:r.z.string()}),Sr=r.z.union([r.z.object({Authorization:r.z.string().startsWith("Bearer ")}),r.z.object({"x-csrf-token":r.z.string()})]),W=nt.buildPayloadRoute({description:"Takes a teamId and returns a JWT token access and refresh token for the user",method:"post",requestPathParamsSchema:r.z.object({teamId:r.z.number()}),pathResolver:e=>`/team/${e.teamId}/actions/get-user-token`,requestHeaderSchema:Sr,requestBodySchema:r.z.undefined(),successResponseBodySchema:zr}),gt={teamKeyCsrf:(e,t)=>["getUserToken","x-csrf-token",t,e],teamKeyJwt:(e,t)=>["getUserToken","Authorization",`Bearer ${t}`,e]},ht=(e,t)=>C.useQuery({...t,queryFn:({queryKey:[n,s,a,i]})=>I.sendByPayloadRoute(e,W,{pathParams:{teamId:i},headers:s==="x-csrf-token"?{"x-csrf-token":a}:{Authorization:a}})}),pt=r.z.union([r.z.literal("owner"),r.z.literal("admin"),r.z.literal("biller"),r.z.literal("member")]),Er=r.z.object({userId:r.z.number(),userUuid:r.z.string(),teamId:r.z.number(),userTeamRole:pt,userEmail:r.z.string().email(),userName:r.z.string(),userCurrentTeamId:r.z.number(),planId:r.z.number(),planName:r.z.string(),isProviderAlpha:r.z.boolean(),isFullyAuthenticated:r.z.boolean(),exp:r.z.number()});function H(e){try{const t=e.split(".")[1],n=atob(t);return Er.parse(JSON.parse(n))}catch{return}}const K=class K extends CustomEvent{constructor(t){super(K.eventName,{detail:{token:t,payload:H(t.accessToken)}})}};we(K,"eventName","new-jwt-issued");let O=K;function Te(){const e=_e(document.cookie,"accessToken"),t=_e(document.cookie,"refreshToken");if(!(!e||!t))return{accessToken:e,refreshToken:t}}function Tt(){return _e(document.cookie,"csrf_token")}function _e(e,t){var n,s;return(s=(n=e.split(";").find(a=>a.trim().startsWith(`${t}=`)))==null?void 0:n.trim())==null?void 0:s.substring(t.length+1)}function Pr(e,t){const n=Tt(),s=ht(e,{queryKey:gt.teamKeyCsrf(t,n??""),enabled:n!==void 0}),a=b.useRef();return b.useEffect(()=>{s.data&&s.data.accessToken!==a.current&&(window.dispatchEvent(new O(s.data)),a.current=s.data.accessToken)},[s.data]),s}function ye(){const[e,t]=b.useState();return b.useEffect(()=>{const n=a=>{t(a.detail.payload)},s=Te();return t(s&&H(s.accessToken)),window.addEventListener(O.eventName,n),()=>{window.removeEventListener(O.eventName,n)}},[]),e}const wr=r.z.object({user_id:r.z.number(),email:r.z.string().email(),fullname:r.z.string(),created_at:r.z.string(),created_at_timestamp:r.z.number(),role:pt}),Ir=r.z.object({team_id:r.z.number(),team_user:wr}),yt=B.buildGetRoute({description:"Get the details of a team user",requestPathParamsSchema:r.z.object({teamId:r.z.number(),userId:r.z.number()}),pathResolver:({teamId:e,userId:t})=>`/teams/${e}/users/${t}`,successResponseBodySchema:Ir}),vt={teamUserKey:(e,t)=>["GetTeamUsers",e,t]},jt=(e,t)=>C.useQuery({...t,queryFn:({queryKey:[n,s,a]})=>I.sendByGetRoute(e,yt,{pathParams:{teamId:s,userId:a}})});function Rr(e){const t=ye();return jt(e,{queryKey:vt.teamUserKey((t==null?void 0:t.teamId)??0,(t==null?void 0:t.userId)??0),enabled:(t==null?void 0:t.userId)!==void 0&&t.teamId!==void 0})}const xr=r.z.object({lang_id:r.z.number(),lang_iso:r.z.string(),lang_name:r.z.string(),is_writable:r.z.union([r.z.literal(0),r.z.literal(1)])}),Nr=r.z.object({user_id:r.z.number(),email:r.z.string().email(),fullname:r.z.string(),created_at:r.z.string(),created_at_timestamp:r.z.number(),admin_rights:r.z.array(r.z.string()),languages:r.z.array(xr),is_admin:r.z.boolean(),is_reviewer:r.z.boolean()}),Ar=r.z.object({project_id:r.z.string(),contributors:r.z.array(Nr)}),zt=B.buildGetRoute({description:"Get the details of a project contributor",requestPathParamsSchema:r.z.object({projectId:r.z.string(),contributorId:r.z.number()}),pathResolver:({projectId:e,contributorId:t})=>`/projects/${e}/contributors/${t}`,successResponseBodySchema:Ar}),St={projectUserKey:(e,t)=>["RetrieveContributor",e,t]},Et=(e,t)=>C.useQuery({...t,queryFn:({queryKey:[n,s,a]})=>I.sendByGetRoute(e,zt,{pathParams:{projectId:s,contributorId:a}})});function Cr(e,t){const n=ye();return Et(e,{queryKey:St.projectUserKey(t,(n==null?void 0:n.userId)??0),enabled:n!==void 0})}function kr(){const e=Te();if(!e)return;const t=H(e.accessToken);if(t)return{...e,payload:t}}function Lr(){return e=>(t,n)=>e(t,{...n,headers:{...n.headers,"x-lokalise-plugin":"true"},credentials:"omit"})}function Q(e){return{Authorization:`Bearer ${e}`}}function Or(e,t){return n=>async(s,a)=>{var l;const i=await t.getCachedJwtToken();if(i===void 0)return n(s,a);const c=await n(s,{...a,headers:{...a.headers,...Q(i.accessToken)}});if(i&&(c.status===401||c.status===403)){const d=H(i.accessToken);if(!d)return c;const u=await I.sendByPayloadRoute(e,W,{pathParams:{teamId:d.teamId},headers:Q(i.refreshToken)});return await((l=t.onNewJwtTokenIssued)==null?void 0:l.call(t,u)),n(s,{...a,headers:{...a.headers,...Q(u.accessToken)}})}return c}}const Pt={wretch:{lokaliseAuth(e){return this.middlewares([Or(this,e)])}}};function qr(e,t){return n=>async(s,a)=>{var d;if(await t.getCachedJwtToken()!==void 0)return n(s,a);const c=await t.getCsrfToken();if(c===void 0)return n(s,a);const l=await I.sendByPayloadRoute(e,W,{pathParams:{teamId:await t.getTeamId()},headers:{"x-csrf-token":c}});return await((d=t.onNewJwtTokenIssued)==null?void 0:d.call(t,l)),n(s,{...a,headers:{...a.headers,...Q(l.accessToken)}})}}const Mr={wretch:{lokaliseAuth(e={}){return this.addon(Pt).lokaliseAuth(Xe(e))},promoteClassicSession(e){const t=Xe(e);return this.middlewares([qr(this,t)])}}};function Xe(e){return{...e,getCachedJwtToken:e.getCachedJwtToken??(async()=>Te()),getCsrfToken:"getCsrfToken"in e?e.getCsrfToken:async()=>Tt(),onNewJwtTokenIssued:t=>{var n;return window.dispatchEvent(new O(t)),((n=e.onNewJwtTokenIssued)==null?void 0:n.call(e,t))??Promise.resolve()}}}const Ur=r.z.object({lang_iso:r.z.string(),custom_iso:r.z.string().optional()}),Br=r.z.object({language_id:r.z.number(),language_iso:r.z.string(),progress:r.z.number(),words_to_do:r.z.number()}),Gr=r.z.object({projectId:r.z.string()}),Hr=r.z.object({lang_id:r.z.number(),lang_iso:r.z.string(),lang_name:r.z.string(),is_rtl:r.z.boolean(),plural_forms:r.z.array(r.z.string().optional())}),Dr=r.z.object({project_id:r.z.string(),project_uuid:r.z.string().uuid(),languages:r.z.array(Hr)}),ve=r.z.union([r.z.literal("localization_files"),r.z.literal("paged_documents"),r.z.literal("marketing")]),$r=r.z.object({per_platform_key_names:r.z.boolean(),reviewing:r.z.boolean(),auto_toggle_unverified:r.z.boolean(),offline_translation:r.z.boolean(),key_editing:r.z.boolean(),inline_machine_translations:r.z.boolean(),custom_translation_statuses:r.z.boolean(),custom_translation_statuses_allow_multiple:r.z.boolean(),segmentation:r.z.boolean(),contributor_preview_download_enabled:r.z.boolean()}),Fr=r.z.object({not_reviewed:r.z.number(),unverified:r.z.number(),spelling_grammar:r.z.number(),inconsistent_placeholders:r.z.number(),inconsistent_html:r.z.number(),different_number_of_urls:r.z.number(),different_urls:r.z.number(),leading_whitespace:r.z.number(),trailing_whitespace:r.z.number(),different_number_of_email_address:r.z.number(),different_email_address:r.z.number(),different_brackets:r.z.number(),different_numbers:r.z.number(),double_space:r.z.number(),special_placeholder:r.z.number(),unbalanced_brackets:r.z.number()}),Qr=r.z.object({progress_total:r.z.number(),keys_total:r.z.number(),team:r.z.number(),base_words:r.z.number(),qa_issues_total:r.z.number(),qa_issues:Fr,languages:r.z.array(Br)}),je=r.z.object({project_id:r.z.string(),uuid:r.z.string().uuid(),project_type:ve,name:r.z.string(),description:r.z.string(),created_at:r.z.string(),created_at_timestamp:r.z.number(),created_by:r.z.number(),created_by_email:r.z.string(),team_id:r.z.number(),base_language_id:r.z.number(),base_language_iso:r.z.string(),settings:$r.optional(),statistics:Qr.optional()}),Kr=r.z.object({name:r.z.string(),team_id:r.z.string(),base_lang_iso:r.z.string(),languages:r.z.array(Ur),project_type:ve,is_segmentation_enabled:r.z.boolean()}),et=r.z.union([r.z.literal(0),r.z.literal(1)]),Jr=r.z.object({project_type:ve.optional(),filter_team_id:r.z.number().optional(),filter_names:r.z.string().optional(),include_statistics:et.optional(),include_settings:et.optional(),limit:r.z.number().optional(),page:r.z.number().optional()}),Wr=r.z.object({projects:r.z.array(je)}),Yr=r.z.object({project_id:r.z.string()}),ze=()=>"/projects",wt=nt.buildPayloadRoute({description:"Create a new project",method:"post",pathResolver:ze,requestBodySchema:Kr,successResponseBodySchema:je}),It=B.buildGetRoute({description:"List all projects",pathResolver:ze,requestQuerySchema:Jr,successResponseBodySchema:Wr}),Rt=B.buildGetRoute({description:"Retrieve a project",pathResolver:ze,requestQuerySchema:Yr,successResponseBodySchema:je});function Vr(e,t={}){return C.useMutation({...t,mutationFn:n=>I.sendByPayloadRoute(e,wt,{body:n})})}const Zr=B.buildGetRoute({description:"List of project languages",requestPathParamsSchema:Gr,pathResolver:({projectId:e})=>`/projects/${e}/languages`,successResponseBodySchema:Dr}),Xr={projectIdKey:e=>["listProjectLanguages",e]};function es(e,t){return C.useQuery({...t,queryFn:({queryKey:[n,s]})=>I.sendByGetRoute(e,Zr,{pathParams:{projectId:s}})})}const ts={paramsKey:e=>["listProjects",e]};function ns(e,t){return C.useQuery({...t,queryFn:({queryKey:[n,s]})=>I.sendByGetRoute(e,It,{queryParams:s})})}const rs={projectIdKey:e=>["retrieveProject",e]};function ss(e,t){return C.useQuery({...t,queryFn:({queryKey:[n,s]})=>I.sendByGetRoute(e,Rt,{queryParams:{project_id:s}})})}exports.Breadcrumbs=mr;exports.ENTERPRISE_OPENSOURCE_PLAN_ID=he;exports.ENTERPRISE_PLAN_IDS=_t;exports.ESSENTIAL_PLAN_IDS=mt;exports.FREE_PLAN_ID=ge;exports.LokaliseAuthAddon=Pt;exports.LokaliseAuthBrowserAddon=Mr;exports.NavigationPanel=U;exports.NavigationTabs=jr;exports.PRO_PLAN_IDS=ft;exports.START_PLAN_IDS=dt;exports.Sidebar=j;exports.TRIAL_PLAN_ID=lt;exports.convertNewLineToBreakTag=qn;exports.createProject=wt;exports.formatDate=Gn;exports.formatDateTz=Hn;exports.getAuthenticatedSessionDetailFromRequest=kr;exports.getTeamUser=yt;exports.getTeamUsersQueryKey=vt;exports.getUserToken=W;exports.getUserTokenKey=gt;exports.isEnterpriseOpenSourcePlan=kn;exports.isEnterprisePlan=An;exports.isEssentialPlan=xn;exports.isFreePlan=J;exports.isPaidPlan=Cn;exports.isProPlan=Nn;exports.isStartPlan=Rn;exports.isTrialPlan=pe;exports.listProjectLanguagesKey=Xr;exports.listProjects=It;exports.listProjectsKey=ts;exports.makeUrlClickable=Bn;exports.parseJwtTokenPayload=H;exports.publicApiHeadersMiddleware=Lr;exports.retrieveContributor=zt;exports.retrieveContributorKeys=St;exports.retrieveProject=Rt;exports.retrieveProjectQueryKey=rs;exports.useAuthenticatedProjectContributor=Cr;exports.useAuthenticatedSessionPayload=ye;exports.useAuthenticatedUser=Rr;exports.useCreateProjectMutation=Vr;exports.useEffectOnce=Dn;exports.useGetPromotedClassicSessionJwtQuery=Pr;exports.useGetTeamUsersQuery=jt;exports.useGetUserTokenQuery=ht;exports.useListProjectLanguagesQuery=es;exports.useListProjectsQuery=ns;exports.useRetrieveContributorQuery=Et;exports.useRetrieveProjectQuery=ss;
|
1
|
+
"use strict";var At=Object.defineProperty;var Ct=(e,t,n)=>t in e?At(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var we=(e,t,n)=>Ct(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),b=require("react"),f=require("@lokalise/louis"),tt=require("date-fns"),kt=require("date-fns-tz"),r=require("zod"),I=require("@lokalise/frontend-http-client"),nt=require("@lokalise/universal-ts-utils/api-contracts/apiContracts"),C=require("@tanstack/react-query"),B=require("@lokalise/universal-ts-utils/node");function Lt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const q=Lt(b);var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V,Ie;function be(){if(Ie)return V;Ie=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return V=e,V}var Z,Re;function Ot(){if(Re)return Z;Re=1;var e=typeof F=="object"&&F&&F.Object===Object&&F;return Z=e,Z}var X,xe;function st(){if(xe)return X;xe=1;var e=Ot(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return X=n,X}var ee,Ne;function Mt(){if(Ne)return ee;Ne=1;var e=st(),t=function(){return e.Date.now()};return ee=t,ee}var te,Ae;function qt(){if(Ae)return te;Ae=1;var e=/\s/;function t(n){for(var s=n.length;s--&&e.test(n.charAt(s)););return s}return te=t,te}var ne,Ce;function Ut(){if(Ce)return ne;Ce=1;var e=qt(),t=/^\s+/;function n(s){return s&&s.slice(0,e(s)+1).replace(t,"")}return ne=n,ne}var re,ke;function at(){if(ke)return re;ke=1;var e=st(),t=e.Symbol;return re=t,re}var se,Le;function Bt(){if(Le)return se;Le=1;var e=at(),t=Object.prototype,n=t.hasOwnProperty,s=t.toString,a=e?e.toStringTag:void 0;function i(c){var l=n.call(c,a),d=c[a];try{c[a]=void 0;var u=!0}catch{}var m=s.call(c);return u&&(l?c[a]=d:delete c[a]),m}return se=i,se}var ae,Oe;function Gt(){if(Oe)return ae;Oe=1;var e=Object.prototype,t=e.toString;function n(s){return t.call(s)}return ae=n,ae}var oe,Me;function Ht(){if(Me)return oe;Me=1;var e=at(),t=Bt(),n=Gt(),s="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function c(l){return l==null?l===void 0?a:s:i&&i in Object(l)?t(l):n(l)}return oe=c,oe}var ie,qe;function Dt(){if(qe)return ie;qe=1;function e(t){return t!=null&&typeof t=="object"}return ie=e,ie}var ce,Ue;function $t(){if(Ue)return ce;Ue=1;var e=Ht(),t=Dt(),n="[object Symbol]";function s(a){return typeof a=="symbol"||t(a)&&e(a)==n}return ce=s,ce}var ue,Be;function Ft(){if(Be)return ue;Be=1;var e=Ut(),t=be(),n=$t(),s=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function d(u){if(typeof u=="number")return u;if(n(u))return s;if(t(u)){var m=typeof u.valueOf=="function"?u.valueOf():u;u=t(m)?m+"":m}if(typeof u!="string")return u===0?u:+u;u=e(u);var h=i.test(u);return h||c.test(u)?l(u.slice(2),h?2:8):a.test(u)?s:+u}return ue=d,ue}var le,Ge;function ot(){if(Ge)return le;Ge=1;var e=be(),t=Mt(),n=Ft(),s="Expected a function",a=Math.max,i=Math.min;function c(l,d,u){var m,h,z,P,g,y,S=0,E=!1,p=!1,w=!0;if(typeof l!="function")throw new TypeError(s);d=n(d)||0,e(u)&&(E=!!u.leading,p="maxWait"in u,z=p?a(n(u.maxWait)||0,d):z,w="trailing"in u?!!u.trailing:w);function v(_){var R=m,M=h;return m=h=void 0,S=_,P=l.apply(M,R),P}function T(_){return S=_,g=setTimeout($,d),E?v(_):P}function D(_){var R=_-y,M=_-S,Pe=d-R;return p?i(Pe,z-M):Pe}function Se(_){var R=_-y,M=_-S;return y===void 0||R>=d||R<0||p&&M>=z}function $(){var _=t();if(Se(_))return Ee(_);g=setTimeout($,D(_))}function Ee(_){return g=void 0,w&&m?v(_):(m=h=void 0,P)}function xt(){g!==void 0&&clearTimeout(g),S=0,m=y=h=g=void 0}function Nt(){return g===void 0?P:Ee(t())}function Y(){var _=t(),R=Se(_);if(m=arguments,h=this,y=_,R){if(g===void 0)return T(y);if(p)return clearTimeout(g),g=setTimeout($,d),v(y)}return g===void 0&&(g=setTimeout($,d)),P}return Y.cancel=xt,Y.flush=Nt,Y}return le=c,le}var Qt=ot();const Kt=rt(Qt);var de,He;function Jt(){if(He)return de;He=1;var e=ot(),t=be(),n="Expected a function";function s(a,i,c){var l=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(c)&&(l="leading"in c?!!c.leading:l,d="trailing"in c?!!c.trailing:d),e(a,i,{leading:l,maxWait:i,trailing:d})}return de=s,de}var Wt=Jt();const Yt=rt(Wt),Vt=(e,t,n,s)=>{switch(t){case"debounce":return Kt(e,n,s);case"throttle":return Yt(e,n,s);default:return e}},Zt=e=>{const t=q.useRef(e);return q.useEffect(()=>{t.current=e}),q.useMemo(()=>(...n)=>{var s;return(s=t.current)===null||s===void 0?void 0:s.call(t,...n)},[])},Xt=e=>{const[t,n]=q.useState((e==null?void 0:e.current)||null);return e&&setTimeout(()=>{e.current!==t&&n(e.current)},0),{refProxy:q.useMemo(()=>new Proxy(a=>{a!==t&&n(a)},{get(a,i){return i==="current"?t:a[i]},set(a,i,c){return i==="current"?n(c):a[i]=c,!0}}),[t]),refElement:t,setRefElement:n}},en=(e,t)=>t==="border-box"?{width:e.borderBoxSize[0].inlineSize,height:e.borderBoxSize[0].blockSize}:t==="content-box"?{width:e.contentBoxSize[0].inlineSize,height:e.contentBoxSize[0].blockSize}:{width:e.contentRect.width,height:e.contentRect.height};function tn({skipOnMount:e=!1,refreshMode:t,refreshRate:n=1e3,refreshOptions:s,handleWidth:a=!0,handleHeight:i=!0,targetRef:c,observerOptions:l,onResize:d}={}){const u=b.useRef(e),m=Zt(d),[h,z]=b.useState({width:void 0,height:void 0}),{refProxy:P,refElement:g}=Xt(c),{box:y}=l||{},S=b.useCallback(p=>{if(!a&&!i)return;if(u.current){u.current=!1;return}const w=(v,T)=>a&&v.width!==T.width||i&&v.height!==T.height;p.forEach(v=>{const T=en(v,y);z(D=>w(D,T)?(m==null||m({width:T.width,height:T.height,entry:v}),T):D)})},[a,i,u,y]),E=b.useCallback(Vt(S,t,n,s),[S,t,n,s]);return b.useEffect(()=>{let p;return g?(p=new window.ResizeObserver(E),p.observe(g,l)):(h.width||h.height)&&(m==null||m({width:null,height:null,entry:null}),z({width:void 0,height:void 0})),()=>{var w,v,T;(w=p==null?void 0:p.disconnect)===null||w===void 0||w.call(p),(T=(v=E).cancel)===null||T===void 0||T.call(v)}},[E,g]),Object.assign({ref:P},h)}function it(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=it(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function A(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=it(e))&&(s&&(s+=" "),s+=t);return s}const nn="_headerContainer_1cubo_1",rn="_navigationTabList_1cubo_8",sn="_navigationTab_1cubo_8",an="_headerContent_1cubo_34",on="_staticEnabled_1cubo_50",L={headerContainer:nn,navigationTabList:rn,navigationTab:sn,headerContent:an,staticEnabled:on},cn=77,U=({sticky:e,children:t})=>{const{ref:n,height:s}=tn({refreshMode:"debounce",refreshRate:0}),[a,i]=b.useState(!1),c=()=>a?!e:!0;b.useEffect(()=>{const d=()=>{i(window.scrollY>0)};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]);const l=`${s||cn}px`;return o.jsx("div",{style:{minHeight:l},children:o.jsx("div",{children:o.jsxs("div",{ref:n,className:A(L.headerContent,{[L.staticEnabled]:c()}),children:[o.jsx(U.Header,{}),o.jsx(U.Tabs,{}),t]})})})};U.Header=({children:e})=>o.jsx("div",{className:L.headerContainer,children:e});U.Tabs=({children:e})=>o.jsx("div",{className:"flex justify-between gap-2 nowrap",children:e});const un="_sidebarContainer_bmdti_1",ln={sidebarContainer:un},dn="_logoLink_1baxb_1",mn={logoLink:dn},fn=({src:e,href:t="/",ariaLabel:n="Home",alt:s="Lokalise"})=>o.jsx("a",{className:mn.logoLink,href:t,"aria-label":n,children:o.jsx("img",{src:e,alt:s})}),_n="_link_18vhx_1",bn="_active_18vhx_18",De={link:_n,active:bn},gn=({label:e,to:t,icon:n})=>o.jsx(f.Tooltip,{placement:"right",tooltip:e,children:o.jsx(f.Link,{className:A(De.link,{[De.active]:window.location.pathname.startsWith(t)}),href:t,children:o.jsx(n,{size:"25px"})})}),hn="_dropdownButton_13l5r_1",pn="_dropdownButtonActive_13l5r_18",$e={dropdownButton:hn,dropdownButtonActive:pn},Tn=({children:e,icon:t})=>o.jsx(f.Menu,{menuButton:({opened:n})=>o.jsx(f.Tooltip,{placement:"right",tooltip:"Help",children:o.jsx("button",{type:"button",className:A($e.dropdownButton,{[$e.dropdownButtonActive]:n}),children:o.jsx(t,{size:"25px"})})}),children:o.jsx(f.MenuList,{placement:"right-start",children:e})}),vn="_iconContainer_nz34m_1",yn={iconContainer:vn},ct=({className:e=""})=>o.jsx("div",{"aria-label":"Upgrade Icon",className:A(yn.iconContainer,"flex-row","items-center","justify-center",e),children:o.jsx(f.CaretUpIcon,{})}),jn="_menuContainer_wbu3u_5",zn="_profileButton_wbu3u_16",Sn="_profileImage_wbu3u_29",En="_profileImageHighlight_wbu3u_37",Pn="_profileImageUpgradeIcon_wbu3u_41",wn="_userIconWrapper_wbu3u_47",x={menuContainer:jn,profileButton:zn,profileImage:Sn,profileImageHighlight:En,profileImageUpgradeIcon:Pn,userIconWrapper:wn},ut=b.createContext({}),G=()=>b.useContext(ut),In=({children:e})=>{const{currentTeam:t,otherTeams:n,showUpgradeCta:s,showBillingButton:a,allowTeamCreation:i,isProviderAlpha:c,canAccessTeamSettings:l,isEndOfTrialActive:d,isTeamSuspended:u,isFullyAuthenticated:m}=G();return o.jsx(f.Menu,{menuButton:()=>o.jsxs("button",{className:x.profileButton,"aria-label":"Profile menu",type:"button",children:[t!=null&&t.logoUrl?o.jsx("img",{src:t.logoUrl,className:A(x.profileImage,{[x.profileImageHighlight]:s}),alt:"Team Logo"}):o.jsx("div",{className:A(x.userIconWrapper,"flex-row","align-center","items-center",{[x.profileImageHighlight]:s}),children:o.jsx(f.UserIcon,{size:"25px"})}),s&&o.jsx(ct,{className:x.profileImageUpgradeIcon})]}),children:o.jsx(f.MenuList,{placement:"right-end",className:x.menuContainer,children:e({allowTeamCreation:i,otherTeams:n,canAccessTeamSettings:l,isEndOfTrialActive:d,isTeamSuspended:u,showBillingButton:a,isProviderAlpha:c,isFullyAuthenticated:m})})})},ge=0,lt=9999,dt=[150,151,250,251],mt=[152,153,252,253],ft=[154,155,157,158,254,255,258,354,355,358],_t=[156,159,160,256,259,260],he=9998,J=e=>e===ge,pe=e=>e===lt,Rn=e=>dt.includes(e),xn=e=>mt.includes(e),Nn=e=>ft.includes(e),An=e=>_t.includes(e),Cn=e=>e>ge&&e<he,kn=e=>e===he,Ln=/\n/,Fe=(e,t,n)=>e.split(t).flatMap((s,a)=>a!==0?[b.cloneElement(n,{key:Math.random().toString(32).slice(0,10)}),s]:s),On=(e,t,n)=>typeof e=="string"?Fe(e,t,n):e.flatMap(s=>typeof s=="string"?Fe(s,t,n):s),Mn=e=>On(e,Ln,o.jsx("br",{})),qn=/(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi,Un=e=>e.match(qn)??[],Qe=(e,t,n)=>{const s=e.split(t);if(s.length===1)return e;const a=[];return s[0]!==""&&a.push(s[0]),s.shift(),s[s.length-1]===""&&s.pop(),a.push(o.jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:t},t+n)),a.push(s.join(t)),a.filter(i=>i!=="")},Ke=e=>{const t=Un(e);return t!=null&&t.length?t.reduce((n,s,a)=>typeof n=="string"?Qe(n,s,a):n.flatMap(i=>typeof i=="string"?Qe(i,s,a):i),e):e},Bn=e=>typeof e=="string"?Ke(e):e.flatMap(t=>typeof t=="string"?Ke(t):t,e),Gn=(e,t="PP")=>tt.format(e,t),Hn=(e,t,n="PP")=>tt.format(kt.toZonedTime(e,t),n),Dn=e=>{b.useEffect(e,[])},Je={biller:"biller",owner:"owner"},We=[Je.biller,Je.owner],$n=({children:e,config:t})=>{const{teams:n,currentTeamId:s,planId:a,isEndOfTrialActive:i,isFullyAuthenticated:c,userTeamRole:l}=t,d=n.find(E=>E.id===s),u=n.filter(E=>E.id!==s),m=We.includes(l),h=We.includes(l),z=J(a)||pe(a),S={...t,currentTeam:d,otherTeams:u,canChangeBilling:m,canAccessTeamSettings:h,isOnFreeOrTrialPlan:z,showUpgradeCta:c&&z&&m,showBillingButton:c&&h&&m,allowTeamCreation:c&&!i};return o.jsx(ut.Provider,{value:S,children:e})},Fn=({config:e,children:t})=>o.jsx($n,{config:e,children:o.jsx(In,{children:t})}),Qn="_container_q5pot_1",Kn="_profileEmail_q5pot_5",Ye={container:Qn,profileEmail:Kn},Jn=({href:e,onClick:t,userEmail:n,hideBottomDivider:s})=>{const{isEndOfTrialActive:a,isTeamSuspended:i}=G();return a||i?null:o.jsxs(o.Fragment,{children:[o.jsx(f.MenuItem,{href:e,onClick:()=>{t==null||t()},children:o.jsxs("div",{className:`flex-col ${Ye.container}`,children:[o.jsx("span",{children:"Profile Settings"}),o.jsx("span",{className:Ye.profileEmail,children:n})]})}),!s&&o.jsx(f.MenuDivider,{})]})},Wn="_wrapper_15d85_1",Yn="_profileImage_15d85_14",Vn="_teamName_15d85_22",Zn="_planLabel_15d85_29",Xn="_membership_15d85_38",er="_defaultProfileImage_15d85_44",k={wrapper:Wn,profileImage:Yn,teamName:Vn,planLabel:Zn,membership:Xn,defaultProfileImage:er},bt=({team:e,onClick:t,hidePlanLabel:n})=>{const{currentTeam:s,planId:a}=G(),i=e||s;if(!i)return null;const c=J(a)?"Free":pe(a)?"Trial":void 0,l=t?f.MenuItem:"div";return o.jsxs(l,{className:`flex-row gap-2 flex-nowrap items-center ${k.wrapper}`,...t&&{onClick:()=>t(i)},children:[i.logoUrl?o.jsx("img",{className:k.profileImage,src:i.logoUrl,alt:"Team Logo"}):o.jsx("span",{className:`flex-row justify-center items-center ${k.defaultProfileImage}`,children:o.jsx(f.UserIcon,{size:"25px"})}),o.jsxs("div",{className:"flex-col items-start",children:[o.jsxs("div",{className:"flex-row items-center flex-nowrap gap-2",children:[o.jsx("span",{title:i.name,className:k.teamName,children:i.name}),c&&!n&&o.jsx("span",{className:`flex-row justify-center items-center ${k.planLabel}`,children:c})]}),o.jsx("span",{className:k.membership,children:i.role})]})]})},tr="_teamsContainer_1t68g_1",nr={teamsContainer:tr},rr=({onSwitchTeam:e})=>{const{otherTeams:t}=G();return t.length===0?null:o.jsx("div",{className:`flex-col items-stretch ${nr.teamsContainer}`,children:t.map(n=>o.jsx(bt,{team:n,onClick:e,hidePlanLabel:!0},n.id))})},sr="_container_1u995_1",ar="_planCta_1u995_15",or="_upgradeIconWrapper_1u995_19",me={container:sr,planCta:ar,upgradeIconWrapper:or},ir=({upgradeOptionHref:e})=>{const{planId:t,trialDaysLeft:n,showUpgradeCta:s}=G();if(!s)return null;const c=J(t)?"Your team is currently on the Free plan":`Free trial ends in ${n} ${n===1?"day":"days"}`;return o.jsxs(f.MenuItem,{href:e,className:`flex-col gap-1 items-start ${me.container}`,children:[o.jsx("span",{className:me.planCta,children:c}),o.jsxs("div",{className:`flex-row items-center gap-1 ${me.upgradeIconWrapper}`,children:[o.jsx(ct,{}),o.jsx("span",{children:"See upgrade options"})]})]})},j=({children:e,...t})=>o.jsx("nav",{...t,className:ln.sidebarContainer,children:e}),cr=({children:e})=>o.jsx("div",{children:e});j.Top=cr;const ur=({children:e})=>o.jsx("div",{children:e});j.Bottom=ur;j.Avatar=fn;j.IconLink=gn;j.Menu=Tn;j.ProfileMenu=Fn;j.TeamSwitch=rr;j.TeamMenuItem=bt;j.UpgradeMenuItem=ir;j.ProfileSettingsMenuItem=Jn;const lr="_breadcrumbsItem_1hm6a_1",dr="_breadcrumbs_1hm6a_1",Ve={breadcrumbsItem:lr,breadcrumbs:dr},mr=({items:e})=>o.jsx("nav",{"aria-label":"breadcrumb",className:Ve.breadcrumbs,children:e.map((t,n)=>o.jsxs(b.Fragment,{children:[o.jsx(f.Link,{className:Ve.breadcrumbsItem,href:t.link,rel:"noreferrer",children:t.name}),n<e.length-1&&o.jsx("span",{children:" — "})]},`${t.link}-${t.name}`))}),fr=({items:e})=>o.jsx(o.Fragment,{children:e.map((t,n)=>o.jsxs(b.Fragment,{children:[!!n&&t.some(s=>s.visible)&&o.jsx(f.MenuDivider,{}),t.filter(({visible:s})=>s).map(({link:s,label:a,onClick:i})=>o.jsx(f.MenuItem,{href:s||"#","aria-label":a,onClick:i,children:a},a))]},t[0].label))}),_r="_badge_1pc1v_1",br="_tag_1pc1v_15",gr="_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21",hr="_disabled_1pc1v_57",pr="_projectNavigationItem_1pc1v_61",Tr="_projectNavigationItemDisabled_1pc1v_67",N={badge:_r,tag:br,withNavLinkStyle:gr,disabled:hr,projectNavigationItem:pr,projectNavigationItemDisabled:Tr},Ze=({label:e,badge:t,novel:n})=>o.jsxs("div",{className:"flex gap-1",children:[o.jsxs("div",{children:[o.jsx("span",{children:e}),!!t&&o.jsx("div",{className:N.badge,"aria-label":`${t} items requiring attention`,children:t>9?"9+":t})]}),!!n&&o.jsx(f.Tag,{className:N.tag,children:n})]}),fe=b.forwardRef(({label:e,href:t="",disabled:n=!1,badge:s,onClick:a,novel:i},c)=>o.jsx(f.Tooltip,{tooltip:"You do not have access to this function",show:n,children:o.jsx("div",{className:n?N.projectNavigationItemDisabled:N.projectNavigationItem,children:a||n||!t?o.jsx("button",{type:"button",ref:c,className:A(N.withNavLinkStyle,{[N.disabled]:n}),disabled:n,onClick:a,children:o.jsx(Ze,{label:e,badge:s,novel:i})}):o.jsx("a",{href:t,className:N.withNavLinkStyle,children:o.jsx(Ze,{label:e,badge:s,novel:i})})})}));fe.displayName="NavigationTabsItem";const vr=e=>(e==null?void 0:e.some(t=>t.some(n=>n.visible)))??!1,yr=e=>e.visible&&(!e.dropdown||vr(e.dropdown)),jr=({navigation:e,activeItem:t})=>o.jsx("nav",{"aria-label":"Project",children:o.jsx("ul",{className:L.navigationTabList,"aria-orientation":"horizontal",children:e.filter(yr).map(n=>{var s,a,i;return n.dropdown?o.jsx("li",{className:L.navigationTab,"data-testid":n.key,"aria-selected":(s=n.isActive)==null?void 0:s.call(n,t),children:o.jsx(f.Menu,{menuButton:({opened:c})=>o.jsx(fe,{label:n.label,disabled:n.disabled,active:c}),children:o.jsx(f.MenuList,{children:o.jsx(fr,{items:n.dropdown})})})},n.key):o.jsx("li",{className:L.navigationTab,"data-testid":n.key,"aria-selected":(a=n.isActive)==null?void 0:a.call(n,t),children:o.jsx(fe,{label:n.label,href:n.link,onClick:n.onClick,disabled:n.disabled,badge:n.badge,novel:n.novel,active:(i=n.isActive)==null?void 0:i.call(n,t)})},n.key)})})}),zr=r.z.object({accessToken:r.z.string(),refreshToken:r.z.string()}),Sr=r.z.union([r.z.object({Authorization:r.z.string().startsWith("Bearer ")}),r.z.object({"x-csrf-token":r.z.string()})]),W=nt.buildPayloadRoute({description:"Takes a teamId and returns a JWT token access and refresh token for the user",method:"post",requestPathParamsSchema:r.z.object({teamId:r.z.number()}),pathResolver:e=>`/team/${e.teamId}/actions/get-user-token`,requestHeaderSchema:Sr,requestBodySchema:r.z.undefined(),successResponseBodySchema:zr}),gt={teamKeyCsrf:(e,t)=>["getUserToken","x-csrf-token",t,e],teamKeyJwt:(e,t)=>["getUserToken","Authorization",`Bearer ${t}`,e]},ht=(e,t)=>C.useQuery({...t,queryFn:({queryKey:[n,s,a,i]})=>I.sendByPayloadRoute(e,W,{pathParams:{teamId:i},headers:s==="x-csrf-token"?{"x-csrf-token":a}:{Authorization:a}})}),pt=r.z.union([r.z.literal("owner"),r.z.literal("admin"),r.z.literal("biller"),r.z.literal("member")]),Er=r.z.object({userId:r.z.number(),userUuid:r.z.string(),teamId:r.z.number(),userTeamRole:pt,userEmail:r.z.string().email(),userName:r.z.string(),userCurrentTeamId:r.z.number(),planId:r.z.number(),planName:r.z.string(),isProviderAlpha:r.z.boolean(),isFullyAuthenticated:r.z.boolean(),exp:r.z.number()});function H(e){try{const t=e.split(".")[1],n=atob(t);return Er.parse(JSON.parse(n))}catch{return}}const K=class K extends CustomEvent{constructor(t){super(K.eventName,{detail:{token:t,payload:H(t.accessToken)}})}};we(K,"eventName","new-jwt-issued");let O=K;function Te(){const e=_e(document.cookie,"accessToken"),t=_e(document.cookie,"refreshToken");if(!(!e||!t))return{accessToken:e,refreshToken:t}}function Tt(){return _e(document.cookie,"csrf_token")}function _e(e,t){var n,s;return(s=(n=e.split(";").find(a=>a.trim().startsWith(`${t}=`)))==null?void 0:n.trim())==null?void 0:s.substring(t.length+1)}function Pr(e,t){const n=Tt(),s=ht(e,{queryKey:gt.teamKeyCsrf(t,n??""),enabled:n!==void 0}),a=b.useRef();return b.useEffect(()=>{s.data&&s.data.accessToken!==a.current&&(window.dispatchEvent(new O(s.data)),a.current=s.data.accessToken)},[s.data]),s}function ve(){const[e,t]=b.useState();return b.useEffect(()=>{const n=a=>{t(a.detail.payload)},s=Te();return t(s&&H(s.accessToken)),window.addEventListener(O.eventName,n),()=>{window.removeEventListener(O.eventName,n)}},[]),e}const wr=r.z.object({user_id:r.z.number(),email:r.z.string().email(),fullname:r.z.string(),created_at:r.z.string(),created_at_timestamp:r.z.number(),role:pt}),Ir=r.z.object({team_id:r.z.number(),team_user:wr}),vt=B.buildGetRoute({description:"Get the details of a team user",requestPathParamsSchema:r.z.object({teamId:r.z.number(),userId:r.z.number()}),pathResolver:({teamId:e,userId:t})=>`/teams/${e}/users/${t}`,successResponseBodySchema:Ir}),yt={teamUserKey:(e,t)=>["GetTeamUsers",e,t]},jt=(e,t)=>C.useQuery({...t,queryFn:({queryKey:[n,s,a]})=>I.sendByGetRoute(e,vt,{pathParams:{teamId:s,userId:a}})});function Rr(e){const t=ve();return jt(e,{queryKey:yt.teamUserKey((t==null?void 0:t.teamId)??0,(t==null?void 0:t.userId)??0),enabled:(t==null?void 0:t.userId)!==void 0&&t.teamId!==void 0})}const xr=r.z.object({lang_id:r.z.number(),lang_iso:r.z.string(),lang_name:r.z.string(),is_writable:r.z.union([r.z.literal(0),r.z.literal(1)])}),Nr=r.z.object({user_id:r.z.number(),email:r.z.string().email(),fullname:r.z.string(),created_at:r.z.string(),created_at_timestamp:r.z.number(),admin_rights:r.z.array(r.z.string()),languages:r.z.array(xr),is_admin:r.z.boolean(),is_reviewer:r.z.boolean()}),Ar=r.z.object({project_id:r.z.string(),contributors:r.z.array(Nr)}),zt=B.buildGetRoute({description:"Get the details of a project contributor",requestPathParamsSchema:r.z.object({projectId:r.z.string(),contributorId:r.z.number()}),pathResolver:({projectId:e,contributorId:t})=>`/projects/${e}/contributors/${t}`,successResponseBodySchema:Ar}),St={projectUserKey:(e,t)=>["RetrieveContributor",e,t]},Et=(e,t)=>C.useQuery({...t,queryFn:({queryKey:[n,s,a]})=>I.sendByGetRoute(e,zt,{pathParams:{projectId:s,contributorId:a}})});function Cr(e,t){const n=ve();return Et(e,{queryKey:St.projectUserKey(t,(n==null?void 0:n.userId)??0),enabled:n!==void 0})}function kr(){const e=Te();if(!e)return;const t=H(e.accessToken);if(t)return{...e,payload:t}}function Lr(){return e=>(t,n)=>e(t,{...n,headers:{...n.headers,"x-lokalise-plugin":"true"},credentials:"omit"})}function Q(e){return{Authorization:`Bearer ${e}`}}function Or(e,t){return n=>async(s,a)=>{var l;const i=await t.getCachedJwtToken();if(i===void 0)return n(s,a);const c=await n(s,{...a,headers:{...a.headers,...Q(i.accessToken)}});if(i&&(c.status===401||c.status===403)){const d=H(i.accessToken);if(!d)return c;const u=await I.sendByPayloadRoute(e,W,{pathParams:{teamId:d.teamId},headers:Q(i.refreshToken)});return await((l=t.onNewJwtTokenIssued)==null?void 0:l.call(t,u)),n(s,{...a,headers:{...a.headers,...Q(u.accessToken)}})}return c}}const Pt={wretch:{lokaliseAuth(e){return this.middlewares([Or(this,e)])}}};function Mr(e,t){return n=>async(s,a)=>{var d;if(await t.getCachedJwtToken()!==void 0)return n(s,a);const c=await t.getCsrfToken();if(c===void 0)return n(s,a);const l=await I.sendByPayloadRoute(e,W,{pathParams:{teamId:await t.getTeamId()},headers:{"x-csrf-token":c}});return await((d=t.onNewJwtTokenIssued)==null?void 0:d.call(t,l)),n(s,{...a,headers:{...a.headers,...Q(l.accessToken)}})}}const qr={wretch:{lokaliseAuth(e={}){return this.addon(Pt).lokaliseAuth(Xe(e))},promoteClassicSession(e){const t=Xe(e);return this.middlewares([Mr(this,t)])}}};function Xe(e){return{...e,getCachedJwtToken:e.getCachedJwtToken??(async()=>Te()),getCsrfToken:"getCsrfToken"in e?e.getCsrfToken:async()=>Tt(),onNewJwtTokenIssued:t=>{var n;return window.dispatchEvent(new O(t)),((n=e.onNewJwtTokenIssued)==null?void 0:n.call(e,t))??Promise.resolve()}}}const Ur=r.z.object({lang_iso:r.z.string(),custom_iso:r.z.string().optional()}),Br=r.z.object({language_id:r.z.number(),language_iso:r.z.string(),progress:r.z.number(),words_to_do:r.z.number()}),Gr=r.z.object({projectId:r.z.string()}),Hr=r.z.object({lang_id:r.z.number(),lang_iso:r.z.string(),lang_name:r.z.string(),is_rtl:r.z.boolean(),plural_forms:r.z.array(r.z.string().optional())}),Dr=r.z.object({project_id:r.z.string(),project_uuid:r.z.string().uuid(),languages:r.z.array(Hr)}),ye=r.z.union([r.z.literal("localization_files"),r.z.literal("paged_documents"),r.z.literal("marketing")]),$r=r.z.object({per_platform_key_names:r.z.boolean(),reviewing:r.z.boolean(),auto_toggle_unverified:r.z.boolean(),offline_translation:r.z.boolean(),key_editing:r.z.boolean(),inline_machine_translations:r.z.boolean(),custom_translation_statuses:r.z.boolean(),custom_translation_statuses_allow_multiple:r.z.boolean(),segmentation:r.z.boolean(),contributor_preview_download_enabled:r.z.boolean()}),Fr=r.z.object({not_reviewed:r.z.number(),unverified:r.z.number(),spelling_grammar:r.z.number(),inconsistent_placeholders:r.z.number(),inconsistent_html:r.z.number(),different_number_of_urls:r.z.number(),different_urls:r.z.number(),leading_whitespace:r.z.number(),trailing_whitespace:r.z.number(),different_number_of_email_address:r.z.number(),different_email_address:r.z.number(),different_brackets:r.z.number(),different_numbers:r.z.number(),double_space:r.z.number(),special_placeholder:r.z.number(),unbalanced_brackets:r.z.number()}),Qr=r.z.object({progress_total:r.z.number(),keys_total:r.z.number(),team:r.z.number(),base_words:r.z.number(),qa_issues_total:r.z.number(),qa_issues:Fr,languages:r.z.array(Br)}),je=r.z.object({project_id:r.z.string(),uuid:r.z.string().uuid(),project_type:ye,name:r.z.string(),description:r.z.string(),created_at:r.z.string(),created_at_timestamp:r.z.number(),created_by:r.z.number(),created_by_email:r.z.string(),team_id:r.z.number(),base_language_id:r.z.number(),base_language_iso:r.z.string(),settings:$r.optional(),statistics:Qr.optional()}),Kr=r.z.object({name:r.z.string(),team_id:r.z.string(),base_lang_iso:r.z.string(),languages:r.z.array(Ur),project_type:ye,is_segmentation_enabled:r.z.boolean()}),et=r.z.union([r.z.literal(0),r.z.literal(1)]),Jr=r.z.object({filter_type:ye.optional(),filter_team_id:r.z.number().optional(),filter_names:r.z.string().optional(),include_statistics:et.optional(),include_settings:et.optional(),limit:r.z.number().optional(),page:r.z.number().optional()}),Wr=r.z.object({projects:r.z.array(je)}),Yr=r.z.object({project_id:r.z.string()}),ze=()=>"/projects",wt=nt.buildPayloadRoute({description:"Create a new project",method:"post",pathResolver:ze,requestBodySchema:Kr,successResponseBodySchema:je}),It=B.buildGetRoute({description:"List all projects",pathResolver:ze,requestQuerySchema:Jr,successResponseBodySchema:Wr}),Rt=B.buildGetRoute({description:"Retrieve a project",pathResolver:ze,requestQuerySchema:Yr,successResponseBodySchema:je});function Vr(e,t={}){return C.useMutation({...t,mutationFn:n=>I.sendByPayloadRoute(e,wt,{body:n})})}const Zr=B.buildGetRoute({description:"List of project languages",requestPathParamsSchema:Gr,pathResolver:({projectId:e})=>`/projects/${e}/languages`,successResponseBodySchema:Dr}),Xr={projectIdKey:e=>["listProjectLanguages",e]};function es(e,t){return C.useQuery({...t,queryFn:({queryKey:[n,s]})=>I.sendByGetRoute(e,Zr,{pathParams:{projectId:s}})})}const ts={paramsKey:e=>["listProjects",e]};function ns(e,t){return C.useQuery({...t,queryFn:({queryKey:[n,s]})=>I.sendByGetRoute(e,It,{queryParams:s})})}const rs={projectIdKey:e=>["retrieveProject",e]};function ss(e,t){return C.useQuery({...t,queryFn:({queryKey:[n,s]})=>I.sendByGetRoute(e,Rt,{queryParams:{project_id:s}})})}exports.Breadcrumbs=mr;exports.ENTERPRISE_OPENSOURCE_PLAN_ID=he;exports.ENTERPRISE_PLAN_IDS=_t;exports.ESSENTIAL_PLAN_IDS=mt;exports.FREE_PLAN_ID=ge;exports.LokaliseAuthAddon=Pt;exports.LokaliseAuthBrowserAddon=qr;exports.NavigationPanel=U;exports.NavigationTabs=jr;exports.PRO_PLAN_IDS=ft;exports.START_PLAN_IDS=dt;exports.Sidebar=j;exports.TRIAL_PLAN_ID=lt;exports.convertNewLineToBreakTag=Mn;exports.createProject=wt;exports.formatDate=Gn;exports.formatDateTz=Hn;exports.getAuthenticatedSessionDetailFromRequest=kr;exports.getTeamUser=vt;exports.getTeamUsersQueryKey=yt;exports.getUserToken=W;exports.getUserTokenKey=gt;exports.isEnterpriseOpenSourcePlan=kn;exports.isEnterprisePlan=An;exports.isEssentialPlan=xn;exports.isFreePlan=J;exports.isPaidPlan=Cn;exports.isProPlan=Nn;exports.isStartPlan=Rn;exports.isTrialPlan=pe;exports.listProjectLanguagesKey=Xr;exports.listProjects=It;exports.listProjectsKey=ts;exports.makeUrlClickable=Bn;exports.parseJwtTokenPayload=H;exports.publicApiHeadersMiddleware=Lr;exports.retrieveContributor=zt;exports.retrieveContributorKeys=St;exports.retrieveProject=Rt;exports.retrieveProjectQueryKey=rs;exports.useAuthenticatedProjectContributor=Cr;exports.useAuthenticatedSessionPayload=ve;exports.useAuthenticatedUser=Rr;exports.useCreateProjectMutation=Vr;exports.useEffectOnce=Dn;exports.useGetPromotedClassicSessionJwtQuery=Pr;exports.useGetTeamUsersQuery=jt;exports.useGetUserTokenQuery=ht;exports.useListProjectLanguagesQuery=es;exports.useListProjectsQuery=ns;exports.useRetrieveContributorQuery=Et;exports.useRetrieveProjectQuery=ss;
|
package/dist/harmony.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
._headerContainer_1cubo_1{display:flex;margin-bottom:var(--lok-spacing-1);width:100%;align-items:center}._navigationTabList_1cubo_8{display:flex;list-style:none;flex-wrap:wrap;margin:0 0 0 calc(-1 * var(--lok-spacing-6));padding:0}._navigationTab_1cubo_8{border:none;margin:0;border-bottom:2px solid transparent;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font:var(--lok-typography-body-small-default);color:var(--lok-color-text-default);margin:0 0 0 var(--lok-spacing-6)}._navigationTab_1cubo_8[aria-selected=true]{font-weight:500;color:var(--lok-color-text-active);border-bottom-color:var(--lok-color-text-active)}._headerContent_1cubo_34{position:fixed;background-color:var(--lok-color-background-surface-default);top:0;left:95px;right:32px;z-index:899;padding-top:var(--lok-spacing-5);padding-left:30px;padding-right:30px;margin-left:-30px;margin-right:-30px;border-bottom:1px solid var(--lok-color-border-default)}._staticEnabled_1cubo_50{z-index:var(--lok-z-index-auto);position:relative;top:inherit;left:0;right:0;padding-top:0;box-shadow:none}._sidebarContainer_bmdti_1{border-right:1px solid var(--lok-color-border-default);position:fixed;width:65px;top:0;left:0;bottom:0;background-color:var(--lok-color-background-surface-middle);display:flex;justify-content:space-between;flex-direction:column;padding-bottom:var(--lok-spacing-3);z-index:1}._logoLink_bmdti_16{display:flex;align-items:center;justify-content:center;height:67px;position:relative}._logoLink_bmdti_16:hover{background-color:var(--lok-color-background-surface-middle)}._logoLink_bmdti_16>img{width:36px}._logoLink_1baxb_1{display:flex;align-items:center;justify-content:center;height:67px;position:relative}._logoLink_1baxb_1:hover{background-color:var(--lok-color-background-surface-middle)}._logoLink_1baxb_1>img{width:36px}.
|
1
|
+
._headerContainer_1cubo_1{display:flex;margin-bottom:var(--lok-spacing-1);width:100%;align-items:center}._navigationTabList_1cubo_8{display:flex;list-style:none;flex-wrap:wrap;margin:0 0 0 calc(-1 * var(--lok-spacing-6));padding:0}._navigationTab_1cubo_8{border:none;margin:0;border-bottom:2px solid transparent;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font:var(--lok-typography-body-small-default);color:var(--lok-color-text-default);margin:0 0 0 var(--lok-spacing-6)}._navigationTab_1cubo_8[aria-selected=true]{font-weight:500;color:var(--lok-color-text-active);border-bottom-color:var(--lok-color-text-active)}._headerContent_1cubo_34{position:fixed;background-color:var(--lok-color-background-surface-default);top:0;left:95px;right:32px;z-index:899;padding-top:var(--lok-spacing-5);padding-left:30px;padding-right:30px;margin-left:-30px;margin-right:-30px;border-bottom:1px solid var(--lok-color-border-default)}._staticEnabled_1cubo_50{z-index:var(--lok-z-index-auto);position:relative;top:inherit;left:0;right:0;padding-top:0;box-shadow:none}._sidebarContainer_bmdti_1{border-right:1px solid var(--lok-color-border-default);position:fixed;width:65px;top:0;left:0;bottom:0;background-color:var(--lok-color-background-surface-middle);display:flex;justify-content:space-between;flex-direction:column;padding-bottom:var(--lok-spacing-3);z-index:1}._logoLink_bmdti_16{display:flex;align-items:center;justify-content:center;height:67px;position:relative}._logoLink_bmdti_16:hover{background-color:var(--lok-color-background-surface-middle)}._logoLink_bmdti_16>img{width:36px}._logoLink_1baxb_1{display:flex;align-items:center;justify-content:center;height:67px;position:relative}._logoLink_1baxb_1:hover{background-color:var(--lok-color-background-surface-middle)}._logoLink_1baxb_1>img{width:36px}._link_18vhx_1._link_18vhx_1{display:flex;justify-content:center;align-items:center;height:65px;width:64px;background:transparent;border:none;outline:none;color:var(--lok-color-text-light-default)}._link_18vhx_1._link_18vhx_1:hover,._active_18vhx_18._active_18vhx_18{color:var(--lok-color-background-action-primary-default);background-color:var(--lok-color-background-surface-fore)}._dropdownButton_13l5r_1{display:flex;justify-content:center;align-items:center;height:65px;width:64px;background:transparent;border:none;outline:none;color:var(--lok-color-text-light-default)}._dropdownButton_13l5r_1:hover,._dropdownButtonActive_13l5r_18{color:var(--lok-color-background-action-primary-default);background-color:var(--lok-color-background-surface-fore)}._iconContainer_nz34m_1{color:var(--lok-color-background-surface-default);background-color:var(--lok-color-background-action-danger-default);border-radius:100%;font-size:10px;height:16px;width:16px}._popoverContent_wbu3u_1{width:300px}._menuContainer_wbu3u_5{margin:var(--lok-spacing-1);width:300px;font-size:var(--lok-font-size-small)}._menuContainer_wbu3u_5 button,._menuContainer_wbu3u_5 a{font-size:var(--lok-font-size-small);padding:var(--lok-spacing-3) var(--lok-spacing-4)}._profileButton_wbu3u_16{cursor:pointer;position:relative;border:none;background:transparent;height:65px;width:65px}._profileButton_wbu3u_16:hover{background:none}._profileImage_wbu3u_29{width:40px;height:40px;border-radius:100%;background-color:var(--lok-color-background-surface-default);object-fit:contain}._profileImageHighlight_wbu3u_37{border:3px solid var(--lok-color-background-action-danger-default)}._profileImageUpgradeIcon_wbu3u_41{position:absolute;bottom:10px;right:10px}._userIconWrapper_wbu3u_47{width:45px;height:45px;display:flex;align-items:center;border-radius:var(--lok-radius-rounded);justify-content:center;margin:auto}._container_q5pot_1{max-width:100%}._profileEmail_q5pot_5{color:var(--lok-color-text-light-default);font-size:var(--lok-font-size-tiny);max-width:100%;overflow:hidden;text-overflow:ellipsis}._wrapper_15d85_1{padding:var(--lok-spacing-3) var(--lok-spacing-4)}._buttonWrapper_15d85_5{background:transparent;outline:none;border:none}._buttonWrapper_15d85_5:hover{background:var(--lok-color-background-active)}._profileImage_15d85_14{width:40px;height:40px;border-radius:100%;background-color:var(--lok-color-background-surface-default);object-fit:contain}._teamName_15d85_22{font:var(--lok-typography-body-base-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._planLabel_15d85_29{font:var(--lok-typography-body-tiny-default);height:20px;border-radius:var(--lok-radius-rounded);padding:2px var(--lok-spacing-2);background-color:var(--lok-color-background-danger);white-space:nowrap}._membership_15d85_38{font:var(--lok-typography-body-action-base);text-transform:capitalize;color:var(--lok-color-text-light-default)}._defaultProfileImage_15d85_44{width:40px;height:40px}._teamsContainer_1t68g_1{width:100%;max-height:350px;overflow-y:auto}._profileImage_1t68g_10{width:40px;height:40px;border-radius:100%;background-color:var(--lok-color-background-surface-default);object-fit:contain}._container_1u995_1{max-width:100%;min-width:0;padding:var(--lok-spacing-3) var(--lok-spacing-4);background:var(--lok-color-background-surface-middle);border:0}._container_1u995_1:hover ._upgrade-icon_1u995_9{color:var(--lok-color-text-inverse)}._planCta_1u995_15{font:var(--lok-typography-body-small-default)}._upgradeIconWrapper_1u995_19{color:var(--lok-color-text-danger);font:var(--lok-typography-body-small-strong);height:16px}._breadcrumbsItem_1hm6a_1{color:var(--lok-color-text-light-default);text-decoration:none}._breadcrumbs_1hm6a_1{font:var(--lok-typography-body-small-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:var(--lok-spacing-1);max-width:90%}._breadcrumbs_1hm6a_1>*{white-space:nowrap}._badge_1pc1v_1{position:absolute;top:5px;right:-13px;background-color:var(--lok-color-background-action-danger-default);font-size:8px;color:var(--lok-color-text-inverse);border-radius:var(--lok-radius-rounded);width:12px;height:12px;line-height:12px;text-align:center}._tag_1pc1v_15{background-color:var(--lok-color-background-active);border:none;color:var(--lok-color-background-action-primary-pressed)}._withLinkStyle_1pc1v_21{cursor:pointer;font-size:inherit;font-weight:inherit;line-height:inherit;color:var(--lok-color-background-action-primary-default);background-color:transparent;padding:0;border:none}._withLinkStyle_1pc1v_21:hover,._withLinkStyle_1pc1v_21:focus{color:var(--lok-color-background-action-primary-hover)}._withLinkStyle_1pc1v_21:active,._withLinkStyle_1pc1v_21:active:hover{color:var(--lok-color-background-action-primary-pressed)}._withNavLinkStyle_1pc1v_42{color:inherit;display:block;position:relative;padding-top:var(--lok-spacing-2);padding-bottom:14px;background-color:transparent;text-decoration:none}._withNavLinkStyle_1pc1v_42[disabled]{pointer-events:none}._withNavLinkStyle_1pc1v_42._disabled_1pc1v_57{color:var(--lok-color-text-disabled)}._projectNavigationItem_1pc1v_61{display:flex;align-items:center;justify-content:space-between}._projectNavigationItemDisabled_1pc1v_67{opacity:.6;pointer-events:none}
|
package/dist/harmony.mjs
CHANGED
@@ -2,11 +2,11 @@ var Ct = Object.defineProperty;
|
|
2
2
|
var Nt = (e, t, n) => t in e ? Ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
3
|
var Ne = (e, t, n) => Nt(e, typeof t != "symbol" ? t + "" : t, n);
|
4
4
|
import { jsx as i, jsxs as p, Fragment as at } from "react/jsx-runtime";
|
5
|
-
import * as
|
5
|
+
import * as q from "react";
|
6
6
|
import { useRef as ot, useState as be, useCallback as Re, useEffect as U, useContext as Rt, createContext as kt, cloneElement as At, Fragment as it, forwardRef as Lt } from "react";
|
7
|
-
import { Tooltip as ge, Link as st, Menu as he, MenuList as pe, CaretUpIcon as Ot, UserIcon as ct, MenuItem as J, MenuDivider as lt, Tag as
|
7
|
+
import { Tooltip as ge, Link as st, Menu as he, MenuList as pe, CaretUpIcon as Ot, UserIcon as ct, MenuItem as J, MenuDivider as lt, Tag as Mt } from "@lokalise/louis";
|
8
8
|
import { format as ut } from "date-fns";
|
9
|
-
import { toZonedTime as
|
9
|
+
import { toZonedTime as qt } from "date-fns-tz";
|
10
10
|
import { z as r } from "zod";
|
11
11
|
import { sendByPayloadRoute as W, sendByGetRoute as x } from "@lokalise/frontend-http-client";
|
12
12
|
import { buildPayloadRoute as dt } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
@@ -49,10 +49,10 @@ function Bt() {
|
|
49
49
|
};
|
50
50
|
return ee = t, ee;
|
51
51
|
}
|
52
|
-
var te,
|
52
|
+
var te, Me;
|
53
53
|
function Ht() {
|
54
|
-
if (
|
55
|
-
|
54
|
+
if (Me) return te;
|
55
|
+
Me = 1;
|
56
56
|
var e = /\s/;
|
57
57
|
function t(n) {
|
58
58
|
for (var a = n.length; a-- && e.test(n.charAt(a)); )
|
@@ -61,10 +61,10 @@ function Ht() {
|
|
61
61
|
}
|
62
62
|
return te = t, te;
|
63
63
|
}
|
64
|
-
var ne,
|
64
|
+
var ne, qe;
|
65
65
|
function $t() {
|
66
|
-
if (
|
67
|
-
|
66
|
+
if (qe) return ne;
|
67
|
+
qe = 1;
|
68
68
|
var e = Ht(), t = /^\s+/;
|
69
69
|
function n(a) {
|
70
70
|
return a && a.slice(0, e(a) + 1).replace(t, "");
|
@@ -167,19 +167,19 @@ function bt() {
|
|
167
167
|
throw new TypeError(a);
|
168
168
|
d = n(d) || 0, e(l) && (w = !!l.leading, g = "maxWait" in l, y = g ? o(n(l.maxWait) || 0, d) : y, j = "trailing" in l ? !!l.trailing : j);
|
169
169
|
function v(f) {
|
170
|
-
var P = m,
|
171
|
-
return m = b = void 0, S = f, I = u.apply(
|
170
|
+
var P = m, M = b;
|
171
|
+
return m = b = void 0, S = f, I = u.apply(M, P), I;
|
172
172
|
}
|
173
173
|
function h(f) {
|
174
174
|
return S = f, _ = setTimeout(G, d), w ? v(f) : I;
|
175
175
|
}
|
176
176
|
function $(f) {
|
177
|
-
var P = f - T,
|
178
|
-
return g ? s(Ce, y -
|
177
|
+
var P = f - T, M = f - S, Ce = d - P;
|
178
|
+
return g ? s(Ce, y - M) : Ce;
|
179
179
|
}
|
180
180
|
function je(f) {
|
181
|
-
var P = f - T,
|
182
|
-
return T === void 0 || P >= d || P < 0 || g &&
|
181
|
+
var P = f - T, M = f - S;
|
182
|
+
return T === void 0 || P >= d || P < 0 || g && M >= y;
|
183
183
|
}
|
184
184
|
function G() {
|
185
185
|
var f = t();
|
@@ -242,10 +242,10 @@ const Zt = /* @__PURE__ */ mt(Vt), Xt = (e, t, n, a) => {
|
|
242
242
|
}, en = (
|
243
243
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
244
244
|
(e) => {
|
245
|
-
const t =
|
246
|
-
return
|
245
|
+
const t = q.useRef(e);
|
246
|
+
return q.useEffect(() => {
|
247
247
|
t.current = e;
|
248
|
-
}),
|
248
|
+
}), q.useMemo(() => (...n) => {
|
249
249
|
var a;
|
250
250
|
return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
|
251
251
|
}, []);
|
@@ -253,10 +253,10 @@ const Zt = /* @__PURE__ */ mt(Vt), Xt = (e, t, n, a) => {
|
|
253
253
|
), tn = (
|
254
254
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
255
255
|
(e) => {
|
256
|
-
const [t, n] =
|
256
|
+
const [t, n] = q.useState((e == null ? void 0 : e.current) || null);
|
257
257
|
return e && setTimeout(() => {
|
258
258
|
e.current !== t && n(e.current);
|
259
|
-
}, 0), { refProxy:
|
259
|
+
}, 0), { refProxy: q.useMemo(() => new Proxy((o) => {
|
260
260
|
o !== t && n(o);
|
261
261
|
}, {
|
262
262
|
get(o, s) {
|
@@ -367,7 +367,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
367
367
|
sidebarContainer: dn
|
368
368
|
}, fn = "_logoLink_1baxb_1", _n = {
|
369
369
|
logoLink: fn
|
370
|
-
}, bn = ({ src: e, href: t = "/", ariaLabel: n = "Home", alt: a = "Lokalise" }) => /* @__PURE__ */ i("a", { className: _n.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ i("img", { src: e, alt: a }) }), gn = "
|
370
|
+
}, bn = ({ src: e, href: t = "/", ariaLabel: n = "Home", alt: a = "Lokalise" }) => /* @__PURE__ */ i("a", { className: _n.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ i("img", { src: e, alt: a }) }), gn = "_link_18vhx_1", hn = "_active_18vhx_18", Ke = {
|
371
371
|
link: gn,
|
372
372
|
active: hn
|
373
373
|
}, pn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ i(ge, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
|
@@ -379,7 +379,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
379
379
|
href: t,
|
380
380
|
children: /* @__PURE__ */ i(n, { size: "25px" })
|
381
381
|
}
|
382
|
-
) }), vn = "
|
382
|
+
) }), vn = "_dropdownButton_13l5r_1", Tn = "_dropdownButtonActive_13l5r_18", Je = {
|
383
383
|
dropdownButton: vn,
|
384
384
|
dropdownButtonActive: Tn
|
385
385
|
}, yn = ({ children: e, icon: t }) => /* @__PURE__ */ i(
|
@@ -468,7 +468,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
468
468
|
}) })
|
469
469
|
}
|
470
470
|
);
|
471
|
-
}, vt = 0, kn = 9999, An = [150, 151, 250, 251], Ln = [152, 153, 252, 253], On = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358],
|
471
|
+
}, vt = 0, kn = 9999, An = [150, 151, 250, 251], Ln = [152, 153, 252, 253], On = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], Mn = [156, 159, 160, 256, 259, 260], Tt = 9998, Te = (e) => e === vt, yt = (e) => e === kn, la = (e) => An.includes(e), ua = (e) => Ln.includes(e), da = (e) => On.includes(e), ma = (e) => Mn.includes(e), fa = (e) => e > vt && e < Tt, _a = (e) => e === Tt, qn = /\n/, We = (e, t, n) => e.split(t).flatMap((a, o) => o !== 0 ? [At(n, { key: Math.random().toString(32).slice(0, 10) }), a] : a), Un = (e, t, n) => typeof e == "string" ? We(e, t, n) : e.flatMap((a) => typeof a == "string" ? We(a, t, n) : a), ba = (e) => Un(e, qn, /* @__PURE__ */ i("br", {})), xn = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, Bn = (e) => e.match(xn) ?? [], Qe = (e, t, n) => {
|
472
472
|
const a = e.split(t);
|
473
473
|
if (a.length === 1)
|
474
474
|
return e;
|
@@ -479,7 +479,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
479
479
|
}, Ye = (e) => {
|
480
480
|
const t = Bn(e);
|
481
481
|
return t != null && t.length ? t.reduce((n, a, o) => typeof n == "string" ? Qe(n, a, o) : n.flatMap((s) => typeof s == "string" ? Qe(s, a, o) : s), e) : e;
|
482
|
-
}, ga = (e) => typeof e == "string" ? Ye(e) : e.flatMap((t) => typeof t == "string" ? Ye(t) : t, e), ha = (e, t = "PP") => ut(e, t), pa = (e, t, n = "PP") => ut(
|
482
|
+
}, ga = (e) => typeof e == "string" ? Ye(e) : e.flatMap((t) => typeof t == "string" ? Ye(t) : t, e), ha = (e, t = "PP") => ut(e, t), pa = (e, t, n = "PP") => ut(qt(e, t), n), va = (e) => {
|
483
483
|
U(e, []);
|
484
484
|
}, Ve = {
|
485
485
|
biller: "biller",
|
@@ -609,7 +609,7 @@ const ir = "_breadcrumbsItem_1hm6a_1", sr = "_breadcrumbs_1hm6a_1", et = {
|
|
609
609
|
/* @__PURE__ */ i("span", { children: e }),
|
610
610
|
!!t && /* @__PURE__ */ i("div", { className: N.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
611
611
|
] }),
|
612
|
-
!!n && /* @__PURE__ */ i(
|
612
|
+
!!n && /* @__PURE__ */ i(Mt, { className: N.tag, children: n })
|
613
613
|
] }), fe = Lt(
|
614
614
|
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: s }, c) => /* @__PURE__ */ i(ge, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ i(
|
615
615
|
"div",
|
@@ -881,7 +881,7 @@ const Or = {
|
|
881
881
|
}
|
882
882
|
}
|
883
883
|
};
|
884
|
-
function
|
884
|
+
function Mr(e, t) {
|
885
885
|
return (n) => async (a, o) => {
|
886
886
|
var d;
|
887
887
|
if (await t.getCachedJwtToken() !== void 0)
|
@@ -906,7 +906,7 @@ const Pa = {
|
|
906
906
|
},
|
907
907
|
promoteClassicSession(e) {
|
908
908
|
const t = nt(e);
|
909
|
-
return this.middlewares([
|
909
|
+
return this.middlewares([Mr(this, t)]);
|
910
910
|
}
|
911
911
|
}
|
912
912
|
};
|
@@ -921,7 +921,7 @@ function nt(e) {
|
|
921
921
|
}
|
922
922
|
};
|
923
923
|
}
|
924
|
-
const
|
924
|
+
const qr = r.object({
|
925
925
|
lang_iso: r.string(),
|
926
926
|
custom_iso: r.string().optional()
|
927
927
|
}), Ur = r.object({
|
@@ -1000,11 +1000,11 @@ const Mr = r.object({
|
|
1000
1000
|
name: r.string(),
|
1001
1001
|
team_id: r.string(),
|
1002
1002
|
base_lang_iso: r.string(),
|
1003
|
-
languages: r.array(
|
1003
|
+
languages: r.array(qr),
|
1004
1004
|
project_type: we,
|
1005
1005
|
is_segmentation_enabled: r.boolean()
|
1006
1006
|
}), rt = r.union([r.literal(0), r.literal(1)]), zr = r.object({
|
1007
|
-
|
1007
|
+
filter_type: we.optional(),
|
1008
1008
|
filter_team_id: r.number().optional(),
|
1009
1009
|
filter_names: r.string().optional(),
|
1010
1010
|
include_statistics: rt.optional(),
|
@@ -1081,7 +1081,7 @@ function Oa(e, t) {
|
|
1081
1081
|
export {
|
1082
1082
|
Ta as Breadcrumbs,
|
1083
1083
|
Tt as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1084
|
-
|
1084
|
+
Mn as ENTERPRISE_PLAN_IDS,
|
1085
1085
|
Ln as ESSENTIAL_PLAN_IDS,
|
1086
1086
|
vt as FREE_PLAN_ID,
|
1087
1087
|
Or as LokaliseAuthAddon,
|
@@ -7,7 +7,7 @@ import { Wretch } from 'wretch';
|
|
7
7
|
export declare const listProjectsKey: {
|
8
8
|
paramsKey: (params: ListProjectsRequestQuery) => readonly ["listProjects", {
|
9
9
|
page?: number | undefined;
|
10
|
-
|
10
|
+
filter_type?: "localization_files" | "paged_documents" | "marketing" | undefined;
|
11
11
|
filter_team_id?: number | undefined;
|
12
12
|
filter_names?: string | undefined;
|
13
13
|
include_statistics?: 0 | 1 | undefined;
|
@@ -748,7 +748,7 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
|
|
748
748
|
} | undefined;
|
749
749
|
}[];
|
750
750
|
}>, undefined, import('zod').ZodObject<{
|
751
|
-
|
751
|
+
filter_type: import('zod').ZodOptional<import('zod').ZodUnion<[import('zod').ZodLiteral<"localization_files">, import('zod').ZodLiteral<"paged_documents">, import('zod').ZodLiteral<"marketing">]>>;
|
752
752
|
filter_team_id: import('zod').ZodOptional<import('zod').ZodNumber>;
|
753
753
|
filter_names: import('zod').ZodOptional<import('zod').ZodString>;
|
754
754
|
include_statistics: import('zod').ZodOptional<import('zod').ZodUnion<[import('zod').ZodLiteral<0>, import('zod').ZodLiteral<1>]>>;
|
@@ -757,7 +757,7 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
|
|
757
757
|
page: import('zod').ZodOptional<import('zod').ZodNumber>;
|
758
758
|
}, "strip", import('zod').ZodTypeAny, {
|
759
759
|
page?: number | undefined;
|
760
|
-
|
760
|
+
filter_type?: "localization_files" | "paged_documents" | "marketing" | undefined;
|
761
761
|
filter_team_id?: number | undefined;
|
762
762
|
filter_names?: string | undefined;
|
763
763
|
include_statistics?: 0 | 1 | undefined;
|
@@ -765,7 +765,7 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
|
|
765
765
|
limit?: number | undefined;
|
766
766
|
}, {
|
767
767
|
page?: number | undefined;
|
768
|
-
|
768
|
+
filter_type?: "localization_files" | "paged_documents" | "marketing" | undefined;
|
769
769
|
filter_team_id?: number | undefined;
|
770
770
|
filter_names?: string | undefined;
|
771
771
|
include_statistics?: 0 | 1 | undefined;
|
@@ -559,7 +559,7 @@ export declare const CREATE_PROJECT_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
559
559
|
}>;
|
560
560
|
export type CreateProjectRequestBody = z.infer<typeof CREATE_PROJECT_REQUEST_BODY_SCHEMA>;
|
561
561
|
export declare const LIST_PROJECTS_REQUEST_QUERY_SCHEMA: z.ZodObject<{
|
562
|
-
|
562
|
+
filter_type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"localization_files">, z.ZodLiteral<"paged_documents">, z.ZodLiteral<"marketing">]>>;
|
563
563
|
filter_team_id: z.ZodOptional<z.ZodNumber>;
|
564
564
|
filter_names: z.ZodOptional<z.ZodString>;
|
565
565
|
include_statistics: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
|
@@ -568,7 +568,7 @@ export declare const LIST_PROJECTS_REQUEST_QUERY_SCHEMA: z.ZodObject<{
|
|
568
568
|
page: z.ZodOptional<z.ZodNumber>;
|
569
569
|
}, "strip", z.ZodTypeAny, {
|
570
570
|
page?: number | undefined;
|
571
|
-
|
571
|
+
filter_type?: "localization_files" | "paged_documents" | "marketing" | undefined;
|
572
572
|
filter_team_id?: number | undefined;
|
573
573
|
filter_names?: string | undefined;
|
574
574
|
include_statistics?: 0 | 1 | undefined;
|
@@ -576,7 +576,7 @@ export declare const LIST_PROJECTS_REQUEST_QUERY_SCHEMA: z.ZodObject<{
|
|
576
576
|
limit?: number | undefined;
|
577
577
|
}, {
|
578
578
|
page?: number | undefined;
|
579
|
-
|
579
|
+
filter_type?: "localization_files" | "paged_documents" | "marketing" | undefined;
|
580
580
|
filter_team_id?: number | undefined;
|
581
581
|
filter_names?: string | undefined;
|
582
582
|
include_statistics?: 0 | 1 | undefined;
|