ode-explorer 1.3.2-dev.202401261533 → 1.3.2-dev.202401261547
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/edifice-react.js +1 -1
- package/dist/version.txt +1 -1
- package/package.json +1 -1
package/dist/edifice-react.js
CHANGED
|
@@ -1344,4 +1344,4 @@ void main()
|
|
|
1344
1344
|
font-display: ${r.display};
|
|
1345
1345
|
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=gN(e)),typeof e=="number"?mN(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const r=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&r<1&&(e+=(r*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${n} ${e}`}reset(){Object.assign(this,xn.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(r=>setTimeout(r,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=X.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};xp.availableFonts={},xp.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Td=xp;const ac=class _n extends xa{constructor(e="",r={}){super(Q.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=Q.from(i,{scaleMode:X.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new me,s.trim=new me,this.texture=s;const n="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(n,"svg"),l=document.createElementNS(n,"foreignObject"),c=document.createElementNS(a,"div"),h=document.createElementNS(a,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",o.appendChild(l),this.maxWidth=_n.defaultMaxWidth,this.maxHeight=_n.defaultMaxHeight,this._domElement=c,this._styleElement=h,this._svgRoot=o,this._foreignObject=l,this._foreignObject.appendChild(h),this._foreignObject.appendChild(c),this._image=i,this._loadImage=new Image,this._autoResolution=_n.defaultAutoResolution,this._resolution=_n.defaultResolution??X.RESOLUTION,this.text=e,this.style=r}measureText(e){var h,f;const{text:r,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:r,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:a,height:o}=n;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const l=Math.min(this.maxWidth,Math.ceil(a)),c=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),r!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(s)}),this._styleElement.textContent=(f=this._style)==null?void 0:f.toGlobalCSS()),{width:l+i.padding*2,height:c+i.padding*2}}async updateText(e=!0){const{style:r,_image:i,_loadImage:s}=this;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),!this.dirty&&e)return;const{width:n,height:a}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(l=>{s.onload=async()=>{if(o<this._updateID){l();return}await r.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),l()};const c=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(c)}`})}get source(){return this._image}updateTexture(){const{style:e,texture:r,_image:i,resolution:s}=this,{padding:n}=e,{baseTexture:a}=r;r.trim.width=r._frame.width=i.width/s,r.trim.height=r._frame.height=i.height/s,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-n*2,r.orig.height=r._frame.height-n*2,this._onTextureUpdate(),a.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,n,a,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},_n.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=r,(s=this._svgRoot)==null||s.remove(),this._svgRoot=r,(n=this._domElement)==null||n.remove(),this._domElement=r,(a=this._foreignObject)==null||a.remove(),this._foreignObject=r,(o=this._styleElement)==null||o.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const r=$i(this.scale.x)||1;this.scale.x=r*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const r=$i(this.scale.y)||1;this.scale.y=r*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof Td?(this.ownsStyle=!1,this._style=e):e instanceof ts?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Td.from(e)):(this.ownsStyle=!0,this._style=new Td(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};ac.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},ac.defaultMaxWidth=2024,ac.defaultMaxHeight=2024,ac.defaultAutoResolution=!0;const I4=E.forwardRef(({children:t},e)=>x.jsx("div",{ref:e,className:"actionbar",children:t})),GU=I4,R4=E.forwardRef((t,e)=>{const{isLoading:r,loadingIcon:i,loadingPosition:s="left",children:n,className:a,...o}=t,l=()=>{let h;return i?h=i:h=x.jsx(vE,{...o,"aria-label":"Loading"}),h},c=re("loading",{"is-loading":r},a);return x.jsxs("div",{className:c,role:"status",ref:e,children:[(!s||s==="left")&&l(),n,s==="right"&&l()]})}),Fw=R4,P4=E.forwardRef(({color:t="primary",type:e="button",size:r="md",children:i,isLoading:s,loadingIcon:n,loadingPosition:a,leftIcon:o,rightIcon:l,className:c,variant:h="filled",...f},u)=>{const d=re("btn",{[`btn-filled btn-${t}`]:h==="filled",[`btn-${h}-${t}`]:h==="outline"||h==="ghost","btn-icon":!i,"btn-loading":s,"btn-lg":r==="lg","btn-sm":r==="sm"},c);return x.jsx("button",{ref:u,className:d,type:e,...f,children:s?x.jsx(Fw,{isLoading:!0,loadingIcon:n,loadingPosition:a,children:i}):x.jsxs("span",{children:[o,i,l]})})}),tt=P4,M4=E.forwardRef(({icon:t,className:e,...r},i)=>{const s={...r,className:re("btn-icon btn-sm",e)};return x.jsx(tt,{ref:i,...s,children:t})}),Qs=M4,O4=E.forwardRef(({icon:t=x.jsx(yE,{}),onClick:e,className:r,...i},s)=>{const n=re("btn-search",r);return x.jsx(Qs,{ref:s,className:n,icon:t,onClick:e,...i})}),k4=O4,D4=E.forwardRef(({type:t="success",className:e="",children:r,button:i,isDismissible:s=!1,isToast:n=!1,isConfirm:a=!1,position:o="none",autoClose:l=!1,autoCloseDelay:c=3e3,onClose:h,onVisibilityChange:f},u)=>{const[d,p]=E.useState(!0),m=E.useRef(null),{t:g}=Ce(),y=E.useCallback(()=>{p(!1),h==null||h()},[h]);E.useImperativeHandle(u,()=>({show:_,hide:y,...m.current})),E.useLayoutEffect(()=>{f==null||f(d)},[d,f]),E.useEffect(()=>{l&&d&&setTimeout(()=>{y()},c)},[l,c,y,d]);const _=()=>{p(!0)},v={success:{icon:x.jsx(fE,{}),classModifier:"alert-success"},warning:{icon:x.jsx(pE,{}),classModifier:"alert-warning"},info:{icon:x.jsx(qy,{}),classModifier:"alert-info"},danger:{icon:x.jsx(mE,{}),classModifier:"alert-danger"}},b={"is-dismissible":s,"is-toast ":n},w={"is-confirm":a},A=re("alert gap-12",v[t].classModifier,b,w,o,e);return x.jsx(x.Fragment,{children:d?x.jsxs("div",{ref:m,className:A,role:"alert",children:[!a&&v[t].icon,x.jsx("div",{className:"alert-content small",children:r}),i&&x.jsxs("div",{className:"ms-12",children:[i," ",a&&x.jsx(tt,{onClick:y,children:g("close")})]}),(s||a)&&x.jsx("div",{className:"btn-close-container",children:x.jsx("button",{type:"button",className:"btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:y})}),l&&x.jsx("div",{className:"alert-progress",style:{transform:"scaleX(0)"}})]}):null})}),zi=D4,N4=E.forwardRef(({children:t,render:e,isFullscreen:r=!1},i)=>{const s=re("d-flex flex-wrap p-16 gap-8 border-bottom bg-white",{"justify-content-between":e,"mx-n16":!r,"z-2000 top-0 start-0 end-0 position-fixed":r});return x.jsxs("div",{ref:i,className:s,children:[t,e?x.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:e()}):null]})}),zU=N4;function Uw({appCode:t}){return pb({queryKey:["conf"],queryFn:async()=>await Me.conf().getConf(t),suspense:!0})}function L4(t){return{getPreference:async()=>await Me.conf().getPreference(t),savePreference:async e=>await Me.conf().savePreference(t,JSON.stringify(e))}}function B4(){const[t,e]=E.useState(!1),{getPreference:r,savePreference:i}=L4("rgpdCookies");return E.useEffect(()=>{(async()=>{const s=await r();e(s===null?!0:s.showInfoTip)})()},[]),{showCookiesConsent:t,handleConsultCookies:()=>{document.location.href="/userbook/mon-compte",i({showInfoTip:!1}),e(!1)},handleCloseCookiesConsent:()=>{i({showInfoTip:!1}),e(!1)}}}function F4(){return pb({queryKey:["session"],queryFn:async()=>await Me.session().getSession(),suspense:!0})}const jw=E.createContext(null);function HU({children:t,params:e}){const r=e.app,{t:i}=Ce(),s=i(r),n=F4(),a=Uw({appCode:r}),{showCookiesConsent:o,handleConsultCookies:l,handleCloseCookiesConsent:c}=B4(),h=(a==null?void 0:a.isSuccess)&&(n==null?void 0:n.isSuccess);E.useEffect(()=>{var u,d;(d=document.querySelector("html"))==null||d.setAttribute("lang",((u=n==null?void 0:n.data)==null?void 0:u.currentLanguage)||"fr")},[n==null?void 0:n.data]),E.useEffect(()=>{document.title=`${s}`},[r,n.data,s]);const f=E.useMemo(()=>{var u,d,p,m,g,y;return{appCode:r,applications:(u=a==null?void 0:a.data)==null?void 0:u.applications,confQuery:a,currentApp:(d=a==null?void 0:a.data)==null?void 0:d.currentApp,currentLanguage:(p=n==null?void 0:n.data)==null?void 0:p.currentLanguage,init:h,sessionQuery:n,user:(m=n==null?void 0:n.data)==null?void 0:m.user,userDescription:(g=n==null?void 0:n.data)==null?void 0:g.userDescription,userProfile:(y=n==null?void 0:n.data)==null?void 0:y.userProfile}},[r,a,h,n]);return x.jsxs(jw.Provider,{value:f,children:[t,o&&x.jsx(zi,{type:"info",className:"m-12",isConfirm:!0,position:"bottom-right",button:x.jsx(tt,{color:"tertiary",variant:"ghost",onClick:l,children:i("rgpd.cookies.banner.button.consult")}),onClose:c,children:i("rgpd.cookies.banner.text1")})]})}function mt(){const t=E.useContext(jw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}const $w=E.createContext(null);function VU({children:t}){var e;const{appCode:r}=mt(),i=Uw({appCode:r});E.useEffect(()=>{var n,a,o,l,c,h,f,u,d;const p=document.getElementById("favicon");p.href=`${(a=(n=i==null?void 0:i.data)==null?void 0:n.theme)==null?void 0:a.basePath}/img/illustrations/favicon.ico`;const m=(c=(l=(o=i==null?void 0:i.data)==null?void 0:o.theme)==null?void 0:l.bootstrapVersion)==null?void 0:c.split("-"),g=m?m[m.length-1]:void 0;[{data:"data-skin",value:(f=(h=i==null?void 0:i.data)==null?void 0:h.theme)==null?void 0:f.skinName},{data:"data-theme",value:(d=(u=i==null?void 0:i.data)==null?void 0:u.theme)==null?void 0:d.themeName},{data:"data-product",value:g}].forEach(y=>{var _;return(_=document.querySelector("html"))==null?void 0:_.setAttribute(y.data,y.value)})},[i==null?void 0:i.data]);const s=E.useMemo(()=>{var n;return{theme:(n=i==null?void 0:i.data)==null?void 0:n.theme}},[(e=i==null?void 0:i.data)==null?void 0:e.theme]);return x.jsx($w.Provider,{value:s,children:t})}function Om(){const t=E.useContext($w);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}function U4(){var t;const{sessionQuery:e}=mt(),r=new Set;return(t=e==null?void 0:e.data)==null?void 0:t.bookmarkedApps.filter(i=>{const s=r.has(i.displayName);return r.add(i.displayName),!s})}const j4=E.createContext(null);function $4(){return E.useContext(j4)}function Ay(...t){return e=>{G4(e,...t)}}function G4(t,...e){e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}const z4=(t,e)=>{const r=e==null?void 0:e.filter(i=>i.id===t&&i.available);return r&&r.length>0},Gw={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};function fo(t){const e=$4(),[r,i]=E.useState();return E.useEffect(()=>{(async()=>{let s;if(e!=null&&e.hasWorkflow)if(typeof t=="string")s=await e.hasWorkflow(t);else throw"not.implemented.yet)";else typeof t=="string"?s=await Me.rights().sessionHasWorkflowRight(t):s=await Me.rights().sessionHasWorkflowRights(t);i(s)})()},[t,e]),r}const H4=()=>{const t=fo("fr.openent.zimbra.controllers.ZimbraController|view"),e=fo("fr.openent.zimbra.controllers.ZimbraController|preauth"),[r,i]=E.useState(0),[s,n]=E.useState(""),a=E.useCallback(async()=>{if(t)try{const l=await Me.http().get("/zimbra/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});l.status!==200&&i(0),i(l.count)}catch{console.error("error"),i(0)}else try{const l=await Me.http().get("/conversation/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});i(l.count)}catch{console.error("error"),i(0)}},[t]),o=E.useCallback(()=>{let l="";Me.http().get("/userbook/preference/zimbra").then(c=>{try{c.preference&&JSON.parse(c.preference).modeExpert&&e?l="/zimbra/preauth":l=window.location.origin+"/zimbra/zimbra"}catch{l="/zimbra/zimbra"}}),n(l)},[e]);return E.useEffect(()=>{(async()=>{try{await a()}catch(l){console.error(l)}})(),o()},[o,a]),{messages:r,msgLink:s,zimbraWorkflow:t}},V4=H4,Cy=["mousedown","touchstart"];function zw(t,e,r){const i=E.useRef();return E.useEffect(()=>{const s=n=>{const{target:a}=n??{};if(Array.isArray(r)){const o=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(l=>!!l&&!n.composedPath().includes(l))&&!o&&t()}else i.current&&!i.current.contains(a)&&t()};return(e||Cy).forEach(n=>{document.addEventListener(n,s)}),()=>{(e||Cy).forEach(n=>{document.removeEventListener(n,s)})}},[i,t,r,e]),i}function W4(t,e){const[r,i]=E.useState(t);return E.useEffect(()=>{const s=setTimeout(()=>{i(t)},e||500);return()=>{clearTimeout(s)}},[t,e]),r}const X4=(t,e)=>{const r=E.useId(),[i,s]=E.useState(!1),[n,a]=E.useState(-1),[o,l]=E.useState(null),{refs:c,floatingStyles:h}=$S({placement:t,open:i,onOpenChange:s,whileElementsMounted:AS,middleware:[oS(4),IS({apply({rects:S,elements:M}){M.floating.style,`${S.reference.width}`}}),CS({padding:0})]}),f=E.useRef(null),u=E.useRef(null),d=E.useRef({});E.useEffect(()=>{i?f.current&&(f.current.focus(),a(0)):(a(-1),d.current={})},[i]),E.useEffect(()=>{if(n!==-1){const S=Object.values(d.current)[n];if(S){const M=S.getAttribute("id");l(M),S.focus()}}},[n]);const p=()=>{const S=Object.values(d.current).length;a(M=>(M+1)%S)},m=()=>{const S=Object.values(d.current).length;a(M=>(M-1+S)%S)},g=()=>{a(0)},y=()=>{const S=Object.values(d.current).length;a(S-1)},_=E.useCallback(()=>{s(!0)},[]),v=E.useCallback(()=>{u.current&&(u.current.focus({preventScroll:!0}),s(!1))},[]),b=(S,M)=>{S&&(M.stopPropagation(),M.preventDefault())},w=E.useCallback(S=>{let M=!1;switch(S.code){case" ":case"Space":case"Enter":case"ArrowDown":case"Down":_(),M=!0;break;case"Esc":case"Escape":v(),M=!0;break;case"Up":case"ArrowUp":_(),M=!0;break}e==null||e(S),b(M,S)},[v,_]),A=S=>{const M=Object.values(d.current).findIndex(I=>I.id===S.currentTarget.getAttribute("id"));a(M)},T=E.useCallback((S,M)=>{let I=!1;if(S.shiftKey)S.key==="Tab"&&(v(),I=!0);else{switch(S.code){case"Escape":v();break;case" ":case"Enter":n!==-1&&(Object.values(d.current)[n].getAttribute("role")==="menuitem"&&u.current&&(u.current.focus(),s(!1)),M==null||M()),I=!0;break;case"ArrowDown":case"Down":p(),I=!0;break;case"ArrowUp":case"Up":m(),I=!0;break;case"Home":g(),I=!0;break;case"End":y(),I=!0;break}b(I,S)}},[n,v]),C=E.useCallback(S=>{s(i!==!0),S.stopPropagation(),S.preventDefault()},[i]);return{isFocused:o,visible:i,itemRefs:d,triggerRef:u,menuRef:f,triggerProps:{ref:Ay(u,c.setReference),id:`dropdown-toggle-${r}`,"aria-haspopup":"menu","aria-controls":`dropdown-${r}`,"aria-expanded":!!i,className:`${i?"selected":""}`,onClick:C,onKeyDown:w,"aria-activedescendant":o},menuProps:{ref:Ay(f,c.setFloating),className:"dropdown-menu bg-white shadow rounded-4 p-8","aria-labelledby":`dropdown-toggle-${r}`,style:{...h}},itemProps:{onMenuItemMouseEnter:A,onMenuItemClick:v,onMenuItemKeyDown:T},setVisible:s}},Y4=X4,q4=()=>{const[t,e]=E.useState(!1),[r,i]=E.useState([]),s=E.useRef(null),n=f=>{i(u=>[...u,f])},a=f=>{i(u=>u.filter(d=>d.name!==f.name))},o=()=>{i([])},l=f=>{const u=f.target.files;u&&[...u].forEach(d=>{n(d)})},c=f=>{f.preventDefault(),f.stopPropagation(),e(!0)},h=f=>{f.preventDefault(),f.stopPropagation(),e(!1)};return{inputRef:s,files:r,dragging:t,handleDragging:c,handleDragLeave:h,handleDrop:f=>{var u;h(f);const d=(u=f.dataTransfer)==null?void 0:u.files;d&&[...d].forEach(p=>{n(p)}),s!=null&&s.current&&d&&(s.current.files=d)},deleteFile:a,addFile:n,cleanFiles:o,handleOnChange:l}},Z4=q4,oc="top-right";function ru(){return{success:(t,e)=>Ta.custom(x.jsx(zi,{type:"success",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),error:(t,e)=>Ta.custom(x.jsx(zi,{type:"danger",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),info:(t,e)=>Ta.custom(x.jsx(zi,{type:"info",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),warning:(t,e)=>Ta.custom(x.jsx(zi,{type:"warning",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??oc}),loading:Ta.loading}}function Hw(){const[t,e]=E.useState(!1),r=E.useRef(null),i=()=>{e(!0)},s=()=>{e(!1)};return E.useEffect(()=>{const n=r.current;if(n)return n.addEventListener("mouseover",i),n.addEventListener("mouseout",s),()=>{n.removeEventListener("mouseover",i),n.removeEventListener("mouseout",s)}},[r]),[r,t]}function K4({src:t,placeholder:e}){const[r,i]=E.useState(t||e),s=E.useCallback(()=>{i(e)},[e]);return E.useEffect(()=>{i(t)},[t]),{imgSrc:r,onError:s}}function Q4(t,e){const r=E.useCallback(({code:i})=>{e.includes(i)&&t()},[t,e]);E.useEffect(()=>(window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}),[r])}function WU(){const t=document.querySelector("html");return()=>{t&&t.scrollIntoView()}}function J4(t=!1){const[e,r]=E.useState(t),i=E.useCallback(()=>{r(s=>!s)},[]);return[e,i]}function e5(){const t=E.useRef(null),e='button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';return E.useEffect(()=>{const r=t.current,i=r.querySelectorAll(e)[0],s=r.querySelectorAll(e),n=t&&(s==null?void 0:s[s.length-1]),a=o=>{o.key==="Tab"&&(o.shiftKey?document.activeElement===i&&(n.focus(),o.preventDefault()):document.activeElement===n&&(i.focus(),o.preventDefault()))};if(r)return r.addEventListener("keydown",a),()=>{r.removeEventListener("keydown",a)}},[]),t}function t5({user:t,avatar:e}){const{appCode:r}=mt(),{t:i}=Ce(),s=i(r),[n,a]=E.useState(!0),[o,l]=Hw(),c=E.useId(),h=E.useId(),f=e,u=t==null?void 0:t.username,d=i("welcome",{username:t==null?void 0:t.firstName}),p=U4(),m=fo("net.atos.entng.community.controllers.CommunityController|view"),g=fo("org.entcore.conversation.controllers.ConversationController|view"),y=fo("fr.openent.searchengine.controllers.SearchEngineController|view"),_=E.useCallback(()=>{a(!n)},[n]),v=async()=>{await Me.session().logout(),window.location.href="/auth/login"};return E.useMemo(()=>({title:s,bookmarkedApps:p,appsRef:o,isAppsHovered:l,popoverAppsId:c,popoverSearchId:h,userAvatar:f,userName:u,welcomeUser:d,communityWorkflow:m,conversationWorflow:g,searchWorkflow:y,isCollapsed:n,toggleCollapsedNav:_,handleLogout:v}),[o,p,m,g,l,n,c,h,y,s,_,f,u,d])}function r5(){const[t,e]=E.useState(!1);E.useEffect(()=>{r()},[]);const r=E.useCallback(async()=>{const i=await Me.session().isAdml();e(i)},[]);return{isAdml:t}}const i5=()=>{var t;const{user:e,appCode:r}=mt(),i=Gw[r],s=(t=e.apps.find(l=>l.isExternal&&l.address.includes("library")&&l.name.includes("library")))==null?void 0:t.address.split("?");let n=s==null?void 0:s[0];n!=null&&n.endsWith("/")||(n=`${n}/`);const a=s==null?void 0:s[1],o=`application%5B0%5D=${i}&page=1&sort_field=views&sort_order=desc`;return{libraryUrl:`${n}search/?${a}&${o}`}},XU=i5;function km(){const t={"last-infos-widget":"ic-widget-actualites",birthday:"ic-star","calendar-widget":"ic-widget-calendar","carnet-de-bord":"ic-widget-carnet-de-bord","record-me":"ic-widget-microphone",mood:"ic-star","my-apps":"ic-widget-apps",notes:"ic-widget-notes","rss-widget":"ic-widget-rss","bookmark-widget":"ic-widget-signets",qwant:"ic-widget-qwant","qwant-junior":"ic-widget-qwant","agenda-widget":"ic-widget-agenda","cursus-widget":"ic-widget-aide-devoirs","maxicours-widget":"ic-widget-maxicours","school-widget":"ic-widget-schoolbook","universalis-widget":"ic-widget-universalis","briefme-widget":"ic-widget-briefme"};function e(o){let l="";switch(typeof o=="string"?l=o:l=(o==null?void 0:o.icon)!==void 0?o==null?void 0:o.icon.trim().toLowerCase():"placeholder",l&&l.length>0?l.endsWith("-large")&&(l=l.replace("-large","")):typeof o=="object"&&(l=(o==null?void 0:o.displayName)!==void 0?o==null?void 0:o.displayName.trim().toLowerCase():""),l){case"admin.title":l="admin";break;case"banques des savoirs":l="banquesavoir";break;case"collaborativewall":l="collaborative-wall";break;case"communautés":l="community";break;case"directory.user":l="userbook";break;case"emploi du temps":l="edt";break;case"formulaire":l="forms";break;case"messagerie":l="conversation";break;case"news":l="actualites";break;case"homeworks":case"cahier de texte":l="cahier-de-texte";break;case"diary":case"cahier de texte 2d":l="cahier-textes";break;case"scrapbook":l="scrap-book";break}return l}function r(o){return o&&(o.startsWith("/")||o.startsWith("http://")||o.startsWith("https://"))}function i(o){const l=e(o);return l?`color-app-${l}`:"color-app-placeholder"}function s(o){const l=e(o);return l?`bg-app-${l}`:"bg-app-placeholder"}function n(o){const l=e(o);return l?`bg-light-${l}`:"bg-light-placeholder"}function a(o){return t[o.platformConf.name]}return{getIconClass:i,getBackgroundIconClass:s,getBackgroundLightIconClass:n,getIconCode:e,getWidgetIconClass:a,isIconUrl:r}}function wa(){return["/assets/themes/edifice-bootstrap/images","/assets/themes/edifice-bootstrap/icons","/assets/themes/edifice-bootstrap/fonts"]}function Vw(){const{user:t,userDescription:e,userProfile:r}=mt(),{theme:i}=Om();function s(){let n=e==null?void 0:e.picture;return(!n||n==="no-avatar.jpg"||n==="no-avatar.svg")&&(n=`${i==null?void 0:i.basePath}/img/illustrations/no-avatar.svg`),n}return{user:{...t,type:r},avatar:s(),userDescription:e}}function YU(){const[t,e]=E.useState("pending"),{currentApp:r}=mt();E.useEffect(()=>{i()},[]);const i=async()=>{if(!r){e("[Xiti] Error, currentApp is not defined.");return}try{await Me.analytics().trackPageLoad(window.location.pathname,r),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),e(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(s){console.error("[Xiti] Error Tracking Page Load",s),e(`[Xiti] Error Tracking Page Load: ${s}`)}};return{xitiStatus:t}}const s5=E.forwardRef(({src:t,alt:e,imgPlaceholder:r,ratio:i,objectFit:s,className:n,...a},o)=>{const[l]=wa(),c=r??`${l}/common/image-placeholder.png`,{imgSrc:h,onError:f}=K4({src:t,placeholder:c}),u={"ratio ratio-1x1":i==="1","ratio ratio-4x3":i==="4","ratio ratio-16x9":i==="16","ratio ratio-21x9":i==="21"},d={"object-fit-contain":s==="contain","object-fit-cover":s==="cover","object-fit-fill":s==="fill","object-fit-scale":s==="scale","object-fit-none":s==="none"},p=re({...u}),m=re({...d},n),g=x.jsx("img",{alt:e,onError:f,ref:o,src:h,className:m,...a});return i?x.jsx("div",{className:p,children:g}):g}),iu=s5,n5=E.forwardRef(({app:t,size:e="24",iconFit:r="contain",variant:i="square"},s)=>{const{isIconUrl:n,getIconCode:a}=km(),[,o]=wa(),l=i==="square",c=i==="rounded",h=i==="circle",f=r==="contain",u=r==="ratio",d={"icon-xs":e==="24","icon-sm":e==="40","icon-md":e==="48","icon-lg":e==="80","icon-xl":e==="160"},p={square:l,rounded:c,"rounded-circle":h},m={"icon-contain":f,"icon-ratio":u},g=typeof t=="string"?t:(t==null?void 0:t.icon)!==void 0?t.icon:"placeholder",y=typeof t!="string"&&(t==null?void 0:t.displayName)!==void 0?t.displayName:"",_=t?a(t):"",v=n(g),b=_||"placeholder",w=re("app-icon",{...d,...p,...m,[`bg-light-${b}`]:b&&!f,[`color-app-${b}`]:b});return v?x.jsx(iu,{src:g,alt:y,objectFit:"contain",width:e,height:e,className:"h-full"}):x.jsx("div",{className:w,style:{width:e+"px",height:e+"px"},children:x.jsx("svg",{ref:s,width:e,height:e,role:"img",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:x.jsx("use",{xlinkHref:`${o}/apps.svg#${b}`})})})}),Ho=n5,a5=E.forwardRef(({variant:t="square",size:e="md",alt:r,src:i,imgPlaceholder:s,className:n,...a},o)=>{const[l]=wa(),c=s||`${l}/avatar/no-avatar.svg`,h=re("avatar",{"avatar-xs":e==="xs","avatar-sm":e==="sm","avatar-md":e==="md","avatar-lg":e==="lg","avatar-xl":e==="xl",square:t==="square",rounded:t==="rounded","rounded-circle":t==="circle"},n);return x.jsx("div",{ref:o,className:h,children:x.jsx(iu,{src:i||c,alt:r,imgPlaceholder:c,...a})})}),ua=a5,o5=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("breadcrumb-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})}),Sd=o5,l5=E.forwardRef(({children:t,className:e},r)=>{const i=re("breadcrumb d-flex flex-nowrap align-items-center mb-0",e);return x.jsx("ol",{ref:r,className:i,children:t})}),c5=l5,h5=E.forwardRef(({children:t,app:e,className:r},i)=>{const{t:s}=Ce(),{getIconClass:n}=km(),a=re("d-flex align-items-center mb-0",n(e),r),o={"--edifice-breadcrumb-divider":"-"};return x.jsx("nav",{ref:i,className:a,"aria-label":s("breadcrumb"),style:o,children:t})}),u5=h5,d5=E.forwardRef(({level:t="h1",headingStyle:e="h1",children:r,className:i,...s},n)=>{const a=re(e,i);return x.jsx(t,{ref:n,className:a,...s,children:r})}),ur=d5,f5=E.forwardRef(({app:t,name:e},r)=>{const{t:i}=Ce();return x.jsx(u5,{app:t,ref:r,className:"mw-100",children:x.jsx(c5,{className:"gap-12 mw-100",children:e?x.jsxs(x.Fragment,{children:[x.jsx(Sd,{children:x.jsxs("a",{href:t==null?void 0:t.address,className:"d-flex",children:[x.jsx(Qs,{variant:"ghost",color:"tertiary",icon:x.jsx(gE,{}),"aria-label":i(t==null?void 0:t.displayName)}),x.jsx(Ho,{app:t,size:"40"})]})}),x.jsx(Sd,{className:"text-truncate",children:x.jsx(ur,{level:"h1",headingStyle:"h3",className:"text-truncate",children:e})})]}):x.jsxs(Sd,{className:"gap-12 d-flex align-items-center",children:[x.jsx(Ho,{app:t,size:"40"}),x.jsx(ur,{level:"h1",headingStyle:"h3",className:"d-none d-md-flex",children:i(t==null?void 0:t.displayName)})]})})})}),qU=f5,p5=({children:t,space:e=null,flexDirection:r="row"})=>{const i=re("card-body",{[`p-${e}`]:e,[`gap-${e}`]:e,"align-items-start":r==="column","flex-column":r==="column"});return x.jsx("div",{className:i,children:t})},m5=p5,Ww=E.createContext(null),Xw=()=>{const t=E.useContext(Ww);if(!t)throw new Error("Cannot be rendered outside the Card component");return t},g5=({children:t})=>x.jsx("div",{className:"card-footer gap-16",children:t}),v5=g5,y5=()=>{const{isSelectable:t,isClickable:e,onClick:r,onSelect:i}=Xw();return t||e?x.jsxs("div",{className:"card-header",children:[t?x.jsx(Qs,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:x.jsx(bE,{}),onClick:i,variant:"ghost"}):null,e?x.jsx("button",{onClick:r,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}):null]}):null},b5=y5,x5=({imageSrc:t,className:e,variant:r="medium"})=>{const{app:i}=Xw(),s=r==="landscape"?{width:"100%",height:"auto"}:null;return x.jsx("div",{className:re("card-image",r),children:t?x.jsx(iu,{alt:"",src:t,objectFit:"cover",className:re("h-full w-100",e)}):x.jsx(Ho,{app:i,iconFit:"ratio",size:"80",variant:"rounded",...s})})},_5=x5,w5=({children:t,className:e})=>{const r=re("card-text small text-break text-truncate text-truncate-1",e);return x.jsx("p",{className:r,children:t})},E5=w5,T5=({children:t,className:e})=>{const r=re("card-title body text-break text-truncate text-truncate-1",e);return x.jsx("h3",{className:r,children:x.jsx("strong",{children:t})})},S5=T5,A5=({userSrc:t,creatorName:e})=>t?x.jsx(ua,{alt:e||"",size:"xs",src:t,variant:"circle",width:"24",height:"24"}):x.jsx(wx,{}),C5=A5,I5=E.forwardRef(({app:t,isSelectable:e=!0,isClickable:r=!0,isSelected:i=!1,onClick:s,onSelect:n,children:a,className:o},l)=>{const{getIconCode:c}=km(),h=t?c(t):"placeholder",f=E.useMemo(()=>({app:t,appCode:h,isSelectable:e,isClickable:r,onClick:s,onSelect:n}),[t,h,e,r,s,n]);return x.jsx(Ww.Provider,{value:f,children:x.jsxs("div",{ref:l,className:re("card",{"is-selected":i,"c-pointer":r},o),children:[x.jsx(Yw.Header,{}),typeof a=="function"?a(h):a]})})}),Yw=Object.assign(I5,{Title:S5,Text:E5,Image:_5,Body:m5,User:C5,Footer:v5,Header:b5}),ZU=Yw,R5=E.forwardRef(({label:t,disabled:e=!1,checked:r=!1,indeterminate:i=!1,...s},n)=>{const a=E.useRef(null);E.useImperativeHandle(n,()=>({...a.current})),E.useEffect(()=>{a.current.indeterminate=i},[a,i]);const o=E.useId(),l={type:"checkbox",checked:r,disabled:e,ref:a,className:re(s.className,"form-check-input c-pointer"),id:o},c={...s,...l};return x.jsxs("div",{className:"form-check d-flex align-items-center gap-8",children:[x.jsx("input",{...c}),t&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:t})]})}),Dm=R5,P5=({children:t,message:e,icon:r=null,placement:i="auto"})=>{const[s,n]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(null),{styles:h,attributes:f}=x2(s,a,{placement:i,modifiers:[{name:"arrow",options:{element:l}}]}),[u,d]=E.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"d-inline-block position-relative z-2",ref:n,onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},children:t}),u&&e&&x.jsxs("div",{className:re("tooltip d-block show mb-12","bs-tooltip-auto"),ref:o,style:h.popper,...f.popper,children:[x.jsxs("div",{className:"tooltip-inner shadow-hover d-flex gap-8 align-items-center",children:[r&&r,x.jsx("div",{children:e})]}),x.jsx("div",{className:"tooltip-arrow",ref:c,style:h.arrow})]})]})},M5=P5,qw=E.createContext(null),Ea=()=>{const t=E.useContext(qw);if(!t)throw new Error("Cannot be rendered outside the Dropdown Component");return t},Zw=E.createContext(null),su=()=>{const t=E.useContext(Zw);if(!t)throw new Error("Cannot be rendered outside the FormControl component");return t},O5=({children:t})=>{const{status:e}=su(),r=re("form-text",{"is-invalid":e==="invalid",valid:e==="valid"});return x.jsx("p",{className:r,children:x.jsx("em",{children:t})})},k5=O5,D5=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",type:i="text",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=su(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("input",{ref:a,id:o,className:f,type:i,placeholder:e,required:l,readOnly:c,...n})}),da=D5,N5=E.forwardRef(({leftIcon:t,optionalText:e="Optional",requiredText:r="*",children:i,className:s},n)=>{const{id:a,isOptional:o,isRequired:l}=su(),c=re("form-label",{"has-icon":t},s),h=o&&!l,f=l&&!o;return E.useEffect(()=>{if(o&&l)throw new Error("Cannot be optional and required at the same time")},[o,l]),x.jsxs("label",{ref:n,htmlFor:a,className:c,children:[t,i,h&&x.jsxs("em",{className:"optional",children:["- ",e]}),f&&x.jsx("em",{className:"required",children:r})]})}),Nn=N5,L5=E.forwardRef(({children:t,className:e,id:r,isOptional:i,isReadOnly:s,isRequired:n,status:a,...o},l)=>{const c=E.useMemo(()=>({id:r,isOptional:i,isRequired:n,isReadOnly:s,status:a}),[r,i,s,n,a]);return x.jsx(Zw.Provider,{value:c,children:x.jsx("div",{ref:l,className:e,...o,children:t})})}),B5=Object.assign(L5,{Label:Nn,Input:da,Text:k5}),ft=B5,F5=({placeholder:t,value:e="",searchMinLength:r=3,handleSearchInputChange:i})=>{const{triggerProps:s,itemProps:n,setVisible:a}=Ea(),o={...s,role:"combobox",onClick:()=>{e.length>=r&&a(!0)},onChange:i};return E.useEffect(()=>{a(e.length>=r)},[a,e,r]),x.jsx(ft,{className:"d-flex align-items-center",id:"search",children:x.jsx(da,{...o,className:"max-w-512",noValidationIcon:!0,placeholder:t,size:"md",type:"search",onKeyDown:n.onMenuItemKeyDown})})},U5=F5,j5=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h=r.includes(e),f={value:e,model:r,checked:h,readOnly:!0},u=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:d=>n.current[c]=d,role:"menuitemcheckbox","aria-checked":h,onMouseUp:()=>i(e),onKeyDown:d=>o(d,()=>i(e)),onMouseEnter:l,tabIndex:h?0:-1,className:u,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(Dm,{...f})]})})},$5=j5,G5=({type:t="action",icon:e,onClick:r,children:i,...s})=>{const{itemProps:n,itemRefs:a,isFocused:o}=Ea(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:c,onMenuItemClick:h}=n,f=()=>{r==null||r(),t==="action"&&h()},u=E.useId(),d=re("dropdown-item",{focus:o===u});return x.jsx("div",{id:u,role:"menuitem",ref:p=>a.current[u]=p,tabIndex:o===u?0:-1,className:d,"aria-current":o===u,onClick:f,onMouseEnter:c,onKeyDown:p=>l(p,r),...s,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center",children:[e,i]})})},z5=G5,H5=E.forwardRef(({children:t,block:e,...r},i)=>{const{menuProps:s,visible:n}=Ea(),{className:a,...o}=s,l={...o,...r},c=re({"w-100":e},a);return n?x.jsx("div",{ref:i,className:c,...l,children:t}):null}),V5=H5,W5=E.forwardRef(({label:t,children:e},r)=>x.jsxs("div",{ref:r,role:"group",children:[x.jsx("span",{className:"small px-4",children:x.jsx("strong",{children:t})}),e]})),X5=W5,Y5=E.forwardRef(({model:t,icon:e,label:r=!1,disabled:i=!1,checked:s,...n},a)=>{const o=E.useId(),l={type:"radio",checked:s,disabled:i,ref:a,className:re(n.className,"form-check-input c-pointer",e&&"d-none"),id:o},c={...n,...l};return x.jsxs("div",{className:re("form-check d-flex align-items-center gap-8",e&&"ps-0"),children:[x.jsx("input",{...c}),e&&x.jsx("label",{htmlFor:c.id,className:re("c-pointer",t!==n.value&&"text-muted"),children:e}),!e&&r&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:r})]})}),_p=Y5,q5=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h={value:e,model:r,checked:e===r,readOnly:!0},f=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:u=>n.current[c]=u,role:"menuitemradio","aria-checked":e===r,onMouseUp:()=>i(e),onKeyDown:u=>o(u,()=>i(e)),onMouseEnter:l,tabIndex:e===r?0:-1,className:f,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(_p,{...h,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})},Z5=q5,K5=()=>x.jsx("div",{role:"separator",className:"px-4",children:x.jsx("hr",{className:"m-0"})}),Q5=K5,J5=E.forwardRef(({label:t,icon:e,variant:r,disabled:i=!1,size:s,badgeContent:n,...a},o)=>{const{triggerProps:l,block:c}=Ea(),{className:h,...f}=l,u={...f,...a},d=re("dropdown-toggle ",s,r,{"w-100":c},h);return x.jsxs("button",{ref:o,className:d,disabled:i,...u,children:[e||null,t,n?x.jsx("span",{className:"badge text-bg-secondary rounded-pill",children:n}):x.jsx(xE,{width:16,height:16,className:"dropdown-toggle-caret"})]})}),e6=J5,t6=({children:t,block:e,overflow:r=!0,placement:i="bottom-start",extraTriggerKeyDownHandler:s})=>{const{visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,setVisible:f}=Y4(i,s),u=zw(()=>f(!1)),d=E.useMemo(()=>({visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,block:e,setVisible:f}),[n,a,o,l,c,h,e,f]),p=re("dropdown",{"w-100":e,overflow:r});return x.jsx(qw.Provider,{value:d,children:x.jsx("div",{ref:u,className:p,children:typeof t=="function"?t(o,h):t})})},r6=Object.assign(t6,{Trigger:e6,Menu:V5,Item:z5,Separator:Q5,CheckboxItem:$5,RadioItem:Z5,MenuGroup:X5}),ot=r6,Nm=({onSearchResultsChange:t,onSearchInputChange:e,options:r,value:i,isLoading:s,noResult:n,searchMinLength:a,placeholder:o})=>{const{t:l}=Ce(),[c,h]=E.useState([]);E.useEffect(()=>{t(c)},[c]);const f=d=>{h([d])},u=()=>s?x.jsxs("div",{className:"d-flex align-items-center p-4",children:[x.jsx(Fw,{isLoading:s}),x.jsx("span",{className:"ps-4",children:l("explorer.search.pending")})]}):n?x.jsx("div",{className:"p-4",children:l("portal.no.result")}):r.map((d,p)=>x.jsxs(E.Fragment,{children:[x.jsx(ot.Item,{type:"select",icon:d.icon,onClick:()=>f(d.value),children:d.label}),p<r.length-1&&x.jsx(ot.Separator,{})]},p));return x.jsxs(ot,{block:!0,children:[x.jsx(Nm.Trigger,{placeholder:o,searchMinLength:a,handleSearchInputChange:e,value:i}),x.jsx(ot.Menu,{children:u()})]})};Nm.Trigger=U5;const i6=Nm,s6=({imageSrc:t,imageAlt:e="",title:r,text:i,className:s})=>{const n=re("text",s);return x.jsxs("div",{className:"emptyscreen",children:[t&&x.jsx("div",{className:"emptyscreen-image mb-12",children:x.jsx("img",{className:"mx-auto",src:t,alt:e,width:"250",height:"250"})}),r&&x.jsx(ur,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:r}),i&&x.jsx("div",{className:n,children:i})]})},KU=s6,n6=({children:t,className:e,...r})=>{const i=re("grid",e);return x.jsx("div",{className:i,...r,children:t})},a6=({sm:t,md:e,lg:r,xl:i,children:s,className:n,as:a,...o})=>{const l=a||"div",c=re({[`g-col-${t}`]:t,[e?`g-col-md-${e}`:""]:e,[r?`g-col-lg-${r}`:""]:r,[i?`g-col-xl-${i}`:""]:i},n);return x.jsx(l,{className:c,...o,children:s})};n6.Col=a6;const o6=E.forwardRef(({label:t,addButtonLabel:e="Add image",deleteButtonLabel:r="Delete image",src:i,className:s,app:n,onUploadImage:a,onDeleteImage:o},l)=>{const[c,h]=E.useState(i||""),{inputRef:f,files:u,deleteFile:d,handleOnChange:p,handleDragging:m,handleDragLeave:g,handleDrop:y}=Z4();E.useEffect(()=>{if(u.length>0){d(u[0]),h("");const w=u==null?void 0:u[0];if(!w)return;h(URL.createObjectURL(w)),a(w)}},[u]);const _=()=>{var w;(w=f.current)==null||w.click()},v=()=>{f.current&&(f.current.value=""),d(u[0]),h(""),o()},b=re("image-input",s);return x.jsxs(ft,{id:"image-input",className:b,onDragEnter:m,onDragOver:m,onDragLeave:g,onDrop:y,ref:l,children:[x.jsxs("div",{className:"image-input-actions gap-8",children:[x.jsx(Qs,{"aria-label":e,color:"tertiary",icon:x.jsx(hE,{}),onClick:_,type:"button",variant:"ghost"}),x.jsx(Qs,{"aria-label":r,color:"danger",disabled:!c,icon:x.jsx(uE,{width:"20",height:"20"}),onClick:v,type:"button",variant:"ghost"})]}),x.jsxs(ft.Label,{children:[x.jsx("span",{className:"visually-hidden",children:t}),x.jsx(da,{accept:"image/*",hidden:!0,onChange:p,ref:f,size:"sm",type:"file"}),c?x.jsx(ua,{alt:"",src:c,size:"xl"}):x.jsx(Ho,{app:n,iconFit:"ratio",size:"160",variant:"rounded"})]})]})}),Kw=o6,l6=E.forwardRef(({position:t=!0,caption:e},r)=>{const[i]=wa(),s=`${i}/loading/screen-loading.gif`,n=re("top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-content-center align-items-center z-2000",{"position-fixed":!t,"position-static":t}),a=re("text-center pt-12",{"text-white":!t});return x.jsxs(x.Fragment,{children:[x.jsxs("div",{ref:r,className:n,children:[x.jsx("div",{className:"bg-white rounded-circle mx-auto w-25",children:x.jsx("img",{src:s,alt:"loading"})}),e&&x.jsx("div",{className:a,children:e})]}),!t&&x.jsx("div",{className:"modal-backdrop fade show"})]})}),QU=l6,c6=E.forwardRef(({src:t,is1d:e,translate:r="Retour accueil"},i)=>{const s=re("navbar-brand d-none d-md-block");return x.jsx("a",{ref:i,className:s,href:"/timeline/timeline","aria-label":r,children:x.jsx("img",{className:"logo",src:t,alt:`logo ${e?"ONE":"NEO"}`,width:"300",height:"52"})})}),Iy=c6,Qw=E.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""}),Jw=()=>{const t=E.useContext(Qw);if(!t)throw new Error("Cannot be rendered outside the Modal component");return t},h6=t=>{const{ariaDescriptionId:e}=Jw(),{children:r,className:i}=t,s=re("modal-body",i);return x.jsx("div",{id:e,className:s,children:r})},u6=h6,d6=t=>x.jsx("div",{className:"modal-footer",children:t.children}),f6=d6,p6=t=>{const{onModalClose:e,children:r}=t,{ariaLabelId:i,focusId:s}=Jw(),n=E.useRef(null);return E.useEffect(()=>{var a;s||(a=n.current)==null||a.focus()},[s]),x.jsxs("div",{className:"modal-header",children:[x.jsx("h2",{id:i,className:"modal-title",tabIndex:-1,children:r}),x.jsx(Qs,{ref:n,"aria-label":"Close",color:"tertiary",icon:x.jsx(Zy,{}),type:"button",variant:"ghost",title:"Delete",onClick:e,className:"btn-close"})]})},m6=p6,g6=t=>x.jsx("p",{className:"modal-subtitle",children:t.children}),v6=g6,y6=E.forwardRef((t,e)=>{const{id:r,isOpen:i,onModalClose:s,size:n="md",viewport:a=!1,scrollable:o=!1,focusId:l,children:c}=t,h=`aria_label_${r}`,f=`aria_desc_${r}`,u=zw(s),d=e5();Q4(s,["Escape"]),E.useEffect(()=>{if(i&&(document.body.style.overflow="hidden",l)){const _=document.getElementById(l);_==null||_.focus()}return()=>{document.body.style.overflow=""}},[l,i]);const p=re("modal fade",{"show d-block":i,"modal-scrollable":o,viewport:a,[`modal-${n}`]:n}),m=re("modal-dialog"),g={ariaLabelId:h,ariaDescriptionId:f,focusId:l},y=ux(i,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return x.jsx(Qw.Provider,{value:g,children:y((_,v)=>x.jsxs(x.Fragment,{children:[v&&x.jsx(of.div,{id:r,ref:e,role:"dialog","aria-modal":"true","aria-labelledby":h,"aria-describedby":f,className:p,style:_,tabIndex:-1,children:x.jsx("div",{id:`${r}_ref`,ref:b=>{u.current=b,v&&(d.current=b)},className:m,children:x.jsx("div",{className:"modal-content",children:c})})}),v&&x.jsx(of.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),b6=Object.assign(y6,{Header:m6,Subtitle:v6,Body:u6,Footer:f6}),je=b6,x6=({children:t,className:e})=>{const r=re("popover-body",e);return x.jsx("div",{className:r,children:t})},_6=({children:t,className:e})=>{const r=re("popover-footer p-8",e);return x.jsx("div",{className:r,children:t})},eE=E.forwardRef(({children:t,className:e,id:r,isVisible:i,...s},n)=>{const a=re("popover d-block position-absolute top-100 start-50 translate-middle-x",e);return ux(i,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((o,l)=>l&&x.jsx(of.div,{ref:n,"aria-labelledby":r,className:a,role:"tooltip",style:o,...s,children:t}))}),w6=t=>x.jsx(ot.Trigger,{...t,"aria-haspopup":"listbox",role:"combobox"}),E6=w6,T6=({icon:t,options:e,overflow:r,block:i,variant:s,size:n,disabled:a,placeholderOption:o,onValueChange:l})=>{const[c,h]=E.useState(),{t:f}=Ce();E.useEffect(()=>{if(c){const d=typeof c=="object"?c.value:c;l==null||l(d)}},[c]);const u=typeof c=="object"?c.label:c;return x.jsxs(ot,{overflow:r,block:i,children:[x.jsx(E6,{icon:t,label:f(u||o),variant:s,size:n,disabled:a}),x.jsx(ot.Menu,{role:"listbox",children:e==null?void 0:e.map(d=>{const p=typeof d=="object"?d.value:d,m=typeof d=="object"?d.label:d;return x.jsx(ot.Item,{type:"action",onClick:()=>h(d),children:m},p)})})]})},tE=T6,S6=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",height:i="md",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=su(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","textarea-height-lg":i==="lg","textarea-height-md":i==="md","textarea-height-sm":i==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("textarea",{ref:a,id:o,className:f,placeholder:e,required:l,readOnly:c,...n})}),rE=S6;function A6(t,e,r,i,s,n,a,o,l){const c=u=>{u.preventDefault(),s==null||s(t),u.stopPropagation()},h=u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),s==null||s(t),u.stopPropagation())},f=()=>{i(!r),r?n==null||n(t):a==null||a(t)};return{handleItemClick:c,handleItemKeyDown:h,handleItemFoldUnfoldClick:u=>{u.preventDefault(),f(),u.stopPropagation()},handleItemFoldUnfoldKeyDown:u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),f(),u.stopPropagation())},handleItemFocus:u=>{u.preventDefault(),o==null||o(t)},handleItemBlur:u=>{u.preventDefault(),l==null||l(t)}}}const C6=t=>{const{nodeId:e,label:r,children:i,section:s,selected:n,onItemSelect:a,onItemFold:o,onItemUnfold:l,onItemFocus:c,onItemBlur:h,selectedNodesIds:f}=t,[u,d]=E.useState(!1),{handleItemClick:p,handleItemKeyDown:m,handleItemFoldUnfoldClick:g,handleItemFoldUnfoldKeyDown:y,handleItemFocus:_,handleItemBlur:v}=A6(e,r,u,d,a,o,l,c,h);E.useEffect(()=>{if(f!=null&&f.length&&(f==null?void 0:f.length)>=1){const A=f[f.length-1];f.some(T=>T===e&&e!==A?(d(!0),T===e):(d(!1),!1))}else d(!1)},[e,f]);const b=s?16:12,w=()=>x.jsx("li",{id:`listitem_${e}`,role:"treeitem","aria-selected":n,"aria-expanded":u,children:x.jsxs("div",{children:[x.jsxs("div",{className:"action-container d-flex align-items-center gap-8 px-2",children:[x.jsxs("div",{className:`py-8 ${Array.isArray(i)?null:"invisible"}`,tabIndex:0,role:"button",onClick:g,onKeyDown:y,"aria-label":"fold/unfold button",children:[Array.isArray(i)&&!u&&x.jsx(Bm,{title:"RafterRight",width:b,height:b}),Array.isArray(i)&&u&&x.jsx(po,{title:"RafterDown",width:b,height:b}),!Array.isArray(i)&&x.jsx(Bm,{title:"RafterRight",width:b,height:b,"aria-hidden":"true"})]}),x.jsxs("div",{tabIndex:0,role:"button",className:"flex-fill d-flex align-items-center text-truncate gap-8 py-8",onClick:p,onKeyDown:m,onFocus:_,onBlur:v,children:[s&&x.jsx(_E,{title:"Folder",width:20,height:20}),x.jsx("span",{className:"text-truncate",children:r})]})]}),Array.isArray(i)&&x.jsx("ul",{role:"group",children:i})]})},e);return s?x.jsx("ul",{role:"tree",className:"m-0 p-0",children:w()}):w()},I6=C6,R6=E.forwardRef((t,e)=>{const{data:r,onTreeItemSelect:i,onTreeItemFold:s,onTreeItemUnfold:n,onTreeItemFocus:a,onTreeItemBlur:o,selectedNodesIds:l}=t,[c,h]=E.useState(null);E.useEffect(()=>{l!=null&&l.length&&(l==null?void 0:l.length)>=1?h(l[l.length-1]):h(null)},[l]);const f=E.useMemo(()=>({unselectAll(){h(null)},select(y){h(y),i==null||i(y)}}),[i]);E.useImperativeHandle(e,()=>f,[f]);const u=y=>{s==null||s(y)},d=y=>{n==null||n(y)},p=y=>{a==null||a(y)},m=y=>{o==null||o(y)},g=y=>x.jsx(I6,{nodeId:y.id,label:y.name,section:y.section,selectedNodesIds:l,selected:c===y.id,onItemSelect:f.select,onItemFold:u,onItemUnfold:d,onItemFocus:p,onItemBlur:m,children:Array.isArray(y.children)?y.children.map(_=>g(_)):null},y.id);return x.jsx("div",{className:"treeview",children:g(r)})}),JU=R6,P6=E.forwardRef(({children:t},e)=>x.jsx("span",{className:"visually-hidden",ref:e,children:t})),Hi=P6,M6=async t=>await Me.conf().getPreference(t),O6=async t=>await Me.conf().savePreference(t,JSON.stringify({showOnboardingTrash:!1})),k6=t=>{const[e,r]=E.useState(!0),[i,s]=E.useState(!1);return E.useEffect(()=>{(async()=>{const n=await M6(t);if(n){const{showOnboardingTrash:a}=n;s(a);return}s(!0)})()},[t]),{isOpen:e,setIsOpen:r,isOnboardingTrash:i,handleSavePreference:async()=>{await O6(t),r(!1)}}},D6=({id:t,items:e,modalOptions:r})=>{const[i]=wa(),[s,n]=E.useState(),[a,o]=E.useState(0),{isOpen:l,isOnboardingTrash:c,setIsOpen:h,handleSavePreference:f}=k6(t);E.useEffect(()=>{const y=document.createElement("link");return y.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",y.rel="stylesheet",y.type="text/css",document.head.appendChild(y),()=>{document.head.removeChild(y)}},[]);const{t:u}=Ce(),{title:d,prevText:p,closeText:m,nextText:g}=r;return c?rs.createPortal(x.jsxs(je,{id:"onboarding-modal",size:"md",isOpen:l,focusId:"nextButtonId",onModalClose:()=>h(!1),children:[x.jsx(je.Header,{onModalClose:()=>h(!1),children:u(d||"explorer.modal.onboarding.trash.title")}),x.jsx(je.Body,{children:x.jsx(Bx,{modules:[q2],onSwiper:y=>{n(y)},onSlideChange:y=>{o(y.progress)},pagination:{clickable:!0},children:e.map((y,_)=>x.jsxs(Fx,{children:[x.jsx(iu,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:`${i}/${y.src}`,alt:u(y.alt)}),x.jsx("p",{children:u(y.text)})]},_))})}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>h(!1),children:u("explorer.modal.onboarding.trash.later")}),a>0&&x.jsx(tt,{type:"button",color:"primary",variant:"outline",onClick:()=>s.slidePrev(),children:u(p||"explorer.modal.onboarding.trash.prev")}),a<1&&x.jsx(tt,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>s.slideNext(),children:u(g||"explorer.modal.onboarding.trash.next")}),a===1&&x.jsx(tt,{type:"button",color:"primary",variant:"filled",onClick:f,children:u(m||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null},e8=D6,N6=()=>{const{t}=Ce();return[{value:"bpr.activityType.classroomActivity",label:t("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:t("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:t("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:t("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:t("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:t("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:t("bpr.activityType.courseElement")},{value:"bpr.other",label:t("bpr.other")}]},L6=({control:t,selectedActivities:e,selectActivities:r})=>{const i=N6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(vh,{name:"activityType",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(ot,{block:!0,overflow:!0,children:[x.jsx(ot.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:e==null?void 0:e.length}),x.jsx(ot.Menu,{children:i.map((a,o)=>x.jsx(ot.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})},B6=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],Ry=({name:t,control:e,placeholderOption:r,validate:i})=>x.jsx(vh,{name:t,control:e,rules:{required:!0,validate:i},render:({field:{onChange:s}})=>x.jsx(tE,{block:!0,size:"md",onValueChange:s,options:B6,"aria-required":!0,placeholderOption:r})}),F6=()=>{const{t}=Ce();return[{value:"de_DE",label:t("de_DE")},{value:"en_EN",label:t("en_EN")},{value:"ar_DZ",label:t("ar_DZ")},{value:"es_ES",label:t("es_ES")},{value:"fr_FR",label:t("fr_FR")},{value:"it_IT",label:t("it_IT")},{value:"ja_JP",label:t("ja_JP")},{value:"zh_CN",label:t("zh_CN")},{value:"pt_PT",label:t("pt_PT")},{value:"ru_RU",label:t("ru_RU")},{value:"bpr.other",label:t("bpr.other")}]},U6="bpr.form.publication.language",j6=({control:t})=>{const e=F6();return x.jsx("div",{className:"col",children:x.jsx(vh,{name:"language",control:t,rules:{required:!0},render:({field:{onChange:r}})=>x.jsx(tE,{block:!0,size:"md",onValueChange:r,options:e,"aria-required":!0,placeholderOption:U6})})})},$6=()=>{const{t}=Ce(),[e]=wa();return x.jsxs(x.Fragment,{children:[x.jsxs("ul",{className:"mb-12",children:[x.jsxs("li",{children:[t("bpr.form.publication.licence.text.1"),x.jsx("img",{className:"ms-8 d-inline-block",src:`${e}/common/image-creative-commons.png`,alt:"licence creative commons"})]}),x.jsx("li",{children:t("bpr.form.publication.licence.text.2")})]}),x.jsx(zi,{type:"info",className:"mb-12",children:t("bpr.form.publication.licence.text.3")}),x.jsx(zi,{type:"warning",children:t("bpr.form.publication.licence.text.4")})]})},G6=()=>{const{t}=Ce();return[{value:"bpr.subjectArea.artActivity",label:t("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:t("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:t("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:t("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:t("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:t("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:t("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:t("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:t("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:t("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:t("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:t("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:t("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:t("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:t("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:t("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:t("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:t("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:t("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:t("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:t("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:t("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:t("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:t("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:t("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:t("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:t("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:t("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:t("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:t("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:t("bpr.subjectArea.technology")},{value:"bpr.other",label:t("bpr.other")}]},z6=({control:t,selectedSubjectAreas:e,selectSubjects:r})=>{const i=G6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(vh,{name:"subjectArea",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(ot,{block:!0,overflow:!0,children:[x.jsx(ot.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:e==null?void 0:e.length}),x.jsx(ot.Menu,{children:i.map((a,o)=>x.jsx(ot.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})};function Py({formData:t}){const{t:e}=Ce(),r=i=>i.match(/^\s/);return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.error.title")}),x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("strong",{children:e("bpr.form.publication.response.error.content")})}),x.jsxs("ul",{children:[r(t.title)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.title")})}),r(t.description)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.description")})})]})]})}function H6({result:t}){const{t:e}=Ce();return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.success.title")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.1")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.2")}),t.details.front_url&&x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("a",{className:"button right-magnet",href:t.details.front_url,target:"_blank",rel:"noreferrer",children:e("bpr.form.publication.response.success.button")})})]})}function V6({onSuccess:t,resource:e}){const{user:r,appCode:i}=mt(),s=ru(),[n,a]=E.useState(e.thumbnail||""),{control:o,register:l,watch:c,setValue:h,handleSubmit:f,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m}}=Yy({mode:"onChange"}),[g,y]=E.useState([]),[_,v]=E.useState([]),b=(w,A,T)=>{let C=[...A];const S=C.findIndex(M=>M===w);A.includes(w)?C=A.filter((M,I)=>I!==S):C=[...A,w],T(C)};return{control:o,cover:n,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m},handleDeleteImage:()=>a(""),handlePublish:async w=>{const A=r?r==null?void 0:r.userId:"";try{let T=new Blob;typeof n=="string"?T=await Me.http().get(n,{responseType:"blob"}):n?T=await Me.http().get(URL.createObjectURL(n),{responseType:"blob"}):e.thumbnail&&(T=await Me.http().get(e.thumbnail,{responseType:"blob"}));const C=await Me.http().get(`/userbook/avatar/${A}?thumbnail=48x48`,{responseType:"blob"}),S=await Me.http().get(`/directory/user/${A}/attachment-school`,{responseType:"json"}),M=Gw[i],I={activityType:g,age:[w.ageMin,w.ageMax],application:M,cover:T,description:w.description,keyWords:w.keyWords,language:w.language,licence:"CC-BY",resourceId:e.assetId,resourceEntId:e.assetId,subjectArea:_,teacherAvatar:C,title:w.title,userId:A,userStructureName:S.name||(r==null?void 0:r.structureNames[0])},D=await Me.resource(i).publish(I);D.success?s.success(x.jsx(H6,{result:D}),{duration:1e4}):s.error(x.jsx(Py,{formData:w})),t==null||t()}catch(T){console.error(T),s.error(x.jsx(Py,{formData:w}))}},handleSubmit:f,handleUploadImage:w=>a(w),register:l,selectActivities:w=>{b(w,g,y)},selectedActivities:g,selectedSubjectAreas:_,selectSubjects:w=>{b(w,_,v)},setValue:h,watch:c}}function t8({isOpen:t,resource:e,onSuccess:r,onCancel:i}){const{currentApp:s}=mt(),{t:n}=Ce(),{control:a,cover:o,formState:{isDirty:l,isValid:c,isSubmitting:h},handleDeleteImage:f,handleSubmit:u,handleUploadImage:d,handlePublish:p,register:m,selectActivities:g,selectedActivities:y,selectedSubjectAreas:_,selectSubjects:v}=V6({resource:e,onSuccess:r}),b="bpr.form.publication.age.min",w="bpr.form.publication.age.max";return rs.createPortal(x.jsxs(je,{isOpen:t,onModalClose:i,id:"libraryModal",size:"lg",children:[x.jsx(je.Header,{onModalClose:i,children:n("bpr.publish")}),x.jsx(je.Subtitle,{children:n("bpr.form.tip")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.heading.general")}),x.jsxs("form",{id:"libraryModalForm",onSubmit:u(p),children:[x.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[x.jsxs("div",{style:{maxWidth:"160px"},children:[x.jsx("div",{className:"form-label",children:n("bpr.form.publication.cover.title")}),x.jsx(Kw,{app:s,src:e.thumbnail,label:n("bpr.form.publication.cover.upload.label"),addButtonLabel:n("bpr.form.publication.cover.upload.add"),deleteButtonLabel:n("bpr.form.publication.cover.upload.remove"),onUploadImage:d,onDeleteImage:f,className:"align-self-center"}),!o&&x.jsx("p",{className:"form-text is-invalid",children:x.jsx("em",{children:n("bpr.form.publication.cover.upload.required.image")})})]}),x.jsxs("div",{className:"flex-fill",children:[x.jsxs(ft,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.title")}),x.jsx(da,{type:"text",defaultValue:e.name,...m("title",{required:!0}),placeholder:n("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ft,{id:"description",isRequired:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.description")}),x.jsx(rE,{...m("description",{required:!0}),placeholder:n("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.heading.infos")}),x.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[x.jsx(L6,{control:a,selectedActivities:y,selectActivities:g}),x.jsx(z6,{control:a,selectedSubjectAreas:_,selectSubjects:v}),x.jsx(j6,{control:a})]}),x.jsxs("div",{className:"mb-24",children:[x.jsx("label",{htmlFor:"",className:"form-label",children:n("bpr.form.publication.age")}),x.jsxs("div",{className:"d-flex gap-8",children:[x.jsx("div",{className:"col col-2",children:x.jsx(Ry,{control:a,name:"ageMin",placeholderOption:b,validate:(A,T)=>parseInt(A)<=parseInt(T.ageMax)})}),x.jsx("div",{className:"col col-2",children:x.jsx(Ry,{control:a,name:"ageMax",placeholderOption:w,validate:(A,T)=>parseInt(A)>=parseInt(T.ageMin)})})]})]}),x.jsx("div",{className:"mb-24",children:x.jsxs(ft,{id:"keywords",isOptional:!0,children:[x.jsx(Nn,{children:n("bpr.form.publication.keywords")}),x.jsx(da,{type:"text",...m("keyWords"),size:"md",placeholder:n("bpr.form.publication.keywords.placeholder")})]})}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("bpr.form.publication.licence.text")}),x.jsx($6,{})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:i,type:"button",variant:"ghost",children:n("cancel")}),x.jsx(tt,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:h,disabled:!o||h||!l||!c,children:n("bpr.form.submit")})]})]}),document.getElementById("portal"))}const My=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function W6(t,e){e?e={...My,...e}:e=My;const r=iE(e);return r.dispatch(t),r.toString()}const X6=Object.freeze(["prototype","__proto__","constructor"]);function iE(t){let e="",r=new Map;const i=s=>{e+=s};return{toString(){return e},getContext(){return r},dispatch(s){return t.replacer&&(s=t.replacer(s)),this[s===null?"null":typeof s](s)},object(s){if(s&&typeof s.toJSON=="function")return this.object(s.toJSON());const n=Object.prototype.toString.call(s);let a="";const o=n.length;o<10?a="unknown:["+n+"]":a=n.slice(8,o-1),a=a.toLowerCase();let l=null;if((l=r.get(s))===void 0)r.set(s,r.size);else return this.dispatch("[CIRCULAR:"+l+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return i("buffer:"),i(s.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this[a]?this[a](s):t.ignoreUnknown||this.unkown(s,a);else{let c=Object.keys(s);t.unorderedObjects&&(c=c.sort());let h=[];t.respectType!==!1&&!Oy(s)&&(h=X6),t.excludeKeys&&(c=c.filter(u=>!t.excludeKeys(u)),h=h.filter(u=>!t.excludeKeys(u))),i("object:"+(c.length+h.length)+":");const f=u=>{this.dispatch(u),i(":"),t.excludeValues||this.dispatch(s[u]),i(",")};for(const u of c)f(u);for(const u of h)f(u)}},array(s,n){if(n=n===void 0?t.unorderedArrays!==!1:n,i("array:"+s.length+":"),!n||s.length<=1){for(const l of s)this.dispatch(l);return}const a=new Map,o=s.map(l=>{const c=iE(t);c.dispatch(l);for(const[h,f]of c.getContext())a.set(h,f);return c.toString()});return r=a,o.sort(),this.array(o,!1)},date(s){return i("date:"+s.toJSON())},symbol(s){return i("symbol:"+s.toString())},unkown(s,n){if(i(n),!!s&&(i(":"),s&&typeof s.entries=="function"))return this.array(Array.from(s.entries()),!0)},error(s){return i("error:"+s.toString())},boolean(s){return i("bool:"+s)},string(s){i("string:"+s.length+":"),i(s)},function(s){i("fn:"),Oy(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this.object(s)},number(s){return i("number:"+s)},xml(s){return i("xml:"+s.toString())},null(){return i("Null")},undefined(){return i("Undefined")},regexp(s){return i("regex:"+s.toString())},uint8array(s){return i("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},uint8clampedarray(s){return i("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},int8array(s){return i("int8array:"),this.dispatch(Array.prototype.slice.call(s))},uint16array(s){return i("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},int16array(s){return i("int16array:"),this.dispatch(Array.prototype.slice.call(s))},uint32array(s){return i("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},int32array(s){return i("int32array:"),this.dispatch(Array.prototype.slice.call(s))},float32array(s){return i("float32array:"),this.dispatch(Array.prototype.slice.call(s))},float64array(s){return i("float64array:"),this.dispatch(Array.prototype.slice.call(s))},arraybuffer(s){return i("arraybuffer:"),this.dispatch(new Uint8Array(s))},url(s){return i("url:"+s.toString())},map(s){i("map:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},set(s){i("set:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},file(s){return i("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},blob(){if(t.ignoreUnknown)return i("[blob]");throw new Error(`Hashing Blob objects is currently not supported
|
|
1346
1346
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
1347
|
-
`)},domwindow(){return i("domwindow")},bigint(s){return i("bigint:"+s.toString())},process(){return i("process")},timer(){return i("timer")},pipe(){return i("pipe")},tcp(){return i("tcp")},udp(){return i("udp")},tty(){return i("tty")},statwatcher(){return i("statwatcher")},securecontext(){return i("securecontext")},connection(){return i("connection")},zlib(){return i("zlib")},context(){return i("context")},nodescript(){return i("nodescript")},httpparser(){return i("httpparser")},dataview(){return i("dataview")},signal(){return i("signal")},fsevent(){return i("fsevent")},tlswrap(){return i("tlswrap")}}}const sE="[native code] }",Y6=sE.length;function Oy(t){return typeof t!="function"?!1:Function.prototype.toString.call(t).slice(-Y6)===sE}class Zi{constructor(e,r){e=this.words=e||[],this.sigBytes=r===void 0?e.length*4:r}toString(e){return(e||q6).stringify(this)}concat(e){if(this.clamp(),this.sigBytes%4)for(let r=0;r<e.sigBytes;r++){const i=e.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=i<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<e.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=e.words[r>>>2];return this.sigBytes+=e.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new Zi([...this.words])}}const q6={stringify(t){const e=[];for(let r=0;r<t.sigBytes;r++){const i=t.words[r>>>2]>>>24-r%4*8&255;e.push((i>>>4).toString(16),(i&15).toString(16))}return e.join("")}},Z6={stringify(t){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[];for(let i=0;i<t.sigBytes;i+=3){const s=t.words[i>>>2]>>>24-i%4*8&255,n=t.words[i+1>>>2]>>>24-(i+1)%4*8&255,a=t.words[i+2>>>2]>>>24-(i+2)%4*8&255,o=s<<16|n<<8|a;for(let l=0;l<4&&i*8+l*6<t.sigBytes*8;l++)r.push(e.charAt(o>>>6*(3-l)&63))}return r.join("")}},K6={parse(t){const e=t.length,r=[];for(let i=0;i<e;i++)r[i>>>2]|=(t.charCodeAt(i)&255)<<24-i%4*8;return new Zi(r,e)}},Q6={parse(t){return K6.parse(unescape(encodeURIComponent(t)))}};class J6{constructor(){this._data=new Zi,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new Zi,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=Q6.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_doProcessBlock(e,r){}_process(e){let r,i=this._data.sigBytes/(this.blockSize*4);e?i=Math.ceil(i):i=Math.max((i|0)-this._minBufferSize,0);const s=i*this.blockSize,n=Math.min(s*4,this._data.sigBytes);if(s){for(let a=0;a<s;a+=this.blockSize)this._doProcessBlock(this._data.words,a);r=this._data.words.splice(0,s),this._data.sigBytes-=n}return new Zi(r,n)}}class eU extends J6{update(e){return this._append(e),this._process(),this}finalize(e){e&&this._append(e)}}const ky=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],tU=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],fs=[];class rU extends eU{constructor(){super(...arguments),this._hash=new Zi([...ky])}reset(){super.reset(),this._hash=new Zi([...ky])}_doProcessBlock(e,r){const i=this._hash.words;let s=i[0],n=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],f=i[7];for(let u=0;u<64;u++){if(u<16)fs[u]=e[r+u]|0;else{const v=fs[u-15],b=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,w=fs[u-2],A=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;fs[u]=b+fs[u-7]+A+fs[u-16]}const d=l&c^~l&h,p=s&n^s&a^n&a,m=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),g=(l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25),y=f+g+d+tU[u]+fs[u],_=m+p;f=h,h=c,c=l,l=o+y|0,o=a,a=n,n=s,s=y+_|0}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+a|0,i[3]=i[3]+o|0,i[4]=i[4]+l|0,i[5]=i[5]+c|0,i[6]=i[6]+h|0,i[7]=i[7]+f|0}finalize(e){super.finalize(e);const r=this._nDataBytes*8,i=this._data.sigBytes*8;return this._data.words[i>>>5]|=128<<24-i%32,this._data.words[(i+64>>>9<<4)+14]=Math.floor(r/4294967296),this._data.words[(i+64>>>9<<4)+15]=r,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function iU(t){return new rU().finalize(t).toString(Z6)}function nE(t,e={}){const r=typeof t=="string"?t:W6(t,e);return iU(r).slice(0,10)}var aE={};Object.defineProperty(aE,"__esModule",{value:!0});const sU=t=>{const e="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",r="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",i=e.split("").join("|"),s=new RegExp(`(${i})`,"g");function n(a){return r[e.indexOf(a)]||""}return t.replace(s,n)},nU=t=>t.split("").map(e=>`\\${e}`).join(""),Dy=(t,e,r=!1)=>{const i=sU(t).trim().toLowerCase(),s=nU(e);return r?i.replace(/\s+/g,e):i.replace(new RegExp(`[^a-z0-9${s}]+`,"g"),e).replace(new RegExp(`${s}+`,"g"),e).replace(new RegExp(`^${s}`,"g"),"").replace(new RegExp(`${s}$`,"g"),"")},qa=(t,e={delimiter:"-",prefix:""})=>{if(e.delimiter||(e.delimiter="-"),e.prefix||(e.prefix=""),!t||typeof t=="boolean")return"";const{delimiter:r,prefix:i}=e;if(typeof t=="boolean")return"";if(typeof t=="string"||typeof t=="number"){const s=Dy(i,r,!0),n=Dy(String(t),r);return s?`${s}${r}${n}`:n}return"children"in t?qa(t.children):"type"in t?qa(t.props.children,e):Symbol.iterator in t?qa(Array.from(t).map(s=>qa(s,{delimiter:r})).join(r),e):""};var oE=aE.default=qa;const aU=({watch:t,selectedResource:e})=>{const[r,i]=E.useState(""),[s,n]=E.useState(!!(e!=null&&e.public)||!1),a=E.useId(),o=t("title"),{t:l}=Ce(),c=ru(),h=`${nE({foo:`${o}${a}`})}-${oE(o)}`;E.useEffect(()=>{if(s){let d="";e&&e.slug?d=e.slug:d=h,i(d)}},[s,e,o,a,h]);function f(d){n(d)}function u(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${r}`),c.success(l("explorer.copy.clipboard"))}return{slug:r,uniqueId:a,isPublic:s,resourceName:o,onPublicChange:f,onCopyToClipBoard:u}},oU=({isUpdating:t,selectedResource:e})=>{const[r,i]=E.useState(t&&(e==null?void 0:e.thumbnail)||"");return{thumbnail:r,handleDeleteImage:()=>i(""),handleUploadImage:s=>i(s)}},lU=({appCode:t,isPublic:e,onCopyToClipBoard:r,onPublicChange:i,register:s,slug:n,resourceName:a})=>{const{t:o}=Ce();return x.jsxs(x.Fragment,{children:[x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:[o("explorer.resource.editModal.heading.access"),t]}),x.jsx(zi,{type:"info",children:o("explorer.resource.editModal.access.alert")}),x.jsxs(ft,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[x.jsx(ft.Input,{type:"checkbox",role:"switch",...s("enablePublic",{disabled:!e&&!a,onChange:l=>{i(l.target.checked)}}),className:"form-check-input mt-0",size:"md"}),x.jsx(ft.Label,{className:"form-check-label mb-0",children:o("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),e&&x.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[x.jsxs("p",{className:"text-break",children:[window.location.origin,window.location.pathname,"/pub/",n]}),x.jsx(tt,{color:"primary",disabled:!e,onClick:r,type:"button",leftIcon:x.jsx(dE,{}),variant:"ghost",className:"text-nowrap",children:o("explorer.resource.editModal.access.url.button")})]})]})},cU=({isOpen:t,actions:e,onCancel:r,onSuccess:i,...s})=>{var n,a,o,l,c,h;const{appCode:f,currentApp:u}=mt(),{t:d}=Ce(),{mode:p}=s,m=E.useId(),g=p==="create",y=p==="update",{watch:_,register:v,handleSubmit:b,formState:{isSubmitting:w,isValid:A}}=Yy({mode:"onChange",defaultValues:{description:y?(n=s.selectedResource)==null?void 0:n.description:"",enablePublic:y?(a=s.selectedResource)==null?void 0:a.public:!1,title:y?(o=s.selectedResource)==null?void 0:o.name:""}}),{slug:T,uniqueId:C,isPublic:S,resourceName:M,onPublicChange:I,onCopyToClipBoard:D}=aU({watch:_,selectedResource:y?s.selectedResource:void 0}),R=ru(),{thumbnail:P,handleDeleteImage:O,handleUploadImage:N}=oU({isUpdating:y,selectedResource:y?s.selectedResource:void 0}),L=async function(B){var U,F;try{const j={description:B.description||"",name:B.title,public:B.enablePublic,thumbnail:P},z=`${nE({foo:`${B.title}${C}`})}-${oE(B.title)}`;g?await s.createResource.mutateAsync({...j,folder:((U=s.currentFolder)==null?void 0:U.id)==="default"?void 0:parseInt(((F=s.currentFolder)==null?void 0:F.id)||""),slug:B.enablePublic?z:"",application:f}):await s.updateResource.mutateAsync({...j,slug:B.enablePublic?s.selectedResource&&s.selectedResource.slug?s.selectedResource.slug:z:"",entId:s.selectedResource.assetId,trashed:s.selectedResource.trashed}),R.success(x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:d(g?"explorer.resource.created":"explorer.resource.updated")}),x.jsxs("p",{children:[d("title")," : ",B.title]}),x.jsxs("p",{children:[d("description")," : ",B.description]}),f==="blog"&&x.jsxs("p",{children:["Public:",B.enablePublic?d("explorer.enable.public.yes"):d("explorer.enable.public.no")]})]})),i()}catch(j){console.error(j)}};return rs.createPortal(x.jsxs(je,{id:`${p}-resource`,size:"lg",isOpen:t,onModalClose:r,children:[x.jsx(je.Header,{onModalClose:r,children:d(`explorer.resource.editModal.header.${g?"create":"edit"}`)}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:d("explorer.resource.editModal.heading.general")}),x.jsxs("form",{id:m,onSubmit:b(L),children:[x.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[x.jsx("div",{children:x.jsx(Kw,{app:u,src:y&&((l=s.selectedResource)==null?void 0:l.thumbnail)||"",label:d("explorer.imagepicker.label"),addButtonLabel:d("explorer.imagepicker.button.add"),deleteButtonLabel:d("explorer.imagepicker.button.delete"),onUploadImage:N,onDeleteImage:O,className:"align-self-center mt-8"})}),x.jsxs("div",{className:"col",children:[x.jsxs(ft,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:d("title")}),x.jsx(da,{type:"text",defaultValue:y?(c=s.selectedResource)==null?void 0:c.name:"",...v("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:d("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ft,{id:"description",isOptional:!0,children:[x.jsx(Nn,{children:d("description")}),x.jsx(rE,{defaultValue:y?(h=s.selectedResource)==null?void 0:h.description:"",...v("description"),placeholder:d("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),f==="blog"&&z4("createPublic",e)&&x.jsx(lU,{appCode:f,isPublic:S,slug:T,onCopyToClipBoard:D,onPublicChange:I,register:v,resourceName:M})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:d("explorer.cancel")}),x.jsx(tt,{form:m,type:"submit",color:"primary",isLoading:w,variant:"filled",disabled:!A||w,children:d(g?"explorer.create":"save")})]})]}),document.getElementById("portal"))},r8=cU;function hU({radioPublicationValue:t,onRadioPublicationChange:e}){const{appCode:r}=mt(),{t:i}=Ce(r);return x.jsxs(x.Fragment,{children:[x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("explorer.publication.steps")}),x.jsx(_p,{label:i("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:t,checked:t==="IMMEDIATE",onChange:s=>e(s.target.value)}),x.jsx(_p,{label:i("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:t==="RESTRAINT",model:t,onChange:s=>e(s.target.value)})]})}const uU={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function dU(t,e){switch(e.type){case"onChange":return{...t,searchInputValue:e.payload};case"isSearching":return{...t,isSearching:e.payload};case"addResult":return{...t,searchResults:e.payload};case"addApiResult":return{...t,searchAPIResults:e.payload};case"updateSearchResult":return{...t,searchResults:e.payload};case"emptyResult":return{...t,searchResults:e.payload};default:throw new Error("Unhandled action type")}}const Ad=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],fU=({resource:t,shareRights:e,shareDispatch:r})=>{const[i,s]=E.useReducer(dU,uU),n=W4(i.searchInputValue,500),{isAdml:a}=r5(),{appCode:o}=mt(),{t:l}=Ce();E.useEffect(()=>{h(n)},[n]);const c=f=>{const u=f.target.value;s({type:"onChange",payload:u})},h=async f=>{if(s({type:"isSearching",payload:!0}),!a&&f.length>=1||a&&f.length>=3){const u=await Me.share().searchShareSubjects(o,t.assetId,f);s({type:"addApiResult",payload:u});const d=u.filter(p=>!e.rights.find(m=>m.id===p.id)).filter(p=>!(p.type==="user"&&p.id===t.creatorId)).map(p=>{let m=p.displayName;return p.type==="user"&&p.profile?m=`${m} (${l(p.profile)})`:p.type==="group"&&p.structureName?m=`${m} (${p.structureName})`:p.type==="sharebookmark"&&(m=`${m} (${l("sharebookmark")})`),{value:p.id,label:m,icon:p.type==="sharebookmark"?x.jsx(wp,{}):null}});s({type:"addResult",payload:d})}else s({type:"emptyResult",payload:[]}),Promise.resolve();s({type:"isSearching",payload:!1})};return{state:i,showSearchAdmlHint:()=>a&&i.searchInputValue.length<3,showSearchLoading:()=>i.isSearching,showSearchNoResults:()=>!i.isSearching&&!a&&n.length>0&&i.searchResults.length===0||!i.isSearching&&a&&n.length>3&&i.searchResults.length===0,getSearchMinLength:()=>a?3:1,handleSearchInputChange:c,handleSearchResultsChange:async f=>{const u=i.searchAPIResults.find(d=>d.id===f[0]);if(u){let d=[];if(u.type==="sharebookmark"){const p=await Me.directory().getBookMarkById(u.id);d.push({...p,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:Ad}),p==null||p.users.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"user",avatarUrl:"",directoryUrl:"",actions:Ad,isBookmarkMember:!0})}),p.groups.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"group",avatarUrl:"",directoryUrl:"",actions:Ad,isBookmarkMember:!0})})}else d=[{...u,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];r({type:"updateShareRights",payload:{...e,rights:[...e.rights,...d]}}),s({type:"updateSearchResult",payload:i.searchResults.filter(p=>p.value!==f[0])})}}}},pU={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function mU(t,e){switch(e.type){case"init":return{...t,...e.payload};case"deleteRow":return{...t,shareRights:e.payload};case"updateShareRights":return{...t,shareRights:e.payload};case"toggleRight":return{...t,shareRights:e.payload};case"isSharing":return{...t,isSharing:!0};default:throw new Error("Unhandled action type")}}function gU({onSuccess:t,resource:e,updateResource:r,shareResource:i}){const{appCode:s}=mt(),{user:n,avatar:a}=Vw(),[o,l]=E.useReducer(mU,pU);return E.useEffect(()=>{(async()=>{const c=await Me.share().getActionsForApp(s),h=await Me.share().getRightsForResource(s,e.assetId);l({type:"init",payload:{shareRightActions:c,shareRights:h}})})()},[]),{state:o,dispatch:l,currentIsAuthor:()=>!!(e&&e.creatorId===(n==null?void 0:n.userId)),myAvatar:a,handleDeleteRow:c=>{l({type:"deleteRow",payload:{...o.shareRights,rights:o.shareRights.rights.filter(h=>{var f,u;return h.id!==c.id&&!((f=c.users)!=null&&f.find(d=>d.id===h.id))&&!((u=c.groups)!=null&&u.find(d=>d.id===h.id))})}})},handleShare:async c=>{l({type:"isSharing",payload:!0});try{const h=e.rights.filter(u=>n&&u.includes(`user:${n.userId}`)).map(u=>u.split(":")[2]).filter(u=>!!u),f=[...o.shareRights.rights];if(h.length>0){const u=h.map(d=>({displayName:d,id:d}));f.push({actions:u,avatarUrl:"",directoryUrl:"",displayName:n.username,id:n.userId,type:"user"})}s==="blog"?await r.mutateAsync(c):await r.mutateAsync({entId:e.assetId||"",trashed:e.trashed||!1,name:e.name||"",thumbnail:e.thumbnail||"",description:e.description||"",public:e.public||!1,slug:e.slug||""}),await i.mutateAsync({resourceId:e.assetId,rights:f}),t==null||t()}catch(h){console.error("Failed to save share",h)}finally{l({type:"isSharing",payload:!1})}},toggleRight:(c,h)=>{var f,u;const{rights:d,...p}=o.shareRights,m=[...d],g=m.findIndex(_=>_.id===c.id),y=o.shareRightActions.filter(_=>_.id===h)[0];if(m[g].actions.findIndex(_=>_.id===h)>-1){let _=m[g].actions.filter(b=>b.id!==h);const v=o.shareRightActions.filter(b=>{var w;return(w=b.requires)==null?void 0:w.includes(h)});_=_.filter(b=>!v.find(w=>w.id===b.id)),m[g]={...m[g],actions:_}}else{const _=o.shareRightActions.filter(v=>{var b;return((b=y.requires)==null?void 0:b.includes(v.id))&&!m[g].actions.find(w=>w.id===v.id)});m[g]={...m[g],actions:[...m[g].actions,y,..._]}}c.type==="sharebookmark"&&((f=m[g].users)==null||f.forEach(_=>{const v=m.findIndex(b=>b.id===_.id);m[v]={...m[v],actions:m[g].actions}}),(u=m[g].groups)==null||u.forEach(_=>{const v=m.findIndex(b=>b.id===_.id);m[v]={...m[v],actions:m[g].actions}})),l({type:"toggleRight",payload:{rights:m,...p}})}}}function vU({resource:t}){const{assetId:e,description:r,thumbnail:i,name:s,public:n,trashed:a,slug:o,"publish-type":l}=t||{"publish-type":"",assetId:"",description:"",name:"",public:!1,slug:"",thumbnail:"",trashed:!1},[c,h]=E.useState(l||"RESTRAINT"),[f,u]=E.useState({description:r||"",entId:e,name:s,public:!!n,slug:o||"",thumbnail:i,trashed:a,"publish-type":l});return E.useEffect(()=>{c&&u(d=>({...d,"publish-type":c}))},[c]),{radioPublicationValue:c,shareBlogPayload:f,handleRadioPublicationChange:async d=>{h(d)}}}const yU=({shareRights:t,shareDispatch:e})=>{const r=ru(),{t:i}=Ce(),s=E.useRef(null),[n,a]=E.useState({name:"",id:E.useId()}),[o,l]=J4(!1),[c,h]=E.useState(!1),f=()=>{l()},u=()=>{a(p=>{var m;return{...p,name:((m=s.current)==null?void 0:m.value)||""}})},d=async p=>{try{const m=await Me.directory().saveBookmarks(p,{users:t.rights.filter(g=>g.type==="user").map(g=>g.id),groups:t.rights.filter(g=>g.type==="group").map(g=>g.id),bookmarks:t.rights.filter(g=>g.type==="sharebookmark").map(g=>g.id)});r.success(i("explorer.bookmarked.status.saved")),e({type:"updateShareRights",payload:{...t,visibleBookmarks:[...t.visibleBookmarks,{displayName:p,id:m.id}]}}),a(g=>({...g,bookmarkId:g.id+new Date().getTime().toString()})),h(!1)}catch(m){console.error("Failed to save bookmark",m),r.error(i("explorer.bookmarked.status.error"))}};return{refBookmark:s,showBookmark:o,showBookmarkInput:c,bookmark:n,handleBookmarkChange:u,setBookmark:a,handleOnSave:()=>{var p;const m=((p=s.current)==null?void 0:p.value)||"";d(m)},toggleBookmark:f,toggleBookmarkInput:h}},bU=({bookmark:t,refBookmark:e,onBookmarkChange:r,onSave:i})=>{const{t:s}=Ce();return x.jsx("div",{className:"mt-16",children:x.jsxs(ft,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[x.jsx("div",{className:"flex-fill",children:x.jsx(ft.Input,{ref:e,onChange:r,placeholder:s("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},t.id)}),x.jsx(tt,{type:"button",color:"primary",variant:"ghost",disabled:t.name.length===0,leftIcon:x.jsx(cE,{}),onClick:i,className:"text-nowrap",children:s("explorer.modal.share.sharebookmark.save")})]})})},xU=(t,e)=>t.actions.filter(r=>e.id===r.id).length>0,_U=(t,e)=>t.isBookmarkMember&&e||!t.isBookmarkMember,wU=({shareRights:t,showBookmark:e,toggleBookmark:r,shareRightActions:i,toggleRight:s,onDeleteRow:n})=>{const{t:a}=Ce();return t==null?void 0:t.rights.map(o=>_U(o,e)&&x.jsxs("tr",{className:o.isBookmarkMember?"bg-light":"",children:[x.jsxs("td",{children:[o.type!=="sharebookmark"&&x.jsx(ua,{alt:a("explorer.modal.share.avatar.shared.alt"),size:"xs",src:o.avatarUrl,variant:"circle"}),o.type==="sharebookmark"&&x.jsx(wp,{})]}),x.jsx("td",{children:x.jsxs("div",{className:"d-flex",children:[o.type==="sharebookmark"&&x.jsx(tt,{color:"tertiary",rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:e?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:r,children:o.displayName}),o.type!=="sharebookmark"&&o.displayName,o.type==="user"&&` (${a(o.profile||"")})`]})}),i.map(l=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:xU(o,l),onChange:()=>s(o,l.id)})},l.displayName)),x.jsx("td",{children:!o.isBookmarkMember&&x.jsx(Qs,{"aria-label":"Delete",color:"tertiary",icon:x.jsx(Zy,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>n(o)})})]},o.id))};function i8({isOpen:t,resource:e,updateResource:r,shareResource:i,onSuccess:s,onCancel:n}){const{appCode:a}=mt(),{radioPublicationValue:o,shareBlogPayload:l,handleRadioPublicationChange:c}=vU({resource:e}),{state:{isSharing:h,shareRights:f,shareRightActions:u},dispatch:d,myAvatar:p,currentIsAuthor:m,handleShare:g,toggleRight:y,handleDeleteRow:_}=gU({resource:e,updateResource:r,shareResource:i,onSuccess:s}),{state:{searchResults:v,searchInputValue:b},showSearchAdmlHint:w,showSearchLoading:A,showSearchNoResults:T,getSearchMinLength:C,handleSearchInputChange:S,handleSearchResultsChange:M}=fU({resource:e,shareRights:f,shareDispatch:d}),{refBookmark:I,showBookmark:D,handleBookmarkChange:R,toggleBookmark:P,bookmark:O,handleOnSave:N,showBookmarkInput:L,toggleBookmarkInput:B}=yU({shareRights:f,shareDispatch:d}),{t:U}=Ce(),F=w()?U("explorer.search.adml.hint"):U("explorer.modal.share.search.placeholder");return rs.createPortal(x.jsxs(je,{id:"share_modal",size:"lg",isOpen:t,onModalClose:n,children:[x.jsx(je.Header,{onModalClose:n,children:U("share.title")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:U("explorer.modal.share.usersWithAccess")}),x.jsx("div",{className:"table-responsive",children:x.jsxs("table",{className:"table border align-middle mb-0",children:[x.jsx("thead",{className:"bg-secondary",children:x.jsxs("tr",{children:[x.jsx("th",{scope:"col",className:"w-32",children:x.jsx(Hi,{children:U("explorer.modal.share.avatar.shared.alt")})}),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:U("explorer.modal.share.search.placeholder")})}),u.map(j=>x.jsx("th",{scope:"col",className:"text-center text-white",children:U(j.displayName)},j.displayName)),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:U("close")})})]})}),x.jsxs("tbody",{children:[m()&&x.jsxs("tr",{children:[x.jsx("th",{scope:"row",children:x.jsx(ua,{alt:U("explorer.modal.share.avatar.me.alt"),size:"xs",src:p,variant:"circle"})}),x.jsx("td",{children:U("share.me")}),u.map(j=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:!0,disabled:!0})},j.displayName)),x.jsx("td",{})]}),x.jsx(wU,{showBookmark:D,shareRightActions:u,shareRights:f,onDeleteRow:_,toggleRight:y,toggleBookmark:P})]})]})}),x.jsxs("div",{className:"mt-16",children:[x.jsx(tt,{color:"tertiary",leftIcon:x.jsx(wp,{}),rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:L?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>B(!L),children:U("share.save.sharebookmark")}),L&&x.jsx(bU,{refBookmark:I,bookmark:O,onBookmarkChange:R,onSave:N})]}),x.jsx("hr",{}),x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[x.jsx("div",{className:"me-8",children:U("explorer.modal.share.search")}),x.jsx(M5,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:x.jsx(qy,{className:"c-pointer",height:"18"})})]}),x.jsx("div",{className:"row",children:x.jsx("div",{className:"col-10",children:x.jsx(i6,{value:b,placeholder:F,isLoading:A(),noResult:T(),options:v,searchMinLength:C(),onSearchInputChange:S,onSearchResultsChange:M})})}),a==="blog"&&x.jsx(hU,{radioPublicationValue:o,onRadioPublicationChange:c})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:n,children:U("explorer.cancel")}),x.jsx(tt,{type:"button",color:"primary",variant:"filled",isLoading:h,onClick:()=>g(l),disabled:h,children:U("share")})]})]}),document.getElementById("portal"))}function Cd({children:t}){return x.jsx("span",{className:"position-absolute badge rounded-pill bg-warning",children:t})}function Id({children:t,className:e,...r}){const i=re("navbar",e);return x.jsx("nav",{className:i,...r,children:t})}function Ny({children:t,className:e,...r}){const i=re("navbar-nav",e);return x.jsx("ul",{className:i,...r,children:t})}const Ge=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("nav-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})});function La({link:t,className:e,children:r,translate:i,...s}){const n=re("nav-link",e);return x.jsxs("a",{href:t,className:n,...s,children:[r,i&&x.jsx(Hi,{children:x.jsx("span",{className:"nav-text",children:i})})]})}const EU=()=>{const{t}=Ce();return x.jsx("div",{className:"widget-footer",children:x.jsx("div",{className:"widget-footer-action",children:x.jsx("a",{href:"/welcome",className:"link",children:t("plus")})})})},TU=({bookmarkedApps:t})=>{const{t:e}=Ce();return x.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!t.length&&x.jsx("div",{className:"text-dark",children:e("navbar.myapps.more")}),t.slice(0,6).map((r,i)=>x.jsx("a",{href:r.address,className:"bookmarked-app",children:x.jsx(Ho,{app:r,size:"32"})},i))]})};function Ly({isHelpOpen:t,setIsHelpOpen:e,parsedHeadline:r,parsedContent:i,error:s}){const{t:n}=Ce(),a=()=>{e(!1)};return t?rs.createPortal(x.jsxs(je,{id:"help-modal",isOpen:t,onModalClose:a,scrollable:!0,size:"lg",children:[x.jsx(je.Header,{onModalClose:a,children:n("navbar.help")}),x.jsx(je.Subtitle,{children:s?n("help.notfound.title"):r}),x.jsx(je.Body,{className:s?"d-flex":null,children:s?n("help.notfound.text"):i})]}),document.getElementById("portal")):null}function SU(){var t,e,r,i,s;const{appCode:n}=mt(),{theme:a}=Om(),[o,l]=E.useState(""),[c,h]=E.useState(!0),[f,u]=E.useState(!1),[d,p]=E.useState(!1),m=a!=null&&a.is1d?"/help-1d":"/help-2d";E.useEffect(()=>{(async()=>{let v="";v=m+"/application/"+n+"/",!n&&window.location.pathname!=="/adapter"?v=m+"/application/portal/":window.location.pathname==="/adapter"?v=m+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?v=m+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(v=m+"/application/userbook/");try{const b=await fetch(v),w=await b.text();if(b.status===404){p(!0);return}l(w),p(!1)}catch(b){p(!0),console.error(b)}})()},[n,m]);const g=os(o,{replace:v=>{const b=v;if(b.attribs&&b.attribs.id==="TOC")return x.jsxs("nav",{id:"TOC",children:[x.jsx(tt,{onClick:()=>{h(!c)},children:x.jsx(wE,{})}),Pl(b.children,{replace:w=>{const A=w;if(A.attribs&&A.name==="ul")return x.jsx("ul",{id:"TOC-list",style:{display:c?"block":"none"},children:Pl(A.children,{replace:T=>{const C=T;if(C.attribs&&C.name==="a")return x.jsx("a",{...Au(C.attribs),children:x.jsx("span",{onClick:()=>{h(!1)},children:Pl(C.children)})})}})})}})]});if(b.attribs&&b.attribs.class==="section level2"){const w=Au(v.attribs);return x.jsx("div",{...w,className:"section level2",style:{display:b.attribs.id!=="présentation"?"none":"block"},children:Pl(b.children,{replace:A=>{const T=A;if(T.attribs&&T.name==="img"){const C=A.attribs.src;return x.jsx("img",{...Au(T.attribs),src:`${m}/${C}`,alt:""})}}})})}}}),y=(r=(e=(t=g==null?void 0:g.props)==null?void 0:t.children.find(v=>v.type==="body"))==null?void 0:e.props)==null?void 0:r.children,_=(s=(i=y==null?void 0:y.find(v=>v.type==="p"))==null?void 0:i.props)==null?void 0:s.children;return{html:o,visibility:c,isModalOpen:f,setIsModalOpen:u,parsedContent:y,parsedHeadline:_,error:d}}const AU=()=>{const[t,e]=Hw(),r=E.useRef(null),i=E.useId(),{t:s}=Ce();function n(){if(r.current){const a=r.current.value;window.location.href=`/searchengine#/${a}`}}return x.jsxs(Ge,{id:i,ref:t,className:"position-relative","aria-haspopup":"true","aria-expanded":e,children:[x.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[x.jsx(F2,{className:"icon search"}),x.jsx("span",{className:"nav-text",children:s("navbar.search")})]}),x.jsx(eE,{id:i,isVisible:e,className:"d-none d-md-flex",children:x.jsxs(ft,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[x.jsx(ft.Input,{ref:r,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),x.jsx(k4,{type:"submit",size:"sm",onClick:n,"aria-label":s("navbar.search")})]})})]})},CU=AU,IU=({is1d:t=!1,src:e=""})=>{const{t:r}=Ce(),{messages:i,msgLink:s,zimbraWorkflow:n}=V4(),{user:a,avatar:o}=Vw(),{currentLanguage:l}=mt(),{isModalOpen:c,setIsModalOpen:h,parsedContent:f,parsedHeadline:u,error:d}=SU(),p=re("header",{"no-2d":t,"no-1d":!t}),{title:m,bookmarkedApps:g,appsRef:y,isAppsHovered:_,popoverAppsId:v,userAvatar:b,userName:w,welcomeUser:A,communityWorkflow:T,conversationWorflow:C,searchWorkflow:S,isCollapsed:M,toggleCollapsedNav:I,handleLogout:D}=t5({user:a,avatar:o}),R=i>0;return x.jsx("header",{className:p,children:t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"container-fluid",children:x.jsxs(Id,{children:[x.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:"/timeline/timeline",children:m}),x.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[x.jsx(ua,{alt:w,size:"sm",src:b,variant:"circle",width:"32",height:"32"}),x.jsx("span",{className:"navbar-text",children:A})]}),x.jsxs(Ny,{className:"gap-8","aria-hidden":"false","aria-label":r("navbar.main.navigation"),children:[C&&x.jsx(Ge,{children:x.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[x.jsx(N2,{className:"icon notification"}),R&&x.jsx(Cd,{children:i}),x.jsx(Hi,{children:r("navbar.messages")})]})}),x.jsx(Ge,{children:x.jsx(La,{link:"/userbook/mon-compte",className:"dropdown-item",translate:r("navbar.myaccount"),children:x.jsx(wx,{className:"icon user"})})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link",onClick:()=>{h(!0)},children:[x.jsx(k2,{className:"icon help"}),x.jsx(Hi,{children:r("navbar.help")})]}),x.jsx(Ly,{isHelpOpen:c,setIsHelpOpen:h,parsedContent:f,parsedHeadline:u,error:d})]}):null,x.jsx(Ge,{children:x.jsxs("button",{className:"nav-link",onClick:D,children:[x.jsx(Dg,{className:"icon logout"}),x.jsx(Hi,{children:r("navbar.disconnect")})]})}),x.jsx(Ge,{className:"d-md-none",children:x.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!M,"aria-label":r("navbar.secondary.navigation"),onClick:I,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),x.jsx(Id,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":r("navbar.secondary.navigation"),children:x.jsx("div",{className:"container-fluid",children:x.jsxs("div",{className:`collapse navbar-collapse ${M?"":"show"}`,id:"navbarCollapsed",children:[x.jsx(Iy,{is1d:!0,src:`${e}/img/illustrations/logo.png`,translate:r("navbar.home")}),x.jsxs(Ny,{className:"gap-8",children:[x.jsx(Ge,{children:x.jsxs("a",{href:"/timeline/timeline",className:"button",children:[x.jsx(M2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.whatsnew")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[x.jsx(j2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.classMembers")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/welcome",className:"button",children:[x.jsx(Ng,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.myapps")})]})})]})]})})})]}):x.jsx(Id,{className:"navbar-expand-md",children:x.jsxs("div",{className:"container-fluid",children:[x.jsx(Iy,{src:`${e}/img/illustrations/logo.png`}),x.jsx("a",{href:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:m}),x.jsxs("ul",{className:"navbar-nav",children:[x.jsx(Ge,{children:x.jsx(La,{link:"/timeline/timeline",translate:r("navbar.home"),children:x.jsx(S2,{color:"#fff"})})}),x.jsxs(Ge,{className:"position-relative",ref:y,id:v,"aria-haspopup":"true","aria-expanded":_,children:[x.jsx(La,{link:"/welcome",translate:r("navbar.applications"),children:x.jsx(Ng,{color:"#fff"})}),x.jsxs(eE,{className:"top-100 widget",id:v,isVisible:_,children:[x.jsx(x6,{children:x.jsx(TU,{bookmarkedApps:g})}),x.jsx(_6,{className:"widget-footer border-top border-ghost",children:x.jsx(EU,{})})]})]}),C&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:"/conversation/conversation",translate:r("conversation"),children:[x.jsx(Lg,{color:"#fff"}),R&&x.jsx(Cd,{children:i})]})}),n&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:s,translate:r("conversation"),children:[x.jsx(Lg,{color:"#fff"}),R&&x.jsx(Cd,{children:i})]})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{h(!0)},children:[x.jsx(I2,{color:"#fff"}),x.jsx(Hi,{children:r("support")})]}),x.jsx(Ly,{isHelpOpen:c,setIsHelpOpen:h,parsedContent:f,parsedHeadline:u,error:d})]}):null,x.jsx(Ge,{children:x.jsxs("div",{className:"dropdown",children:[x.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!M,"aria-label":r("navbar.open.menu"),onClick:I,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),x.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${M?"":"show"}`,id:"dropdown-navbar",children:[T&&x.jsx(Ge,{children:x.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[x.jsx(w2,{className:"icon community"}),x.jsx("span",{className:"nav-text",children:r("navbar.community")})]})}),S?x.jsx(CU,{}):null,x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[x.jsx(ua,{alt:w,size:"sm",src:b,variant:"circle",className:"bg-white",width:"32",height:"32"}),x.jsx("span",{className:"nav-text",children:r("navbar.myaccount")})]})}),x.jsx(Ge,{children:x.jsx("hr",{className:"dropdown-divider"})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/auth/logout?callback=",className:"nav-link dropdown-item",children:[x.jsx(Dg,{className:"icon logout"}),x.jsx("span",{id:"logout-label",className:"nav-text",children:r("navbar.disconnect")})]})})]})]})})]})]})})})},RU=IU;function PU({children:t,className:e,...r}){const i=re("container-fluid",e);return x.jsx("main",{className:i,...r,children:t})}const MU=({children:t,...e})=>{const{theme:r}=Om();return x.jsxs(x.Fragment,{children:[x.jsx(RU,{is1d:r==null?void 0:r.is1d,src:r==null?void 0:r.basePath}),x.jsx(PU,{className:re("d-flex flex-column bg-white",{"rounded-4 border":r==null?void 0:r.is1d,"mt-24":r==null?void 0:r.is1d}),...e,children:t}),x.jsx(XT,{toastOptions:{position:"top-right"}})]})},s8=MU;X1.extend(ck);X1.extend(ok);export{zU as A,tt as B,ZU as C,ot as D,KU as E,ft as F,n6 as G,$U as H,Qs as I,Ho as J,ua as K,QU as L,je as M,wx as N,HU as O,M5 as P,LU as Q,X1 as R,k4 as S,JU as T,ck as U,re as V,Nn as W,r8 as X,i8 as Y,t8 as Z,mt as a,pb as b,ru as c,hb as d,UU as e,Vw as f,jU as g,da as h,J4 as i,x as j,YU as k,z4 as l,qU as m,s8 as n,FE as o,FU as p,VU as q,Om as r,XU as s,iu as t,WU as u,wa as v,ux as w,of as x,GU as y,e8 as z};
|
|
1347
|
+
`)},domwindow(){return i("domwindow")},bigint(s){return i("bigint:"+s.toString())},process(){return i("process")},timer(){return i("timer")},pipe(){return i("pipe")},tcp(){return i("tcp")},udp(){return i("udp")},tty(){return i("tty")},statwatcher(){return i("statwatcher")},securecontext(){return i("securecontext")},connection(){return i("connection")},zlib(){return i("zlib")},context(){return i("context")},nodescript(){return i("nodescript")},httpparser(){return i("httpparser")},dataview(){return i("dataview")},signal(){return i("signal")},fsevent(){return i("fsevent")},tlswrap(){return i("tlswrap")}}}const sE="[native code] }",Y6=sE.length;function Oy(t){return typeof t!="function"?!1:Function.prototype.toString.call(t).slice(-Y6)===sE}class Zi{constructor(e,r){e=this.words=e||[],this.sigBytes=r===void 0?e.length*4:r}toString(e){return(e||q6).stringify(this)}concat(e){if(this.clamp(),this.sigBytes%4)for(let r=0;r<e.sigBytes;r++){const i=e.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=i<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<e.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=e.words[r>>>2];return this.sigBytes+=e.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new Zi([...this.words])}}const q6={stringify(t){const e=[];for(let r=0;r<t.sigBytes;r++){const i=t.words[r>>>2]>>>24-r%4*8&255;e.push((i>>>4).toString(16),(i&15).toString(16))}return e.join("")}},Z6={stringify(t){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[];for(let i=0;i<t.sigBytes;i+=3){const s=t.words[i>>>2]>>>24-i%4*8&255,n=t.words[i+1>>>2]>>>24-(i+1)%4*8&255,a=t.words[i+2>>>2]>>>24-(i+2)%4*8&255,o=s<<16|n<<8|a;for(let l=0;l<4&&i*8+l*6<t.sigBytes*8;l++)r.push(e.charAt(o>>>6*(3-l)&63))}return r.join("")}},K6={parse(t){const e=t.length,r=[];for(let i=0;i<e;i++)r[i>>>2]|=(t.charCodeAt(i)&255)<<24-i%4*8;return new Zi(r,e)}},Q6={parse(t){return K6.parse(unescape(encodeURIComponent(t)))}};class J6{constructor(){this._data=new Zi,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new Zi,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=Q6.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_doProcessBlock(e,r){}_process(e){let r,i=this._data.sigBytes/(this.blockSize*4);e?i=Math.ceil(i):i=Math.max((i|0)-this._minBufferSize,0);const s=i*this.blockSize,n=Math.min(s*4,this._data.sigBytes);if(s){for(let a=0;a<s;a+=this.blockSize)this._doProcessBlock(this._data.words,a);r=this._data.words.splice(0,s),this._data.sigBytes-=n}return new Zi(r,n)}}class eU extends J6{update(e){return this._append(e),this._process(),this}finalize(e){e&&this._append(e)}}const ky=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],tU=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],fs=[];class rU extends eU{constructor(){super(...arguments),this._hash=new Zi([...ky])}reset(){super.reset(),this._hash=new Zi([...ky])}_doProcessBlock(e,r){const i=this._hash.words;let s=i[0],n=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],f=i[7];for(let u=0;u<64;u++){if(u<16)fs[u]=e[r+u]|0;else{const v=fs[u-15],b=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,w=fs[u-2],A=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;fs[u]=b+fs[u-7]+A+fs[u-16]}const d=l&c^~l&h,p=s&n^s&a^n&a,m=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),g=(l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25),y=f+g+d+tU[u]+fs[u],_=m+p;f=h,h=c,c=l,l=o+y|0,o=a,a=n,n=s,s=y+_|0}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+a|0,i[3]=i[3]+o|0,i[4]=i[4]+l|0,i[5]=i[5]+c|0,i[6]=i[6]+h|0,i[7]=i[7]+f|0}finalize(e){super.finalize(e);const r=this._nDataBytes*8,i=this._data.sigBytes*8;return this._data.words[i>>>5]|=128<<24-i%32,this._data.words[(i+64>>>9<<4)+14]=Math.floor(r/4294967296),this._data.words[(i+64>>>9<<4)+15]=r,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function iU(t){return new rU().finalize(t).toString(Z6)}function nE(t,e={}){const r=typeof t=="string"?t:W6(t,e);return iU(r).slice(0,10)}var aE={};Object.defineProperty(aE,"__esModule",{value:!0});const sU=t=>{const e="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",r="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",i=e.split("").join("|"),s=new RegExp(`(${i})`,"g");function n(a){return r[e.indexOf(a)]||""}return t.replace(s,n)},nU=t=>t.split("").map(e=>`\\${e}`).join(""),Dy=(t,e,r=!1)=>{const i=sU(t).trim().toLowerCase(),s=nU(e);return r?i.replace(/\s+/g,e):i.replace(new RegExp(`[^a-z0-9${s}]+`,"g"),e).replace(new RegExp(`${s}+`,"g"),e).replace(new RegExp(`^${s}`,"g"),"").replace(new RegExp(`${s}$`,"g"),"")},qa=(t,e={delimiter:"-",prefix:""})=>{if(e.delimiter||(e.delimiter="-"),e.prefix||(e.prefix=""),!t||typeof t=="boolean")return"";const{delimiter:r,prefix:i}=e;if(typeof t=="boolean")return"";if(typeof t=="string"||typeof t=="number"){const s=Dy(i,r,!0),n=Dy(String(t),r);return s?`${s}${r}${n}`:n}return"children"in t?qa(t.children):"type"in t?qa(t.props.children,e):Symbol.iterator in t?qa(Array.from(t).map(s=>qa(s,{delimiter:r})).join(r),e):""};var oE=aE.default=qa;const aU=({watch:t,selectedResource:e})=>{const[r,i]=E.useState(""),[s,n]=E.useState(!!(e!=null&&e.public)||!1),a=E.useId(),o=t("title"),{t:l}=Ce(),c=ru(),h=`${nE({foo:`${o}${a}`})}-${oE(o)}`;E.useEffect(()=>{if(s){let d="";e&&e.slug?d=e.slug:d=h,i(d)}},[s,e,o,a,h]);function f(d){n(d)}function u(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${r}`),c.success(l("explorer.copy.clipboard"))}return{slug:r,uniqueId:a,isPublic:s,resourceName:o,onPublicChange:f,onCopyToClipBoard:u}},oU=({isUpdating:t,selectedResource:e})=>{const[r,i]=E.useState(t&&(e==null?void 0:e.thumbnail)||"");return{thumbnail:r,handleDeleteImage:()=>i(""),handleUploadImage:s=>i(s)}},lU=({appCode:t,isPublic:e,onCopyToClipBoard:r,onPublicChange:i,register:s,slug:n,resourceName:a})=>{const{t:o}=Ce();return x.jsxs(x.Fragment,{children:[x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:[o("explorer.resource.editModal.heading.access"),t]}),x.jsx(zi,{type:"info",children:o("explorer.resource.editModal.access.alert")}),x.jsxs(ft,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[x.jsx(ft.Input,{type:"checkbox",role:"switch",...s("enablePublic",{disabled:!e&&!a,onChange:l=>{i(l.target.checked)}}),className:"form-check-input mt-0",size:"md"}),x.jsx(ft.Label,{className:"form-check-label mb-0",children:o("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),e&&x.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[x.jsxs("p",{className:"text-break",children:[window.location.origin,window.location.pathname,"/pub/",n]}),x.jsx(tt,{color:"primary",disabled:!e,onClick:r,type:"button",leftIcon:x.jsx(dE,{}),variant:"ghost",className:"text-nowrap",children:o("explorer.resource.editModal.access.url.button")})]})]})},cU=({isOpen:t,actions:e,onCancel:r,onSuccess:i,...s})=>{var n,a,o,l,c,h;const{appCode:f,currentApp:u}=mt(),{t:d}=Ce(),{mode:p}=s,m=E.useId(),g=p==="create",y=p==="update",{watch:_,register:v,handleSubmit:b,formState:{isSubmitting:w,isValid:A}}=Yy({mode:"onChange",defaultValues:{description:y?(n=s.selectedResource)==null?void 0:n.description:"",enablePublic:y?(a=s.selectedResource)==null?void 0:a.public:!1,title:y?(o=s.selectedResource)==null?void 0:o.name:""}}),{slug:T,uniqueId:C,isPublic:S,resourceName:M,onPublicChange:I,onCopyToClipBoard:D}=aU({watch:_,selectedResource:y?s.selectedResource:void 0}),R=ru(),{thumbnail:P,handleDeleteImage:O,handleUploadImage:N}=oU({isUpdating:y,selectedResource:y?s.selectedResource:void 0}),L=async function(B){var U,F;try{const j={description:B.description||"",name:B.title,public:B.enablePublic,thumbnail:P},z=`${nE({foo:`${B.title}${C}`})}-${oE(B.title)}`;g?await s.createResource.mutateAsync({...j,folder:((U=s.currentFolder)==null?void 0:U.id)==="default"?void 0:parseInt(((F=s.currentFolder)==null?void 0:F.id)||""),slug:B.enablePublic?z:"",application:f}):await s.updateResource.mutateAsync({...j,slug:B.enablePublic?s.selectedResource&&s.selectedResource.slug?s.selectedResource.slug:z:"",entId:s.selectedResource.assetId,trashed:s.selectedResource.trashed}),R.success(x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:d(g?"explorer.resource.created":"explorer.resource.updated")}),x.jsxs("p",{children:[d("title")," : ",B.title]}),x.jsxs("p",{children:[d("description")," : ",B.description]}),f==="blog"&&x.jsxs("p",{children:["Public:",B.enablePublic?d("explorer.enable.public.yes"):d("explorer.enable.public.no")]})]})),i()}catch(j){console.error(j)}};return rs.createPortal(x.jsxs(je,{id:`${p}-resource`,size:"lg",isOpen:t,onModalClose:r,children:[x.jsx(je.Header,{onModalClose:r,children:d(`explorer.resource.editModal.header.${g?"create":"edit"}`)}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:d("explorer.resource.editModal.heading.general")}),x.jsxs("form",{id:m,onSubmit:b(L),children:[x.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[x.jsx("div",{children:x.jsx(Kw,{app:u,src:y&&((l=s.selectedResource)==null?void 0:l.thumbnail)||"",label:d("explorer.imagepicker.label"),addButtonLabel:d("explorer.imagepicker.button.add"),deleteButtonLabel:d("explorer.imagepicker.button.delete"),onUploadImage:N,onDeleteImage:O,className:"align-self-center mt-8"})}),x.jsxs("div",{className:"col",children:[x.jsxs(ft,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:d("title")}),x.jsx(da,{type:"text",defaultValue:y?(c=s.selectedResource)==null?void 0:c.name:"",...v("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:d("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ft,{id:"description",isOptional:!0,children:[x.jsx(Nn,{children:d("description")}),x.jsx(rE,{defaultValue:y?(h=s.selectedResource)==null?void 0:h.description:"",...v("description"),placeholder:d("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),f==="blog"&&z4("createPublic",e)&&x.jsx(lU,{appCode:f,isPublic:S,slug:T,onCopyToClipBoard:D,onPublicChange:I,register:v,resourceName:M})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:d("explorer.cancel")}),x.jsx(tt,{form:m,type:"submit",color:"primary",isLoading:w,variant:"filled",disabled:!A||w,children:d(g?"explorer.create":"save")})]})]}),document.getElementById("portal"))},r8=cU;function hU({radioPublicationValue:t,onRadioPublicationChange:e}){const{appCode:r}=mt(),{t:i}=Ce(r);return x.jsxs(x.Fragment,{children:[x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("explorer.publication.steps")}),x.jsx(_p,{label:i("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:t,checked:t==="IMMEDIATE",onChange:s=>e(s.target.value)}),x.jsx(_p,{label:i("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:t==="RESTRAINT",model:t,onChange:s=>e(s.target.value)})]})}const uU={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function dU(t,e){switch(e.type){case"onChange":return{...t,searchInputValue:e.payload};case"isSearching":return{...t,isSearching:e.payload};case"addResult":return{...t,searchResults:e.payload};case"addApiResult":return{...t,searchAPIResults:e.payload};case"updateSearchResult":return{...t,searchResults:e.payload};case"emptyResult":return{...t,searchResults:e.payload};default:throw new Error("Unhandled action type")}}const Ad=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],fU=({resource:t,shareRights:e,shareDispatch:r})=>{const[i,s]=E.useReducer(dU,uU),n=W4(i.searchInputValue,500),{isAdml:a}=r5(),{appCode:o}=mt(),{t:l}=Ce();E.useEffect(()=>{h(n)},[n]);const c=f=>{const u=f.target.value;s({type:"onChange",payload:u})},h=async f=>{if(s({type:"isSearching",payload:!0}),!a&&f.length>=1||a&&f.length>=3){const u=await Me.share().searchShareSubjects(o,t.assetId,f);s({type:"addApiResult",payload:u});const d=u.filter(p=>!e.rights.find(m=>m.id===p.id)).filter(p=>!(p.type==="user"&&p.id===t.creatorId)).map(p=>{let m=p.displayName;return p.type==="user"&&p.profile?m=`${m} (${l(p.profile)})`:p.type==="group"&&p.structureName&&(m=`${m} (${p.structureName})`),{value:p.id,label:m,icon:p.type==="sharebookmark"?x.jsx(wp,{}):null}});s({type:"addResult",payload:d})}else s({type:"emptyResult",payload:[]}),Promise.resolve();s({type:"isSearching",payload:!1})};return{state:i,showSearchAdmlHint:()=>a&&i.searchInputValue.length<3,showSearchLoading:()=>i.isSearching,showSearchNoResults:()=>!i.isSearching&&!a&&n.length>0&&i.searchResults.length===0||!i.isSearching&&a&&n.length>3&&i.searchResults.length===0,getSearchMinLength:()=>a?3:1,handleSearchInputChange:c,handleSearchResultsChange:async f=>{const u=i.searchAPIResults.find(d=>d.id===f[0]);if(u){let d=[];if(u.type==="sharebookmark"){const p=await Me.directory().getBookMarkById(u.id);d.push({...p,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:Ad}),p==null||p.users.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"user",avatarUrl:"",directoryUrl:"",actions:Ad,isBookmarkMember:!0})}),p.groups.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"group",avatarUrl:"",directoryUrl:"",actions:Ad,isBookmarkMember:!0})})}else d=[{...u,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];r({type:"updateShareRights",payload:{...e,rights:[...e.rights,...d]}}),s({type:"updateSearchResult",payload:i.searchResults.filter(p=>p.value!==f[0])})}}}},pU={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function mU(t,e){switch(e.type){case"init":return{...t,...e.payload};case"deleteRow":return{...t,shareRights:e.payload};case"updateShareRights":return{...t,shareRights:e.payload};case"toggleRight":return{...t,shareRights:e.payload};case"isSharing":return{...t,isSharing:!0};default:throw new Error("Unhandled action type")}}function gU({onSuccess:t,resource:e,updateResource:r,shareResource:i}){const{appCode:s}=mt(),{user:n,avatar:a}=Vw(),[o,l]=E.useReducer(mU,pU);return E.useEffect(()=>{(async()=>{const c=await Me.share().getActionsForApp(s),h=await Me.share().getRightsForResource(s,e.assetId);l({type:"init",payload:{shareRightActions:c,shareRights:h}})})()},[]),{state:o,dispatch:l,currentIsAuthor:()=>!!(e&&e.creatorId===(n==null?void 0:n.userId)),myAvatar:a,handleDeleteRow:c=>{l({type:"deleteRow",payload:{...o.shareRights,rights:o.shareRights.rights.filter(h=>{var f,u;return h.id!==c.id&&!((f=c.users)!=null&&f.find(d=>d.id===h.id))&&!((u=c.groups)!=null&&u.find(d=>d.id===h.id))})}})},handleShare:async c=>{l({type:"isSharing",payload:!0});try{const h=e.rights.filter(u=>n&&u.includes(`user:${n.userId}`)).map(u=>u.split(":")[2]).filter(u=>!!u),f=[...o.shareRights.rights];if(h.length>0){const u=h.map(d=>({displayName:d,id:d}));f.push({actions:u,avatarUrl:"",directoryUrl:"",displayName:n.username,id:n.userId,type:"user"})}s==="blog"?await r.mutateAsync(c):await r.mutateAsync({entId:e.assetId||"",trashed:e.trashed||!1,name:e.name||"",thumbnail:e.thumbnail||"",description:e.description||"",public:e.public||!1,slug:e.slug||""}),await i.mutateAsync({resourceId:e.assetId,rights:f}),t==null||t()}catch(h){console.error("Failed to save share",h)}finally{l({type:"isSharing",payload:!1})}},toggleRight:(c,h)=>{var f,u;const{rights:d,...p}=o.shareRights,m=[...d],g=m.findIndex(_=>_.id===c.id),y=o.shareRightActions.filter(_=>_.id===h)[0];if(m[g].actions.findIndex(_=>_.id===h)>-1){let _=m[g].actions.filter(b=>b.id!==h);const v=o.shareRightActions.filter(b=>{var w;return(w=b.requires)==null?void 0:w.includes(h)});_=_.filter(b=>!v.find(w=>w.id===b.id)),m[g]={...m[g],actions:_}}else{const _=o.shareRightActions.filter(v=>{var b;return((b=y.requires)==null?void 0:b.includes(v.id))&&!m[g].actions.find(w=>w.id===v.id)});m[g]={...m[g],actions:[...m[g].actions,y,..._]}}c.type==="sharebookmark"&&((f=m[g].users)==null||f.forEach(_=>{const v=m.findIndex(b=>b.id===_.id);m[v]={...m[v],actions:m[g].actions}}),(u=m[g].groups)==null||u.forEach(_=>{const v=m.findIndex(b=>b.id===_.id);m[v]={...m[v],actions:m[g].actions}})),l({type:"toggleRight",payload:{rights:m,...p}})}}}function vU({resource:t}){const{assetId:e,description:r,thumbnail:i,name:s,public:n,trashed:a,slug:o,"publish-type":l}=t||{"publish-type":"",assetId:"",description:"",name:"",public:!1,slug:"",thumbnail:"",trashed:!1},[c,h]=E.useState(l||"RESTRAINT"),[f,u]=E.useState({description:r||"",entId:e,name:s,public:!!n,slug:o||"",thumbnail:i,trashed:a,"publish-type":l});return E.useEffect(()=>{c&&u(d=>({...d,"publish-type":c}))},[c]),{radioPublicationValue:c,shareBlogPayload:f,handleRadioPublicationChange:async d=>{h(d)}}}const yU=({shareRights:t,shareDispatch:e})=>{const r=ru(),{t:i}=Ce(),s=E.useRef(null),[n,a]=E.useState({name:"",id:E.useId()}),[o,l]=J4(!1),[c,h]=E.useState(!1),f=()=>{l()},u=()=>{a(p=>{var m;return{...p,name:((m=s.current)==null?void 0:m.value)||""}})},d=async p=>{try{const m=await Me.directory().saveBookmarks(p,{users:t.rights.filter(g=>g.type==="user").map(g=>g.id),groups:t.rights.filter(g=>g.type==="group").map(g=>g.id),bookmarks:t.rights.filter(g=>g.type==="sharebookmark").map(g=>g.id)});r.success(i("explorer.bookmarked.status.saved")),e({type:"updateShareRights",payload:{...t,visibleBookmarks:[...t.visibleBookmarks,{displayName:p,id:m.id}]}}),a(g=>({...g,bookmarkId:g.id+new Date().getTime().toString()})),h(!1)}catch(m){console.error("Failed to save bookmark",m),r.error(i("explorer.bookmarked.status.error"))}};return{refBookmark:s,showBookmark:o,showBookmarkInput:c,bookmark:n,handleBookmarkChange:u,setBookmark:a,handleOnSave:()=>{var p;const m=((p=s.current)==null?void 0:p.value)||"";d(m)},toggleBookmark:f,toggleBookmarkInput:h}},bU=({bookmark:t,refBookmark:e,onBookmarkChange:r,onSave:i})=>{const{t:s}=Ce();return x.jsx("div",{className:"mt-16",children:x.jsxs(ft,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[x.jsx("div",{className:"flex-fill",children:x.jsx(ft.Input,{ref:e,onChange:r,placeholder:s("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},t.id)}),x.jsx(tt,{type:"button",color:"primary",variant:"ghost",disabled:t.name.length===0,leftIcon:x.jsx(cE,{}),onClick:i,className:"text-nowrap",children:s("explorer.modal.share.sharebookmark.save")})]})})},xU=(t,e)=>t.actions.filter(r=>e.id===r.id).length>0,_U=(t,e)=>t.isBookmarkMember&&e||!t.isBookmarkMember,wU=({shareRights:t,showBookmark:e,toggleBookmark:r,shareRightActions:i,toggleRight:s,onDeleteRow:n})=>{const{t:a}=Ce();return t==null?void 0:t.rights.map(o=>_U(o,e)&&x.jsxs("tr",{className:o.isBookmarkMember?"bg-light":"",children:[x.jsxs("td",{children:[o.type!=="sharebookmark"&&x.jsx(ua,{alt:a("explorer.modal.share.avatar.shared.alt"),size:"xs",src:o.avatarUrl,variant:"circle"}),o.type==="sharebookmark"&&x.jsx(wp,{})]}),x.jsx("td",{children:x.jsxs("div",{className:"d-flex",children:[o.type==="sharebookmark"&&x.jsx(tt,{color:"tertiary",rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:e?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:r,children:o.displayName}),o.type!=="sharebookmark"&&o.displayName,o.type==="user"&&` (${a(o.profile||"")})`]})}),i.map(l=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:xU(o,l),onChange:()=>s(o,l.id)})},l.displayName)),x.jsx("td",{children:!o.isBookmarkMember&&x.jsx(Qs,{"aria-label":"Delete",color:"tertiary",icon:x.jsx(Zy,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>n(o)})})]},o.id))};function i8({isOpen:t,resource:e,updateResource:r,shareResource:i,onSuccess:s,onCancel:n}){const{appCode:a}=mt(),{radioPublicationValue:o,shareBlogPayload:l,handleRadioPublicationChange:c}=vU({resource:e}),{state:{isSharing:h,shareRights:f,shareRightActions:u},dispatch:d,myAvatar:p,currentIsAuthor:m,handleShare:g,toggleRight:y,handleDeleteRow:_}=gU({resource:e,updateResource:r,shareResource:i,onSuccess:s}),{state:{searchResults:v,searchInputValue:b},showSearchAdmlHint:w,showSearchLoading:A,showSearchNoResults:T,getSearchMinLength:C,handleSearchInputChange:S,handleSearchResultsChange:M}=fU({resource:e,shareRights:f,shareDispatch:d}),{refBookmark:I,showBookmark:D,handleBookmarkChange:R,toggleBookmark:P,bookmark:O,handleOnSave:N,showBookmarkInput:L,toggleBookmarkInput:B}=yU({shareRights:f,shareDispatch:d}),{t:U}=Ce(),F=w()?U("explorer.search.adml.hint"):U("explorer.modal.share.search.placeholder");return rs.createPortal(x.jsxs(je,{id:"share_modal",size:"lg",isOpen:t,onModalClose:n,children:[x.jsx(je.Header,{onModalClose:n,children:U("share.title")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:U("explorer.modal.share.usersWithAccess")}),x.jsx("div",{className:"table-responsive",children:x.jsxs("table",{className:"table border align-middle mb-0",children:[x.jsx("thead",{className:"bg-secondary",children:x.jsxs("tr",{children:[x.jsx("th",{scope:"col",className:"w-32",children:x.jsx(Hi,{children:U("explorer.modal.share.avatar.shared.alt")})}),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:U("explorer.modal.share.search.placeholder")})}),u.map(j=>x.jsx("th",{scope:"col",className:"text-center text-white",children:U(j.displayName)},j.displayName)),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:U("close")})})]})}),x.jsxs("tbody",{children:[m()&&x.jsxs("tr",{children:[x.jsx("th",{scope:"row",children:x.jsx(ua,{alt:U("explorer.modal.share.avatar.me.alt"),size:"xs",src:p,variant:"circle"})}),x.jsx("td",{children:U("share.me")}),u.map(j=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:!0,disabled:!0})},j.displayName)),x.jsx("td",{})]}),x.jsx(wU,{showBookmark:D,shareRightActions:u,shareRights:f,onDeleteRow:_,toggleRight:y,toggleBookmark:P})]})]})}),x.jsxs("div",{className:"mt-16",children:[x.jsx(tt,{color:"tertiary",leftIcon:x.jsx(wp,{}),rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:L?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>B(!L),children:U("share.save.sharebookmark")}),L&&x.jsx(bU,{refBookmark:I,bookmark:O,onBookmarkChange:R,onSave:N})]}),x.jsx("hr",{}),x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[x.jsx("div",{className:"me-8",children:U("explorer.modal.share.search")}),x.jsx(M5,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:x.jsx(qy,{className:"c-pointer",height:"18"})})]}),x.jsx("div",{className:"row",children:x.jsx("div",{className:"col-10",children:x.jsx(i6,{value:b,placeholder:F,isLoading:A(),noResult:T(),options:v,searchMinLength:C(),onSearchInputChange:S,onSearchResultsChange:M})})}),a==="blog"&&x.jsx(hU,{radioPublicationValue:o,onRadioPublicationChange:c})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:n,children:U("explorer.cancel")}),x.jsx(tt,{type:"button",color:"primary",variant:"filled",isLoading:h,onClick:()=>g(l),disabled:h,children:U("share")})]})]}),document.getElementById("portal"))}function Cd({children:t}){return x.jsx("span",{className:"position-absolute badge rounded-pill bg-warning",children:t})}function Id({children:t,className:e,...r}){const i=re("navbar",e);return x.jsx("nav",{className:i,...r,children:t})}function Ny({children:t,className:e,...r}){const i=re("navbar-nav",e);return x.jsx("ul",{className:i,...r,children:t})}const Ge=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("nav-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})});function La({link:t,className:e,children:r,translate:i,...s}){const n=re("nav-link",e);return x.jsxs("a",{href:t,className:n,...s,children:[r,i&&x.jsx(Hi,{children:x.jsx("span",{className:"nav-text",children:i})})]})}const EU=()=>{const{t}=Ce();return x.jsx("div",{className:"widget-footer",children:x.jsx("div",{className:"widget-footer-action",children:x.jsx("a",{href:"/welcome",className:"link",children:t("plus")})})})},TU=({bookmarkedApps:t})=>{const{t:e}=Ce();return x.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!t.length&&x.jsx("div",{className:"text-dark",children:e("navbar.myapps.more")}),t.slice(0,6).map((r,i)=>x.jsx("a",{href:r.address,className:"bookmarked-app",children:x.jsx(Ho,{app:r,size:"32"})},i))]})};function Ly({isHelpOpen:t,setIsHelpOpen:e,parsedHeadline:r,parsedContent:i,error:s}){const{t:n}=Ce(),a=()=>{e(!1)};return t?rs.createPortal(x.jsxs(je,{id:"help-modal",isOpen:t,onModalClose:a,scrollable:!0,size:"lg",children:[x.jsx(je.Header,{onModalClose:a,children:n("navbar.help")}),x.jsx(je.Subtitle,{children:s?n("help.notfound.title"):r}),x.jsx(je.Body,{className:s?"d-flex":null,children:s?n("help.notfound.text"):i})]}),document.getElementById("portal")):null}function SU(){var t,e,r,i,s;const{appCode:n}=mt(),{theme:a}=Om(),[o,l]=E.useState(""),[c,h]=E.useState(!0),[f,u]=E.useState(!1),[d,p]=E.useState(!1),m=a!=null&&a.is1d?"/help-1d":"/help-2d";E.useEffect(()=>{(async()=>{let v="";v=m+"/application/"+n+"/",!n&&window.location.pathname!=="/adapter"?v=m+"/application/portal/":window.location.pathname==="/adapter"?v=m+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?v=m+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(v=m+"/application/userbook/");try{const b=await fetch(v),w=await b.text();if(b.status===404){p(!0);return}l(w),p(!1)}catch(b){p(!0),console.error(b)}})()},[n,m]);const g=os(o,{replace:v=>{const b=v;if(b.attribs&&b.attribs.id==="TOC")return x.jsxs("nav",{id:"TOC",children:[x.jsx(tt,{onClick:()=>{h(!c)},children:x.jsx(wE,{})}),Pl(b.children,{replace:w=>{const A=w;if(A.attribs&&A.name==="ul")return x.jsx("ul",{id:"TOC-list",style:{display:c?"block":"none"},children:Pl(A.children,{replace:T=>{const C=T;if(C.attribs&&C.name==="a")return x.jsx("a",{...Au(C.attribs),children:x.jsx("span",{onClick:()=>{h(!1)},children:Pl(C.children)})})}})})}})]});if(b.attribs&&b.attribs.class==="section level2"){const w=Au(v.attribs);return x.jsx("div",{...w,className:"section level2",style:{display:b.attribs.id!=="présentation"?"none":"block"},children:Pl(b.children,{replace:A=>{const T=A;if(T.attribs&&T.name==="img"){const C=A.attribs.src;return x.jsx("img",{...Au(T.attribs),src:`${m}/${C}`,alt:""})}}})})}}}),y=(r=(e=(t=g==null?void 0:g.props)==null?void 0:t.children.find(v=>v.type==="body"))==null?void 0:e.props)==null?void 0:r.children,_=(s=(i=y==null?void 0:y.find(v=>v.type==="p"))==null?void 0:i.props)==null?void 0:s.children;return{html:o,visibility:c,isModalOpen:f,setIsModalOpen:u,parsedContent:y,parsedHeadline:_,error:d}}const AU=()=>{const[t,e]=Hw(),r=E.useRef(null),i=E.useId(),{t:s}=Ce();function n(){if(r.current){const a=r.current.value;window.location.href=`/searchengine#/${a}`}}return x.jsxs(Ge,{id:i,ref:t,className:"position-relative","aria-haspopup":"true","aria-expanded":e,children:[x.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[x.jsx(F2,{className:"icon search"}),x.jsx("span",{className:"nav-text",children:s("navbar.search")})]}),x.jsx(eE,{id:i,isVisible:e,className:"d-none d-md-flex",children:x.jsxs(ft,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[x.jsx(ft.Input,{ref:r,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),x.jsx(k4,{type:"submit",size:"sm",onClick:n,"aria-label":s("navbar.search")})]})})]})},CU=AU,IU=({is1d:t=!1,src:e=""})=>{const{t:r}=Ce(),{messages:i,msgLink:s,zimbraWorkflow:n}=V4(),{user:a,avatar:o}=Vw(),{currentLanguage:l}=mt(),{isModalOpen:c,setIsModalOpen:h,parsedContent:f,parsedHeadline:u,error:d}=SU(),p=re("header",{"no-2d":t,"no-1d":!t}),{title:m,bookmarkedApps:g,appsRef:y,isAppsHovered:_,popoverAppsId:v,userAvatar:b,userName:w,welcomeUser:A,communityWorkflow:T,conversationWorflow:C,searchWorkflow:S,isCollapsed:M,toggleCollapsedNav:I,handleLogout:D}=t5({user:a,avatar:o}),R=i>0;return x.jsx("header",{className:p,children:t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"container-fluid",children:x.jsxs(Id,{children:[x.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:"/timeline/timeline",children:m}),x.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[x.jsx(ua,{alt:w,size:"sm",src:b,variant:"circle",width:"32",height:"32"}),x.jsx("span",{className:"navbar-text",children:A})]}),x.jsxs(Ny,{className:"gap-8","aria-hidden":"false","aria-label":r("navbar.main.navigation"),children:[C&&x.jsx(Ge,{children:x.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[x.jsx(N2,{className:"icon notification"}),R&&x.jsx(Cd,{children:i}),x.jsx(Hi,{children:r("navbar.messages")})]})}),x.jsx(Ge,{children:x.jsx(La,{link:"/userbook/mon-compte",className:"dropdown-item",translate:r("navbar.myaccount"),children:x.jsx(wx,{className:"icon user"})})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link",onClick:()=>{h(!0)},children:[x.jsx(k2,{className:"icon help"}),x.jsx(Hi,{children:r("navbar.help")})]}),x.jsx(Ly,{isHelpOpen:c,setIsHelpOpen:h,parsedContent:f,parsedHeadline:u,error:d})]}):null,x.jsx(Ge,{children:x.jsxs("button",{className:"nav-link",onClick:D,children:[x.jsx(Dg,{className:"icon logout"}),x.jsx(Hi,{children:r("navbar.disconnect")})]})}),x.jsx(Ge,{className:"d-md-none",children:x.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!M,"aria-label":r("navbar.secondary.navigation"),onClick:I,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),x.jsx(Id,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":r("navbar.secondary.navigation"),children:x.jsx("div",{className:"container-fluid",children:x.jsxs("div",{className:`collapse navbar-collapse ${M?"":"show"}`,id:"navbarCollapsed",children:[x.jsx(Iy,{is1d:!0,src:`${e}/img/illustrations/logo.png`,translate:r("navbar.home")}),x.jsxs(Ny,{className:"gap-8",children:[x.jsx(Ge,{children:x.jsxs("a",{href:"/timeline/timeline",className:"button",children:[x.jsx(M2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.whatsnew")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[x.jsx(j2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.classMembers")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/welcome",className:"button",children:[x.jsx(Ng,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.myapps")})]})})]})]})})})]}):x.jsx(Id,{className:"navbar-expand-md",children:x.jsxs("div",{className:"container-fluid",children:[x.jsx(Iy,{src:`${e}/img/illustrations/logo.png`}),x.jsx("a",{href:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:m}),x.jsxs("ul",{className:"navbar-nav",children:[x.jsx(Ge,{children:x.jsx(La,{link:"/timeline/timeline",translate:r("navbar.home"),children:x.jsx(S2,{color:"#fff"})})}),x.jsxs(Ge,{className:"position-relative",ref:y,id:v,"aria-haspopup":"true","aria-expanded":_,children:[x.jsx(La,{link:"/welcome",translate:r("navbar.applications"),children:x.jsx(Ng,{color:"#fff"})}),x.jsxs(eE,{className:"top-100 widget",id:v,isVisible:_,children:[x.jsx(x6,{children:x.jsx(TU,{bookmarkedApps:g})}),x.jsx(_6,{className:"widget-footer border-top border-ghost",children:x.jsx(EU,{})})]})]}),C&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:"/conversation/conversation",translate:r("conversation"),children:[x.jsx(Lg,{color:"#fff"}),R&&x.jsx(Cd,{children:i})]})}),n&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:s,translate:r("conversation"),children:[x.jsx(Lg,{color:"#fff"}),R&&x.jsx(Cd,{children:i})]})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{h(!0)},children:[x.jsx(I2,{color:"#fff"}),x.jsx(Hi,{children:r("support")})]}),x.jsx(Ly,{isHelpOpen:c,setIsHelpOpen:h,parsedContent:f,parsedHeadline:u,error:d})]}):null,x.jsx(Ge,{children:x.jsxs("div",{className:"dropdown",children:[x.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!M,"aria-label":r("navbar.open.menu"),onClick:I,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),x.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${M?"":"show"}`,id:"dropdown-navbar",children:[T&&x.jsx(Ge,{children:x.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[x.jsx(w2,{className:"icon community"}),x.jsx("span",{className:"nav-text",children:r("navbar.community")})]})}),S?x.jsx(CU,{}):null,x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[x.jsx(ua,{alt:w,size:"sm",src:b,variant:"circle",className:"bg-white",width:"32",height:"32"}),x.jsx("span",{className:"nav-text",children:r("navbar.myaccount")})]})}),x.jsx(Ge,{children:x.jsx("hr",{className:"dropdown-divider"})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/auth/logout?callback=",className:"nav-link dropdown-item",children:[x.jsx(Dg,{className:"icon logout"}),x.jsx("span",{id:"logout-label",className:"nav-text",children:r("navbar.disconnect")})]})})]})]})})]})]})})})},RU=IU;function PU({children:t,className:e,...r}){const i=re("container-fluid",e);return x.jsx("main",{className:i,...r,children:t})}const MU=({children:t,...e})=>{const{theme:r}=Om();return x.jsxs(x.Fragment,{children:[x.jsx(RU,{is1d:r==null?void 0:r.is1d,src:r==null?void 0:r.basePath}),x.jsx(PU,{className:re("d-flex flex-column bg-white",{"rounded-4 border":r==null?void 0:r.is1d,"mt-24":r==null?void 0:r.is1d}),...e,children:t}),x.jsx(XT,{toastOptions:{position:"top-right"}})]})},s8=MU;X1.extend(ck);X1.extend(ok);export{zU as A,tt as B,ZU as C,ot as D,KU as E,ft as F,n6 as G,$U as H,Qs as I,Ho as J,ua as K,QU as L,je as M,wx as N,HU as O,M5 as P,LU as Q,X1 as R,k4 as S,JU as T,ck as U,re as V,Nn as W,r8 as X,i8 as Y,t8 as Z,mt as a,pb as b,ru as c,hb as d,UU as e,Vw as f,jU as g,da as h,J4 as i,x as j,YU as k,z4 as l,qU as m,s8 as n,FE as o,FU as p,VU as q,Om as r,XU as s,iu as t,WU as u,wa as v,ux as w,of as x,GU as y,e8 as z};
|
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=1.0-b2school-SNAPSHOT 26/01/2024 15:
|
|
1
|
+
ode-explorer=1.0-b2school-SNAPSHOT 26/01/2024 15:48:04
|
package/package.json
CHANGED