ode-explorer 1.3.3-develop-pedago.202402071030 → 1.3.3-develop.202402071721

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.
@@ -1342,6 +1342,6 @@ void main()
1342
1342
  font-weight: ${r.weight};
1343
1343
  font-style: ${r.style};
1344
1344
  font-display: ${r.display};
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=PN(e)),typeof e=="number"?RN(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}};wp.availableFonts={},wp.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 Ad=wp;const lc=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 Ad?(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=Ad.from(e)):(this.ownsStyle=!0,this._style=new Ad(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(/&nbsp;/gi,"&#160;")}};lc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},lc.defaultMaxWidth=2024,lc.defaultMaxHeight=2024,lc.defaultAutoResolution=!0;const G4=E.forwardRef(({children:t},e)=>x.jsx("div",{ref:e,className:"actionbar",children:t})),t8=G4,z4=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(bE,{...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()]})}),zw=z4,H4=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(zw,{isLoading:!0,loadingIcon:n,loadingPosition:a,children:i}):x.jsxs("span",{children:[o,i,l]})})}),tt=H4,V4=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})}),ua=V4,W4=E.forwardRef(({icon:t=x.jsx(xE,{}),onClick:e,className:r,...i},s)=>{const n=re("btn-search",r);return x.jsx(ua,{ref:s,className:n,icon:t,onClick:e,...i})}),X4=W4,Y4=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(gE,{}),classModifier:"alert-success"},warning:{icon:x.jsx(vE,{}),classModifier:"alert-warning"},info:{icon:x.jsx(Qy,{}),classModifier:"alert-info"},danger:{icon:x.jsx(yE,{}),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=Y4,q4=E.forwardRef(({children:t,render:e,isFullscreen:r=!1,...i},s)=>{const n=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":r});return x.jsxs("div",{ref:s,className:n,...i,children:[t,e?x.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:e()}):null]})}),r8=q4;function Hw({appCode:t}){return vb({queryKey:["conf"],queryFn:async()=>await Ae.conf().getConf(t),suspense:!0})}function Z4(t){return{getPreference:async()=>await Ae.conf().getPreference(t),savePreference:async e=>await Ae.conf().savePreference(t,JSON.stringify(e))}}function K4(){const[t,e]=E.useState(!1),{getPreference:r,savePreference:i}=Z4("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 Q4(){return vb({queryKey:["session"],queryFn:async()=>await Ae.session().getSession(),suspense:!0})}const Vw=E.createContext(null);function i8({children:t,params:e}){const r=e.app,{t:i}=Ce(),s=i(r),n=Q4(),a=Hw({appCode:r}),{showCookiesConsent:o,handleConsultCookies:l,handleCloseCookiesConsent:c}=K4(),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(Vw.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(Vw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}const Ww=E.createContext(null);function s8({children:t}){var e;const{appCode:r}=mt(),i=Hw({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(Ww.Provider,{value:s,children:t})}function Om(){const t=E.useContext(Ww);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}function J4(){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 e5=E.createContext(null);function t5(){return E.useContext(e5)}function Cy(...t){return e=>{r5(e,...t)}}function r5(t,...e){e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}const n8=(t,e)=>{const r=e==null?void 0:e.filter(i=>i.id===t&&i.available);return r&&r.length>0},Xw={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};function fo(t){const e=t5(),[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 Ae.rights().sessionHasWorkflowRight(t):s=await Ae.rights().sessionHasWorkflowRights(t);i(s)})()},[t,e]),r}const i5=()=>{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 Ae.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 Ae.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="";Ae.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}},s5=i5,Iy=["mousedown","touchstart"];function Yw(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||Iy).forEach(n=>{document.addEventListener(n,s)}),()=>{(e||Iy).forEach(n=>{document.removeEventListener(n,s)})}},[i,t,r,e]),i}function n5(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 a5=(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}=zT({placement:t,open:i,onOpenChange:s,whileElementsMounted:IT,middleware:[cT(4),PT({apply({rects:T,elements:M}){M.floating.style,`${T.reference.width}`}}),RT({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 T=Object.values(d.current)[n];if(T){const M=T.getAttribute("id");l(M),T.focus()}}},[n]);const p=()=>{const T=Object.values(d.current).length;a(M=>(M+1)%T)},m=()=>{const T=Object.values(d.current).length;a(M=>(M-1+T)%T)},g=()=>{a(0)},y=()=>{const T=Object.values(d.current).length;a(T-1)},_=E.useCallback(()=>{s(!0)},[]),v=E.useCallback(()=>{u.current&&(u.current.focus({preventScroll:!0}),s(!1))},[]),b=(T,M)=>{T&&(M.stopPropagation(),M.preventDefault())},w=E.useCallback(T=>{let M=!1;switch(T.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(T),b(M,T)},[v,_]),A=T=>{const M=Object.values(d.current).findIndex(I=>I.id===T.currentTarget.getAttribute("id"));a(M)},S=E.useCallback((T,M)=>{let I=!1;if(T.shiftKey)T.key==="Tab"&&(v(),I=!0);else{switch(T.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,T)}},[n,v]),C=E.useCallback(T=>{s(i!==!0),T.stopPropagation(),T.preventDefault()},[i]);return{isFocused:o,visible:i,itemRefs:d,triggerRef:u,menuRef:f,triggerProps:{ref:Cy(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:Cy(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:S},setVisible:s}},o5=a5,l5=()=>{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}},c5=l5,cc="top-right";function bl(){return{success:(t,e)=>Sa.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)??cc}),error:(t,e)=>Sa.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)??cc}),info:(t,e)=>Sa.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)??cc}),warning:(t,e)=>Sa.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)??cc}),loading:Sa.loading}}function qw(){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 h5({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 u5(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 a8(){const t=document.querySelector("html");return()=>{t&&t.scrollIntoView()}}function d5(t=!1){const[e,r]=E.useState(t),i=E.useCallback(()=>{r(s=>!s)},[]);return[e,i]}function f5(){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 p5({user:t,avatar:e}){const{appCode:r}=mt(),{t:i}=Ce(),s=i(r),[n,a]=E.useState(!0),[o,l]=qw(),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=J4(),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 Ae.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 m5(){const[t,e]=E.useState(!1);E.useEffect(()=>{r()},[]);const r=E.useCallback(async()=>{const i=await Ae.session().isAdml();e(i)},[]);return{isAdml:t}}const g5=()=>{var t;const{user:e,appCode:r}=mt(),i=Xw[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}`}},o8=g5;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}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 Zw(){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 l8(){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 Ae.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 v5=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}=h5({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}),nu=v5,y5=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(nu,{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=y5,b5=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(nu,{src:i||c,alt:r,imgPlaceholder:c,...a})})}),da=b5,x5=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})}),hc=x5,_5=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})}),w5=_5,E5=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})}),S5=E5,T5=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=T5,A5=E.forwardRef(({app:t,name:e},r)=>{const{t:i}=Ce();return x.jsx(S5,{app:t,ref:r,className:"mw-100",children:x.jsx(w5,{className:"gap-12 mw-100",children:e?x.jsxs(x.Fragment,{children:[x.jsx(hc,{children:x.jsx("a",{href:t==null?void 0:t.address,className:"d-flex",children:x.jsx(Ho,{app:t,size:"40"})})}),x.jsx(hc,{children:x.jsx(Pd,{})}),x.jsx(hc,{className:"text-truncate",children:x.jsx(ur,{level:"h1",headingStyle:"h3",className:"text-truncate",children:e})})]}):x.jsxs(hc,{className:"gap-12 d-flex align-items-center",children:[x.jsx("a",{href:t==null?void 0:t.address,className:"d-flex",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)})]})})})}),c8=A5,C5=({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})},I5=C5,Kw=E.createContext(null),Qw=()=>{const t=E.useContext(Kw);if(!t)throw new Error("Cannot be rendered outside the Card component");return t},R5=({children:t})=>x.jsx("div",{className:"card-footer gap-16",children:t}),P5=R5,M5=()=>{const{isSelectable:t,isClickable:e,onClick:r,onSelect:i}=Qw();return t||e?x.jsxs("div",{className:"card-header",children:[t?x.jsx(ua,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:x.jsx(_E,{}),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},O5=M5,k5=({imageSrc:t,className:e,variant:r="medium"})=>{const{app:i}=Qw(),s=r==="landscape"?{width:"100%",height:"auto"}:null;return x.jsx("div",{className:re("card-image",r),children:t?x.jsx(nu,{alt:"",src:t,objectFit:"cover",className:re("h-full w-100",e)}):x.jsx(Ho,{app:i,iconFit:"ratio",size:"80",variant:"rounded",...s})})},D5=k5,N5=({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})},L5=N5,B5=({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})})},F5=B5,U5=({userSrc:t,creatorName:e})=>t?x.jsx(da,{alt:e||"",size:"xs",src:t,variant:"circle",width:"24",height:"24"}):x.jsx(Ax,{}),j5=U5,$5=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(Kw.Provider,{value:f,children:x.jsxs("div",{ref:l,className:re("card",{"is-selected":i,"c-pointer":r},o),children:[x.jsx(Jw.Header,{}),typeof a=="function"?a(h):a]})})}),Jw=Object.assign($5,{Title:F5,Text:L5,Image:D5,Body:I5,User:j5,Footer:P5,Header:O5}),h8=Jw,G5=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=G5,z5=({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}=w2(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})]})]})},H5=z5,eE=E.createContext(null),Ea=()=>{const t=E.useContext(eE);if(!t)throw new Error("Cannot be rendered outside the Dropdown Component");return t},tE=E.createContext(null),au=()=>{const t=E.useContext(tE);if(!t)throw new Error("Cannot be rendered outside the FormControl component");return t},V5=({children:t})=>{const{status:e}=au(),r=re("form-text",{"is-invalid":e==="invalid",valid:e==="valid"});return x.jsx("p",{className:r,children:x.jsx("em",{children:t})})},W5=V5,X5=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}=au(),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})}),Qs=X5,Y5=E.forwardRef(({leftIcon:t,optionalText:e="Optional",requiredText:r="*",children:i,className:s},n)=>{const{id:a,isOptional:o,isRequired:l}=au(),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=Y5,q5=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(tE.Provider,{value:c,children:x.jsx("div",{ref:l,className:e,...o,children:t})})}),Z5=Object.assign(q5,{Label:Nn,Input:Qs,Text:W5}),ot=Z5,K5=({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(ot,{className:"d-flex align-items-center",id:"search",children:x.jsx(Qs,{...o,className:"max-w-512",noValidationIcon:!0,placeholder:t,size:"md",type:"search",onKeyDown:n.onMenuItemKeyDown})})},Q5=K5,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})]})})},e6=J5,t6=({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]})})},r6=t6,i6=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}),s6=i6,n6=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]})),a6=n6,o6=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})]})}),Ep=o6,l6=({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(Ep,{...h,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})},c6=l6,h6=()=>x.jsx("div",{role:"separator",className:"px-4",children:x.jsx("hr",{className:"m-0"})}),u6=h6,d6=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(wE,{width:16,height:16,className:"dropdown-toggle-caret"})]})}),f6=d6,p6=({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}=o5(i,s),u=Yw(()=>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(eE.Provider,{value:d,children:x.jsx("div",{ref:u,className:p,children:typeof t=="function"?t(o,h):t})})},m6=Object.assign(p6,{Trigger:f6,Menu:s6,Item:r6,Separator:u6,CheckboxItem:e6,RadioItem:c6,MenuGroup:a6}),lt=m6,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(zw,{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(lt.Item,{type:"select",icon:d.icon,onClick:()=>f(d.value),children:d.label}),p<r.length-1&&x.jsx(lt.Separator,{})]},p));return x.jsxs(lt,{block:!0,children:[x.jsx(Nm.Trigger,{placeholder:o,searchMinLength:a,handleSearchInputChange:e,value:i}),x.jsx(lt.Menu,{children:u()})]})};Nm.Trigger=Q5;const g6=Nm,v6=({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})]})},u8=v6,y6=({children:t,className:e,...r})=>{const i=re("grid",e);return x.jsx("div",{className:i,...r,children:t})},b6=({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})};y6.Col=b6;const x6=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}=c5();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(ot,{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(ua,{"aria-label":e,color:"tertiary",icon:x.jsx(pE,{}),onClick:_,type:"button",variant:"ghost"}),x.jsx(ua,{"aria-label":r,color:"danger",disabled:!c,icon:x.jsx(mE,{width:"20",height:"20"}),onClick:v,type:"button",variant:"ghost"})]}),x.jsxs(ot.Label,{children:[x.jsx("span",{className:"visually-hidden",children:t}),x.jsx(Qs,{accept:"image/*",hidden:!0,onChange:p,ref:f,size:"sm",type:"file"}),c?x.jsx(da,{alt:"",src:c,size:"xl"}):x.jsx(Ho,{app:n,iconFit:"ratio",size:"160",variant:"rounded"})]})]})}),rE=x6,_6=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"})]})}),Lm=_6,w6=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"})})}),Ry=w6,iE=E.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""}),sE=()=>{const t=E.useContext(iE);if(!t)throw new Error("Cannot be rendered outside the Modal component");return t},E6=t=>{const{ariaDescriptionId:e}=sE(),{children:r,className:i}=t,s=re("modal-body",i);return x.jsx("div",{id:e,className:s,children:r})},S6=E6,T6=t=>x.jsx("div",{className:"modal-footer",children:t.children}),A6=T6,C6=t=>{const{onModalClose:e,children:r}=t,{ariaLabelId:i,focusId:s}=sE(),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(ua,{ref:n,"aria-label":"Close",color:"tertiary",icon:x.jsx(Jy,{}),type:"button",variant:"ghost",title:"Delete",onClick:e,className:"btn-close"})]})},I6=C6,R6=t=>x.jsx("p",{className:"modal-subtitle",children:t.children}),P6=R6,M6=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=Yw(s),d=f5();u5(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=mx(i,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return x.jsx(iE.Provider,{value:g,children:y((_,v)=>x.jsxs(x.Fragment,{children:[v&&x.jsx(cf.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(cf.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),O6=Object.assign(M6,{Header:I6,Subtitle:P6,Body:S6,Footer:A6}),je=O6,k6=({children:t,className:e})=>{const r=re("popover-body",e);return x.jsx("div",{className:r,children:t})},D6=({children:t,className:e})=>{const r=re("popover-footer p-8",e);return x.jsx("div",{className:r,children:t})},nE=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 mx(i,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((o,l)=>l&&x.jsx(cf.div,{ref:n,"aria-labelledby":r,className:a,role:"tooltip",style:o,...s,children:t}))}),N6=t=>x.jsx(lt.Trigger,{...t,"aria-haspopup":"listbox",role:"combobox"}),L6=N6,B6=({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(lt,{overflow:r,block:i,children:[x.jsx(L6,{icon:t,label:f(u||o),variant:s,size:n,disabled:a}),x.jsx(lt.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(lt.Item,{type:"action",onClick:()=>h(d),children:m},p)})})]})},aE=B6,F6=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}=au(),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})}),oE=F6;function U6(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 j6=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}=U6(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(S=>S===e&&e!==A?(d(!0),S===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(Pd,{title:"RafterRight",width:b,height:b}),Array.isArray(i)&&u&&x.jsx(po,{title:"RafterDown",width:b,height:b}),!Array.isArray(i)&&x.jsx(Pd,{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(EE,{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()},$6=j6,G6=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($6,{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)})}),d8=G6,z6=E.forwardRef(({children:t},e)=>x.jsx("span",{className:"visually-hidden",ref:e,children:t})),Hi=z6,H6=async t=>await Ae.conf().getPreference(t),V6=async t=>await Ae.conf().savePreference(t,JSON.stringify({showOnboardingTrash:!1})),W6=t=>{const[e,r]=E.useState(!0),[i,s]=E.useState(!1);return E.useEffect(()=>{(async()=>{const n=await H6(t);if(n){const{showOnboardingTrash:a}=n;s(a);return}s(!0)})()},[t]),{isOpen:e,setIsOpen:r,isOnboardingTrash:i,handleSavePreference:async()=>{await V6(t),r(!1)}}},X6=({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}=W6(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($x,{modules:[K2],onSwiper:y=>{n(y)},onSlideChange:y=>{o(y.progress)},pagination:{clickable:!0},children:e.map((y,_)=>x.jsxs(Gx,{children:[x.jsx(nu,{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},f8=X6,Y6=()=>{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")}]},q6=({control:t,selectedActivities:e,selectActivities:r})=>{const i=Y6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(xh,{name:"activityType",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(lt,{block:!0,overflow:!0,children:[x.jsx(lt.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:e==null?void 0:e.length}),x.jsx(lt.Menu,{children:i.map((a,o)=>x.jsx(lt.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})},Z6=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],Py=({name:t,control:e,placeholderOption:r,validate:i})=>x.jsx(xh,{name:t,control:e,rules:{required:!0,validate:i},render:({field:{onChange:s}})=>x.jsx(aE,{block:!0,size:"md",onValueChange:s,options:Z6,"aria-required":!0,placeholderOption:r})}),K6=()=>{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")}]},Q6="bpr.form.publication.language",J6=({control:t})=>{const e=K6();return x.jsx("div",{className:"col",children:x.jsx(xh,{name:"language",control:t,rules:{required:!0},render:({field:{onChange:r}})=>x.jsx(aE,{block:!0,size:"md",onValueChange:r,options:e,"aria-required":!0,placeholderOption:Q6})})})},eU=()=>{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")})]})},tU=()=>{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")}]},rU=({control:t,selectedSubjectAreas:e,selectSubjects:r})=>{const i=tU(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(xh,{name:"subjectArea",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(lt,{block:!0,overflow:!0,children:[x.jsx(lt.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:e==null?void 0:e.length}),x.jsx(lt.Menu,{children:i.map((a,o)=>x.jsx(lt.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})};function My({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 iU({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 sU({onSuccess:t,resource:e}){const{user:r,appCode:i}=mt(),s=bl(),[n,a]=E.useState((e==null?void 0:e.thumbnail)||"");E.useEffect(()=>{a(e==null?void 0:e.thumbnail)},[e]);const{control:o,register:l,watch:c,setValue:h,handleSubmit:f,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m}}=Ky({mode:"onChange"}),[g,y]=E.useState([]),[_,v]=E.useState([]),b=(w,A,S)=>{let C=[...A];const T=C.findIndex(M=>M===w);A.includes(w)?C=A.filter((M,I)=>I!==T):C=[...A,w],S(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 S=new Blob;typeof n=="string"?S=await Ae.http().get(n,{responseType:"blob"}):n?S=await Ae.http().get(URL.createObjectURL(n),{responseType:"blob"}):e!=null&&e.thumbnail&&(S=await Ae.http().get(e==null?void 0:e.thumbnail,{responseType:"blob"}));const C=await Ae.http().get(`/userbook/avatar/${A}?thumbnail=48x48`,{responseType:"blob"}),T=await Ae.http().get(`/directory/user/${A}/attachment-school`,{responseType:"json"}),M=Xw[i],I={activityType:g,age:[w.ageMin,w.ageMax],application:M,cover:S,description:w.description,keyWords:w.keyWords,language:w.language,licence:"CC-BY",resourceId:e==null?void 0:e.assetId,resourceEntId:e==null?void 0:e.assetId,subjectArea:_,teacherAvatar:C,title:w.title,userId:A,userStructureName:T.name||(r==null?void 0:r.structureNames[0])},k=await Ae.resource(i).publish(I);k.success?s.success(x.jsx(iU,{result:k}),{duration:1e4}):s.error(x.jsx(My,{formData:w})),t==null||t()}catch(S){console.error(S),s.error(x.jsx(My,{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}}const nU=(t,e)=>{const[r,i]=E.useState(null);return E.useEffect(()=>{if(e===""){console.warn("resourceId must be an assetId and not an empty string");return}(async()=>{const s=[e],n=await Ae.resource(t).searchContext({application:t,filters:{folder:void 0,owner:void 0,shared:void 0,public:void 0},pagination:{startIdx:0,pageSize:s.length},types:[t],asset_id:s});i(n.resources[0])})()},[]),r},Bm=nU;function p8({isOpen:t,resourceId:e,onSuccess:r,onCancel:i}){const{appCode:s,currentApp:n}=mt(),{t:a}=Ce(),o=Bm(s,e),{control:l,cover:c,formState:{isDirty:h,isValid:f,isSubmitting:u},handleDeleteImage:d,handleSubmit:p,handleUploadImage:m,handlePublish:g,register:y,selectActivities:_,selectedActivities:v,selectedSubjectAreas:b,selectSubjects:w}=sU({resource:o,onSuccess:r});return o?rs.createPortal(x.jsxs(je,{isOpen:t,onModalClose:i,id:"libraryModal",size:"lg",children:[x.jsx(je.Header,{onModalClose:i,children:a("bpr.publish")}),x.jsx(je.Subtitle,{children:a("bpr.form.tip")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.heading.general")}),x.jsxs("form",{id:"libraryModalForm",onSubmit:p(g),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:a("bpr.form.publication.cover.title")}),x.jsx(rE,{app:n,src:o==null?void 0:o.thumbnail,label:a("bpr.form.publication.cover.upload.label"),addButtonLabel:a("bpr.form.publication.cover.upload.add"),deleteButtonLabel:a("bpr.form.publication.cover.upload.remove"),onUploadImage:m,onDeleteImage:d,className:"align-self-center"}),!c&&x.jsx("p",{className:"form-text is-invalid",children:x.jsx("em",{children:a("bpr.form.publication.cover.upload.required.image")})})]}),x.jsxs("div",{className:"flex-fill",children:[x.jsxs(ot,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.title")}),x.jsx(Qs,{type:"text",defaultValue:o==null?void 0:o.name,...y("title",{required:!0}),placeholder:a("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ot,{id:"description",isRequired:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.description")}),x.jsx(oE,{...y("description",{required:!0}),placeholder:a("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.heading.infos")}),x.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[x.jsx(q6,{control:l,selectedActivities:v,selectActivities:_}),x.jsx(rU,{control:l,selectedSubjectAreas:b,selectSubjects:w}),x.jsx(J6,{control:l})]}),x.jsxs("div",{className:"mb-24",children:[x.jsx("label",{htmlFor:"",className:"form-label",children:a("bpr.form.publication.age")}),x.jsxs("div",{className:"d-flex gap-8",children:[x.jsx("div",{className:"col col-2",children:x.jsx(Py,{control:l,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(C,T)=>parseInt(C)<=parseInt(T.ageMax)})}),x.jsx("div",{className:"col col-2",children:x.jsx(Py,{control:l,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(C,T)=>parseInt(C)>=parseInt(T.ageMin)})})]})]}),x.jsx("div",{className:"mb-24",children:x.jsxs(ot,{id:"keywords",isOptional:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.keywords")}),x.jsx(Qs,{type:"text",...y("keyWords"),size:"md",placeholder:a("bpr.form.publication.keywords.placeholder")})]})}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.licence.text")}),x.jsx(eU,{})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:i,type:"button",variant:"ghost",children:a("cancel")}),x.jsx(tt,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:u,disabled:!c||u||!h||!f,children:a("bpr.form.submit")})]})]}),document.getElementById("portal")):x.jsx(Lm,{})}const aU=({isUpdating:t,selectedResource:e})=>{const[r,i]=E.useState(t&&(e==null?void 0:e.thumbnail)||"");return E.useEffect(()=>{i((e==null?void 0:e.thumbnail)||"")},[e]),{thumbnail:r,handleDeleteImage:()=>i(""),handleUploadImage:s=>i(s)}},oU=({isOpen:t,onCancel:e,onSuccess:r,children:i,...s})=>{const{appCode:n,currentApp:a}=mt(),{t:o}=Ce(),{mode:l}=s,c=bl(),h=E.useId(),f=l==="create",u=l==="update",d=Bm(n,u?s.resourceId:""),{watch:p,register:m,handleSubmit:g,setValue:y,formState:{isSubmitting:_,isValid:v}}=Ky({mode:"onChange",defaultValues:{description:u?d==null?void 0:d.description:"",enablePublic:u?d==null?void 0:d.public:!1,title:u?d==null?void 0:d.name:"",formSlug:u?d==null?void 0:d.slug:""}}),{thumbnail:b,handleDeleteImage:w,handleUploadImage:A}=aU({isUpdating:u,selectedResource:u?d:void 0}),S=async function(C){var T,M;try{const I={description:C.description||"",name:C.title,public:C.enablePublic,slug:C.enablePublic&&C.formSlug||"",thumbnail:b};if(f){const k={...I,folder:((T=s.currentFolder)==null?void 0:T.id)==="default"?void 0:parseInt(((M=s.currentFolder)==null?void 0:M.id)||""),application:n};s.createResource?await s.createResource.mutateAsync(k):await Ae.resource(n).create(k)}else{const k={...I,entId:d.assetId,trashed:d.trashed};s.updateResource?await s.updateResource.mutateAsync(k):await Ae.resource(n).update(k)}c.success(x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:o(f?"explorer.resource.created":"explorer.resource.updated")}),x.jsxs("p",{children:[o("title")," : ",C.title]}),x.jsxs("p",{children:[o("description")," : ",C.description]}),n==="blog"&&x.jsxs("p",{children:["Public:",C.enablePublic?o("explorer.enable.public.yes"):o("explorer.enable.public.no")]})]})),r()}catch(I){console.error(I)}};return u&&!d?x.jsx(Lm,{}):rs.createPortal(x.jsxs(je,{id:`${l}-resource`,size:"lg",isOpen:t,onModalClose:e,children:[x.jsx(je.Header,{onModalClose:e,children:o(`explorer.resource.editModal.header.${f?"create":"edit"}`)}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:o("explorer.resource.editModal.heading.general")}),x.jsxs("form",{id:h,onSubmit:g(S),children:[x.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[x.jsx("div",{children:x.jsx(rE,{app:a,src:u&&(d==null?void 0:d.thumbnail)||"",label:o("explorer.imagepicker.label"),addButtonLabel:o("explorer.imagepicker.button.add"),deleteButtonLabel:o("explorer.imagepicker.button.delete"),onUploadImage:A,onDeleteImage:w,className:"align-self-center mt-8"})}),x.jsxs("div",{className:"col",children:[x.jsxs(ot,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:o("title")}),x.jsx(Qs,{type:"text",defaultValue:u?d==null?void 0:d.name:"",...m("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:o("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ot,{id:"description",isOptional:!0,children:[x.jsx(Nn,{children:o("description")}),x.jsx(oE,{defaultValue:u?d==null?void 0:d.description:"",...m("description"),placeholder:o("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),typeof i=="function"?i(d,u,p,y,m):i]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:e,type:"button",variant:"ghost",children:o("explorer.cancel")}),x.jsx(tt,{form:h,type:"submit",color:"primary",isLoading:_,variant:"filled",disabled:!v||_,children:o(f?"explorer.create":"save")})]})]}),document.getElementById("portal"))},m8=oU,lU=({application:t,options:e})=>yb({mutationFn:async r=>await Ae.resource(t).update(r),...e}),g8=lU,Oy=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 cU(t,e){e?e={...Oy,...e}:e=Oy;const r=lE(e);return r.dispatch(t),r.toString()}const hU=Object.freeze(["prototype","__proto__","constructor"]);function lE(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&&!ky(s)&&(h=hU),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=lE(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:"),ky(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
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=PN(e)),typeof e=="number"?RN(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}};wp.availableFonts={},wp.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 Ad=wp;const lc=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 Ad?(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=Ad.from(e)):(this.ownsStyle=!0,this._style=new Ad(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(/&nbsp;/gi,"&#160;")}};lc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},lc.defaultMaxWidth=2024,lc.defaultMaxHeight=2024,lc.defaultAutoResolution=!0;const G4=E.forwardRef(({children:t},e)=>x.jsx("div",{ref:e,className:"actionbar",children:t})),t8=G4,z4=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(bE,{...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()]})}),zw=z4,H4=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(zw,{isLoading:!0,loadingIcon:n,loadingPosition:a,children:i}):x.jsxs("span",{children:[o,i,l]})})}),tt=H4,V4=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})}),ua=V4,W4=E.forwardRef(({icon:t=x.jsx(xE,{}),onClick:e,className:r,...i},s)=>{const n=re("btn-search",r);return x.jsx(ua,{ref:s,className:n,icon:t,onClick:e,...i})}),X4=W4,Y4=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(gE,{}),classModifier:"alert-success"},warning:{icon:x.jsx(vE,{}),classModifier:"alert-warning"},info:{icon:x.jsx(Qy,{}),classModifier:"alert-info"},danger:{icon:x.jsx(yE,{}),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=Y4,q4=E.forwardRef(({children:t,render:e,isFullscreen:r=!1,...i},s)=>{const n=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":r});return x.jsxs("div",{ref:s,className:n,...i,children:[t,e?x.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:e()}):null]})}),r8=q4;function Hw({appCode:t}){return vb({queryKey:["conf"],queryFn:async()=>await Ae.conf().getConf(t),suspense:!0})}function Z4(t){return{getPreference:async()=>await Ae.conf().getPreference(t),savePreference:async e=>await Ae.conf().savePreference(t,JSON.stringify(e))}}function K4(){const[t,e]=E.useState(!1),{getPreference:r,savePreference:i}=Z4("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 Q4(){return vb({queryKey:["session"],queryFn:async()=>await Ae.session().getSession(),suspense:!0})}const Vw=E.createContext(null);function i8({children:t,params:e}){const r=e.app,{t:i}=Ce(),s=i(r),n=Q4(),a=Hw({appCode:r}),{showCookiesConsent:o,handleConsultCookies:l,handleCloseCookiesConsent:c}=K4(),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(Vw.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(Vw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}const Ww=E.createContext(null);function s8({children:t}){var e;const{appCode:r}=mt(),i=Hw({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(Ww.Provider,{value:s,children:t})}function Om(){const t=E.useContext(Ww);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}function J4(){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 e5=E.createContext(null);function t5(){return E.useContext(e5)}function Cy(...t){return e=>{r5(e,...t)}}function r5(t,...e){e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}const n8=(t,e)=>{const r=e==null?void 0:e.filter(i=>i.id===t&&i.available);return r&&r.length>0},Xw={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};function fo(t){const e=t5(),[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 Ae.rights().sessionHasWorkflowRight(t):s=await Ae.rights().sessionHasWorkflowRights(t);i(s)})()},[t,e]),r}const i5=()=>{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 Ae.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 Ae.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="";Ae.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}},s5=i5,Iy=["mousedown","touchstart"];function Yw(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||Iy).forEach(n=>{document.addEventListener(n,s)}),()=>{(e||Iy).forEach(n=>{document.removeEventListener(n,s)})}},[i,t,r,e]),i}function n5(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 a5=(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}=zT({placement:t,open:i,onOpenChange:s,whileElementsMounted:IT,middleware:[cT(4),PT({apply({rects:T,elements:M}){M.floating.style,`${T.reference.width}`}}),RT({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 T=Object.values(d.current)[n];if(T){const M=T.getAttribute("id");l(M),T.focus()}}},[n]);const p=()=>{const T=Object.values(d.current).length;a(M=>(M+1)%T)},m=()=>{const T=Object.values(d.current).length;a(M=>(M-1+T)%T)},g=()=>{a(0)},y=()=>{const T=Object.values(d.current).length;a(T-1)},_=E.useCallback(()=>{s(!0)},[]),v=E.useCallback(()=>{u.current&&(u.current.focus({preventScroll:!0}),s(!1))},[]),b=(T,M)=>{T&&(M.stopPropagation(),M.preventDefault())},w=E.useCallback(T=>{let M=!1;switch(T.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(T),b(M,T)},[v,_]),A=T=>{const M=Object.values(d.current).findIndex(I=>I.id===T.currentTarget.getAttribute("id"));a(M)},S=E.useCallback((T,M)=>{let I=!1;if(T.shiftKey)T.key==="Tab"&&(v(),I=!0);else{switch(T.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,T)}},[n,v]),C=E.useCallback(T=>{s(i!==!0),T.stopPropagation(),T.preventDefault()},[i]);return{isFocused:o,visible:i,itemRefs:d,triggerRef:u,menuRef:f,triggerProps:{ref:Cy(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:Cy(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:S},setVisible:s}},o5=a5,l5=()=>{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}},c5=l5,cc="top-right";function bl(){return{success:(t,e)=>Sa.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)??cc}),error:(t,e)=>Sa.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)??cc}),info:(t,e)=>Sa.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)??cc}),warning:(t,e)=>Sa.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)??cc}),loading:Sa.loading}}function qw(){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 h5({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 u5(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 a8(){const t=document.querySelector("html");return()=>{t&&t.scrollIntoView()}}function d5(t=!1){const[e,r]=E.useState(t),i=E.useCallback(()=>{r(s=>!s)},[]);return[e,i]}function f5(){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 p5({user:t,avatar:e}){const{appCode:r}=mt(),{t:i}=Ce(),s=i(r),[n,a]=E.useState(!0),[o,l]=qw(),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=J4(),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 Ae.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 m5(){const[t,e]=E.useState(!1);E.useEffect(()=>{r()},[]);const r=E.useCallback(async()=>{const i=await Ae.session().isAdml();e(i)},[]);return{isAdml:t}}const g5=()=>{var t;const{user:e,appCode:r}=mt(),i=Xw[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}`}},o8=g5;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}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 Zw(){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 l8(){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 Ae.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 v5=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}=h5({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}),nu=v5,y5=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(nu,{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=y5,b5=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(nu,{src:i||c,alt:r,imgPlaceholder:c,...a})})}),da=b5,x5=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})}),hc=x5,_5=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})}),w5=_5,E5=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})}),S5=E5,T5=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=T5,A5=E.forwardRef(({app:t,name:e},r)=>{const{t:i}=Ce();return x.jsx(S5,{app:t,ref:r,className:"mw-100",children:x.jsx(w5,{className:"gap-12 mw-100",children:e?x.jsxs(x.Fragment,{children:[x.jsx(hc,{children:x.jsx("a",{href:t==null?void 0:t.address,className:"d-flex",children:x.jsx(Ho,{app:t,size:"40"})})}),x.jsx(hc,{children:x.jsx(Pd,{color:"var(--edifice-gray-600)",width:20,height:20})}),x.jsx(hc,{className:"text-truncate",children:x.jsx(ur,{level:"h1",headingStyle:"h3",className:"text-truncate",children:e})})]}):x.jsxs(hc,{className:"gap-12 d-flex align-items-center",children:[x.jsx("a",{href:t==null?void 0:t.address,className:"d-flex",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)})]})})})}),c8=A5,C5=({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})},I5=C5,Kw=E.createContext(null),Qw=()=>{const t=E.useContext(Kw);if(!t)throw new Error("Cannot be rendered outside the Card component");return t},R5=({children:t})=>x.jsx("div",{className:"card-footer gap-16",children:t}),P5=R5,M5=()=>{const{isSelectable:t,isClickable:e,onClick:r,onSelect:i}=Qw();return t||e?x.jsxs("div",{className:"card-header",children:[t?x.jsx(ua,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:x.jsx(_E,{}),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},O5=M5,k5=({imageSrc:t,className:e,variant:r="medium"})=>{const{app:i}=Qw(),s=r==="landscape"?{width:"100%",height:"auto"}:null;return x.jsx("div",{className:re("card-image",r),children:t?x.jsx(nu,{alt:"",src:t,objectFit:"cover",className:re("h-full w-100",e)}):x.jsx(Ho,{app:i,iconFit:"ratio",size:"80",variant:"rounded",...s})})},D5=k5,N5=({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})},L5=N5,B5=({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})})},F5=B5,U5=({userSrc:t,creatorName:e})=>t?x.jsx(da,{alt:e||"",size:"xs",src:t,variant:"circle",width:"24",height:"24"}):x.jsx(Ax,{}),j5=U5,$5=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(Kw.Provider,{value:f,children:x.jsxs("div",{ref:l,className:re("card",{"is-selected":i,"c-pointer":r},o),children:[x.jsx(Jw.Header,{}),typeof a=="function"?a(h):a]})})}),Jw=Object.assign($5,{Title:F5,Text:L5,Image:D5,Body:I5,User:j5,Footer:P5,Header:O5}),h8=Jw,G5=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=G5,z5=({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}=w2(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})]})]})},H5=z5,eE=E.createContext(null),Ea=()=>{const t=E.useContext(eE);if(!t)throw new Error("Cannot be rendered outside the Dropdown Component");return t},tE=E.createContext(null),au=()=>{const t=E.useContext(tE);if(!t)throw new Error("Cannot be rendered outside the FormControl component");return t},V5=({children:t})=>{const{status:e}=au(),r=re("form-text",{"is-invalid":e==="invalid",valid:e==="valid"});return x.jsx("p",{className:r,children:x.jsx("em",{children:t})})},W5=V5,X5=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}=au(),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})}),Qs=X5,Y5=E.forwardRef(({leftIcon:t,optionalText:e="Optional",requiredText:r="*",children:i,className:s},n)=>{const{id:a,isOptional:o,isRequired:l}=au(),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=Y5,q5=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(tE.Provider,{value:c,children:x.jsx("div",{ref:l,className:e,...o,children:t})})}),Z5=Object.assign(q5,{Label:Nn,Input:Qs,Text:W5}),ot=Z5,K5=({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(ot,{className:"d-flex align-items-center",id:"search",children:x.jsx(Qs,{...o,className:"max-w-512",noValidationIcon:!0,placeholder:t,size:"md",type:"search",onKeyDown:n.onMenuItemKeyDown})})},Q5=K5,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})]})})},e6=J5,t6=({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]})})},r6=t6,i6=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}),s6=i6,n6=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]})),a6=n6,o6=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})]})}),Ep=o6,l6=({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(Ep,{...h,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})},c6=l6,h6=()=>x.jsx("div",{role:"separator",className:"px-4",children:x.jsx("hr",{className:"m-0"})}),u6=h6,d6=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(wE,{width:16,height:16,className:"dropdown-toggle-caret"})]})}),f6=d6,p6=({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}=o5(i,s),u=Yw(()=>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(eE.Provider,{value:d,children:x.jsx("div",{ref:u,className:p,children:typeof t=="function"?t(o,h):t})})},m6=Object.assign(p6,{Trigger:f6,Menu:s6,Item:r6,Separator:u6,CheckboxItem:e6,RadioItem:c6,MenuGroup:a6}),lt=m6,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(zw,{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(lt.Item,{type:"select",icon:d.icon,onClick:()=>f(d.value),children:d.label}),p<r.length-1&&x.jsx(lt.Separator,{})]},p));return x.jsxs(lt,{block:!0,children:[x.jsx(Nm.Trigger,{placeholder:o,searchMinLength:a,handleSearchInputChange:e,value:i}),x.jsx(lt.Menu,{children:u()})]})};Nm.Trigger=Q5;const g6=Nm,v6=({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})]})},u8=v6,y6=({children:t,className:e,...r})=>{const i=re("grid",e);return x.jsx("div",{className:i,...r,children:t})},b6=({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})};y6.Col=b6;const x6=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}=c5();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(ot,{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(ua,{"aria-label":e,color:"tertiary",icon:x.jsx(pE,{}),onClick:_,type:"button",variant:"ghost"}),x.jsx(ua,{"aria-label":r,color:"danger",disabled:!c,icon:x.jsx(mE,{width:"20",height:"20"}),onClick:v,type:"button",variant:"ghost"})]}),x.jsxs(ot.Label,{children:[x.jsx("span",{className:"visually-hidden",children:t}),x.jsx(Qs,{accept:"image/*",hidden:!0,onChange:p,ref:f,size:"sm",type:"file"}),c?x.jsx(da,{alt:"",src:c,size:"xl"}):x.jsx(Ho,{app:n,iconFit:"ratio",size:"160",variant:"rounded"})]})]})}),rE=x6,_6=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"})]})}),Lm=_6,w6=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"})})}),Ry=w6,iE=E.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""}),sE=()=>{const t=E.useContext(iE);if(!t)throw new Error("Cannot be rendered outside the Modal component");return t},E6=t=>{const{ariaDescriptionId:e}=sE(),{children:r,className:i}=t,s=re("modal-body",i);return x.jsx("div",{id:e,className:s,children:r})},S6=E6,T6=t=>x.jsx("div",{className:"modal-footer",children:t.children}),A6=T6,C6=t=>{const{onModalClose:e,children:r}=t,{ariaLabelId:i,focusId:s}=sE(),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(ua,{ref:n,"aria-label":"Close",color:"tertiary",icon:x.jsx(Jy,{}),type:"button",variant:"ghost",title:"Delete",onClick:e,className:"btn-close"})]})},I6=C6,R6=t=>x.jsx("p",{className:"modal-subtitle",children:t.children}),P6=R6,M6=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=Yw(s),d=f5();u5(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=mx(i,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return x.jsx(iE.Provider,{value:g,children:y((_,v)=>x.jsxs(x.Fragment,{children:[v&&x.jsx(cf.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(cf.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),O6=Object.assign(M6,{Header:I6,Subtitle:P6,Body:S6,Footer:A6}),je=O6,k6=({children:t,className:e})=>{const r=re("popover-body",e);return x.jsx("div",{className:r,children:t})},D6=({children:t,className:e})=>{const r=re("popover-footer p-8",e);return x.jsx("div",{className:r,children:t})},nE=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 mx(i,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((o,l)=>l&&x.jsx(cf.div,{ref:n,"aria-labelledby":r,className:a,role:"tooltip",style:o,...s,children:t}))}),N6=t=>x.jsx(lt.Trigger,{...t,"aria-haspopup":"listbox",role:"combobox"}),L6=N6,B6=({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(lt,{overflow:r,block:i,children:[x.jsx(L6,{icon:t,label:f(u||o),variant:s,size:n,disabled:a}),x.jsx(lt.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(lt.Item,{type:"action",onClick:()=>h(d),children:m},p)})})]})},aE=B6,F6=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}=au(),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})}),oE=F6;function U6(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 j6=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}=U6(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(S=>S===e&&e!==A?(d(!0),S===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(Pd,{title:"RafterRight",width:b,height:b}),Array.isArray(i)&&u&&x.jsx(po,{title:"RafterDown",width:b,height:b}),!Array.isArray(i)&&x.jsx(Pd,{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(EE,{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()},$6=j6,G6=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($6,{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)})}),d8=G6,z6=E.forwardRef(({children:t},e)=>x.jsx("span",{className:"visually-hidden",ref:e,children:t})),Hi=z6,H6=async t=>await Ae.conf().getPreference(t),V6=async t=>await Ae.conf().savePreference(t,JSON.stringify({showOnboardingTrash:!1})),W6=t=>{const[e,r]=E.useState(!0),[i,s]=E.useState(!1);return E.useEffect(()=>{(async()=>{const n=await H6(t);if(n){const{showOnboardingTrash:a}=n;s(a);return}s(!0)})()},[t]),{isOpen:e,setIsOpen:r,isOnboardingTrash:i,handleSavePreference:async()=>{await V6(t),r(!1)}}},X6=({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}=W6(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($x,{modules:[K2],onSwiper:y=>{n(y)},onSlideChange:y=>{o(y.progress)},pagination:{clickable:!0},children:e.map((y,_)=>x.jsxs(Gx,{children:[x.jsx(nu,{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},f8=X6,Y6=()=>{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")}]},q6=({control:t,selectedActivities:e,selectActivities:r})=>{const i=Y6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(xh,{name:"activityType",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(lt,{block:!0,overflow:!0,children:[x.jsx(lt.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:e==null?void 0:e.length}),x.jsx(lt.Menu,{children:i.map((a,o)=>x.jsx(lt.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})},Z6=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],Py=({name:t,control:e,placeholderOption:r,validate:i})=>x.jsx(xh,{name:t,control:e,rules:{required:!0,validate:i},render:({field:{onChange:s}})=>x.jsx(aE,{block:!0,size:"md",onValueChange:s,options:Z6,"aria-required":!0,placeholderOption:r})}),K6=()=>{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")}]},Q6="bpr.form.publication.language",J6=({control:t})=>{const e=K6();return x.jsx("div",{className:"col",children:x.jsx(xh,{name:"language",control:t,rules:{required:!0},render:({field:{onChange:r}})=>x.jsx(aE,{block:!0,size:"md",onValueChange:r,options:e,"aria-required":!0,placeholderOption:Q6})})})},eU=()=>{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")})]})},tU=()=>{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")}]},rU=({control:t,selectedSubjectAreas:e,selectSubjects:r})=>{const i=tU(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(xh,{name:"subjectArea",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(lt,{block:!0,overflow:!0,children:[x.jsx(lt.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:e==null?void 0:e.length}),x.jsx(lt.Menu,{children:i.map((a,o)=>x.jsx(lt.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})};function My({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 iU({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 sU({onSuccess:t,resource:e}){const{user:r,appCode:i}=mt(),s=bl(),[n,a]=E.useState((e==null?void 0:e.thumbnail)||"");E.useEffect(()=>{a(e==null?void 0:e.thumbnail)},[e]);const{control:o,register:l,watch:c,setValue:h,handleSubmit:f,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m}}=Ky({mode:"onChange"}),[g,y]=E.useState([]),[_,v]=E.useState([]),b=(w,A,S)=>{let C=[...A];const T=C.findIndex(M=>M===w);A.includes(w)?C=A.filter((M,I)=>I!==T):C=[...A,w],S(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 S=new Blob;typeof n=="string"?S=await Ae.http().get(n,{responseType:"blob"}):n?S=await Ae.http().get(URL.createObjectURL(n),{responseType:"blob"}):e!=null&&e.thumbnail&&(S=await Ae.http().get(e==null?void 0:e.thumbnail,{responseType:"blob"}));const C=await Ae.http().get(`/userbook/avatar/${A}?thumbnail=48x48`,{responseType:"blob"}),T=await Ae.http().get(`/directory/user/${A}/attachment-school`,{responseType:"json"}),M=Xw[i],I={activityType:g,age:[w.ageMin,w.ageMax],application:M,cover:S,description:w.description,keyWords:w.keyWords,language:w.language,licence:"CC-BY",resourceId:e==null?void 0:e.assetId,resourceEntId:e==null?void 0:e.assetId,subjectArea:_,teacherAvatar:C,title:w.title,userId:A,userStructureName:T.name||(r==null?void 0:r.structureNames[0])},k=await Ae.resource(i).publish(I);k.success?s.success(x.jsx(iU,{result:k}),{duration:1e4}):s.error(x.jsx(My,{formData:w})),t==null||t()}catch(S){console.error(S),s.error(x.jsx(My,{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}}const nU=(t,e)=>{const[r,i]=E.useState(null);return E.useEffect(()=>{if(e===""){console.warn("resourceId must be an assetId and not an empty string");return}(async()=>{const s=[e],n=await Ae.resource(t).searchContext({application:t,filters:{folder:void 0,owner:void 0,shared:void 0,public:void 0},pagination:{startIdx:0,pageSize:s.length},types:[t],asset_id:s});i(n.resources[0])})()},[]),r},Bm=nU;function p8({isOpen:t,resourceId:e,onSuccess:r,onCancel:i}){const{appCode:s,currentApp:n}=mt(),{t:a}=Ce(),o=Bm(s,e),{control:l,cover:c,formState:{isDirty:h,isValid:f,isSubmitting:u},handleDeleteImage:d,handleSubmit:p,handleUploadImage:m,handlePublish:g,register:y,selectActivities:_,selectedActivities:v,selectedSubjectAreas:b,selectSubjects:w}=sU({resource:o,onSuccess:r});return o?rs.createPortal(x.jsxs(je,{isOpen:t,onModalClose:i,id:"libraryModal",size:"lg",children:[x.jsx(je.Header,{onModalClose:i,children:a("bpr.publish")}),x.jsx(je.Subtitle,{children:a("bpr.form.tip")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.heading.general")}),x.jsxs("form",{id:"libraryModalForm",onSubmit:p(g),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:a("bpr.form.publication.cover.title")}),x.jsx(rE,{app:n,src:o==null?void 0:o.thumbnail,label:a("bpr.form.publication.cover.upload.label"),addButtonLabel:a("bpr.form.publication.cover.upload.add"),deleteButtonLabel:a("bpr.form.publication.cover.upload.remove"),onUploadImage:m,onDeleteImage:d,className:"align-self-center"}),!c&&x.jsx("p",{className:"form-text is-invalid",children:x.jsx("em",{children:a("bpr.form.publication.cover.upload.required.image")})})]}),x.jsxs("div",{className:"flex-fill",children:[x.jsxs(ot,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.title")}),x.jsx(Qs,{type:"text",defaultValue:o==null?void 0:o.name,...y("title",{required:!0}),placeholder:a("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ot,{id:"description",isRequired:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.description")}),x.jsx(oE,{...y("description",{required:!0}),placeholder:a("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.heading.infos")}),x.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[x.jsx(q6,{control:l,selectedActivities:v,selectActivities:_}),x.jsx(rU,{control:l,selectedSubjectAreas:b,selectSubjects:w}),x.jsx(J6,{control:l})]}),x.jsxs("div",{className:"mb-24",children:[x.jsx("label",{htmlFor:"",className:"form-label",children:a("bpr.form.publication.age")}),x.jsxs("div",{className:"d-flex gap-8",children:[x.jsx("div",{className:"col col-2",children:x.jsx(Py,{control:l,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(C,T)=>parseInt(C)<=parseInt(T.ageMax)})}),x.jsx("div",{className:"col col-2",children:x.jsx(Py,{control:l,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(C,T)=>parseInt(C)>=parseInt(T.ageMin)})})]})]}),x.jsx("div",{className:"mb-24",children:x.jsxs(ot,{id:"keywords",isOptional:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.keywords")}),x.jsx(Qs,{type:"text",...y("keyWords"),size:"md",placeholder:a("bpr.form.publication.keywords.placeholder")})]})}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.licence.text")}),x.jsx(eU,{})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:i,type:"button",variant:"ghost",children:a("cancel")}),x.jsx(tt,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:u,disabled:!c||u||!h||!f,children:a("bpr.form.submit")})]})]}),document.getElementById("portal")):x.jsx(Lm,{})}const aU=({isUpdating:t,selectedResource:e})=>{const[r,i]=E.useState(t&&(e==null?void 0:e.thumbnail)||"");return E.useEffect(()=>{i((e==null?void 0:e.thumbnail)||"")},[e]),{thumbnail:r,handleDeleteImage:()=>i(""),handleUploadImage:s=>i(s)}},oU=({isOpen:t,onCancel:e,onSuccess:r,children:i,...s})=>{const{appCode:n,currentApp:a}=mt(),{t:o}=Ce(),{mode:l}=s,c=bl(),h=E.useId(),f=l==="create",u=l==="update",d=Bm(n,u?s.resourceId:""),{watch:p,register:m,handleSubmit:g,setValue:y,formState:{isSubmitting:_,isValid:v}}=Ky({mode:"onChange",defaultValues:{description:u?d==null?void 0:d.description:"",enablePublic:u?d==null?void 0:d.public:!1,title:u?d==null?void 0:d.name:"",formSlug:u?d==null?void 0:d.slug:""}}),{thumbnail:b,handleDeleteImage:w,handleUploadImage:A}=aU({isUpdating:u,selectedResource:u?d:void 0}),S=async function(C){var T,M;try{const I={description:C.description||"",name:C.title,public:C.enablePublic,slug:C.enablePublic&&C.formSlug||"",thumbnail:b};if(f){const k={...I,folder:((T=s.currentFolder)==null?void 0:T.id)==="default"?void 0:parseInt(((M=s.currentFolder)==null?void 0:M.id)||""),application:n};s.createResource?await s.createResource.mutateAsync(k):await Ae.resource(n).create(k)}else{const k={...I,entId:d.assetId,trashed:d.trashed};s.updateResource?await s.updateResource.mutateAsync(k):await Ae.resource(n).update(k)}c.success(x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:o(f?"explorer.resource.created":"explorer.resource.updated")}),x.jsxs("p",{children:[o("title")," : ",C.title]}),x.jsxs("p",{children:[o("description")," : ",C.description]}),n==="blog"&&x.jsxs("p",{children:["Public:",C.enablePublic?o("explorer.enable.public.yes"):o("explorer.enable.public.no")]})]})),r()}catch(I){console.error(I)}};return u&&!d?x.jsx(Lm,{}):rs.createPortal(x.jsxs(je,{id:`${l}-resource`,size:"lg",isOpen:t,onModalClose:e,children:[x.jsx(je.Header,{onModalClose:e,children:o(`explorer.resource.editModal.header.${f?"create":"edit"}`)}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:o("explorer.resource.editModal.heading.general")}),x.jsxs("form",{id:h,onSubmit:g(S),children:[x.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[x.jsx("div",{children:x.jsx(rE,{app:a,src:u&&(d==null?void 0:d.thumbnail)||"",label:o("explorer.imagepicker.label"),addButtonLabel:o("explorer.imagepicker.button.add"),deleteButtonLabel:o("explorer.imagepicker.button.delete"),onUploadImage:A,onDeleteImage:w,className:"align-self-center mt-8"})}),x.jsxs("div",{className:"col",children:[x.jsxs(ot,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:o("title")}),x.jsx(Qs,{type:"text",defaultValue:u?d==null?void 0:d.name:"",...m("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:o("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ot,{id:"description",isOptional:!0,children:[x.jsx(Nn,{children:o("description")}),x.jsx(oE,{defaultValue:u?d==null?void 0:d.description:"",...m("description"),placeholder:o("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),typeof i=="function"?i(d,u,p,y,m):i]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:e,type:"button",variant:"ghost",children:o("explorer.cancel")}),x.jsx(tt,{form:h,type:"submit",color:"primary",isLoading:_,variant:"filled",disabled:!v||_,children:o(f?"explorer.create":"save")})]})]}),document.getElementById("portal"))},m8=oU,lU=({application:t,options:e})=>yb({mutationFn:async r=>await Ae.resource(t).update(r),...e}),g8=lU,Oy=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 cU(t,e){e?e={...Oy,...e}:e=Oy;const r=lE(e);return r.dispatch(t),r.toString()}const hU=Object.freeze(["prototype","__proto__","constructor"]);function lE(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&&!ky(s)&&(h=hU),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=lE(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:"),ky(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
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 cE="[native code] }",uU=cE.length;function ky(t){return typeof t!="function"?!1:Function.prototype.toString.call(t).slice(-uU)===cE}class Zi{constructor(e,r){e=this.words=e||[],this.sigBytes=r===void 0?e.length*4:r}toString(e){return(e||dU).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 dU={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("")}},fU={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("")}},pU={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)}},mU={parse(t){return pU.parse(unescape(encodeURIComponent(t)))}};class gU{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=mU.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 vU extends gU{update(e){return this._append(e),this._process(),this}finalize(e){e&&this._append(e)}}const Dy=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],yU=[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 bU extends vU{constructor(){super(...arguments),this._hash=new Zi([...Dy])}reset(){super.reset(),this._hash=new Zi([...Dy])}_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+yU[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 xU(t){return new bU().finalize(t).toString(fU)}function Ny(t,e={}){const r=typeof t=="string"?t:cU(t,e);return xU(r).slice(0,10)}var hE={};Object.defineProperty(hE,"__esModule",{value:!0});const _U=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)},wU=t=>t.split("").map(e=>`\\${e}`).join(""),Ly=(t,e,r=!1)=>{const i=_U(t).trim().toLowerCase(),s=wU(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=Ly(i,r,!0),n=Ly(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 By=hE.default=qa;const EU=({watch:t,setValue:e,selectedResource:r})=>{const[i,s]=E.useState(""),[n,a]=E.useState((r==null?void 0:r.public)||!1),o=E.useId(),l=t("title"),{t:c}=Ce(),h=bl();E.useEffect(()=>{if(n){let d="";r?d=r.slug?r.slug:`${Ny({foo:`${l}${o}`})}-${By(l)}`:d=`${Ny({foo:`${l}${o}`})}-${By(l)}`,e("formSlug",d),s(d)}},[n,l]);function f(d){a(d)}function u(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${i}`),h.success(c("explorer.copy.clipboard"))}return{slug:i,uniqueId:o,isPublic:n,resourceName:l,onPublicChange:f,onCopyToClipBoard:u}},SU=({appCode:t,isUpdating:e,resource:r,watch:i,register:s,setValue:n})=>{const{t:a}=Ce(),{slug:o,isPublic:l,resourceName:c,onPublicChange:h,onCopyToClipBoard:f}=EU({watch:i,setValue:n,selectedResource:e?r:void 0});return x.jsxs(x.Fragment,{children:[x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:[a("explorer.resource.editModal.heading.access"),t]}),x.jsx(zi,{type:"info",children:a("explorer.resource.editModal.access.alert")}),x.jsxs(ot,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[x.jsx(ot.Input,{type:"checkbox",role:"switch",defaultChecked:e?r.public:!1,...s("enablePublic",{disabled:!c,onChange:u=>{const d=u.target.checked;h(d)}}),className:"form-check-input mt-0",size:"md"}),x.jsx(ot.Label,{className:"form-check-label mb-0",children:a("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),l&&x.jsxs(x.Fragment,{children:[x.jsx(ot,{id:"formSlug",children:x.jsx(Qs,{type:"text",hidden:!0,defaultValue:e?o:"",...s("formSlug"),size:"sm"})},o),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/",o]}),x.jsx(tt,{color:"primary",disabled:!l,onClick:f,type:"button",leftIcon:x.jsx(dE,{}),variant:"ghost",className:"text-nowrap",children:a("explorer.resource.editModal.access.url.button")})]})]})]})},v8=SU,TU={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function AU(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 Cd=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],CU=({resource:t,shareRights:e,shareDispatch:r})=>{const[i,s]=E.useReducer(AU,TU),n=n5(i.searchInputValue,500),{isAdml:a}=m5(),{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=E.useCallback(async f=>{if(t){if(s({type:"isSearching",payload:!0}),!a&&f.length>=1||a&&f.length>=3){const u=t&&await Ae.share().searchShareSubjects(o,t==null?void 0: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==null?void 0: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(Sp,{}):null}});s({type:"addResult",payload:d})}else s({type:"emptyResult",payload:[]}),Promise.resolve();s({type:"isSearching",payload:!1})}},[t]);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 Ae.directory().getBookMarkById(u.id);d.push({...p,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:Cd}),p==null||p.users.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"user",avatarUrl:"",directoryUrl:"",actions:Cd,isBookmarkMember:!0})}),p.groups.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"group",avatarUrl:"",directoryUrl:"",actions:Cd,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])})}}}},IU={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function RU(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:e.payload};default:throw new Error("Unhandled action type")}}function PU({onSuccess:t,resource:e,shareResource:r}){const{appCode:i}=mt(),{user:s,avatar:n}=Zw(),a=bl(),{t:o}=Ce(),[l,c]=E.useReducer(RU,IU);return E.useEffect(()=>{e&&(async()=>{const h=await Ae.share().getActionsForApp(i),f=await Ae.share().getRightsForResource(i,e==null?void 0:e.assetId);c({type:"init",payload:{shareRightActions:h,shareRights:f}})})()},[e]),{state:l,dispatch:c,currentIsAuthor:()=>!!(e&&e.creatorId===(s==null?void 0:s.userId)),myAvatar:n,handleDeleteRow:h=>{c({type:"deleteRow",payload:{...l.shareRights,rights:l.shareRights.rights.filter(f=>{var u,d;return f.id!==h.id&&!((u=h.users)!=null&&u.find(p=>p.id===f.id))&&!((d=h.groups)!=null&&d.find(p=>p.id===f.id))})}})},handleShare:async()=>{c({type:"isSharing",payload:!0});try{const h=e.rights.filter(u=>s&&u.includes(`user:${s.userId}`)).map(u=>u.split(":")[2]).filter(u=>!!u),f=[...l.shareRights.rights];if(h.length>0){const u=h.map(d=>({displayName:d,id:d}));f.push({actions:u,avatarUrl:"",directoryUrl:"",displayName:s.username,id:s.userId,type:"user"})}r?await r.mutateAsync({resourceId:e==null?void 0:e.assetId,rights:f}):await Ae.share().saveRights(i,e==null?void 0:e.assetId,f),a.success(o("explorer.shared.status.saved")),t()}catch(h){typeof h=="string"&&a.error(o("explorer.shared.status.error")),console.error("Failed to save share",h)}finally{c({type:"isSharing",payload:!1})}},toggleRight:(h,f)=>{var u,d;const{rights:p,...m}=l.shareRights,g=[...p],y=g.findIndex(v=>v.id===h.id),_=l.shareRightActions.filter(v=>v.id===f)[0];if(g[y].actions.findIndex(v=>v.id===f)>-1){let v=g[y].actions.filter(w=>w.id!==f);const b=l.shareRightActions.filter(w=>{var A;return(A=w.requires)==null?void 0:A.includes(f)});v=v.filter(w=>!b.find(A=>A.id===w.id)),g[y]={...g[y],actions:v}}else{const v=l.shareRightActions.filter(b=>{var w;return((w=_.requires)==null?void 0:w.includes(b.id))&&!g[y].actions.find(A=>A.id===b.id)});g[y]={...g[y],actions:[...g[y].actions,_,...v]}}h.type==="sharebookmark"&&((u=g[y].users)==null||u.forEach(v=>{const b=g.findIndex(w=>w.id===v.id);g[b]={...g[b],actions:g[y].actions}}),(d=g[y].groups)==null||d.forEach(v=>{const b=g.findIndex(w=>w.id===v.id);g[b]={...g[b],actions:g[y].actions}})),c({type:"toggleRight",payload:{rights:g,...m}})}}}const MU=({shareRights:t,shareDispatch:e})=>{const r=bl(),{t:i}=Ce(),s=E.useRef(null),[n,a]=E.useState({name:"",id:E.useId()}),[o,l]=d5(!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 Ae.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}},OU=({bookmark:t,refBookmark:e,onBookmarkChange:r,onSave:i})=>{const{t:s}=Ce();return x.jsx("div",{className:"mt-16",children:x.jsxs(ot,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[x.jsx("div",{className:"flex-fill",children:x.jsx(ot.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(fE,{}),onClick:i,className:"text-nowrap",children:s("explorer.modal.share.sharebookmark.save")})]})})},kU=(t,e)=>t.actions.filter(r=>e.id===r.id).length>0,DU=(t,e)=>t.isBookmarkMember&&e||!t.isBookmarkMember,NU=({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=>DU(o,e)&&x.jsxs("tr",{className:o.isBookmarkMember?"bg-light":"",children:[x.jsxs("td",{children:[o.type!=="sharebookmark"&&x.jsx(da,{alt:a("explorer.modal.share.avatar.shared.alt"),size:"xs",src:o.avatarUrl,variant:"circle"}),o.type==="sharebookmark"&&x.jsx(Sp,{})]}),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:kU(o,l),onChange:()=>s(o,l.id)})},l.displayName)),x.jsx("td",{children:!o.isBookmarkMember&&x.jsx(ua,{"aria-label":"Delete",color:"tertiary",icon:x.jsx(Jy,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>n(o)})})]},o.id))};function y8({isOpen:t,resourceId:e,shareResource:r,children:i,onSuccess:s,onCancel:n}){const{appCode:a}=mt(),o=Bm(a,e),{state:{isSharing:l,shareRights:c,shareRightActions:h},dispatch:f,myAvatar:u,currentIsAuthor:d,handleShare:p,toggleRight:m,handleDeleteRow:g}=PU({resource:o,shareResource:r,onSuccess:s}),{state:{searchResults:y,searchInputValue:_},showSearchAdmlHint:v,showSearchLoading:b,showSearchNoResults:w,getSearchMinLength:A,handleSearchInputChange:S,handleSearchResultsChange:C}=CU({resource:o,shareRights:c,shareDispatch:f}),{refBookmark:T,showBookmark:M,handleBookmarkChange:I,toggleBookmark:k,bookmark:P,handleOnSave:R,showBookmarkInput:O,toggleBookmarkInput:L}=MU({shareRights:c,shareDispatch:f}),{t:N}=Ce(),B=v()?N("explorer.search.adml.hint"):N("explorer.modal.share.search.placeholder");return o?rs.createPortal(x.jsxs(je,{id:"share_modal",size:"lg",isOpen:t,onModalClose:n,children:[x.jsx(je.Header,{onModalClose:n,children:N("share.title")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:N("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:N("explorer.modal.share.avatar.shared.alt")})}),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:N("explorer.modal.share.search.placeholder")})}),h.map(U=>x.jsx("th",{scope:"col",className:"text-center text-white",children:N(U.displayName)},U.displayName)),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:N("close")})})]})}),x.jsxs("tbody",{children:[d()&&x.jsxs("tr",{children:[x.jsx("th",{scope:"row",children:x.jsx(da,{alt:N("explorer.modal.share.avatar.me.alt"),size:"xs",src:u,variant:"circle"})}),x.jsx("td",{children:N("share.me")}),h.map(U=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:!0,disabled:!0})},U.displayName)),x.jsx("td",{})]}),x.jsx(NU,{showBookmark:M,shareRightActions:h,shareRights:c,onDeleteRow:g,toggleRight:m,toggleBookmark:k})]})]})}),x.jsxs("div",{className:"mt-16",children:[x.jsx(tt,{color:"tertiary",leftIcon:x.jsx(Sp,{}),rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:O?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>L(!O),children:N("share.save.sharebookmark")}),O&&x.jsx(OU,{refBookmark:T,bookmark:P,onBookmarkChange:I,onSave:R})]}),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:N("explorer.modal.share.search")}),x.jsx(H5,{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(g6,{value:_,placeholder:B,isLoading:b(),noResult:w(),options:y,searchMinLength:A(),onSearchInputChange:S,onSearchResultsChange:C})})}),i]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:n,children:N("explorer.cancel")}),x.jsx(tt,{type:"button",color:"primary",variant:"filled",isLoading:l,onClick:p,disabled:l,children:N("share")})]})]}),document.getElementById("portal")):x.jsx(Lm,{})}function b8({resource:t,updateResource:e}){const{appCode:r}=mt(),{t:i}=Ce(r),s=t&&t["publish-type"],[n,a]=E.useState(s),o=async l=>{const c=l.target.value;(async()=>{const h={description:t.description||"",entId:t.assetId,name:t.name,public:!!t.public,slug:t.slug||"",thumbnail:t.thumbnail,trashed:t.trashed,"publish-type":c};e?await e.mutateAsync(h):await Ae.resource("blog").update(h),a(c)})()};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(Ep,{label:i("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:n,checked:n==="IMMEDIATE",onChange:o}),x.jsx(Ep,{label:i("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:n==="RESTRAINT",model:n,onChange:o})]})}const LU=({application:t,options:e})=>yb({mutationFn:async({resourceId:r,rights:i})=>await Ae.share().saveRights(t,r,i),...e}),x8=LU;function Id({children:t}){return x.jsx("span",{className:"position-absolute badge rounded-pill bg-warning",children:t})}function Rd({children:t,className:e,...r}){const i=re("navbar",e);return x.jsx("nav",{className:i,...r,children:t})}function Fy({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 BU=()=>{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")})})})},FU=({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 Uy({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 UU(){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(SE,{})}),Ol(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:Ol(A.children,{replace:S=>{const C=S;if(C.attribs&&C.name==="a")return x.jsx("a",{...Iu(C.attribs),children:x.jsx("span",{onClick:()=>{h(!1)},children:Ol(C.children)})})}})})}})]});if(b.attribs&&b.attribs.class==="section level2"){const w=Iu(v.attribs);return x.jsx("div",{...w,className:"section level2",style:{display:b.attribs.id!=="présentation"?"none":"block"},children:Ol(b.children,{replace:A=>{const S=A;if(S.attribs&&S.name==="img"){const C=A.attribs.src;return x.jsx("img",{...Iu(S.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 jU=()=>{const[t,e]=qw(),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(j2,{className:"icon search"}),x.jsx("span",{className:"nav-text",children:s("navbar.search")})]}),x.jsx(nE,{id:i,isVisible:e,className:"d-none d-md-flex",children:x.jsxs(ot,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[x.jsx(ot.Input,{ref:r,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),x.jsx(X4,{type:"submit",size:"sm",onClick:n,"aria-label":s("navbar.search")})]})})]})},$U=jU,GU=({is1d:t=!1,src:e=""})=>{const{t:r}=Ce(),{messages:i,msgLink:s,zimbraWorkflow:n}=s5(),{user:a,avatar:o}=Zw(),{currentLanguage:l,currentApp:c}=mt(),{isModalOpen:h,setIsModalOpen:f,parsedContent:u,parsedHeadline:d,error:p}=UU(),m=re("header",{"no-2d":t,"no-1d":!t}),{title:g,bookmarkedApps:y,appsRef:_,isAppsHovered:v,popoverAppsId:b,userAvatar:w,userName:A,welcomeUser:S,communityWorkflow:C,conversationWorflow:T,searchWorkflow:M,isCollapsed:I,toggleCollapsedNav:k,handleLogout:P}=p5({user:a,avatar:o}),R=i>0;return x.jsx("header",{className:m,children:t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"container-fluid",children:x.jsxs(Rd,{children:[x.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:c?c.address:"/timeline/timeline",children:g}),x.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[x.jsx(da,{alt:A,size:"sm",src:w,variant:"circle",width:"32",height:"32"}),x.jsx("span",{className:"navbar-text",children:S})]}),x.jsxs(Fy,{className:"gap-8","aria-hidden":"false","aria-label":r("navbar.main.navigation"),children:[T&&x.jsx(Ge,{children:x.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[x.jsx(B2,{className:"icon notification"}),R&&x.jsx(Id,{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(Ax,{className:"icon user"})})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link",onClick:()=>{f(!0)},children:[x.jsx(N2,{className:"icon help"}),x.jsx(Hi,{children:r("navbar.help")})]}),x.jsx(Uy,{isHelpOpen:h,setIsHelpOpen:f,parsedContent:u,parsedHeadline:d,error:p})]}):null,x.jsx(Ge,{children:x.jsxs("button",{className:"nav-link",onClick:P,children:[x.jsx(Ng,{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":!I,"aria-label":r("navbar.secondary.navigation"),onClick:k,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),x.jsx(Rd,{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 ${I?"":"show"}`,id:"navbarCollapsed",children:[x.jsx(Ry,{is1d:!0,src:`${e}/img/illustrations/logo.png`,translate:r("navbar.home")}),x.jsxs(Fy,{className:"gap-8",children:[x.jsx(Ge,{children:x.jsxs("a",{href:"/timeline/timeline",className:"button",children:[x.jsx(k2,{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(G2,{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(Lg,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.myapps")})]})})]})]})})})]}):x.jsx(Rd,{className:"navbar-expand-md",children:x.jsxs("div",{className:"container-fluid",children:[x.jsx(Ry,{src:`${e}/img/illustrations/logo.png`}),x.jsx("a",{href:c?c.address:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:g}),x.jsxs("ul",{className:"navbar-nav",children:[x.jsx(Ge,{children:x.jsx(La,{link:"/timeline/timeline",translate:r("navbar.home"),children:x.jsx(C2,{color:"#fff"})})}),x.jsxs(Ge,{className:"position-relative",ref:_,id:b,"aria-haspopup":"true","aria-expanded":v,children:[x.jsx(La,{link:"/welcome",translate:r("navbar.applications"),children:x.jsx(Lg,{color:"#fff"})}),x.jsxs(nE,{className:"top-100 widget",id:b,isVisible:v,children:[x.jsx(k6,{children:x.jsx(FU,{bookmarkedApps:y})}),x.jsx(D6,{className:"widget-footer border-top border-ghost",children:x.jsx(BU,{})})]})]}),T&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:"/conversation/conversation",translate:r("conversation"),children:[x.jsx(Bg,{color:"#fff"}),R&&x.jsx(Id,{children:i})]})}),n&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:s,translate:r("conversation"),children:[x.jsx(Bg,{color:"#fff"}),R&&x.jsx(Id,{children:i})]})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{f(!0)},children:[x.jsx(P2,{color:"#fff"}),x.jsx(Hi,{children:r("support")})]}),x.jsx(Uy,{isHelpOpen:h,setIsHelpOpen:f,parsedContent:u,parsedHeadline:d,error:p})]}):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":!I,"aria-label":r("navbar.open.menu"),onClick:k,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),x.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${I?"":"show"}`,id:"dropdown-navbar",children:[C&&x.jsx(Ge,{children:x.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[x.jsx(S2,{className:"icon community"}),x.jsx("span",{className:"nav-text",children:r("navbar.community")})]})}),M?x.jsx($U,{}):null,x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[x.jsx(da,{alt:A,size:"sm",src:w,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(Ng,{className:"icon logout"}),x.jsx("span",{id:"logout-label",className:"nav-text",children:r("navbar.disconnect")})]})})]})]})})]})]})})})},zU=GU;function HU({children:t,className:e,...r}){const i=re("container-fluid",e);return x.jsx("main",{className:i,...r,children:t})}const VU=({children:t,...e})=>{const{theme:r}=Om();return x.jsxs(x.Fragment,{children:[x.jsx(zU,{is1d:r==null?void 0:r.is1d,src:r==null?void 0:r.basePath}),x.jsx(HU,{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(qS,{toastOptions:{position:"top-right"}})]})},_8=VU;K_.extend(uk);K_.extend(ck);export{Nn as $,r8 as A,tt as B,cf as C,lt as D,t8 as E,ot as F,y6 as G,y8 as H,ua as I,b8 as J,f8 as K,Lm as L,je as M,u8 as N,i8 as O,h8 as P,ZU as Q,e8 as R,X4 as S,d8 as T,Ho as U,da as V,Ax as W,H5 as X,K_ as Y,uk as Z,re as _,mt as a,m8 as a0,p8 as a1,vb as b,bl as c,fb as d,yb as e,x8 as f,g8 as g,Zw as h,JU as i,x as j,Qs as k,d5 as l,l8 as m,n8 as n,c8 as o,_8 as p,jE as q,QU as r,s8 as s,v8 as t,a8 as u,Om as v,o8 as w,nu as x,wa as y,mx as z};
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 07/02/2024 10:31:06
1
+ ode-explorer=1.0-b2school-SNAPSHOT 07/02/2024 17:22:15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "1.3.3-develop-pedago.202402071030",
3
+ "version": "1.3.3-develop.202402071721",
4
4
  "description": "Open Digital Education Explorer",
5
5
  "homepage": "https://github.com/opendigitaleducation/explorer#readme",
6
6
  "bugs": {
@@ -36,8 +36,8 @@
36
36
  ]
37
37
  },
38
38
  "dependencies": {
39
- "@edifice-ui/icons": "develop-pedago",
40
- "@edifice-ui/react": "develop-pedago",
39
+ "@edifice-ui/icons": "develop",
40
+ "@edifice-ui/react": "develop",
41
41
  "@react-spring/web": "9.7.3",
42
42
  "@tanstack/react-query": "5.8.4",
43
43
  "clsx": "2.1.0",
@@ -65,8 +65,8 @@
65
65
  "@vitejs/plugin-react-swc": "3.5.0",
66
66
  "concurrently": "8.2.2",
67
67
  "csstype": "3.1.3",
68
- "edifice-bootstrap": "develop-pedago",
69
- "edifice-ts-client": "develop-pedago",
68
+ "edifice-bootstrap": "develop",
69
+ "edifice-ts-client": "develop",
70
70
  "eslint": "8.56.0",
71
71
  "eslint-config-prettier": "9.1.0",
72
72
  "eslint-plugin-import": "2.29.1",