@project-sunbird/collection-editor-react 1.0.14 → 1.0.16-alpha

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.
Files changed (43) hide show
  1. package/dist/api/competencyFramework.d.ts +32 -0
  2. package/dist/api/content.d.ts +1 -1
  3. package/dist/api/content.test.d.ts +1 -0
  4. package/dist/collection-editor.umd.js +112 -112
  5. package/dist/components/SparkMetaForm/fields/OptionSearch.d.ts +20 -0
  6. package/dist/components/SparkMetaForm/fields/OptionSearch.test.d.ts +1 -0
  7. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.competency.test.d.ts +1 -0
  8. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +34 -1
  9. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.skill.test.d.ts +1 -0
  10. package/dist/components/UnitContentList/LevelCourseItem.d.ts +2 -0
  11. package/dist/hooks/useCompetencyFrameworks.d.ts +27 -0
  12. package/dist/hooks/useCourseCompetency.d.ts +31 -0
  13. package/dist/hooks/useCourseCompetency.test.d.ts +1 -0
  14. package/dist/hooks/useLibrary.d.ts +88 -18
  15. package/dist/hooks/useLpCompetency.d.ts +13 -0
  16. package/dist/hooks/useSkillCategory.d.ts +15 -1
  17. package/dist/hooks/useSkillScope.d.ts +4 -3
  18. package/dist/hooks/useSkillsCoveredSync.d.ts +10 -0
  19. package/dist/hooks/useSkillsCoveredSync.test.d.ts +1 -0
  20. package/dist/i18n/locales/ar.json.d.ts +46 -28
  21. package/dist/i18n/locales/en.json.d.ts +46 -28
  22. package/dist/i18n/locales/fr.json.d.ts +46 -28
  23. package/dist/i18n/locales/pt.json.d.ts +46 -28
  24. package/dist/index.cjs +109 -109
  25. package/dist/index.js +9572 -9004
  26. package/dist/store/tree.store.d.ts +4 -1
  27. package/dist/store/tree.store.dirty.test.d.ts +1 -0
  28. package/dist/style.css +1 -1
  29. package/dist/types/content.d.ts +3 -1
  30. package/dist/types/content.test.d.ts +1 -0
  31. package/dist/types/editor.d.ts +1 -1
  32. package/dist/types/framework.d.ts +27 -0
  33. package/dist/utils/competencyLeaves.d.ts +44 -0
  34. package/dist/utils/competencyLeaves.test.d.ts +1 -0
  35. package/dist/utils/libraryCardMeta.d.ts +33 -0
  36. package/dist/utils/libraryCardMeta.test.d.ts +1 -0
  37. package/dist/utils/lpCompetency.d.ts +32 -0
  38. package/dist/utils/lpCompetency.test.d.ts +1 -0
  39. package/dist/utils/lpStructure.d.ts +21 -16
  40. package/dist/utils/skillTerms.d.ts +22 -0
  41. package/dist/utils/skillTerms.test.d.ts +1 -0
  42. package/package.json +1 -1
  43. package/dist/components/UnitContentList/SkillPicker.d.ts +0 -19
@@ -1,4 +1,4 @@
1
- (function(Ae,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("react-dom"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime"],p):(Ae=typeof globalThis<"u"?globalThis:Ae||self,p(Ae.CollectionEditorReact={},Ae.React,Ae.ReactDOM,Ae.jsxRuntime))})(this,(function(Ae,p,Ue,l){"use strict";var DI=Object.defineProperty;var hg=Ae=>{throw TypeError(Ae)};var NI=(Ae,p,Ue)=>p in Ae?DI(Ae,p,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):Ae[p]=Ue;var ho=(Ae,p,Ue)=>NI(Ae,typeof p!="symbol"?p+"":p,Ue),Xl=(Ae,p,Ue)=>p.has(Ae)||hg("Cannot "+Ue);var L=(Ae,p,Ue)=>(Xl(Ae,p,"read from private field"),Ue?Ue.call(Ae):p.get(Ae)),Ce=(Ae,p,Ue)=>p.has(Ae)?hg("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(Ae):p.set(Ae,Ue),ee=(Ae,p,Ue,l)=>(Xl(Ae,p,"write to private field"),l?l.call(Ae,Ue):p.set(Ae,Ue),Ue),Ne=(Ae,p,Ue)=>(Xl(Ae,p,"access private method"),Ue);var Ba=(Ae,p,Ue,l)=>({set _($a){ee(Ae,p,$a,Ue)},get _(){return L(Ae,p,l)}});var fn,qr,Zn,ng,vr,hn,sg,Xn,Ur,Jn,og,pn,ag,es,gn,ts,er,mn,gt,ro,vn,Qt,pg,Lr,ig,qt,Oe,no,xt,yn,rs,Ar,zr,so,ns,ss,bn,Cn,Vr,os,qe,po,Jl,ec,tc,rc,nc,sc,oc,gg,lg,oo,yr,Nt,Sn,br,Kr,cg,kr,ur,ao,dg,Cr,ug,tt,Hr,Qr,as,is,Wr,ls,cs,fg;function $a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const je=$a(p);var fs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yg=(ng=class extends fs{constructor(){super();Ce(this,fn);Ce(this,qr);Ce(this,Zn);ee(this,Zn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){L(this,qr)||this.setEventListener(L(this,Zn))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,qr))==null||t.call(this),ee(this,qr,void 0))}setEventListener(t){var r;ee(this,Zn,t),(r=L(this,qr))==null||r.call(this),ee(this,qr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){L(this,fn)!==t&&(ee(this,fn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof L(this,fn)=="boolean"?L(this,fn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fn=new WeakMap,qr=new WeakMap,Zn=new WeakMap,ng),ja=new yg,bg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cg=(sg=class{constructor(){Ce(this,vr,bg);Ce(this,hn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&L(this,hn)&&e!==L(this,vr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:L(this,vr),provider:e}),ee(this,vr,e),process.env.NODE_ENV!=="production"&&ee(this,hn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,hn,!0),L(this,vr).setTimeout(e,t)}clearTimeout(e){L(this,vr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,hn,!0),L(this,vr).setInterval(e,t)}clearInterval(e){L(this,vr).clearInterval(e)}},vr=new WeakMap,hn=new WeakMap,sg),Yr=new Cg;function Sg(e){setTimeout(e,0)}var wg=typeof window>"u"||"Deno"in globalThis;function Mt(){}function _g(e,t){return typeof e=="function"?e(t):e}function qa(e){return typeof e=="number"&&e>=0&&e!==1/0}function ac(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dr(e,t){return typeof e=="function"?e(t):e}function Ut(e,t){return typeof e=="function"?e(t):e}function ic(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==Ua(a,t.options))return!1}else if(!ps(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||o&&!o(t))}function lc(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(hs(t.options.mutationKey)!==hs(o))return!1}else if(!ps(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Ua(e,t){return((t==null?void 0:t.queryKeyHashFn)||hs)(e)}function hs(e){return JSON.stringify(e,(t,r)=>Ha(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function ps(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ps(e[r],t[r])):!1}var Tg=Object.prototype.hasOwnProperty;function za(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=cc(e)&&cc(t);if(!n&&!(Ha(e)&&Ha(t)))return t;const o=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),i=a.length,c=n?new Array(i):{};let d=0;for(let u=0;u<i;u++){const f=n?u:a[u],g=e[f],m=t[f];if(g===m){c[f]=g,(n?u<o:Tg.call(e,f))&&d++;continue}if(g===null||m===null||typeof g!="object"||typeof m!="object"){c[f]=m;continue}const C=za(g,m,r+1);c[f]=C,C===g&&d++}return o===i&&d===o?e:c}function Va(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function cc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ha(e){if(!dc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!dc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Eg(e){return new Promise(t=>{Yr.setTimeout(t,e)})}function Qa(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return za(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return za(e,t)}return t}function Ag(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function kg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var go=Symbol();function uc(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===go&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===go?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fc(e,t){return typeof e=="function"?e(...t):!!e}function Ig(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var gs=(()=>{let e=()=>wg;return{isServer(){return e()},setIsServer(t){e=t}}})();function Wa(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Lg=Sg;function Dg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Lg;const o=i=>{t?e.push(i):s(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var yt=Dg(),Ng=(og=class extends fs{constructor(){super();Ce(this,Xn,!0);Ce(this,Ur);Ce(this,Jn);ee(this,Jn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){L(this,Ur)||this.setEventListener(L(this,Jn))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,Ur))==null||t.call(this),ee(this,Ur,void 0))}setEventListener(t){var r;ee(this,Jn,t),(r=L(this,Ur))==null||r.call(this),ee(this,Ur,t(this.setOnline.bind(this)))}setOnline(t){L(this,Xn)!==t&&(ee(this,Xn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return L(this,Xn)}},Xn=new WeakMap,Ur=new WeakMap,Jn=new WeakMap,og),mo=new Ng;function Pg(e){return Math.min(1e3*2**e,3e4)}function hc(e){return(e??"online")==="online"?mo.isOnline():!0}var Ra=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pc(e){let t=!1,r=0,n;const s=Wa(),o=()=>s.status!=="pending",a=h=>{var v;if(!o()){const y=new Ra(h);g(y),(v=e.onCancel)==null||v.call(e,y)}},i=()=>{t=!0},c=()=>{t=!1},d=()=>ja.isFocused()&&(e.networkMode==="always"||mo.isOnline())&&e.canRun(),u=()=>hc(e.networkMode)&&e.canRun(),f=h=>{o()||(n==null||n(),s.resolve(h))},g=h=>{o()||(n==null||n(),s.reject(h))},m=()=>new Promise(h=>{var v;n=y=>{(o()||d())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,o()||(h=e.onContinue)==null||h.call(e)}),C=()=>{if(o())return;let h;const v=r===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(f).catch(y=>{var E;if(o())return;const b=e.retry??(gs.isServer()?0:3),S=e.retryDelay??Pg,w=typeof S=="function"?S(r,y):S,T=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,y);if(t||!T){g(y);return}r++,(E=e.onFail)==null||E.call(e,r,y),Eg(w).then(()=>d()?void 0:m()).then(()=>{t?g(y):C()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?C():m().then(C),s)}}var gc=(ag=class{constructor(){Ce(this,pn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qa(this.gcTime)&&ee(this,pn,Yr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gs.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,pn)!==void 0&&(Yr.clearTimeout(L(this,pn)),ee(this,pn,void 0))}},pn=new WeakMap,ag);function Og(e){return{onFetch:(t,r)=>{var u,f,g,m,C;const n=t.options,s=(g=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,o=((m=t.state.data)==null?void 0:m.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let h=!1;const v=S=>{Ig(S,()=>t.signal,()=>h=!0)},y=uc(t.options,t.fetchOptions),b=async(S,w,T)=>{if(h)return Promise.reject(t.signal.reason);if(w==null&&S.pages.length)return Promise.resolve(S);const N=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return v(k),k})(),I=await y(N),{maxPages:O}=t.options,B=T?kg:Ag;return{pages:B(S.pages,I,O),pageParams:B(S.pageParams,w,O)}};if(s&&o.length){const S=s==="backward",w=S?xg:mc,T={pages:o,pageParams:a},E=w(n,T);i=await b(T,E,S)}else{const S=e??o.length;do{const w=c===0?a[0]??n.initialPageParam:mc(n,i);if(c>0&&w==null)break;i=await b(i,w),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function mc(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function xg(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Fg=(ig=class extends gc{constructor(t){super();Ce(this,Qt);Ce(this,es);Ce(this,gn);Ce(this,ts);Ce(this,er);Ce(this,mn);Ce(this,gt);Ce(this,ro);Ce(this,vn);ee(this,vn,!1),ee(this,ro,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,mn,t.client),ee(this,er,L(this,mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,gn,bc(this.options)),this.state=t.state??L(this,gn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,es)}get promise(){var t;return(t=L(this,gt))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,ro),...t},t!=null&&t._type&&ee(this,es,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=bc(this.options);r.data!==void 0&&(this.setState(yc(r.data,r.dataUpdatedAt)),ee(this,gn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,er).remove(this)}setData(t,r){const n=Qa(this.state.data,t,this.options);return Ne(this,Qt,Lr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Ne(this,Qt,Lr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=L(this,gt))==null?void 0:n.promise;return(s=L(this,gt))==null||s.cancel(t),r?r.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,gn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ut(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===go||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Dr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ac(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,gt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,gt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,er).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(L(this,gt)&&(L(this,vn)||Ne(this,Qt,pg).call(this)?L(this,gt).cancel({revert:!0}):L(this,gt).cancelRetry()),this.scheduleGc()),L(this,er).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ne(this,Qt,Lr).call(this,{type:"invalidate"})}async fetch(t,r){var d,u,f,g,m,C,h,v,y,b,S;if(this.state.fetchStatus!=="idle"&&((d=L(this,gt))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(L(this,gt))return L(this,gt).continueRetry(),L(this,gt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(T=>T.options.queryFn);w&&this.setOptions(w.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(ee(this,vn,!0),n.signal)})},o=()=>{const w=uc(this.options,r),E=(()=>{const N={client:L(this,mn),queryKey:this.queryKey,meta:this.meta};return s(N),N})();return ee(this,vn,!1),this.options.persister?this.options.persister(w,E,this):w(E)},i=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:L(this,mn),state:this.state,fetchFn:o};return s(w),w})(),c=L(this,es)==="infinite"?Og(this.options.pages):this.options.behavior;c==null||c.onFetch(i,this),ee(this,ts,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Ne(this,Qt,Lr).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),ee(this,gt,pc({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:w=>{w instanceof Ra&&w.revert&&this.setState({...L(this,ts),fetchStatus:"idle"}),n.abort()},onFail:(w,T)=>{Ne(this,Qt,Lr).call(this,{type:"failed",failureCount:w,error:T})},onPause:()=>{Ne(this,Qt,Lr).call(this,{type:"pause"})},onContinue:()=>{Ne(this,Qt,Lr).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const w=await L(this,gt).start();if(w===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(w),(m=(g=L(this,er).config).onSuccess)==null||m.call(g,w,this),(h=(C=L(this,er).config).onSettled)==null||h.call(C,w,this.state.error,this),w}catch(w){if(w instanceof Ra){if(w.silent)return L(this,gt).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Ne(this,Qt,Lr).call(this,{type:"error",error:w}),(y=(v=L(this,er).config).onError)==null||y.call(v,w,this),(S=(b=L(this,er).config).onSettled)==null||S.call(b,this.state.data,w,this),w}finally{this.scheduleGc()}}},es=new WeakMap,gn=new WeakMap,ts=new WeakMap,er=new WeakMap,mn=new WeakMap,gt=new WeakMap,ro=new WeakMap,vn=new WeakMap,Qt=new WeakSet,pg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Lr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...vc(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...yc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,ts,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),L(this,er).notify({query:this,type:"updated",action:t})})},ig);function vc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Mg=(lg=class extends fs{constructor(t,r){super();Ce(this,qe);Ce(this,qt);Ce(this,Oe);Ce(this,no);Ce(this,xt);Ce(this,yn);Ce(this,rs);Ce(this,Ar);Ce(this,zr);Ce(this,so);Ce(this,ns);Ce(this,ss);Ce(this,bn);Ce(this,Cn);Ce(this,Vr);Ce(this,os,new Set);this.options=r,ee(this,qt,t),ee(this,zr,null),ee(this,Ar,Wa()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Oe).addObserver(this),Cc(L(this,Oe),this.options)?Ne(this,qe,po).call(this):this.updateResult(),Ne(this,qe,rc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ga(L(this,Oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ga(L(this,Oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ne(this,qe,nc).call(this),Ne(this,qe,sc).call(this),L(this,Oe).removeObserver(this)}setOptions(t){const r=this.options,n=L(this,Oe);if(this.options=L(this,qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ut(this.options.enabled,L(this,Oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ne(this,qe,oc).call(this),L(this,Oe).setOptions(this.options),r._defaulted&&!Va(this.options,r)&&L(this,qt).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Oe),observer:this});const s=this.hasListeners();s&&Sc(L(this,Oe),n,this.options,r)&&Ne(this,qe,po).call(this),this.updateResult(),s&&(L(this,Oe)!==n||Ut(this.options.enabled,L(this,Oe))!==Ut(r.enabled,L(this,Oe))||Dr(this.options.staleTime,L(this,Oe))!==Dr(r.staleTime,L(this,Oe)))&&Ne(this,qe,Jl).call(this);const o=Ne(this,qe,ec).call(this);s&&(L(this,Oe)!==n||Ut(this.options.enabled,L(this,Oe))!==Ut(r.enabled,L(this,Oe))||o!==L(this,Vr))&&Ne(this,qe,tc).call(this,o)}getOptimisticResult(t){const r=L(this,qt).getQueryCache().build(L(this,qt),t),n=this.createResult(r,t);return $g(this,n)&&(ee(this,xt,n),ee(this,rs,this.options),ee(this,yn,L(this,Oe).state)),n}getCurrentResult(){return L(this,xt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,Ar).status==="pending"&&L(this,Ar).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){L(this,os).add(t)}getCurrentQuery(){return L(this,Oe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=L(this,qt).defaultQueryOptions(t),n=L(this,qt).getQueryCache().build(L(this,qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ne(this,qe,po).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,xt)))}createResult(t,r){var O;const n=L(this,Oe),s=this.options,o=L(this,xt),a=L(this,yn),i=L(this,rs),d=t!==n?t.state:L(this,no),{state:u}=t;let f={...u},g=!1,m;if(r._optimisticResults){const B=this.hasListeners(),k=!B&&Cc(t,r),F=B&&Sc(t,n,r,s);(k||F)&&(f={...f,...vc(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:C,errorUpdatedAt:h,status:v}=f;m=f.data;let y=!1;if(r.placeholderData!==void 0&&m===void 0&&v==="pending"){let B;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(B=o.data,y=!0):B=typeof r.placeholderData=="function"?r.placeholderData((O=L(this,ss))==null?void 0:O.state.data,L(this,ss)):r.placeholderData,B!==void 0&&(v="success",m=Qa(o==null?void 0:o.data,B,r),g=!0)}if(r.select&&m!==void 0&&!y)if(o&&m===(a==null?void 0:a.data)&&r.select===L(this,so))m=L(this,ns);else try{ee(this,so,r.select),m=r.select(m),m=Qa(o==null?void 0:o.data,m,r),ee(this,ns,m),ee(this,zr,null)}catch(B){ee(this,zr,B)}L(this,zr)&&(C=L(this,zr),m=L(this,ns),h=Date.now(),v="error");const b=f.fetchStatus==="fetching",S=v==="pending",w=v==="error",T=S&&b,E=m!==void 0,I={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:w,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:f.dataUpdatedAt,error:C,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:w&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:w&&E,isStale:Ka(t,r),refetch:this.refetch,promise:L(this,Ar),isEnabled:Ut(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const B=I.data!==void 0,k=I.status==="error"&&!B,F=z=>{k?z.reject(I.error):B&&z.resolve(I.data)},M=()=>{const z=ee(this,Ar,I.promise=Wa());F(z)},x=L(this,Ar);switch(x.status){case"pending":t.queryHash===n.queryHash&&F(x);break;case"fulfilled":(k||I.data!==x.value)&&M();break;case"rejected":(!k||I.error!==x.reason)&&M();break}}return I}updateResult(){const t=L(this,xt),r=this.createResult(L(this,Oe),this.options);if(ee(this,yn,L(this,Oe).state),ee(this,rs,this.options),L(this,yn).data!==void 0&&ee(this,ss,L(this,Oe)),Va(r,t))return;ee(this,xt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!L(this,os).size)return!0;const a=new Set(o??L(this,os));return this.options.throwOnError&&a.add("error"),Object.keys(L(this,xt)).some(i=>{const c=i;return L(this,xt)[c]!==t[c]&&a.has(c)})};Ne(this,qe,gg).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ne(this,qe,rc).call(this)}},qt=new WeakMap,Oe=new WeakMap,no=new WeakMap,xt=new WeakMap,yn=new WeakMap,rs=new WeakMap,Ar=new WeakMap,zr=new WeakMap,so=new WeakMap,ns=new WeakMap,ss=new WeakMap,bn=new WeakMap,Cn=new WeakMap,Vr=new WeakMap,os=new WeakMap,qe=new WeakSet,po=function(t){Ne(this,qe,oc).call(this);let r=L(this,Oe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Mt)),r},Jl=function(){Ne(this,qe,nc).call(this);const t=Dr(this.options.staleTime,L(this,Oe));if(gs.isServer()||L(this,xt).isStale||!qa(t))return;const n=ac(L(this,xt).dataUpdatedAt,t)+1;ee(this,bn,Yr.setTimeout(()=>{L(this,xt).isStale||this.updateResult()},n))},ec=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Oe)):this.options.refetchInterval)??!1},tc=function(t){Ne(this,qe,sc).call(this),ee(this,Vr,t),!(gs.isServer()||Ut(this.options.enabled,L(this,Oe))===!1||!qa(L(this,Vr))||L(this,Vr)===0)&&ee(this,Cn,Yr.setInterval(()=>{(this.options.refetchIntervalInBackground||ja.isFocused())&&Ne(this,qe,po).call(this)},L(this,Vr)))},rc=function(){Ne(this,qe,Jl).call(this),Ne(this,qe,tc).call(this,Ne(this,qe,ec).call(this))},nc=function(){L(this,bn)!==void 0&&(Yr.clearTimeout(L(this,bn)),ee(this,bn,void 0))},sc=function(){L(this,Cn)!==void 0&&(Yr.clearInterval(L(this,Cn)),ee(this,Cn,void 0))},oc=function(){const t=L(this,qt).getQueryCache().build(L(this,qt),this.options);if(t===L(this,Oe))return;const r=L(this,Oe);ee(this,Oe,t),ee(this,no,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},gg=function(t){yt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(L(this,xt))}),L(this,qt).getQueryCache().notify({query:L(this,Oe),type:"observerResultsUpdated"})})},lg);function Bg(e,t){return Ut(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ut(t.retryOnMount,e)===!1)}function Cc(e,t){return Bg(e,t)||e.state.data!==void 0&&Ga(e,t,t.refetchOnMount)}function Ga(e,t,r){if(Ut(t.enabled,e)!==!1&&Dr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ka(e,t)}return!1}function Sc(e,t,r,n){return(e!==t||Ut(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ka(e,r)}function Ka(e,t){return Ut(t.enabled,e)!==!1&&e.isStaleByTime(Dr(t.staleTime,e))}function $g(e,t){return!Va(e.getCurrentResult(),t)}var jg=(cg=class extends gc{constructor(t){super();Ce(this,br);Ce(this,oo);Ce(this,yr);Ce(this,Nt);Ce(this,Sn);ee(this,oo,t.client),this.mutationId=t.mutationId,ee(this,Nt,t.mutationCache),ee(this,yr,[]),this.state=t.state||qg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,yr).includes(t)||(L(this,yr).push(t),this.clearGcTimeout(),L(this,Nt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,yr,L(this,yr).filter(r=>r!==t)),this.scheduleGc(),L(this,Nt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,yr).length||(this.state.status==="pending"?this.scheduleGc():L(this,Nt).remove(this))}continue(){var t;return((t=L(this,Sn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,c,d,u,f,g,m,C,h,v,y,b,S,w,T,E,N;const r=()=>{Ne(this,br,Kr).call(this,{type:"continue"})},n={client:L(this,oo),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Sn,pc({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(I,O)=>{Ne(this,br,Kr).call(this,{type:"failed",failureCount:I,error:O})},onPause:()=>{Ne(this,br,Kr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,Nt).canRun(this)}));const s=this.state.status==="pending",o=!L(this,Sn).canStart();try{if(s)r();else{Ne(this,br,Kr).call(this,{type:"pending",variables:t,isPaused:o}),L(this,Nt).config.onMutate&&await L(this,Nt).config.onMutate(t,this,n);const O=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t,n));O!==this.state.context&&Ne(this,br,Kr).call(this,{type:"pending",context:O,variables:t,isPaused:o})}const I=await L(this,Sn).start();return await((d=(c=L(this,Nt).config).onSuccess)==null?void 0:d.call(c,I,t,this.state.context,this,n)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,I,t,this.state.context,n)),await((m=(g=L(this,Nt).config).onSettled)==null?void 0:m.call(g,I,null,this.state.variables,this.state.context,this,n)),await((h=(C=this.options).onSettled)==null?void 0:h.call(C,I,null,t,this.state.context,n)),Ne(this,br,Kr).call(this,{type:"success",data:I}),I}catch(I){try{await((y=(v=L(this,Nt).config).onError)==null?void 0:y.call(v,I,t,this.state.context,this,n))}catch(O){Promise.reject(O)}try{await((S=(b=this.options).onError)==null?void 0:S.call(b,I,t,this.state.context,n))}catch(O){Promise.reject(O)}try{await((T=(w=L(this,Nt).config).onSettled)==null?void 0:T.call(w,void 0,I,this.state.variables,this.state.context,this,n))}catch(O){Promise.reject(O)}try{await((N=(E=this.options).onSettled)==null?void 0:N.call(E,void 0,I,t,this.state.context,n))}catch(O){Promise.reject(O)}throw Ne(this,br,Kr).call(this,{type:"error",error:I}),I}finally{L(this,Nt).runNext(this)}}},oo=new WeakMap,yr=new WeakMap,Nt=new WeakMap,Sn=new WeakMap,br=new WeakSet,Kr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),yt.batch(()=>{L(this,yr).forEach(n=>{n.onMutationUpdate(t)}),L(this,Nt).notify({mutation:this,type:"updated",action:t})})},cg);function qg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ug=(dg=class extends fs{constructor(t={}){super();Ce(this,kr);Ce(this,ur);Ce(this,ao);this.config=t,ee(this,kr,new Set),ee(this,ur,new Map),ee(this,ao,0)}build(t,r,n){const s=new jg({client:t,mutationCache:this,mutationId:++Ba(this,ao)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){L(this,kr).add(t);const r=vo(t);if(typeof r=="string"){const n=L(this,ur).get(r);n?n.push(t):L(this,ur).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,kr).delete(t)){const r=vo(t);if(typeof r=="string"){const n=L(this,ur).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&L(this,ur).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=vo(t);if(typeof r=="string"){const n=L(this,ur).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=vo(t);if(typeof r=="string"){const s=(n=L(this,ur).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){yt.batch(()=>{L(this,kr).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,kr).clear(),L(this,ur).clear()})}getAll(){return Array.from(L(this,kr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>lc(r,n))}findAll(t={}){return this.getAll().filter(r=>lc(t,r))}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return yt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Mt))))}},kr=new WeakMap,ur=new WeakMap,ao=new WeakMap,dg);function vo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zg=(ug=class extends fs{constructor(t={}){super();Ce(this,Cr);this.config=t,ee(this,Cr,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??Ua(s,r);let a=this.get(o);return a||(a=new Fg({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){L(this,Cr).has(t.queryHash)||(L(this,Cr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=L(this,Cr).get(t.queryHash);r&&(t.destroy(),r===t&&L(this,Cr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Cr).get(t)}getAll(){return[...L(this,Cr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ic(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>ic(t,n)):r}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Cr=new WeakMap,ug),Vg=(fg=class{constructor(e={}){Ce(this,tt);Ce(this,Hr);Ce(this,Qr);Ce(this,as);Ce(this,is);Ce(this,Wr);Ce(this,ls);Ce(this,cs);ee(this,tt,e.queryCache||new zg),ee(this,Hr,e.mutationCache||new Ug),ee(this,Qr,e.defaultOptions||{}),ee(this,as,new Map),ee(this,is,new Map),ee(this,Wr,0)}mount(){Ba(this,Wr)._++,L(this,Wr)===1&&(ee(this,ls,ja.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,tt).onFocus())})),ee(this,cs,mo.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,tt).onOnline())})))}unmount(){var e,t;Ba(this,Wr)._--,L(this,Wr)===0&&((e=L(this,ls))==null||e.call(this),ee(this,ls,void 0),(t=L(this,cs))==null||t.call(this),ee(this,cs,void 0))}isFetching(e){return L(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,Hr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,tt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=L(this,tt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Dr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return L(this,tt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=L(this,tt).get(n.queryHash),o=s==null?void 0:s.state.data,a=_g(t,o);if(a!==void 0)return L(this,tt).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return yt.batch(()=>L(this,tt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,tt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=L(this,tt);yt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=L(this,tt);return yt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=yt.batch(()=>L(this,tt).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Mt).catch(Mt)}invalidateQueries(e,t={}){return yt.batch(()=>(L(this,tt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=yt.batch(()=>L(this,tt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(Mt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Mt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=L(this,tt).build(this,t);return r.isStaleByTime(Dr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mt).catch(Mt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mt).catch(Mt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return mo.isOnline()?L(this,Hr).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,tt)}getMutationCache(){return L(this,Hr)}getDefaultOptions(){return L(this,Qr)}setDefaultOptions(e){ee(this,Qr,e)}setQueryDefaults(e,t){L(this,as).set(hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,as).values()],r={};return t.forEach(n=>{ps(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){L(this,is).set(hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,is).values()],r={};return t.forEach(n=>{ps(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,Qr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ua(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===go&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,Qr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,tt).clear(),L(this,Hr).clear()}},tt=new WeakMap,Hr=new WeakMap,Qr=new WeakMap,as=new WeakMap,is=new WeakMap,Wr=new WeakMap,ls=new WeakMap,cs=new WeakMap,fg),wc=je.createContext(void 0),Hg=e=>{const t=je.useContext(wc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qg=({client:e,children:t})=>(je.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(wc.Provider,{value:e,children:t})),_c=je.createContext(!1),Wg=()=>je.useContext(_c);_c.Provider;function Rg(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Gg=je.createContext(Rg()),Kg=()=>je.useContext(Gg),Yg=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?fc(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Zg=e=>{je.useEffect(()=>{e.clearReset()},[e])},Xg=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||fc(r,[e.error,n])),Jg=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},em=(e,t)=>e.isLoading&&e.isFetching&&!t,tm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Tc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function rm(e,t,r){var m,C,h,v;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Wg(),s=Kg(),o=Hg(),a=o.defaultQueryOptions(e);(C=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||C.call(m,a);const i=o.getQueryCache().get(a.queryHash);process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const c=e.subscribed!==!1;a._optimisticResults=n?"isRestoring":c?"optimistic":void 0,Jg(a),Yg(a,s,i),Zg(s);const d=!o.getQueryCache().get(a.queryHash),[u]=je.useState(()=>new t(o,a)),f=u.getOptimisticResult(a),g=!n&&c;if(je.useSyncExternalStore(je.useCallback(y=>{const b=g?u.subscribe(yt.batchCalls(y)):Mt;return u.updateResult(),b},[u,g]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),je.useEffect(()=>{u.setOptions(a)},[a,u]),tm(a,f))throw Tc(a,u,s);if(Xg({result:f,errorResetBoundary:s,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;if((v=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,a,f),a.experimental_prefetchInRender&&!gs.isServer()&&em(f,n)){const y=d?Tc(a,u,s):i==null?void 0:i.promise;y==null||y.catch(Mt).finally(()=>{u.updateResult()})}return a.notifyOnChangeProps?f:u.trackResult(f)}function En(e,t){return rm(e,Mg)}let nm={data:""},sm=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||nm},om=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,am=/\/\*[^]*?\*\/| +/g,Ec=/\n+/g,Nr=(e,t)=>{let r="",n="",s="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?r=o+" "+a+";":n+=o[1]=="f"?Nr(a,o):o+"{"+Nr(a,o[1]=="k"?"":t)+"}":typeof a=="object"?n+=Nr(a,t?t.replace(/([^,])+/g,i=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,i):i?i+" "+c:c)):o):a!=null&&(o=o[1]=="-"?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Nr.p?Nr.p(o,a):o+":"+a+";")}return r+(t&&s?t+"{"+s+"}":s)+n},Pr={},Ac=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ac(e[r]);return t}return e},im=(e,t,r,n,s)=>{let o=Ac(e),a=Pr[o]||(Pr[o]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(o));if(!Pr[a]){let c=o!==e?e:(d=>{let u,f,g=[{}];for(;u=om.exec(d.replace(am,""));)u[4]?g.shift():u[3]?(f=u[3].replace(Ec," ").trim(),g.unshift(g[0][f]=g[0][f]||{})):g[0][u[1]]=u[2].replace(Ec," ").trim();return g[0]})(e);Pr[a]=Nr(s?{["@keyframes "+a]:c}:c,r?"":"."+a)}let i=r&&Pr.g;return r&&(Pr.g=Pr[a]),((c,d,u,f)=>{f?d.data=d.data.replace(f,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Pr[a],t,n,i),a},lm=(e,t,r)=>e.reduce((n,s,o)=>{let a=t[o];if(a&&a.call){let i=a(r),c=i&&i.props&&i.props.className||/^go/.test(i)&&i;a=c?"."+c:i&&typeof i=="object"?i.props?"":Nr(i,""):i===!1?"":i}return n+s+(a??"")},"");function yo(e){let t=this||{},r=e.call?e(t.p):e;return im(r.unshift?r.raw?lm(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,sm(t.target),t.g,t.o,t.k)}let kc,Ya,Za;yo.bind({g:1});let _r=yo.bind({k:1});function cm(e,t,r,n){Nr.p=t,kc=e,Ya=r,Za=n}function Or(e,t){let r=this||{};return function(){let n=arguments;function s(o,a){let i=Object.assign({},o),c=i.className||s.className;r.p=Object.assign({theme:Ya&&Ya()},i),r.o=/go\d/.test(c),i.className=yo.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=i.as||e,delete i.as),Za&&d[0]&&Za(i),kc(d,i)}return s}}var dm=e=>typeof e=="function",bo=(e,t)=>dm(e)?e(t):e,um=(()=>{let e=0;return()=>(++e).toString()})(),Ic=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),fm=20,Xa="default",Lc=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return Lc(e,{type:e.toasts.find(a=>a.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(a=>a.id===s||s===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+o}))}}},Co=[],Dc={toasts:[],pausedAt:void 0,settings:{toastLimit:fm}},hr={},Nc=(e,t=Xa)=>{hr[t]=Lc(hr[t]||Dc,e),Co.forEach(([r,n])=>{r===t&&n(hr[t])})},Pc=e=>Object.keys(hr).forEach(t=>Nc(e,t)),hm=e=>Object.keys(hr).find(t=>hr[t].toasts.some(r=>r.id===e)),So=(e=Xa)=>t=>{Nc(t,e)},pm={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gm=(e={},t=Xa)=>{let[r,n]=p.useState(hr[t]||Dc),s=p.useRef(hr[t]);p.useEffect(()=>(s.current!==hr[t]&&n(hr[t]),Co.push([t,n]),()=>{let a=Co.findIndex(([i])=>i===t);a>-1&&Co.splice(a,1)}),[t]);let o=r.toasts.map(a=>{var i,c,d;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((i=e[a.type])==null?void 0:i.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((c=e[a.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||pm[a.type],style:{...e.style,...(d=e[a.type])==null?void 0:d.style,...a.style}}});return{...r,toasts:o}},mm=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||um()}),ms=e=>(t,r)=>{let n=mm(t,e,r);return So(n.toasterId||hm(n.id))({type:2,toast:n}),n.id},lt=(e,t)=>ms("blank")(e,t);lt.error=ms("error"),lt.success=ms("success"),lt.loading=ms("loading"),lt.custom=ms("custom"),lt.dismiss=(e,t)=>{let r={type:3,toastId:e};t?So(t)(r):Pc(r)},lt.dismissAll=e=>lt.dismiss(void 0,e),lt.remove=(e,t)=>{let r={type:4,toastId:e};t?So(t)(r):Pc(r)},lt.removeAll=e=>lt.remove(void 0,e),lt.promise=(e,t,r)=>{let n=lt.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let o=t.success?bo(t.success,s):void 0;return o?lt.success(o,{id:n,...r,...r==null?void 0:r.success}):lt.dismiss(n),s}).catch(s=>{let o=t.error?bo(t.error,s):void 0;o?lt.error(o,{id:n,...r,...r==null?void 0:r.error}):lt.dismiss(n)}),e};var vm=1e3,ym=(e,t="default")=>{let{toasts:r,pausedAt:n}=gm(e,t),s=p.useRef(new Map).current,o=p.useCallback((f,g=vm)=>{if(s.has(f))return;let m=setTimeout(()=>{s.delete(f),a({type:4,toastId:f})},g);s.set(f,m)},[]);p.useEffect(()=>{if(n)return;let f=Date.now(),g=r.map(m=>{if(m.duration===1/0)return;let C=(m.duration||0)+m.pauseDuration-(f-m.createdAt);if(C<0){m.visible&&lt.dismiss(m.id);return}return setTimeout(()=>lt.dismiss(m.id,t),C)});return()=>{g.forEach(m=>m&&clearTimeout(m))}},[r,n,t]);let a=p.useCallback(So(t),[t]),i=p.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=p.useCallback((f,g)=>{a({type:1,toast:{id:f,height:g}})},[a]),d=p.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),u=p.useCallback((f,g)=>{let{reverseOrder:m=!1,gutter:C=8,defaultPosition:h}=g||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),y=v.findIndex(S=>S.id===f.id),b=v.filter((S,w)=>w<y&&S.visible).length;return v.filter(S=>S.visible).slice(...m?[b+1]:[0,b]).reduce((S,w)=>S+(w.height||0)+C,0)},[r]);return p.useEffect(()=>{r.forEach(f=>{if(f.dismissed)o(f.id,f.removeDelay);else{let g=s.get(f.id);g&&(clearTimeout(g),s.delete(f.id))}})},[r,o]),{toasts:r,handlers:{updateHeight:c,startPause:i,endPause:d,calculateOffset:u}}},bm=_r`
1
+ (function(xe,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("react-dom"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime"],h):(xe=typeof globalThis<"u"?globalThis:xe||self,h(xe.CollectionEditorReact={},xe.React,xe.ReactDOM,xe.jsxRuntime))})(this,(function(xe,h,Ke,l){"use strict";var lD=Object.defineProperty;var vg=xe=>{throw TypeError(xe)};var cD=(xe,h,Ke)=>h in xe?lD(xe,h,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):xe[h]=Ke;var Ns=(xe,h,Ke)=>cD(xe,typeof h!="symbol"?h+"":h,Ke),Lc=(xe,h,Ke)=>h.has(xe)||vg("Cannot "+Ke);var I=(xe,h,Ke)=>(Lc(xe,h,"read from private field"),Ke?Ke.call(xe):h.get(xe)),_e=(xe,h,Ke)=>h.has(xe)?vg("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(xe):h.set(xe,Ke),oe=(xe,h,Ke,l)=>(Lc(xe,h,"write to private field"),l?l.call(xe,Ke):h.set(xe,Ke),Ke),qe=(xe,h,Ke)=>(Lc(xe,h,"access private method"),Ke);var ii=(xe,h,Ke,l)=>({set _(li){oe(xe,h,li,Ke)},get _(){return I(xe,h,l)}});var Fn,dn,So,sg,Fr,Mn,ag,wo,un,_o,ig,Bn,lg,To,$n,ko,gr,qn,St,Ts,jn,ar,yg,Yr,cg,Xt,He,ks,Vt,Un,Eo,Wr,fn,Es,Ao,Io,Hn,Vn,hn,Lo,Ge,Os,Dc,Nc,Oc,Pc,xc,Fc,Mc,bg,dg,As,Mr,$t,zn,Br,wn,ug,Gr,Ar,Is,fg,$r,hg,it,pn,mn,Do,No,gn,Oo,Po,pg;function li(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const We=li(h);var xo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wg=(sg=class extends xo{constructor(){super();_e(this,Fn);_e(this,dn);_e(this,So);oe(this,So,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,dn)||this.setEventListener(I(this,So))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,dn))==null||t.call(this),oe(this,dn,void 0))}setEventListener(t){var r;oe(this,So,t),(r=I(this,dn))==null||r.call(this),oe(this,dn,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){I(this,Fn)!==t&&(oe(this,Fn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof I(this,Fn)=="boolean"?I(this,Fn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Fn=new WeakMap,dn=new WeakMap,So=new WeakMap,sg),ci=new wg,_g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Tg=(ag=class{constructor(){_e(this,Fr,_g);_e(this,Mn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&I(this,Mn)&&e!==I(this,Fr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:I(this,Fr),provider:e}),oe(this,Fr,e),process.env.NODE_ENV!=="production"&&oe(this,Mn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&oe(this,Mn,!0),I(this,Fr).setTimeout(e,t)}clearTimeout(e){I(this,Fr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&oe(this,Mn,!0),I(this,Fr).setInterval(e,t)}clearInterval(e){I(this,Fr).clearInterval(e)}},Fr=new WeakMap,Mn=new WeakMap,ag),_n=new Tg;function kg(e){setTimeout(e,0)}var Eg=typeof window>"u"||"Deno"in globalThis;function Wt(){}function Ag(e,t){return typeof e=="function"?e(t):e}function di(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zr(e,t){return typeof e=="function"?e(t):e}function tr(e,t){return typeof e=="function"?e(t):e}function $c(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==ui(a,t.options))return!1}else if(!Mo(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||o&&o!==t.state.fetchStatus||s&&!s(t))}function qc(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(Fo(t.options.mutationKey)!==Fo(s))return!1}else if(!Mo(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function ui(e,t){return((t==null?void 0:t.queryKeyHashFn)||Fo)(e)}function Fo(e){return JSON.stringify(e,(t,r)=>pi(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function Mo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Mo(e[r],t[r])):!1}var Ig=Object.prototype.hasOwnProperty;function fi(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=jc(e)&&jc(t);if(!n&&!(pi(e)&&pi(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),i=a.length,c=n?new Array(i):{};let d=0;for(let u=0;u<i;u++){const f=n?u:a[u],g=e[f],p=t[f];if(g===p){c[f]=g,(n?u<s:Ig.call(e,f))&&d++;continue}if(g===null||p===null||typeof g!="object"||typeof p!="object"){c[f]=p;continue}const b=fi(g,p,r+1);c[f]=b,b===g&&d++}return s===i&&d===s?e:c}function hi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function jc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pi(e){if(!Uc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Uc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Uc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Lg(e){return new Promise(t=>{_n.setTimeout(t,e)})}function mi(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return fi(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return fi(e,t)}return t}function Dg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Ng(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ps=Symbol();function Hc(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ps&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ps?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vc(e,t){return typeof e=="function"?e(...t):!!e}function Og(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var Bo=(()=>{let e=()=>Eg;return{isServer(){return e()},setIsServer(t){e=t}}})();function gi(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var Pg=kg;function xg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},o=Pg;const s=i=>{t?e.push(i):o(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&o(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{s(()=>{i(...c)})},schedule:s,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{o=i}}}var Et=xg(),Fg=(ig=class extends xo{constructor(){super();_e(this,wo,!0);_e(this,un);_e(this,_o);oe(this,_o,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){I(this,un)||this.setEventListener(I(this,_o))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,un))==null||t.call(this),oe(this,un,void 0))}setEventListener(t){var r;oe(this,_o,t),(r=I(this,un))==null||r.call(this),oe(this,un,t(this.setOnline.bind(this)))}setOnline(t){I(this,wo)!==t&&(oe(this,wo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return I(this,wo)}},wo=new WeakMap,un=new WeakMap,_o=new WeakMap,ig),xs=new Fg;function Mg(e){return Math.min(1e3*2**e,3e4)}function zc(e){return(e??"online")==="online"?xs.isOnline():!0}var vi=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Rc(e){let t=!1,r=0,n;const o=gi(),s=()=>o.status!=="pending",a=m=>{var v;if(!s()){const y=new vi(m);g(y),(v=e.onCancel)==null||v.call(e,y)}},i=()=>{t=!0},c=()=>{t=!1},d=()=>ci.isFocused()&&(e.networkMode==="always"||xs.isOnline())&&e.canRun(),u=()=>zc(e.networkMode)&&e.canRun(),f=m=>{s()||(n==null||n(),o.resolve(m))},g=m=>{s()||(n==null||n(),o.reject(m))},p=()=>new Promise(m=>{var v;n=y=>{(s()||d())&&m(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var m;n=void 0,s()||(m=e.onContinue)==null||m.call(e)}),b=()=>{if(s())return;let m;const v=r===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(f).catch(y=>{var T;if(s())return;const C=e.retry??(Bo.isServer()?0:3),S=e.retryDelay??Mg,w=typeof S=="function"?S(r,y):S,_=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,y);if(t||!_){g(y);return}r++,(T=e.onFail)==null||T.call(e,r,y),Lg(w).then(()=>d()?void 0:p()).then(()=>{t?g(y):b()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(n==null||n(),o),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():p().then(b),o)}}var Qc=(lg=class{constructor(){_e(this,Bn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),di(this.gcTime)&&oe(this,Bn,_n.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bo.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,Bn)!==void 0&&(_n.clearTimeout(I(this,Bn)),oe(this,Bn,void 0))}},Bn=new WeakMap,lg);function Bg(e){return{onFetch:(t,r)=>{var u,f,g,p,b;const n=t.options,o=(g=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let m=!1;const v=S=>{Og(S,()=>t.signal,()=>m=!0)},y=Hc(t.options,t.fetchOptions),C=async(S,w,_)=>{if(m)return Promise.reject(t.signal.reason);if(w==null&&S.pages.length)return Promise.resolve(S);const E=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:w,direction:_?"backward":"forward",meta:t.options.meta};return v(D),D})(),A=await y(E),{maxPages:x}=t.options,B=_?Ng:Dg;return{pages:B(S.pages,A,x),pageParams:B(S.pageParams,w,x)}};if(o&&s.length){const S=o==="backward",w=S?$g:Wc,_={pages:s,pageParams:a},T=w(n,_);i=await C(_,T,S)}else{const S=e??s.length;do{const w=c===0?a[0]??n.initialPageParam:Wc(n,i);if(c>0&&w==null)break;i=await C(i,w),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var m,v;return(v=(m=t.options).persister)==null?void 0:v.call(m,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function Wc(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function $g(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var qg=(cg=class extends Qc{constructor(t){super();_e(this,ar);_e(this,To);_e(this,$n);_e(this,ko);_e(this,gr);_e(this,qn);_e(this,St);_e(this,Ts);_e(this,jn);oe(this,jn,!1),oe(this,Ts,t.defaultOptions),this.setOptions(t.options),this.observers=[],oe(this,qn,t.client),oe(this,gr,I(this,qn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,oe(this,$n,Yc(this.options)),this.state=t.state??I(this,$n),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return I(this,To)}get promise(){var t;return(t=I(this,St))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,Ts),...t},t!=null&&t._type&&oe(this,To,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Yc(this.options);r.data!==void 0&&(this.setState(Kc(r.data,r.dataUpdatedAt)),oe(this,$n,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,gr).remove(this)}setData(t,r){const n=mi(this.state.data,t,this.options);return qe(this,ar,Yr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){qe(this,ar,Yr).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=I(this,St))==null?void 0:n.promise;return(o=I(this,St))==null||o.cancel(t),r?r.then(Wt).catch(Wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,$n)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>tr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ps||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Zr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Bc(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,St))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,St))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,gr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(I(this,St)&&(I(this,jn)||qe(this,ar,yg).call(this)?I(this,St).cancel({revert:!0}):I(this,St).cancelRetry()),this.scheduleGc()),I(this,gr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||qe(this,ar,Yr).call(this,{type:"invalidate"})}async fetch(t,r){var d,u,f,g,p,b,m,v,y,C,S;if(this.state.fetchStatus!=="idle"&&((d=I(this,St))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,St))return I(this,St).continueRetry(),I(this,St).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(_=>_.options.queryFn);w&&this.setOptions(w.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(oe(this,jn,!0),n.signal)})},s=()=>{const w=Hc(this.options,r),T=(()=>{const E={client:I(this,qn),queryKey:this.queryKey,meta:this.meta};return o(E),E})();return oe(this,jn,!1),this.options.persister?this.options.persister(w,T,this):w(T)},i=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,qn),state:this.state,fetchFn:s};return o(w),w})(),c=I(this,To)==="infinite"?Bg(this.options.pages):this.options.behavior;c==null||c.onFetch(i,this),oe(this,ko,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&qe(this,ar,Yr).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),oe(this,St,Rc({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:w=>{w instanceof vi&&w.revert&&this.setState({...I(this,ko),fetchStatus:"idle"}),n.abort()},onFail:(w,_)=>{qe(this,ar,Yr).call(this,{type:"failed",failureCount:w,error:_})},onPause:()=>{qe(this,ar,Yr).call(this,{type:"pause"})},onContinue:()=>{qe(this,ar,Yr).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const w=await I(this,St).start();if(w===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(w),(p=(g=I(this,gr).config).onSuccess)==null||p.call(g,w,this),(m=(b=I(this,gr).config).onSettled)==null||m.call(b,w,this.state.error,this),w}catch(w){if(w instanceof vi){if(w.silent)return I(this,St).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw qe(this,ar,Yr).call(this,{type:"error",error:w}),(y=(v=I(this,gr).config).onError)==null||y.call(v,w,this),(S=(C=I(this,gr).config).onSettled)==null||S.call(C,this.state.data,w,this),w}finally{this.scheduleGc()}}},To=new WeakMap,$n=new WeakMap,ko=new WeakMap,gr=new WeakMap,qn=new WeakMap,St=new WeakMap,Ts=new WeakMap,jn=new WeakMap,ar=new WeakSet,yg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Yr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Gc(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Kc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return oe(this,ko,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Et.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),I(this,gr).notify({query:this,type:"updated",action:t})})},cg);function Gc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Kc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Yc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var jg=(dg=class extends xo{constructor(t,r){super();_e(this,Ge);_e(this,Xt);_e(this,He);_e(this,ks);_e(this,Vt);_e(this,Un);_e(this,Eo);_e(this,Wr);_e(this,fn);_e(this,Es);_e(this,Ao);_e(this,Io);_e(this,Hn);_e(this,Vn);_e(this,hn);_e(this,Lo,new Set);this.options=r,oe(this,Xt,t),oe(this,fn,null),oe(this,Wr,gi()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,He).addObserver(this),Zc(I(this,He),this.options)?qe(this,Ge,Os).call(this):this.updateResult(),qe(this,Ge,Pc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yi(I(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yi(I(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,qe(this,Ge,xc).call(this),qe(this,Ge,Fc).call(this),I(this,He).removeObserver(this)}setOptions(t){const r=this.options,n=I(this,He);if(this.options=I(this,Xt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tr(this.options.enabled,I(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");qe(this,Ge,Mc).call(this),I(this,He).setOptions(this.options),r._defaulted&&!hi(this.options,r)&&I(this,Xt).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,He),observer:this});const o=this.hasListeners();o&&Xc(I(this,He),n,this.options,r)&&qe(this,Ge,Os).call(this),this.updateResult(),o&&(I(this,He)!==n||tr(this.options.enabled,I(this,He))!==tr(r.enabled,I(this,He))||Zr(this.options.staleTime,I(this,He))!==Zr(r.staleTime,I(this,He)))&&qe(this,Ge,Dc).call(this);const s=qe(this,Ge,Nc).call(this);o&&(I(this,He)!==n||tr(this.options.enabled,I(this,He))!==tr(r.enabled,I(this,He))||s!==I(this,hn))&&qe(this,Ge,Oc).call(this,s)}getOptimisticResult(t){const r=I(this,Xt).getQueryCache().build(I(this,Xt),t),n=this.createResult(r,t);return Hg(this,n)&&(oe(this,Vt,n),oe(this,Eo,this.options),oe(this,Un,I(this,He).state)),n}getCurrentResult(){return I(this,Vt)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&I(this,Wr).status==="pending"&&I(this,Wr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){I(this,Lo).add(t)}getCurrentQuery(){return I(this,He)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=I(this,Xt).defaultQueryOptions(t),n=I(this,Xt).getQueryCache().build(I(this,Xt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return qe(this,Ge,Os).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Vt)))}createResult(t,r){var x;const n=I(this,He),o=this.options,s=I(this,Vt),a=I(this,Un),i=I(this,Eo),d=t!==n?t.state:I(this,ks),{state:u}=t;let f={...u},g=!1,p;if(r._optimisticResults){const B=this.hasListeners(),D=!B&&Zc(t,r),F=B&&Xc(t,n,r,o);(D||F)&&(f={...f,...Gc(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:m,status:v}=f;p=f.data;let y=!1;if(r.placeholderData!==void 0&&p===void 0&&v==="pending"){let B;s!=null&&s.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(B=s.data,y=!0):B=typeof r.placeholderData=="function"?r.placeholderData((x=I(this,Io))==null?void 0:x.state.data,I(this,Io)):r.placeholderData,B!==void 0&&(v="success",p=mi(s==null?void 0:s.data,B,r),g=!0)}if(r.select&&p!==void 0&&!y)if(s&&p===(a==null?void 0:a.data)&&r.select===I(this,Es))p=I(this,Ao);else try{oe(this,Es,r.select),p=r.select(p),p=mi(s==null?void 0:s.data,p,r),oe(this,Ao,p),oe(this,fn,null)}catch(B){oe(this,fn,B)}I(this,fn)&&(b=I(this,fn),p=I(this,Ao),m=Date.now(),v="error");const C=f.fetchStatus==="fetching",S=v==="pending",w=v==="error",_=S&&C,T=p!==void 0,A={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:w,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:m,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:w&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:w&&T,isStale:bi(t,r),refetch:this.refetch,promise:I(this,Wr),isEnabled:tr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const B=A.data!==void 0,D=A.status==="error"&&!B,F=V=>{D?V.reject(A.error):B&&V.resolve(A.data)},M=()=>{const V=oe(this,Wr,A.promise=gi());F(V)},P=I(this,Wr);switch(P.status){case"pending":t.queryHash===n.queryHash&&F(P);break;case"fulfilled":(D||A.data!==P.value)&&M();break;case"rejected":(!D||A.error!==P.reason)&&M();break}}return A}updateResult(){const t=I(this,Vt),r=this.createResult(I(this,He),this.options);if(oe(this,Un,I(this,He).state),oe(this,Eo,this.options),I(this,Un).data!==void 0&&oe(this,Io,I(this,He)),hi(r,t))return;oe(this,Vt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!I(this,Lo).size)return!0;const a=new Set(s??I(this,Lo));return this.options.throwOnError&&a.add("error"),Object.keys(I(this,Vt)).some(i=>{const c=i;return I(this,Vt)[c]!==t[c]&&a.has(c)})};qe(this,Ge,bg).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&qe(this,Ge,Pc).call(this)}},Xt=new WeakMap,He=new WeakMap,ks=new WeakMap,Vt=new WeakMap,Un=new WeakMap,Eo=new WeakMap,Wr=new WeakMap,fn=new WeakMap,Es=new WeakMap,Ao=new WeakMap,Io=new WeakMap,Hn=new WeakMap,Vn=new WeakMap,hn=new WeakMap,Lo=new WeakMap,Ge=new WeakSet,Os=function(t){qe(this,Ge,Mc).call(this);let r=I(this,He).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Wt)),r},Dc=function(){qe(this,Ge,xc).call(this);const t=Zr(this.options.staleTime,I(this,He));if(Bo.isServer()||I(this,Vt).isStale||!di(t))return;const n=Bc(I(this,Vt).dataUpdatedAt,t)+1;oe(this,Hn,_n.setTimeout(()=>{I(this,Vt).isStale||this.updateResult()},n))},Nc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,He)):this.options.refetchInterval)??!1},Oc=function(t){qe(this,Ge,Fc).call(this),oe(this,hn,t),!(Bo.isServer()||tr(this.options.enabled,I(this,He))===!1||!di(I(this,hn))||I(this,hn)===0)&&oe(this,Vn,_n.setInterval(()=>{(this.options.refetchIntervalInBackground||ci.isFocused())&&qe(this,Ge,Os).call(this)},I(this,hn)))},Pc=function(){qe(this,Ge,Dc).call(this),qe(this,Ge,Oc).call(this,qe(this,Ge,Nc).call(this))},xc=function(){I(this,Hn)!==void 0&&(_n.clearTimeout(I(this,Hn)),oe(this,Hn,void 0))},Fc=function(){I(this,Vn)!==void 0&&(_n.clearInterval(I(this,Vn)),oe(this,Vn,void 0))},Mc=function(){const t=I(this,Xt).getQueryCache().build(I(this,Xt),this.options);if(t===I(this,He))return;const r=I(this,He);oe(this,He,t),oe(this,ks,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},bg=function(t){Et.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(I(this,Vt))}),I(this,Xt).getQueryCache().notify({query:I(this,He),type:"observerResultsUpdated"})})},dg);function Ug(e,t){return tr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&tr(t.retryOnMount,e)===!1)}function Zc(e,t){return Ug(e,t)||e.state.data!==void 0&&yi(e,t,t.refetchOnMount)}function yi(e,t,r){if(tr(t.enabled,e)!==!1&&Zr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&bi(e,t)}return!1}function Xc(e,t,r,n){return(e!==t||tr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&bi(e,r)}function bi(e,t){return tr(t.enabled,e)!==!1&&e.isStaleByTime(Zr(t.staleTime,e))}function Hg(e,t){return!hi(e.getCurrentResult(),t)}var Vg=(ug=class extends Qc{constructor(t){super();_e(this,Br);_e(this,As);_e(this,Mr);_e(this,$t);_e(this,zn);oe(this,As,t.client),this.mutationId=t.mutationId,oe(this,$t,t.mutationCache),oe(this,Mr,[]),this.state=t.state||zg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,Mr).includes(t)||(I(this,Mr).push(t),this.clearGcTimeout(),I(this,$t).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){oe(this,Mr,I(this,Mr).filter(r=>r!==t)),this.scheduleGc(),I(this,$t).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,Mr).length||(this.state.status==="pending"?this.scheduleGc():I(this,$t).remove(this))}continue(){var t;return((t=I(this,zn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,c,d,u,f,g,p,b,m,v,y,C,S,w,_,T,E;const r=()=>{qe(this,Br,wn).call(this,{type:"continue"})},n={client:I(this,As),meta:this.options.meta,mutationKey:this.options.mutationKey};oe(this,zn,Rc({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(A,x)=>{qe(this,Br,wn).call(this,{type:"failed",failureCount:A,error:x})},onPause:()=>{qe(this,Br,wn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,$t).canRun(this)}));const o=this.state.status==="pending",s=!I(this,zn).canStart();try{if(o)r();else{qe(this,Br,wn).call(this,{type:"pending",variables:t,isPaused:s}),I(this,$t).config.onMutate&&await I(this,$t).config.onMutate(t,this,n);const x=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t,n));x!==this.state.context&&qe(this,Br,wn).call(this,{type:"pending",context:x,variables:t,isPaused:s})}const A=await I(this,zn).start();return await((d=(c=I(this,$t).config).onSuccess)==null?void 0:d.call(c,A,t,this.state.context,this,n)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,A,t,this.state.context,n)),await((p=(g=I(this,$t).config).onSettled)==null?void 0:p.call(g,A,null,this.state.variables,this.state.context,this,n)),await((m=(b=this.options).onSettled)==null?void 0:m.call(b,A,null,t,this.state.context,n)),qe(this,Br,wn).call(this,{type:"success",data:A}),A}catch(A){try{await((y=(v=I(this,$t).config).onError)==null?void 0:y.call(v,A,t,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,A,t,this.state.context,n))}catch(x){Promise.reject(x)}try{await((_=(w=I(this,$t).config).onSettled)==null?void 0:_.call(w,void 0,A,this.state.variables,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((E=(T=this.options).onSettled)==null?void 0:E.call(T,void 0,A,t,this.state.context,n))}catch(x){Promise.reject(x)}throw qe(this,Br,wn).call(this,{type:"error",error:A}),A}finally{I(this,$t).runNext(this)}}},As=new WeakMap,Mr=new WeakMap,$t=new WeakMap,zn=new WeakMap,Br=new WeakSet,wn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Et.batch(()=>{I(this,Mr).forEach(n=>{n.onMutationUpdate(t)}),I(this,$t).notify({mutation:this,type:"updated",action:t})})},ug);function zg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rg=(fg=class extends xo{constructor(t={}){super();_e(this,Gr);_e(this,Ar);_e(this,Is);this.config=t,oe(this,Gr,new Set),oe(this,Ar,new Map),oe(this,Is,0)}build(t,r,n){const o=new Vg({client:t,mutationCache:this,mutationId:++ii(this,Is)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){I(this,Gr).add(t);const r=Fs(t);if(typeof r=="string"){const n=I(this,Ar).get(r);n?n.push(t):I(this,Ar).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,Gr).delete(t)){const r=Fs(t);if(typeof r=="string"){const n=I(this,Ar).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&I(this,Ar).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Fs(t);if(typeof r=="string"){const n=I(this,Ar).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Fs(t);if(typeof r=="string"){const o=(n=I(this,Ar).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Et.batch(()=>{I(this,Gr).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,Gr).clear(),I(this,Ar).clear()})}getAll(){return Array.from(I(this,Gr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>qc(r,n))}findAll(t={}){return this.getAll().filter(r=>qc(t,r))}notify(t){Et.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Et.batch(()=>Promise.all(t.map(r=>r.continue().catch(Wt))))}},Gr=new WeakMap,Ar=new WeakMap,Is=new WeakMap,fg);function Fs(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Qg=(hg=class extends xo{constructor(t={}){super();_e(this,$r);this.config=t,oe(this,$r,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??ui(o,r);let a=this.get(s);return a||(a=new qg({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){I(this,$r).has(t.queryHash)||(I(this,$r).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=I(this,$r).get(t.queryHash);r&&(t.destroy(),r===t&&I(this,$r).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Et.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,$r).get(t)}getAll(){return[...I(this,$r).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>$c(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>$c(t,n)):r}notify(t){Et.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Et.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Et.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},$r=new WeakMap,hg),Wg=(pg=class{constructor(e={}){_e(this,it);_e(this,pn);_e(this,mn);_e(this,Do);_e(this,No);_e(this,gn);_e(this,Oo);_e(this,Po);oe(this,it,e.queryCache||new Qg),oe(this,pn,e.mutationCache||new Rg),oe(this,mn,e.defaultOptions||{}),oe(this,Do,new Map),oe(this,No,new Map),oe(this,gn,0)}mount(){ii(this,gn)._++,I(this,gn)===1&&(oe(this,Oo,ci.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,it).onFocus())})),oe(this,Po,xs.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,it).onOnline())})))}unmount(){var e,t;ii(this,gn)._--,I(this,gn)===0&&((e=I(this,Oo))==null||e.call(this),oe(this,Oo,void 0),(t=I(this,Po))==null||t.call(this),oe(this,Po,void 0))}isFetching(e){return I(this,it).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,pn).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,it).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=I(this,it).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Zr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return I(this,it).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=I(this,it).get(n.queryHash),s=o==null?void 0:o.state.data,a=Ag(t,s);if(a!==void 0)return I(this,it).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Et.batch(()=>I(this,it).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,it).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=I(this,it);Et.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=I(this,it);return Et.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Et.batch(()=>I(this,it).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(Wt).catch(Wt)}invalidateQueries(e,t={}){return Et.batch(()=>(I(this,it).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Et.batch(()=>I(this,it).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(Wt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Wt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=I(this,it).build(this,t);return r.isStaleByTime(Zr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wt).catch(Wt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wt).catch(Wt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return xs.isOnline()?I(this,pn).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,it)}getMutationCache(){return I(this,pn)}getDefaultOptions(){return I(this,mn)}setDefaultOptions(e){oe(this,mn,e)}setQueryDefaults(e,t){I(this,Do).set(Fo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,Do).values()],r={};return t.forEach(n=>{Mo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){I(this,No).set(Fo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,No).values()],r={};return t.forEach(n=>{Mo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,mn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ui(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ps&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,mn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,it).clear(),I(this,pn).clear()}},it=new WeakMap,pn=new WeakMap,mn=new WeakMap,Do=new WeakMap,No=new WeakMap,gn=new WeakMap,Oo=new WeakMap,Po=new WeakMap,pg),Jc=We.createContext(void 0),Gg=e=>{const t=We.useContext(Jc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Kg=({client:e,children:t})=>(We.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Jc.Provider,{value:e,children:t})),ed=We.createContext(!1),Yg=()=>We.useContext(ed);ed.Provider;function Zg(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Xg=We.createContext(Zg()),Jg=()=>We.useContext(Xg),ev=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Vc(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},tv=e=>{We.useEffect(()=>{e.clearReset()},[e])},rv=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||Vc(r,[e.error,n])),nv=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ov=(e,t)=>e.isLoading&&e.isFetching&&!t,sv=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,td=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function av(e,t,r){var p,b,m,v;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Yg(),o=Jg(),s=Gg(),a=s.defaultQueryOptions(e);(b=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||b.call(p,a);const i=s.getQueryCache().get(a.queryHash);process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const c=e.subscribed!==!1;a._optimisticResults=n?"isRestoring":c?"optimistic":void 0,nv(a),ev(a,o,i),tv(o);const d=!s.getQueryCache().get(a.queryHash),[u]=We.useState(()=>new t(s,a)),f=u.getOptimisticResult(a),g=!n&&c;if(We.useSyncExternalStore(We.useCallback(y=>{const C=g?u.subscribe(Et.batchCalls(y)):Wt;return u.updateResult(),C},[u,g]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),We.useEffect(()=>{u.setOptions(a)},[a,u]),sv(a,f))throw td(a,u,o);if(rv({result:f,errorResetBoundary:o,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;if((v=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||v.call(m,a,f),a.experimental_prefetchInRender&&!Bo.isServer()&&ov(f,n)){const y=d?td(a,u,o):i==null?void 0:i.promise;y==null||y.catch(Wt).finally(()=>{u.updateResult()})}return a.notifyOnChangeProps?f:u.trackResult(f)}function Ur(e,t){return av(e,jg)}let iv={data:""},lv=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||iv},cv=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,dv=/\/\*[^]*?\*\/| +/g,rd=/\n+/g,Xr=(e,t)=>{let r="",n="",o="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+a+";":n+=s[1]=="f"?Xr(a,s):s+"{"+Xr(a,s[1]=="k"?"":t)+"}":typeof a=="object"?n+=Xr(a,t?t.replace(/([^,])+/g,i=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,i):i?i+" "+c:c)):s):a!=null&&(s=s[1]=="-"?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Xr.p?Xr.p(s,a):s+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Jr={},nd=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+nd(e[r]);return t}return e},uv=(e,t,r,n,o)=>{let s=nd(e),a=Jr[s]||(Jr[s]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(s));if(!Jr[a]){let c=s!==e?e:(d=>{let u,f,g=[{}];for(;u=cv.exec(d.replace(dv,""));)u[4]?g.shift():u[3]?(f=u[3].replace(rd," ").trim(),g.unshift(g[0][f]=g[0][f]||{})):g[0][u[1]]=u[2].replace(rd," ").trim();return g[0]})(e);Jr[a]=Xr(o?{["@keyframes "+a]:c}:c,r?"":"."+a)}let i=r&&Jr.g;return r&&(Jr.g=Jr[a]),((c,d,u,f)=>{f?d.data=d.data.replace(f,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Jr[a],t,n,i),a},fv=(e,t,r)=>e.reduce((n,o,s)=>{let a=t[s];if(a&&a.call){let i=a(r),c=i&&i.props&&i.props.className||/^go/.test(i)&&i;a=c?"."+c:i&&typeof i=="object"?i.props?"":Xr(i,""):i===!1?"":i}return n+o+(a??"")},"");function Ms(e){let t=this||{},r=e.call?e(t.p):e;return uv(r.unshift?r.raw?fv(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,lv(t.target),t.g,t.o,t.k)}let od,Ci,Si;Ms.bind({g:1});let Hr=Ms.bind({k:1});function hv(e,t,r,n){Xr.p=t,od=e,Ci=r,Si=n}function en(e,t){let r=this||{};return function(){let n=arguments;function o(s,a){let i=Object.assign({},s),c=i.className||o.className;r.p=Object.assign({theme:Ci&&Ci()},i),r.o=/go\d/.test(c),i.className=Ms.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=i.as||e,delete i.as),Si&&d[0]&&Si(i),od(d,i)}return o}}var pv=e=>typeof e=="function",Bs=(e,t)=>pv(e)?e(t):e,mv=(()=>{let e=0;return()=>(++e).toString()})(),sd=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),gv=20,wi="default",ad=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return ad(e,{type:e.toasts.find(a=>a.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(a=>a.id===o||o===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},$s=[],id={toasts:[],pausedAt:void 0,settings:{toastLimit:gv}},Dr={},ld=(e,t=wi)=>{Dr[t]=ad(Dr[t]||id,e),$s.forEach(([r,n])=>{r===t&&n(Dr[t])})},cd=e=>Object.keys(Dr).forEach(t=>ld(e,t)),vv=e=>Object.keys(Dr).find(t=>Dr[t].toasts.some(r=>r.id===e)),qs=(e=wi)=>t=>{ld(t,e)},yv={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},bv=(e={},t=wi)=>{let[r,n]=h.useState(Dr[t]||id),o=h.useRef(Dr[t]);h.useEffect(()=>(o.current!==Dr[t]&&n(Dr[t]),$s.push([t,n]),()=>{let a=$s.findIndex(([i])=>i===t);a>-1&&$s.splice(a,1)}),[t]);let s=r.toasts.map(a=>{var i,c,d;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((i=e[a.type])==null?void 0:i.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((c=e[a.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||yv[a.type],style:{...e.style,...(d=e[a.type])==null?void 0:d.style,...a.style}}});return{...r,toasts:s}},Cv=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||mv()}),$o=e=>(t,r)=>{let n=Cv(t,e,r);return qs(n.toasterId||vv(n.id))({type:2,toast:n}),n.id},mt=(e,t)=>$o("blank")(e,t);mt.error=$o("error"),mt.success=$o("success"),mt.loading=$o("loading"),mt.custom=$o("custom"),mt.dismiss=(e,t)=>{let r={type:3,toastId:e};t?qs(t)(r):cd(r)},mt.dismissAll=e=>mt.dismiss(void 0,e),mt.remove=(e,t)=>{let r={type:4,toastId:e};t?qs(t)(r):cd(r)},mt.removeAll=e=>mt.remove(void 0,e),mt.promise=(e,t,r)=>{let n=mt.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Bs(t.success,o):void 0;return s?mt.success(s,{id:n,...r,...r==null?void 0:r.success}):mt.dismiss(n),o}).catch(o=>{let s=t.error?Bs(t.error,o):void 0;s?mt.error(s,{id:n,...r,...r==null?void 0:r.error}):mt.dismiss(n)}),e};var Sv=1e3,wv=(e,t="default")=>{let{toasts:r,pausedAt:n}=bv(e,t),o=h.useRef(new Map).current,s=h.useCallback((f,g=Sv)=>{if(o.has(f))return;let p=setTimeout(()=>{o.delete(f),a({type:4,toastId:f})},g);o.set(f,p)},[]);h.useEffect(()=>{if(n)return;let f=Date.now(),g=r.map(p=>{if(p.duration===1/0)return;let b=(p.duration||0)+p.pauseDuration-(f-p.createdAt);if(b<0){p.visible&&mt.dismiss(p.id);return}return setTimeout(()=>mt.dismiss(p.id,t),b)});return()=>{g.forEach(p=>p&&clearTimeout(p))}},[r,n,t]);let a=h.useCallback(qs(t),[t]),i=h.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=h.useCallback((f,g)=>{a({type:1,toast:{id:f,height:g}})},[a]),d=h.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),u=h.useCallback((f,g)=>{let{reverseOrder:p=!1,gutter:b=8,defaultPosition:m}=g||{},v=r.filter(S=>(S.position||m)===(f.position||m)&&S.height),y=v.findIndex(S=>S.id===f.id),C=v.filter((S,w)=>w<y&&S.visible).length;return v.filter(S=>S.visible).slice(...p?[C+1]:[0,C]).reduce((S,w)=>S+(w.height||0)+b,0)},[r]);return h.useEffect(()=>{r.forEach(f=>{if(f.dismissed)s(f.id,f.removeDelay);else{let g=o.get(f.id);g&&(clearTimeout(g),o.delete(f.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:c,startPause:i,endPause:d,calculateOffset:u}}},_v=Hr`
2
2
  from {
3
3
  transform: scale(0) rotate(45deg);
4
4
  opacity: 0;
@@ -6,7 +6,7 @@ from {
6
6
  to {
7
7
  transform: scale(1) rotate(45deg);
8
8
  opacity: 1;
9
- }`,Cm=_r`
9
+ }`,Tv=Hr`
10
10
  from {
11
11
  transform: scale(0);
12
12
  opacity: 0;
@@ -14,7 +14,7 @@ from {
14
14
  to {
15
15
  transform: scale(1);
16
16
  opacity: 1;
17
- }`,Sm=_r`
17
+ }`,kv=Hr`
18
18
  from {
19
19
  transform: scale(0) rotate(90deg);
20
20
  opacity: 0;
@@ -22,7 +22,7 @@ from {
22
22
  to {
23
23
  transform: scale(1) rotate(90deg);
24
24
  opacity: 1;
25
- }`,wm=Or("div")`
25
+ }`,Ev=en("div")`
26
26
  width: 20px;
27
27
  opacity: 0;
28
28
  height: 20px;
@@ -31,14 +31,14 @@ to {
31
31
  position: relative;
32
32
  transform: rotate(45deg);
33
33
 
34
- animation: ${bm} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
34
+ animation: ${_v} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
35
35
  forwards;
36
36
  animation-delay: 100ms;
37
37
 
38
38
  &:after,
39
39
  &:before {
40
40
  content: '';
41
- animation: ${Cm} 0.15s ease-out forwards;
41
+ animation: ${Tv} 0.15s ease-out forwards;
42
42
  animation-delay: 150ms;
43
43
  position: absolute;
44
44
  border-radius: 3px;
@@ -51,18 +51,18 @@ to {
51
51
  }
52
52
 
53
53
  &:before {
54
- animation: ${Sm} 0.15s ease-out forwards;
54
+ animation: ${kv} 0.15s ease-out forwards;
55
55
  animation-delay: 180ms;
56
56
  transform: rotate(90deg);
57
57
  }
58
- `,_m=_r`
58
+ `,Av=Hr`
59
59
  from {
60
60
  transform: rotate(0deg);
61
61
  }
62
62
  to {
63
63
  transform: rotate(360deg);
64
64
  }
65
- `,Tm=Or("div")`
65
+ `,Iv=en("div")`
66
66
  width: 12px;
67
67
  height: 12px;
68
68
  box-sizing: border-box;
@@ -70,8 +70,8 @@ to {
70
70
  border-radius: 100%;
71
71
  border-color: ${e=>e.secondary||"#e0e0e0"};
72
72
  border-right-color: ${e=>e.primary||"#616161"};
73
- animation: ${_m} 1s linear infinite;
74
- `,Em=_r`
73
+ animation: ${Av} 1s linear infinite;
74
+ `,Lv=Hr`
75
75
  from {
76
76
  transform: scale(0) rotate(45deg);
77
77
  opacity: 0;
@@ -79,7 +79,7 @@ from {
79
79
  to {
80
80
  transform: scale(1) rotate(45deg);
81
81
  opacity: 1;
82
- }`,Am=_r`
82
+ }`,Dv=Hr`
83
83
  0% {
84
84
  height: 0;
85
85
  width: 0;
@@ -93,7 +93,7 @@ to {
93
93
  100% {
94
94
  opacity: 1;
95
95
  height: 10px;
96
- }`,km=Or("div")`
96
+ }`,Nv=en("div")`
97
97
  width: 20px;
98
98
  opacity: 0;
99
99
  height: 20px;
@@ -102,13 +102,13 @@ to {
102
102
  position: relative;
103
103
  transform: rotate(45deg);
104
104
 
105
- animation: ${Em} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
105
+ animation: ${Lv} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
106
106
  forwards;
107
107
  animation-delay: 100ms;
108
108
  &:after {
109
109
  content: '';
110
110
  box-sizing: border-box;
111
- animation: ${Am} 0.2s ease-out forwards;
111
+ animation: ${Dv} 0.2s ease-out forwards;
112
112
  opacity: 0;
113
113
  animation-delay: 200ms;
114
114
  position: absolute;
@@ -120,16 +120,16 @@ to {
120
120
  height: 10px;
121
121
  width: 6px;
122
122
  }
123
- `,Im=Or("div")`
123
+ `,Ov=en("div")`
124
124
  position: absolute;
125
- `,Lm=Or("div")`
125
+ `,Pv=en("div")`
126
126
  position: relative;
127
127
  display: flex;
128
128
  justify-content: center;
129
129
  align-items: center;
130
130
  min-width: 20px;
131
131
  min-height: 20px;
132
- `,Dm=_r`
132
+ `,xv=Hr`
133
133
  from {
134
134
  transform: scale(0.6);
135
135
  opacity: 0.4;
@@ -137,20 +137,20 @@ from {
137
137
  to {
138
138
  transform: scale(1);
139
139
  opacity: 1;
140
- }`,Nm=Or("div")`
140
+ }`,Fv=en("div")`
141
141
  position: relative;
142
142
  transform: scale(0.6);
143
143
  opacity: 0.4;
144
144
  min-width: 20px;
145
- animation: ${Dm} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
145
+ animation: ${xv} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
146
146
  forwards;
147
- `,Pm=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?je.createElement(Nm,null,t):t:r==="blank"?null:je.createElement(Lm,null,je.createElement(Tm,{...n}),r!=="loading"&&je.createElement(Im,null,r==="error"?je.createElement(wm,{...n}):je.createElement(km,{...n})))},Om=e=>`
147
+ `,Mv=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?We.createElement(Fv,null,t):t:r==="blank"?null:We.createElement(Pv,null,We.createElement(Iv,{...n}),r!=="loading"&&We.createElement(Ov,null,r==="error"?We.createElement(Ev,{...n}):We.createElement(Nv,{...n})))},Bv=e=>`
148
148
  0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
149
149
  100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
150
- `,xm=e=>`
150
+ `,$v=e=>`
151
151
  0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
152
152
  100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
153
- `,Fm="0%{opacity:0;} 100%{opacity:1;}",Mm="0%{opacity:1;} 100%{opacity:0;}",Bm=Or("div")`
153
+ `,qv="0%{opacity:0;} 100%{opacity:1;}",jv="0%{opacity:1;} 100%{opacity:0;}",Uv=en("div")`
154
154
  display: flex;
155
155
  align-items: center;
156
156
  background: #fff;
@@ -162,338 +162,338 @@ to {
162
162
  pointer-events: auto;
163
163
  padding: 8px 10px;
164
164
  border-radius: 8px;
165
- `,$m=Or("div")`
165
+ `,Hv=en("div")`
166
166
  display: flex;
167
167
  justify-content: center;
168
168
  margin: 4px 10px;
169
169
  color: inherit;
170
170
  flex: 1 1 auto;
171
171
  white-space: pre-line;
172
- `,jm=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=Ic()?[Fm,Mm]:[Om(r),xm(r)];return{animation:t?`${_r(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${_r(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},qm=je.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?jm(e.position||t||"top-center",e.visible):{opacity:0},o=je.createElement(Pm,{toast:e}),a=je.createElement($m,{...e.ariaProps},bo(e.message,e));return je.createElement(Bm,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:o,message:a}):je.createElement(je.Fragment,null,o,a))});cm(je.createElement);var Um=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let o=je.useCallback(a=>{if(a){let i=()=>{let c=a.getBoundingClientRect().height;n(e,c)};i(),new MutationObserver(i).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return je.createElement("div",{ref:o,className:t,style:r},s)},zm=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ic()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},Vm=yo`
172
+ `,Vv=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=sd()?[qv,jv]:[Bv(r),$v(r)];return{animation:t?`${Hr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Hr(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},zv=We.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Vv(e.position||t||"top-center",e.visible):{opacity:0},s=We.createElement(Mv,{toast:e}),a=We.createElement(Hv,{...e.ariaProps},Bs(e.message,e));return We.createElement(Uv,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:a}):We.createElement(We.Fragment,null,s,a))});hv(We.createElement);var Rv=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=We.useCallback(a=>{if(a){let i=()=>{let c=a.getBoundingClientRect().height;n(e,c)};i(),new MutationObserver(i).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return We.createElement("div",{ref:s,className:t,style:r},o)},Qv=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:sd()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Wv=Ms`
173
173
  z-index: 9999;
174
174
  > * {
175
175
  pointer-events: auto;
176
176
  }
177
- `,wo=16,Hm=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:o,containerStyle:a,containerClassName:i})=>{let{toasts:c,handlers:d}=ym(r,o);return je.createElement("div",{"data-rht-toaster":o||"",style:{position:"fixed",zIndex:9999,top:wo,left:wo,right:wo,bottom:wo,pointerEvents:"none",...a},className:i,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let f=u.position||t,g=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),m=zm(f,g);return je.createElement(Um,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Vm:"",style:m},u.type==="custom"?bo(u.message,u):s?s(u):je.createElement(qm,{toast:u,position:f}))}))},pe=lt;function Qm(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const _o=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function An(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ja(e){return"nodeType"in e}function Ot(e){var t,r;return e?An(e)?e:Ja(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ei(e){const{Document:t}=Ot(e);return e instanceof t}function vs(e){return An(e)?!1:e instanceof Ot(e).HTMLElement}function Oc(e){return e instanceof Ot(e).SVGElement}function kn(e){return e?An(e)?e.document:Ja(e)?ei(e)?e:vs(e)||Oc(e)?e.ownerDocument:document:document:document}const nr=_o?p.useLayoutEffect:p.useEffect;function To(e){const t=p.useRef(e);return nr(()=>{t.current=e}),p.useCallback(function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t.current==null?void 0:t.current(...n)},[])}function Wm(){const e=p.useRef(null),t=p.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function ys(e,t){t===void 0&&(t=[e]);const r=p.useRef(e);return nr(()=>{r.current!==e&&(r.current=e)},t),r}function bs(e,t){const r=p.useRef();return p.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Eo(e){const t=To(e),r=p.useRef(null),n=p.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function Ao(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let ti={};function Cs(e,t){return p.useMemo(()=>{if(t)return t;const r=ti[e]==null?0:ti[e]+1;return ti[e]=r,e+"-"+r},[e,t])}function xc(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return n.reduce((o,a)=>{const i=Object.entries(a);for(const[c,d]of i){const u=o[c];u!=null&&(o[c]=u+e*d)}return o},{...t})}}const In=xc(1),Ss=xc(-1);function Rm(e){return"clientX"in e&&"clientY"in e}function ko(e){if(!e)return!1;const{KeyboardEvent:t}=Ot(e.target);return t&&e instanceof t}function Gm(e){if(!e)return!1;const{TouchEvent:t}=Ot(e.target);return t&&e instanceof t}function Io(e){if(Gm(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Rm(e)?{x:e.clientX,y:e.clientY}:null}const Tr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Tr.Translate.toString(e),Tr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Fc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Km(e){return e.matches(Fc)?e:e.querySelector(Fc)}const Ym={display:"none"};function Zm(e){let{id:t,value:r}=e;return p.createElement("div",{id:t,style:Ym},r)}function Xm(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return p.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function Jm(){const[e,t]=p.useState("");return{announce:p.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Mc=p.createContext(null);function ev(e){const t=p.useContext(Mc);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function tv(){const[e]=p.useState(()=>new Set),t=p.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[p.useCallback(n=>{let{type:s,event:o}=n;e.forEach(a=>{var i;return(i=a[s])==null?void 0:i.call(a,o)})},[e]),t]}const rv={draggable:`
177
+ `,js=16,Gv=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:a,containerClassName:i})=>{let{toasts:c,handlers:d}=wv(r,s);return We.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:js,left:js,right:js,bottom:js,pointerEvents:"none",...a},className:i,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let f=u.position||t,g=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),p=Qv(f,g);return We.createElement(Rv,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Wv:"",style:p},u.type==="custom"?Bs(u.message,u):o?o(u):We.createElement(zv,{toast:u,position:f}))}))},be=mt;function Kv(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return h.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Us=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _i(e){return"nodeType"in e}function Ht(e){var t,r;return e?Rn(e)?e:_i(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Ti(e){const{Document:t}=Ht(e);return e instanceof t}function qo(e){return Rn(e)?!1:e instanceof Ht(e).HTMLElement}function dd(e){return e instanceof Ht(e).SVGElement}function Qn(e){return e?Rn(e)?e.document:_i(e)?Ti(e)?e:qo(e)||dd(e)?e.ownerDocument:document:document:document}const Cr=Us?h.useLayoutEffect:h.useEffect;function Hs(e){const t=h.useRef(e);return Cr(()=>{t.current=e}),h.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function Yv(){const e=h.useRef(null),t=h.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function jo(e,t){t===void 0&&(t=[e]);const r=h.useRef(e);return Cr(()=>{r.current!==e&&(r.current=e)},t),r}function Uo(e,t){const r=h.useRef();return h.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Vs(e){const t=Hs(e),r=h.useRef(null),n=h.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function zs(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let ki={};function Ho(e,t){return h.useMemo(()=>{if(t)return t;const r=ki[e]==null?0:ki[e]+1;return ki[e]=r,e+"-"+r},[e,t])}function ud(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((s,a)=>{const i=Object.entries(a);for(const[c,d]of i){const u=s[c];u!=null&&(s[c]=u+e*d)}return s},{...t})}}const Wn=ud(1),Vo=ud(-1);function Zv(e){return"clientX"in e&&"clientY"in e}function Rs(e){if(!e)return!1;const{KeyboardEvent:t}=Ht(e.target);return t&&e instanceof t}function Xv(e){if(!e)return!1;const{TouchEvent:t}=Ht(e.target);return t&&e instanceof t}function Qs(e){if(Xv(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Zv(e)?{x:e.clientX,y:e.clientY}:null}const Vr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Vr.Translate.toString(e),Vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),fd="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Jv(e){return e.matches(fd)?e:e.querySelector(fd)}const ey={display:"none"};function ty(e){let{id:t,value:r}=e;return h.createElement("div",{id:t,style:ey},r)}function ry(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function ny(){const[e,t]=h.useState("");return{announce:h.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const hd=h.createContext(null);function oy(e){const t=h.useContext(hd);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function sy(){const[e]=h.useState(()=>new Set),t=h.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[h.useCallback(n=>{let{type:o,event:s}=n;e.forEach(a=>{var i;return(i=a[o])==null?void 0:i.call(a,s)})},[e]),t]}const ay={draggable:`
178
178
  To pick up a draggable item, press the space bar.
179
179
  While dragging, use the arrow keys to move the item.
180
180
  Press space again to drop the item in its new position, or press escape to cancel.
181
- `},nv={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function sv(e){let{announcements:t=nv,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=rv}=e;const{announce:o,announcement:a}=Jm(),i=Cs("DndLiveRegion"),[c,d]=p.useState(!1);if(p.useEffect(()=>{d(!0)},[]),ev(p.useMemo(()=>({onDragStart(f){let{active:g}=f;o(t.onDragStart({active:g}))},onDragMove(f){let{active:g,over:m}=f;t.onDragMove&&o(t.onDragMove({active:g,over:m}))},onDragOver(f){let{active:g,over:m}=f;o(t.onDragOver({active:g,over:m}))},onDragEnd(f){let{active:g,over:m}=f;o(t.onDragEnd({active:g,over:m}))},onDragCancel(f){let{active:g,over:m}=f;o(t.onDragCancel({active:g,over:m}))}}),[o,t])),!c)return null;const u=p.createElement(p.Fragment,null,p.createElement(Zm,{id:n,value:s.draggable}),p.createElement(Xm,{id:i,announcement:a}));return r?Ue.createPortal(u,r):u}var ct;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ct||(ct={}));function Lo(){}function ri(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Bc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const sr=Object.freeze({x:0,y:0});function $c(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ov(e,t){const r=Io(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function jc(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function av(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function qc(e){let{left:t,top:r,height:n,width:s}=e;return[{x:t,y:r},{x:t+s,y:r},{x:t,y:r+n},{x:t+s,y:r+n}]}function Uc(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function zc(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Vc=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=zc(t,t.left,t.top),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=$c(zc(c),s);o.push({id:i,data:{droppableContainer:a,value:d}})}}return o.sort(jc)},iv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=qc(t),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=qc(c),u=s.reduce((g,m,C)=>g+$c(d[C],m),0),f=Number((u/4).toFixed(4));o.push({id:i,data:{droppableContainer:a,value:f}})}}return o.sort(jc)};function lv(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=s-n,i=o-r;if(n<s&&r<o){const c=t.width*t.height,d=e.width*e.height,u=a*i,f=u/(c+d-u);return Number(f.toFixed(4))}return 0}const cv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const o of n){const{id:a}=o,i=r.get(a);if(i){const c=lv(i,t);c>0&&s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(av)};function dv(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Hc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:sr}function uv(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...r})}}const fv=uv(1);function Qc(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function hv(e,t,r){const n=Qc(t);if(!n)return e;const{scaleX:s,scaleY:o,x:a,y:i}=n,c=e.left-a-(1-s)*parseFloat(r),d=e.top-i-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),u=s?e.width/s:e.width,f=o?e.height/o:e.height;return{width:u,height:f,top:d,right:c+u,bottom:d+f,left:c}}const pv={ignoreTransform:!1};function Ln(e,t){t===void 0&&(t=pv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Ot(e).getComputedStyle(e);d&&(r=hv(r,d,u))}const{top:n,left:s,width:o,height:a,bottom:i,right:c}=r;return{top:n,left:s,width:o,height:a,bottom:i,right:c}}function Wc(e){return Ln(e,{ignoreTransform:!0})}function gv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function mv(e,t){return t===void 0&&(t=Ot(e).getComputedStyle(e)),t.position==="fixed"}function vv(e,t){t===void 0&&(t=Ot(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?r.test(o):!1})}function Do(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(ei(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!vs(s)||Oc(s)||r.includes(s))return r;const o=Ot(e).getComputedStyle(s);return s!==e&&vv(s,o)&&r.push(s),mv(s,o)?r:n(s.parentNode)}return e?n(e):r}function Rc(e){const[t]=Do(e,1);return t??null}function ni(e){return!_o||!e?null:An(e)?e:Ja(e)?ei(e)||e===kn(e).scrollingElement?window:vs(e)?e:null:null}function Gc(e){return An(e)?e.scrollX:e.scrollLeft}function Kc(e){return An(e)?e.scrollY:e.scrollTop}function si(e){return{x:Gc(e),y:Kc(e)}}var ft;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ft||(ft={}));function Yc(e){return!_o||!e?!1:e===document.scrollingElement}function Zc(e){const t={x:0,y:0},r=Yc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:s,isLeft:o,isBottom:a,isRight:i,maxScroll:n,minScroll:t}}const yv={x:.2,y:.2};function bv(e,t,r,n,s){let{top:o,left:a,right:i,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=yv);const{isTop:d,isBottom:u,isLeft:f,isRight:g}=Zc(e),m={x:0,y:0},C={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!d&&o<=t.top+h.height?(m.y=ft.Backward,C.y=n*Math.abs((t.top+h.height-o)/h.height)):!u&&c>=t.bottom-h.height&&(m.y=ft.Forward,C.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!g&&i>=t.right-h.width?(m.x=ft.Forward,C.x=n*Math.abs((t.right-h.width-i)/h.width)):!f&&a<=t.left+h.width&&(m.x=ft.Backward,C.x=n*Math.abs((t.left+h.width-a)/h.width)),{direction:m,speed:C}}function Cv(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Xc(e){return e.reduce((t,r)=>In(t,si(r)),sr)}function Sv(e){return e.reduce((t,r)=>t+Gc(r),0)}function wv(e){return e.reduce((t,r)=>t+Kc(r),0)}function Jc(e,t){if(t===void 0&&(t=Ln),!e)return;const{top:r,left:n,bottom:s,right:o}=t(e);Rc(e)&&(s<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const _v=[["x",["left","right"],Sv],["y",["top","bottom"],wv]];class oi{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Do(r),s=Xc(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,i]of _v)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=i(n),u=s[o]-d;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ws{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Tv(e){const{EventTarget:t}=Ot(e);return e instanceof t?e:kn(e)}function ai(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Rt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Rt||(Rt={}));function ed(e){e.preventDefault()}function Ev(e){e.stopPropagation()}var Pe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Pe||(Pe={}));const td={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},Av=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Pe.Right:return{...r,x:r.x+25};case Pe.Left:return{...r,x:r.x-25};case Pe.Down:return{...r,y:r.y+25};case Pe.Up:return{...r,y:r.y-25}}};class ii{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new ws(kn(r)),this.windowListeners=new ws(Ot(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Rt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Jc(n),r(sr)}handleKeyDown(t){if(ko(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:o=td,coordinateGetter:a=Av,scrollBehavior:i="smooth"}=s,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:sr;this.referenceCoordinates||(this.referenceCoordinates=u);const f=a(t,{active:r,context:n.current,currentCoordinates:u});if(f){const g=Ss(f,u),m={x:0,y:0},{scrollableAncestors:C}=n.current;for(const h of C){const v=t.code,{isTop:y,isRight:b,isLeft:S,isBottom:w,maxScroll:T,minScroll:E}=Zc(h),N=Cv(h),I={x:Math.min(v===Pe.Right?N.right-N.width/2:N.right,Math.max(v===Pe.Right?N.left:N.left+N.width/2,f.x)),y:Math.min(v===Pe.Down?N.bottom-N.height/2:N.bottom,Math.max(v===Pe.Down?N.top:N.top+N.height/2,f.y))},O=v===Pe.Right&&!b||v===Pe.Left&&!S,B=v===Pe.Down&&!w||v===Pe.Up&&!y;if(O&&I.x!==f.x){const k=h.scrollLeft+g.x,F=v===Pe.Right&&k<=T.x||v===Pe.Left&&k>=E.x;if(F&&!g.y){h.scrollTo({left:k,behavior:i});return}F?m.x=h.scrollLeft-k:m.x=v===Pe.Right?h.scrollLeft-T.x:h.scrollLeft-E.x,m.x&&h.scrollBy({left:-m.x,behavior:i});break}else if(B&&I.y!==f.y){const k=h.scrollTop+g.y,F=v===Pe.Down&&k<=T.y||v===Pe.Up&&k>=E.y;if(F&&!g.x){h.scrollTo({top:k,behavior:i});return}F?m.y=h.scrollTop-k:m.y=v===Pe.Down?h.scrollTop-T.y:h.scrollTop-E.y,m.y&&h.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,In(Ss(f,this.referenceCoordinates),m))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ii.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=td,onActivation:s}=t,{active:o}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const i=o.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function rd(e){return!!(e&&"distance"in e)}function nd(e){return!!(e&&"delay"in e)}class li{constructor(t,r,n){var s;n===void 0&&(n=Tv(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:o}=t,{target:a}=o;this.props=t,this.events=r,this.document=kn(a),this.documentListeners=new ws(this.document),this.listeners=new ws(n),this.windowListeners=new ws(Ot(a)),this.initialCoordinates=(s=Io(o))!=null?s:sr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.DragStart,ed),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),this.windowListeners.add(Rt.ContextMenu,ed),this.documentListeners.add(Rt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(nd(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(rd(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Rt.Click,Ev,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Rt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:o}=this,{onMove:a,options:{activationConstraint:i}}=o;if(!s)return;const c=(r=Io(t))!=null?r:sr,d=Ss(s,c);if(!n&&i){if(rd(i)){if(i.tolerance!=null&&ai(d,i.tolerance))return this.handleCancel();if(ai(d,i.distance))return this.handleStart()}if(nd(i)&&ai(d,i.tolerance))return this.handleCancel();this.handlePending(i,d);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Pe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const kv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class No extends li{constructor(t){const{event:r}=t,n=kn(r.target);super(t,kv,n)}}No.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Iv={move:{name:"mousemove"},end:{name:"mouseup"}};var ci;(function(e){e[e.RightClick=2]="RightClick"})(ci||(ci={}));class Lv extends li{constructor(t){super(t,Iv,kn(t.event.target))}}Lv.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===ci.RightClick?!1:(n==null||n({event:r}),!0)}}];const di={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Dv extends li{constructor(t){super(t,di)}static setup(){return window.addEventListener(di.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(di.move.name,t)};function t(){}}}Dv.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var _s;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(_s||(_s={}));var Po;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Po||(Po={}));function Nv(e){let{acceleration:t,activator:r=_s.Pointer,canScroll:n,draggingRect:s,enabled:o,interval:a=5,order:i=Po.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:g}=e;const m=Ov({delta:f,disabled:!o}),[C,h]=Wm(),v=p.useRef({x:0,y:0}),y=p.useRef({x:0,y:0}),b=p.useMemo(()=>{switch(r){case _s.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case _s.DraggableRect:return s}},[r,s,c]),S=p.useRef(null),w=p.useCallback(()=>{const E=S.current;if(!E)return;const N=v.current.x*y.current.x,I=v.current.y*y.current.y;E.scrollBy(N,I)},[]),T=p.useMemo(()=>i===Po.TreeOrder?[...d].reverse():d,[i,d]);p.useEffect(()=>{if(!o||!d.length||!b){h();return}for(const E of T){if((n==null?void 0:n(E))===!1)continue;const N=d.indexOf(E),I=u[N];if(!I)continue;const{direction:O,speed:B}=bv(E,I,b,t,g);for(const k of["x","y"])m[k][O[k]]||(B[k]=0,O[k]=0);if(B.x>0||B.y>0){h(),S.current=E,C(w,a),v.current=B,y.current=O;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,w,n,h,o,a,JSON.stringify(b),JSON.stringify(m),C,d,T,u,JSON.stringify(g)])}const Pv={x:{[ft.Backward]:!1,[ft.Forward]:!1},y:{[ft.Backward]:!1,[ft.Forward]:!1}};function Ov(e){let{delta:t,disabled:r}=e;const n=Ao(t);return bs(s=>{if(r||!n||!s)return Pv;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ft.Backward]:s.x[ft.Backward]||o.x===-1,[ft.Forward]:s.x[ft.Forward]||o.x===1},y:{[ft.Backward]:s.y[ft.Backward]||o.y===-1,[ft.Forward]:s.y[ft.Forward]||o.y===1}}},[r,t,n])}function xv(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return bs(s=>{var o;return t==null?null:(o=n??s)!=null?o:null},[n,t])}function Fv(e,t){return p.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,o=s.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,n)}));return[...r,...o]},[]),[e,t])}var Ts;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ts||(Ts={}));var ui;(function(e){e.Optimized="optimized"})(ui||(ui={}));const sd=new Map;function Mv(e,t){let{dragging:r,dependencies:n,config:s}=t;const[o,a]=p.useState(null),{frequency:i,measure:c,strategy:d}=s,u=p.useRef(e),f=v(),g=ys(f),m=p.useCallback(function(y){y===void 0&&(y=[]),!g.current&&a(b=>b===null?y:b.concat(y.filter(S=>!b.includes(S))))},[g]),C=p.useRef(null),h=bs(y=>{if(f&&!r)return sd;if(!y||y===sd||u.current!==e||o!=null){const b=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){b.set(S.id,S.rect.current);continue}const w=S.node.current,T=w?new oi(c(w),w):null;S.rect.current=T,T&&b.set(S.id,T)}return b}return y},[e,o,r,f,c]);return p.useEffect(()=>{u.current=e},[e]),p.useEffect(()=>{f||m()},[r,f]),p.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),p.useEffect(()=>{f||typeof i!="number"||C.current!==null||(C.current=setTimeout(()=>{m(),C.current=null},i))},[i,f,m,...n]),{droppableRects:h,measureDroppableContainers:m,measuringScheduled:o!=null};function v(){switch(d){case Ts.Always:return!1;case Ts.BeforeDragging:return r;default:return!r}}}function fi(e,t){return bs(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Bv(e,t){return fi(e,t)}function $v(e){let{callback:t,disabled:r}=e;const n=To(t),s=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(n)},[n,r]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Oo(e){let{callback:t,disabled:r}=e;const n=To(t),s=p.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(n)},[r]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function jv(e){return new oi(Ln(e),e)}function od(e,t,r){t===void 0&&(t=jv);const[n,s]=p.useState(null);function o(){s(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??r)!=null?d:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const a=$v({callback(c){if(e)for(const d of c){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),i=Oo({callback:o});return nr(()=>{o(),e?(i==null||i.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(i==null||i.disconnect(),a==null||a.disconnect())},[e]),n}function qv(e){const t=fi(e);return Hc(e,t)}const ad=[];function Uv(e){const t=p.useRef(e),r=bs(n=>e?n&&n!==ad&&e&&t.current&&e.parentNode===t.current.parentNode?n:Do(e):ad,[e]);return p.useEffect(()=>{t.current=e},[e]),r}function zv(e){const[t,r]=p.useState(null),n=p.useRef(e),s=p.useCallback(o=>{const a=ni(o.target);a&&r(i=>i?(i.set(a,si(a)),new Map(i)):null)},[]);return p.useEffect(()=>{const o=n.current;if(e!==o){a(o);const i=e.map(c=>{const d=ni(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,si(d)]):null}).filter(c=>c!=null);r(i.length?new Map(i):null),n.current=e}return()=>{a(e),a(o)};function a(i){i.forEach(c=>{const d=ni(c);d==null||d.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>In(o,a),sr):Xc(e):sr,[e,t])}function id(e,t){t===void 0&&(t=[]);const r=p.useRef(null);return p.useEffect(()=>{r.current=null},t),p.useEffect(()=>{const n=e!==sr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Ss(e,r.current):sr}function Vv(e){p.useEffect(()=>{if(!_o)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Hv(e,t){return p.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:o}=n;return r[s]=a=>{o(a,t)},r},{}),[e,t])}function ld(e){return p.useMemo(()=>e?gv(e):null,[e])}const cd=[];function Qv(e,t){t===void 0&&(t=Ln);const[r]=e,n=ld(r?Ot(r):null),[s,o]=p.useState(cd);function a(){o(()=>e.length?e.map(c=>Yc(c)?n:new oi(t(c),c)):cd)}const i=Oo({callback:a});return nr(()=>{i==null||i.disconnect(),a(),e.forEach(c=>i==null?void 0:i.observe(c))},[e]),s}function dd(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vs(t)?t:e}function Wv(e){let{measure:t}=e;const[r,n]=p.useState(null),s=p.useCallback(d=>{for(const{target:u}of d)if(vs(u)){n(f=>{const g=t(u);return f?{...f,width:g.width,height:g.height}:g});break}},[t]),o=Oo({callback:s}),a=p.useCallback(d=>{const u=dd(d);o==null||o.disconnect(),u&&(o==null||o.observe(u)),n(u?t(u):null)},[t,o]),[i,c]=Eo(a);return p.useMemo(()=>({nodeRef:i,rect:r,setRef:c}),[r,i,c])}const Rv=[{sensor:No,options:{}},{sensor:ii,options:{}}],Gv={current:{}},xo={draggable:{measure:Wc},droppable:{measure:Wc,strategy:Ts.WhileDragging,frequency:ui.Optimized},dragOverlay:{measure:Ln}};class Es extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Kv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Es,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Lo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:xo,measureDroppableContainers:Lo,windowRect:null,measuringScheduled:!1},ud={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Lo,draggableNodes:new Map,over:null,measureDroppableContainers:Lo},As=p.createContext(ud),fd=p.createContext(Kv);function Yv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Es}}}function Zv(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new Es(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case ct.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new Es(e.droppable.containers);return a.set(r,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case ct.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const o=new Es(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Xv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=p.useContext(As),o=Ao(n),a=Ao(r==null?void 0:r.id);return p.useEffect(()=>{if(!t&&!n&&o&&a!=null){if(!ko(o)||document.activeElement===o.target)return;const i=s.get(a);if(!i)return;const{activatorNode:c,node:d}=i;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[c.current,d.current]){if(!u)continue;const f=Km(u);if(f){f.focus();break}}})}},[n,t,s,a,o]),null}function hd(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...n}),r):r}function Jv(e){return p.useMemo(()=>({draggable:{...xo.draggable,...e==null?void 0:e.draggable},droppable:{...xo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...xo.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function ey(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const o=p.useRef(!1),{x:a,y:i}=typeof s=="boolean"?{x:s,y:s}:s;nr(()=>{if(!a&&!i||!t){o.current=!1;return}if(o.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),f=Hc(u,n);if(a||(f.x=0),i||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=Rc(d);g&&g.scrollBy({top:f.y,left:f.x})}},[t,a,i,n,r])}const Fo=p.createContext({...sr,scaleX:1,scaleY:1});var xr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(xr||(xr={}));const hi=p.memo(function(t){var r,n,s,o;let{id:a,accessibility:i,autoScroll:c=!0,children:d,sensors:u=Rv,collisionDetection:f=cv,measuring:g,modifiers:m,...C}=t;const h=p.useReducer(Zv,void 0,Yv),[v,y]=h,[b,S]=tv(),[w,T]=p.useState(xr.Uninitialized),E=w===xr.Initialized,{draggable:{active:N,nodes:I,translate:O},droppable:{containers:B}}=v,k=N!=null?I.get(N):null,F=p.useRef({initial:null,translated:null}),M=p.useMemo(()=>{var vt;return N!=null?{id:N,data:(vt=k==null?void 0:k.data)!=null?vt:Gv,rect:F}:null},[N,k]),x=p.useRef(null),[z,ne]=p.useState(null),[R,ge]=p.useState(null),me=ys(C,Object.values(C)),K=Cs("DndDescribedBy",a),ce=p.useMemo(()=>B.getEnabled(),[B]),te=Jv(g),{droppableRects:we,measureDroppableContainers:ve,measuringScheduled:q}=Mv(ce,{dragging:E,dependencies:[O.x,O.y],config:te.droppable}),$=xv(I,N),U=p.useMemo(()=>R?Io(R):null,[R]),oe=Tn(),ie=Bv($,te.draggable.measure);ey({activeNode:N!=null?I.get(N):null,config:oe.layoutShiftCompensation,initialRect:ie,measure:te.draggable.measure});const Se=od($,te.draggable.measure,ie),fe=od($?$.parentElement:null),ye=p.useRef({activatorEvent:null,active:null,activeNode:$,collisionRect:null,collisions:null,droppableRects:we,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Le=B.getNodeFor((r=ye.current.over)==null?void 0:r.id),J=Wv({measure:te.dragOverlay.measure}),he=(n=J.nodeRef.current)!=null?n:$,Q=E?(s=J.rect)!=null?s:Se:null,be=!!(J.nodeRef.current&&J.rect),He=qv(be?null:Se),ot=ld(he?Ot(he):null),Qe=Uv(E?Le??$:null),Ke=Qv(Qe),at=hd(m,{transform:{x:O.x-He.x,y:O.y-He.y,scaleX:1,scaleY:1},activatorEvent:R,active:M,activeNodeRect:Se,containerNodeRect:fe,draggingNodeRect:Q,over:ye.current.over,overlayNodeRect:J.rect,scrollableAncestors:Qe,scrollableAncestorRects:Ke,windowRect:ot}),wn=U?In(U,O):null,ds=zv(Qe),io=id(ds),_n=id(ds,[Se]),_=In(at,io),A=Q?fv(Q,at):null,D=M&&A?f({active:M,collisionRect:A,droppableRects:we,droppableContainers:ce,pointerCoordinates:wn}):null,V=Uc(D,"id"),[H,Y]=p.useState(null),W=be?at:In(at,_n),de=dv(W,(o=H==null?void 0:H.rect)!=null?o:null,Se),ue=p.useRef(null),Fe=p.useCallback((vt,Pt)=>{let{sensor:Ft,options:fr}=Pt;if(x.current==null)return;const rr=I.get(x.current);if(!rr)return;const Wt=vt.nativeEvent,Sr=new Ft({active:x.current,activeNode:rr,event:Wt,options:fr,context:ye,onAbort(wt){if(!I.get(wt))return;const{onDragAbort:wr}=me.current,Ir={id:wt};wr==null||wr(Ir),b({type:"onDragAbort",event:Ir})},onPending(wt,Rr,wr,Ir){if(!I.get(wt))return;const{onDragPending:uo}=me.current,Gr={id:wt,constraint:Rr,initialCoordinates:wr,offset:Ir};uo==null||uo(Gr),b({type:"onDragPending",event:Gr})},onStart(wt){const Rr=x.current;if(Rr==null)return;const wr=I.get(Rr);if(!wr)return;const{onDragStart:Ir}=me.current,co={activatorEvent:Wt,active:{id:Rr,data:wr.data,rect:F}};Ue.unstable_batchedUpdates(()=>{Ir==null||Ir(co),T(xr.Initializing),y({type:ct.DragStart,initialCoordinates:wt,active:Rr}),b({type:"onDragStart",event:co}),ne(ue.current),ge(Wt)})},onMove(wt){y({type:ct.DragMove,coordinates:wt})},onEnd:us(ct.DragEnd),onCancel:us(ct.DragCancel)});ue.current=Sr;function us(wt){return async function(){const{active:wr,collisions:Ir,over:co,scrollAdjustedTranslate:uo}=ye.current;let Gr=null;if(wr&&uo){const{cancelDrop:fo}=me.current;Gr={activatorEvent:Wt,active:wr,collisions:Ir,delta:uo,over:co},wt===ct.DragEnd&&typeof fo=="function"&&await Promise.resolve(fo(Gr))&&(wt=ct.DragCancel)}x.current=null,Ue.unstable_batchedUpdates(()=>{y({type:wt}),T(xr.Uninitialized),Y(null),ne(null),ge(null),ue.current=null;const fo=wt===ct.DragEnd?"onDragEnd":"onDragCancel";if(Gr){const Zl=me.current[fo];Zl==null||Zl(Gr),b({type:fo,event:Gr})}})}}},[I]),Je=p.useCallback((vt,Pt)=>(Ft,fr)=>{const rr=Ft.nativeEvent,Wt=I.get(fr);if(x.current!==null||!Wt||rr.dndKit||rr.defaultPrevented)return;const Sr={active:Wt};vt(Ft,Pt.options,Sr)===!0&&(rr.dndKit={capturedBy:Pt.sensor},x.current=fr,Fe(Ft,Pt))},[I,Fe]),ut=Fv(u,Je);Vv(u),nr(()=>{Se&&w===xr.Initializing&&T(xr.Initialized)},[Se,w]),p.useEffect(()=>{const{onDragMove:vt}=me.current,{active:Pt,activatorEvent:Ft,collisions:fr,over:rr}=ye.current;if(!Pt||!Ft)return;const Wt={active:Pt,activatorEvent:Ft,collisions:fr,delta:{x:_.x,y:_.y},over:rr};Ue.unstable_batchedUpdates(()=>{vt==null||vt(Wt),b({type:"onDragMove",event:Wt})})},[_.x,_.y]),p.useEffect(()=>{const{active:vt,activatorEvent:Pt,collisions:Ft,droppableContainers:fr,scrollAdjustedTranslate:rr}=ye.current;if(!vt||x.current==null||!Pt||!rr)return;const{onDragOver:Wt}=me.current,Sr=fr.get(V),us=Sr&&Sr.rect.current?{id:Sr.id,rect:Sr.rect.current,data:Sr.data,disabled:Sr.disabled}:null,wt={active:vt,activatorEvent:Pt,collisions:Ft,delta:{x:rr.x,y:rr.y},over:us};Ue.unstable_batchedUpdates(()=>{Y(us),Wt==null||Wt(wt),b({type:"onDragOver",event:wt})})},[V]),nr(()=>{ye.current={activatorEvent:R,active:M,activeNode:$,collisionRect:A,collisions:D,droppableRects:we,draggableNodes:I,draggingNode:he,draggingNodeRect:Q,droppableContainers:B,over:H,scrollableAncestors:Qe,scrollAdjustedTranslate:_},F.current={initial:Q,translated:A}},[M,$,D,A,I,he,Q,we,B,H,Qe,_]),Nv({...oe,delta:O,draggingRect:A,pointerCoordinates:wn,scrollableAncestors:Qe,scrollableAncestorRects:Ke});const tr=p.useMemo(()=>({active:M,activeNode:$,activeNodeRect:Se,activatorEvent:R,collisions:D,containerNodeRect:fe,dragOverlay:J,draggableNodes:I,droppableContainers:B,droppableRects:we,over:H,measureDroppableContainers:ve,scrollableAncestors:Qe,scrollableAncestorRects:Ke,measuringConfiguration:te,measuringScheduled:q,windowRect:ot}),[M,$,Se,R,D,fe,J,I,B,we,H,ve,Qe,Ke,te,q,ot]),lo=p.useMemo(()=>({activatorEvent:R,activators:ut,active:M,activeNodeRect:Se,ariaDescribedById:{draggable:K},dispatch:y,draggableNodes:I,over:H,measureDroppableContainers:ve}),[R,ut,M,Se,y,K,I,H,ve]);return p.createElement(Mc.Provider,{value:S},p.createElement(As.Provider,{value:lo},p.createElement(fd.Provider,{value:tr},p.createElement(Fo.Provider,{value:de},d)),p.createElement(Xv,{disabled:(i==null?void 0:i.restoreFocus)===!1})),p.createElement(sv,{...i,hiddenTextDescribedById:K}));function Tn(){const vt=(z==null?void 0:z.autoScrollEnabled)===!1,Pt=typeof c=="object"?c.enabled===!1:c===!1,Ft=E&&!vt&&!Pt;return typeof c=="object"?{...c,enabled:Ft}:{enabled:Ft}}}),ty=p.createContext(null),pd="button",ry="Draggable";function gd(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const o=Cs(ry),{activators:a,activatorEvent:i,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:g}=p.useContext(As),{role:m=pd,roleDescription:C="draggable",tabIndex:h=0}=s??{},v=(c==null?void 0:c.id)===t,y=p.useContext(v?Fo:ty),[b,S]=Eo(),[w,T]=Eo(),E=Hv(a,t),N=ys(r);nr(()=>(f.set(t,{id:t,key:o,node:b,activatorNode:w,data:N}),()=>{const O=f.get(t);O&&O.key===o&&f.delete(t)}),[f,t]);const I=p.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&m===pd?!0:void 0,"aria-roledescription":C,"aria-describedby":u.draggable}),[n,m,h,v,C,u.draggable]);return{active:c,activatorEvent:i,activeNodeRect:d,attributes:I,isDragging:v,listeners:n?void 0:E,node:b,over:g,setNodeRef:S,setActivatorNodeRef:T,transform:y}}function md(){return p.useContext(fd)}const ny="Droppable",sy={timeout:25};function oy(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const o=Cs(ny),{active:a,dispatch:i,over:c,measureDroppableContainers:d}=p.useContext(As),u=p.useRef({disabled:r}),f=p.useRef(!1),g=p.useRef(null),m=p.useRef(null),{disabled:C,updateMeasurementsFor:h,timeout:v}={...sy,...s},y=ys(h??n),b=p.useCallback(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),m.current=null},v)},[v]),S=Oo({callback:b,disabled:C||!a}),w=p.useCallback((I,O)=>{S&&(O&&(S.unobserve(O),f.current=!1),I&&S.observe(I))},[S]),[T,E]=Eo(w),N=ys(t);return p.useEffect(()=>{!S||!T.current||(S.disconnect(),f.current=!1,S.observe(T.current))},[T,S]),p.useEffect(()=>(i({type:ct.RegisterDroppable,element:{id:n,key:o,disabled:r,node:T,rect:g,data:N}}),()=>i({type:ct.UnregisterDroppable,key:o,id:n})),[n]),p.useEffect(()=>{r!==u.current.disabled&&(i({type:ct.SetDroppableDisabled,id:n,key:o,disabled:r}),u.current.disabled=r)},[n,o,r,i]),{active:a,rect:g,isOver:(c==null?void 0:c.id)===n,node:T,over:c,setNodeRef:E}}function ay(e){let{animation:t,children:r}=e;const[n,s]=p.useState(null),[o,a]=p.useState(null),i=Ao(r);return!r&&!n&&i&&s(i),nr(()=>{if(!o)return;const c=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(c==null||d==null){s(null);return}Promise.resolve(t(d,o)).then(()=>{s(null)})},[t,n,o]),p.createElement(p.Fragment,null,r,n?p.cloneElement(n,{ref:a}):null)}const iy={x:0,y:0,scaleX:1,scaleY:1};function ly(e){let{children:t}=e;return p.createElement(As.Provider,{value:ud},p.createElement(Fo.Provider,{value:iy},t))}const cy={position:"fixed",touchAction:"none"},dy=e=>ko(e)?"transform 250ms ease":void 0,uy=p.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:o,className:a,rect:i,style:c,transform:d,transition:u=dy}=e;if(!i)return null;const f=s?d:{...d,scaleX:1,scaleY:1},g={...cy,width:i.width,height:i.height,top:i.top,left:i.left,transform:Tr.Transform.toString(f),transformOrigin:s&&n?ov(n,i):void 0,transition:typeof u=="function"?u(n):u,...c};return p.createElement(r,{className:a,style:g,ref:t},o)}),fy={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Tr.Transform.toString(t)},{transform:Tr.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[i,c]of Object.entries(o.active))c!==void 0&&(s[i]=r.node.style.getPropertyValue(i),r.node.style.setProperty(i,c));if(o!=null&&o.dragOverlay)for(const[i,c]of Object.entries(o.dragOverlay))c!==void 0&&n.node.style.setProperty(i,c);return a!=null&&a.active&&r.node.classList.add(a.active),a!=null&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[c,d]of Object.entries(s))r.node.style.setProperty(c,d);a!=null&&a.active&&r.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};function hy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return To((o,a)=>{if(t===null)return;const i=r.get(o);if(!i)return;const c=i.node.current;if(!c)return;const d=dd(a);if(!d)return;const{transform:u}=Ot(a).getComputedStyle(a),f=Qc(u);if(!f)return;const g=typeof t=="function"?t:py(t);return Jc(c,s.draggable.measure),g({active:{id:o,data:i.data,node:c,rect:s.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:a,rect:s.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function py(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...fy,...e};return o=>{let{active:a,dragOverlay:i,transform:c,...d}=o;if(!t)return;const u={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},f={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/i.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/i.rect.height:1},g={x:c.x-u.x,y:c.y-u.y,...f},m=s({...d,active:a,dragOverlay:i,transform:{initial:c,final:g}}),[C]=m,h=m[m.length-1];if(JSON.stringify(C)===JSON.stringify(h))return;const v=n==null?void 0:n({active:a,dragOverlay:i,...d}),y=i.node.animate(m,{duration:t,easing:r,fill:"forwards"});return new Promise(b=>{y.onfinish=()=>{v==null||v(),b()}})}}let vd=0;function gy(e){return p.useMemo(()=>{if(e!=null)return vd++,vd},[e])}const my=p.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:o,modifiers:a,wrapperElement:i="div",className:c,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:g,containerNodeRect:m,draggableNodes:C,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:b,scrollableAncestors:S,scrollableAncestorRects:w,windowRect:T}=md(),E=p.useContext(Fo),N=gy(f==null?void 0:f.id),I=hd(a,{activatorEvent:u,active:f,activeNodeRect:g,containerNodeRect:m,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:w,transform:E,windowRect:T}),O=fi(g),B=hy({config:n,draggableNodes:C,droppableContainers:h,measuringConfiguration:b}),k=O?v.setRef:void 0;return p.createElement(ly,null,p.createElement(ay,{animation:B},f&&N?p.createElement(uy,{key:N,id:f.id,ref:k,as:i,activatorEvent:u,adjustScale:t,className:c,transition:o,rect:O,style:{zIndex:d,...s},transform:I},r):null))});/**
181
+ `},iy={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ly(e){let{announcements:t=iy,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=ay}=e;const{announce:s,announcement:a}=ny(),i=Ho("DndLiveRegion"),[c,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),oy(h.useMemo(()=>({onDragStart(f){let{active:g}=f;s(t.onDragStart({active:g}))},onDragMove(f){let{active:g,over:p}=f;t.onDragMove&&s(t.onDragMove({active:g,over:p}))},onDragOver(f){let{active:g,over:p}=f;s(t.onDragOver({active:g,over:p}))},onDragEnd(f){let{active:g,over:p}=f;s(t.onDragEnd({active:g,over:p}))},onDragCancel(f){let{active:g,over:p}=f;s(t.onDragCancel({active:g,over:p}))}}),[s,t])),!c)return null;const u=h.createElement(h.Fragment,null,h.createElement(ty,{id:n,value:o.draggable}),h.createElement(ry,{id:i,announcement:a}));return r?Ke.createPortal(u,r):u}var gt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(gt||(gt={}));function Ws(){}function Ei(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function pd(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return h.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Sr=Object.freeze({x:0,y:0});function md(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function cy(e,t){const r=Qs(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function gd(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function dy(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function vd(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function yd(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function bd(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Cd=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=bd(t,t.left,t.top),s=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=md(bd(c),o);s.push({id:i,data:{droppableContainer:a,value:d}})}}return s.sort(gd)},uy=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=vd(t),s=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=vd(c),u=o.reduce((g,p,b)=>g+md(d[b],p),0),f=Number((u/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:f}})}}return s.sort(gd)};function fy(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-n,i=s-r;if(n<o&&r<s){const c=t.width*t.height,d=e.width*e.height,u=a*i,f=u/(c+d-u);return Number(f.toFixed(4))}return 0}const hy=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const s of n){const{id:a}=s,i=r.get(a);if(i){const c=fy(i,t);c>0&&o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(dy)};function py(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Sd(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Sr}function my(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return o.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...r})}}const gy=my(1);function wd(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function vy(e,t,r){const n=wd(t);if(!n)return e;const{scaleX:o,scaleY:s,x:a,y:i}=n,c=e.left-a-(1-o)*parseFloat(r),d=e.top-i-(1-s)*parseFloat(r.slice(r.indexOf(" ")+1)),u=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:u,height:f,top:d,right:c+u,bottom:d+f,left:c}}const yy={ignoreTransform:!1};function Gn(e,t){t===void 0&&(t=yy);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Ht(e).getComputedStyle(e);d&&(r=vy(r,d,u))}const{top:n,left:o,width:s,height:a,bottom:i,right:c}=r;return{top:n,left:o,width:s,height:a,bottom:i,right:c}}function _d(e){return Gn(e,{ignoreTransform:!0})}function by(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Cy(e,t){return t===void 0&&(t=Ht(e).getComputedStyle(e)),t.position==="fixed"}function Sy(e,t){t===void 0&&(t=Ht(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?r.test(s):!1})}function Gs(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(Ti(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!qo(o)||dd(o)||r.includes(o))return r;const s=Ht(e).getComputedStyle(o);return o!==e&&Sy(o,s)&&r.push(o),Cy(o,s)?r:n(o.parentNode)}return e?n(e):r}function Td(e){const[t]=Gs(e,1);return t??null}function Ai(e){return!Us||!e?null:Rn(e)?e:_i(e)?Ti(e)||e===Qn(e).scrollingElement?window:qo(e)?e:null:null}function kd(e){return Rn(e)?e.scrollX:e.scrollLeft}function Ed(e){return Rn(e)?e.scrollY:e.scrollTop}function Ii(e){return{x:kd(e),y:Ed(e)}}var yt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(yt||(yt={}));function Ad(e){return!Us||!e?!1:e===document.scrollingElement}function Id(e){const t={x:0,y:0},r=Ad(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:o,isLeft:s,isBottom:a,isRight:i,maxScroll:n,minScroll:t}}const wy={x:.2,y:.2};function _y(e,t,r,n,o){let{top:s,left:a,right:i,bottom:c}=r;n===void 0&&(n=10),o===void 0&&(o=wy);const{isTop:d,isBottom:u,isLeft:f,isRight:g}=Id(e),p={x:0,y:0},b={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+m.height?(p.y=yt.Backward,b.y=n*Math.abs((t.top+m.height-s)/m.height)):!u&&c>=t.bottom-m.height&&(p.y=yt.Forward,b.y=n*Math.abs((t.bottom-m.height-c)/m.height)),!g&&i>=t.right-m.width?(p.x=yt.Forward,b.x=n*Math.abs((t.right-m.width-i)/m.width)):!f&&a<=t.left+m.width&&(p.x=yt.Backward,b.x=n*Math.abs((t.left+m.width-a)/m.width)),{direction:p,speed:b}}function Ty(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Ld(e){return e.reduce((t,r)=>Wn(t,Ii(r)),Sr)}function ky(e){return e.reduce((t,r)=>t+kd(r),0)}function Ey(e){return e.reduce((t,r)=>t+Ed(r),0)}function Dd(e,t){if(t===void 0&&(t=Gn),!e)return;const{top:r,left:n,bottom:o,right:s}=t(e);Td(e)&&(o<=0||s<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ay=[["x",["left","right"],ky],["y",["top","bottom"],Ey]];class Li{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Gs(r),o=Ld(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of Ay)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=i(n),u=o[s]-d;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class zo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Iy(e){const{EventTarget:t}=Ht(e);return e instanceof t?e:Qn(e)}function Di(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var dr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(dr||(dr={}));function Nd(e){e.preventDefault()}function Ly(e){e.stopPropagation()}var je;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(je||(je={}));const Od={start:[je.Space,je.Enter],cancel:[je.Esc],end:[je.Space,je.Enter,je.Tab]},Dy=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case je.Right:return{...r,x:r.x+25};case je.Left:return{...r,x:r.x-25};case je.Down:return{...r,y:r.y+25};case je.Up:return{...r,y:r.y-25}}};class Ni{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new zo(Qn(r)),this.windowListeners=new zo(Ht(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(dr.Resize,this.handleCancel),this.windowListeners.add(dr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(dr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Dd(n),r(Sr)}handleKeyDown(t){if(Rs(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:s=Od,coordinateGetter:a=Dy,scrollBehavior:i="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:Sr;this.referenceCoordinates||(this.referenceCoordinates=u);const f=a(t,{active:r,context:n.current,currentCoordinates:u});if(f){const g=Vo(f,u),p={x:0,y:0},{scrollableAncestors:b}=n.current;for(const m of b){const v=t.code,{isTop:y,isRight:C,isLeft:S,isBottom:w,maxScroll:_,minScroll:T}=Id(m),E=Ty(m),A={x:Math.min(v===je.Right?E.right-E.width/2:E.right,Math.max(v===je.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(v===je.Down?E.bottom-E.height/2:E.bottom,Math.max(v===je.Down?E.top:E.top+E.height/2,f.y))},x=v===je.Right&&!C||v===je.Left&&!S,B=v===je.Down&&!w||v===je.Up&&!y;if(x&&A.x!==f.x){const D=m.scrollLeft+g.x,F=v===je.Right&&D<=_.x||v===je.Left&&D>=T.x;if(F&&!g.y){m.scrollTo({left:D,behavior:i});return}F?p.x=m.scrollLeft-D:p.x=v===je.Right?m.scrollLeft-_.x:m.scrollLeft-T.x,p.x&&m.scrollBy({left:-p.x,behavior:i});break}else if(B&&A.y!==f.y){const D=m.scrollTop+g.y,F=v===je.Down&&D<=_.y||v===je.Up&&D>=T.y;if(F&&!g.x){m.scrollTo({top:D,behavior:i});return}F?p.y=m.scrollTop-D:p.y=v===je.Down?m.scrollTop-_.y:m.scrollTop-T.y,p.y&&m.scrollBy({top:-p.y,behavior:i});break}}this.handleMove(t,Wn(Vo(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ni.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Od,onActivation:o}=t,{active:s}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Pd(e){return!!(e&&"distance"in e)}function xd(e){return!!(e&&"delay"in e)}class Oi{constructor(t,r,n){var o;n===void 0&&(n=Iy(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:s}=t,{target:a}=s;this.props=t,this.events=r,this.document=Qn(a),this.documentListeners=new zo(this.document),this.listeners=new zo(n),this.windowListeners=new zo(Ht(a)),this.initialCoordinates=(o=Qs(s))!=null?o:Sr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(dr.Resize,this.handleCancel),this.windowListeners.add(dr.DragStart,Nd),this.windowListeners.add(dr.VisibilityChange,this.handleCancel),this.windowListeners.add(dr.ContextMenu,Nd),this.documentListeners.add(dr.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xd(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Pd(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(dr.Click,Ly,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(dr.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!o)return;const c=(r=Qs(t))!=null?r:Sr,d=Vo(o,c);if(!n&&i){if(Pd(i)){if(i.tolerance!=null&&Di(d,i.tolerance))return this.handleCancel();if(Di(d,i.distance))return this.handleStart()}if(xd(i)&&Di(d,i.tolerance))return this.handleCancel();this.handlePending(i,d);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ny={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ks extends Oi{constructor(t){const{event:r}=t,n=Qn(r.target);super(t,Ny,n)}}Ks.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Oy={move:{name:"mousemove"},end:{name:"mouseup"}};var Pi;(function(e){e[e.RightClick=2]="RightClick"})(Pi||(Pi={}));class Py extends Oi{constructor(t){super(t,Oy,Qn(t.event.target))}}Py.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Pi.RightClick?!1:(n==null||n({event:r}),!0)}}];const xi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class xy extends Oi{constructor(t){super(t,xi)}static setup(){return window.addEventListener(xi.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(xi.move.name,t)};function t(){}}}xy.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var Ro;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ro||(Ro={}));var Ys;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ys||(Ys={}));function Fy(e){let{acceleration:t,activator:r=Ro.Pointer,canScroll:n,draggingRect:o,enabled:s,interval:a=5,order:i=Ys.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:g}=e;const p=By({delta:f,disabled:!s}),[b,m]=Yv(),v=h.useRef({x:0,y:0}),y=h.useRef({x:0,y:0}),C=h.useMemo(()=>{switch(r){case Ro.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ro.DraggableRect:return o}},[r,o,c]),S=h.useRef(null),w=h.useCallback(()=>{const T=S.current;if(!T)return;const E=v.current.x*y.current.x,A=v.current.y*y.current.y;T.scrollBy(E,A)},[]),_=h.useMemo(()=>i===Ys.TreeOrder?[...d].reverse():d,[i,d]);h.useEffect(()=>{if(!s||!d.length||!C){m();return}for(const T of _){if((n==null?void 0:n(T))===!1)continue;const E=d.indexOf(T),A=u[E];if(!A)continue;const{direction:x,speed:B}=_y(T,A,C,t,g);for(const D of["x","y"])p[D][x[D]]||(B[D]=0,x[D]=0);if(B.x>0||B.y>0){m(),S.current=T,b(w,a),v.current=B,y.current=x;return}}v.current={x:0,y:0},y.current={x:0,y:0},m()},[t,w,n,m,s,a,JSON.stringify(C),JSON.stringify(p),b,d,_,u,JSON.stringify(g)])}const My={x:{[yt.Backward]:!1,[yt.Forward]:!1},y:{[yt.Backward]:!1,[yt.Forward]:!1}};function By(e){let{delta:t,disabled:r}=e;const n=zs(t);return Uo(o=>{if(r||!n||!o)return My;const s={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[yt.Backward]:o.x[yt.Backward]||s.x===-1,[yt.Forward]:o.x[yt.Forward]||s.x===1},y:{[yt.Backward]:o.y[yt.Backward]||s.y===-1,[yt.Forward]:o.y[yt.Forward]||s.y===1}}},[r,t,n])}function $y(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Uo(o=>{var s;return t==null?null:(s=n??o)!=null?s:null},[n,t])}function qy(e,t){return h.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,n)}));return[...r,...s]},[]),[e,t])}var Qo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Qo||(Qo={}));var Fi;(function(e){e.Optimized="optimized"})(Fi||(Fi={}));const Fd=new Map;function jy(e,t){let{dragging:r,dependencies:n,config:o}=t;const[s,a]=h.useState(null),{frequency:i,measure:c,strategy:d}=o,u=h.useRef(e),f=v(),g=jo(f),p=h.useCallback(function(y){y===void 0&&(y=[]),!g.current&&a(C=>C===null?y:C.concat(y.filter(S=>!C.includes(S))))},[g]),b=h.useRef(null),m=Uo(y=>{if(f&&!r)return Fd;if(!y||y===Fd||u.current!==e||s!=null){const C=new Map;for(let S of e){if(!S)continue;if(s&&s.length>0&&!s.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const w=S.node.current,_=w?new Li(c(w),w):null;S.rect.current=_,_&&C.set(S.id,_)}return C}return y},[e,s,r,f,c]);return h.useEffect(()=>{u.current=e},[e]),h.useEffect(()=>{f||p()},[r,f]),h.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),h.useEffect(()=>{f||typeof i!="number"||b.current!==null||(b.current=setTimeout(()=>{p(),b.current=null},i))},[i,f,p,...n]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:s!=null};function v(){switch(d){case Qo.Always:return!1;case Qo.BeforeDragging:return r;default:return!r}}}function Mi(e,t){return Uo(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Uy(e,t){return Mi(e,t)}function Hy(e){let{callback:t,disabled:r}=e;const n=Hs(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(n)},[n,r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Zs(e){let{callback:t,disabled:r}=e;const n=Hs(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(n)},[r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Vy(e){return new Li(Gn(e),e)}function Md(e,t,r){t===void 0&&(t=Vy);const[n,o]=h.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??r)!=null?d:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const a=Hy({callback(c){if(e)for(const d of c){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),i=Zs({callback:s});return Cr(()=>{s(),e?(i==null||i.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(i==null||i.disconnect(),a==null||a.disconnect())},[e]),n}function zy(e){const t=Mi(e);return Sd(e,t)}const Bd=[];function Ry(e){const t=h.useRef(e),r=Uo(n=>e?n&&n!==Bd&&e&&t.current&&e.parentNode===t.current.parentNode?n:Gs(e):Bd,[e]);return h.useEffect(()=>{t.current=e},[e]),r}function Qy(e){const[t,r]=h.useState(null),n=h.useRef(e),o=h.useCallback(s=>{const a=Ai(s.target);a&&r(i=>i?(i.set(a,Ii(a)),new Map(i)):null)},[]);return h.useEffect(()=>{const s=n.current;if(e!==s){a(s);const i=e.map(c=>{const d=Ai(c);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ii(d)]):null}).filter(c=>c!=null);r(i.length?new Map(i):null),n.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(c=>{const d=Ai(c);d==null||d.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>Wn(s,a),Sr):Ld(e):Sr,[e,t])}function $d(e,t){t===void 0&&(t=[]);const r=h.useRef(null);return h.useEffect(()=>{r.current=null},t),h.useEffect(()=>{const n=e!==Sr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Vo(e,r.current):Sr}function Wy(e){h.useEffect(()=>{if(!Us)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Gy(e,t){return h.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:s}=n;return r[o]=a=>{s(a,t)},r},{}),[e,t])}function qd(e){return h.useMemo(()=>e?by(e):null,[e])}const jd=[];function Ky(e,t){t===void 0&&(t=Gn);const[r]=e,n=qd(r?Ht(r):null),[o,s]=h.useState(jd);function a(){s(()=>e.length?e.map(c=>Ad(c)?n:new Li(t(c),c)):jd)}const i=Zs({callback:a});return Cr(()=>{i==null||i.disconnect(),a(),e.forEach(c=>i==null?void 0:i.observe(c))},[e]),o}function Ud(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return qo(t)?t:e}function Yy(e){let{measure:t}=e;const[r,n]=h.useState(null),o=h.useCallback(d=>{for(const{target:u}of d)if(qo(u)){n(f=>{const g=t(u);return f?{...f,width:g.width,height:g.height}:g});break}},[t]),s=Zs({callback:o}),a=h.useCallback(d=>{const u=Ud(d);s==null||s.disconnect(),u&&(s==null||s.observe(u)),n(u?t(u):null)},[t,s]),[i,c]=Vs(a);return h.useMemo(()=>({nodeRef:i,rect:r,setRef:c}),[r,i,c])}const Zy=[{sensor:Ks,options:{}},{sensor:Ni,options:{}}],Xy={current:{}},Xs={draggable:{measure:_d},droppable:{measure:_d,strategy:Qo.WhileDragging,frequency:Fi.Optimized},dragOverlay:{measure:Gn}};class Wo extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Jy={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Wo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ws},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xs,measureDroppableContainers:Ws,windowRect:null,measuringScheduled:!1},Hd={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ws,draggableNodes:new Map,over:null,measureDroppableContainers:Ws},Go=h.createContext(Hd),Vd=h.createContext(Jy);function eb(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Wo}}}function tb(e,t){switch(t.type){case gt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case gt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case gt.DragEnd:case gt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case gt.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new Wo(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case gt.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const a=new Wo(e.droppable.containers);return a.set(r,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case gt.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const s=new Wo(e.droppable.containers);return s.delete(r),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function rb(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=h.useContext(Go),s=zs(n),a=zs(r==null?void 0:r.id);return h.useEffect(()=>{if(!t&&!n&&s&&a!=null){if(!Rs(s)||document.activeElement===s.target)return;const i=o.get(a);if(!i)return;const{activatorNode:c,node:d}=i;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[c.current,d.current]){if(!u)continue;const f=Jv(u);if(f){f.focus();break}}})}},[n,t,o,a,s]),null}function zd(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...n}),r):r}function nb(e){return h.useMemo(()=>({draggable:{...Xs.draggable,...e==null?void 0:e.draggable},droppable:{...Xs.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Xs.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function ob(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const s=h.useRef(!1),{x:a,y:i}=typeof o=="boolean"?{x:o,y:o}:o;Cr(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),f=Sd(u,n);if(a||(f.x=0),i||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=Td(d);g&&g.scrollBy({top:f.y,left:f.x})}},[t,a,i,n,r])}const Js=h.createContext({...Sr,scaleX:1,scaleY:1});var tn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(tn||(tn={}));const Bi=h.memo(function(t){var r,n,o,s;let{id:a,accessibility:i,autoScroll:c=!0,children:d,sensors:u=Zy,collisionDetection:f=hy,measuring:g,modifiers:p,...b}=t;const m=h.useReducer(tb,void 0,eb),[v,y]=m,[C,S]=sy(),[w,_]=h.useState(tn.Uninitialized),T=w===tn.Initialized,{draggable:{active:E,nodes:A,translate:x},droppable:{containers:B}}=v,D=E!=null?A.get(E):null,F=h.useRef({initial:null,translated:null}),M=h.useMemo(()=>{var ht;return E!=null?{id:E,data:(ht=D==null?void 0:D.data)!=null?ht:Xy,rect:F}:null},[E,D]),P=h.useRef(null),[V,ne]=h.useState(null),[W,de]=h.useState(null),ie=jo(b,Object.values(b)),ve=Ho("DndDescribedBy",a),me=h.useMemo(()=>B.getEnabled(),[B]),z=nb(g),{droppableRects:Ce,measureDroppableContainers:ke,measuringScheduled:U}=jy(me,{dragging:T,dependencies:[x.x,x.y],config:z.droppable}),q=$y(A,E),le=h.useMemo(()=>W?Qs(W):null,[W]),ge=qr(),ee=Uy(q,z.draggable.measure);ob({activeNode:E!=null?A.get(E):null,config:ge.layoutShiftCompensation,initialRect:ee,measure:z.draggable.measure});const fe=Md(q,z.draggable.measure,ee),X=Md(q?q.parentElement:null),Se=h.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:Ce,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Me=B.getNodeFor((r=Se.current.over)==null?void 0:r.id),re=Yy({measure:z.dragOverlay.measure}),ce=(n=re.nodeRef.current)!=null?n:q,G=T?(o=re.rect)!=null?o:fe:null,H=!!(re.nodeRef.current&&re.rect),Ae=zy(H?null:fe),Te=qd(ce?Ht(ce):null),Ie=Ry(T?Me??q:null),we=Ky(Ie),Be=zd(p,{transform:{x:x.x-Ae.x,y:x.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:W,active:M,activeNodeRect:fe,containerNodeRect:X,draggingNodeRect:G,over:Se.current.over,overlayNodeRect:re.rect,scrollableAncestors:Ie,scrollableAncestorRects:we,windowRect:Te}),zt=le?Wn(le,x):null,vr=Qy(Ie),Rt=$d(vr),qt=$d(vr,[fe]),k=Wn(Be,Rt),N=G?gy(G,Be):null,O=M&&N?f({active:M,collisionRect:N,droppableRects:Ce,droppableContainers:me,pointerCoordinates:zt}):null,R=yd(O,"id"),[Q,K]=h.useState(null),Y=H?Be:Wn(Be,qt),he=py(Y,(s=Q==null?void 0:Q.rect)!=null?s:null,fe),Pe=h.useRef(null),et=h.useCallback((ht,Tt)=>{let{sensor:kt,options:Jt}=Tt;if(P.current==null)return;const Qt=A.get(P.current);if(!Qt)return;const Ut=ht.nativeEvent,ir=new kt({active:P.current,activeNode:Qt,event:Ut,options:Jt,context:Se,onAbort(pt){if(!A.get(pt))return;const{onDragAbort:lr}=ie.current,yr={id:pt};lr==null||lr(yr),C({type:"onDragAbort",event:yr})},onPending(pt,Ir,lr,yr){if(!A.get(pt))return;const{onDragPending:bn}=ie.current,j={id:pt,constraint:Ir,initialCoordinates:lr,offset:yr};bn==null||bn(j),C({type:"onDragPending",event:j})},onStart(pt){const Ir=P.current;if(Ir==null)return;const lr=A.get(Ir);if(!lr)return;const{onDragStart:yr}=ie.current,yn={activatorEvent:Ut,active:{id:Ir,data:lr.data,rect:F}};Ke.unstable_batchedUpdates(()=>{yr==null||yr(yn),_(tn.Initializing),y({type:gt.DragStart,initialCoordinates:pt,active:Ir}),C({type:"onDragStart",event:yn}),ne(Pe.current),de(Ut)})},onMove(pt){y({type:gt.DragMove,coordinates:pt})},onEnd:Kr(gt.DragEnd),onCancel:Kr(gt.DragCancel)});Pe.current=ir;function Kr(pt){return async function(){const{active:lr,collisions:yr,over:yn,scrollAdjustedTranslate:bn}=Se.current;let j=null;if(lr&&bn){const{cancelDrop:ye}=ie.current;j={activatorEvent:Ut,active:lr,collisions:yr,delta:bn,over:yn},pt===gt.DragEnd&&typeof ye=="function"&&await Promise.resolve(ye(j))&&(pt=gt.DragCancel)}P.current=null,Ke.unstable_batchedUpdates(()=>{y({type:pt}),_(tn.Uninitialized),K(null),ne(null),de(null),Pe.current=null;const ye=pt===gt.DragEnd?"onDragEnd":"onDragCancel";if(j){const Le=ie.current[ye];Le==null||Le(j),C({type:ye,event:j})}})}}},[A]),jt=h.useCallback((ht,Tt)=>(kt,Jt)=>{const Qt=kt.nativeEvent,Ut=A.get(Jt);if(P.current!==null||!Ut||Qt.dndKit||Qt.defaultPrevented)return;const ir={active:Ut};ht(kt,Tt.options,ir)===!0&&(Qt.dndKit={capturedBy:Tt.sensor},P.current=Jt,et(kt,Tt))},[A,et]),_t=qy(u,jt);Wy(u),Cr(()=>{fe&&w===tn.Initializing&&_(tn.Initialized)},[fe,w]),h.useEffect(()=>{const{onDragMove:ht}=ie.current,{active:Tt,activatorEvent:kt,collisions:Jt,over:Qt}=Se.current;if(!Tt||!kt)return;const Ut={active:Tt,activatorEvent:kt,collisions:Jt,delta:{x:k.x,y:k.y},over:Qt};Ke.unstable_batchedUpdates(()=>{ht==null||ht(Ut),C({type:"onDragMove",event:Ut})})},[k.x,k.y]),h.useEffect(()=>{const{active:ht,activatorEvent:Tt,collisions:kt,droppableContainers:Jt,scrollAdjustedTranslate:Qt}=Se.current;if(!ht||P.current==null||!Tt||!Qt)return;const{onDragOver:Ut}=ie.current,ir=Jt.get(R),Kr=ir&&ir.rect.current?{id:ir.id,rect:ir.rect.current,data:ir.data,disabled:ir.disabled}:null,pt={active:ht,activatorEvent:Tt,collisions:kt,delta:{x:Qt.x,y:Qt.y},over:Kr};Ke.unstable_batchedUpdates(()=>{K(Kr),Ut==null||Ut(pt),C({type:"onDragOver",event:pt})})},[R]),Cr(()=>{Se.current={activatorEvent:W,active:M,activeNode:q,collisionRect:N,collisions:O,droppableRects:Ce,draggableNodes:A,draggingNode:ce,draggingNodeRect:G,droppableContainers:B,over:Q,scrollableAncestors:Ie,scrollAdjustedTranslate:k},F.current={initial:G,translated:N}},[M,q,O,N,A,ce,G,Ce,B,Q,Ie,k]),Fy({...ge,delta:x,draggingRect:N,pointerCoordinates:zt,scrollableAncestors:Ie,scrollableAncestorRects:we});const ft=h.useMemo(()=>({active:M,activeNode:q,activeNodeRect:fe,activatorEvent:W,collisions:O,containerNodeRect:X,dragOverlay:re,draggableNodes:A,droppableContainers:B,droppableRects:Ce,over:Q,measureDroppableContainers:ke,scrollableAncestors:Ie,scrollableAncestorRects:we,measuringConfiguration:z,measuringScheduled:U,windowRect:Te}),[M,q,fe,W,O,X,re,A,B,Ce,Q,ke,Ie,we,z,U,Te]),vn=h.useMemo(()=>({activatorEvent:W,activators:_t,active:M,activeNodeRect:fe,ariaDescribedById:{draggable:ve},dispatch:y,draggableNodes:A,over:Q,measureDroppableContainers:ke}),[W,_t,M,fe,y,ve,A,Q,ke]);return h.createElement(hd.Provider,{value:S},h.createElement(Go.Provider,{value:vn},h.createElement(Vd.Provider,{value:ft},h.createElement(Js.Provider,{value:he},d)),h.createElement(rb,{disabled:(i==null?void 0:i.restoreFocus)===!1})),h.createElement(ly,{...i,hiddenTextDescribedById:ve}));function qr(){const ht=(V==null?void 0:V.autoScrollEnabled)===!1,Tt=typeof c=="object"?c.enabled===!1:c===!1,kt=T&&!ht&&!Tt;return typeof c=="object"?{...c,enabled:kt}:{enabled:kt}}}),sb=h.createContext(null),Rd="button",ab="Draggable";function Qd(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const s=Ho(ab),{activators:a,activatorEvent:i,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:g}=h.useContext(Go),{role:p=Rd,roleDescription:b="draggable",tabIndex:m=0}=o??{},v=(c==null?void 0:c.id)===t,y=h.useContext(v?Js:sb),[C,S]=Vs(),[w,_]=Vs(),T=Gy(a,t),E=jo(r);Cr(()=>(f.set(t,{id:t,key:s,node:C,activatorNode:w,data:E}),()=>{const x=f.get(t);x&&x.key===s&&f.delete(t)}),[f,t]);const A=h.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":n,"aria-pressed":v&&p===Rd?!0:void 0,"aria-roledescription":b,"aria-describedby":u.draggable}),[n,p,m,v,b,u.draggable]);return{active:c,activatorEvent:i,activeNodeRect:d,attributes:A,isDragging:v,listeners:n?void 0:T,node:C,over:g,setNodeRef:S,setActivatorNodeRef:_,transform:y}}function Wd(){return h.useContext(Vd)}const ib="Droppable",lb={timeout:25};function cb(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const s=Ho(ib),{active:a,dispatch:i,over:c,measureDroppableContainers:d}=h.useContext(Go),u=h.useRef({disabled:r}),f=h.useRef(!1),g=h.useRef(null),p=h.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:v}={...lb,...o},y=jo(m??n),C=h.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),p.current=null},v)},[v]),S=Zs({callback:C,disabled:b||!a}),w=h.useCallback((A,x)=>{S&&(x&&(S.unobserve(x),f.current=!1),A&&S.observe(A))},[S]),[_,T]=Vs(w),E=jo(t);return h.useEffect(()=>{!S||!_.current||(S.disconnect(),f.current=!1,S.observe(_.current))},[_,S]),h.useEffect(()=>(i({type:gt.RegisterDroppable,element:{id:n,key:s,disabled:r,node:_,rect:g,data:E}}),()=>i({type:gt.UnregisterDroppable,key:s,id:n})),[n]),h.useEffect(()=>{r!==u.current.disabled&&(i({type:gt.SetDroppableDisabled,id:n,key:s,disabled:r}),u.current.disabled=r)},[n,s,r,i]),{active:a,rect:g,isOver:(c==null?void 0:c.id)===n,node:_,over:c,setNodeRef:T}}function db(e){let{animation:t,children:r}=e;const[n,o]=h.useState(null),[s,a]=h.useState(null),i=zs(r);return!r&&!n&&i&&o(i),Cr(()=>{if(!s)return;const c=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(c==null||d==null){o(null);return}Promise.resolve(t(d,s)).then(()=>{o(null)})},[t,n,s]),h.createElement(h.Fragment,null,r,n?h.cloneElement(n,{ref:a}):null)}const ub={x:0,y:0,scaleX:1,scaleY:1};function fb(e){let{children:t}=e;return h.createElement(Go.Provider,{value:Hd},h.createElement(Js.Provider,{value:ub},t))}const hb={position:"fixed",touchAction:"none"},pb=e=>Rs(e)?"transform 250ms ease":void 0,mb=h.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:s,className:a,rect:i,style:c,transform:d,transition:u=pb}=e;if(!i)return null;const f=o?d:{...d,scaleX:1,scaleY:1},g={...hb,width:i.width,height:i.height,top:i.top,left:i.left,transform:Vr.Transform.toString(f),transformOrigin:o&&n?cy(n,i):void 0,transition:typeof u=="function"?u(n):u,...c};return h.createElement(r,{className:a,style:g,ref:t},s)}),gb={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Vr.Transform.toString(t)},{transform:Vr.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:s,className:a}=e;if(s!=null&&s.active)for(const[i,c]of Object.entries(s.active))c!==void 0&&(o[i]=r.node.style.getPropertyValue(i),r.node.style.setProperty(i,c));if(s!=null&&s.dragOverlay)for(const[i,c]of Object.entries(s.dragOverlay))c!==void 0&&n.node.style.setProperty(i,c);return a!=null&&a.active&&r.node.classList.add(a.active),a!=null&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[c,d]of Object.entries(o))r.node.style.setProperty(c,d);a!=null&&a.active&&r.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};function vb(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return Hs((s,a)=>{if(t===null)return;const i=r.get(s);if(!i)return;const c=i.node.current;if(!c)return;const d=Ud(a);if(!d)return;const{transform:u}=Ht(a).getComputedStyle(a),f=wd(u);if(!f)return;const g=typeof t=="function"?t:yb(t);return Dd(c,o.draggable.measure),g({active:{id:s,data:i.data,node:c,rect:o.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:a,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function yb(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...gb,...e};return s=>{let{active:a,dragOverlay:i,transform:c,...d}=s;if(!t)return;const u={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},f={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/i.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/i.rect.height:1},g={x:c.x-u.x,y:c.y-u.y,...f},p=o({...d,active:a,dragOverlay:i,transform:{initial:c,final:g}}),[b]=p,m=p[p.length-1];if(JSON.stringify(b)===JSON.stringify(m))return;const v=n==null?void 0:n({active:a,dragOverlay:i,...d}),y=i.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(C=>{y.onfinish=()=>{v==null||v(),C()}})}}let Gd=0;function bb(e){return h.useMemo(()=>{if(e!=null)return Gd++,Gd},[e])}const Cb=h.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:s,modifiers:a,wrapperElement:i="div",className:c,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:g,containerNodeRect:p,draggableNodes:b,droppableContainers:m,dragOverlay:v,over:y,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:w,windowRect:_}=Wd(),T=h.useContext(Js),E=bb(f==null?void 0:f.id),A=zd(a,{activatorEvent:u,active:f,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:w,transform:T,windowRect:_}),x=Mi(g),B=vb({config:n,draggableNodes:b,droppableContainers:m,measuringConfiguration:C}),D=x?v.setRef:void 0;return h.createElement(fb,null,h.createElement(db,{animation:B},f&&E?h.createElement(mb,{key:E,id:f.id,ref:D,as:i,activatorEvent:u,adjustScale:t,className:c,transition:s,rect:x,style:{zIndex:d,...o},transform:A},r):null))});/**
182
182
  * @license lucide-react v0.400.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const vy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yd=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
186
+ */const Sb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kd=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
187
187
  * @license lucide-react v0.400.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */var yy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
191
+ */var wb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
192
192
  * @license lucide-react v0.400.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const by=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...i},c)=>p.createElement("svg",{ref:c,...yy,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:yd("lucide",s),...i},[...a.map(([d,u])=>p.createElement(d,u)),...Array.isArray(o)?o:[o]]));/**
196
+ */const _b=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:a,...i},c)=>h.createElement("svg",{ref:c,...wb,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Kd("lucide",o),...i},[...a.map(([d,u])=>h.createElement(d,u)),...Array.isArray(s)?s:[s]]));/**
197
197
  * @license lucide-react v0.400.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const le=(e,t)=>{const r=p.forwardRef(({className:n,...s},o)=>p.createElement(by,{ref:o,iconNode:t,className:yd(`lucide-${vy(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
201
+ */const pe=(e,t)=>{const r=h.forwardRef(({className:n,...o},s)=>h.createElement(_b,{ref:s,iconNode:t,className:Kd(`lucide-${Sb(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
202
202
  * @license lucide-react v0.400.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const Cy=le("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
206
+ */const Tb=pe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
207
207
  * @license lucide-react v0.400.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
- */const pi=le("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
211
+ */const $i=pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
212
212
  * @license lucide-react v0.400.0 - ISC
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const Sy=le("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/**
216
+ */const kb=pe("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/**
217
217
  * @license lucide-react v0.400.0 - ISC
218
218
  *
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
- */const wy=le("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
221
+ */const Eb=pe("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
222
222
  * @license lucide-react v0.400.0 - ISC
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
- */const pr=le("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
226
+ */const Nr=pe("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
227
227
  * @license lucide-react v0.400.0 - ISC
228
228
  *
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
- */const _y=le("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/**
231
+ */const Ab=pe("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/**
232
232
  * @license lucide-react v0.400.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
- */const Zr=le("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
236
+ */const Kn=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
237
237
  * @license lucide-react v0.400.0 - ISC
238
238
  *
239
239
  * This source code is licensed under the ISC license.
240
240
  * See the LICENSE file in the root directory of this source tree.
241
- */const Xr=le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
241
+ */const rn=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
242
242
  * @license lucide-react v0.400.0 - ISC
243
243
  *
244
244
  * This source code is licensed under the ISC license.
245
245
  * See the LICENSE file in the root directory of this source tree.
246
- */const gi=le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
246
+ */const ea=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
247
247
  * @license lucide-react v0.400.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
- */const Ty=le("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
251
+ */const Ib=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
252
252
  * @license lucide-react v0.400.0 - ISC
253
253
  *
254
254
  * This source code is licensed under the ISC license.
255
255
  * See the LICENSE file in the root directory of this source tree.
256
- */const bd=le("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
256
+ */const Yd=pe("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
257
257
  * @license lucide-react v0.400.0 - ISC
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
- */const Mo=le("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
261
+ */const ta=pe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
262
262
  * @license lucide-react v0.400.0 - ISC
263
263
  *
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
- */const Ey=le("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
266
+ */const Lb=pe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
267
267
  * @license lucide-react v0.400.0 - ISC
268
268
  *
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
- */const Ay=le("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
271
+ */const Db=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
272
272
  * @license lucide-react v0.400.0 - ISC
273
273
  *
274
274
  * This source code is licensed under the ISC license.
275
275
  * See the LICENSE file in the root directory of this source tree.
276
- */const ky=le("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
276
+ */const Nb=pe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
277
277
  * @license lucide-react v0.400.0 - ISC
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
- */const Cd=le("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
281
+ */const Zd=pe("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
282
282
  * @license lucide-react v0.400.0 - ISC
283
283
  *
284
284
  * This source code is licensed under the ISC license.
285
285
  * See the LICENSE file in the root directory of this source tree.
286
- */const Iy=le("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
286
+ */const Ob=pe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
287
287
  * @license lucide-react v0.400.0 - ISC
288
288
  *
289
289
  * This source code is licensed under the ISC license.
290
290
  * See the LICENSE file in the root directory of this source tree.
291
- */const ks=le("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
291
+ */const Ko=pe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
292
292
  * @license lucide-react v0.400.0 - ISC
293
293
  *
294
294
  * This source code is licensed under the ISC license.
295
295
  * See the LICENSE file in the root directory of this source tree.
296
- */const Fr=le("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
296
+ */const nn=pe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
297
297
  * @license lucide-react v0.400.0 - ISC
298
298
  *
299
299
  * This source code is licensed under the ISC license.
300
300
  * See the LICENSE file in the root directory of this source tree.
301
- */const Sd=le("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
301
+ */const Xd=pe("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
302
302
  * @license lucide-react v0.400.0 - ISC
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
- */const Ly=le("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
306
+ */const Pb=pe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
307
307
  * @license lucide-react v0.400.0 - ISC
308
308
  *
309
309
  * This source code is licensed under the ISC license.
310
310
  * See the LICENSE file in the root directory of this source tree.
311
- */const wd=le("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
311
+ */const Jd=pe("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
312
312
  * @license lucide-react v0.400.0 - ISC
313
313
  *
314
314
  * This source code is licensed under the ISC license.
315
315
  * See the LICENSE file in the root directory of this source tree.
316
- */const _d=le("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
316
+ */const eu=pe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
317
317
  * @license lucide-react v0.400.0 - ISC
318
318
  *
319
319
  * This source code is licensed under the ISC license.
320
320
  * See the LICENSE file in the root directory of this source tree.
321
- */const Dy=le("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
321
+ */const xb=pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
322
322
  * @license lucide-react v0.400.0 - ISC
323
323
  *
324
324
  * This source code is licensed under the ISC license.
325
325
  * See the LICENSE file in the root directory of this source tree.
326
- */const mi=le("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
326
+ */const qi=pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
327
327
  * @license lucide-react v0.400.0 - ISC
328
328
  *
329
329
  * This source code is licensed under the ISC license.
330
330
  * See the LICENSE file in the root directory of this source tree.
331
- */const Ny=le("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
331
+ */const Fb=pe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
332
332
  * @license lucide-react v0.400.0 - ISC
333
333
  *
334
334
  * This source code is licensed under the ISC license.
335
335
  * See the LICENSE file in the root directory of this source tree.
336
- */const Td=le("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
336
+ */const tu=pe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
337
337
  * @license lucide-react v0.400.0 - ISC
338
338
  *
339
339
  * This source code is licensed under the ISC license.
340
340
  * See the LICENSE file in the root directory of this source tree.
341
- */const Dn=le("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
341
+ */const zr=pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
342
342
  * @license lucide-react v0.400.0 - ISC
343
343
  *
344
344
  * This source code is licensed under the ISC license.
345
345
  * See the LICENSE file in the root directory of this source tree.
346
- */const Bo=le("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
346
+ */const ra=pe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
347
347
  * @license lucide-react v0.400.0 - ISC
348
348
  *
349
349
  * This source code is licensed under the ISC license.
350
350
  * See the LICENSE file in the root directory of this source tree.
351
- */const Py=le("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
351
+ */const Mb=pe("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
352
352
  * @license lucide-react v0.400.0 - ISC
353
353
  *
354
354
  * This source code is licensed under the ISC license.
355
355
  * See the LICENSE file in the root directory of this source tree.
356
- */const $o=le("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
356
+ */const na=pe("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
357
357
  * @license lucide-react v0.400.0 - ISC
358
358
  *
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
- */const Ed=le("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
361
+ */const ru=pe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
362
362
  * @license lucide-react v0.400.0 - ISC
363
363
  *
364
364
  * This source code is licensed under the ISC license.
365
365
  * See the LICENSE file in the root directory of this source tree.
366
- */const Oy=le("Milestone",[["path",{d:"M18 6H5a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h13l4-3.5L18 6Z",key:"1mp5s7"}],["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}]]);/**
366
+ */const Bb=pe("Milestone",[["path",{d:"M18 6H5a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h13l4-3.5L18 6Z",key:"1mp5s7"}],["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}]]);/**
367
367
  * @license lucide-react v0.400.0 - ISC
368
368
  *
369
369
  * This source code is licensed under the ISC license.
370
370
  * See the LICENSE file in the root directory of this source tree.
371
- */const jo=le("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
371
+ */const oa=pe("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
372
372
  * @license lucide-react v0.400.0 - ISC
373
373
  *
374
374
  * This source code is licensed under the ISC license.
375
375
  * See the LICENSE file in the root directory of this source tree.
376
- */const qo=le("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
376
+ */const sa=pe("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
377
377
  * @license lucide-react v0.400.0 - ISC
378
378
  *
379
379
  * This source code is licensed under the ISC license.
380
380
  * See the LICENSE file in the root directory of this source tree.
381
- */const xy=le("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
381
+ */const $b=pe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
382
382
  * @license lucide-react v0.400.0 - ISC
383
383
  *
384
384
  * This source code is licensed under the ISC license.
385
385
  * See the LICENSE file in the root directory of this source tree.
386
- */const Fy=le("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
386
+ */const qb=pe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
387
387
  * @license lucide-react v0.400.0 - ISC
388
388
  *
389
389
  * This source code is licensed under the ISC license.
390
390
  * See the LICENSE file in the root directory of this source tree.
391
- */const My=le("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
391
+ */const jb=pe("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
392
392
  * @license lucide-react v0.400.0 - ISC
393
393
  *
394
394
  * This source code is licensed under the ISC license.
395
395
  * See the LICENSE file in the root directory of this source tree.
396
- */const By=le("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
396
+ */const Ub=pe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
397
397
  * @license lucide-react v0.400.0 - ISC
398
398
  *
399
399
  * This source code is licensed under the ISC license.
400
400
  * See the LICENSE file in the root directory of this source tree.
401
- */const Er=le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
401
+ */const Rr=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
402
402
  * @license lucide-react v0.400.0 - ISC
403
403
  *
404
404
  * This source code is licensed under the ISC license.
405
405
  * See the LICENSE file in the root directory of this source tree.
406
- */const Ad=le("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
406
+ */const nu=pe("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
407
407
  * @license lucide-react v0.400.0 - ISC
408
408
  *
409
409
  * This source code is licensed under the ISC license.
410
410
  * See the LICENSE file in the root directory of this source tree.
411
- */const kd=le("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
411
+ */const ou=pe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
412
412
  * @license lucide-react v0.400.0 - ISC
413
413
  *
414
414
  * This source code is licensed under the ISC license.
415
415
  * See the LICENSE file in the root directory of this source tree.
416
- */const $y=le("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
416
+ */const Hb=pe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
417
417
  * @license lucide-react v0.400.0 - ISC
418
418
  *
419
419
  * This source code is licensed under the ISC license.
420
420
  * See the LICENSE file in the root directory of this source tree.
421
- */const jy=le("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
421
+ */const Vb=pe("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
422
422
  * @license lucide-react v0.400.0 - ISC
423
423
  *
424
424
  * This source code is licensed under the ISC license.
425
425
  * See the LICENSE file in the root directory of this source tree.
426
- */const qy=le("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 4 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8l4-2",key:"1vwozw"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 8-4 8 4",key:"1q0ilc"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/**
426
+ */const zb=pe("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 4 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8l4-2",key:"1vwozw"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 8-4 8 4",key:"1q0ilc"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/**
427
427
  * @license lucide-react v0.400.0 - ISC
428
428
  *
429
429
  * This source code is licensed under the ISC license.
430
430
  * See the LICENSE file in the root directory of this source tree.
431
- */const Uo=le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
431
+ */const aa=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
432
432
  * @license lucide-react v0.400.0 - ISC
433
433
  *
434
434
  * This source code is licensed under the ISC license.
435
435
  * See the LICENSE file in the root directory of this source tree.
436
- */const Uy=le("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
436
+ */const Rb=pe("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
437
437
  * @license lucide-react v0.400.0 - ISC
438
438
  *
439
439
  * This source code is licensed under the ISC license.
440
440
  * See the LICENSE file in the root directory of this source tree.
441
- */const zy=le("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
441
+ */const Qb=pe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
442
442
  * @license lucide-react v0.400.0 - ISC
443
443
  *
444
444
  * This source code is licensed under the ISC license.
445
445
  * See the LICENSE file in the root directory of this source tree.
446
- */const Vy=le("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
446
+ */const Wb=pe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
447
447
  * @license lucide-react v0.400.0 - ISC
448
448
  *
449
449
  * This source code is licensed under the ISC license.
450
450
  * See the LICENSE file in the root directory of this source tree.
451
- */const Hy=le("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
451
+ */const Gb=pe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
452
452
  * @license lucide-react v0.400.0 - ISC
453
453
  *
454
454
  * This source code is licensed under the ISC license.
455
455
  * See the LICENSE file in the root directory of this source tree.
456
- */const Qy=le("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
456
+ */const Kb=pe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
457
457
  * @license lucide-react v0.400.0 - ISC
458
458
  *
459
459
  * This source code is licensed under the ISC license.
460
460
  * See the LICENSE file in the root directory of this source tree.
461
- */const Nn=le("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
461
+ */const Yn=pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
462
462
  * @license lucide-react v0.400.0 - ISC
463
463
  *
464
464
  * This source code is licensed under the ISC license.
465
465
  * See the LICENSE file in the root directory of this source tree.
466
- */const Wy=le("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
466
+ */const Yb=pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
467
467
  * @license lucide-react v0.400.0 - ISC
468
468
  *
469
469
  * This source code is licensed under the ISC license.
470
470
  * See the LICENSE file in the root directory of this source tree.
471
- */const vi=le("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
471
+ */const ji=pe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
472
472
  * @license lucide-react v0.400.0 - ISC
473
473
  *
474
474
  * This source code is licensed under the ISC license.
475
475
  * See the LICENSE file in the root directory of this source tree.
476
- */const Ry=le("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
476
+ */const Zb=pe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
477
477
  * @license lucide-react v0.400.0 - ISC
478
478
  *
479
479
  * This source code is licensed under the ISC license.
480
480
  * See the LICENSE file in the root directory of this source tree.
481
- */const Gy=le("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
481
+ */const Xb=pe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
482
482
  * @license lucide-react v0.400.0 - ISC
483
483
  *
484
484
  * This source code is licensed under the ISC license.
485
485
  * See the LICENSE file in the root directory of this source tree.
486
- */const zo=le("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
486
+ */const ia=pe("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
487
487
  * @license lucide-react v0.400.0 - ISC
488
488
  *
489
489
  * This source code is licensed under the ISC license.
490
490
  * See the LICENSE file in the root directory of this source tree.
491
- */const or=le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
491
+ */const Or=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
492
492
  * @license lucide-react v0.400.0 - ISC
493
493
  *
494
494
  * This source code is licensed under the ISC license.
495
495
  * See the LICENSE file in the root directory of this source tree.
496
- */const Ky=le("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Yy={},Id=e=>{let t;const r=new Set,n=(u,f)=>{const g=typeof u=="function"?u(t):u;if(!Object.is(g,t)){const m=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),r.forEach(C=>C(t,m))}},s=()=>t,c={setState:n,getState:s,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(Yy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,s,c);return c},Zy=e=>e?Id(e):Id;function yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vo={exports:{}},bi={},Ho={exports:{}},Ci={};/**
496
+ */const Jb=pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),eC={},su=e=>{let t;const r=new Set,n=(u,f)=>{const g=typeof u=="function"?u(t):u;if(!Object.is(g,t)){const p=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),r.forEach(b=>b(t,p))}},o=()=>t,c={setState:n,getState:o,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(eC?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,o,c);return c},tC=e=>e?su(e):su;function Ui(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var la={exports:{}},Hi={},ca={exports:{}},Vi={};/**
497
497
  * @license React
498
498
  * use-sync-external-store-shim.production.js
499
499
  *
@@ -501,7 +501,7 @@ to {
501
501
  *
502
502
  * This source code is licensed under the MIT license found in the
503
503
  * LICENSE file in the root directory of this source tree.
504
- */var Ld;function Xy(){if(Ld)return Ci;Ld=1;var e=p;function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function i(f,g){var m=g(),C=n({inst:{value:m,getSnapshot:g}}),h=C[0].inst,v=C[1];return o(function(){h.value=m,h.getSnapshot=g,c(h)&&v({inst:h})},[f,m,g]),s(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),a(m),m}function c(f){var g=f.getSnapshot;f=f.value;try{var m=g();return!r(f,m)}catch{return!0}}function d(f,g){return g()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:i;return Ci.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Ci}var Si={};/**
504
+ */var au;function rC(){if(au)return Vi;au=1;var e=h;function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(f,g){var p=g(),b=n({inst:{value:p,getSnapshot:g}}),m=b[0].inst,v=b[1];return s(function(){m.value=p,m.getSnapshot=g,c(m)&&v({inst:m})},[f,p,g]),o(function(){return c(m)&&v({inst:m}),f(function(){c(m)&&v({inst:m})})},[f]),a(p),p}function c(f){var g=f.getSnapshot;f=f.value;try{var p=g();return!r(f,p)}catch{return!0}}function d(f,g){return g()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:i;return Vi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Vi}var zi={};/**
505
505
  * @license React
506
506
  * use-sync-external-store-shim.development.js
507
507
  *
@@ -509,7 +509,7 @@ to {
509
509
  *
510
510
  * This source code is licensed under the MIT license found in the
511
511
  * LICENSE file in the root directory of this source tree.
512
- */var Dd;function Jy(){return Dd||(Dd=1,process.env.NODE_ENV!=="production"&&(function(){function e(m,C){return m===C&&(m!==0||1/m===1/C)||m!==m&&C!==C}function t(m,C){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=C();if(!f){var v=C();o(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:h,getSnapshot:C}});var y=v[0].inst,b=v[1];return c(function(){y.value=h,y.getSnapshot=C,r(y)&&b({inst:y})},[m,h,C]),i(function(){return r(y)&&b({inst:y}),m(function(){r(y)&&b({inst:y})})},[m]),d(h),h}function r(m){var C=m.getSnapshot;m=m.value;try{var h=C();return!o(m,h)}catch{return!0}}function n(m,C){return C()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=p,o=typeof Object.is=="function"?Object.is:e,a=s.useState,i=s.useEffect,c=s.useLayoutEffect,d=s.useDebugValue,u=!1,f=!1,g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Si.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:g,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Si}var Nd;function wi(){return Nd||(Nd=1,process.env.NODE_ENV==="production"?Ho.exports=Xy():Ho.exports=Jy()),Ho.exports}/**
512
+ */var iu;function nC(){return iu||(iu=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}function t(p,b){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=b();if(!f){var v=b();s(m,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:m,getSnapshot:b}});var y=v[0].inst,C=v[1];return c(function(){y.value=m,y.getSnapshot=b,r(y)&&C({inst:y})},[p,m,b]),i(function(){return r(y)&&C({inst:y}),p(function(){r(y)&&C({inst:y})})},[p]),d(m),m}function r(p){var b=p.getSnapshot;p=p.value;try{var m=b();return!s(p,m)}catch{return!0}}function n(p,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,c=o.useLayoutEffect,d=o.useDebugValue,u=!1,f=!1,g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;zi.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:g,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),zi}var lu;function Ri(){return lu||(lu=1,process.env.NODE_ENV==="production"?ca.exports=rC():ca.exports=nC()),ca.exports}/**
513
513
  * @license React
514
514
  * use-sync-external-store-shim/with-selector.production.js
515
515
  *
@@ -517,7 +517,7 @@ to {
517
517
  *
518
518
  * This source code is licensed under the MIT license found in the
519
519
  * LICENSE file in the root directory of this source tree.
520
- */var Pd;function eb(){if(Pd)return bi;Pd=1;var e=p,t=wi();function r(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var n=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,i=e.useMemo,c=e.useDebugValue;return bi.useSyncExternalStoreWithSelector=function(d,u,f,g,m){var C=o(null);if(C.current===null){var h={hasValue:!1,value:null};C.current=h}else h=C.current;C=i(function(){function y(E){if(!b){if(b=!0,S=E,E=g(E),m!==void 0&&h.hasValue){var N=h.value;if(m(N,E))return w=N}return w=E}if(N=w,n(S,E))return N;var I=g(E);return m!==void 0&&m(N,I)?(S=E,N):(S=E,w=I)}var b=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,g,m]);var v=s(d,C[0],C[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},bi}var _i={};/**
520
+ */var cu;function oC(){if(cu)return Hi;cu=1;var e=h,t=Ri();function r(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,i=e.useMemo,c=e.useDebugValue;return Hi.useSyncExternalStoreWithSelector=function(d,u,f,g,p){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=i(function(){function y(T){if(!C){if(C=!0,S=T,T=g(T),p!==void 0&&m.hasValue){var E=m.value;if(p(E,T))return w=E}return w=T}if(E=w,n(S,T))return E;var A=g(T);return p!==void 0&&p(E,A)?(S=T,E):(S=T,w=A)}var C=!1,S,w,_=f===void 0?null:f;return[function(){return y(u())},_===null?void 0:function(){return y(_())}]},[u,f,g,p]);var v=o(d,b[0],b[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},Hi}var Qi={};/**
521
521
  * @license React
522
522
  * use-sync-external-store-shim/with-selector.development.js
523
523
  *
@@ -525,22 +525,22 @@ to {
525
525
  *
526
526
  * This source code is licensed under the MIT license found in the
527
527
  * LICENSE file in the root directory of this source tree.
528
- */var Od;function tb(){return Od||(Od=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,r=wi(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,o=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;_i.useSyncExternalStoreWithSelector=function(d,u,f,g,m){var C=o(null);if(C.current===null){var h={hasValue:!1,value:null};C.current=h}else h=C.current;C=i(function(){function y(E){if(!b){if(b=!0,S=E,E=g(E),m!==void 0&&h.hasValue){var N=h.value;if(m(N,E))return w=N}return w=E}if(N=w,n(S,E))return N;var I=g(E);return m!==void 0&&m(N,I)?(S=E,N):(S=E,w=I)}var b=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,g,m]);var v=s(d,C[0],C[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),_i}var xd;function rb(){return xd||(xd=1,process.env.NODE_ENV==="production"?Vo.exports=eb():Vo.exports=tb()),Vo.exports}var nb=rb();const sb=yi(nb),Fd={},{useDebugValue:ob}=p,{useSyncExternalStoreWithSelector:ab}=sb;let Md=!1;const ib=e=>e;function lb(e,t=ib,r){(Fd?"production":void 0)!=="production"&&r&&!Md&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Md=!0);const n=ab(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return ob(n),n}const Bd=e=>{(Fd?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Zy(e):e,r=(n,s)=>lb(t,n,s);return Object.assign(r,t),r},Is=e=>e?Bd(e):Bd,Qo={key:"collection",unitPrimaryCategory:"Course Unit",unitContentType:"CourseUnit",unitLabelKey:"unit",defaultUnitName:"Untitled Unit",maxDepth:4,linkedLeavesOnly:!1,leafPrimaryCategories:[],derivedRoles:!1,competencyScoped:!1,features:{csvUpload:!0,dialcodes:!0,pageNumbers:!0,bulkUpload:!0,collaborators:!0}},cb={key:"learningPath",unitPrimaryCategory:"Level",unitContentType:"Level",unitLabelKey:"level",defaultUnitName:"Untitled Level",maxDepth:1,linkedLeavesOnly:!0,leafPrimaryCategories:["Course"],derivedRoles:!0,competencyScoped:!0,features:{csvUpload:!1,dialcodes:!1,pageNumbers:!1,bulkUpload:!1,collaborators:!1}},db={...Qo,key:"evaluationCourse",restrictedContentCategories:["Practice Question Set","Course Assessment"]};function ub(e){switch(e.config.primaryCategory){case"Learning Path":return cb;case"Evaluation Course":return db;default:return Qo}}const X=Is(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,editorProfile:Qo,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorProfile:t=>e({editorProfile:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=X.getState().formStatusMapper,n=[...t];for(;n.length>0;){const s=n.shift();if(r[s.id]===!1)return!1;s.children&&n.push(...s.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),fb=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:X},Symbol.toStringTag,{value:"Module"})),rt=Is(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,activeLevelExamTarget:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t,activeLevelExamTarget:null}),setActiveLevelExamTarget:t=>e({activeLevelExamTarget:t,activeAssessmentSlot:null})})),Ti={contextualEditor:{emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},languageSelector:{ariaLabel:"Select language"},collectionEditor:{errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},breadcrumb:{nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},tabBar:{detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},contentEditForm:{moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},titleAppIcon:{selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},unitContentList:{removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},contentRow:{dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},csvUpload:{invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},manageCollaborators:{saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},sparkMetaForm:{shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},appIconField:{requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},appIconPickerModal:{dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},chipGroupField:{addPlaceholder:"Add…",addButtonLabel:"Add"},dateTimeField:{requiredError:"{field} is required"},dialcodeInputField:{requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},keywordSuggestField:{requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},licenseSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select license…"},multiSelectField:{requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},nestedSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select…"},radioField:{requiredError:"{field} is required"},selectField:{requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},textField:{requiredError:"{field} is required",maxLengthError:"Max {max} characters"},assetBrowser:{dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},resourceReorderDialog:{dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},assignPageNumber:{dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},confirmDialog:{title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},publishChecklist:{publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",noButton:"No",yesButton:"Yes"},qualityParamsModal:{reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},unsavedChangesModal:{title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},filterChips:{contentTypeFiltersAriaLabel:"Content type filters"},libraryCard:{alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added"},libraryDock:{selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",cancelTargetAriaLabel:"Cancel — go back to browsing",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter"},libraryFilterPanel:{boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},libraryPreviewPanel:{contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},outlineTree:{maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},treeNode:{expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},contentPlayer:{mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},dialcodePanel:{title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},progressStatus:{unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},splitBuilderShell:{dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},topbar:{draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},reviewCommentModal:{closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},confirmReviewModal:{closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},generateQRModal:{closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},chip:{remove:"Remove"},dropZone:{dropHere:"Drop here"},spinner:{loading:"Loading"},learningPath:{profileBadgeLabel:"Learning Path",pathStructureLabel:"Path Structure",addLevelButton:"Add Level",levelNumberPrefix:"Level {n}",priorAssessmentLabel:"Prior Assessment",priorAssessmentHint:"Always required · not a level",outcomeAssessmentLabel:"Outcome Assessment",outcomeAssessmentHint:"Confirms outcome · not a level",skillCheckBadge:"Skill check",outcomeCheckBadge:"Outcome check",assessmentCourseMeta:"Course · Question set only",addAssessmentSlotButton:"Add {label} — a course with only a question set",requiredSlotBadge:"Required",removeAssessmentSlotButton:"Remove",addCourseToLevelButton:"Add Course to this level",addLevelExamButton:"Add Level Exam — a course with only a question set",levelExamMeta:"Level Exam · Question set only",deletePriorAssessmentConfirm:"Deleting the Prior Assessment removes the score this path's Adaptive skips are based on. Continue?",deleteAssessmentSlotConfirm:"Remove this assessment course from the path?",deleteLevelExamConfirm:"Remove this Level Exam course from the level?",deleteLevelConfirm:'Delete "{name}" and everything in it?',deleteCourseConfirm:"Remove this course from the path?",deleteMultipleConfirm:"Delete {count} selected items from the path?",courseNameUnavailable:"Course details unavailable",notAssessmentCourseToast:`"{name}" isn't an Evaluation Course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",levelExamAlreadyFilledToast:"This level already has a Level Exam course — remove it before adding a different one.",assessmentCheckFailedToast:"Could not verify this course. Please try again.",skillsHeading:"Skills",skillsOutOfScopeWarning:"Out of scope, please re-select: {skills}",skillsUncoveredWarning:"No course covers these yet: {skills}",skillUncoveredPillTitle:"No linked course is tagged with this skill yet",searchSkillsPlaceholder:"Search skills",noSkillsAvailable:"No skills available yet",noMatchingSkills:"No matching skills",noSkillsSelectedYet:"No skills selected",removeSkillAriaLabel:"Remove {skill}",skillScopeFromPriorNote:"Pick which skills — from the Prior Assessment — this level builds. The Library filters courses to these skills.",skillScopeManualNote:"No Prior Assessment yet, so pick from the general skill catalog. The Library filters courses to these skills.",skillsCoveredHeading:"Skills covered",skillsCoveredDescription:"All skills tagged across this path's Prior Assessment, levels, and Outcome Assessment.",noSkillsYet:"No skills yet — add courses to see skills here.",levelCountLabel:"{count} level",levelCountLabelPlural:"{count} levels",courseCountLabel:"{count} course",courseCountLabelPlural:"{count} courses",backToPathButton:"Back to path",backToLevelButton:"Back to {label}",courseDetailsLoading:"Loading course details…",courseDetailsEmpty:"This course has no units yet.",courseDetailsError:"Could not load course details.",courseDetailsCardTitle:"Course details",courseTitleFieldLabel:"Title",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"No description available.",unitsSectionLabel:"Units",unitsSectionDescription:"Units group related content; each content item is tagged with the skills it builds.",unitTopicsFieldLabel:"Topics",contentCountLabel:"{count} content",contentCountLabelPlural:"{count} contents",courseUnitTopicsLabel:"{count} topic",courseUnitTopicsLabelPlural:"{count} topics",verifyingAssessmentCourses:"Verifying assessment courses…",resolveBeforePublishing:"Resolve these before publishing:",resolveBeforeSendingForReview:"Resolve these before sending for review:",assessmentsCardHeading:"Prior & outcome assessments",assessmentsCardDescription:"Add the question-set-only courses that open and close this path.",assessmentNotAddedYet:"Not added yet — pick a question-set-only course from the Library.",viewCourseMenuItem:"View",priorAssessmentExplainerTitle:"Why this can't be skipped",priorAssessmentExplainerBody:"This question set's score is what every level reads to decide a skip — there's nothing to compare against yet, so it always runs in full.",priorAssessmentPurposeLabel:"Sets the skill baseline",outcomeAssessmentExplainerTitle:"Closes the path",outcomeAssessmentExplainerBody:"Passing this question set is what certifies the skill gain for the whole path — its score is what appears on the learner's certificate.",outcomeUnlocksHint:"Unlocks after the last level",assessmentCourseSectionTitle:"Course",assessmentCourseSectionDescription:"A single Evaluation Course — its content can only be Question Sets or Course Assessment, never other content types.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",libraryAddLevelExamCourse:"Add Level Exam course for {level}",policyStrictLabel:"Strict",policyStrictDescription:"Every learner completes every level, in order — regardless of prior assessment score.",policyAdaptiveLabel:"Adaptive",policyAdaptiveDescriptionPre:"A level can be skipped, but only when the learner's score on the Prior Assessment",policyAdaptiveDescriptionPost:" clears its waiver threshold.",policyPriorLearningLabel:"Prior learning",policyPriorLearningDescription:"Skips can also draw on skills the learner already holds — a verified certificate or prior course — not the assessment alone.",selectLevelFirstToast:"Select a level first",selectLevelFromOutlineToast:"Open a level in the path structure to add courses — courses cannot be added to the path itself or under another course.",selectCurriculumFirstToast:"Select a Curriculum for this path before adding courses.",noCurriculumEmptyTitle:"No Curriculum selected",noCurriculumEmptyHint:"Select a Curriculum for this path to browse courses.",noSkillsEmptyTitle:"No skills selected",noSkillsEmptyHint:"Select skills for this level to see matching courses.",itemAlreadyInPathToast:'"{name}" is already in this learning path',addedToLevelSuccess:'Added "{name}" to level',dropOntoLevelError:"Drop onto a level to add a course",dropOntoPathError:"Drop courses onto a level, not directly on the learning path.",priorSlotFilledToast:"The Prior Assessment already has a course — remove it before adding a different one.",outcomeSlotFilledToast:"The Outcome Assessment already has a course — remove it before adding a different one.",levelNeedsMixedContentToast:"This level is first or last in the path — a question-set-only course as its only content will be treated as a Prior/Outcome Assessment. Add another course, or one with more than just question sets.",cannotRemoveLastRegularCourseToast:"This level is first or last in the path — removing this course would leave only the Level Exam course, and it would be treated as a Prior/Outcome Assessment. Add another course first.",coursesRemovedFrameworkChangeToast:"{count} course(s) tagged to a different curriculum were removed from this path.",levelSkillsResetFrameworkChangeToast:"{count} Level(s) had their selected skills cleared — they don't apply to the new curriculum.",priorAssessmentNarrowedScopeToast:"The Prior Assessment narrowed the skill scope — {count} Level(s) now have skills outside it.",coursesCardHeading:"Courses",coursesCardDescription:"Courses a learner completes to clear this level — each course may include its own assessments internally. Drag the handle to reorder, use the menu to remove.",coursesEmptyHint:"Not added yet — pick a course from the Library.",courseMetaLabel:"Course",removeFromLevelMenuItem:"Remove from level"}},hb={contextualEditor:{emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},languageSelector:{ariaLabel:"اختيار اللغة"},collectionEditor:{errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},breadcrumb:{nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},tabBar:{detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},contentEditForm:{moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},titleAppIcon:{selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},unitContentList:{removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},contentRow:{dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},csvUpload:{invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},manageCollaborators:{saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},sparkMetaForm:{shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},appIconField:{requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},appIconPickerModal:{dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},chipGroupField:{addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},dateTimeField:{requiredError:"{field} مطلوب"},dialcodeInputField:{requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},keywordSuggestField:{requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},licenseSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},multiSelectField:{requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},nestedSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},radioField:{requiredError:"{field} مطلوب"},selectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},textField:{requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},assetBrowser:{dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},resourceReorderDialog:{dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},assignPageNumber:{dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},confirmDialog:{title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},publishChecklist:{publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},qualityParamsModal:{reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},unsavedChangesModal:{title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},filterChips:{contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},libraryCard:{alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},libraryDock:{selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",cancelTargetAriaLabel:"إلغاء — العودة إلى التصفح",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},libraryFilterPanel:{boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},libraryPreviewPanel:{contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},outlineTree:{maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},treeNode:{expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},contentPlayer:{mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},dialcodePanel:{title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},progressStatus:{unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},splitBuilderShell:{dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},topbar:{draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},reviewCommentModal:{closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},confirmReviewModal:{closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},generateQRModal:{closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},chip:{remove:"إزالة"},dropZone:{dropHere:"أفلت هنا"},spinner:{loading:"جارٍ التحميل"},learningPath:{profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",addCourseToLevelButton:"إضافة مقرر إلى هذا المستوى",addLevelExamButton:"إضافة اختبار المستوى — مقرر يحتوي على بنك أسئلة فقط",levelExamMeta:"اختبار المستوى · بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelExamConfirm:"هل تريد إزالة مقرر اختبار المستوى هذا من المستوى؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقرر تقييم (Evaluation Course)، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",levelExamAlreadyFilledToast:"يحتوي هذا المستوى بالفعل على مقرر اختبار المستوى — أزِله قبل إضافة مقرر آخر.",assessmentCheckFailedToast:"تعذر التحقق من هذا المقرر. حاول مرة أخرى.",skillsHeading:"المهارات",skillsOutOfScopeWarning:"خارج النطاق، يرجى إعادة الاختيار: {skills}",skillsUncoveredWarning:"لا يغطي أي مقرر هذه المهارات بعد: {skills}",skillUncoveredPillTitle:"لا يوجد مقرر مرتبط موسوم بهذه المهارة بعد",searchSkillsPlaceholder:"البحث عن المهارات",noSkillsAvailable:"لا توجد مهارات متاحة حتى الآن",noMatchingSkills:"لا توجد مهارات مطابقة",noSkillsSelectedYet:"لم يتم تحديد مهارات",removeSkillAriaLabel:"إزالة {skill}",skillScopeFromPriorNote:"اختر المهارات — من التقييم المسبق — التي يبنيها هذا المستوى. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillScopeManualNote:"لا يوجد تقييم مسبق حتى الآن، فاختر من كتالوج المهارات العام. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillsCoveredHeading:"المهارات المشمولة",skillsCoveredDescription:"جميع المهارات الموسومة عبر التقييم المسبق والمستويات وتقييم النتائج لهذا المسار.",noSkillsYet:"لا توجد مهارات بعد — أضف مقررات لرؤية المهارات هنا.",levelCountLabel:"{count} مستوى",levelCountLabelPlural:"{count} مستويات",courseCountLabel:"{count} مقرر",courseCountLabelPlural:"{count} مقررات",backToPathButton:"العودة إلى المسار",backToLevelButton:"العودة إلى {label}",courseDetailsLoading:"جارٍ تحميل تفاصيل المقرر…",courseDetailsEmpty:"لا يحتوي هذا المقرر على وحدات بعد.",courseDetailsError:"تعذر تحميل تفاصيل المقرر.",courseDetailsCardTitle:"تفاصيل المقرر",courseTitleFieldLabel:"العنوان",courseDescriptionFieldLabel:"الوصف",noCourseDescriptionPlaceholder:"لا يتوفر وصف.",unitsSectionLabel:"الوحدات",unitsSectionDescription:"تجمع الوحدات المحتوى المرتبط؛ كل عنصر محتوى موسوم بالمهارات التي يبنيها.",unitTopicsFieldLabel:"المواضيع",contentCountLabel:"{count} عنصر محتوى",contentCountLabelPlural:"{count} عناصر محتوى",courseUnitTopicsLabel:"{count} موضوع",courseUnitTopicsLabelPlural:"{count} مواضيع",verifyingAssessmentCourses:"جارٍ التحقق من مقررات التقييم…",resolveBeforePublishing:"حل هذه النقاط قبل النشر:",resolveBeforeSendingForReview:"حل هذه النقاط قبل الإرسال للمراجعة:",assessmentsCardHeading:"التقييم المسبق وتقييم النتائج",assessmentsCardDescription:"أضف المقررات التي تحتوي على بنك أسئلة فقط والتي تفتح وتغلق هذا المسار.",assessmentNotAddedYet:"لم تتم إضافته بعد — اختر مقررًا يحتوي على بنك أسئلة فقط من المكتبة.",viewCourseMenuItem:"عرض",priorAssessmentExplainerTitle:"لماذا لا يمكن تخطي هذا",priorAssessmentExplainerBody:"درجة بنك الأسئلة هذا هي ما يعتمد عليه كل مستوى لتحديد التخطي — ولا يوجد حتى الآن ما يُقارن به، لذا يُنفَّذ بالكامل دائمًا.",priorAssessmentPurposeLabel:"يحدد خط أساس المهارة",outcomeAssessmentExplainerTitle:"يُغلق المسار",outcomeAssessmentExplainerBody:"النجاح في بنك الأسئلة هذا هو ما يُصادق على اكتساب المهارة للمسار بأكمله — ودرجته هي ما تظهر في شهادة المتعلم.",outcomeUnlocksHint:"يُفتح بعد المستوى الأخير",assessmentCourseSectionTitle:"المقرر",assessmentCourseSectionDescription:"مقرر تقييم واحد (Evaluation Course) — لا يمكن أن يكون محتواه سوى بنوك أسئلة أو تقييم مقرر، وليس أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",libraryAddLevelExamCourse:"إضافة مقرر اختبار المستوى لـ {level}",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج",noCurriculumEmptyHint:"حدد منهجًا لهذا المسار لتصفح المقررات.",noSkillsEmptyTitle:"لم يتم تحديد مهارات",noSkillsEmptyHint:"حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",levelNeedsMixedContentToast:"هذا المستوى هو الأول أو الأخير في المسار — مقرر يحتوي فقط على بنك أسئلة كمحتوى وحيد له سيُعامل كتقييم مسبق/ختامي. أضف مقررًا آخر، أو مقررًا يحتوي على أكثر من بنك الأسئلة فقط.",cannotRemoveLastRegularCourseToast:"هذا المستوى هو الأول أو الأخير في المسار — إزالة هذا المقرر ستترك فقط مقرر اختبار المستوى، وسيتم التعامل معه كتقييم مسبق/ختامي. أضف مقررًا آخر أولاً.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق.",coursesCardHeading:"المقررات",coursesCardDescription:"المقررات التي يُتمّها المتعلم لاجتياز هذا المستوى — قد يتضمن كل مقرر تقييماته الخاصة. اسحب المقبض لإعادة الترتيب، واستخدم القائمة للإزالة.",coursesEmptyHint:"لم تتم الإضافة بعد — اختر مقررًا من المكتبة.",courseMetaLabel:"مقرر",removeFromLevelMenuItem:"إزالة من المستوى"}},pb={contextualEditor:{emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},languageSelector:{ariaLabel:"Sélectionner la langue"},collectionEditor:{errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},breadcrumb:{nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},tabBar:{detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},contentEditForm:{moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},titleAppIcon:{selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},unitContentList:{removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},contentRow:{dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},csvUpload:{invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},manageCollaborators:{saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},sparkMetaForm:{shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},appIconField:{requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},appIconPickerModal:{dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},chipGroupField:{addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},dateTimeField:{requiredError:"{field} est requis"},dialcodeInputField:{requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},keywordSuggestField:{requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},licenseSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},multiSelectField:{requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},nestedSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},radioField:{requiredError:"{field} est requis"},selectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},textField:{requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},assetBrowser:{dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},resourceReorderDialog:{dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},assignPageNumber:{dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},confirmDialog:{title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},publishChecklist:{publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",noButton:"Non",yesButton:"Oui"},qualityParamsModal:{reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},unsavedChangesModal:{title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},filterChips:{contentTypeFiltersAriaLabel:"Filtres par type de contenu"},libraryCard:{alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté"},libraryDock:{selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",cancelTargetAriaLabel:"Annuler — revenir à la navigation",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre"},libraryFilterPanel:{boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},libraryPreviewPanel:{contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},outlineTree:{maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},treeNode:{expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},contentPlayer:{mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},dialcodePanel:{title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},progressStatus:{unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},splitBuilderShell:{dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},topbar:{draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},reviewCommentModal:{closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},confirmReviewModal:{closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},generateQRModal:{closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},chip:{remove:"Supprimer"},dropZone:{dropHere:"Déposer ici"},spinner:{loading:"Chargement"},learningPath:{profileBadgeLabel:"Parcours d'apprentissage",pathStructureLabel:"Structure du parcours",addLevelButton:"Ajouter un niveau",levelNumberPrefix:"Niveau {n}",priorAssessmentLabel:"Évaluation préalable",priorAssessmentHint:"Toujours requise · ne compte pas comme un niveau",outcomeAssessmentLabel:"Évaluation finale",outcomeAssessmentHint:"Confirme le résultat · ne compte pas comme un niveau",skillCheckBadge:"Vérification des compétences",outcomeCheckBadge:"Vérification du résultat",assessmentCourseMeta:"Cours · Questionnaire uniquement",addAssessmentSlotButton:"Ajouter {label} — un cours contenant uniquement un questionnaire",addCourseToLevelButton:"Ajouter un cours à ce niveau",addLevelExamButton:"Ajouter l'examen de niveau — un cours contenant uniquement un questionnaire",levelExamMeta:"Examen de niveau · Questionnaire uniquement",requiredSlotBadge:"Obligatoire",removeAssessmentSlotButton:"Retirer",deletePriorAssessmentConfirm:"Supprimer l'évaluation préalable retire le score sur lequel se basent les sauts adaptatifs de ce parcours. Continuer ?",deleteAssessmentSlotConfirm:"Retirer ce cours d'évaluation du parcours ?",deleteLevelExamConfirm:"Retirer ce cours d'examen de niveau du niveau ?",deleteLevelConfirm:"Supprimer « {name} » et tout son contenu ?",deleteCourseConfirm:"Retirer ce cours du parcours ?",deleteMultipleConfirm:"Supprimer les {count} éléments sélectionnés du parcours ?",courseNameUnavailable:"Détails du cours indisponibles",notAssessmentCourseToast:"« {name} » n'est pas un Cours d'évaluation, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",levelExamAlreadyFilledToast:"Ce niveau a déjà un cours d'examen de niveau — retirez-le avant d'en ajouter un autre.",assessmentCheckFailedToast:"Impossible de vérifier ce cours. Veuillez réessayer.",skillsHeading:"Compétences",skillsOutOfScopeWarning:"Hors du périmètre, veuillez resélectionner : {skills}",skillsUncoveredWarning:"Aucun cours ne couvre encore : {skills}",skillUncoveredPillTitle:"Aucun cours associé n'est encore étiqueté avec cette compétence",searchSkillsPlaceholder:"Rechercher des compétences",noSkillsAvailable:"Aucune compétence disponible pour le moment",noMatchingSkills:"Aucune compétence correspondante",noSkillsSelectedYet:"Aucune compétence sélectionnée",removeSkillAriaLabel:"Supprimer {skill}",skillScopeFromPriorNote:"Choisissez les compétences — issues de l'évaluation préalable — que ce niveau développe. La bibliothèque filtre les cours selon ces compétences.",skillScopeManualNote:"Aucune évaluation préalable pour le moment — choisissez dans le catalogue général des compétences. La bibliothèque filtre les cours selon ces compétences.",skillsCoveredHeading:"Compétences couvertes",skillsCoveredDescription:"Toutes les compétences associées à l'évaluation préalable, aux niveaux et à l'évaluation finale de ce parcours.",noSkillsYet:"Aucune compétence pour le moment — ajoutez des cours pour voir les compétences ici.",levelCountLabel:"{count} niveau",levelCountLabelPlural:"{count} niveaux",courseCountLabel:"{count} cours",courseCountLabelPlural:"{count} cours",backToPathButton:"Retour au parcours",backToLevelButton:"Retour à {label}",courseDetailsLoading:"Chargement des détails du cours…",courseDetailsEmpty:"Ce cours ne contient pas encore d'unités.",courseDetailsError:"Impossible de charger les détails du cours.",courseDetailsCardTitle:"Détails du cours",courseTitleFieldLabel:"Titre",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"Aucune description disponible.",unitsSectionLabel:"Unités",unitsSectionDescription:"Les unités regroupent le contenu associé ; chaque contenu est associé aux compétences qu'il développe.",unitTopicsFieldLabel:"Sujets",contentCountLabel:"{count} contenu",contentCountLabelPlural:"{count} contenus",courseUnitTopicsLabel:"{count} sujet",courseUnitTopicsLabelPlural:"{count} sujets",verifyingAssessmentCourses:"Vérification des cours d'évaluation…",resolveBeforePublishing:"Résolvez les points suivants avant de publier :",resolveBeforeSendingForReview:"Résolvez les points suivants avant d'envoyer pour révision :",assessmentsCardHeading:"Évaluations préalable et finale",assessmentsCardDescription:"Ajoutez les cours composés uniquement d'un questionnaire qui ouvrent et ferment ce parcours.",assessmentNotAddedYet:"Pas encore ajouté — choisissez un cours composé uniquement d'un questionnaire dans la bibliothèque.",viewCourseMenuItem:"Voir",priorAssessmentExplainerTitle:"Pourquoi cela ne peut pas être ignoré",priorAssessmentExplainerBody:"Le score de ce questionnaire est ce que chaque niveau utilise pour décider d'un saut — il n'y a encore rien à comparer, donc il s'exécute toujours en entier.",priorAssessmentPurposeLabel:"Établit la base de compétences",outcomeAssessmentExplainerTitle:"Termine le parcours",outcomeAssessmentExplainerBody:"Réussir ce questionnaire certifie l'acquisition de la compétence pour l'ensemble du parcours — son score est celui qui apparaît sur le certificat de l'apprenant.",outcomeUnlocksHint:"Se débloque après le dernier niveau",assessmentCourseSectionTitle:"Cours",assessmentCourseSectionDescription:"Un seul Cours d'évaluation — son contenu ne peut être que des questionnaires ou une Évaluation de cours, jamais d'autres types de contenu.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",libraryAddLevelExamCourse:"Ajouter le cours d'examen de niveau pour {level}",policyStrictLabel:"Strict",policyStrictDescription:"Chaque apprenant termine chaque niveau, dans l'ordre — quel que soit le score de l'évaluation préalable.",policyAdaptiveLabel:"Adaptatif",policyAdaptiveDescriptionPre:"Un niveau peut être ignoré, mais seulement si le score de l'apprenant à l'Évaluation préalable",policyAdaptiveDescriptionPost:" dépasse le seuil de dispense.",policyPriorLearningLabel:"Acquis antérieurs",policyPriorLearningDescription:"Les sauts peuvent aussi s'appuyer sur des compétences déjà détenues par l'apprenant — un certificat vérifié ou un cours antérieur — pas seulement l'évaluation.",selectLevelFirstToast:"Sélectionnez d'abord un niveau",selectLevelFromOutlineToast:"Ouvrez un niveau dans la structure du parcours pour ajouter des cours — les cours ne peuvent pas être ajoutés au parcours lui-même ni sous un autre cours.",selectCurriculumFirstToast:"Sélectionnez un programme (Curriculum) pour ce parcours avant d'ajouter des cours.",noCurriculumEmptyTitle:"Aucun programme sélectionné",noCurriculumEmptyHint:"Sélectionnez un programme (Curriculum) pour ce parcours afin de parcourir les cours.",noSkillsEmptyTitle:"Aucune compétence sélectionnée",noSkillsEmptyHint:"Sélectionnez des compétences pour ce niveau afin de voir les cours correspondants.",itemAlreadyInPathToast:"« {name} » fait déjà partie de ce parcours d'apprentissage",addedToLevelSuccess:"« {name} » ajouté au niveau",dropOntoLevelError:"Déposez sur un niveau pour ajouter un cours",dropOntoPathError:"Déposez les cours sur un niveau, pas directement sur le parcours d'apprentissage.",priorSlotFilledToast:"L'Évaluation préalable contient déjà un cours — retirez-le avant d'en ajouter un autre.",outcomeSlotFilledToast:"L'Évaluation finale contient déjà un cours — retirez-le avant d'en ajouter un autre.",levelNeedsMixedContentToast:"Ce niveau est premier ou dernier dans le parcours — un cours composé uniquement de bancs de questions comme seul contenu sera traité comme une évaluation préalable/finale. Ajoutez un autre cours, ou un cours contenant plus que des bancs de questions.",cannotRemoveLastRegularCourseToast:"Ce niveau est premier ou dernier dans le parcours — retirer ce cours ne laisserait que le cours d'examen de niveau, qui serait alors traité comme une évaluation préalable/finale. Ajoutez d'abord un autre cours.",coursesRemovedFrameworkChangeToast:"{count} cours associé(s) à un autre curriculum ont été retirés de ce parcours.",levelSkillsResetFrameworkChangeToast:"{count} niveau(x) ont eu leurs compétences sélectionnées effacées — elles ne s'appliquent pas au nouveau curriculum.",priorAssessmentNarrowedScopeToast:"L'évaluation préalable a réduit le périmètre des compétences — {count} niveau(x) ont désormais des compétences hors de ce périmètre.",coursesCardHeading:"Cours",coursesCardDescription:"Cours qu'un apprenant termine pour valider ce niveau — chaque cours peut inclure ses propres évaluations. Faites glisser la poignée pour réorganiser, utilisez le menu pour retirer.",coursesEmptyHint:"Pas encore ajouté — choisissez un cours dans la bibliothèque.",courseMetaLabel:"Cours",removeFromLevelMenuItem:"Retirer du niveau"}},gb={contextualEditor:{emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},languageSelector:{ariaLabel:"Selecionar idioma"},collectionEditor:{errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},breadcrumb:{nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},tabBar:{detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},contentEditForm:{moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},titleAppIcon:{selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},unitContentList:{removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},contentRow:{dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},csvUpload:{invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},manageCollaborators:{saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},sparkMetaForm:{shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},appIconField:{requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},appIconPickerModal:{dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},chipGroupField:{addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},dateTimeField:{requiredError:"{field} é obrigatório"},dialcodeInputField:{requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},keywordSuggestField:{requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},licenseSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},multiSelectField:{requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},nestedSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},radioField:{requiredError:"{field} é obrigatório"},selectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},textField:{requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},assetBrowser:{dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},resourceReorderDialog:{dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},assignPageNumber:{dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},confirmDialog:{title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},publishChecklist:{publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",noButton:"Não",yesButton:"Sim"},qualityParamsModal:{reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},unsavedChangesModal:{title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},filterChips:{contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},libraryCard:{alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado"},libraryDock:{selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",cancelTargetAriaLabel:"Cancelar — voltar à navegação",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente"},libraryFilterPanel:{boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},libraryPreviewPanel:{contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},outlineTree:{maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},treeNode:{expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},contentPlayer:{mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},dialcodePanel:{title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},progressStatus:{unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},splitBuilderShell:{dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},topbar:{draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},reviewCommentModal:{closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},confirmReviewModal:{closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},generateQRModal:{closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},chip:{remove:"Remover"},dropZone:{dropHere:"Solte aqui"},spinner:{loading:"Carregando"},learningPath:{profileBadgeLabel:"Trilha de Aprendizagem",pathStructureLabel:"Estrutura da trilha",addLevelButton:"Adicionar nível",levelNumberPrefix:"Nível {n}",priorAssessmentLabel:"Avaliação prévia",priorAssessmentHint:"Sempre obrigatória · não conta como um nível",outcomeAssessmentLabel:"Avaliação de resultado",outcomeAssessmentHint:"Confirma o resultado · não conta como um nível",skillCheckBadge:"Verificação de habilidade",outcomeCheckBadge:"Verificação de resultado",assessmentCourseMeta:"Curso · Apenas banco de questões",addAssessmentSlotButton:"Adicionar {label} — um curso com apenas um banco de questões",addCourseToLevelButton:"Adicionar curso a este nível",addLevelExamButton:"Adicionar Exame de nível — um curso com apenas um banco de questões",levelExamMeta:"Exame de nível · Apenas banco de questões",requiredSlotBadge:"Obrigatório",removeAssessmentSlotButton:"Remover",deletePriorAssessmentConfirm:"Excluir a Avaliação prévia remove a pontuação usada pelos avanços adaptativos deste percurso. Continuar?",deleteAssessmentSlotConfirm:"Remover este curso de avaliação do percurso?",deleteLevelExamConfirm:"Remover este curso de Exame de nível do nível?",deleteLevelConfirm:'Excluir "{name}" e tudo o que ele contém?',deleteCourseConfirm:"Remover este curso do percurso?",deleteMultipleConfirm:"Excluir os {count} itens selecionados do percurso?",courseNameUnavailable:"Detalhes do curso indisponíveis",notAssessmentCourseToast:'"{name}" não é um Curso de Avaliação, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",levelExamAlreadyFilledToast:"Este nível já tem um curso de Exame de nível — remova-o antes de adicionar outro.",assessmentCheckFailedToast:"Não foi possível verificar este curso. Tente novamente.",skillsHeading:"Habilidades",skillsOutOfScopeWarning:"Fora do escopo, selecione novamente: {skills}",skillsUncoveredWarning:"Nenhum curso cobre ainda: {skills}",skillUncoveredPillTitle:"Nenhum curso vinculado está marcado com esta habilidade ainda",searchSkillsPlaceholder:"Buscar habilidades",noSkillsAvailable:"Nenhuma habilidade disponível ainda",noMatchingSkills:"Nenhuma habilidade correspondente",noSkillsSelectedYet:"Nenhuma habilidade selecionada",removeSkillAriaLabel:"Remover {skill}",skillScopeFromPriorNote:"Escolha quais habilidades — da Avaliação prévia — este nível desenvolve. A biblioteca filtra os cursos por essas habilidades.",skillScopeManualNote:"Ainda não há Avaliação prévia, então escolha no catálogo geral de habilidades. A biblioteca filtra os cursos por essas habilidades.",skillsCoveredHeading:"Habilidades abordadas",skillsCoveredDescription:"Todas as habilidades marcadas na Avaliação prévia, nos níveis e na Avaliação de resultado deste percurso.",noSkillsYet:"Nenhuma habilidade ainda — adicione cursos para ver as habilidades aqui.",levelCountLabel:"{count} nível",levelCountLabelPlural:"{count} níveis",courseCountLabel:"{count} curso",courseCountLabelPlural:"{count} cursos",backToPathButton:"Voltar ao percurso",backToLevelButton:"Voltar a {label}",courseDetailsLoading:"Carregando detalhes do curso…",courseDetailsEmpty:"Este curso ainda não tem unidades.",courseDetailsError:"Não foi possível carregar os detalhes do curso.",courseDetailsCardTitle:"Detalhes do curso",courseTitleFieldLabel:"Título",courseDescriptionFieldLabel:"Descrição",noCourseDescriptionPlaceholder:"Nenhuma descrição disponível.",unitsSectionLabel:"Unidades",unitsSectionDescription:"As unidades agrupam conteúdo relacionado; cada item de conteúdo é marcado com as habilidades que desenvolve.",unitTopicsFieldLabel:"Tópicos",contentCountLabel:"{count} conteúdo",contentCountLabelPlural:"{count} conteúdos",courseUnitTopicsLabel:"{count} tópico",courseUnitTopicsLabelPlural:"{count} tópicos",verifyingAssessmentCourses:"Verificando cursos de avaliação…",resolveBeforePublishing:"Resolva os itens abaixo antes de publicar:",resolveBeforeSendingForReview:"Resolva os itens abaixo antes de enviar para revisão:",assessmentsCardHeading:"Avaliações prévia e de resultado",assessmentsCardDescription:"Adicione os cursos compostos apenas por banco de questões que abrem e encerram este percurso.",assessmentNotAddedYet:"Ainda não adicionado — escolha um curso composto apenas por banco de questões na Biblioteca.",viewCourseMenuItem:"Ver",priorAssessmentExplainerTitle:"Por que isso não pode ser pulado",priorAssessmentExplainerBody:"A pontuação deste banco de questões é o que cada nível usa para decidir um avanço — ainda não há nada para comparar, então ele sempre é executado por completo.",priorAssessmentPurposeLabel:"Define a linha de base de habilidades",outcomeAssessmentExplainerTitle:"Encerra o percurso",outcomeAssessmentExplainerBody:"Passar neste banco de questões certifica o ganho de habilidade de todo o percurso — sua pontuação é o que aparece no certificado do aprendiz.",outcomeUnlocksHint:"Desbloqueia após o último nível",assessmentCourseSectionTitle:"Curso",assessmentCourseSectionDescription:"Um único Curso de Avaliação — seu conteúdo só pode ser Bancos de Questões ou Avaliação de Curso, nunca outros tipos de conteúdo.",libraryOpenLevelToAdd:"Abra um nível para adicionar",libraryAddToLevel:"Adicionar a {level}",libraryAddPriorAssessmentCourse:"Adicionar curso de Avaliação prévia",libraryAddOutcomeAssessmentCourse:"Adicionar curso de Avaliação de resultado",libraryAddLevelExamCourse:"Adicionar curso de Exame de nível para {level}",policyStrictLabel:"Estrita",policyStrictDescription:"Todo aprendiz completa todos os níveis, em ordem — independentemente da pontuação da avaliação prévia.",policyAdaptiveLabel:"Adaptativa",policyAdaptiveDescriptionPre:"Um nível pode ser pulado, mas somente quando a pontuação do aprendiz na Avaliação prévia",policyAdaptiveDescriptionPost:" atinge o limite de dispensa.",policyPriorLearningLabel:"Aprendizagem prévia",policyPriorLearningDescription:"Os avanços também podem se basear em habilidades que o aprendiz já possui — um certificado verificado ou curso anterior — não apenas na avaliação.",selectLevelFirstToast:"Selecione um nível primeiro",selectLevelFromOutlineToast:"Abra um nível na estrutura da trilha para adicionar cursos — cursos não podem ser adicionados à própria trilha nem dentro de outro curso.",selectCurriculumFirstToast:"Selecione um Currículo para esta trilha antes de adicionar cursos.",noCurriculumEmptyTitle:"Nenhum currículo selecionado",noCurriculumEmptyHint:"Selecione um currículo para esta trilha para navegar pelos cursos.",noSkillsEmptyTitle:"Nenhuma habilidade selecionada",noSkillsEmptyHint:"Selecione habilidades para este nível para ver os cursos correspondentes.",itemAlreadyInPathToast:'"{name}" já está nesta trilha de aprendizagem',addedToLevelSuccess:'"{name}" adicionado ao nível',dropOntoLevelError:"Solte sobre um nível para adicionar um curso",dropOntoPathError:"Solte os cursos sobre um nível, não diretamente na trilha de aprendizagem.",priorSlotFilledToast:"A Avaliação prévia já tem um curso — remova-o antes de adicionar outro.",outcomeSlotFilledToast:"A Avaliação final já tem um curso — remova-o antes de adicionar outro.",levelNeedsMixedContentToast:"Este nível é o primeiro ou o último no percurso — um curso composto apenas por bancos de questões como único conteúdo será tratado como uma Avaliação prévia/final. Adicione outro curso, ou um curso com mais do que apenas bancos de questões.",cannotRemoveLastRegularCourseToast:"Este nível é o primeiro ou o último no percurso — remover este curso deixaria apenas o curso de Exame de Nível, que seria tratado como uma Avaliação prévia/final. Adicione outro curso primeiro.",coursesRemovedFrameworkChangeToast:"{count} curso(s) vinculados a outro currículo foram removidos desta trilha.",levelSkillsResetFrameworkChangeToast:"{count} nível(is) tiveram as habilidades selecionadas apagadas — elas não se aplicam ao novo currículo.",priorAssessmentNarrowedScopeToast:"A Avaliação prévia reduziu o escopo de habilidades — {count} nível(is) agora têm habilidades fora dele.",coursesCardHeading:"Cursos",coursesCardDescription:"Cursos que um aprendiz conclui para cumprir este nível — cada curso pode incluir suas próprias avaliações internas. Arraste a alça para reordenar, use o menu para remover.",coursesEmptyHint:"Ainda não adicionado — escolha um curso na Biblioteca.",courseMetaLabel:"Curso",removeFromLevelMenuItem:"Remover do nível"}},mb=["ar"],vb={en:Ti,ar:hb,fr:pb,pt:gb};function $d(e,t){const r={...e};for(const n of Object.keys(t)){const s=e[n],o=t[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)?r[n]=$d(s,o):o!==void 0&&(r[n]=o)}return r}function jd(e){const t=vb[e];return!t||e==="en"?Ti:$d(Ti,t)}function yb(e){return mb.includes(e)}const Ei="app-language",Ai="app-language-change",ki=Is(e=>({lang:"en",labelConfig:jd("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:jd(t)}),localStorage.setItem(Ei,t),document.documentElement.setAttribute("dir",yb(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(Ai,{detail:{lang:t}}))}}));function qd(e,t){return function(){return e.apply(t,arguments)}}const{toString:bb}=Object.prototype,{getPrototypeOf:Pn}=Object,{iterator:Ls,toStringTag:Ud}=Symbol,Wo=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ds=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Wo(r,t))return!0;r=Pn(r)}return!1},Cb=(e,t)=>e!=null&&Ds(e,t)?e[t]:void 0,Ii=(e=>t=>{const r=bb.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ar=e=>(e=e.toLowerCase(),t=>Ii(t)===e),Ro=e=>t=>typeof t===e,{isArray:Jr}=Array,On=Ro("undefined");function xn(e){return e!==null&&!On(e)&&e.constructor!==null&&!On(e.constructor)&&Bt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zd=ar("ArrayBuffer");function Sb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zd(e.buffer),t}const wb=Ro("string"),Bt=Ro("function"),Vd=Ro("number"),Fn=e=>e!==null&&typeof e=="object",_b=e=>e===!0||e===!1,Go=e=>{if(!Fn(e))return!1;const t=Pn(e);return(t===null||t===Object.prototype||Pn(t)===null)&&!Ds(e,Ud)&&!Ds(e,Ls)},Tb=e=>{if(!Fn(e)||xn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Eb=ar("Date"),Ab=ar("File"),kb=e=>!!(e&&typeof e.uri<"u"),Ib=e=>e&&typeof e.getParts<"u",Lb=ar("Blob"),Db=ar("FileList"),Nb=e=>Fn(e)&&Bt(e.pipe);function Pb(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Hd=Pb(),Qd=typeof Hd.FormData<"u"?Hd.FormData:void 0,Ob=e=>{if(!e)return!1;if(Qd&&e instanceof Qd)return!0;const t=Pn(e);if(!t||t===Object.prototype||!Bt(e.append))return!1;const r=Ii(e);return r==="formdata"||r==="object"&&Bt(e.toString)&&e.toString()==="[object FormData]"},xb=ar("URLSearchParams"),[Fb,Mb,Bb,$b]=["ReadableStream","Request","Response","Headers"].map(ar),jb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ns(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),Jr(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(xn(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}function Wd(e,t){if(xn(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const en=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Rd=e=>!On(e)&&e!==en;function Li(...e){const{caseless:t,skipUndefined:r}=Rd(this)&&this||{},n={},s=(o,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const i=t&&typeof a=="string"&&Wd(n,a)||a,c=Wo(n,i)?n[i]:void 0;Go(c)&&Go(o)?n[i]=Li(c,o):Go(o)?n[i]=Li({},o):Jr(o)?n[i]=o.slice():(!r||!On(o))&&(n[i]=o)};for(let o=0,a=e.length;o<a;o++){const i=e[o];if(!i||xn(i)||(Ns(i,s),typeof i!="object"||Jr(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let d=0;d<c.length;d++){const u=c[d];Zb.call(i,u)&&s(i[u],u)}}return n}const qb=(e,t,r,{allOwnKeys:n}={})=>(Ns(t,(s,o)=>{r&&Bt(s)?Object.defineProperty(e,o,{__proto__:null,value:qd(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Ub=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),zb=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},Vb=(e,t,r,n)=>{let s,o,a;const i={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!n||n(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&Pn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Hb=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Qb=e=>{if(!e)return null;if(Jr(e))return e;let t=e.length;if(!Vd(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Wb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Pn(Uint8Array)),Rb=(e,t)=>{const n=(e&&e[Ls]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Gb=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Kb=ar("HTMLFormElement"),Yb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:Zb}=Object.prototype,Xb=ar("RegExp"),Gd=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Ns(r,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(n[o]=a||s)}),Object.defineProperties(e,n)},Jb=e=>{Gd(e,(t,r)=>{if(Bt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Bt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},eC=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return Jr(e)?n(e):n(String(e).split(t)),r},tC=()=>{},rC=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function nC(e){return!!(e&&Bt(e.append)&&e[Ud]==="FormData"&&e[Ls])}const sC=e=>{const t=new WeakSet,r=n=>{if(Fn(n)){if(t.has(n))return;if(xn(n))return n;if(!("toJSON"in n)){t.add(n);const s=Jr(n)?[]:{};return Ns(n,(o,a)=>{const i=r(o);!On(i)&&(s[a]=i)}),t.delete(n),s}}return n};return r(e)},oC=ar("AsyncFunction"),aC=e=>e&&(Fn(e)||Bt(e))&&Bt(e.then)&&Bt(e.catch),Kd=((e,t)=>e?setImmediate:t?((r,n)=>(en.addEventListener("message",({source:s,data:o})=>{s===en&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),en.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Bt(en.postMessage)),iC=typeof queueMicrotask<"u"?queueMicrotask.bind(en):typeof process<"u"&&process.nextTick||Kd,Yd=e=>e!=null&&Bt(e[Ls]),P={isArray:Jr,isArrayBuffer:zd,isBuffer:xn,isFormData:Ob,isArrayBufferView:Sb,isString:wb,isNumber:Vd,isBoolean:_b,isObject:Fn,isPlainObject:Go,isEmptyObject:Tb,isReadableStream:Fb,isRequest:Mb,isResponse:Bb,isHeaders:$b,isUndefined:On,isDate:Eb,isFile:Ab,isReactNativeBlob:kb,isReactNative:Ib,isBlob:Lb,isRegExp:Xb,isFunction:Bt,isStream:Nb,isURLSearchParams:xb,isTypedArray:Wb,isFileList:Db,forEach:Ns,merge:Li,extend:qb,trim:jb,stripBOM:Ub,inherits:zb,toFlatObject:Vb,kindOf:Ii,kindOfTest:ar,endsWith:Hb,toArray:Qb,forEachEntry:Rb,matchAll:Gb,isHTMLForm:Kb,hasOwnProperty:Wo,hasOwnProp:Wo,hasOwnInPrototypeChain:Ds,getSafeProp:Cb,reduceDescriptors:Gd,freezeMethods:Jb,toObjectSet:eC,toCamelCase:Yb,noop:tC,toFiniteNumber:rC,findKey:Wd,global:en,isContextDefined:Rd,isSpecCompliantForm:nC,toJSONObject:sC,isAsyncFn:oC,isThenable:aC,setImmediate:Kd,asap:iC,isIterable:Yd,isSafeIterable:e=>e!=null&&Ds(e,Ls)&&Yd(e)},lC=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),cC=e=>{const t={};let r,n,s;return e&&e.split(`
529
- `).forEach(function(a){s=a.indexOf(":"),r=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!r||t[r]&&lC[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function dC(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const uC=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),fC=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Di(e,t){return P.isArray(e)?e.map(r=>Di(r,t)):dC(String(e).replace(t,""))}const hC=e=>Di(e,uC),pC=e=>Di(e,fC);function Zd(e){const t=Object.create(null);return P.forEach(e.toJSON(),(r,n)=>{t[n]=pC(r)}),t}const Xd=Symbol("internals");function Ps(e){return e&&String(e).trim().toLowerCase()}function Ko(e){return e===!1||e==null?e:P.isArray(e)?e.map(Ko):hC(String(e))}function gC(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const mC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ni(e,t,r,n,s){if(P.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!P.isString(t)){if(P.isString(n))return t.indexOf(n)!==-1;if(P.isRegExp(n))return n.test(t)}}function vC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function yC(e,t){const r=P.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,o,a){return this[n].call(this,t,s,o,a)},configurable:!0})})}let _t=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(i,c,d){const u=Ps(c);if(!u)return;const f=P.findKey(s,u);(!f||s[f]===void 0||d===!0||d===void 0&&s[f]!==!1)&&(s[f||c]=Ko(i))}const a=(i,c)=>P.forEach(i,(d,u)=>o(d,u,c));if(P.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(P.isString(t)&&(t=t.trim())&&!mC(t))a(cC(t),r);else if(P.isObject(t)&&P.isSafeIterable(t)){let i=Object.create(null),c,d;for(const u of t){if(!P.isArray(u))throw new TypeError("Object iterator must return a key-value pair");d=u[0],P.hasOwnProp(i,d)?(c=i[d],i[d]=P.isArray(c)?[...c,u[1]]:[c,u[1]]):i[d]=u[1]}a(i,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=Ps(t),t){const n=P.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return gC(s);if(P.isFunction(r))return r.call(this,s,n);if(P.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ps(t),t){const n=P.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Ni(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(a){if(a=Ps(a),a){const i=P.findKey(n,a);i&&(!r||Ni(n,n[i],i,r))&&(delete n[i],s=!0)}}return P.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||Ni(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return P.forEach(this,(s,o)=>{const a=P.findKey(n,o);if(a){r[a]=Ko(s),delete r[o];return}const i=t?vC(o):String(o).trim();i!==o&&delete r[o],r[i]=Ko(s),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return P.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&P.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
530
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Xd]=this[Xd]={accessors:{}}).accessors,s=this.prototype;function o(a){const i=Ps(a);n[i]||(yC(s,a),n[i]=!0)}return P.isArray(t)?t.forEach(o):o(t),this}};_t.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(_t.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),P.freezeMethods(_t);const bC="[REDACTED ****]";function CC(e){if(P.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(P.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function SC(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],s=o=>{if(o===null||typeof o!="object"||P.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof _t&&(o=o.toJSON()),n.push(o);let a;if(P.isArray(o))a=[],o.forEach((i,c)=>{const d=s(i);P.isUndefined(d)||(a[c]=d)});else{if(!P.isPlainObject(o)&&CC(o))return n.pop(),o;a=Object.create(null);for(const[i,c]of Object.entries(o)){const d=r.has(i.toLowerCase())?bC:s(c);P.isUndefined(d)||(a[i]=d)}}return n.pop(),a};return s(e)}let re=class mg extends Error{static from(t,r,n,s,o,a){const i=new mg(t.message,r||t.code,n,s,o);return i.cause=t,i.name=t.name,t.status!=null&&i.status==null&&(i.status=t.status),a&&Object.assign(i,a),i}constructor(t,r,n,s,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&P.hasOwnProp(t,"redact")?t.redact:void 0,n=P.isArray(r)&&r.length>0?SC(t,r):P.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};re.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",re.ERR_BAD_OPTION="ERR_BAD_OPTION",re.ECONNABORTED="ECONNABORTED",re.ETIMEDOUT="ETIMEDOUT",re.ECONNREFUSED="ECONNREFUSED",re.ERR_NETWORK="ERR_NETWORK",re.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",re.ERR_DEPRECATED="ERR_DEPRECATED",re.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",re.ERR_BAD_REQUEST="ERR_BAD_REQUEST",re.ERR_CANCELED="ERR_CANCELED",re.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",re.ERR_INVALID_URL="ERR_INVALID_URL",re.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const wC=null,Jd=100;function Pi(e){return P.isPlainObject(e)||P.isArray(e)}function eu(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function Oi(e,t,r){return e?e.concat(t).map(function(s,o){return s=eu(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function _C(e){return P.isArray(e)&&!e.some(Pi)}const TC=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function Yo(e,t,r){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=P.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,S){return!P.isUndefined(S[b])});const n=r.metaTokens,s=r.visitor||C,o=r.dots,a=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?Jd:r.maxDepth,d=i&&P.isSpecCompliantForm(t),u=[];if(!P.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(P.isDate(y))return y.toISOString();if(P.isBoolean(y))return y.toString();if(!d&&P.isBlob(y))throw new re("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(y)||P.isTypedArray(y)?d&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function g(y){if(y>c)throw new re("Object is too deeply nested ("+y+" levels). Max depth: "+c,re.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(y,b){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(T,E){if(!P.isObject(E))return E;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(E),g(b+S.length-1),E})}function C(y,b,S){let w=y;if(P.isReactNative(t)&&P.isReactNativeBlob(y))return t.append(Oi(S,b,o),f(y)),!1;if(y&&!S&&typeof y=="object"){if(P.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=m(y,1);else if(P.isArray(y)&&_C(y)||(P.isFileList(y)||P.endsWith(b,"[]"))&&(w=P.toArray(y)))return b=eu(b),w.forEach(function(E,N){!(P.isUndefined(E)||E===null)&&t.append(a===!0?Oi([b],N,o):a===null?b:b+"[]",f(E))}),!1}return Pi(y)?!0:(t.append(Oi(S,b,o),f(y)),!1)}const h=Object.assign(TC,{defaultVisitor:C,convertValue:f,isVisitable:Pi});function v(y,b,S=0){if(!P.isUndefined(y)){if(g(S),u.indexOf(y)!==-1)throw new Error("Circular reference detected in "+b.join("."));u.push(y),P.forEach(y,function(T,E){(!(P.isUndefined(T)||T===null)&&s.call(t,T,P.isString(E)?E.trim():E,b,h))===!0&&v(T,b?b.concat(E):[E],S+1)}),u.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return v(e),t}function tu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function xi(e,t){this._pairs=[],e&&Yo(e,this,t)}const ru=xi.prototype;ru.append=function(t,r){this._pairs.push([t,r])},ru.toString=function(t){const r=t?function(n){return t.call(this,n,tu)}:tu;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function EC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nu(e,t,r){if(!t)return e;const n=P.isFunction(r)?{serialize:r}:r,s=P.getSafeProp(n,"encode")||EC,o=P.getSafeProp(n,"serialize");let a;if(o?a=o(t,n):a=P.isURLSearchParams(t)?t.toString():new xi(t,n).toString(s),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class su{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Fi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},AC={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:xi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Mi=typeof window<"u"&&typeof document<"u",Bi=typeof navigator=="object"&&navigator||void 0,kC=Mi&&(!Bi||["ReactNative","NativeScript","NS"].indexOf(Bi.product)<0),IC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",LC=Mi&&window.location.href||"http://localhost",bt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Mi,hasStandardBrowserEnv:kC,hasStandardBrowserWebWorkerEnv:IC,navigator:Bi,origin:LC},Symbol.toStringTag,{value:"Module"})),...AC};function DC(e,t){return Yo(e,new bt.classes.URLSearchParams,{visitor:function(r,n,s,o){return bt.isNode&&P.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const ou=Jd;function au(e){if(e>ou)throw new re("FormData field is too deeply nested ("+e+" levels). Max depth: "+ou,re.ERR_FORM_DATA_DEPTH_EXCEEDED)}function NC(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)au(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function PC(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function iu(e){function t(r,n,s,o){au(o);let a=r[o++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=o>=r.length;return a=!a&&P.isArray(s)?s.length:a,c?(P.hasOwnProp(s,a)?s[a]=P.isArray(s[a])?s[a].concat(n):[s[a],n]:s[a]=n,!i):((!P.hasOwnProp(s,a)||!P.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],o)&&P.isArray(s[a])&&(s[a]=PC(s[a])),!i)}if(P.isFormData(e)&&P.isFunction(e.entries)){const r={};return P.forEachEntry(e,(n,s)=>{t(NC(n),s,r,0)}),r}return null}const Mn=(e,t)=>e!=null&&P.hasOwnProp(e,t)?e[t]:void 0;function OC(e,t,r){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Os={transitional:Fi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=P.isObject(t);if(o&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return s?JSON.stringify(iu(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t)||P.isReadableStream(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=Mn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return DC(t,c).toString();if((i=P.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=Mn(this,"env"),u=d&&d.FormData;return Yo(i?{"files[]":t}:t,u&&new u,c)}}return o||s?(r.setContentType("application/json",!1),OC(t)):t}],transformResponse:[function(t){const r=Mn(this,"transitional")||Os.transitional,n=r&&r.forcedJSONParsing,s=Mn(this,"responseType"),o=s==="json";if(P.isResponse(t)||P.isReadableStream(t))return t;if(t&&P.isString(t)&&(n&&!s||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Mn(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?re.from(c,re.ERR_BAD_RESPONSE,this,null,Mn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch","query"],e=>{Os.headers[e]={}});function $i(e,t){const r=this||Os,n=t||r,s=_t.from(n.headers);let o=n.data;return P.forEach(e,function(i){o=i.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function lu(e){return!!(e&&e.__CANCEL__)}let xs=class extends re{constructor(t,r,n){super(t??"canceled",re.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function cu(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new re("Request failed with status code "+r.status,r.status>=400&&r.status<500?re.ERR_BAD_REQUEST:re.ERR_BAD_RESPONSE,r.config,r.request,r))}function xC(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function FC(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[o];a||(a=d),r[s]=c,n[s]=d;let f=o,g=0;for(;f!==s;)g+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-a<t)return;const m=u&&d-u;return m?Math.round(g*1e3/m):void 0}}function MC(e,t){let r=0,n=1e3/t,s,o;const a=(d,u=Date.now())=>{r=u,s=null,o&&(clearTimeout(o),o=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=n?a(d,u):(s=d,o||(o=setTimeout(()=>{o=null,a(s)},n-f)))},()=>s&&a(s)]}const Zo=(e,t,r=3)=>{let n=0;const s=FC(50,250);return MC(o=>{if(!o||typeof o.loaded!="number")return;const a=o.loaded,i=o.lengthComputable?o.total:void 0,c=i!=null?Math.min(a,i):a,d=Math.max(0,c-n),u=s(d);n=Math.max(n,c);const f={loaded:c,total:i,progress:i?c/i:void 0,bytes:d,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(f)},r)},du=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},uu=e=>(...t)=>P.asap(()=>e(...t)),BC=bt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,bt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,$C=bt.hasStandardBrowserEnv?{write(e,t,r,n,s,o,a){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];P.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),P.isString(n)&&i.push(`path=${n}`),P.isString(s)&&i.push(`domain=${s}`),o===!0&&i.push("secure"),P.isString(a)&&i.push(`SameSite=${a}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function jC(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const UC=/^https?:(?!\/\/)/i,zC=/[\t\n\r]/g;function VC(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function HC(e){return VC(e).replace(zC,"")}function fu(e,t){if(typeof e=="string"&&UC.test(HC(e)))throw new re('Invalid URL: missing "//" after protocol',re.ERR_INVALID_URL,t)}function hu(e,t,r,n){fu(t,n);let s=!jC(t);return e&&(s||r===!1)?(fu(e,n),qC(e,t)):t}const pu=e=>e instanceof _t?{...e}:e;function tn(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(u,f,g,m){return P.isPlainObject(u)&&P.isPlainObject(f)?P.merge.call({caseless:m},u,f):P.isPlainObject(f)?P.merge({},f):P.isArray(f)?f.slice():f}function s(u,f,g,m){if(P.isUndefined(f)){if(!P.isUndefined(u))return n(void 0,u,g,m)}else return n(u,f,g,m)}function o(u,f){if(!P.isUndefined(f))return n(void 0,f)}function a(u,f){if(P.isUndefined(f)){if(!P.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function i(u){const f=P.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!P.isUndefined(f))if(P.isPlainObject(f)){if(P.hasOwnProp(f,u))return f[u]}else return;const g=P.hasOwnProp(e,"transitional")?e.transitional:void 0;if(P.isPlainObject(g)&&P.hasOwnProp(g,u))return g[u]}function c(u,f,g){if(P.hasOwnProp(t,g))return n(u,f);if(P.hasOwnProp(e,g))return n(void 0,u)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:c,headers:(u,f,g)=>s(pu(u),pu(f),g,!0)};return P.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const g=P.hasOwnProp(d,f)?d[f]:s,m=P.hasOwnProp(e,f)?e[f]:void 0,C=P.hasOwnProp(t,f)?t[f]:void 0,h=g(m,C,f);P.isUndefined(h)&&g!==c||(r[f]=h)}),P.hasOwnProp(t,"validateStatus")&&P.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(P.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const QC=["content-type","content-length"];function WC(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{QC.includes(n.toLowerCase())&&e.set(n,s)})}const RC=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function gu(e){const t=tn({},e),r=g=>P.hasOwnProp(t,g)?t[g]:void 0,n=r("data");let s=r("withXSRFToken");const o=r("xsrfHeaderName"),a=r("xsrfCookieName");let i=r("headers");const c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),f=r("url");if(t.headers=i=_t.from(i),t.url=nu(hu(d,f,u,t),r("params"),r("paramsSerializer")),c){const g=P.getSafeProp(c,"username")||"",m=P.getSafeProp(c,"password")||"";i.set("Authorization","Basic "+btoa(g+":"+(m?RC(m):"")))}if(P.isFormData(n)&&(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv||P.isReactNative(n)?i.setContentType(void 0):P.isFunction(n.getHeaders)&&WC(i,n.getHeaders(),r("formDataHeaderPolicy"))),bt.hasStandardBrowserEnv&&(P.isFunction(s)&&(s=s(t)),s===!0||s==null&&BC(t.url))){const m=o&&a&&$C.read(a);m&&i.set(o,m)}return t}const GC=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=gu(e);let o=s.data;const a=_t.from(s.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:d}=s,u,f,g,m,C;function h(){m&&m(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=_t.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),T={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};cu(function(N){r(N),h()},function(N){n(N),h()},T),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(y)},v.onabort=function(){v&&(n(new re("Request aborted",re.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(w){const T=w&&w.message?w.message:"Network Error",E=new re(T,re.ERR_NETWORK,e,v);E.event=w||null,n(E),h(),v=null},v.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const T=s.transitional||Fi;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),n(new re(w,T.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,e,v)),h(),v=null},o===void 0&&a.setContentType(null),"setRequestHeader"in v&&P.forEach(Zd(a),function(w,T){v.setRequestHeader(T,w)}),P.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),i&&i!=="json"&&(v.responseType=s.responseType),d&&([g,C]=Zo(d,!0),v.addEventListener("progress",g)),c&&v.upload&&([f,m]=Zo(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(u=S=>{v&&(n(!S||S.type?new xs(null,e,v):S),v.abort(),h(),v=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const b=xC(s.url);if(b&&!bt.protocols.includes(b)){n(new re("Unsupported protocol "+b+":",re.ERR_BAD_REQUEST,e));return}v.send(o||null)})},KC=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(c){if(!n){n=!0,a();const d=c instanceof Error?c:this.reason;r.abort(d instanceof re?d:new xs(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,s(new re(`timeout of ${t}ms exceeded`,re.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:i}=r;return i.unsubscribe=()=>P.asap(a),i},YC=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},ZC=async function*(e,t){for await(const r of XC(e))yield*YC(r,t)},XC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},mu=(e,t,r,n)=>{const s=ZC(e,t);let o=0,a,i=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await s.next();if(d){i(),c.close();return}let f=u.byteLength;if(r){let g=o+=f;r(g)}c.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(c){return i(c),s.return()}},{highWaterMark:2})},Xo=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,JC=(e,t,r)=>t+2<r&&Xo(e.charCodeAt(t+1))&&Xo(e.charCodeAt(t+2));function eS(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let a=n.length;const i=n.length;for(let m=0;m<i;m++)if(n.charCodeAt(m)===37&&m+2<i){const C=n.charCodeAt(m+1),h=n.charCodeAt(m+2);Xo(C)&&Xo(h)&&(a-=2,m+=2)}let c=0,d=i-1;const u=m=>m>=2&&n.charCodeAt(m-2)===37&&n.charCodeAt(m-1)===51&&(n.charCodeAt(m)===68||n.charCodeAt(m)===100);d>=0&&(n.charCodeAt(d)===61?(c++,d--):u(d)&&(c++,d-=3)),c===1&&d>=0&&(n.charCodeAt(d)===61||u(d))&&c++;const g=Math.floor(a/4)*3-(c||0);return g>0?g:0}let o=0;for(let a=0,i=n.length;a<i;a++){const c=n.charCodeAt(a);if(c===37&&JC(n,a,i))o+=1,a+=2;else if(c<128)o+=1;else if(c<2048)o+=2;else if(c>=55296&&c<=56319&&a+1<i){const d=n.charCodeAt(a+1);d>=56320&&d<=57343?(o+=4,a++):o+=3}else o+=3}return o}const ji="1.18.0",vu=64*1024,{isFunction:Jo}=P,tS=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),yu=e=>{if(!P.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},bu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},rS=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},nS=e=>{const t=P.global!==void 0&&P.global!==null?P.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=P.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:o,Response:a}=e,i=s?Jo(s):typeof fetch=="function",c=Jo(o),d=Jo(a);if(!i)return!1;const u=i&&Jo(r),f=i&&(typeof n=="function"?(y=>b=>y.encode(b))(new n):async y=>new Uint8Array(await new o(y).arrayBuffer())),g=c&&u&&bu(()=>{let y=!1;const b=new o(bt.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),y&&!S}),m=d&&u&&bu(()=>P.isReadableStream(new a("").body)),C={stream:m&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!C[y]&&(C[y]=(b,S)=>{let w=b&&b[y];if(w)return w.call(b);throw new re(`Response type '${y}' is not supported`,re.ERR_NOT_SUPPORT,S)})});const h=async y=>{if(y==null)return 0;if(P.isBlob(y))return y.size;if(P.isSpecCompliantForm(y))return(await new o(bt.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(P.isArrayBufferView(y)||P.isArrayBuffer(y))return y.byteLength;if(P.isURLSearchParams(y)&&(y=y+""),P.isString(y))return(await f(y)).byteLength},v=async(y,b)=>{const S=P.toFiniteNumber(y.getContentLength());return S??h(b)};return async y=>{let{url:b,method:S,data:w,signal:T,cancelToken:E,timeout:N,onDownloadProgress:I,onUploadProgress:O,responseType:B,headers:k,withCredentials:F="same-origin",fetchOptions:M,maxContentLength:x,maxBodyLength:z}=gu(y);const ne=P.isNumber(x)&&x>-1,R=P.isNumber(z)&&z>-1,ge=$=>P.hasOwnProp(y,$)?y[$]:void 0;let me=s||fetch;B=B?(B+"").toLowerCase():"text";let K=KC([T,E&&E.toAbortSignal()],N),ce=null;const te=K&&K.unsubscribe&&(()=>{K.unsubscribe()});let we,ve=null;const q=()=>new re("Request body larger than maxBodyLength limit",re.ERR_BAD_REQUEST,y,ce);try{let $;const U=ge("auth");if(U){const Q=P.getSafeProp(U,"username")||"",be=P.getSafeProp(U,"password")||"";$={username:Q,password:be}}if(rS(b)){const Q=new URL(b,bt.origin);if(!$&&(Q.username||Q.password)){const be=yu(Q.username),He=yu(Q.password);$={username:be,password:He}}(Q.username||Q.password)&&(Q.username="",Q.password="",b=Q.href)}if($&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa(tS(($.username||"")+":"+($.password||""))))),ne&&typeof b=="string"&&b.startsWith("data:")&&eS(b)>x)throw new re("maxContentLength size of "+x+" exceeded",re.ERR_BAD_RESPONSE,y,ce);if(R&&S!=="get"&&S!=="head"){const Q=await h(w);if(typeof Q=="number"&&isFinite(Q)&&(we=Q,Q>z))throw q()}const oe=R&&(P.isReadableStream(w)||P.isStream(w)),ie=(Q,be,He)=>mu(Q,vu,ot=>{if(R&&ot>z)throw ve=q();be&&be(ot)},He);if(g&&S!=="get"&&S!=="head"&&(O||oe)){if(we=we??await v(k,w),we!==0||oe){let Q=new o(b,{method:"POST",body:w,duplex:"half"}),be;if(P.isFormData(w)&&(be=Q.headers.get("content-type"))&&k.setContentType(be),Q.body){const[He,ot]=O&&du(we,Zo(uu(O)))||[];w=ie(Q.body,He,ot)}}}else if(oe&&!c&&u&&S!=="get"&&S!=="head")w=ie(w);else if(oe&&c&&!g&&S!=="get"&&S!=="head")throw new re("Stream request bodies are not supported by the current fetch implementation",re.ERR_NOT_SUPPORT,y,ce);P.isString(F)||(F=F?"include":"omit");const Se=c&&"credentials"in o.prototype;if(P.isFormData(w)){const Q=k.getContentType();Q&&/^multipart\/form-data/i.test(Q)&&!/boundary=/i.test(Q)&&k.delete("content-type")}k.set("User-Agent","axios/"+ji,!1);const fe={...M,signal:K,method:S.toUpperCase(),headers:Zd(k.normalize()),body:w,duplex:"half",credentials:Se?F:void 0};ce=c&&new o(b,fe);let ye=await(c?me(ce,M):me(b,fe));const Le=_t.from(ye.headers);if(ne){const Q=P.toFiniteNumber(Le.getContentLength());if(Q!=null&&Q>x)throw new re("maxContentLength size of "+x+" exceeded",re.ERR_BAD_RESPONSE,y,ce)}const J=m&&(B==="stream"||B==="response");if(m&&ye.body&&(I||ne||J&&te)){const Q={};["status","statusText","headers"].forEach(at=>{Q[at]=ye[at]});const be=P.toFiniteNumber(Le.getContentLength()),[He,ot]=I&&du(be,Zo(uu(I),!0))||[];let Qe=0;const Ke=at=>{if(ne&&(Qe=at,Qe>x))throw new re("maxContentLength size of "+x+" exceeded",re.ERR_BAD_RESPONSE,y,ce);He&&He(at)};ye=new a(mu(ye.body,vu,Ke,()=>{ot&&ot(),te&&te()}),Q)}B=B||"text";let he=await C[P.findKey(C,B)||"text"](ye,y);if(ne&&!m&&!J){let Q;if(he!=null&&(typeof he.byteLength=="number"?Q=he.byteLength:typeof he.size=="number"?Q=he.size:typeof he=="string"&&(Q=typeof n=="function"?new n().encode(he).byteLength:he.length)),typeof Q=="number"&&Q>x)throw new re("maxContentLength size of "+x+" exceeded",re.ERR_BAD_RESPONSE,y,ce)}return!J&&te&&te(),await new Promise((Q,be)=>{cu(Q,be,{data:he,headers:_t.from(ye.headers),status:ye.status,statusText:ye.statusText,config:y,request:ce})})}catch($){if(te&&te(),K&&K.aborted&&K.reason instanceof re){const U=K.reason;throw U.config=y,ce&&(U.request=ce),$!==U&&(U.cause=$),U}throw ve?(ce&&!ve.request&&(ve.request=ce),ve):$ instanceof re?(ce&&!$.request&&($.request=ce),$):$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new re("Network Error",re.ERR_NETWORK,y,ce,$&&$.response),{cause:$.cause||$}):re.from($,$&&$.code,y,ce,$&&$.response)}}},sS=new Map,Cu=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let a=o.length,i=a,c,d,u=sS;for(;i--;)c=o[i],d=u.get(c),d===void 0&&u.set(c,d=i?new Map:nS(t)),u=d;return d};Cu();const qi={http:wC,xhr:GC,fetch:{get:Cu}};P.forEach(qi,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Su=e=>`- ${e}`,oS=e=>P.isFunction(e)||e===null||e===!1;function aS(e,t){e=P.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let a=0;a<r;a++){n=e[a];let i;if(s=n,!oS(n)&&(s=qi[(i=String(n)).toLowerCase()],s===void 0))throw new re(`Unknown adapter '${i}'`);if(s&&(P.isFunction(s)||(s=s.get(t))))break;o[i||"#"+a]=s}if(!s){const a=Object.entries(o).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=r?a.length>1?`since :
531
- `+a.map(Su).join(`
532
- `):" "+Su(a[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s}const wu={getAdapter:aS,adapters:qi};function Ui(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xs(null,e)}function _u(e){return Ui(e),e.headers=_t.from(e.headers),e.data=$i.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wu.getAdapter(e.adapter||Os.adapter,e)(e).then(function(n){Ui(e),e.response=n;try{n.data=$i.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=_t.from(n.headers),n},function(n){if(!lu(n)&&(Ui(e),n&&n.response)){e.response=n.response;try{n.response.data=$i.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=_t.from(n.response.headers)}return Promise.reject(n)})}const ea={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ea[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Tu={};ea.transitional=function(t,r,n){function s(o,a){return"[Axios v"+ji+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,i)=>{if(t===!1)throw new re(s(a," has been removed"+(r?" in "+r:"")),re.ERR_DEPRECATED);return r&&!Tu[a]&&(Tu[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,i):!0}},ea.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function iS(e,t,r){if(typeof e!="object")throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const i=e[o],c=i===void 0||a(i,o,e);if(c!==!0)throw new re("option "+o+" must be "+c,re.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new re("Unknown option "+o,re.ERR_BAD_OPTION)}}const ta={assertOptions:iS,validators:ea},Tt=ta.validators;let rn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new su,response:new su}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=(()=>{if(!s.stack)return"";const a=s.stack.indexOf(`
533
- `);return a===-1?"":s.stack.slice(a+1)})();try{if(!n.stack)n.stack=o;else if(o){const a=o.indexOf(`
534
- `),i=a===-1?-1:o.indexOf(`
535
- `,a+1),c=i===-1?"":o.slice(i+1);String(n.stack).endsWith(c)||(n.stack+=`
536
- `+o)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=tn(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&ta.assertOptions(n,{silentJSONParsing:Tt.transitional(Tt.boolean),forcedJSONParsing:Tt.transitional(Tt.boolean),clarifyTimeoutError:Tt.transitional(Tt.boolean),legacyInterceptorReqResOrdering:Tt.transitional(Tt.boolean),advertiseZstdAcceptEncoding:Tt.transitional(Tt.boolean),validateStatusUndefinedResolves:Tt.transitional(Tt.boolean)},!1),s!=null&&(P.isFunction(s)?r.paramsSerializer={serialize:s}:ta.assertOptions(s,{encode:Tt.function,serialize:Tt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ta.assertOptions(r,{baseUrl:Tt.spelling("baseURL"),withXsrfToken:Tt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&P.merge(o.common,o[r.method]);o&&P.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete o[C]}),r.headers=_t.concat(a,o);const i=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(r)===!1)return;c=c&&h.synchronous;const v=r.transitional||Fi;v&&v.legacyInterceptorReqResOrdering?i.unshift(h.fulfilled,h.rejected):i.push(h.fulfilled,h.rejected)});const d=[];this.interceptors.response.forEach(function(h){d.push(h.fulfilled,h.rejected)});let u,f=0,g;if(!c){const C=[_u.bind(this),void 0];for(C.unshift(...i),C.push(...d),g=C.length,u=Promise.resolve(r);f<g;)u=u.then(C[f++],C[f++]);return u}g=i.length;let m=r;for(;f<g;){const C=i[f++],h=i[f++];try{m=C(m)}catch(v){h.call(this,v);break}}try{u=_u.call(this,m)}catch(C){return Promise.reject(C)}for(f=0,g=d.length;f<g;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=tn(this.defaults,t);const r=hu(t.baseURL,t.url,t.allowAbsoluteUrls,t);return nu(r,t.params,t.paramsSerializer)}};P.forEach(["delete","get","head","options"],function(t){rn.prototype[t]=function(r,n){return this.request(tn(n||{},{method:t,url:r,data:n&&P.hasOwnProp(n,"data")?n.data:void 0}))}}),P.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,a,i){return this.request(tn(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}rn.prototype[t]=r(),t!=="query"&&(rn.prototype[t+"Form"]=r(!0))});let lS=class vg{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(i=>{n.subscribe(i),o=i}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,i){n.reason||(n.reason=new xs(o,a,i),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new vg(function(s){t=s}),cancel:t}}};function cS(e){return function(r){return e.apply(null,r)}}function dS(e){return P.isObject(e)&&e.isAxiosError===!0}const zi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(zi).forEach(([e,t])=>{zi[t]=e});function Eu(e){const t=new rn(e),r=qd(rn.prototype.request,t);return P.extend(r,rn.prototype,t,{allOwnKeys:!0}),P.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Eu(tn(e,s))},r}const nt=Eu(Os);nt.Axios=rn,nt.CanceledError=xs,nt.CancelToken=lS,nt.isCancel=lu,nt.VERSION=ji,nt.toFormData=Yo,nt.AxiosError=re,nt.Cancel=nt.CanceledError,nt.all=function(t){return Promise.all(t)},nt.spread=cS,nt.isAxiosError=dS,nt.mergeConfig=tn,nt.AxiosHeaders=_t,nt.formToJSON=e=>iu(P.isHTMLForm(e)?new FormData(e):e),nt.getAdapter=wu.getAdapter,nt.HttpStatusCode=zi,nt.default=nt;const{Axios:TP,AxiosError:EP,CanceledError:AP,isCancel:kP,CancelToken:IP,VERSION:LP,all:DP,Cancel:NP,isAxiosError:PP,spread:OP,toFormData:xP,AxiosHeaders:FP,HttpStatusCode:MP,formToJSON:BP,getAdapter:$P,mergeConfig:jP,create:qP}=nt;let Vi="";function Au(e){Vi=e}const Me=nt.create({timeout:3e4});function uS(e,t){if(!e||typeof t!="string"||!t.trim())return e;const r=t.trim().replace(/\/+$/,""),n=r.startsWith("/")?r:`/${r}`;return e.replace(/^\/(action|api|portal)(?=\/|$)/,n)}Me.interceptors.request.use(async e=>{var s,o,a;const{useEditorStore:t}=await Promise.resolve().then(()=>fb),r=t.getState(),n=(s=r.editorConfig)==null?void 0:s.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),e.url=uS(e.url,(a=(o=r.editorConfig)==null?void 0:o.config)==null?void 0:a.apiSlug),Vi&&(e.baseURL=Vi),e});const ku="/portal";async function Iu(e){var n,s,o,a,i,c,d;const t=await Me.get(`${ku}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.questionset;if(!r||!r.identifier){const u=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${u}`)}return r}async function fS(e){var r,n;return e.length?((n=(r=(await Me.post(`${ku}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function ra(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",o=r.mimeType??"",a=r.children,i=Array.isArray(a)?a.map(d=>ra(d,n)):[],c=o==="application/vnd.ekstep.content-collection"||s.toLowerCase().includes("unit")||s.toLowerCase().includes("textbook")||s.toLowerCase().includes("collection")||s.toLowerCase().includes("course")||s.toLowerCase().includes("lesson")||r.visibility==="Parent"||o==="application/vnd.sunbird.questionset"&&i.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:s,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:i,metadata:r,parent:t}}async function Lu(e){var s,o,a,i,c,d,u;const t=await Me.get(`/action/collection/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(s=t.data)==null?void 0:s.result)==null?void 0:o.content;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((d=(c=t.data)==null?void 0:c.params)==null?void 0:d.err)||((u=t.data)==null?void 0:u.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=ra(r);return{content:r,rootNode:n}}async function hS(e){const t=await Iu(e),r=ra(t);return{content:t,rootNode:r}}async function pS(e,t,r,n){var o;return((o=(await Me.patch("/action/collection/v1/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:o.result)??{}}async function gS(e,t=""){await Me.post(`/action/collection/v1/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function mS(e){var n,s,o,a,i,c,d;const t=await Me.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.content;if(!r||!r.identifier){const u=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${u}`)}return r}async function Du(e){var r,n;return(n=(r=(await Me.get(`/action/collection/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function vS(e){await Me.post(`/action/collection/v1/review/${e}`,{request:{content:{}}})}async function yS(e,t){await Me.post(`/action/collection/v1/reject/${e}`,{request:{content:{rejectComment:t}}})}async function bS(e,t){await Me.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const Nu="Evaluation Course";function nn(e){return(e==null?void 0:e.primaryCategory)===Nu}function CS(e){const t=(e.children??[]).map(r=>({...r,children:(r.children??[]).map(n=>{var o;const s=!!((o=n.metadata)!=null&&o.isAssessmentCourse)||nn(n.metadata);return{...n,isFolder:!1,children:[],metadata:{...n.metadata??{},...s?{isAssessmentCourse:!0}:{}}}})}));return{...e,children:t}}function st(e){var r,n;const t=(e==null?void 0:e.children)??[];return t.length===1&&!!((n=(r=t[0])==null?void 0:r.metadata)!=null&&n.isAssessmentCourse)}function Pu(e){return((e==null?void 0:e.children)??[]).find(t=>{var r;return!!((r=t.metadata)!=null&&r.isAssessmentCourse)})}function SS(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function wS(e,t){const r=e.findIndex(s=>s.id===t);return r===-1?null:Ms(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((s,o)=>!Ms(e,o)).length}}function Fs(e,t){return t==="pre"?e.length>0&&st(e[0]):e.length>1&&st(e[e.length-1])}function Ms(e,t){const r=SS(t,e.length,st(e[t]));return r==="pre"||r==="post"}function Hi(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&Ms(e,r)}function Ou(e,t){var n,s;return(((n=e[0])==null?void 0:n.id)===t.id||((s=e[e.length-1])==null?void 0:s.id)===t.id)&&(t.children??[]).length===0}function _S(e){return Fs(e,"pre")?Fs(e,"post")?null:"post":"pre"}function TS(e,t,r){if(t<0||t>=e.length)return!1;const n=st(e[0])?e[0]:null,s=e.length>1&&st(e[e.length-1])?e[e.length-1]:null,o=[...e],[a]=o.splice(t,1);return o.splice(r,0,a),!(n&&o[0]!==n||s&&o[o.length-1]!==s||!n&&st(o[0])||!s&&o.length>1&&st(o[o.length-1]))}function xu(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(s=>{var o;return!!((o=s.metadata)!=null&&o.isAssessmentCourse)}):!0}function sn(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function Fu(e,t){var n,s;return e?((n=t[e.id])==null?void 0:n.framework)??((s=e.metadata)==null?void 0:s.framework):void 0}function Mu(e,t){return!!Fu(e,t)}function Bu(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((s,o)=>{var a,i;Ms(n,o)?sn((a=s.children[0].metadata)==null?void 0:a[t]).forEach(c=>r.add(c)):sn((i=s.metadata)==null?void 0:i[t]).forEach(c=>r.add(c))}),Array.from(r)}function ES(e,t,r){var d,u;if(!e||!t)return null;const n=Bu(e,t),s=((d=r[e.id])==null?void 0:d[t])??((u=e.metadata)==null?void 0:u[t]),o=sn(s),a=[...n].sort(),i=[...o].sort();return a.length===i.length&&a.every((f,g)=>f===i[g])?null:n}function AS(e,t,r){if(!e||!t||r.length===0)return[];const n=e.children??[];return n.filter((s,o)=>{var i;return Ms(n,o)?!1:sn((i=s.metadata)==null?void 0:i[t]).some(c=>!r.includes(c))})}function $u(e,t,r){var s;if(!e||!r||t.length===0)return[];const n=new Set;for(const o of e.children??[])sn((s=o.metadata)==null?void 0:s[r]).forEach(a=>n.add(a));return t.filter(o=>!n.has(o))}const ju=new Set(["adaptive"]);function Qi(e,t,r,n={}){var C,h,v,y;const s=[];if(!e)return s;const o=((C=n[e.id])==null?void 0:C.policy)??((h=e.metadata)==null?void 0:h.policy);o||s.push({code:"policyMissing",message:"Set a consumption policy for this path."});const a=e.children??[],i=a[0],c=a.length>1?a[a.length-1]:void 0,d=st(i),u=st(c);!d&&o&&ju.has(o)&&s.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[i,"Prior Assessment"],[c,"Outcome Assessment"]].forEach(([b,S])=>{if(!b)return;const w=b.children??[],T=w.filter(E=>{var N;return!!((N=E.metadata)!=null&&N.isAssessmentCourse)});T.length!==0&&(T.length<w.length||w.length!==1&&s.push({code:"slotNotPure",nodeId:b.id,message:`${S} must contain exactly one question-set-only course.`}))});const f=new Set,g=(b,S)=>{f.has(b)&&s.push({code:"duplicateCourse",nodeId:S,message:"A course appears more than once in this path."}),f.add(b)},m=a.slice(d?1:0,a.length-(u?1:0));d&&g(i.children[0].id,i.id),u&&g(c.children[0].id,c.id);for(const b of m){const S=b.children??[],w=S.length===0;w&&s.push({code:"emptyLevel",nodeId:b.id,message:`"${b.name}" has no courses yet.`});const T=t?sn((v=b.metadata)==null?void 0:v[t]):[];if(T.length===0)w||s.push({code:"levelMissingSkills",nodeId:b.id,message:`"${b.name}" needs at least one skill selected.`});else{if(r.length>0){const N=T.filter(I=>!r.includes(I));N.length>0&&s.push({code:"levelSkillsOutOfScope",nodeId:b.id,message:`"${b.name}" has skills outside the current scope: ${N.join(", ")}.`})}const E=$u(b,T,t);E.length>0&&s.push({code:"levelSkillsUncovered",nodeId:b.id,message:`"${b.name}" has no course covering: ${E.join(", ")}.`})}for(const E of S)g(E.id,b.id),(t?sn((y=E.metadata)==null?void 0:y[t]):[]).length===0&&s.push({code:"courseMissingSkillTag",nodeId:E.id,message:`"${E.name}" has no skill tag.`})}return s}async function kS(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],s=r.length>1?r[r.length-1]:void 0;for(const[o,a]of[[n,"Prior Assessment"],[s,"Outcome Assessment"]]){if(!o||!st(o))continue;const i=o.children[0].id,c=await Du(i);nn(c)||t.push({code:"slotCourseChanged",nodeId:o.id,message:`${a}'s course is no longer an Evaluation Course — pick a different course.`})}return t}function Et(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function qu(e,t,r=0){var n;for(const s of e){if(s.id===t)return r;if((n=s.children)!=null&&n.length){const o=qu(s.children,t,r+1);if(o>=0)return o}}return-1}const Uu=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function zu(e,t,r,n){return e.map(s=>{if(s.id===t){const o=r.metadata??{},a=n!=null&&n.length?new Set([...Uu,...n]):Uu,i={};for(const c of a)c in r&&(i[c]=r[c]);return{...s,...r,metadata:{...s.metadata??{},...i,...o}}}return s.children&&s.children.length>0?{...s,children:zu(s.children,t,r,n)}:s})}function na(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:na(n.children,t,r)}:n)}function Vu(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]];return o.splice(n,0,r),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:Vu(s.children,t,r,n)}:s})}function Wi(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Wi(r.children,t):[]}))}function Ri(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]],[a]=o.splice(r,1);return o.splice(n,0,a),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:Ri(s.children,t,r,n)}:s})}function Hu(e,t){return e.map(r=>{const n=t[r.id]??r.id,s=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:s,children:r.children?Hu(r.children,t):[]}})}function IS(e){let t=0;const r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t++,n.children&&r.push(...n.children)}return t}function LS(e,t){const r=Et(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Et(e,s.parent):void 0;return n}const se=Is((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var s;const n=((s=r[0])==null?void 0:s.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:s,getBreadcrumb:o}=t(),a=Et(n,r),i=o(r),c={...(a==null?void 0:a.metadata)??{},...s[r]??{}};X.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),rt.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:i,activeNodeMeta:c})},updateNode:(r,n,s)=>{if(e(o=>({treeData:zu(o.treeData,r,n,s),treeCache:{...o.treeCache,[r]:{...o.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const o=Et(t().treeData,r);e(a=>({activeNodeMeta:{...(o==null?void 0:o.metadata)??{},...a.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var g,m,C;const s=t(),o=X.getState().editorProfile,a=((m=(g=X.getState().editorConfig)==null?void 0:g.config)==null?void 0:m.maxDepth)??o.maxDepth,i=qu(s.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const c="temp-"+Math.random().toString(36).slice(2),d={id:c,identifier:c,name:o.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:crypto.randomUUID(),name:o.defaultUnitName,contentType:o.unitContentType,primaryCategory:o.unitPrimaryCategory,visibility:"Parent"}},u=((C=Et(s.treeData,r))==null?void 0:C.children)??[],f=o.derivedRoles&&Fs(u,"post");return e(h=>({treeData:f?Vu(h.treeData,r,d,u.length-1):na(h.treeData,r,d),treeCache:{...h.treeCache,[c]:{...d.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var o,a,i;const n=(o=t().treeData[0])==null?void 0:o.id;if(r===n)return!1;if(X.getState().editorProfile.derivedRoles){const c=Et(t().treeData,r),d=c!=null&&c.parent?Et(t().treeData,c.parent):void 0,u=((a=t().treeData[0])==null?void 0:a.children)??[],f=d?u.findIndex(g=>g.id===d.id):-1;if(f===0||f===u.length-1){const g=(d.children??[]).filter(m=>m.id!==r);if(g.length===1&&((i=g[0].metadata)!=null&&i.isAssessmentCourse))return!1}}return e(c=>({treeData:Wi(c.treeData,r),selectedNodeId:c.selectedNodeId===r?null:c.selectedNodeId})),!0},reorderChildren:(r,n,s)=>{var i;const o=X.getState().editorProfile,a=(i=t().treeData[0])==null?void 0:i.id;if(o.derivedRoles&&r===a){const c=Et(t().treeData,r);if(c!=null&&c.children&&!TS(c.children,n,s))return}e(c=>({treeData:Ri(c.treeData,r,n,s)}))},moveNode:(r,n,s)=>{var d,u,f;const o=X.getState().editorProfile,a=Et(t().treeData,r),i=Et(t().treeData,s);if(!(i!=null&&i.isFolder))return;const c=(d=t().treeData[0])==null?void 0:d.id;if(!(o.derivedRoles&&(a!=null&&a.isFolder)&&s!==c)){if(o.derivedRoles&&a&&!a.isFolder){const g=!!((u=a.metadata)!=null&&u.isAssessmentCourse),m=((f=t().treeData[0])==null?void 0:f.children)??[];if(!xu(i,g,Hi(m,i)))return}e(g=>{const m=Et(g.treeData,r);if(!m)return g;let C=Wi(g.treeData,r);return C=na(C,s,{...m,parent:s}),{treeData:C}}),t().markDirty()}},addResource:(r,n,s)=>{var C,h,v,y,b,S;const o=X.getState().editorConfig,a=X.getState().editorProfile,i=(C=t().treeData[0])==null?void 0:C.id,c=!!(s!=null&&s.isAssessmentCourse);if(a.derivedRoles&&n===i){if(!c||Et(t().treeData,r.identifier))return!1;const w=t().treeData[0],T=(w==null?void 0:w.children)??[],E=(s==null?void 0:s.slot)??_S(T);if(!E||Fs(T,E))return!1;const N=t().addNode(i,"unit");if(!N)return!1;const{learningPath:I}=ki.getState().labelConfig;if(t().updateNode(N,{name:E==="pre"?I.priorAssessmentLabel:I.outcomeAssessmentLabel}),E==="pre"){const O=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e(B=>({treeData:Ri(B.treeData,i,O,0)}))}return t().addResource(r,N,s)}if(!(((y=o==null?void 0:o.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===i||Et(t().treeData,r.identifier))return!1;const u=Et(t().treeData,n);if(!(u!=null&&u.isFolder))return!1;if(a.derivedRoles){const w=((b=t().treeData[0])==null?void 0:b.children)??[];if(!xu(u,c,Hi(w,u)))return!1}const f=((S=o==null?void 0:o.config)==null?void 0:S.maxContentsLimit)??1200;if(IS(t().treeData)>=f)return!1;const m={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:{...r,...c?{isAssessmentCourse:!0}:{}}};return e(w=>({treeData:na(w.treeData,n,m)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=X.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const a=[];for(const i of o.children??[]){const c=st(i),d=(i.children??[]).filter(u=>{var m;if(u.isFolder)return!0;const f=(m=u.metadata)==null?void 0:m.framework,g=!f||(Array.isArray(f)?f.includes(r):f===r);return g||n++,g});c&&d.length===0||a.push(d.length===(i.children??[]).length?i:{...i,children:d})}return n===0?s:{treeData:[{...o,children:a}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const a={...s.treeCache},i=(o.children??[]).map(c=>{var g,m;if(!(((g=c.metadata)==null?void 0:g[r])!==void 0||((m=a[c.id])==null?void 0:m[r])!==void 0))return c;n++;const{[r]:u,...f}=c.metadata??{};if(a[c.id]){const{[r]:C,...h}=a[c.id];a[c.id]=h}return{...c,metadata:f}});return n===0?s:{treeData:[{...o,children:i}],treeCache:a}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=Hu(n.treeData,r),o={};for(const[i,c]of Object.entries(n.treeCache)){const d=r[i]??i,{isNew:u,...f}=c;o[d]=f}const a=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:s,treeCache:o,selectedNodeId:a}})},getNodeById:r=>Et(t().treeData,r),getChildrenOf:r=>{const n=Et(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>LS(t().treeData,r)})),DS={spin:"_spin_1ah4d_9"};function ae(){return ki(e=>e.labelConfig)}const NS=({size:e=16,color:t="currentColor"})=>{const r=ae();return l.jsx("svg",{className:DS.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:l.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},Be=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:o,className:a,type:i="button"})=>l.jsxs("button",{type:i,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${a??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(NS,{size:14}):null,o]}),Qu=({size:e=16,...t})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[l.jsx("circle",{cx:"58",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("circle",{cx:"8",cy:"58",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{d:"M52 12 H24 A12 12 0 0 0 24 36 H40 A12 12 0 0 1 40 60 H12",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]});async function Wu(e){var r,n;return(n=(r=(await Me.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function PS(e){var r,n;return((n=(r=(await Me.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function sa(e,t){const r=En({queryKey:["framework",e],queryFn:()=>Wu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=En({queryKey:["framework",n],queryFn:()=>Wu(n),enabled:!!n,staleTime:300*1e3}),o=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:o,isLoading:r.isLoading||s.isLoading}}function Ru(e){if(!(e!=null&&e.length))return null;const t=e.reduce((r,n)=>(n.index??-1/0)>(r.index??-1/0)?n:r);return{code:t.code,terms:t.terms??[]}}function OS(e){var n,s,o,a;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!st(t))return;const r=(a=(o=(s=t==null?void 0:t.children)==null?void 0:s[0])==null?void 0:o.metadata)==null?void 0:a.framework;return Array.isArray(r)?r[0]:r}function ir(){var o;const e=X(a=>a.editorConfig),t=X(a=>a.contentFramework),r=se(a=>a.treeData),n=OS(r[0])??t??((o=e==null?void 0:e.context)==null?void 0:o.framework),{organisationFramework:s}=sa(n);return Ru(s==null?void 0:s.categories)}function xS(e,t,r){var d,u,f,g;const n={scope:((t==null?void 0:t.terms)??[]).map(m=>m.name),source:"manual"};if(!t)return n;const s=(d=e==null?void 0:e.children)==null?void 0:d[0];if(!st(s))return n;const o=(u=s==null?void 0:s.children)==null?void 0:u[0];if(!o)return n;const i=((f=r[o.id])==null?void 0:f[t.code])??((g=o.metadata)==null?void 0:g[t.code]);return{scope:Array.isArray(i)?i:i?[i]:[],source:"prior"}}function Bs(){const e=ir(),t=se(n=>n.treeData),r=se(n=>n.treeCache);return p.useMemo(()=>xS(t[0],e,r),[t,e,r])}const ke={overlay:"_overlay_12iiv_1",modal:"_modal_12iiv_15",modalHeader:"_modalHeader_12iiv_27",modalHeaderClose:"_modalHeaderClose_12iiv_37",modalBody:"_modalBody_12iiv_55",modalFooter:"_modalFooter_12iiv_62",checkRow:"_checkRow_12iiv_69",formGroup:"_formGroup_12iiv_112",textarea:"_textarea_12iiv_123",sliderGroup:"_sliderGroup_12iiv_144",sliderValue:"_sliderValue_12iiv_156",sliderLabels:"_sliderLabels_12iiv_164",sectionTitle:"_sectionTitle_12iiv_172"},FS=({objectType:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=se(C=>C.treeData[0]),o=se(C=>C.treeCache),a=ir(),{scope:i}=Bs(),[c,d]=p.useState(null),u=Qi(s,a==null?void 0:a.code,i,o);p.useEffect(()=>{let C=!1;return d(null),kS(s).then(h=>{C||d(h)}).catch(h=>{console.error("[PublishChecklist] assessment-course re-check failed:",h),C||d([{code:"slotCourseCheckFailed",message:n.learningPath.assessmentCheckFailedToast}])}),()=>{C=!0}},[s]);const f=c===null,g=[...u,...c??[]],m=!f&&g.length===0;return l.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:ke.modal,children:[l.jsxs("div",{className:ke.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:ke.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:ke.modalBody,children:g.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:f?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:ke.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:g.map((C,h)=>l.jsx("li",{children:C.message},`${C.code}-${C.nodeId??h}`))})]})}),l.jsxs("div",{className:ke.modalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Be,{variant:"primary",onClick:t,disabled:!m,children:n.publishChecklist.yesButton})]})]})})},MS=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=X(g=>{var m,C;return(C=(m=g.editorConfig)==null?void 0:m.config)==null?void 0:C.objectType})||"Content",o=X(g=>g.editorProfile.key==="learningPath"),a=X(g=>g.publishChecklist)??[],[i,c]=p.useState({}),d=a.every(g=>i[g.code]),u=a.length===0||d,f=()=>{t()};return o?l.jsx(FS,{objectType:s,onConfirm:t,onCancel:r}):l.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:ke.modal,children:[l.jsxs("div",{className:ke.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),l.jsx("button",{className:ke.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:ke.modalBody,children:a.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",s,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:ke.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(g=>l.jsxs("label",{className:ke.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!i[g.code],onChange:m=>c(C=>({...C,[g.code]:m.target.checked}))}),l.jsx("span",{children:g.label})]},g.code))]})}),l.jsxs("div",{className:ke.modalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Be,{variant:"primary",onClick:f,disabled:!u,children:n.publishChecklist.yesButton})]})]})})},BS=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const s=ae(),[o,a]=p.useState(""),[i,c]=p.useState(7),d=t==="approve",u=d?s.qualityParamsModal.reviewQualityTitle:s.qualityParamsModal.rejectContentTitle,f=!d&&o.trim().length===0,g=()=>{d?r(o.trim(),i):r(o.trim())};return l.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:ke.modal,children:[l.jsxs("div",{className:ke.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:u}),l.jsx("button",{className:ke.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:ke.modalBody,children:d?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ke.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:ke.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:i,onChange:m=>c(Number(m.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":i}),l.jsx("span",{className:ke.sliderValue,children:i})]}),l.jsxs("div",{className:ke.sliderLabels,children:[l.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:ke.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[s.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:s.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:ke.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:o,onChange:m=>a(m.target.value),rows:4})]})]}):l.jsxs("div",{className:ke.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[s.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:ke.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:o,onChange:m=>a(m.target.value),rows:5,required:!0,"aria-required":"true"}),o.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:s.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:ke.modalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),l.jsx(Be,{variant:d?"primary":"danger",onClick:g,disabled:f,children:d?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})},$S=({message:e,onConfirm:t,onCancel:r})=>{const n=ae();return Ue.createPortal(l.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:ke.modal,children:[l.jsxs("div",{className:ke.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:ke.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:ke.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:ke.modalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx(Be,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Gu=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function jS(e,t={}){var c,d,u,f;const n={"organisations.roles":[((c=t.objectType)==null?void 0:c.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const s=e.includes("@"),o=/^\d{10,}$/.test(e.trim()),a={filters:n,fields:Gu,offset:0,limit:t.limit??200};return s?n.email=e.trim():o?n.phone=e.trim():a.query=e,((f=(u=(d=(await Me.post("/action/user/v1/search",{request:a},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:d.result)==null?void 0:u.response)==null?void 0:f.content)??[]}async function qS(e){var r,n,s;return e.length?((s=(n=(r=(await Me.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Gu,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:s.content)??[]:[]}async function US(e){var r,n;return((n=(r=(await Me.get(`/action/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const $e={container:"_container_r27rp_1",header:"_header_r27rp_13",title:"_title_r27rp_22",closeBtn:"_closeBtn_r27rp_29",body:"_body_r27rp_45",label:"_label_r27rp_54",searchSection:"_searchSection_r27rp_62",searchRow:"_searchRow_r27rp_68",searchInput:"_searchInput_r27rp_74",searchSpinner:"_searchSpinner_r27rp_89",resultsList:"_resultsList_r27rp_105",resultItem:"_resultItem_r27rp_118",userInfo:"_userInfo_r27rp_133",userName:"_userName_r27rp_141",userEmail:"_userEmail_r27rp_150",userOrg:"_userOrg_r27rp_158",noResults:"_noResults_r27rp_167",collabSection:"_collabSection_r27rp_174",sectionTitle:"_sectionTitle_r27rp_179",badge:"_badge_r27rp_189",emptyCollab:"_emptyCollab_r27rp_203",collabList:"_collabList_r27rp_214",collabItem:"_collabItem_r27rp_223",userAvatar:"_userAvatar_r27rp_237",error:"_error_r27rp_251",success:"_success_r27rp_257",footer:"_footer_r27rp_263"},zS=({contentId:e,onClose:t})=>{var O,B;const r=ae(),n=X(k=>k.editorConfig),s=(O=n==null?void 0:n.context)==null?void 0:O.channel,o=(B=n==null?void 0:n.config)==null?void 0:B.objectType,[a,i]=p.useState(""),[c,d]=p.useState([]),[u,f]=p.useState(!1),[g,m]=p.useState([]),[C,h]=p.useState(!1),[v,y]=p.useState(""),[b,S]=p.useState(!1),w=p.useRef(null);p.useEffect(()=>{let k=!1;return(async()=>{try{const F=await Du(e),M=(F==null?void 0:F.collaborators)??[];if(!M.length)return;const x=await qS(M);if(k)return;const z=M.map(ne=>x.find(R=>R.identifier===ne)??{identifier:ne,firstName:ne});m(z)}catch{}})(),()=>{k=!0}},[e]),p.useEffect(()=>{w.current&&clearTimeout(w.current);const k=a.trim();if(k.length<2){d([]);return}return w.current=setTimeout(async()=>{f(!0);try{const F=await jS(k,{rootOrgId:s,objectType:o}),M=new Set(g.map(x=>x.identifier));d(F.filter(x=>!M.has(x.identifier)))}catch{d([])}finally{f(!1)}},300),()=>{w.current&&clearTimeout(w.current)}},[a,g,s,o]);const T=p.useCallback(k=>{m(F=>F.find(M=>M.identifier===k.identifier)?F:[...F,k]),d(F=>F.filter(M=>M.identifier!==k.identifier)),S(!1)},[]),E=p.useCallback(k=>{m(F=>F.filter(M=>M.identifier!==k)),S(!1)},[]),N=p.useCallback(async()=>{h(!0),y(""),S(!1);try{await bS(e,g.map(k=>k.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,g,r.manageCollaborators.saveFailed]),I=k=>`${k.firstName}${k.lastName?` ${k.lastName}`:""}`;return l.jsxs("div",{className:$e.container,children:[l.jsxs("div",{className:$e.header,children:[l.jsx("h2",{className:$e.title,children:r.manageCollaborators.title}),l.jsx("button",{className:$e.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(or,{size:18})})]}),l.jsxs("div",{className:$e.body,children:[l.jsxs("div",{className:$e.searchSection,children:[l.jsx("label",{className:$e.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:$e.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:$e.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:a,onChange:k=>i(k.target.value)}),u&&l.jsx("span",{className:$e.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:$e.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(k=>{var F,M,x,z;return l.jsxs("li",{className:$e.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:$e.userInfo,children:[l.jsx("span",{className:$e.userName,children:I(k)}),k.email&&l.jsx("span",{className:$e.userEmail,children:k.email}),(((M=(F=k.organisations)==null?void 0:F[0])==null?void 0:M.orgName)??k.rootOrgName)&&l.jsx("span",{className:$e.userOrg,children:((z=(x=k.organisations)==null?void 0:x[0])==null?void 0:z.orgName)??k.rootOrgName})]}),l.jsx(Be,{variant:"primary",size:"sm",onClick:()=>T(k),children:r.manageCollaborators.add})]},k.identifier)})}),a.trim().length>=2&&!u&&c.length===0&&l.jsx("p",{className:$e.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:$e.collabSection,children:[l.jsxs("h3",{className:$e.sectionTitle,children:[r.manageCollaborators.currentCollaborators,g.length>0&&l.jsx("span",{className:$e.badge,children:g.length})]}),g.length===0?l.jsx("p",{className:$e.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:$e.collabList,children:g.map(k=>{var F,M,x,z;return l.jsxs("li",{className:$e.collabItem,children:[l.jsx("div",{className:$e.userAvatar,"aria-hidden":"true",children:I(k).charAt(0).toUpperCase()}),l.jsxs("div",{className:$e.userInfo,children:[l.jsx("span",{className:$e.userName,children:I(k)}),k.email&&l.jsx("span",{className:$e.userEmail,children:k.email}),(((M=(F=k.organisations)==null?void 0:F[0])==null?void 0:M.orgName)??k.rootOrgName)&&l.jsx("span",{className:$e.userOrg,children:((z=(x=k.organisations)==null?void 0:x[0])==null?void 0:z.orgName)??k.rootOrgName})]}),l.jsx(Be,{variant:"danger",size:"sm",onClick:()=>E(k.identifier),children:r.manageCollaborators.remove})]},k.identifier)})})]}),v&&l.jsx("p",{className:$e.error,role:"alert",children:v}),b&&l.jsx("p",{className:$e.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:$e.footer,children:[l.jsx(Be,{variant:"ghost",onClick:t,disabled:C,children:r.manageCollaborators.cancel}),l.jsx(Be,{variant:"primary",isLoading:C,onClick:N,children:r.manageCollaborators.save})]})]})};async function VS(e){return(await Me.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function HS(e,t){var s;const n=((s=(await Me.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:s.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function QS(e){var n;const r=((n=(await Me.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const _e={topbar:"_topbar_lk8lp_1",left:"_left_lk8lp_15",right:"_right_lk8lp_23",backBtn:"_backBtn_lk8lp_30",title:"_title_lk8lp_49",profileBadge:"_profileBadge_lk8lp_61",statusChip:"_statusChip_lk8lp_76",savedIndicator:"_savedIndicator_lk8lp_88",unsaved:"_unsaved_lk8lp_98",iconBtn:"_iconBtn_lk8lp_103",iconBtnLabel:"_iconBtnLabel_lk8lp_130",qrDropdown:"_qrDropdown_lk8lp_134",qrMenu:"_qrMenu_lk8lp_138",reviewBtns:"_reviewBtns_lk8lp_173",sourcingBtns:"_sourcingBtns_lk8lp_182",modalOverlay:"_modalOverlay_lk8lp_191",sbOverlay:"_sbOverlay_lk8lp_201",sbModal:"_sbModal_lk8lp_211",sbModalHeader:"_sbModalHeader_lk8lp_222",sbModalTitle:"_sbModalTitle_lk8lp_230",sbModalClose:"_sbModalClose_lk8lp_237",sbModalBody:"_sbModalBody_lk8lp_250",sbLabel:"_sbLabel_lk8lp_257",sbTextarea:"_sbTextarea_lk8lp_264",sbError:"_sbError_lk8lp_281",sbModalFooter:"_sbModalFooter_lk8lp_288"};function WS(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function RS(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const GS=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:s="primary",onConfirm:o,onCancel:a})=>{const i=ae(),[c,d]=p.useState(""),u=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${u}-title`,children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:`${u}-title`,className:_e.sbModalTitle,children:e}),l.jsx("button",{className:_e.sbModalClose,onClick:a,"aria-label":i.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.sbLabel,htmlFor:`${u}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${u}-comment`,className:_e.sbTextarea,placeholder:r,value:c,onChange:f=>d(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:_e.sbError,children:i.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:a,children:i.reviewCommentModal.cancelButton}),l.jsx(Be,{variant:s,onClick:()=>o(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},KS=({onConfirm:e,onCancel:t})=>{const r=ae(),[n,s]=p.useState(!1),o=X(g=>g.editorProfile.key==="learningPath"),a=se(g=>g.treeData[0]),i=se(g=>g.treeCache),c=ir(),{scope:d}=Bs(),u=o?Qi(a,c==null?void 0:c.code,d,i):[],f=u.length>0;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:_e.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:_e.sbModalBody,children:f?l.jsxs(l.Fragment,{children:[l.jsx("p",{style:{margin:"0 0 8px",fontSize:13,fontWeight:600},children:r.learningPath.resolveBeforeSendingForReview}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:u.map((g,m)=>l.jsx("li",{children:g.message},`${g.code}-${g.nodeId??m}`))})]}):l.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[l.jsx("input",{type:"checkbox",checked:n,onChange:g=>s(g.target.checked),style:{marginTop:2}}),l.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",l.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",l.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!f&&l.jsx(Be,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},YS=({onConfirm:e,onCancel:t})=>{const r=ae(),[n,s]=p.useState(""),o=parseInt(n,10),a=!isNaN(o)&&o>=2&&o<=250;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:_e.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:_e.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:i=>s(i.target.value)}),n&&!a&&l.jsx("p",{className:_e.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(Be,{variant:"primary",onClick:()=>e(o),disabled:!a,children:r.generateQRModal.generateButton})]})]})})},ZS=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:s=!0,onToolbarEvent:o})=>{var ie,Se;const a=ae(),c=se(fe=>fe.treeData)[0],d=(c==null?void 0:c.name)??a.contextualEditor.untitledPlaceholder,u=RS(((ie=c==null?void 0:c.metadata)==null?void 0:ie.status)??(c==null?void 0:c.status),a.topbar.draftStatusFallback),f=X(fe=>{var ye,Le,J,he;return((Le=(ye=fe.editorConfig)==null?void 0:ye.context)==null?void 0:Le.contentId)??((he=(J=fe.editorConfig)==null?void 0:J.context)==null?void 0:he.identifier)??""}),{activeModal:g,modalData:m,closeModal:C,openModal:h}=rt(),v=X(fe=>fe.buttonLoaders),y=X(fe=>fe.categoryMeta),b=X(fe=>fe.editorProfile),S=b.key==="learningPath",w=b.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[T,E]=p.useState(!1),[N,I]=p.useState(!1),[O,B]=p.useState(!1),k=p.useRef(null),[F,M]=p.useState(!1);p.useEffect(()=>{if(!O)return;const fe=ye=>{var Le;(Le=k.current)!=null&&Le.contains(ye.target)||B(!1)};return document.addEventListener("mousedown",fe),()=>document.removeEventListener("mousedown",fe)},[O]);const[x,z]=p.useState(!1),[ne,R]=p.useState(!1),{updateNode:ge}=se(),me=(Se=c==null?void 0:c.metadata)==null?void 0:Se.qrCodeProcessId,K=p.useCallback(async fe=>{if(f){M(!1),z(!0);try{const{processId:ye,reservedDialcodes:Le}=await HS(f,fe);ye&&c&&ge(c.id,{qrCodeProcessId:ye,reservedDialcodes:Le}),pe.success(a.topbar.qrGenerationStartedToast)}catch{pe.error(a.topbar.qrGenerationFailedToast)}finally{z(!1)}}},[f,c,ge,a]),ce=p.useCallback(async()=>{if(!me){pe.error(a.topbar.qrCodesNotGeneratedToast);return}R(!0);try{const fe=await QS(me);if(fe.status==="in-process"){pe(a.topbar.qrGenerationInProgressToast,{icon:l.jsx(Dn,{size:16})});return}const ye=fe.url;if(!ye){pe.error(a.topbar.qrCodesNotReadyToast);return}const Le=await fetch(ye).then(Ke=>Ke.blob()),J=await new Promise(Ke=>{const at=new FileReader;at.onloadend=()=>Ke(at.result),at.readAsDataURL(Le)}),he=(c==null?void 0:c.metadata)??{},Q=Ke=>Array.isArray(Ke)?Ke.join("_"):typeof Ke=="string"?Ke:"",be=[f,Q(he.medium),Q(he.gradeLevel),Q(he.subject)].filter(Boolean),He=new Date().toISOString().replace(/[:.]/g,"-"),ot=`${be.join("_")}_${He}.zip`,Qe=document.createElement("a");Qe.href=J,Qe.download=ot,Qe.style.display="none",document.body.appendChild(Qe),Qe.click(),document.body.removeChild(Qe),pe.success(a.topbar.qrCodesDownloadedToast)}catch{pe.error(a.topbar.qrCodesDownloadFailedToast)}finally{R(!1)}},[me,c,f,a]),te=e==="edit",we=e==="review",ve=e==="sourcingreview",q=e==="read",$=p.useCallback((fe,ye)=>{o({action:fe,data:ye})},[o]),U=p.useCallback(()=>{C(),$("publish")},[C,$]),oe=p.useCallback((fe,ye)=>{const Le=m==null?void 0:m.action;C(),Le==="approve"?$("sourcingApprove",{comment:fe,score:ye}):$("reject",{comment:fe})},[C,$,m]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:_e.topbar,role:"banner",children:[l.jsxs("div",{className:_e.left,children:[l.jsx("button",{className:_e.backBtn,onClick:()=>$("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:l.jsx(pi,{size:18})}),l.jsx("h1",{className:_e.title,title:d,children:d}),S&&l.jsxs("span",{className:_e.profileBadge,children:[l.jsx(Qu,{size:13,"aria-hidden":"true"}),a.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${_e.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${u}`,children:u})]}),l.jsxs("div",{className:_e.right,children:[t?l.jsx("span",{className:_e.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&te?l.jsx("span",{className:`${_e.savedIndicator} ${_e.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?l.jsxs("span",{className:_e.savedIndicator,"aria-live":"polite",children:[l.jsx(Zr,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",WS(n)]}):null,!q&&!we&&!ve&&u!=="Review"&&l.jsx("span",{title:s?void 0:a.topbar.fillRequiredFieldsTooltip,children:l.jsx(Be,{variant:"ghost",size:"sm",onClick:()=>$("saveCollection"),disabled:!s,children:a.topbar.saveAsDraftButton})}),te&&l.jsxs(l.Fragment,{children:[l.jsxs(Be,{variant:"primary",size:"sm",onClick:()=>I(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(Uy,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),b.features.collaborators&&l.jsx("button",{className:_e.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:l.jsx(Gy,{size:16,"aria-hidden":"true"})}),w&&l.jsxs("div",{className:_e.qrDropdown,ref:k,children:[l.jsxs("button",{className:_e.iconBtn,onClick:()=>B(fe=>!fe),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":O,children:[l.jsx(Ad,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:_e.iconBtnLabel,children:a.topbar.qrCodesLabel}),l.jsx(Xr,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),O&&l.jsxs("div",{className:_e.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{B(!1),M(!0)},disabled:x,children:[l.jsx(Ad,{size:14}),x?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{B(!1),ce()},disabled:ne||!me,children:[l.jsx(ky,{size:14}),ne?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),we&&l.jsxs("div",{className:_e.reviewBtns,children:[l.jsxs(Be,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(bd,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),l.jsxs(Be,{variant:"primary",size:"sm",onClick:()=>E(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(kd,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),ve&&l.jsxs("div",{className:_e.sourcingBtns,children:[l.jsxs(Be,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(Vy,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),l.jsxs(Be,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(kd,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),g==="publishChecklist"&&l.jsx(MS,{contentId:f,onConfirm:U,onCancel:C}),g==="qualityParams"&&l.jsx(BS,{contentId:f,action:(m==null?void 0:m.action)??"reject",onConfirm:oe,onCancel:C}),g==="manageCollaborators"&&l.jsx("div",{className:_e.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(zS,{contentId:f,onClose:C})}),g==="confirmDelete"&&l.jsx($S,{message:(m==null?void 0:m.message)??"",onConfirm:()=>{const fe=m==null?void 0:m.onConfirm;C(),fe==null||fe()},onCancel:C}),N&&l.jsx(KS,{onConfirm:()=>{I(!1),$("sendForReview")},onCancel:()=>I(!1)}),T&&l.jsx(GS,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:fe=>{E(!1),$("reject",{comment:fe})},onCancel:()=>E(!1)}),F&&l.jsx(YS,{onConfirm:K,onCancel:()=>M(!1)})]})},XS=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=ae();return Ue.createPortal(l.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:ke.modal,children:[l.jsxs("div",{className:ke.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),l.jsx("button",{className:ke.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:ke.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:ke.modalFooter,children:[l.jsx(Be,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),l.jsx(Be,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),l.jsx(Be,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var JS=wi();const Ku=p.createContext(null);function $t(){const e=p.useContext(Ku);if(e===null)throw new Error("No Tree Api Provided");return e}const Yu=p.createContext(null);function ew(){const e=p.useContext(Yu);if(e===null)throw new Error("Provide a NodesContext");return e}const Zu=p.createContext(null);function tw(){const e=p.useContext(Zu);if(e===null)throw new Error("Provide a DnDContext");return e}const Xu=p.createContext(0);function Ju(){p.useContext(Xu)}function oa(e,t,r){return Math.max(Math.min(e,r),t)}function ef(e){return e&&e.isLeaf}function tf(e){return e&&e.isInternal&&!e.isOpen}function rf(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const nf=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},sf=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Gi(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Gi(r,t);if(n)return n}return null}function aa(e,t){if(t(e),e.children)for(let r of e.children)aa(r,t)}function of(e){const t=lf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=rw(t,n);break}r==null||r.focus()}function af(e){const t=lf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=nw(t,n);break}r==null||r.focus()}function rw(e,t){return t+1<e.length?e[t+1]:e[0]}function nw(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function lf(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function $s(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Bn(e){return typeof e=="string"?e:e.id}function sw(e,...t){if(e)return e(...t)}function cf(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function df(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function uf(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const ow=Object.freeze(Object.defineProperty({__proto__:null,access:$s,bound:oa,dfs:Gi,focusNextElement:of,focusPrevElement:af,getInsertIndex:df,getInsertParentId:uf,identify:Bn,indexOf:sf,isClosed:tf,isDescendant:nf,isItem:ef,isOpenWithEmptyChildren:rf,safeRun:sw,waitFor:cf,walk:aa},Symbol.toStringTag,{value:"Module"})),aw={display:"flex",alignItems:"center",zIndex:1},iw={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},lw={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},cw=p.memo(function({top:t,left:r,indent:n}){const s={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},aw),s),children:[l.jsx("div",{style:Object.assign({},lw)}),l.jsx("div",{style:Object.assign({},iw)})]})});function dw({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:s=>s.stopPropagation(),onClick:e.handleClick,children:n}))}function uw(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx(hw,Object.assign({},e)):l.jsx(fw,Object.assign({},e))]})}function fw(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function hw({node:e}){const t=p.useRef();return p.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const js="__REACT_ARBORIST_INTERNAL_ROOT__";function ff(e){var t;function r(o,a,i){const c=e.accessId(o),d=new qs({tree:e,data:o,level:a,parent:i,id:c,children:null,isDraggable:e.isDraggable(o),rowIndex:null}),u=e.accessChildren(o);return u&&(d.children=u.map(f=>r(f,a+1,d))),d}const n=new qs({tree:e,id:js,data:{id:js},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),s=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=s.map(o=>r(o,0,n)),n}class qs{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===js}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new qs(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Ki(e){return{type:"EDIT",id:e}}function pw(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function $n(e){return{type:"FOCUS",id:e}}function gw(){return{type:"TREE_BLUR"}}function mw(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}const Yi={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function hf(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function vw(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:hf(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:hf(e.unfiltered,t)}):e}const jn=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Mr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:Bn(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Bn)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Bn)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:Bn(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:Bn(e)})};function yw(e=jn().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const qn={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function bw(e=jn().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return jn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const Cw={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Sw=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},ww=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function pf({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(_w,{isDragging:s,children:[l.jsx(Tw,{offset:e,children:l.jsx(Aw,{id:r,dragIds:n})}),l.jsx(Ew,{mouse:t,count:n.length})]})}const _w=p.memo(function(t){return t.isDragging?l.jsx("div",{style:Cw,children:t.children}):null});function Tw(e){return l.jsx("div",{className:"row preview",style:Sw(e.offset),children:e.children})}function Ew(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:ww(r),children:t}):null}const Aw=p.memo(function(t){const r=$t(),n=r.get(t.id);return n?l.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function Zi(){return Zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zi.apply(null,arguments)}function gf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xi(e,t){return Xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Xi(e,t)}function kw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xi(e,t)}var mf=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Iw(e,t){return!!(e===t||mf(e)&&mf(t))}function Lw(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Iw(e[r],t[r]))return!1;return!0}function Ji(e,t){t===void 0&&(t=Lw);var r,n=[],s,o=!1;function a(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return o&&r===this&&t(i,n)||(s=e.apply(this,i),o=!0,r=this,n=i),s}return a}var Dw=typeof performance=="object"&&typeof performance.now=="function",vf=Dw?function(){return performance.now()}:function(){return Date.now()};function yf(e){cancelAnimationFrame(e.id)}function Nw(e,t){var r=vf();function n(){vf()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var el=-1;function bf(e){if(e===void 0&&(e=!1),el===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),el=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return el}var Un=null;function Cf(e){if(e===void 0&&(e=!1),Un===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),s=n.style;return s.width="100px",s.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Un="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Un="negative":Un="positive-ascending"),document.body.removeChild(t),Un}return Un}process.env.NODE_ENV;var Pw=150,Ow=function(t,r){return t},ia=null,la=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(ia=new WeakSet,la=new WeakSet);function Sf(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,i=e.getStopIndexForStartIndex,c=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=(function(f){kw(g,f);function g(C){var h;return h=f.call(this,C)||this,h._instanceProps=c(h.props,gf(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:gf(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Ji(function(v,y,b,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:b,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Ji(function(v,y,b){return h.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:b})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var y=h.props,b=y.direction,S=y.itemSize,w=y.layout,T=h._getItemStyleCache(d&&S,d&&w,d&&b),E;if(T.hasOwnProperty(v))E=T[v];else{var N=r(h.props,v,h._instanceProps),I=s(h.props,v,h._instanceProps),O=b==="horizontal"||w==="horizontal",B=b==="rtl",k=O?N:0;T[v]=E={position:"absolute",left:B?void 0:k,right:B?k:void 0,top:O?0:N,height:O?"100%":I,width:O?I:"100%"}}return E},h._getItemStyleCache=void 0,h._getItemStyleCache=Ji(function(v,y,b){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,b=y.clientWidth,S=y.scrollLeft,w=y.scrollWidth;h.setState(function(T){if(T.scrollOffset===S)return null;var E=h.props.direction,N=S;if(E==="rtl")switch(Cf()){case"negative":N=-S;break;case"positive-descending":N=w-b-S;break}return N=Math.max(0,Math.min(N,w-b)),{isScrolling:!0,scrollDirection:T.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,b=y.clientHeight,S=y.scrollHeight,w=y.scrollTop;h.setState(function(T){if(T.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,S-b));return{isScrolling:!0,scrollDirection:T.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(v){var y=h.props.outerRef;h._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&&yf(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=Nw(h._resetIsScrolling,Pw)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}g.getDerivedStateFromProps=function(h,v){return xw(h,v),u(h),null};var m=g.prototype;return m.scrollTo=function(h){h=Math.max(0,h),this.setState(function(v){return v.scrollOffset===h?null:{scrollDirection:v.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,b=y.itemCount,S=y.layout,w=this.state.scrollOffset;h=Math.max(0,Math.min(h,b-1));var T=0;if(this._outerRef){var E=this._outerRef;S==="vertical"?T=E.scrollWidth>E.clientWidth?bf():0:T=E.scrollHeight>E.clientHeight?bf():0}this.scrollTo(o(this.props,h,v,w,this._instanceProps,T))},m.componentDidMount=function(){var h=this.props,v=h.direction,y=h.initialScrollOffset,b=h.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||b==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},m.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,b=this.state,S=b.scrollOffset,w=b.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var T=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(Cf()){case"negative":T.scrollLeft=-S;break;case"positive-ascending":T.scrollLeft=S;break;default:var E=T.clientWidth,N=T.scrollWidth;T.scrollLeft=N-E-S;break}else T.scrollLeft=S;else T.scrollTop=S}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&yf(this._resetIsScrollingTimeoutId)},m.render=function(){var h=this.props,v=h.children,y=h.className,b=h.direction,S=h.height,w=h.innerRef,T=h.innerElementType,E=h.innerTagName,N=h.itemCount,I=h.itemData,O=h.itemKey,B=O===void 0?Ow:O,k=h.layout,F=h.outerElementType,M=h.outerTagName,x=h.style,z=h.useIsScrolling,ne=h.width,R=this.state.isScrolling,ge=b==="horizontal"||k==="horizontal",me=ge?this._onScrollHorizontal:this._onScrollVertical,K=this._getRangeToRender(),ce=K[0],te=K[1],we=[];if(N>0)for(var ve=ce;ve<=te;ve++)we.push(p.createElement(v,{data:I,key:B(ve,I),index:ve,isScrolling:z?R:void 0,style:this._getItemStyle(ve)}));var q=n(this.props,this._instanceProps);return p.createElement(F||M||"div",{className:y,onScroll:me,ref:this._outerRefSetter,style:Zi({position:"relative",height:S,width:ne,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},x)},p.createElement(T||E||"div",{children:we,ref:w,style:{height:ge?"100%":q,pointerEvents:R?"none":void 0,width:ge?q:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var v=this._getRangeToRender(),y=v[0],b=v[1],S=v[2],w=v[3];this._callOnItemsRendered(y,b,S,w)}}if(typeof this.props.onScroll=="function"){var T=this.state,E=T.scrollDirection,N=T.scrollOffset,I=T.scrollUpdateWasRequested;this._callOnScroll(E,N,I)}},m._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,b=this.state,S=b.isScrolling,w=b.scrollDirection,T=b.scrollOffset;if(v===0)return[0,0,0,0];var E=a(this.props,T,this._instanceProps),N=i(this.props,E,T,this._instanceProps),I=!S||w==="backward"?Math.max(1,y):1,O=!S||w==="forward"?Math.max(1,y):1;return[Math.max(0,E-I),Math.max(0,Math.min(v-1,N+O)),E,N]},g})(p.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var xw=function(t,r){var n=t.children,s=t.direction,o=t.height,a=t.layout,i=t.innerTagName,c=t.outerTagName,d=t.width,u=r.instance;if(process.env.NODE_ENV!=="production"){(i!=null||c!=null)&&la&&!la.has(u)&&(la.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||a==="horizontal";switch(s){case"horizontal":case"vertical":ia&&!ia.has(u)&&(ia.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+s+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(f&&typeof d!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(d===null?"null":typeof d)+'" was specified.'));if(!f&&typeof o!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(o===null?"null":typeof o)+'" was specified.'))}},Fw=50,zn=function(t,r,n){var s=t,o=s.itemSize,a=n.itemMetadataMap,i=n.lastMeasuredIndex;if(r>i){var c=0;if(i>=0){var d=a[i];c=d.offset+d.size}for(var u=i+1;u<=r;u++){var f=o(u);a[u]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return a[r]},Mw=function(t,r,n){var s=r.itemMetadataMap,o=r.lastMeasuredIndex,a=o>0?s[o].offset:0;return a>=n?wf(t,r,o,0,n):Bw(t,r,Math.max(0,o),n)},wf=function(t,r,n,s,o){for(;s<=n;){var a=s+Math.floor((n-s)/2),i=zn(t,a,r).offset;if(i===o)return a;i<o?s=a+1:i>o&&(n=a-1)}return s>0?s-1:0},Bw=function(t,r,n,s){for(var o=t.itemCount,a=1;n<o&&zn(t,n,r).offset<s;)n+=a,a*=2;return wf(t,r,Math.min(n,o-1),Math.floor(n/2),s)},_f=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,o=r.estimatedItemSize,a=r.lastMeasuredIndex,i=0;if(a>=n&&(a=n-1),a>=0){var c=s[a];i=c.offset+c.size}var d=n-a-1,u=d*o;return i+u},$w=Sf({getItemOffset:function(t,r,n){return zn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:_f,getOffsetForIndexAndAlignment:function(t,r,n,s,o,a){var i=t.direction,c=t.height,d=t.layout,u=t.width,f=i==="horizontal"||d==="horizontal",g=f?u:c,m=zn(t,r,o),C=_f(t,o),h=Math.max(0,Math.min(C-g,m.offset)),v=Math.max(0,m.offset-g+m.size+a);switch(n==="smart"&&(s>=v-g&&s<=h+g?n="auto":n="center"),n){case"start":return h;case"end":return v;case"center":return Math.round(v+(h-v)/2);case"auto":default:return s>=v&&s<=h?s:s<v?v:h}},getStartIndexForOffset:function(t,r,n){return Mw(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var o=t.direction,a=t.height,i=t.itemCount,c=t.layout,d=t.width,u=o==="horizontal"||c==="horizontal",f=u?d:a,g=zn(t,r,s),m=n+f,C=g.offset+g.size,h=r;h<i-1&&C<m;)h++,C+=zn(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,o={itemMetadataMap:{},estimatedItemSize:s||Fw,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,i){i===void 0&&(i=!0),o.lastMeasuredIndex=Math.min(o.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),i&&r.forceUpdate()},o},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),jw=Sf({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,s,o,a){var i=t.direction,c=t.height,d=t.itemCount,u=t.itemSize,f=t.layout,g=t.width,m=i==="horizontal"||f==="horizontal",C=m?g:c,h=Math.max(0,d*u-C),v=Math.min(h,r*u),y=Math.max(0,r*u-C+u+a);switch(n==="smart"&&(s>=y-C&&s<=v+C?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var b=Math.round(y+(v-y)/2);return b<Math.ceil(C/2)?0:b>h+Math.floor(C/2)?h:b}case"auto":default:return s>=y&&s<=v?s:s<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/s)))},getStopIndexForStartIndex:function(t,r,n){var s=t.direction,o=t.height,a=t.itemCount,i=t.itemSize,c=t.layout,d=t.width,u=s==="horizontal"||c==="horizontal",f=r*i,g=u?d:o,m=Math.ceil((g+n-f)/i);return Math.max(0,Math.min(a-1,r+m-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function qw(){var e,t;const r=$t(),s=tw().cursor;if(!s||s.type!=="line")return null;const o=r.indent,a=r.rowTopPosition(s.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),i=o*s.level,c=r.renderCursor;return l.jsx(c,{top:a,left:i,indent:o})}var Uw=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const zw=p.forwardRef(function(t,r){const{children:n}=t,s=Uw(t,["children"]),o=$t();return l.jsxs("div",Object.assign({ref:r},s,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[l.jsx(Vw,{}),n]}))}),Vw=()=>{const e=$t();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(qw,{})})};var Hw=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const Qw=p.forwardRef(function(t,r){var n,s,o,a,{style:i}=t,c=Hw(t,["style"]);const d=$t(),u=(s=(n=d.props.padding)!==null&&n!==void 0?n:d.props.paddingTop)!==null&&s!==void 0?s:0,f=(a=(o=d.props.padding)!==null&&o!==void 0?o:d.props.paddingBottom)!==null&&a!==void 0?a:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},i),{height:`${parseFloat(i.height)+u+f}px`})},c))});var Tf=p.createContext({dragDropManager:void 0}),Gt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Gt||(Gt={}));function Te(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(t.replace(/%s/g,function(){return n[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var tl="dnd-core/INIT_COORDS",ca="dnd-core/BEGIN_DRAG",rl="dnd-core/PUBLISH_DRAG_SOURCE",da="dnd-core/HOVER",ua="dnd-core/DROP",fa="dnd-core/END_DRAG";function Ef(e,t){return{type:tl,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function ha(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ha=function(r){return typeof r}:ha=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ha(e)}function Ww(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function Rw(e,t){return e.filter(function(r){return r!==t})}function Af(e){return ha(e)==="object"}function Gw(e,t){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(o,a){o===1&&s.push(a)}),s}function Kw(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var Yw={type:tl,payload:{clientOffset:null,sourceClientOffset:null}};function Zw(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=n.publishSource,o=s===void 0?!0:s,a=n.clientOffset,i=n.getSourceClientOffset,c=e.getMonitor(),d=e.getRegistry();e.dispatch(Ef(a)),Xw(r,c,d);var u=t_(r,c);if(u===null){e.dispatch(Yw);return}var f=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");Jw(i),f=i(u)}e.dispatch(Ef(a,f));var g=d.getSource(u),m=g.beginDrag(c,u);if(m!=null){e_(m),d.pinSource(u);var C=d.getSourceType(u);return{type:ca,payload:{itemType:C,item:m,sourceId:u,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}}function Xw(e,t,r){Te(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Te(r.getSource(n),"Expected sourceIds to be registered.")})}function Jw(e){Te(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function e_(e){Te(Af(e),"Item must be an object.")}function t_(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function r_(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:rl}}}function nl(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function n_(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;s_(r);var o=r.slice(0),a=e.getMonitor(),i=e.getRegistry();o_(o,a,i);var c=a.getItemType();return a_(o,i,c),i_(o,a,i),{type:da,payload:{targetIds:o,clientOffset:s||null}}}}function s_(e){Te(Array.isArray(e),"Expected targetIds to be an array.")}function o_(e,t,r){Te(t.isDragging(),"Cannot call hover while not dragging."),Te(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var s=e[n];Te(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(s);Te(o,"Expected targetIds to be registered.")}}function a_(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],o=t.getTargetType(s);nl(o,r)||e.splice(n,1)}}function i_(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function If(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kf(Object(r),!0).forEach(function(n){l_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function l_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c_(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();d_(n);var o=h_(n);o.forEach(function(a,i){var c=u_(a,i,s,n),d={type:ua,payload:{dropResult:If(If({},r),c)}};e.dispatch(d)})}}function d_(e){Te(e.isDragging(),"Cannot call drop while not dragging."),Te(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function u_(e,t,r,n){var s=r.getTarget(e),o=s?s.drop(n,e):void 0;return f_(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function f_(e){Te(typeof e>"u"||Af(e),"Drop result must either be an object or undefined.")}function h_(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function p_(e){return function(){var r=e.getMonitor(),n=e.getRegistry();g_(r);var s=r.getSourceId();if(s!=null){var o=n.getSource(s,!0);o.endDrag(r,s),n.unpinSource()}return{type:fa}}}function g_(e){Te(e.isDragging(),"Cannot call endDrag while not dragging.")}function m_(e){return{beginDrag:Zw(e),publishDragSource:r_(e),hover:n_(e),drop:c_(e),endDrag:p_(e)}}function v_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b_(e,t,r){return t&&y_(e.prototype,t),e}function Us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var C_=(function(){function e(t,r){var n=this;v_(this,e),Us(this,"store",void 0),Us(this,"monitor",void 0),Us(this,"backend",void 0),Us(this,"isSetUp",!1),Us(this,"handleRefCountChange",function(){var s=n.store.getState().refCount>0;n.backend&&(s&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!s&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return b_(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function s(a){return function(){for(var i=arguments.length,c=new Array(i),d=0;d<i;d++)c[d]=arguments[d];var u=a.apply(r,c);typeof u<"u"&&n(u)}}var o=m_(this);return Object.keys(o).reduce(function(a,i){var c=o[i];return a[i]=s(c),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function Kt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Lf=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Df=function(){return Math.random().toString(36).substring(7).split("").join(".")},Nf={INIT:"@@redux/INIT"+Df(),REPLACE:"@@redux/REPLACE"+Df()};function S_(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function w_(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(E_(e))return"date";if(T_(e))return"error";var r=__(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function __(e){return typeof e.constructor=="function"?e.constructor.name:null}function T_(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function E_(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Vn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=w_(e)),t}function Pf(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Kt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Kt(1):"Expected the enhancer to be a function. Instead, received: '"+Vn(r)+"'");return r(Pf)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Kt(2):"Expected the root reducer to be a function. Instead, received: '"+Vn(e)+"'");var s=e,o=t,a=[],i=a,c=!1;function d(){i===a&&(i=a.slice())}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?Kt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Kt(4):"Expected the listener to be a function. Instead, received: '"+Vn(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Kt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return d(),i.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Kt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,d();var b=i.indexOf(h);i.splice(b,1),a=null}}}function g(h){if(!S_(h))throw new Error(process.env.NODE_ENV==="production"?Kt(7):"Actions must be plain objects. Instead, the actual type was: '"+Vn(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Kt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Kt(9):"Reducers may not dispatch actions.");try{c=!0,o=s(o,h)}finally{c=!1}for(var v=a=i,y=0;y<v.length;y++){var b=v[y];b()}return h}function m(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Kt(10):"Expected the nextReducer to be a function. Instead, received: '"+Vn(h));s=h,g({type:Nf.REPLACE})}function C(){var h,v=f;return h={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?Kt(11):"Expected the observer to be an object. Instead, received: '"+Vn(b)+"'");function S(){b.next&&b.next(u())}S();var w=v(S);return{unsubscribe:w}}},h[Lf]=function(){return this},h}return g({type:Nf.INIT}),n={dispatch:g,subscribe:f,getState:u,replaceReducer:m},n[Lf]=C,n}var A_=function(t,r){return t===r};function k_(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function I_(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A_;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Of(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Of(Object(r),!0).forEach(function(n){L_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Of(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function L_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ff={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function D_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ff,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case tl:case ca:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case da:return k_(e.clientOffset,r.clientOffset)?e:xf(xf({},e),{},{clientOffset:r.clientOffset});case fa:case ua:return Ff;default:return e}}var sl="dnd-core/ADD_SOURCE",ol="dnd-core/ADD_TARGET",al="dnd-core/REMOVE_SOURCE",pa="dnd-core/REMOVE_TARGET";function N_(e){return{type:sl,payload:{sourceId:e}}}function P_(e){return{type:ol,payload:{targetId:e}}}function O_(e){return{type:al,payload:{sourceId:e}}}function x_(e){return{type:pa,payload:{targetId:e}}}function Mf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mf(Object(r),!0).forEach(function(n){F_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function F_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M_={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function B_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M_,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case ca:return Yt(Yt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rl:return Yt(Yt({},e),{},{isSourcePublic:!0});case da:return Yt(Yt({},e),{},{targetIds:r.targetIds});case pa:return e.targetIds.indexOf(r.targetId)===-1?e:Yt(Yt({},e),{},{targetIds:Rw(e.targetIds,r.targetId)});case ua:return Yt(Yt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case fa:return Yt(Yt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function $_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case sl:case ol:return e+1;case al:case pa:return e-1;default:return e}}var ga=[],il=[];ga.__IS_NONE__=!0,il.__IS_ALL__=!0;function j_(e,t){if(e===ga)return!1;if(e===il||typeof t>"u")return!0;var r=Kw(t,e);return r.length>0}function q_(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case da:break;case sl:case ol:case pa:case al:return ga;case ca:case rl:case fa:case ua:default:return il}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,o=s===void 0?[]:s,a=Gw(n,o),i=a.length>0||!I_(n,o);if(!i)return ga;var c=o[o.length-1],d=n[n.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function U_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $f(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bf(Object(r),!0).forEach(function(n){z_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function z_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function V_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:q_(e.dirtyHandlerIds,{type:t.type,payload:$f($f({},t.payload),{},{prevTargetIds:Ww(e,"dragOperation.targetIds",[])})}),dragOffset:D_(e.dragOffset,t),refCount:$_(e.refCount,t),dragOperation:B_(e.dragOperation,t),stateId:U_(e.stateId)}}function H_(e,t){return{x:e.x+t.x,y:e.y+t.y}}function jf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Q_(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:jf(H_(t,n),r)}function W_(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:jf(t,r)}function R_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function K_(e,t,r){return t&&G_(e.prototype,t),e}function qf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Y_=(function(){function e(t,r){R_(this,e),qf(this,"store",void 0),qf(this,"registry",void 0),this.store=t,this.registry=r}return K_(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;Te(typeof r=="function","listener must be a function."),Te(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,i=function(){var d=n.store.getState(),u=d.stateId;try{var f=u===a||u===a+1&&!j_(d.dirtyHandlerIds,o);f||r()}finally{a=u}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;Te(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var i=n.store.getState().dragOffset;i!==s&&(s=i,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return Te(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(Te(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(r),o=this.getItemType();return nl(s,o)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(Te(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(r),o=this.getItemType();return s!==o?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var s=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();if(a&&!nl(o,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var c=i.indexOf(r);return s?c===i.length-1:c>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return Q_(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return W_(this.store.getState().dragOffset)}}]),e})(),Z_=0;function X_(){return Z_++}function ma(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ma=function(r){return typeof r}:ma=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ma(e)}function J_(e){Te(typeof e.canDrag=="function","Expected canDrag to be a function."),Te(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Te(typeof e.endDrag=="function","Expected endDrag to be a function.")}function e1(e){Te(typeof e.canDrop=="function","Expected canDrop to be a function."),Te(typeof e.hover=="function","Expected hover to be a function."),Te(typeof e.drop=="function","Expected beginDrag to be a function.")}function ll(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return ll(r,!1)});return}Te(typeof e=="string"||ma(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Uf=typeof global<"u"?global:self,zf=Uf.MutationObserver||Uf.WebKitMutationObserver;function Vf(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function t1(e){let t=1;const r=new zf(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const r1=typeof zf=="function"?t1:Vf;class n1{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,s=t.length-this.index;n<s;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=r1(this.flush),this.requestErrorThrow=Vf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class s1{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class o1{create(t){const r=this.freeTasks,n=r.length?r.pop():new s1(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Hf=new n1,a1=new o1(Hf.registerPendingError);function i1(e){Hf.enqueueTask(a1.create(e))}function l1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d1(e,t,r){return t&&c1(e.prototype,t),e}function Hn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u1(e,t){return g1(e)||p1(e,t)||h1(e,t)||f1()}function f1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
537
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h1(e,t){if(e){if(typeof e=="string")return Qf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qf(e,t)}}function Qf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function g1(e){if(Array.isArray(e))return e}function m1(e){var t=X_().toString();switch(e){case Gt.SOURCE:return"S".concat(t);case Gt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Wf(e){switch(e[0]){case"S":return Gt.SOURCE;case"T":return Gt.TARGET;default:Te(!1,"Cannot parse handler ID: ".concat(e))}}function Rf(e,t){var r=e.entries(),n=!1;do{var s=r.next(),o=s.done,a=u1(s.value,2),i=a[1];if(i===t)return!0;n=!!o}while(!n);return!1}var v1=(function(){function e(t){l1(this,e),Hn(this,"types",new Map),Hn(this,"dragSources",new Map),Hn(this,"dropTargets",new Map),Hn(this,"pinnedSourceId",null),Hn(this,"pinnedSource",null),Hn(this,"store",void 0),this.store=t}return d1(e,[{key:"addSource",value:function(r,n){ll(r),J_(n);var s=this.addHandler(Gt.SOURCE,r,n);return this.store.dispatch(N_(s)),s}},{key:"addTarget",value:function(r,n){ll(r,!0),e1(n);var s=this.addHandler(Gt.TARGET,r,n);return this.store.dispatch(P_(s)),s}},{key:"containsHandler",value:function(r){return Rf(this.dragSources,r)||Rf(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Te(this.isSourceId(r),"Expected a valid source ID.");var s=n&&r===this.pinnedSourceId,o=s?this.pinnedSource:this.dragSources.get(r);return o}},{key:"getTarget",value:function(r){return Te(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return Te(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return Te(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Wf(r);return n===Gt.SOURCE}},{key:"isTargetId",value:function(r){var n=Wf(r);return n===Gt.TARGET}},{key:"removeSource",value:function(r){var n=this;Te(this.getSource(r),"Expected an existing source."),this.store.dispatch(O_(r)),i1(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){Te(this.getTarget(r),"Expected an existing target."),this.store.dispatch(x_(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);Te(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){Te(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,s){var o=m1(r);return this.types.set(o,n),r===Gt.SOURCE?this.dragSources.set(o,s):r===Gt.TARGET&&this.dropTargets.set(o,s),o}}]),e})();function y1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=b1(n),o=new Y_(s,new v1(s)),a=new C_(s,o),i=e(a,t,r);return a.receiveBackend(i),a}function b1(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Pf(V_,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var C1=["children"];function S1(e,t){return E1(e)||T1(e,t)||_1(e,t)||w1()}function w1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
538
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _1(e,t){if(e){if(typeof e=="string")return Gf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gf(e,t)}}function Gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function E1(e){if(Array.isArray(e))return e}function A1(e,t){if(e==null)return{};var r=k1(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function k1(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var Kf=0,va=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),I1=p.memo(function(t){var r=t.children,n=A1(t,C1),s=L1(n),o=S1(s,2),a=o[0],i=o[1];return p.useEffect(function(){if(i){var c=Yf();return++Kf,function(){--Kf===0&&(c[va]=null)}}},[]),l.jsx(Tf.Provider,Object.assign({value:a},{children:r}),void 0)});function L1(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=D1(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function D1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yf(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[va]||(s[va]={dragDropManager:y1(e,t,r,n)}),s[va]}function Yf(){return typeof global<"u"?global:window}function N1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function O1(e,t,r){return t&&P1(e.prototype,t),e}function Zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cl=!1,dl=!1,x1=(function(){function e(t){N1(this,e),Zf(this,"internalMonitor",void 0),Zf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return O1(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Te(!cl,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return cl=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{cl=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Te(!dl,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return dl=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{dl=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function F1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function B1(e,t,r){return t&&M1(e.prototype,t),e}function Xf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ul=!1,$1=(function(){function e(t){F1(this,e),Xf(this,"internalMonitor",void 0),Xf(this,"targetId",null),this.internalMonitor=t.getMonitor()}return B1(e,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Te(!ul,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ul=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ul=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function j1(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function q1(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!p.isValidElement(t)){var n=t;return e(n,r),n}var s=t;j1(s);var o=r?function(a){return e(a,r)}:e;return U1(s,o)}}function Jf(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var s=q1(n);t[r]=function(){return s}}}),t}function eh(e,t){typeof e=="function"?e(t):e.current=t}function U1(e,t){var r=e.ref;return Te(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?p.cloneElement(e,{ref:function(s){eh(r,s),eh(t,s)}}):p.cloneElement(e,{ref:t})}function ya(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ya=function(r){return typeof r}:ya=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ya(e)}function fl(e){return e!==null&&ya(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function hl(e,t,r,n){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var d=o[c];if(!i(d))return!1;var u=e[d],f=t[d];if(s=void 0,s===!1||s===void 0&&u!==f)return!1}return!0}function z1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H1(e,t,r){return t&&V1(e.prototype,t),e}function At(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Q1=(function(){function e(t){var r=this;z1(this,e),At(this,"hooks",Jf({dragSource:function(s,o){r.clearDragSource(),r.dragSourceOptions=o||null,fl(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,fl(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),At(this,"handlerId",null),At(this,"dragSourceRef",null),At(this,"dragSourceNode",void 0),At(this,"dragSourceOptionsInternal",null),At(this,"dragSourceUnsubscribe",void 0),At(this,"dragPreviewRef",null),At(this,"dragPreviewNode",void 0),At(this,"dragPreviewOptionsInternal",null),At(this,"dragPreviewUnsubscribe",void 0),At(this,"lastConnectedHandlerId",null),At(this,"lastConnectedDragSource",null),At(this,"lastConnectedDragSourceOptions",null),At(this,"lastConnectedDragPreview",null),At(this,"lastConnectedDragPreviewOptions",null),At(this,"backend",void 0),this.backend=t}return H1(e,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!hl(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!hl(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e})();function W1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function G1(e,t,r){return t&&R1(e.prototype,t),e}function gr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K1=(function(){function e(t){var r=this;W1(this,e),gr(this,"hooks",Jf({dropTarget:function(s,o){r.clearDropTarget(),r.dropTargetOptions=o,fl(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),gr(this,"handlerId",null),gr(this,"dropTargetRef",null),gr(this,"dropTargetNode",void 0),gr(this,"dropTargetOptionsInternal",null),gr(this,"unsubscribeDropTarget",void 0),gr(this,"lastConnectedHandlerId",null),gr(this,"lastConnectedDropTarget",null),gr(this,"lastConnectedDropTargetOptions",null),gr(this,"backend",void 0),this.backend=t}return G1(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!hl(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e})();function Y1(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function Z1(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var on=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ba(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ba=function(r){return typeof r}:ba=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ba(e)}function X1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eT(e,t,r){return t&&J1(e.prototype,t),e}function pl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tT=(function(){function e(t,r,n){X1(this,e),pl(this,"spec",void 0),pl(this,"monitor",void 0),pl(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return eT(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,o=null;return ba(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(s):o={},(r=o)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var s=this.spec,o=this.monitor,a=s.isDragging;return a?a(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,o=r.end;o&&o(n.getItem(),n),s.reconnect()}}]),e})();function rT(e,t,r){var n=p.useMemo(function(){return new tT(e,t,r)},[t,r]);return p.useEffect(function(){n.spec=e},[e]),n}function an(){var e=p.useContext(Tf),t=e.dragDropManager;return Te(t!=null,"Expected drag drop context"),t}function nT(e){return p.useMemo(function(){var t=e.type;return Te(t!=null,"spec.type must be defined"),t},[e])}function sT(e,t){return lT(e)||iT(e,t)||aT(e,t)||oT()}function oT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aT(e,t){if(e){if(typeof e=="string")return th(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function lT(e){if(Array.isArray(e))return e}function cT(e,t,r){var n=an(),s=rT(e,t,r),o=nT(e);on(function(){if(o!=null){var i=Z1(o,s,n),c=sT(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u}},[n,t,r,s,o])}function dT(e){return pT(e)||hT(e)||fT(e)||uT()}function uT(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
540
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fT(e,t){if(e){if(typeof e=="string")return gl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gl(e,t)}}function hT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pT(e){if(Array.isArray(e))return gl(e)}function gl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rh(e,t){var r=dT(t||[]);return t==null&&typeof e!="function"&&r.push(e),p.useMemo(function(){return typeof e=="function"?e():e},r)}function gT(){var e=an();return p.useMemo(function(){return new x1(e)},[e])}function mT(e,t){var r=an(),n=p.useMemo(function(){return new Q1(r.getBackend())},[r]);return on(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),on(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var ml,nh;function vT(){return nh||(nh=1,ml=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),ml}var yT=vT();const bT=yi(yT);function CT(e,t){return TT(e)||_T(e,t)||wT(e,t)||ST()}function ST(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
541
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wT(e,t){if(e){if(typeof e=="string")return sh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sh(e,t)}}function sh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _T(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function TT(e){if(Array.isArray(e))return e}function oh(e,t,r){var n=p.useState(function(){return t(e)}),s=CT(n,2),o=s[0],a=s[1],i=p.useCallback(function(){var c=t(e);bT(o,c)||(a(c),r&&r())},[o,e,r]);return on(i),[o,i]}function ET(e,t){return LT(e)||IT(e,t)||kT(e,t)||AT()}function AT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
542
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kT(e,t){if(e){if(typeof e=="string")return ah(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ah(e,t)}}function ah(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function IT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function LT(e){if(Array.isArray(e))return e}function DT(e,t,r){var n=oh(e,t,r),s=ET(n,2),o=s[0],a=s[1];return on(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(a,{handlerIds:[c]})},[e,a]),o}function ih(e,t,r){return DT(t,e||function(){return{}},function(){return r.reconnect()})}function NT(e){return p.useMemo(function(){return e.hooks.dragSource()},[e])}function PT(e){return p.useMemo(function(){return e.hooks.dragPreview()},[e])}function OT(e,t){var r=rh(e,t);Te(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=gT(),s=mT(r.options,r.previewOptions);return cT(r,n,s),[ih(r.collect,n,s),NT(s),PT(s)]}function xT(e){var t=e.accept;return p.useMemo(function(){return Te(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function FT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function BT(e,t,r){return t&&MT(e.prototype,t),e}function lh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $T=(function(){function e(t,r){FT(this,e),lh(this,"spec",void 0),lh(this,"monitor",void 0),this.spec=t,this.monitor=r}return BT(e,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),e})();function jT(e,t){var r=p.useMemo(function(){return new $T(e,t)},[t]);return p.useEffect(function(){r.spec=e},[e]),r}function qT(e,t){return HT(e)||VT(e,t)||zT(e,t)||UT()}function UT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
543
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zT(e,t){if(e){if(typeof e=="string")return ch(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ch(e,t)}}function ch(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function VT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function HT(e){if(Array.isArray(e))return e}function QT(e,t,r){var n=an(),s=jT(e,t),o=xT(e);on(function(){var i=Y1(o,s,n),c=qT(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u},[n,t,s,r,o.map(function(a){return a.toString()}).join("|")])}function WT(){var e=an();return p.useMemo(function(){return new $1(e)},[e])}function RT(e){var t=an(),r=p.useMemo(function(){return new K1(t.getBackend())},[t]);return on(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function GT(e){return p.useMemo(function(){return e.hooks.dropTarget()},[e])}function dh(e,t){var r=rh(e,t),n=WT(),s=RT(r.options);return QT(r,n,s),[ih(r.collect,n,s),GT(s)]}function KT(e,t){return JT(e)||XT(e,t)||ZT(e,t)||YT()}function YT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
544
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZT(e,t){if(e){if(typeof e=="string")return uh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uh(e,t)}}function uh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function JT(e){if(Array.isArray(e))return e}function e0(e){var t=an(),r=t.getMonitor(),n=oh(r,e),s=KT(n,2),o=s[0],a=s[1];return p.useEffect(function(){return r.subscribeToOffsetChange(a)}),p.useEffect(function(){return r.subscribeToStateChange(a)}),o}function fh(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function t0(e,t){return e.filter(function(r){return r!==t})}function r0(e,t){var r=new Set,n=function(a){return r.add(a)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(o){return s.push(o)}),s}function n0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o0(e,t,r){return t&&s0(e.prototype,t),e}function hh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a0=(function(){function e(t){n0(this,e),hh(this,"entered",[]),hh(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return o0(e,[{key:"enter",value:function(r){var n=this,s=this.entered.length,o=function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(r))};return this.entered=r0(this.entered.filter(o),[r]),s===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=t0(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),i0=fh(function(){return/firefox/i.test(navigator.userAgent)}),ph=fh(function(){return!!window.safari});function l0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d0(e,t,r){return t&&c0(e.prototype,t),e}function zs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gh=(function(){function e(t,r){l0(this,e),zs(this,"xs",void 0),zs(this,"ys",void 0),zs(this,"c1s",void 0),zs(this,"c2s",void 0),zs(this,"c3s",void 0);for(var n=t.length,s=[],o=0;o<n;o++)s.push(o);s.sort(function(I,O){return t[I]<t[O]?-1:1});for(var a=[],i=[],c,d,u=0;u<n-1;u++)c=t[u+1]-t[u],d=r[u+1]-r[u],a.push(c),i.push(d/c);for(var f=[i[0]],g=0;g<a.length-1;g++){var m=i[g],C=i[g+1];if(m*C<=0)f.push(0);else{c=a[g];var h=a[g+1],v=c+h;f.push(3*v/((v+h)/m+(v+c)/C))}}f.push(i[i.length-1]);for(var y=[],b=[],S,w=0;w<f.length-1;w++){S=i[w];var T=f[w],E=1/a[w],N=T+f[w+1]-S-S;y.push((S-T-N)*E),b.push(N*E*E)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=b}return d0(e,[{key:"interpolate",value:function(r){var n=this.xs,s=this.ys,o=this.c1s,a=this.c2s,i=this.c3s,c=n.length-1;if(r===n[c])return s[c];for(var d=0,u=i.length-1,f;d<=u;){f=Math.floor(.5*(d+u));var g=n[f];if(g<r)d=f+1;else if(g>r)u=f-1;else return s[f]}c=Math.max(0,u);var m=r-n[c],C=m*m;return s[c]+o[c]*m+a[c]*C+i[c]*m*C}}]),e})(),u0=1;function mh(e){var t=e.nodeType===u0?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function Ca(e){return{x:e.clientX,y:e.clientY}}function f0(e){var t;return e.nodeName==="IMG"&&(i0()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function h0(e,t,r,n){var s=e?t.width:r,o=e?t.height:n;return ph()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function p0(e,t,r,n,s){var o=f0(t),a=o?e:t,i=mh(a),c={x:r.x-i.x,y:r.y-i.y},d=e.offsetWidth,u=e.offsetHeight,f=n.anchorX,g=n.anchorY,m=h0(o,t,d,u),C=m.dragPreviewWidth,h=m.dragPreviewHeight,v=function(){var N=new gh([0,.5,1],[c.y,c.y/u*h,c.y+h-u]),I=N.interpolate(g);return ph()&&o&&(I+=(window.devicePixelRatio-1)*h),I},y=function(){var N=new gh([0,.5,1],[c.x,c.x/d*C,c.x+C-d]);return N.interpolate(f)},b=s.offsetX,S=s.offsetY,w=b===0||b,T=S===0||S;return{x:w?b:y(),y:T?S:v()}}var vh="__NATIVE_FILE__",yh="__NATIVE_URL__",bh="__NATIVE_TEXT__",Ch="__NATIVE_HTML__";const Sh=Object.freeze(Object.defineProperty({__proto__:null,FILE:vh,HTML:Ch,TEXT:bh,URL:yh},Symbol.toStringTag,{value:"Module"}));function vl(e,t,r){var n=t.reduce(function(s,o){return s||e.getData(o)},"");return n??r}var Qn;function Sa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yl=(Qn={},Sa(Qn,vh,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Sa(Qn,Ch,{exposeProperties:{html:function(t,r){return vl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Sa(Qn,yh,{exposeProperties:{urls:function(t,r){return vl(t,r,"").split(`
545
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Sa(Qn,bh,{exposeProperties:{text:function(t,r){return vl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Qn);function g0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function v0(e,t,r){return t&&m0(e.prototype,t),e}function wh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y0=(function(){function e(t){g0(this,e),wh(this,"item",void 0),wh(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return v0(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var s={};Object.keys(this.config.exposeProperties).forEach(function(o){s[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,s)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e})();function b0(e,t){var r=new y0(yl[e]);return r.loadDataTransfer(t),r}function bl(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(yl).filter(function(r){var n=yl[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function C0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function w0(e,t,r){return t&&S0(e.prototype,t),e}function Cl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _0=(function(){function e(t,r){C0(this,e),Cl(this,"ownerDocument",null),Cl(this,"globalContext",void 0),Cl(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return w0(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e})();function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Th(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_h(Object(r),!0).forEach(function(n){De(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function A0(e,t,r){return t&&E0(e.prototype,t),e}function De(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var k0=(function(){function e(t,r,n){var s=this;T0(this,e),De(this,"options",void 0),De(this,"actions",void 0),De(this,"monitor",void 0),De(this,"registry",void 0),De(this,"enterLeaveCounter",void 0),De(this,"sourcePreviewNodes",new Map),De(this,"sourcePreviewNodeOptions",new Map),De(this,"sourceNodes",new Map),De(this,"sourceNodeOptions",new Map),De(this,"dragStartSourceIds",null),De(this,"dropTargetIds",[]),De(this,"dragEnterTargetIds",[]),De(this,"currentNativeSource",null),De(this,"currentNativeHandle",null),De(this,"currentDragSourceNode",null),De(this,"altKeyPressed",!1),De(this,"mouseMoveTimeoutTimer",null),De(this,"asyncEndDragFrameId",null),De(this,"dragOverTargetIds",null),De(this,"lastClientOffset",null),De(this,"hoverRafId",null),De(this,"getSourceClientOffset",function(o){var a=s.sourceNodes.get(o);return a&&mh(a)||null}),De(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),De(this,"isNodeInDocument",function(o){return!!(o&&s.document&&s.document.body&&s.document.body.contains(o))}),De(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=s.currentDragSourceNode;o==null||s.isNodeInDocument(o)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),De(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),De(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=s.dragStartSourceIds;s.dragStartSourceIds=null;var i=Ca(o);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:i});var c=o.dataTransfer,d=bl(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=s.monitor.getSourceId(),f=s.sourceNodes.get(u),g=s.sourcePreviewNodes.get(u)||f;if(g){var m=s.getCurrentSourcePreviewNodeOptions(),C=m.anchorX,h=m.anchorY,v=m.offsetX,y=m.offsetY,b={anchorX:C,anchorY:h},S={offsetX:v,offsetY:y},w=p0(f,g,i,b,S);c.setDragImage(g,w.x,w.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(o.target);var T=s.getCurrentSourcePreviewNodeOptions(),E=T.captureDraggingState;E?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(d)s.beginDragNativeItem(d);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),De(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),De(this,"handleTopDragEnterCapture",function(o){s.dragEnterTargetIds=[];var a=s.enterLeaveCounter.enter(o.target);if(!(!a||s.monitor.isDragging())){var i=o.dataTransfer,c=bl(i);c&&s.beginDragNativeItem(c,i)}}),De(this,"handleTopDragEnter",function(o){var a=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=o.altKey,a.length>0&&s.actions.hover(a,{clientOffset:Ca(o)});var i=a.some(function(c){return s.monitor.canDropOnTarget(c)});i&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),De(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),De(this,"handleTopDragOver",function(o){var a=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=Ca(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(a||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var i=(a||[]).some(function(c){return s.monitor.canDropOnTarget(c)});i?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),De(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var a=s.enterLeaveCounter.leave(o.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),De(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var a;o.preventDefault(),(a=s.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else bl(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),De(this,"handleTopDrop",function(o){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:Ca(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),De(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new _0(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new a0(this.isNodeInDocument)}return A0(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,s){var o=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var a=function(d){return o.handleDragStart(d,r)},i=function(d){return o.handleSelectStart(d)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,o=function(d){return s.handleDragEnter(d,r)},a=function(d){return s.handleDragOver(d,r)},i=function(d){return s.handleDrop(d,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",a),n.addEventListener("drop",i),function(){n.removeEventListener("dragenter",o),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Th({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Th({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Sh).some(function(n){return Sh[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=b0(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e})(),wa;function I0(){return wa||(wa=new Image,wa.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),wa}var L0=function(t,r,n){return new k0(t,r,n)};function D0(e,t){return typeof e=="function"?e(t):e??"NODE"}function N0(e){return e.isDraggable&&!e.isEditing}function P0(e){const t=$t(),r=t.selectedIds,[n,s,o]=OT(()=>({canDrag:()=>N0(e),type:D0(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(qn.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(qn.dragEnd())}}),[r,e,t.props.dragType]);return p.useEffect(()=>{o(I0())},[o]),s}function O0(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),o=r.height,a=s<o/2,i=!a,c=o/4,d=s>c&&s<o-c;return{x:n,inTopHalf:a,inBottomHalf:i,inMiddle:d,atTop:!d&&a,atBottom:!d&&i}}function x0(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function _a(e,t){return{parentId:e||null,index:t}}function Wn(e,t){return{type:"line",index:e,level:t}}function F0(e){return{type:"highlight",id:e}}function Sl(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const s=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=sf(n)+1;return{parentId:s,index:o}}function Eh(e){var t;const r=O0(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:a,prevNode:i}=e,[c,d]=x0(o,i,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:_a(o.id,null),cursor:F0(o.id)};if(!c)return{drop:_a((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:Wn(0,0)};if(ef(c)){const u=oa(s,(d==null?void 0:d.level)||0,c.level);return{drop:Sl(c,u),cursor:Wn(c.rowIndex+1,u)}}if(tf(c)){const u=oa(s,(d==null?void 0:d.level)||0,c.level);return{drop:Sl(c,u),cursor:Wn(c.rowIndex+1,u)}}if(rf(c)){const u=oa(s,0,c.level+1);return u>c.level?{drop:_a(c.id,0),cursor:Wn(c.rowIndex+1,u)}:{drop:Sl(c,u),cursor:Wn(c.rowIndex+1,u)}}return{drop:_a(c==null?void 0:c.id,0),cursor:Wn(c.rowIndex+1,c.level+1)}}function M0(e,t){const r=$t(),[n,s]=dh(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const i=a.getClientOffset();if(!e.current||!i)return;const{cursor:c,drop:d}=Eh({element:e.current,offset:i,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch(qn.hovering(d.parentId,d.index)),a.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function B0(e){const t=$t(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return p.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Ah=p.memo(function({index:t,style:r}){Ju(),ew();const n=$t(),s=B0(t),o=p.useRef(null),a=P0(s),i=M0(o,s),c=p.useCallback(h=>{o.current=h,i(h)},[i]),d=n.indent*s.level,u=p.useMemo(()=>({paddingLeft:d}),[d]),f=p.useMemo(()=>{var h,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};p.useEffect(()=>{var h;!s.isEditing&&s.isFocused&&((h=o.current)===null||h===void 0||h.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,o.current]);const m=n.renderNode,C=n.renderRow;return l.jsx(C,{node:s,innerRef:c,attrs:g,children:l.jsx(m,{node:s,tree:n,style:u,dragHandle:a})})});let wl="",kh=null;function Ih(){Ju();const e=$t();return l.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const s=Array.from(e.selectedIds);if(s.length>1){let o=e.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=e.lastNode),e.focus(o,{scroll:!1}),e.delete(Array.from(s))}else{const o=e.focusedNode;if(o){const a=o.nextSibling,i=o.parent;e.focus(a||i,{scroll:!1}),e.delete(o)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),of(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),af(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const s=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const s=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const s=e.focusedNode;if(!s)return;s.isInternal&&s.isOpen?e.focus(e.nextNode):s.isInternal&&e.open(s.id);return}if(t.key==="ArrowLeft"){const s=e.focusedNode;if(!s||s.isRoot)return;s.isInternal&&s.isOpen?e.close(s.id):!((r=s.parent)===null||r===void 0)&&r.isRoot||e.focus(s.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const s=e.focusedNode;if(!s||!s.isEditable||!e.props.onRename)return;setTimeout(()=>{s&&e.edit(s)});return}if(t.key===" "){t.preventDefault();const s=e.focusedNode;if(!s)return;s.isLeaf?(s.select(),s.activate()):s.toggle();return}if(t.key==="*"){const s=e.focusedNode;if(!s)return;e.openSiblings(s);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(kh),wl+=t.key,kh=setTimeout(()=>{wl=""},600);const n=e.visibleNodes.find(s=>{const o=s.data.name;return typeof o=="string"?o.toLowerCase().startsWith(wl):!1});n&&e.focus(n.id)},children:l.jsx($0,{})})}function $0(){var e,t;const r=$t(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var o;return((o=r.visibleNodes[s])===null||o===void 0?void 0:o.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:zw,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:Qw,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx($w,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Ah})):l.jsx(jw,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Ah}))}function Lh(e){return e.isFiltered?q0(e.root,e.isMatch.bind(e)):j0(e.root)}function j0(e){const t=[];function r(n){var s;n.level>=0&&t.push(n),n.isOpen&&((s=n.children)===null||s===void 0||s.forEach(r))}return r(e),t.forEach(Dh),t}function q0(e,t){const r={},n=[];function s(a){if(!a.isRoot&&t(a)){r[a.id]=!0;let c=a.parent;for(;c;)r[c.id]=!0,c=c.parent}if(a.children)for(let c of a.children)s(c)}function o(a){var i;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((i=a.children)===null||i===void 0||i.forEach(o))}return s(e),o(e),n.forEach(Dh),n}function Dh(e,t){e.rowIndex=t}const Nh=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var _l=function(e,t,r,n){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function i(u){try{d(n.next(u))}catch(f){a(f)}}function c(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?o(u.value):s(u.value).then(i,c)}d((n=n.apply(e,t||[])).next())})};const{safeRun:kt}=ow;class Vs{constructor(t,r,n,s){this.store=t,this.props=r,this.list=n,this.listEl=s,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=o=>{const a=this.props.rowHeight;if(typeof a=="function"){const i=this.at(o);return i?a(i):this.rowHeight}return a??24},this.rowTopPosition=o=>{if(typeof this.props.rowHeight!="function")return o*this.rowHeight;const a=this.getRowOffsets(),i=Math.max(0,Math.min(o,a.length-1));return a[i]},this.redrawList=(o=0)=>{this.rowOffsets=null;const a=this.list.current;a&&"resetAfterIndex"in a&&a.resetAfterIndex(Math.max(0,o))},this.root=ff(this),this.visibleNodes=Lh(this),this.idToIndex=Nh(this.visibleNodes)}update(t){this.props=t,this.root=ff(this),this.visibleNodes=Lh(this),this.idToIndex=Nh(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:((n,s)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(s.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=$s(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=$s(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof qs)return t.id;const r=this.props.idAccessor||"id";return $s(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const s=(n=this.indexOf(t))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const a=Math.min(s,o),i=Math.max(s,o);return this.visibleNodes.slice(a,i+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return _l(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?uf(this):t.parentId,o=(r=t.index)!==null&&r!==void 0?r:df(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",i=yield kt(this.props.onCreate,{type:a,parentId:s,index:o,parentNode:this.get(s)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(t){return _l(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(a=>this.identify(a)),s=n.map(a=>this.get(a)).filter(a=>!!a),o=s.length?Math.min(...s.map(a=>{var i;return(i=a.rowIndex)!==null&&i!==void 0?i:0})):0;yield kt(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(o)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(Ki(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(o=>{Vs.editPromise=o})}submit(t,r){return _l(this,void 0,void 0,function*(){var n,s;if(!t)return;const o=this.identify(t);yield kt(this.props.onRename,{id:o,name:r,node:this.get(o)}),this.dispatch(Ki(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Ki(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&kt(this.props.onActivate,r)}resolveEdit(t){const r=Vs.editPromise;r&&r(t),Vs.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch($n(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&kt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-o,0),this.focus(this.at(a))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,o=s-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a<s?a=s:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,o=this.identify(t);s&&this.dispatch($n(o)),!((n=this.get(o))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[o],anchor:o,mostRecent:o}),this.scrollTo(o,r.align),this.focusedNode&&s&&kt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Mr.remove(r)),kt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const s=r.focus!==!1;s&&this.dispatch($n(n.id)),n.isSelectable&&(this.dispatch(Mr.add(n.id)),this.dispatch(Mr.anchor(n.id)),this.dispatch(Mr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&kt(this.props.onFocus,this.focusedNode),kt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch($n(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:o}=this.state.nodes.selection,a=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(Mr.remove(this.nodesBetween(s,o))),this.dispatch(Mr.add(a)),this.dispatch(Mr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&kt(this.props.onFocus,this.focusedNode),kt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const s=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:s,anchor:(t=s[0])!==null&&t!==void 0?t:null,mostRecent:(r=s[s.length-1])!==null&&r!==void 0?r:null}),this.dispatch($n((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&kt(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(a=>this.identify(a))),s=this.identifyNull(t.anchor),o=this.identifyNull(t.mostRecent);this.dispatch(Mr.set({ids:n,anchor:s,mostRecent:o})),kt(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,s=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&nf(r,o))return!1;return typeof s=="function"?!s({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof s=="string"?!r.data[s]:typeof s=="boolean"?!s:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;kt(this.props.onMove,{dragIds:n,parentId:t===js?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(qn.cursor({type:"none"}))}showCursor(t){this.dispatch(qn.cursor(t))}open(t,r=!0){var n,s;const o=this.identifyNull(t);o&&(this.isOpen(o)||(this.dispatch(Yi.open(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),kt(this.props.onToggle,o)))}close(t,r=!0){var n,s;const o=this.identifyNull(t);o&&this.isOpen(o)&&(this.dispatch(Yi.close(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),kt(this.props.onToggle,o))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=Gi(this.root,r);let s=n==null?void 0:n.parent;for(;s;)this.open(s.id,!1),s=s.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let s of r.children)s.isInternal&&(n?this.close(s.id,!1):this.open(s.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){aa(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){aa(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),cf(()=>n in this.idToIndex).then(()=>{var s;const o=this.idToIndex[n];o!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,s;if(!t)return!1;if(t===js)return!0;const o=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(s=this.state.nodes.open.unfiltered[t])!==null&&s!==void 0?s:o}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!$s(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:s}=this.state.nodes.drag;return r===n&&s===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch($n(t.id))}onBlur(){this.dispatch(gw())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ih}get renderRow(){return this.props.renderRow||dw}get renderNode(){return this.props.children||uw}get renderDragPreview(){return this.props.renderDragPreview||pf}get renderCursor(){return this.props.renderCursor||cw}}function It(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var U0=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ph=U0,Tl=()=>Math.random().toString(36).substring(7).split("").join("."),z0={INIT:`@@redux/INIT${Tl()}`,REPLACE:`@@redux/REPLACE${Tl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Tl()}`},ln=z0;function Oh(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function V0(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(W0(e))return"date";if(Q0(e))return"error";const r=H0(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function H0(e){return typeof e.constructor=="function"?e.constructor.name:null}function Q0(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function W0(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Br(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=V0(e)),t}function xh(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?It(2):`Expected the root reducer to be a function. Instead, received: '${Br(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?It(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?It(1):`Expected the enhancer to be a function. Instead, received: '${Br(r)}'`);return r(xh)(e,t)}let n=e,s=t,o=new Map,a=o,i=0,c=!1;function d(){a===o&&(a=new Map,o.forEach((v,y)=>{a.set(y,v)}))}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?It(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?It(4):`Expected the listener to be a function. Instead, received: '${Br(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?It(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;d();const b=i++;return a.set(b,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?It(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d(),a.delete(b),o=null}}}function g(v){if(!Oh(v))throw new Error(process.env.NODE_ENV==="production"?It(7):`Actions must be plain objects. Instead, the actual type was: '${Br(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?It(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?It(17):`Action "type" property must be a string. Instead, the actual type was: '${Br(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?It(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(o=a).forEach(b=>{b()}),v}function m(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?It(10):`Expected the nextReducer to be a function. Instead, received: '${Br(v)}`);n=v,g({type:ln.REPLACE})}function C(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?It(11):`Expected the observer to be an object. Instead, received: '${Br(y)}'`);function b(){const w=y;w.next&&w.next(u())}return b(),{unsubscribe:v(b)}},[Ph](){return this}}}return g({type:ln.INIT}),{dispatch:g,subscribe:f,getState:u,replaceReducer:m,[Ph]:C}}function Fh(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function R0(e,t,r,n){const s=Object.keys(t),o=r&&r.type===ln.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Oh(e))return`The ${o} has unexpected type of "${Br(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const a=Object.keys(e).filter(i=>!t.hasOwnProperty(i)&&!n[i]);if(a.forEach(i=>{n[i]=!0}),!(r&&r.type===ln.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function G0(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:ln.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?It(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:ln.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?It(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${ln.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function Mh(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const i=t[a];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&Fh(`No reducer provided for key "${i}"`),typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let o;try{G0(r)}catch(a){o=a}return function(i={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const f=R0(i,r,c,s);f&&Fh(f)}let d=!1;const u={};for(let f=0;f<n.length;f++){const g=n[f],m=r[g],C=i[g],h=m(C,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?It(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${g}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[g]=h,d=d||h!==C}return d=d||n.length!==Object.keys(i).length,d?u:i}}function K0(e=jn().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const Y0=Mh({nodes:Mh({focus:mw,edit:pw,open:vw,selection:yw,drag:K0}),dnd:bw}),Z0=jn();function X0({treeProps:e,imperativeHandle:t,children:r}){const n=p.useRef(null),s=p.useRef(null),o=p.useRef(xh(Y0,jn(e))),a=JS.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>Z0),i=p.useMemo(()=>new Vs(o.current,e,n,s),[]),c=p.useRef(0);return p.useMemo(()=>{c.current+=1,i.update(e)},Object.values(e)),p.useMemo(()=>{c.current+=1,i.update(i.props)},[a.nodes.open]),p.useImperativeHandle(t,()=>i),p.useEffect(()=>{i.props.selection?i.select(i.props.selection,{focus:!1}):i.deselectAll()},[i.props.selection]),p.useEffect(()=>{i.props.searchTerm||o.current.dispatch(Yi.clear(!0))},[i.props.searchTerm]),l.jsx(Ku.Provider,{value:i,children:l.jsx(Xu.Provider,{value:c.current,children:l.jsx(Yu.Provider,{value:a.nodes,children:l.jsx(Zu.Provider,{value:a.dnd,children:l.jsx(I1,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||L0,options:{rootElement:i.props.dndRootElement||void 0}},{children:r}))})})})})}function J0(){const e=$t(),[,t]=dh(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const s=n.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:o,drop:a}=Eh({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(qn.hovering(a.parentId,a.index)),n.canDrop()?o&&e.showCursor(o):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function eE(e){return J0(),e.children}function tE(){const t=$t().props.renderContainer||Ih;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function rE(){const e=$t(),{offset:t,mouse:r,item:n,isDragging:s}=e0(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=e.props.renderDragPreview||pf;return l.jsx(o,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function nE(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",s=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:o=>o[n],getChildren:typeof s=="function"?s:o=>o[s],childrenKey:typeof s=="string"?s:"children"}}class sE{constructor(t,r={}){this.accessors=nE(r),this.root=oE(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const s=this.find(t,n);if(s)return s}return null}return null}}function oE(e,t){const r=new Bh({},null,t,"ROOT");return r.children=e.map(n=>El(n,r,t)),r}function El(e,t,r){const n=new Bh(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(o=>El(o,n,r))),n}class Bh{constructor(t,r,n,s){this.data=t,this.parent=r,this.accessors=n,this.id=s??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,s;const o=El(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o);const a=this.accessors.childrenKey,i=this.data;i[a]=(s=i[a])!==null&&s!==void 0?s:[],i[a].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let aE=0;function iE(e,t={}){const[r,n]=p.useState(e),s=t.idAccessor,o=t.childrenAccessor,a=p.useMemo(()=>new sE(r,{idAccessor:s,childrenAccessor:o}),[r,s,o]),i=C=>{for(const h of C.dragIds)a.move({id:h,parentId:C.parentId,index:C.index});n(a.data)},c=({name:C,id:h})=>{a.update({id:h,changes:{name:C}}),n(a.data)},d=typeof s=="string"?s:"id",u=typeof o=="string"?o:"children";return[r,{onMove:i,onRename:c,onCreate:({parentId:C,index:h,type:v})=>{if(typeof s=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(v==="internal"&&typeof o=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const y={[d]:`simple-tree-id-${aE++}`,name:""};return v==="internal"&&(y[u]=[]),a.create({parentId:C,index:h,data:y}),n(a.data),y},onDelete:C=>{C.ids.forEach(h=>a.drop({id:h})),n(a.data)}}]}function lE(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
546
- Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=iE(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function cE(e,t){const r=lE(e);return l.jsxs(X0,{treeProps:r,imperativeHandle:t,children:[l.jsx(eE,{children:l.jsx(tE,{})}),l.jsx(rE,{})]})}const dE=p.forwardRef(cE);function Al(){return se(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function uE(){return se(e=>{var s;if(!e.selectedNodeId)return!1;const t=(s=e.treeData[0])==null?void 0:s.id,r=o=>{var a;for(const i of o){if(i.id===e.selectedNodeId)return i;if((a=i.children)!=null&&a.length){const c=r(i.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const $h={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},jh={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},qh=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],kl=[{label:"All",value:"all"},{label:"Course Assessment",value:"Course Assessment"},{label:"eTextbook",value:"eTextbook"},{label:"Exam Question",value:"Exam Question"},{label:"Explanation Content",value:"Explanation Content"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"},{label:"SCORM Content",value:"SCORM Content"},{label:"Teacher Resource",value:"Teacher Resource"}];function fE(e){var r;if((r=e.metadata)!=null&&r.isAssessmentCourse)return"quiz";const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":e.primaryCategory==="Course"?"course":"default"}function Hs(e){const t=fE(e);return{key:t,color:$h[t]??$h.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:jh[t]??jh.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const dt={row:"_row_1yoqj_1",grip:"_grip_1yoqj_16",menuBtn:"_menuBtn_1yoqj_19",rowLp:"_rowLp_1yoqj_23",selected:"_selected_1yoqj_27",title:"_title_1yoqj_32",dropTarget:"_dropTarget_1yoqj_41",toggle:"_toggle_1yoqj_58",ctIcon:"_ctIcon_1yoqj_73",ctIconLp:"_ctIconLp_1yoqj_85",folderIcon:"_folderIcon_1yoqj_89",rootIcon:"_rootIcon_1yoqj_94",titleLp:"_titleLp_1yoqj_110",levelTitle:"_levelTitle_1yoqj_114",renameInput:"_renameInput_1yoqj_119",dropHere:"_dropHere_1yoqj_128",menuWrap:"_menuWrap_1yoqj_138",menu:"_menu_1yoqj_19",dangerItem:"_dangerItem_1yoqj_190"},hE={video:zo,pdf:ks,h5p:Bo,scorm:qo,audio:jo,quiz:Mo,course:pr,default:Fr},pE=({node:e,style:t,dragHandle:r,editorMode:n})=>{var M;const[s,o]=p.useState(!1),[a,i]=p.useState(!1),[c,d]=p.useState(e.data.name),u=p.useRef(null),f=ae(),g=X(x=>x.editorProfile),m=n==="edit",C=Al(),h=Hs(e.data),v=hE[h.key]??Fr,y=e.isSelected,b=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),w=g.key==="learningPath",T=b?w?Qu:_y:S?w?Oy:_d:v,E=w&&S&&!b&&!st(e.data),N=w&&!!((M=e.data.metadata)!=null&&M.isAssessmentCourse),I=e.level+1<=g.maxDepth,O=w?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,B=w?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;p.useEffect(()=>{if(!s)return;const x=z=>{var ne;(ne=u.current)!=null&&ne.contains(z.target)||o(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[s]);const k=p.useCallback(()=>{c.trim()&&e.submit(c.trim()),i(!1)},[c,e]),F=p.useCallback(x=>{x.key==="Enter"&&k(),x.key==="Escape"&&(d(e.data.name),i(!1))},[k,e.data.name]);return l.jsxs("div",{className:[dt.row,w?dt.rowLp:"",y?dt.selected:"",e.state.isOver&&S?dt.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":S?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":S?!e.isClosed:void 0,children:[m&&l.jsx("span",{ref:r,className:dt.grip,"aria-hidden":"true",children:l.jsx(mi,{size:14})}),l.jsx("button",{className:dt.toggle,onClick:x=>{x.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(gi,{size:14}):l.jsx(Xr,{size:14})}),l.jsx("span",{className:[dt.ctIcon,b||S||N?dt.folderIcon:h.bgClass,w?dt.ctIconLp:"",b&&w?dt.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(T,{size:b&&w?15:12})}),a?l.jsx("input",{className:dt.renameInput,value:c,autoFocus:!0,onChange:x=>d(x.target.value),onBlur:k,onKeyDown:F,onClick:x=>x.stopPropagation()}):l.jsx("span",{className:[dt.title,w?dt.titleLp:"",E?dt.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>m&&i(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:dt.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),m&&l.jsxs("div",{className:dt.menuWrap,ref:u,children:[l.jsx("button",{className:dt.menuBtn,onClick:x=>{x.stopPropagation(),o(z=>!z)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(Cd,{size:14})}),s&&l.jsxs("div",{className:dt.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{i(!0),o(!1)},children:[l.jsx(By,{size:13})," ",f.treeNode.renameMenuItem]}),S&&C&&I&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),o(!1)},children:[l.jsx(wd,{size:13})," ",O]}),e.data.parent&&C&&!w&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),o(!1)},children:[l.jsx(Er,{size:13})," ",B]}),!b&&l.jsxs("button",{role:"menuitem",className:dt.dangerItem,onClick:()=>{e.tree.delete(e.id),o(!1)},children:[l.jsx(Nn,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function gE(e,t){var o,a;const n=((o=(await Me.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)??{},s=((a=n.content)==null?void 0:a.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!s)throw new Error("Could not obtain an upload URL");return s}async function mE(e,t){const r=await fetch(e,{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"text/csv"},body:t});if(!r.ok)throw new Error(`Blob upload failed (${r.status})`);return e.split("?")[0]}async function vE(e,t){var i;const r=await gE(e,t.name),n=await mE(r,t),s=new FormData;return s.append("fileUrl",n),s.append("mimeType",t.type||"text/csv"),{processId:(((i=(await Me.post(`/action/collection/v1/import/${e}`,s)).data)==null?void 0:i.result)??{}).processId??""}}async function yE(e){var r;return((r=(await Me.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Uh(e){var n,s,o;const r=(o=(s=(n=(await Me.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:o.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function bE(e){return Uh(e)}const ze={container:"_container_jr3ij_1",header:"_header_jr3ij_13",title:"_title_jr3ij_22",closeBtn:"_closeBtn_jr3ij_29",body:"_body_jr3ij_45",dropZone:"_dropZone_jr3ij_54",dragOver:"_dragOver_jr3ij_67",hasFile:"_hasFile_jr3ij_72",hiddenInput:"_hiddenInput_jr3ij_78",fileInfo:"_fileInfo_jr3ij_82",fileIcon:"_fileIcon_jr3ij_89",fileName:"_fileName_jr3ij_93",fileSize:"_fileSize_jr3ij_100",dropHint:"_dropHint_jr3ij_105",dropIcon:"_dropIcon_jr3ij_112",dropText:"_dropText_jr3ij_117",dropSubtext:"_dropSubtext_jr3ij_124",sampleLink:"_sampleLink_jr3ij_130",statusBar:"_statusBar_jr3ij_145",status_uploading:"_status_uploading_jr3ij_154",status_processing:"_status_processing_jr3ij_154",status_done:"_status_done_jr3ij_159",status_error:"_status_error_jr3ij_164",successDetail:"_successDetail_jr3ij_170",spinner:"_spinner_jr3ij_175",spin:"_spin_jr3ij_175",errorMsg:"_errorMsg_jr3ij_191",failedSection:"_failedSection_jr3ij_197",failedTitle:"_failedTitle_jr3ij_203",tableWrap:"_tableWrap_jr3ij_213",failedTable:"_failedTable_jr3ij_219",reasonCell:"_reasonCell_jr3ij_244",footer:"_footer_jr3ij_248"},CE=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const s=ae(),[o,a]=p.useState(null),[i,c]=p.useState(!1),[d,u]=p.useState("idle"),[f,g]=p.useState(""),[m,C]=p.useState([]),[h,v]=p.useState(null),y=p.useRef(null),b=p.useRef(null),S=p.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[]);p.useEffect(()=>()=>S(),[S]);const w=k=>k.name.toLowerCase().endsWith(".csv")?k.size>50*1024*1024?(g(s.csvUpload.fileTooLarge),!1):!0:(g(s.csvUpload.invalidFileType),!1),T=p.useCallback(k=>{g(""),C([]),v(null),u("idle"),w(k)&&a(k)},[]),E=p.useCallback(k=>{k.preventDefault(),c(!1);const F=k.dataTransfer.files[0];F&&T(F)},[T]),N=p.useCallback(k=>{var M;const F=(M=k.target.files)==null?void 0:M[0];F&&T(F),k.target.value=""},[T]),I=p.useCallback(async()=>{try{const k=await bE(e),F=document.createElement("a");F.href=k,F.download="sample_hierarchy.csv",F.target="_blank",F.click()}catch{g(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),O=p.useCallback(async()=>{if(o){u("uploading"),g(""),C([]);try{const{processId:k}=await vE(e,o);if(!k){u("done"),v(null),setTimeout(t,1500);return}u("processing"),b.current=setInterval(async()=>{try{const F=await yE(k);F.status==="COMPLETED"?(S(),u("done"),v(F.successCount??null),F.failedRecords&&F.failedRecords.length>0?C(F.failedRecords):setTimeout(t,1500)):F.status==="FAILED"&&(S(),u("error"),g(s.csvUpload.processingFailed),F.failedRecords&&C(F.failedRecords))}catch{S(),u("error"),g(s.csvUpload.connectionLost)}},2e3)}catch{u("error"),g(s.csvUpload.uploadFailed)}}},[e,o,t,S,s.csvUpload.processingFailed,s.csvUpload.connectionLost,s.csvUpload.uploadFailed]),B={idle:"",uploading:s.csvUpload.statusUploading,processing:s.csvUpload.statusProcessing,done:s.csvUpload.statusDone,error:s.csvUpload.statusError};return l.jsxs("div",{className:ze.container,children:[l.jsxs("div",{className:ze.header,children:[l.jsx("h2",{className:ze.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),l.jsx("button",{className:ze.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:l.jsx(or,{size:18})})]}),l.jsxs("div",{className:ze.body,children:[l.jsxs("div",{className:`${ze.dropZone} ${i?ze.dragOver:""} ${o?ze.hasFile:""}`,onDragEnter:k=>{k.preventDefault(),c(!0)},onDragOver:k=>{k.preventDefault(),c(!0)},onDragLeave:k=>{k.preventDefault(),c(!1)},onDrop:E,onClick:()=>{var k;return(k=y.current)==null?void 0:k.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:k=>{var F;return k.key==="Enter"&&((F=y.current)==null?void 0:F.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:ze.hiddenInput,onChange:N,"aria-hidden":"true"}),o?l.jsxs("div",{className:ze.fileInfo,children:[l.jsx(ks,{size:24,className:ze.fileIcon}),l.jsx("span",{className:ze.fileName,children:o.name}),l.jsxs("span",{className:ze.fileSize,children:["(",(o.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:ze.dropHint,children:[l.jsx(vi,{size:32,className:ze.dropIcon}),l.jsx("p",{className:ze.dropText,children:s.csvUpload.dropText}),l.jsx("p",{className:ze.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:ze.sampleLink,onClick:I,type:"button",children:s.csvUpload.downloadSample}),d!=="idle"&&l.jsxs("div",{className:`${ze.statusBar} ${ze[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&l.jsx("span",{className:ze.spinner,"aria-hidden":"true"}),B[d],d==="done"&&h!==null&&l.jsx("span",{className:ze.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:ze.errorMsg,role:"alert",children:f}),m.length>0&&l.jsxs("div",{className:ze.failedSection,children:[l.jsx("h4",{className:ze.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(m.length))}),l.jsx("div",{className:ze.tableWrap,children:l.jsxs("table",{className:ze.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:s.csvUpload.rowHeader}),l.jsx("th",{children:s.csvUpload.nameHeader}),l.jsx("th",{children:s.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:m.map((k,F)=>l.jsxs("tr",{children:[l.jsx("td",{children:k.rowNumber??F+1}),l.jsx("td",{children:k.name??"—"}),l.jsx("td",{className:ze.reasonCell,children:k.reason??s.csvUpload.unknownError})]},F))})]})})]})]}),l.jsxs("div",{className:ze.footer,children:[l.jsx(Be,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:s.csvUpload.cancel}),l.jsx(Be,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!o||d==="done",onClick:O,children:d==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})};function Il(){var v,y,b,S,w,T,E;const e=ae(),t=se(N=>N.treeData),r=se(N=>N.treeCache),n=se(N=>N.deleteNode),s=rt(N=>N.activeAssessmentSlot),o=rt(N=>N.setActiveAssessmentSlot),a=rt(N=>N.openModal),i=((v=t[0])==null?void 0:v.children)??[],c=i[0],d=i.length>1?i[i.length-1]:void 0,u=st(c),f=st(d),g=t[0],m=g?((y=r[g.id])==null?void 0:y.policy)??((b=g.metadata)==null?void 0:b.policy):void 0,C=!!m&&ju.has(m),h=N=>{const I=N==="pre"?c:d;if(!I)return;const O=N==="pre"&&C?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;a("confirmDelete",{message:O,onConfirm:()=>n(I.id)})};return{pre:{level:c,filled:u,courseName:u?(w=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:w.name:void 0,required:C},post:{level:d,filled:f,courseName:f?(E=(T=d==null?void 0:d.children)==null?void 0:T[0])==null?void 0:E.name:void 0,required:!1},activeAssessmentSlot:s,setActiveAssessmentSlot:o,deleteSlot:h}}const lr={container:"_container_1ghxo_1",header:"_header_1ghxo_8",sectionLabel:"_sectionLabel_1ghxo_18",headerActions:"_headerActions_1ghxo_26",iconBtn:"_iconBtn_1ghxo_33",menuWrap:"_menuWrap_1ghxo_51",dropdownMenu:"_dropdownMenu_1ghxo_55",treeWrapper:"_treeWrapper_1ghxo_87",csvModal:"_csvModal_1ghxo_103",footer:"_footer_1ghxo_113"},SE=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Le;const n=ae(),s=p.useRef(null),o=p.useRef(null),a=p.useRef(null),[i,c]=p.useState(400),[d,u]=p.useState(!1),[f,g]=p.useState(!1),[m,C]=p.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:b,deleteNode:S,getNodeById:w,reorderChildren:T,moveNode:E,setTreeData:N}=se(),I=rt(J=>J.openModal),O=X(J=>J.editorProfile),B=O.key==="learningPath",k=e==="edit",F=Al(),M=k&&F,x=B?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,z=O.maxDepth>1,ne=(((Le=h[0])==null?void 0:Le.children)??[]).some(J=>J.isFolder),{pre:R,post:ge,deleteSlot:me}=Il(),{level:K}=R,{level:ce}=ge,te=X(J=>{var he,Q,be,He;return((Q=(he=J.editorConfig)==null?void 0:he.context)==null?void 0:Q.contentId)??((He=(be=J.editorConfig)==null?void 0:be.context)==null?void 0:He.identifier)??""}),we=X(J=>{var Q,be;const he=(be=(Q=J.categoryMeta)==null?void 0:Q.sourcingSettings)==null?void 0:be.collection;return(he==null?void 0:he.enableBulkUpload)!==!1}),ve=O.features.csvUpload&&we;p.useEffect(()=>{const J=o.current;if(!J)return;const he=new ResizeObserver(()=>{c(J.clientHeight||400)});return he.observe(J),c(J.clientHeight||400),()=>he.disconnect()},[]),p.useEffect(()=>{if(!d)return;const J=he=>{var Q;(Q=a.current)!=null&&Q.contains(he.target)||u(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[d]);const q=p.useCallback(J=>{J.length>0&&y(J[0].data.id)},[y]),$=p.useCallback(({parentId:J,index:he,dragIds:Q})=>{if(!J)return;const be=Q[0],He=Ll(h,be);if(!He)return;const ot=He.parent;if(ot===J){const Qe=Ll(h,J);if(!(Qe!=null&&Qe.children))return;const Ke=Qe.children.findIndex(at=>at.id===be);if(Ke<0)return;T(J,Ke,he>Ke?he-1:he)}else E(be,ot??"",J)},[h,T,E]),U=p.useCallback(({ids:J})=>{if(!B){for(const Q of J)S(Q);return}if(J.length===1){const Q=J[0];if((K==null?void 0:K.id)===Q){me("pre");return}if((ce==null?void 0:ce.id)===Q){me("post");return}const be=w(Q),He=be!=null&&be.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",be.name):n.learningPath.deleteCourseConfirm;I("confirmDelete",{message:He,onConfirm:()=>{S(Q)||pe.error(n.learningPath.cannotRemoveLastRegularCourseToast)}});return}const he=n.learningPath.deleteMultipleConfirm.replace("{count}",String(J.length));I("confirmDelete",{message:he,onConfirm:()=>{let Q=!1;for(const be of J)S(be)||(Q=!0);Q&&pe.error(n.learningPath.cannotRemoveLastRegularCourseToast)}})},[S,me,B,K,ce,w,I,n]),oe=p.useCallback(({parentId:J})=>{var be;const he=J??((be=h[0])==null?void 0:be.id)??"";if(!he)return{id:crypto.randomUUID()};const Q=b(he,"unit");return Q?{id:Q}:(pe.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[b,h,n]),ie=p.useCallback(()=>{var he;const J=(he=h[0])==null?void 0:he.id;J&&(b(J,"unit")||pe.error(n.outlineTree.maxDepthReachedToast))},[h,b,n]),Se=p.useCallback(()=>{v&&(b(v,"subunit")||pe.error(n.outlineTree.maxDepthReachedToast))},[v,b,n]),fe=p.useCallback(async()=>{if(u(!1),!!te)try{const J=await Uh(te),he=await fetch(J).then(He=>He.blob()),Q=URL.createObjectURL(he),be=document.createElement("a");be.href=Q,be.download=`${te}-folders.csv`,be.style.display="none",document.body.appendChild(be),be.click(),document.body.removeChild(be),URL.revokeObjectURL(Q)}catch{pe.error(n.outlineTree.downloadCsvFailedToast)}},[te,n]),ye=p.useCallback(async()=>{if(g(!1),!!te)try{const{rootNode:J}=await Lu(te);N([J]),pe.success(n.outlineTree.outlineRefreshedToast)}catch{pe.error(n.outlineTree.outlineRefreshFailedToast)}},[te,N,n]);return l.jsxs("div",{className:lr.container,children:[l.jsxs("div",{className:lr.header,children:[B&&l.jsx("span",{className:lr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:lr.headerActions,children:[k&&ve&&l.jsxs("div",{className:lr.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:lr.iconBtn,onClick:()=>u(J=>!J),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:l.jsx(Cd,{size:15})}),d&&l.jsxs("div",{className:lr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:ne,title:ne?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{u(!1),C("create"),g(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ne,title:ne?void 0:n.outlineTree.noFoldersYetTitle,onClick:fe,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ne,title:ne?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{u(!1),C("update"),g(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:lr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(Fy,{size:15}):l.jsx(xy,{size:15})})]})]}),l.jsx("div",{className:lr.treeWrapper,ref:o,children:l.jsx(dE,{ref:s,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:q,onMove:k?$:void 0,onDelete:k?U:void 0,onCreate:k?oe:void 0,disableEdit:!k,disableDrop:!k,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:i,width:"100%",children:J=>l.jsx(pE,{...J,editorMode:e})})}),k&&l.jsxs("div",{className:lr.footer,children:[l.jsxs(Be,{variant:"ghost",size:"sm",onClick:ie,disabled:!M,children:[l.jsx(Er,{size:14})," ",x]}),z&&l.jsxs(Be,{variant:"ghost",size:"sm",onClick:Se,disabled:!M||!v,children:[l.jsx(wd,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:lr.csvModal,children:l.jsx(CE,{contentId:te,mode:m,onComplete:ye,onClose:()=>g(!1)})})]})};function Ll(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=Ll(r.children,t);if(n)return n}}}const Qs={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},wE=({crumbs:e})=>{const t=se(n=>n.selectNode),r=ae();return e.length?l.jsxs("nav",{className:Qs.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:Qs.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Ny,{size:13})}),e.map((n,s)=>l.jsxs(p.Fragment,{children:[l.jsx(gi,{size:13,className:Qs.sep}),s<e.length-1?l.jsx("button",{className:Qs.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:Qs.current,children:n.name})]},n.id))]}):null},Ws={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},_E=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=ae(),o=[{id:"details",label:s.tabBar.detailsTab},{id:"audience",label:s.tabBar.audienceCurriculumTab},{id:"licensing",label:s.tabBar.licensingTab}],a=n?o.filter(i=>n.includes(i.id)):o;return l.jsx("div",{className:Ws.tabBar,role:"tablist","aria-label":s.tabBar.metadataSectionsAriaLabel,children:a.map(i=>l.jsxs("button",{role:"tab","aria-selected":e===i.id,"aria-controls":`panel-${i.id}`,className:[Ws.tab,e===i.id?Ws.active:"",r.includes(i.id)?Ws.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:Ws.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},i.id))})};var Rs=e=>e.type==="checkbox",cn=e=>e instanceof Date,Ct=e=>e==null;const zh=e=>typeof e=="object";var Ze=e=>!Ct(e)&&!Array.isArray(e)&&zh(e)&&!cn(e),Dl=e=>Ze(e)&&e.target?Rs(e.target)?e.target.checked:e.target.value:e,Vh=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Hh=e=>{const t=e.constructor&&e.constructor.prototype;return Ze(t)&&t.hasOwnProperty("isPrototypeOf")},Ta=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function et(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ta&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ze(e)&&Hh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=et(e[s]));return n}const $r={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},cr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},dr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Nl="form",Qh="root",Wh=["__proto__","constructor","prototype"];var Gs=e=>/^\w*$/.test(e),Ge=e=>e===void 0,Ea=e=>e.split(/[.[\]'"]/g).filter(Boolean),Z=(e,t,r)=>{if(!t||!Ze(e))return r;const n=Gs(t)?[t]:Ea(t);if(n.some(o=>Wh.includes(o)))return r;const s=n.reduce((o,a)=>Ct(o)?void 0:o[a],e);return Ge(s)||s===e?Ge(e[t])?r:e[t]:s},zt=e=>typeof e=="boolean",Lt=e=>typeof e=="function",We=(e,t,r)=>{let n=-1;const s=Gs(t)?[t]:Ea(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let c=r;if(n!==a){const d=e[i];c=Ze(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(Wh.includes(i))return;e[i]=c,e=e[i]}};const Pl=p.createContext(null);Pl.displayName="HookFormControlContext";const Ol=()=>p.useContext(Pl);var Rh=(e,t,r,n=!0)=>{const s={};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==cr.all&&(t._proxyFormState[a]=!n||cr.all),r&&(r[a]=!0),e[a]}});return s};const xl=Ta?p.useLayoutEffect:p.useEffect;function TE(e){const t=Ol(),{control:r=t,disabled:n,name:s,exact:o}=e||{},[a,i]=p.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return xl(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:d=>{!n&&i({...r._formState,...d,defaultValues:r._defaultValues})}}),[s,n,o]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>Rh(a,r,c.current,!1),[a,r])}var Dt=e=>typeof e=="string",Fl=(e,t,r,n,s)=>Dt(e)?(n&&t.watch.add(e),Z(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),Z(r,o))):(n&&(t.watchAll=!0),r),Ml=e=>Ct(e)||!zh(e);const Gh=(e,t)=>t.length===0&&!Array.isArray(e)&&!Hh(e);function Vt(e,t,r=new WeakMap){if(e===t)return!0;if(Ml(e)||Ml(t))return Object.is(e,t);if(cn(e)&&cn(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(Gh(e,n)||Gh(t,s))return Object.is(e,t);const o=r.get(e);if(o&&o.has(t))return!0;o?o.add(t):r.set(e,new WeakSet([t]));for(const a of n){const i=e[a];if(!(a in t))return!1;if(a!=="ref"){const c=t[a];if(cn(i)&&cn(c)||(Ze(i)||Array.isArray(i))&&(Ze(c)||Array.isArray(c))?!Vt(i,c,r):!Object.is(i,c))return!1}}return!0}function EE(e){const t=Ol(),{control:r=t,name:n,defaultValue:s,disabled:o,exact:a,compute:i}=e||{},c=p.useRef(s),d=p.useRef(i),u=p.useRef(void 0),f=p.useRef(r),g=p.useRef(n);d.current=i;const[m,C]=p.useState(()=>{const w=r._getWatch(n,c.current);return d.current?d.current(w):w}),h=p.useCallback(w=>{const T=Fl(n,r._names,w||r._formValues,!1,c.current);return d.current?d.current(T):T},[r._formValues,r._names,n]),v=p.useCallback(w=>{if(!o){const T=Fl(n,r._names,w||r._formValues,!1,c.current);if(d.current){const E=d.current(T);Vt(E,u.current)||(C(E),u.current=E)}else C(T)}},[r._formValues,r._names,o,n]);xl(()=>((f.current!==r||!Vt(g.current,n))&&(f.current=r,g.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:w=>{v(w.values)}})),[r,a,n,v]),p.useEffect(()=>r._removeUnmounted());const y=f.current!==r,b=g.current,S=p.useMemo(()=>{if(o)return null;const w=!y&&!Vt(b,n);return y||w?h():null},[o,y,n,b,h]);return S!==null?S:m}function Ks(e){const t=Ol(),{name:r,disabled:n,control:s=t,shouldUnregister:o,defaultValue:a,exact:i=!0}=e,c=Vh(s._names.array,r),d=p.useMemo(()=>Z(s._formValues,r,Z(s._defaultValues,r,a)),[s,r,a]),u=EE({control:s,name:r,defaultValue:d,exact:i}),f=TE({control:s,name:r,exact:i}),g=p.useRef(e),m=p.useRef(null),C=p.useRef(s.register(r,{...e.rules,value:u,...zt(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const h=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!Z(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Z(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Z(f.validatingFields,r)},error:{enumerable:!0,get:()=>Z(f.errors,r)}}),[f,r]),v=p.useCallback(w=>{const T=Dl(w);return Z(s._fields,r)||(C.current=s.register(r,{...g.current.rules,value:T})),C.current.onChange({target:{value:Dl(w),name:r},type:$r.CHANGE})},[r,s]),y=p.useCallback(()=>C.current.onBlur({target:{value:Z(s._formValues,r),name:r},type:$r.BLUR}),[r,s._formValues]),b=p.useCallback(w=>{w&&(m.current={focus:()=>Lt(w.focus)&&w.focus(),select:()=>Lt(w.select)&&w.select(),setCustomValidity:E=>Lt(w.setCustomValidity)&&w.setCustomValidity(E),reportValidity:()=>Lt(w.reportValidity)&&w.reportValidity()});const T=Z(s._fields,r);T&&T._f&&w&&(T._f.ref=m.current)},[s._fields,r]),S=p.useMemo(()=>({name:r,value:u,...zt(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:b}),[r,n,f.disabled,v,y,b,u]);return p.useEffect(()=>{const w=s._options.shouldUnregister||o;s.register(r,{...g.current.rules,...zt(g.current.disabled)?{disabled:g.current.disabled}:{}});const T=(E,N)=>{const I=Z(s._fields,E);I&&I._f&&(I._f.mount=N)};if(T(r,!0),w){const E=et(Z(o?s._defaultValues:s._options.values||s._defaultValues,r,Z(s._options.defaultValues,r,g.current.defaultValue)));We(s._defaultValues,r,E),Ge(Z(s._formValues,r))&&We(s._formValues,r,E)}if(!c&&s.register(r),m.current){const E=Z(s._fields,r);E&&E._f&&(E._f.ref=m.current)}return()=>{(c?w&&!s._state.action:w)?s.unregister(r):T(r,!1)}},[r,s,c,o]),p.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),p.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const AE=e=>e.render(Ks(e)),Bl=p.createContext(null);Bl.displayName="HookFormContext";const Zt=()=>p.useContext(Bl),kE=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:g,unregister:m,control:C,register:h,setFocus:v,subscribe:y})=>{const b=p.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:g,unregister:m,control:C,register:h,setFocus:v,subscribe:y}),[o,C,d,n,r,g,h,f,u,s,v,a,i,y,c,m,t]);return p.createElement(Bl.Provider,{value:b},p.createElement(Pl.Provider,{value:b.control},e))};var IE=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Kh=e=>Array.isArray(e)?e.filter(Boolean):[],Aa=e=>Array.isArray(e)?e:[e],Yh=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function Zh(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&Ze(s)&&o){const a=Zh(s,o);Ze(a)&&(r[n]=a)}else e[n]&&(r[n]=o)}return r}var ht=e=>Ze(e)&&!Object.keys(e).length,$l=e=>e.type==="file",ka=e=>{if(!Ta)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Xh=e=>e.type==="select-multiple",jl=e=>e.type==="radio",LE=e=>jl(e)||Rs(e),ql=e=>ka(e)&&e.isConnected;function DE(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(Ct(e)){e=void 0;break}e=e[t[n]],n++}return e}function NE(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ge(e[t]))return!1;return!0}function it(e,t){if(Dt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Gs(t)?[t]:Ea(t),n=r.length===1?e:DE(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Ze(n)&&ht(n)||Array.isArray(n)&&NE(n))&&it(e,r.slice(0,-1)),e}var PE=e=>{for(const t in e)if(Lt(e[t]))return!0;return!1};function Jh(e){return Array.isArray(e)||Ze(e)&&!PE(e)}function Ul(e,t={}){for(const r in e){const n=e[r];Jh(n)?(t[r]=Array.isArray(n)?[]:{},Ul(n,t[r])):Ge(n)||(t[r]=!0)}return t}function zl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>zl(r));return t.some(r=>r!==void 0)?t:void 0}if(Ze(e)){const t={};for(const r in e){const n=zl(e[r]);Ge(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function dn(e,t,r){r||(r=Ul(t));for(const n in e){const s=e[n];if(Jh(s))Ge(t)||Ml(r[n])?r[n]=Ul(s,Array.isArray(s)?[]:{}):dn(s,Ct(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!Vt(s,o)}}return zl(r)||{}}const ep={value:!1,isValid:!1},tp={value:!0,isValid:!0};var rp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ge(e[0].attributes.value)?Ge(e[0].value)||e[0].value===""?tp:{value:e[0].value,isValid:!0}:tp:ep}return ep},np=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ge(e)?e:t?e===""?NaN:e&&+e:r&&Dt(e)?new Date(e):n?n(e):e;const sp={isValid:!1,value:null};var op=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,sp):sp;function ap(e){const t=e.ref;return $l(t)?t.files:jl(t)?op(e.refs).value:Xh(t)?[...t.selectedOptions].map(({value:r})=>r):Rs(t)?rp(e.refs).value:np(Ge(t.value)?e.ref.value:t.value,e)}var OE=(e,t,r,n)=>{const s={};for(const o of e){const a=Z(t,o);a&&We(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ia=e=>e instanceof RegExp,Ys=e=>Ge(e)?e:Ia(e)?e.source:Ze(e)?Ia(e.value)?e.value.source:e.value:e,ip=e=>({isOnSubmit:!e||e===cr.onSubmit,isOnBlur:e===cr.onBlur,isOnChange:e===cr.onChange,isOnAll:e===cr.all,isOnTouch:e===cr.onTouched});const lp="AsyncFunction";var xE=e=>!!e&&!!e.validate&&!!(Lt(e.validate)&&e.validate.constructor.name===lp||Ze(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===lp)),FE=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Vl=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Zs=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=Z(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Zs(i,t))break}else if(Ze(i)&&Zs(i,t))break}}};function cp(e,t,r){const n=Z(e,r);if(n||Gs(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=Z(t,o),i=Z(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var ME=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ht(o)||n&&Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||cr.all))},BE=(e,t,r)=>!e||!t||e===t||Aa(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),$E=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,jE=(e,t)=>!Kh(Z(e,t)).length&&it(e,t),dp=(e,t,r)=>{const n=Z(e,r),s=Array.isArray(n)?n:[];return We(s,Qh,t[r]),We(e,r,s),e};function up(e,t,r="validate"){if(Dt(e)||Array.isArray(e)&&e.every(Dt)||zt(e)&&!e)return{type:r,message:Dt(e)?e:"",ref:t}}var Rn=e=>Ze(e)&&!Ia(e)?e:{value:e,message:""},fp=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:f,max:g,pattern:m,validate:C,name:h,valueAsNumber:v,mount:y}=e._f,b=Z(r,h);if(!y||t.has(h))return{};const S=i?i[0]:a,w=F=>{if(s&&S.reportValidity){const M=zt(F)?"":F||"";i?i.forEach(x=>x.setCustomValidity(M)):S.setCustomValidity(M),S.reportValidity()}},T={},E=jl(a),N=Rs(a),I=E||N,O=(v||$l(a))&&Ge(a.value)&&Ge(b)||ka(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,B=IE.bind(null,h,n,T),k=(F,M,x,z=dr.maxLength,ne=dr.minLength)=>{const R=F?M:x;T[h]={type:F?z:ne,message:R,ref:a,...B(F?z:ne,R)}};if(o?!Array.isArray(b)||!b.length:c&&(!I&&(O||Ct(b))||zt(b)&&!b||N&&!rp(i).isValid||E&&!op(i).isValid)){const{value:F,message:M}=Dt(c)?{value:!!c,message:c}:Rn(c);if(F&&(T[h]={type:dr.required,message:M,ref:S,...B(dr.required,M)},!n))return w(M),T}if(!O&&(!Ct(f)||!Ct(g))){let F,M;const x=Rn(g),z=Rn(f);if(!Ct(b)&&!isNaN(b)){const ne=a.valueAsNumber||b&&+b;Ct(x.value)||(F=ne>x.value),Ct(z.value)||(M=ne<z.value)}else{const ne=a.valueAsDate||new Date(b),R=K=>new Date(new Date().toDateString()+" "+K),ge=a.type=="time",me=a.type=="week";Dt(x.value)&&b&&(F=ge?R(b)>R(x.value):me?b>x.value:ne>new Date(x.value)),Dt(z.value)&&b&&(M=ge?R(b)<R(z.value):me?b<z.value:ne<new Date(z.value))}if((F||M)&&(k(!!F,x.message,z.message,dr.max,dr.min),!n))return w(T[h].message),T}if((d||u)&&!O&&(Dt(b)||o&&Array.isArray(b))){const F=Rn(d),M=Rn(u),x=!Ct(F.value)&&b.length>+F.value,z=!Ct(M.value)&&b.length<+M.value;if((x||z)&&(k(x,F.message,M.message),!n))return w(T[h].message),T}if(m&&!O&&Dt(b)){const{value:F,message:M}=Rn(m);if(Ia(F)&&!b.match(F)&&(T[h]={type:dr.pattern,message:M,ref:a,...B(dr.pattern,M)},!n))return w(M),T}if(C){if(Lt(C)){const F=await C(b,r),M=up(F,S);if(M&&(T[h]={...M,...B(dr.validate,M.message)},!n))return w(M.message),T}else if(Ze(C)){let F={};for(const M in C){if(!ht(F)&&!n)break;const x=up(await C[M](b,r),S,M);x&&(F={...x,...B(M,x.message)},w(x.message),n&&(T[h]=F))}if(!ht(F)&&(T[h]={ref:S,...F},!n))return T}}return w(!0),T};const qE={mode:cr.onSubmit,reValidateMode:cr.onChange,shouldFocusError:!0},hp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function UE(e={}){let t={...qE,...e},r={...et(hp),isLoading:Lt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=Ze(t.defaultValues)||Ze(t.values)?et(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:et(s),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...u};let g={...f};const m={array:Yh(),state:Yh()},C=t.criteriaMode===cr.all,h=_=>A=>{clearTimeout(d),d=setTimeout(_,A)},v=async _=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||g.isValid||_)){let A;t.resolver?(A=ht((await B()).errors),y()):A=await M({fields:n,onlyCheckValid:!0,eventType:$r.VALID}),A!==r.isValid&&m.state.next({isValid:A})}},y=(_,A)=>{!t.disabled&&(f.isValidating||f.validatingFields||g.isValidating||g.validatingFields)&&((_||Array.from(i.mount)).forEach(D=>{D&&(A?We(r.validatingFields,D,A):it(r.validatingFields,D))}),m.state.next({validatingFields:r.validatingFields,isValidating:!ht(r.validatingFields)}))},b=()=>{r.dirtyFields=dn(s,o)},S=(_,A=[],D,V,H=!0,Y=!0)=>{if(V&&D&&!t.disabled){if(a.action=!0,Y&&Array.isArray(Z(n,_))){const W=D(Z(n,_),V.argA,V.argB);H&&We(n,_,W)}if(Y&&Array.isArray(Z(r.errors,_))){const W=D(Z(r.errors,_),V.argA,V.argB);H&&We(r.errors,_,W),jE(r.errors,_)}if((f.touchedFields||g.touchedFields)&&Y&&Array.isArray(Z(r.touchedFields,_))){const W=D(Z(r.touchedFields,_),V.argA,V.argB);H&&We(r.touchedFields,_,W)}(f.dirtyFields||g.dirtyFields)&&b(),m.state.next({name:_,isDirty:z(_,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else We(o,_,A)},w=(_,A)=>{We(r.errors,_,A),r.errors={...r.errors},m.state.next({errors:r.errors})},T=_=>{r.errors=_,m.state.next({errors:r.errors,isValid:!1})},E=_=>{const A=Gs(_)?[_]:Ea(_);let D=o,V=s;for(let H=0;H<A.length-1;H++){const Y=A[H];if(D=Ct(D)?D:D[Y],V=Ct(V)?V:V[Y],D===null&&V!==null)return!0}return!1},N=(_,A,D,V)=>{const H=Z(n,_);if(H){if(E(_))return;const Y=Ge(Z(o,_)),W=Z(o,_,Ge(D)?Z(s,_):D);Ge(W)||V&&V.defaultChecked||A?We(o,_,A?W:ap(H._f)):ge(_,W),a.mount&&!a.action&&(v(),Y&&r.isDirty&&(f.isDirty||g.isDirty)&&(z()||(r.isDirty=!1,m.state.next({...r}))),e.shouldUnregister&&Y&&!Ge(Z(o,_))&&Vl(_,i)&&(a.watch=!0))}},I=(_,A,D,V,H)=>{let Y=!1,W=!1;const de={name:_};if(!t.disabled){if(!D||V){(f.isDirty||g.isDirty)&&(W=r.isDirty,r.isDirty=de.isDirty=z(),Y=W!==de.isDirty);const ue=Vt(Z(s,_),A);W=!!Z(r.dirtyFields,_),ue!==r.isDirty?r.dirtyFields=dn(s,o):ue?it(r.dirtyFields,_):We(r.dirtyFields,_,!0),de.dirtyFields=r.dirtyFields,Y=Y||(f.dirtyFields||g.dirtyFields)&&W!==!ue}if(D){const ue=Z(r.touchedFields,_);ue||(We(r.touchedFields,_,D),de.touchedFields=r.touchedFields,Y=Y||(f.touchedFields||g.touchedFields)&&ue!==D)}Y&&H&&m.state.next(de)}return Y?de:{}},O=(_,A,D,V)=>{const H=Z(r.errors,_),Y=(f.isValid||g.isValid)&&zt(A)&&r.isValid!==A;if(t.delayError&&D?(c=h(()=>w(_,D)),c(t.delayError)):(clearTimeout(d),c=null,D?We(r.errors,_,D):it(r.errors,_),r.errors={...r.errors}),(D?!Vt(H,D):H)||!ht(V)||Y){const W={...V,...Y&&zt(A)?{isValid:A}:{},errors:r.errors,name:_};r={...r,...W},m.state.next(W)}},B=async _=>(y(_,!0),await t.resolver(o,t.context,OE(_||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),k=async _=>{const{errors:A}=await B(_);if(y(_),_){for(const D of _){const V=Z(A,D);V?i.array.has(D)&&Ze(V)&&!Object.keys(V).some(H=>!Number.isNaN(Number(H)))?dp(r.errors,{[D]:V},D):We(r.errors,D,V):it(r.errors,D)}r.errors={...r.errors}}else r.errors=A;return A},F=async({name:_,eventType:A})=>{if(e.validate){const D=await e.validate({formValues:o,formState:r,name:_,eventType:A});if(Ze(D))for(const V in D){const H=D[V];H&&ie(`${Nl}.${V}`,{message:Dt(H.message)?H.message:"",type:H.type||dr.validate})}else Dt(D)||!D?ie(Nl,{message:D||"",type:dr.validate}):oe(Nl);return D}return!0},M=async({fields:_,onlyCheckValid:A,name:D,eventType:V,context:H={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(H.runRootValidation=!0,!await F({name:D,eventType:V})&&(H.valid=!1,A)))return H.valid;for(const Y in _){const W=_[Y];if(W){const{_f:de,...ue}=W;if(de){const Fe=i.array.has(de.name),Je=W._f&&xE(W._f),ut=f.validatingFields||f.isValidating||g.validatingFields||g.isValidating;Je&&ut&&y([de.name],!0);const tr=await fp(W,i.disabled,o,C,t.shouldUseNativeValidation&&!A,Fe);if(Je&&ut&&y([de.name]),tr[de.name]&&(H.valid=!1,A)||(!A&&(Z(tr,de.name)?Fe?dp(r.errors,tr,de.name):We(r.errors,de.name,tr[de.name]):it(r.errors,de.name)),e.shouldUseNativeValidation&&tr[de.name]))break}!ht(ue)&&await M({context:H,onlyCheckValid:A,fields:ue,name:Y,eventType:V})}}return H.valid},x=()=>{for(const _ of i.unMount){const A=Z(n,_);A&&(A._f.refs?A._f.refs.every(D=>!ql(D)):!ql(A._f.ref))&&Le(_)}i.unMount=new Set},z=(_,A)=>!t.disabled&&(_&&A&&We(o,_,A),!Vt($(),s)),ne=(_,A,D)=>Fl(_,i,{...a.mount?o:Ge(A)?s:Dt(_)?{[_]:A}:A},D,A),R=_=>Kh(Z(a.mount?o:s,_,t.shouldUnregister?Z(s,_,[]):[])),ge=(_,A,D={},V=!1)=>{const H=Z(n,_);let Y=A;if(H){const W=H._f;W&&(!W.disabled&&We(o,_,np(A,W)),Y=ka(W.ref)&&Ct(A)?"":A,Xh(W.ref)?[...W.ref.options].forEach(de=>de.selected=Y.includes(de.value)):W.refs?Rs(W.ref)?W.refs.forEach(de=>{(!de.defaultChecked||!de.disabled)&&(Array.isArray(Y)?de.checked=!!Y.find(ue=>ue===de.value):de.checked=Y===de.value||!!Y)}):W.refs.forEach(de=>de.checked=de.value===Y):$l(W.ref)?W.ref.value="":(W.ref.value=Y,W.ref.type||m.state.next({name:_,values:V?o:et(o)})))}(D.shouldDirty||D.shouldTouch)&&I(_,Y,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&q(_)},me=(_,A,D,V=!1)=>{for(const H in A){if(!A.hasOwnProperty(H))return;const Y=A[H],W=_+"."+H,de=Z(n,W);(i.array.has(_)||Ze(Y)||de&&!de._f)&&!cn(Y)?me(W,Y,D,V):ge(W,Y,D,V)}},K=(_,A,D,V)=>{const H=Z(n,_),Y=i.array.has(_),W=V?A:et(A),de=Z(o,_),ue=Vt(de,W);if(ue||We(o,_,W),Y)m.array.next({name:_,values:V?o:et(o)}),(f.isDirty||f.dirtyFields||g.isDirty||g.dirtyFields)&&D.shouldDirty&&(b(),m.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:z(_,W)}));else{const Fe=Array.isArray(W)&&!W.length||ht(W);!H||H._f||Ct(W)||Fe?ge(_,W,D,V):me(_,W,D,V)}if(!ue){const Fe=Vl(_,i),Je=V?o:et(o);m.state.next({...Fe&&r,name:a.mount||Fe?_:void 0,values:Je})}},ce=(_,A,D={})=>K(_,A,D,!1),te=(_,A={})=>{const D=Lt(_)?_(o):_;if(!Vt(o,D)){o={...o,...D};for(const V of i.mount)K(V,Z(D,V),A,!0);m.state.next({...r,name:void 0,type:void 0,values:o}),A.shouldValidate&&v()}},we=async _=>{a.mount=!0;const A=_.target;let D=A.name,V=!0;const H=Z(n,D),Y=ue=>{V=Number.isNaN(ue)||cn(ue)&&isNaN(ue.getTime())||Vt(ue,Z(o,D,ue))},W=ip(t.mode),de=ip(t.reValidateMode);if(H){let ue,Fe;const Je=A.type?ap(H._f):Dl(_),ut=_.type===$r.BLUR||_.type===$r.FOCUS_OUT,tr=!FE(H._f)&&!e.validate&&!t.resolver&&!Z(r.errors,D)&&!H._f.deps||$E(ut,Z(r.touchedFields,D),r.isSubmitted,de,W),lo=Vl(D,i,ut);We(o,D,Je),ut?(!A||!A.readOnly)&&(H._f.onBlur&&H._f.onBlur(_),c&&c(0)):H._f.onChange&&H._f.onChange(_);const Tn=I(D,Je,ut),vt=!ht(Tn)||lo;if(!ut&&m.state.next({name:D,type:_.type,values:et(o)}),tr)return(f.isValid||g.isValid)&&(t.mode==="onBlur"?ut&&v():ut||v()),vt&&m.state.next({name:D,...lo?{}:Tn});if(!t.resolver&&e.validate&&await F({name:D,eventType:_.type}),!ut&&lo&&m.state.next({...r}),t.resolver){const{errors:Pt}=await B([D]);if(y([D]),Y(Je),!V){!ht(Tn)&&m.state.next(Tn);return}const Ft=cp(r.errors,n,D),fr=cp(Pt,n,Ft.name||D);ue=fr.error,D=fr.name,Fe=ht(Pt)}else y([D],!0),ue=(await fp(H,i.disabled,o,C,t.shouldUseNativeValidation))[D],y([D]),Y(Je),V&&(ue?Fe=!1:(f.isValid||g.isValid)&&(Fe=await M({fields:n,onlyCheckValid:!0,name:D,eventType:_.type})));V&&(H._f.deps&&(!Array.isArray(H._f.deps)||H._f.deps.length>0)&&q(H._f.deps),O(D,Fe,ue,Tn))}},ve=(_,A)=>{if(Z(r.errors,A)&&_.focus)return _.focus(),1},q=async(_,A={})=>{let D,V;const H=Aa(_);if(t.resolver){const Y=await k(Ge(_)?_:H);D=ht(Y),V=_?!H.some(W=>Z(Y,W)):D}else _?(V=(await Promise.all(H.map(async Y=>{const W=Z(n,Y);return await M({fields:W&&W._f?{[Y]:W}:W,eventType:$r.TRIGGER})}))).every(Boolean),!(!V&&!r.isValid)&&v()):V=D=await M({fields:n,name:_,eventType:$r.TRIGGER});return m.state.next({...!Dt(_)||(f.isValid||g.isValid)&&D!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:D}:{},errors:r.errors}),A.shouldFocus&&!V&&Zs(n,ve,_?H:i.mount),V},$=(_,A)=>{let D={...a.mount?o:s};return A&&(D=Zh(A.dirtyFields?r.dirtyFields:r.touchedFields,D)),Ge(_)?D:Dt(_)?Z(D,_):_.map(V=>Z(D,V))},U=(_,A)=>({invalid:!!Z((A||r).errors,_),isDirty:!!Z((A||r).dirtyFields,_),error:Z((A||r).errors,_),isValidating:!!Z(r.validatingFields,_),isTouched:!!Z((A||r).touchedFields,_)}),oe=_=>{const A=_?Aa(_):void 0;A==null||A.forEach(D=>it(r.errors,D)),A?A.forEach(D=>{m.state.next({name:D,errors:r.errors})}):m.state.next({errors:{}})},ie=(_,A,D)=>{const V=(Z(n,_,{_f:{}})._f||{}).ref,H=Z(r.errors,_)||{},{ref:Y,message:W,type:de,...ue}=H;We(r.errors,_,{...ue,...A,ref:V}),m.state.next({name:_,errors:r.errors,isValid:!1}),D&&D.shouldFocus&&V&&V.focus&&V.focus()},Se=(_,A)=>Lt(_)?m.state.subscribe({next:D=>"values"in D&&_(D.values||ne(void 0,A),D)}):ne(_,A,!0),fe=_=>m.state.subscribe({next:A=>{if(BE(_.name,A.name,_.exact)&&ME(A,_.formState||f,wn,_.reRenderRoot)){const D={...o};_.callback({values:D,...r,...A,defaultValues:s})}}}).unsubscribe,ye=_=>(a.mount=!0,g={...g,..._.formState},fe({..._,formState:{...u,..._.formState}})),Le=(_,A={})=>{for(const D of _?Aa(_):i.mount)i.mount.delete(D),i.array.delete(D),A.keepValue||(it(n,D),it(o,D)),!A.keepError&&it(r.errors,D),!A.keepDirty&&it(r.dirtyFields,D),!A.keepTouched&&it(r.touchedFields,D),!A.keepIsValidating&&it(r.validatingFields,D),!t.shouldUnregister&&!A.keepDefaultValue&&it(s,D);m.state.next({values:et(o)}),m.state.next({...r,...A.keepDirty?{isDirty:z()}:{}}),!A.keepIsValid&&v()},J=({disabled:_,name:A})=>{if(zt(_)&&a.mount||_||i.disabled.has(A)){const H=i.disabled.has(A)!==!!_;_?i.disabled.add(A):i.disabled.delete(A),H&&a.mount&&!a.action&&v()}},he=(_,A={})=>{let D=Z(n,_);const V=zt(A.disabled)||zt(t.disabled),H=!i.registerName.has(_)&&D&&D._f&&!D._f.mount;return We(n,_,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:_}},name:_,mount:!0,...A}}),i.mount.add(_),D&&!H?J({disabled:zt(A.disabled)?A.disabled:t.disabled,name:_}):N(_,!0,A.value),{...V?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:Ys(A.min),max:Ys(A.max),minLength:Ys(A.minLength),maxLength:Ys(A.maxLength),pattern:Ys(A.pattern)}:{},name:_,onChange:we,onBlur:we,ref:Y=>{if(Y){i.registerName.add(_),he(_,A),i.registerName.delete(_),D=Z(n,_);const W=Ge(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,de=LE(W),ue=D._f.refs||[];if(de?ue.find(Fe=>Fe===W):W===D._f.ref)return;We(n,_,{_f:{...D._f,...de?{refs:[...ue.filter(ql),W,...Array.isArray(Z(s,_))?[{}]:[]],ref:{type:W.type,name:_}}:{ref:W}}}),N(_,!1,void 0,W)}else D=Z(n,_,{}),D._f&&(D._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(Vh(i.array,_)&&a.action)&&i.unMount.add(_)}}},Q=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Zs(n,ve,i.mount),be=_=>{zt(_)&&(m.state.next({disabled:_}),Zs(n,(A,D)=>{const V=Z(n,D);V&&(A.disabled=V._f.disabled||_,Array.isArray(V._f.refs)&&V._f.refs.forEach(H=>{H.disabled=V._f.disabled||_}))},0,!1))},He=(_,A)=>async D=>{let V;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let H=et(o);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:W}=await B();y(),r.errors=Y,H=et(W)}else await M({fields:n,eventType:$r.SUBMIT});if(i.disabled.size)for(const Y of i.disabled)it(H,Y);if(it(r.errors,Qh),ht(r.errors)){m.state.next({errors:{}});try{await _(H,D)}catch(Y){V=Y}}else A&&await A({...r.errors},D),Q(),setTimeout(Q);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ht(r.errors)&&!V,submitCount:r.submitCount+1,errors:r.errors}),V)throw V},ot=(_,A={})=>{Z(n,_)&&(Ge(A.defaultValue)?ce(_,et(Z(s,_))):(ce(_,A.defaultValue),We(s,_,et(A.defaultValue))),A.keepTouched||it(r.touchedFields,_),A.keepDirty||(it(r.dirtyFields,_),r.isDirty=A.defaultValue?z(_,et(Z(s,_))):z()),A.keepError||(it(r.errors,_),f.isValid&&v()),m.state.next({...r}))},Qe=(_,A={})=>{const D=_?et(_):s,V=et(D),H=ht(_),Y=V;if(A.keepDefaultValues||(s=D),!A.keepValues){if(A.keepDirtyValues){const W=new Set([...i.mount,...Object.keys(dn(s,o))]);for(const de of Array.from(W)){const ue=Z(r.dirtyFields,de),Fe=Z(o,de),Je=Z(Y,de);ue&&!Ge(Fe)?We(Y,de,Fe):!ue&&!Ge(Je)&&ce(de,Je)}}else{if(Ta&&Ge(_))for(const W of i.mount){const de=Z(n,W);if(de&&de._f){const ue=Array.isArray(de._f.refs)?de._f.refs[0]:de._f.ref;if(ka(ue)){const Fe=ue.closest("form");if(Fe){Fe.reset();break}}}}if(A.keepFieldsRef)for(const W of i.mount)ce(W,Z(Y,W));else n={}}if(t.shouldUnregister){if(o=A.keepDefaultValues?et(s):{},A.keepFieldsRef)for(const W of i.mount)We(o,W,Z(Y,W))}else o=et(Y);m.array.next({values:{...Y}}),m.state.next({values:{...Y}})}i={mount:A.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!ht(Y),a.watch=!!t.shouldUnregister,a.keepIsValid=!!A.keepIsValid,a.action=!1,A.keepErrors||(r.errors={}),m.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:H?!1:A.keepDirty?r.isDirty:A.keepValues?z():!!(A.keepDefaultValues&&!Vt(_,s)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:H?{}:A.keepDirtyValues?A.keepDefaultValues&&o?dn(s,o):r.dirtyFields:A.keepDefaultValues&&_?dn(s,_):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Ke=(_,A)=>Qe(Lt(_)?_(o):_,{...t.resetOptions,...A}),at=(_,A={})=>{const D=Z(n,_),V=D&&D._f;if(V){const H=V.refs?V.refs[0]:V.ref;H.focus&&setTimeout(()=>{H.focus(),A.shouldSelect&&Lt(H.select)&&H.select()})}},wn=_=>{r={...r,..._}},_n={control:{register:he,unregister:Le,getFieldState:U,handleSubmit:He,setError:ie,_subscribe:fe,_runSchema:B,_updateIsValidating:y,_focusError:Q,_getWatch:ne,_getDirty:z,_setValid:v,_setFieldArray:S,_setDisabledField:J,_setErrors:T,_getFieldArray:R,_reset:Qe,_resetDefaultValues:()=>Lt(t.defaultValues)&&t.defaultValues().then(_=>{Ke(_,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:x,_disableForm:be,_subjects:m,_proxyFormState:f,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(_){a=_},get _defaultValues(){return s},get _names(){return i},set _names(_){i=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:ye,trigger:q,register:he,handleSubmit:He,watch:Se,setValue:ce,setValues:te,getValues:$,reset:Ke,resetField:ot,resetDefaultValues:(_,A={})=>{if(s=et(_),!A.keepDirty){const D=dn(s,o);r.dirtyFields=D,r.isDirty=!ht(D)}A.keepIsValid||v(),m.state.next({...r,defaultValues:s})},clearErrors:oe,unregister:Le,setError:ie,setFocus:at,getFieldState:U};return{..._n,formControl:_n}}function zE(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),n=p.useRef(e.formControl),[s,o]=p.useState(()=>({...et(hp),isLoading:Lt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Lt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!Lt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...c}=UE(e);t.current={...c,formState:s}}const a=t.current.control;return a._options=e,xl(()=>{const i=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),a._formState.isReady=!0,i},[a]),p.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),p.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),p.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),p.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==s.isDirty&&a._subjects.state.next({isDirty:i})}},[a,s.isDirty]),p.useEffect(()=>{var i;e.values&&!Vt(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((i=a._options.resetOptions)===null||i===void 0)&&i.keepIsValid||a._setValid(),r.current=e.values,o(c=>({...c}))):a._resetDefaultValues()},[a,e.values]),p.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=p.useMemo(()=>Rh(s,a),[a,s]),t.current}function VE(e,t,r){const n=e??[],s=new Set(n.map(u=>u.type).filter(Boolean)),o=(t??[]).filter(u=>!s.has(u)),{data:a}=En({queryKey:["framework-search",o.sort().join(","),r],queryFn:()=>PS({type:o,systemDefault:"Yes"}),enabled:o.length>0,staleTime:600*1e3}),i=t&&t.length?n.filter(u=>u.type&&t.includes(u.type)):n,c=[...(a??[]).map(u=>({label:u.name,value:u.identifier})),...i.map(u=>({label:u.name,value:u.identifier}))],d=new Set;return c.filter(u=>d.has(u.value)?!1:(d.add(u.value),!0))}async function pp(e){var r,n;return(n=(r=(await Me.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function HE(e){var r,n,s,o,a,i,c;const t=En({queryKey:["channel",e],queryFn:()=>pp(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(s=t.data)==null?void 0:s.frameworks,collectionAdditionalCategories:(o=t.data)==null?void 0:o.collectionAdditionalCategories,contentAdditionalCategories:(a=t.data)==null?void 0:a.contentAdditionalCategories,defaultLicense:(i=t.data)==null?void 0:i.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function QE(e){const{data:t}=En({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>US(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const gp=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],WE={"First Section":{title:"Basic Information",description:"Core details that define the content identity."},"Second Section":{title:"Categorisation",description:"Category and type classification for the content."},"Third Section":{title:"Categorisation",description:"Category and type classification for the content."},"Organisation Framework Terms":{title:"Curriculum",description:"Framework-aligned categorisation."},"Target Framework Terms":{title:"Target Audience",description:"Curriculum alignment for the intended learners."},"Fourth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Sixth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Consumption policy":{title:"Consumption policy",description:"How learners move through this path."}},RE=new Set(["review","read","sourcingreview","orgreview"]),La={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},GE={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},KE={name:"details",description:"details",keywords:"details",appIcon:"details",primaryCategory:"details",additionalCategories:"details",board:"details",boardIds:"details",subject:"details",subjectIds:"details",medium:"details",framework:"details",topicsIds:"details",topic:"details",dialcodeRequired:"details",dialcodes:"details",audience:"audience",targetBoardIds:"audience",targetMediumIds:"audience",targetGradeLevelIds:"audience",targetSubjectIds:"audience",gradeLevel:"audience",creator:"licensing",author:"licensing",attributions:"licensing",license:"licensing",copyright:"licensing",copyrightYear:"licensing"},Xs={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},Hl=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function mp(e,t,r,n,s={}){if(!(e!=null&&e.length))return vp(pA(t,n,r,s),r,t,n,s);const o=new Map;for(const c of e){const d=c.code;d&&!o.has(d)&&o.set(d,c)}const a=new Set,i=e.filter(c=>{var u;if(n&&(c.code==="dialCode"||c.code==="dialcode")||((u=s.profile)==null?void 0:u.key)==="learningPath"&&Hl.has(c.code)||c.visible===!1)return!1;const d=c.code;return a.has(d)?!1:(a.add(d),!0)}).map(c=>{const d=c.code??"",u=rA(c),f=nA(c,r,t,o,s),g=t[d],m=ZE(d,yp(g,u),u,t,s),C={code:d,label:c.label??d,inputType:u,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:YE(d,c.editable!==!1,s),placeholder:c.placeholder,maxLength:c.maxLength,options:eA(f,m,u,r),depends:c.depends,tab:tA(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:m};if(d==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...C,required:h,visible:h}}return C});return vp(i,r,t,n,s)}function vp(e,t,r,n,s){var o;return((o=s.profile)==null?void 0:o.key)==="learningPath"?hA(e,t,r,n):fA(e,t,r,n)}function YE(e,t,r){var o;const n=r.editorMode??"edit";if(!RE.has(n))return t!==!1;const s=(o=r.editableFields)==null?void 0:o[n];return!!(s&&s.includes(e))}function ZE(e,t,r,n,s){const o=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return o?s.defaultLicense??"":t;case"copyright":return o&&s.channelName?s.channelName:t;case"copyrightYear":return o?String(new Date().getFullYear()):t;case"author":case"creator":return o&&s.userFullName?s.userFullName:t;case"instructions":{const a=n.instructions;return a&&typeof a=="object"&&!Array.isArray(a)?a.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!o)return t;const a=n.timeLimits,i=a==null?void 0:a[e];return i!=null&&i!==""?XE(Number(i)):t}default:return t}}function XE(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),s=o=>String(o).padStart(2,"0");return n>0?`${s(n)}:${s(r)}:${s(t)}`:`${s(r)}:${s(t)}`}function JE(e){var n,s,o;const t=new Map,r=a=>a==null?void 0:a.forEach(i=>{i.identifier&&t.set(i.identifier,i.name),i.name&&t.set(i.name,i.name)});return(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(a=>r(a.terms)),(o=e.targetFrameworks)==null||o.forEach(a=>{var i;return(i=a.categories)==null?void 0:i.forEach(c=>r(c.terms))}),t}function eA(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const s=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!s.length)return e;const o=e?[...e]:[],a=new Set(o.map(c=>c.value)),i=JE(n);for(const c of s){const d=String(c);a.has(d)||(o.push({label:i.get(d)??d,value:d}),a.add(d))}return o}function tA(e){const t=e.section;if(t){if(La[t])return La[t];const n=GE[t];if(n&&La[n])return La[n]}const r=e.code??"";return KE[r]??"details"}function yp(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function rA(e){const t=(e.inputType??e.dataType??"").toLowerCase(),n=(e.dataType??"").toLowerCase()==="list";return t==="select"?"select":t==="framework"||t==="frameworkcategoryselect"?n?"multiselect":"select":t==="topicselector"?"chips":t==="multiselect"||t==="multi-select"?"multiselect":t==="keywords"||e.code==="keywords"||e.code==="topic"||e.code==="topicsIds"?"chips":t==="radio"?"radio":e.code==="appIcon"||t==="appicon"?"appIcon":t==="textarea"||e.code==="description"?"textarea":t==="datepicker"||t==="date"?"datepicker":t==="datetime"||t==="datetime-local"?"datetime":t==="tagsinput"?"tagsinput":t==="nestedselect"||t==="nested-select"?n?"multiselect":"select":t==="license"?"license":t==="dialcode"||t==="dial-code"?"dialcode":"text"}function nA(e,t,r,n,s){var d;const o=e.code??"";if(((d=s.profile)==null?void 0:d.key)==="learningPath"&&o==="policy")return gp;if(o==="maxQuestions"){const u=s.childCount??0;if(u>0)return Array.from({length:u},(f,g)=>({label:String(g+1),value:String(g+1)}))}const a=e.range;if(Array.isArray(a)&&a.length)return typeof a[0]=="string"?a.map(u=>({label:u,value:u})):a.map(u=>({label:u.name,value:u.identifier}));const i=e.enum;if(i!=null&&i.length)return i.map(u=>({label:u,value:u}));if(o==="framework")return t.orgFrameworks;if(o==="additionalCategories"){const f=(s.objectType??"")==="QuestionSet"?s.contentAdditionalCategories??s.collectionAdditionalCategories:s.collectionAdditionalCategories??s.contentAdditionalCategories,g=(f&&f.length?f:s.contextAdditionalCategories)??t.channelAdditionalCategories;return g!=null&&g.length?iA(g).map(m=>({label:m,value:m})):void 0}const c=e.sourceCategory??Xs[o];if(c)return bp(o,c,e,t,r,n)}function sA(e,t){return Hl.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function oA(e,t){return Hl.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function Ql(e,t,r){var o,a,i,c,d;const n=(a=(o=e.organisationFramework)==null?void 0:o.categories)==null?void 0:a.find(u=>u.code===t),s=(d=(c=(i=e.targetFrameworks)==null?void 0:i[0])==null?void 0:c.categories)==null?void 0:d.find(u=>u.code===t);return r?(s==null?void 0:s.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(s==null?void 0:s.terms)??[]}function aA(e){const t=new Set,r=[];for(const n of e){const s=n.identifier??n.name;s&&!t.has(s)&&(t.add(s),r.push(n))}return r}function iA(e){return Array.from(new Set(e))}function lA(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function bp(e,t,r,n,s,o){const a=sA(e,r),i=oA(e,r),c=h=>({label:h.name,value:a?h.identifier:h.name}),d=r.depends;if(!(d!=null&&d.length))return Ql(n,t,i).map(c);const u=d.flatMap(h=>lA(s[h])).map(String);if(!u.length)return[];const f=[];for(const h of d){const v=o.get(h),y=(v==null?void 0:v.sourceCategory)??Xs[h]??h;f.push(...Ql(n,y,i))}const m=f.filter(h=>u.includes(String(h.name))||u.includes(String(h.identifier))||u.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),C=aA(m);return C.length?C.map(c):Ql(n,t,i).map(c)}function Js(e,t){const r=Xs[e];if(r)return bp(e,r,{},t,{},new Map)}function Ye(e,t,r){return yp(e[t],r)}const cA=["board","medium","gradeLevel","subject"];function dA(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>cA.includes(n.code)):!0}function uA(e,t){var r,n,s;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(o=>o.code===t)||(s=e.targetFrameworks)!=null&&s.some(o=>{var a;return(a=o.categories)==null?void 0:a.some(i=>i.code===t)}))}function fA(e,t,r,n){var c;if(!n||dA(t))return e;const s=e.filter(d=>{const u=d.sourceCategory??Xs[d.code];return!u||uA(t,u)}),o=new Set(s.map(d=>d.code)),a=[];for(const d of((c=t.organisationFramework)==null?void 0:c.categories)??[])o.has(d.code)||a.push({code:d.code,label:d.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(d.terms??[]).map(u=>({label:u.name,value:u.name})),currentValue:Ye(r,d.code,"multiselect")});if(!a.length)return s;const i=s.findIndex(d=>d.code==="framework");return i>=0?[...s.slice(0,i+1),...a,...s.slice(i+1)]:[...s,...a]}const Wl="Organisation Framework Terms";function hA(e,t,r,n){var m,C;if(!n)return e;const s=[...((m=t.organisationFramework)==null?void 0:m.categories)??[]].sort((h,v)=>(h.index??1/0)-(v.index??1/0));if(!s.length)return e;const o=(C=Ru(s))==null?void 0:C.code,a=h=>h.sourceCategory??Xs[h.code];let c=e.filter(h=>{const v=a(h);return v?v!==o&&s.some(y=>y.code===v):!0}).map(h=>a(h)?{...h,section:Wl,required:!0,inputType:"select",currentValue:Ye(r,h.code,"select")}:h),d=c.findIndex(h=>h.code==="framework");if(d===-1){const h={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:Wl,options:t.orgFrameworks,currentValue:Ye(r,"framework","select")},v=c.findIndex(y=>!!a(y));d=v>=0?v:c.length,c=[...c.slice(0,d),h,...c.slice(d)]}if(!!!Ye(r,"framework","select"))return c.filter(h=>h.code==="framework"||!a(h));const f=new Set(c.map(h=>h.code)),g=s.filter(h=>h.code!==o&&!f.has(h.code)).map(h=>({code:h.code,label:h.name,inputType:"select",required:!0,editable:!0,tab:"details",section:Wl,options:(h.terms??[]).map(v=>({label:v.name,value:v.name})),currentValue:Ye(r,h.code,"select")}));return g.length?[...c.slice(0,d+1),...g,...c.slice(d+1)]:c}function pA(e,t,r,n={}){var o,a;const s=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:Ye(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:Ye(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:Ye(e,"keywords","chips")}];return t?((o=n.profile)==null?void 0:o.key)==="learningPath"?(s.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ye(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:gp,currentValue:Ye(e,"policy","select")||"strict"}),s):(s.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:Ye(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:Ye(e,"additionalCategories","multiselect"),options:(a=r.channelAdditionalCategories)==null?void 0:a.map(i=>({label:i,value:i}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ye(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Js("subjectIds",r),currentValue:Ye(e,"subjectIds","multiselect")}),s.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:Ye(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Js("targetBoardIds",r),currentValue:Ye(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:Js("targetMediumIds",r),currentValue:Ye(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:Js("targetGradeLevelIds",r),currentValue:Ye(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:Js("targetSubjectIds",r),currentValue:Ye(e,"targetSubjectIds","multiselect")}),s.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"license","select")}),s):s}const gA=["allowECM","levels","setPeriod","instances"];function Cp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function mA(e,t={}){const r={...e};for(const o of gA)delete r[o];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Cp(n)});const s=e.instances;return s!=null&&s!==""&&(r.instances={label:s}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function vA(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?Cp(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function yA(e,t){const{watch:r,setValue:n}=e,s=p.useRef(!1);p.useEffect(()=>{const o=r((a,{name:i})=>{var c;if(!(!i||s.current)){s.current=!0;try{const d=new Set([i]);let u=!0;for(;u;){u=!1;for(const f of t)d.has(f.code)||(c=f.depends)!=null&&c.some(g=>d.has(g))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),d.add(f.code),u=!0)}}finally{s.current=!1}}});return()=>o.unsubscribe()},[r,n,t])}const Gn={section:"_section_ylgu8_1",header:"_header_ylgu8_11",title:"_title_ylgu8_17",description:"_description_ylgu8_24",divider:"_divider_ylgu8_30",fields:"_fields_ylgu8_36"},bA=({title:e,description:t,children:r})=>l.jsxs("div",{className:Gn.section,children:[l.jsxs("div",{className:Gn.header,children:[l.jsx("h3",{className:Gn.title,children:e}),t&&l.jsx("p",{className:Gn.description,children:t})]}),l.jsx("hr",{className:Gn.divider}),l.jsx("div",{className:Gn.fields,children:r})]}),j={field:"_field_1s288_1",fullWidth:"_fullWidth_1s288_7",label:"_label_1s288_11",required:"_required_1s288_19",input:"_input_1s288_24",textarea:"_textarea_1s288_45",inputError:"_inputError_1s288_50",error:"_error_1s288_54",selectBtn:"_selectBtn_1s288_59",selectOpen:"_selectOpen_1s288_83",placeholder:"_placeholder_1s288_87",selectedVal:"_selectedVal_1s288_91",chevronUp:"_chevronUp_1s288_95",dropdown:"_dropdown_1s288_100",option:"_option_1s288_116",optionSelected:"_optionSelected_1s288_134",noOpts:"_noOpts_1s288_139",chipGroup:"_chipGroup_1s288_146",chipInput:"_chipInput_1s288_158",addChipBtn:"_addChipBtn_1s288_167",radioGroup:"_radioGroup_1s288_184",radioLabel:"_radioLabel_1s288_191",iconWrap:"_iconWrap_1s288_199",iconPreview:"_iconPreview_1s288_214",iconPlaceholder:"_iconPlaceholder_1s288_220",removeIconBtn:"_removeIconBtn_1s288_233",tagChip:"_tagChip_1s288_252",tagChipRemove:"_tagChipRemove_1s288_264",nestedSelectRow:"_nestedSelectRow_1s288_278",dialcodeRow:"_dialcodeRow_1s288_287",validateBtn:"_validateBtn_1s288_293",dialcodeValid:"_dialcodeValid_1s288_315",dialcodeSpinner:"_dialcodeSpinner_1s288_325"},Sp=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:o,placeholder:a})=>{const i=ae(),{register:c,formState:{errors:d}}=Zt(),u=d[e],f={required:r?i.textField.requiredError.replace("{field}",t):!1,maxLength:o?{value:o,message:i.textField.maxLengthError.replace("{max}",String(o))}:void 0};return l.jsxs("div",{className:[j.field,s?j.fullWidth:""].join(" "),children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),s?l.jsx("textarea",{id:e,className:[j.input,j.textarea,u?j.inputError:""].join(" "),disabled:n,placeholder:a,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[j.input,u?j.inputError:""].join(" "),disabled:n,placeholder:a,...c(e,f)}),u&&l.jsx("span",{className:j.error,children:String(u.message)})]})},CA=({name:e,label:t,options:r,required:n,disabled:s})=>{var v;const o=ae(),[a,i]=p.useState(!1),c=p.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:g}}=Zt(),m=u(e),C=((v=r.find(y=>y.value===m))==null?void 0:v.label)??o.selectField.selectPlaceholder,h=g[e];return p.useEffect(()=>{if(!a)return;const y=b=>{var S;(S=c.current)!=null&&S.contains(b.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]),l.jsxs("div",{className:j.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?o.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[j.selectBtn,h?j.inputError:"",a?j.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:m?j.selectedVal:j.placeholder,children:C}),l.jsx(Xr,{size:14,className:a?j.chevronUp:""})]}),a&&l.jsxs("div",{className:j.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[j.option,m===y.value?j.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:y.label}),m===y.value&&l.jsx(Zr,{size:13})]},y.value)),!r.length&&l.jsx("span",{className:j.noOpts,children:o.selectField.noOptionsMessage})]}),h&&l.jsx("span",{className:j.error,children:String(h.message)})]})},SA=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=ae(),[a,i]=p.useState(!1),c=p.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:g}}=Zt(),m=u(e)??[],C=g[e],h=m.length?`${m.length} ${o.multiSelectField.selectedCountSuffix}`:o.multiSelectField.selectPlaceholder;p.useEffect(()=>{if(!a)return;const y=b=>{var S;(S=c.current)!=null&&S.contains(b.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]);const v=y=>{const b=m.includes(y)?m.filter(S=>S!==y):[...m,y];f(e,b,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:j.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?o.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[j.selectBtn,C?j.inputError:"",a?j.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:m.length?j.selectedVal:j.placeholder,children:h}),l.jsx(Xr,{size:14,className:a?j.chevronUp:""})]}),a&&l.jsxs("div",{className:j.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[j.option,m.includes(y.value)?j.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(Zr,{size:13,style:{opacity:m.includes(y.value)?1:0}}),l.jsx("span",{children:y.label})]},y.value)),!r.length&&l.jsx("span",{className:j.noOpts,children:o.multiSelectField.noOptionsMessage})]}),C&&l.jsx("span",{className:j.error,children:String(C.message)})]})},wA=({name:e,label:t,required:r,disabled:n,placeholder:s})=>{const o=ae(),a=s??o.chipGroupField.addPlaceholder,[i,c]=p.useState(""),[d,u]=p.useState(!1),f=p.useRef(null),{watch:g,setValue:m,formState:{errors:C}}=Zt(),h=g(e)??[],v=C[e],y=()=>{const S=i.trim();S&&!h.includes(S)&&m(e,[...h,S],{shouldDirty:!0}),c(""),u(!1)},b=S=>m(e,h.filter(w=>w!==S),{shouldDirty:!0});return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:j.chipGroup,children:[h.map(S=>l.jsxs("span",{className:"sbx-chip filled",children:[S,!n&&l.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>b(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(d?l.jsx("input",{ref:f,autoFocus:!0,className:j.chipInput,value:i,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),u(!1))},onBlur:y,placeholder:a}):l.jsxs("button",{type:"button",className:j.addChipBtn,onClick:()=>{u(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(Er,{size:12})," ",o.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:j.error,children:String(v.message)})]})},_A=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=ae(),{register:a,formState:{errors:i}}=Zt(),c=i[e];return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("div",{className:j.radioGroup,children:r.map(d=>l.jsxs("label",{className:j.radioLabel,children:[l.jsx("input",{type:"radio",value:d.value,disabled:s,...a(e,{required:n?o.radioField.requiredError.replace("{field}",t):!1})}),d.label]},d.value))}),c&&l.jsx("span",{className:j.error,children:String(c.message)})]})};async function TA(e,t,r,n){var a,i;const o=(i=(a=(await Me.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:a.result)==null?void 0:i.node_id;if(!o)throw new Error("Asset creation failed: no node_id returned");return o}async function EA(e,t){var s,o;const n=(o=(s=(await Me.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)==null?void 0:o.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function AA(e,t,r={}){const n=await fetch(e,{method:"PUT",body:t,headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"application/octet-stream",...r}});if(!n.ok)throw new Error(`Blob upload failed: ${n.status} ${n.statusText}`)}async function kA(e,t,r){var a,i;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const o=(i=(a=(await Me.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:a.result)==null?void 0:i.content_url;if(!o)throw new Error("Asset finalize failed: no content_url returned");return o}const Ee={overlay:"_overlay_ga6eh_1",modal:"_modal_ga6eh_12",header:"_header_ga6eh_24",title:"_title_ga6eh_33",closeBtn:"_closeBtn_ga6eh_39",tabs:"_tabs_ga6eh_57",tab:"_tab_ga6eh_57",activeTab:"_activeTab_ga6eh_83",body:"_body_ga6eh_88",searchWrap:"_searchWrap_ga6eh_99",searchIcon:"_searchIcon_ga6eh_104",searchInput:"_searchInput_ga6eh_113",grid:"_grid_ga6eh_132",imgCell:"_imgCell_ga6eh_148",imgCellSelected:"_imgCellSelected_ga6eh_166",thumb:"_thumb_ga6eh_171",noThumb:"_noThumb_ga6eh_177",checkBadge:"_checkBadge_ga6eh_183",loadMoreBtn:"_loadMoreBtn_ga6eh_198",loadingRow:"_loadingRow_ga6eh_220",empty:"_empty_ga6eh_230",spinner:"_spinner_ga6eh_237",uploadArea:"_uploadArea_ga6eh_247",dropZone:"_dropZone_ga6eh_256",uploadIcon:"_uploadIcon_ga6eh_277",dropText:"_dropText_ga6eh_281",dropSubtext:"_dropSubtext_ga6eh_288",uploadPreview:"_uploadPreview_ga6eh_294",hiddenInput:"_hiddenInput_ga6eh_301",fileName:"_fileName_ga6eh_305",errorText:"_errorText_ga6eh_311",footer:"_footer_ga6eh_318",cancelBtn:"_cancelBtn_ga6eh_328",confirmBtn:"_confirmBtn_ga6eh_345"},wp=18,_p=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const s=ae(),[o,a]=p.useState("my"),[i,c]=p.useState(""),[d,u]=p.useState([]),[f,g]=p.useState(0),[m,C]=p.useState(!1),[h,v]=p.useState(null),[y,b]=p.useState(0),[S,w]=p.useState(null),[T,E]=p.useState(""),[N,I]=p.useState(!1),[O,B]=p.useState(""),k=p.useRef(null),F=X(q=>{var $,U;return((U=($=q.editorConfig)==null?void 0:$.context)==null?void 0:U.channel)??""}),M=X(q=>{var $,U;return((U=($=q.editorConfig)==null?void 0:$.context)==null?void 0:U.uid)??""}),x=X(q=>{var $,U,oe;return((oe=(U=($=q.editorConfig)==null?void 0:$.context)==null?void 0:U.cloudStorage)==null?void 0:oe.presigned_headers)??{}}),z=X(q=>{var $,U,oe;return((oe=(U=($=q.editorConfig)==null?void 0:$.config)==null?void 0:U.assetConfig)==null?void 0:oe.size)??1*1024*1024}),ne=X(q=>{var $,U,oe;return((oe=(U=($=q.editorConfig)==null?void 0:$.config)==null?void 0:U.assetConfig)==null?void 0:oe.accepted)??"image/png,image/jpeg"}),R=p.useCallback(async(q,$,U=!1)=>{var oe;C(!0);try{const ie={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};o==="my"&&M&&(ie.createdBy=M),F&&(ie.channel=F);const fe=((oe=(await Me.post("/action/composite/v3/search",{request:{filters:ie,query:q,limit:wp,offset:$,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:oe.result)??{},ye=fe.content??[];g(fe.count??0),u(Le=>U?[...Le,...ye]:ye)}catch{}finally{C(!1)}},[o,M,F]);p.useEffect(()=>{o!=="upload"&&(u([]),b(0),R(i,0))},[o]);const ge=p.useRef(),me=q=>{c(q),clearTimeout(ge.current),ge.current=setTimeout(()=>{u([]),b(0),R(q,0)},400)},K=()=>{const q=y+wp;b(q),R(i,q,!0)},ce=()=>{const q=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";q&&r(q)};p.useEffect(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);const te=q=>{var oe;const $=(oe=q.target.files)==null?void 0:oe[0];if(q.target.value="",!$)return;const U=ne.split(",").map(ie=>ie.trim());if(!U.includes($.type)){const ie=U.map(Se=>Se.replace("image/","").toUpperCase()).join(", ");B(s.appIconPickerModal.invalidFileTypeError.replace("{types}",ie));return}if($.size>z){const ie=(z/1048576).toFixed(0);B(s.appIconPickerModal.fileTooLargeError.replace("{size}",ie));return}T&&URL.revokeObjectURL(T),w($),E(URL.createObjectURL($)),B("")},we=async()=>{if(S){I(!0),B("");try{const q=await TA(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,M,F),$=await EA(q,S.name);await AA($,S,x);const U=$.split("?")[0],oe=await kA(q,U,S.type);r(oe)}catch(q){B(q instanceof Error?q.message:s.appIconPickerModal.uploadFailedError)}finally{I(!1)}}},ve=d.length<f;return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.header,children:[l.jsx("span",{className:Ee.title,children:s.appIconPickerModal.title}),l.jsx("button",{className:Ee.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:l.jsx(or,{size:18})})]}),l.jsxs("div",{className:Ee.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":o==="my",className:`${Ee.tab} ${o==="my"?Ee.activeTab:""}`,onClick:()=>a("my"),children:s.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":o==="all",className:`${Ee.tab} ${o==="all"?Ee.activeTab:""}`,onClick:()=>a("all"),children:s.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":o==="upload",className:`${Ee.tab} ${o==="upload"?Ee.activeTab:""}`,onClick:()=>a("upload"),children:[l.jsx(vi,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Ee.body,children:o!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ee.searchWrap,children:[l.jsx(Uo,{size:14,className:Ee.searchIcon}),l.jsx("input",{type:"search",className:Ee.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:i,onChange:q=>me(q.target.value)})]}),m&&d.length===0?l.jsxs("div",{className:Ee.loadingRow,children:[l.jsx($o,{size:20,className:Ee.spinner}),l.jsx("span",{children:s.appIconPickerModal.loadingText})]}):d.length===0?l.jsx("div",{className:Ee.empty,children:s.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Ee.grid,children:d.map(q=>{const $=q.appIcon??q.artifactUrl??q.downloadUrl??"",U=(h==null?void 0:h.identifier)===q.identifier;return l.jsxs("button",{type:"button",className:`${Ee.imgCell} ${U?Ee.imgCellSelected:""}`,onClick:()=>v(q),title:q.name,children:[$?l.jsx("img",{src:$,alt:q.name,className:Ee.thumb}):l.jsx("div",{className:Ee.noThumb,children:s.appIconPickerModal.noThumbnailText}),U&&l.jsx("div",{className:Ee.checkBadge,children:l.jsx(Zr,{size:12})})]},q.identifier)})}),ve&&!m&&l.jsx("button",{className:Ee.loadMoreBtn,onClick:K,children:s.appIconPickerModal.loadMoreButton}),m&&d.length>0&&l.jsx("div",{className:Ee.loadingRow,children:l.jsx($o,{size:16,className:Ee.spinner})})]}):l.jsxs("div",{className:Ee.uploadArea,children:[l.jsx("div",{className:Ee.dropZone,onClick:()=>{var q;return(q=k.current)==null?void 0:q.click()},onDragOver:q=>q.preventDefault(),onDrop:q=>{q.preventDefault();const $=q.dataTransfer.files[0];$&&te({target:{files:[$],value:""}})},children:T?l.jsx("img",{src:T,alt:s.appIconPickerModal.previewAlt,className:Ee.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(vi,{size:32,className:Ee.uploadIcon}),l.jsx("p",{className:Ee.dropText,children:s.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Ee.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",ne.split(",").map(q=>q.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(z/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:k,type:"file",accept:ne,className:Ee.hiddenInput,onChange:te}),S&&l.jsx("p",{className:Ee.fileName,children:S.name}),O&&l.jsx("p",{className:Ee.errorText,children:O})]})}),l.jsxs("div",{className:Ee.footer,children:[l.jsx("button",{className:Ee.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),o==="upload"?l.jsx("button",{className:Ee.confirmBtn,disabled:!S||N,onClick:we,children:N?l.jsxs(l.Fragment,{children:[l.jsx($o,{size:14,className:Ee.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Ee.confirmBtn,disabled:!h,onClick:ce,children:s.appIconPickerModal.useSelectedButton})]})]})})},IA=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const o=ae(),[a,i]=p.useState(!1),{watch:c,setValue:d,register:u,formState:{errors:f}}=Zt(),g=c(e),m=f[e],C=v=>{d(e,v,{shouldDirty:!0,shouldValidate:!0}),i(!1)},h=()=>{d(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?o.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:j.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":o.appIconField.selectIconAriaLabel,onClick:()=>!s&&i(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!s&&i(!0)},children:g?l.jsx("img",{src:g,alt:o.appIconField.iconAlt,className:j.iconPreview}):l.jsxs("div",{className:j.iconPlaceholder,children:[l.jsx(Td,{size:20}),l.jsx("span",{children:o.appIconField.selectIconLabel})]})}),g&&!s&&l.jsxs("button",{type:"button",className:j.removeIconBtn,onClick:h,"aria-label":o.appIconField.removeIconAriaLabel,children:[l.jsx(Nn,{size:13}),l.jsx("span",{children:o.appIconField.removeLabel})]}),m&&l.jsx("span",{className:j.error,children:String(m.message)}),a&&l.jsx(_p,{nodeId:r,currentValue:g,onSelect:C,onClose:()=>i(!1)})]})},LA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Zt(),{field:a,fieldState:{error:i}}=Ks({name:e,control:o,rules:{required:r?s.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[j.input,i?j.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:a.onChange,onBlur:a.onBlur,ref:a.ref}),i&&l.jsx("span",{className:j.error,children:String(i.message)})]})},DA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Zt(),{field:a,fieldState:{error:i}}=Ks({name:e,control:o,rules:{required:r?s.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,d]=p.useState(""),u=p.useRef(null),f=a.value??[],g=v=>{const y=v.trim();!y||f.includes(y)||a.onChange([...f,y])},m=v=>{a.onChange(f.filter(y=>y!==v))},C=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),g(c),d("")):v.key==="Backspace"&&c===""&&f.length>0&&m(f[f.length-1])},h=()=>{c.trim()&&(g(c),d("")),a.onBlur()};return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:[j.chipGroup,i?j.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=u.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:j.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:j.tagChipRemove,onClick:y=>{y.stopPropagation(),m(v)},"aria-label":`Remove ${v}`,children:l.jsx(or,{size:11})})]},v)),!n&&l.jsx("input",{ref:u,className:j.chipInput,value:c,onChange:v=>d(v.target.value),onKeyDown:C,onBlur:h,placeholder:f.length===0?s.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),i&&l.jsx("span",{className:j.error,children:String(i.message)})]})},NA=({name:e,label:t,levels:r,required:n,disabled:s})=>{const o=ae(),{control:a}=Zt(),{field:i,fieldState:{error:c}}=Ks({name:e,control:a,rules:{required:n?o.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=i.value??{},u=(f,g,m)=>{const C={};for(let h=0;h<g;h++)C[r[h].code]=d[r[h].code]??"";C[f]=m;for(let h=g+1;h<r.length;h++)C[r[h].code]="";i.onChange(C)};return l.jsxs("div",{className:[j.field,j.fullWidth].join(" "),children:[l.jsxs("label",{className:j.label,children:[t,n&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("div",{className:j.nestedSelectRow,children:r.map((f,g)=>{const m=g>0&&!d[r[g-1].code];return l.jsxs("div",{className:j.field,style:{flex:1},children:[l.jsx("label",{className:j.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[j.input,c?j.inputError:""].join(" "),disabled:s||m,value:d[f.code]??"",onChange:C=>u(f.code,g,C.target.value),onBlur:i.onBlur,children:[l.jsx("option",{value:"",children:o.nestedSelectField.selectPlaceholder}),f.options.map(C=>l.jsx("option",{value:C.value,children:C.label},C.value))]})]},f.code)})}),c&&l.jsx("span",{className:j.error,children:String(c.message)})]})},Tp=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC0 1.0 (Public Domain)",value:"CC0 1.0"}],PA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),[o,a]=p.useState(!1),i=p.useRef(null),{register:c,watch:d,setValue:u,formState:{errors:f}}=Zt(),g=d(e),m=Tp.find(v=>v.value===g),C=(m==null?void 0:m.label)??s.licenseSelectField.selectPlaceholder,h=f[e];return p.useEffect(()=>{if(!o)return;const v=y=>{var b;(b=i.current)!=null&&b.contains(y.target)||a(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[o]),l.jsxs("div",{className:j.field,ref:i,style:{position:"relative"},children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?s.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[j.selectBtn,h?j.inputError:"",o?j.selectOpen:""].join(" "),onClick:()=>a(v=>!v),"aria-haspopup":"listbox","aria-expanded":o,children:[l.jsx("span",{className:g?j.selectedVal:j.placeholder,children:C}),l.jsx(Xr,{size:14,className:o?j.chevronUp:""})]}),o&&l.jsx("div",{className:j.dropdown,role:"listbox",children:Tp.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":g===v.value,className:[j.option,g===v.value?j.optionSelected:""].join(" "),onClick:()=>{u(e,v.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:v.label}),g===v.value&&l.jsx(Zr,{size:13})]},v.value))}),h&&l.jsx("span",{className:j.error,children:String(h.message)})]})},OA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Zt(),{field:a,fieldState:{error:i}}=Ks({name:e,control:o,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,d]=p.useState("idle"),[u,f]=p.useState(""),g=async()=>{const C=(a.value??"").trim();if(!C){d("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}d("loading"),f("");try{const h=await VS(C),v=h==null?void 0:h.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(d("valid"),f(s.dialcodeInputField.validMessage)):(d("invalid"),f(s.dialcodeInputField.notFoundMessage))}catch{d("invalid"),f(s.dialcodeInputField.validationFailedMessage)}},m=()=>c==="loading"?l.jsx($o,{size:16,className:j.dialcodeSpinner}):c==="valid"?l.jsx(bd,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(Ey,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsxs("div",{className:j.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[j.input,i?j.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:C=>{a.onChange(C),d("idle"),f("")},onBlur:a.onBlur,ref:a.ref,placeholder:s.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:j.validateBtn,onClick:g,disabled:n||c==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:c==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),m()]}),i&&l.jsx("span",{className:j.error,children:String(i.message)}),!i&&u&&l.jsx("span",{className:c==="valid"?j.dialcodeValid:j.error,children:u})]})},Ht={cards:"_cards_1j7eu_1",card:"_card_1j7eu_1",cardActive:"_cardActive_1j7eu_30",cardIcon:"_cardIcon_1j7eu_35",cardIconPrimary:"_cardIconPrimary_1j7eu_46",cardIconHover:"_cardIconHover_1j7eu_50",radioDot:"_radioDot_1j7eu_54",radioDotActive:"_radioDotActive_1j7eu_65",cardTitle:"_cardTitle_1j7eu_70",cardTitleInk:"_cardTitleInk_1j7eu_76",cardDescription:"_cardDescription_1j7eu_80",cardDescriptionCharcoal:"_cardDescriptionCharcoal_1j7eu_86"},xA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Zt(),a=[{value:"strict",Icon:Ed,iconVariant:Ht.cardIconPrimary,title:s.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:Ky,iconVariant:Ht.cardIconPrimary,title:s.learningPath.policyAdaptiveLabel,titleVariant:Ht.cardTitleInk,description:l.jsxs(l.Fragment,{children:[s.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:j.required,children:"*"}),s.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:Ht.cardDescriptionCharcoal},{value:"priorLearning",Icon:zy,iconVariant:Ht.cardIconHover,title:s.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:j.field,children:[l.jsxs("label",{className:j.label,children:[t,r&&l.jsx("span",{className:j.required,children:"*"})]}),l.jsx(AE,{name:e,control:o,rules:{required:r?s.selectField.requiredError.replace("{field}",t):!1},render:({field:i})=>l.jsx("div",{className:Ht.cards,children:a.map(({value:c,Icon:d,iconVariant:u,title:f,titleVariant:g,description:m,descriptionVariant:C})=>{const h=i.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[Ht.card,h?Ht.cardActive:""].join(" "),onClick:()=>i.onChange(c),children:[l.jsx("span",{className:[Ht.cardIcon,u].join(" "),children:l.jsx(d,{size:16})}),l.jsx("span",{className:[Ht.radioDot,h?Ht.radioDotActive:""].join(" ")}),l.jsx("span",{className:[Ht.cardTitle,g].join(" "),children:f}),l.jsx("span",{className:[Ht.cardDescription,C].join(" "),children:m})]},c)})})})]})},Kn={form:"_form_lktqh_1",formLp:"_formLp_lktqh_7",ungrouped:"_ungrouped_lktqh_12",ungroupedLp:"_ungroupedLp_lktqh_23",fullWidthField:"_fullWidthField_lktqh_27",noFields:"_noFields_lktqh_31"},FA=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:o,onFormStatusChange:a})=>{var He,ot,Qe,Ke,at,wn,ds,io,_n;const i=ae(),c=X(_=>_.editorConfig),d=X(_=>_.editorProfile),u=d.key==="learningPath",f=X(_=>_.rootFormConfig),g=X(_=>_.unitFormConfig),m=X(_=>_.categoryMeta),C=X(_=>_.contentFramework),h=X(_=>_.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:b}=sa(C??((He=c==null?void 0:c.context)==null?void 0:He.framework),h??((ot=c==null?void 0:c.context)==null?void 0:ot.targetFWIds)),{frameworks:S,collectionAdditionalCategories:w,contentAdditionalCategories:T,defaultLicense:E,name:N}=HE((Qe=c==null?void 0:c.context)==null?void 0:Qe.channel),I=QE(((Ke=c==null?void 0:c.context)==null?void 0:Ke.userId)??((at=c==null?void 0:c.context)==null?void 0:at.uid)),O=VE(S,(wn=m==null?void 0:m.frameworkMetadata)==null?void 0:wn.orgFWType,(ds=c==null?void 0:c.context)==null?void 0:ds.channel),B={organisationFramework:v,targetFrameworks:y,orgFrameworks:O,channelAdditionalCategories:w},k=se(_=>_.selectedNodeId),F=se(_=>_.treeData),M=se(_=>_.treeCache),x=k?M[k]??{}:{},z={...e,...x},ne=p.useMemo(()=>{var A;if(!k)return 0;const _=[...F];for(;_.length;){const D=_.shift();if(D.id===k)return((A=D.children)==null?void 0:A.length)??0;D.children&&_.push(...D.children)}return 0},[F,k]),R=(c==null?void 0:c.config)??{},ge=(c==null?void 0:c.context)??{},me={editorMode:s,editableFields:R.editableFields,objectType:R.objectType,setDefaultCopyRight:R.setDefaultCopyRight===!0,defaultLicense:ge.defaultLicense??E,contextAdditionalCategories:ge.additionalCategories,userFullName:((io=ge.user)==null?void 0:io.fullName)??I,channelName:N,collectionAdditionalCategories:w,contentAdditionalCategories:T,childCount:ne,profile:d},K=r?f:g,ce=K||(((_n=c==null?void 0:c.config.hierarchy)==null?void 0:_n.formConfig)??[]),te=mp(ce,z,B,r,me),we=te.filter(_=>_.tab===t&&_.inputType!=="appIcon"&&_.visible!==!1),ve=zE({mode:"onChange",defaultValues:Object.fromEntries(te.map(_=>{const A=["multiselect","chips","keywords","tagsinput"],D=["nestedselect"];return A.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??[]]:D.includes(_.inputType)?[_.code,_.currentValue??_.defaultValue??{}]:[_.code,_.currentValue??_.defaultValue??""]}))});yA(ve,te);const{updateNode:q}=se(),$=p.useRef(te);$.current=te;const U=p.useRef(k);U.current=k;const oe=p.useRef(o);oe.current=o;const ie=p.useRef(a);ie.current=a;const Se=p.useRef(typeof z.shuffle=="boolean"?z.shuffle:void 0),fe=p.useRef(z.name??"");fe.current=z.name??"";const ye=p.useRef(s);ye.current=s;const Le=ir(),J=p.useRef(Le==null?void 0:Le.code);J.current=Le==null?void 0:Le.code;const he=["review","read","sourcingreview","orgreview"];p.useEffect(()=>{const _=U.current;if(_){const A=Object.fromEntries($.current.filter(D=>D.currentValue!==void 0&&D.currentValue!==null).map(D=>[D.code,D.currentValue]));Object.keys(A).length>0&&q(_,A)}ve.trigger().then(()=>{const A=ve.formState.errors,D=$.current,V=Array.from(new Set(Object.keys(A).map(H=>{var Y;return(Y=D.find(W=>W.code===H))==null?void 0:Y.tab}).filter(Boolean)));ie.current(Object.keys(A).length===0,V)})},[]),p.useEffect(()=>{const _=ve.watch((A,{name:D})=>{const V=U.current;if(!V)return;const H=$.current,Y=new Set(H.map(ue=>ue.code));if(D&&Y.has(D)){let ue=ve.getValues(D);if(D==="dialcodes"&&(ue=Array.isArray(ue)?ue:ue?[ue]:[]),D==="shuffle"&&(ue===!0&&Se.current===!1&&pe(i.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(Dn,{size:16})}),Se.current=ue),D==="framework"&&r&&typeof ue=="string"&&ue){const Je=X.getState();if(Je.setContentFramework(ue,Je.contentTargetFWIds),u){const ut=se.getState().pruneCoursesByFramework(ue);ut>0&&pe(i.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(ut)),{icon:l.jsx(Dn,{size:16}),duration:5e3});const tr=se.getState().clearLevelSkills(J.current);tr>0&&pe(i.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(tr)),{icon:l.jsx(Dn,{size:16}),duration:5e3})}}const Fe=vA(D,ue);Fe&&(q(V,Fe),oe.current(Fe))}else if(!D){const ue=ve.getValues(),Fe=Object.fromEntries(Object.entries(ue).filter(([ut])=>Y.has(ut))),Je=mA(Fe,{isReview:he.includes(ye.current),nodeTitle:fe.current});Object.keys(Je).length>0&&(q(V,Je),oe.current(Je))}const W=ve.formState.errors,de=Array.from(new Set(Object.keys(W).map(ue=>{var Fe;return(Fe=H.find(Je=>Je.code===ue))==null?void 0:Fe.tab}).filter(Boolean)));ie.current(Object.keys(W).length===0,de)});return()=>_.unsubscribe()},[ve]),p.useEffect(()=>{for(const _ of["author","creator","copyright","copyrightYear","license"]){const A=$.current.find(V=>V.code===_);if(!A||A.currentValue===void 0||A.currentValue===null||A.currentValue==="")continue;const D=ve.getValues(_);(D==null||D==="")&&ve.setValue(_,A.currentValue,{shouldDirty:!1})}},[I,N,ve]);const Q=we.reduce((_,A)=>{const D=_[_.length-1];return D&&D.section===A.section?D.fields.push(A):_.push({section:A.section,fields:[A]}),_},[]),be=_=>{const A={name:_.code,label:_.label,required:_.required,disabled:_.editable===!1};if(u&&_.code==="policy")return l.jsx("div",{className:Kn.fullWidthField,children:l.jsx(xA,{...A})},_.code);switch(_.inputType){case"textarea":return l.jsx(Sp,{...A,multiline:!0,maxLength:_.maxLength},_.code);case"select":return l.jsx(CA,{...A,options:_.options??[]},_.code);case"multiselect":return l.jsx(SA,{...A,options:_.options??[]},_.code);case"chips":return l.jsx(wA,{...A},_.code);case"radio":return l.jsx(_A,{...A,options:_.options??[]},_.code);case"appIcon":return l.jsx(IA,{...A,nodeId:k??""},_.code);case"datepicker":case"datetime":return l.jsx(LA,{...A},_.code);case"keywords":case"tagsinput":return l.jsx(DA,{...A},_.code);case"nestedselect":return l.jsx(NA,{...A,levels:_.levels??[]},_.code);case"license":return l.jsx(PA,{...A},_.code);case"dialcode":return l.jsx(OA,{...A},_.code);default:return l.jsx(Sp,{...A,maxLength:_.maxLength},_.code)}};return l.jsx(kE,{...ve,children:l.jsxs("div",{className:[Kn.form,u?Kn.formLp:""].filter(Boolean).join(" "),children:[Q.map((_,A)=>{const D=_.section?WE[_.section]:void 0;return D?l.jsx(bA,{title:D.title,description:D.description,children:_.fields.map(be)},_.section??A):l.jsx("div",{className:[Kn.ungrouped,u?Kn.ungroupedLp:""].filter(Boolean).join(" "),children:_.fields.map(be)},A)}),we.length===0&&!b&&l.jsx("p",{className:Kn.noFields,children:i.sparkMetaForm.noFieldsMessage})]})})};function Ep(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function MA(e,t){return e.reduce((r,n,s)=>{const o=t.get(n);return o&&(r[s]=o),r},Array(e.length))}function Da(e){return e!==null&&e>=0}function BA(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function $A(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ap=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const o=Ep(t,n,r),a=t[s],i=o[s];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Na={scaleX:1,scaleY:1},kp=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:o,overIndex:a}=e;const i=(t=o[r])!=null?t:n;if(!i)return null;if(s===r){const d=o[a];return d?{x:0,y:r<a?d.top+d.height-(i.top+i.height):d.top-i.top,...Na}:null}const c=jA(o,s,r);return s>r&&s<=a?{x:0,y:-i.height-c,...Na}:s<r&&s>=a?{x:0,y:i.height+c,...Na}:{x:0,y:0,...Na}};function jA(e,t,r){const n=e[t],s=e[t-1],o=e[t+1];return n?r<t?s?n.top-(s.top+s.height):o?o.top-(n.top+n.height):0:o?o.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const Ip="Sortable",Lp=p.createContext({activeIndex:-1,containerId:Ip,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ap,disabled:{draggable:!1,droppable:!1}});function Dp(e){let{children:t,id:r,items:n,strategy:s=Ap,disabled:o=!1}=e;const{active:a,dragOverlay:i,droppableRects:c,over:d,measureDroppableContainers:u}=md(),f=Cs(Ip,r),g=i.rect!==null,m=p.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),C=a!=null,h=a?m.indexOf(a.id):-1,v=d?m.indexOf(d.id):-1,y=p.useRef(m),b=!BA(m,y.current),S=v!==-1&&h===-1||b,w=$A(o);nr(()=>{b&&C&&u(m)},[b,m,C,u]),p.useEffect(()=>{y.current=m},[m]);const T=p.useMemo(()=>({activeIndex:h,containerId:f,disabled:w,disableTransforms:S,items:m,overIndex:v,useDragOverlay:g,sortedRects:MA(m,c),strategy:s}),[h,f,w.draggable,w.droppable,S,m,v,c,g,s]);return p.createElement(Lp.Provider,{value:T},t)}const qA=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return Ep(r,n,s).indexOf(t)},UA=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:o,newIndex:a,previousItems:i,previousContainerId:c,transition:d}=e;return!d||!n||i!==o&&s===a?!1:r?!0:a!==s&&t===c},zA={duration:200,easing:"ease"},Np="transform",VA=Tr.Transition.toString({property:Np,duration:0,easing:"linear"}),HA={roleDescription:"sortable"};function QA(e){let{disabled:t,index:r,node:n,rect:s}=e;const[o,a]=p.useState(null),i=p.useRef(r);return nr(()=>{if(!t&&r!==i.current&&n.current){const c=s.current;if(c){const d=Ln(n.current,{ignoreTransform:!0}),u={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(u.x||u.y)&&a(u)}}r!==i.current&&(i.current=r)},[t,r,n,s]),p.useEffect(()=>{o&&a(null)},[o]),o}function Pp(e){let{animateLayoutChanges:t=UA,attributes:r,disabled:n,data:s,getNewIndex:o=qA,id:a,strategy:i,resizeObserverConfig:c,transition:d=zA}=e;const{items:u,containerId:f,activeIndex:g,disabled:m,disableTransforms:C,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:b}=p.useContext(Lp),S=WA(n,m),w=u.indexOf(a),T=p.useMemo(()=>({sortable:{containerId:f,index:w,items:u},...s}),[f,s,w,u]),E=p.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:N,node:I,isOver:O,setNodeRef:B}=oy({id:a,data:T,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:k,activatorEvent:F,activeNodeRect:M,attributes:x,setNodeRef:z,listeners:ne,isDragging:R,over:ge,setActivatorNodeRef:me,transform:K}=gd({id:a,data:T,attributes:{...HA,...r},disabled:S.draggable}),ce=Qm(B,z),te=!!k,we=te&&!C&&Da(g)&&Da(v),ve=!y&&R,q=ve&&we?K:null,U=we?q??(i??b)({rects:h,activeNodeRect:M,activeIndex:g,overIndex:v,index:w}):null,oe=Da(g)&&Da(v)?o({id:a,items:u,activeIndex:g,overIndex:v}):w,ie=k==null?void 0:k.id,Se=p.useRef({activeId:ie,items:u,newIndex:oe,containerId:f}),fe=u!==Se.current.items,ye=t({active:k,containerId:f,isDragging:R,isSorting:te,id:a,index:w,items:u,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:d,wasDragging:Se.current.activeId!=null}),Le=QA({disabled:!ye,index:w,node:I,rect:N});return p.useEffect(()=>{te&&Se.current.newIndex!==oe&&(Se.current.newIndex=oe),f!==Se.current.containerId&&(Se.current.containerId=f),u!==Se.current.items&&(Se.current.items=u)},[te,oe,f,u]),p.useEffect(()=>{if(ie===Se.current.activeId)return;if(ie&&!Se.current.activeId){Se.current.activeId=ie;return}const he=setTimeout(()=>{Se.current.activeId=ie},50);return()=>clearTimeout(he)},[ie]),{active:k,activeIndex:g,attributes:x,data:T,rect:N,index:w,newIndex:oe,items:u,isOver:O,isSorting:te,isDragging:R,listeners:ne,node:I,overIndex:v,over:ge,setNodeRef:ce,setActivatorNodeRef:me,setDroppableNodeRef:B,setDraggableNodeRef:z,transform:Le??U,transition:J()};function J(){if(Le||fe&&Se.current.newIndex===w)return VA;if(!(ve&&!ko(F)||!d)&&(te||ye))return Tr.Transition.toString({...d,property:Np})}}function WA(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function Pa(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const RA=[Pe.Down,Pe.Right,Pe.Up,Pe.Left],GA=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:o,over:a,scrollableAncestors:i}}=t;if(RA.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const g=s.get(f.id);if(g)switch(e.code){case Pe.Down:n.top<g.top&&c.push(f);break;case Pe.Up:n.top>g.top&&c.push(f);break;case Pe.Left:n.left>g.left&&c.push(f);break;case Pe.Right:n.left<g.left&&c.push(f);break}});const d=iv({collisionRect:n,droppableRects:s,droppableContainers:c});let u=Uc(d,"id");if(u===(a==null?void 0:a.id)&&d.length>1&&(u=d[1].id),u!=null){const f=o.get(r.id),g=o.get(u),m=g?s.get(g.id):null,C=g==null?void 0:g.node.current;if(C&&m&&f&&g){const v=Do(C).some((E,N)=>i[N]!==E),y=Op(f,g),b=KA(f,g),S=v||!y?{x:0,y:0}:{x:b?n.width-m.width:0,y:b?n.height-m.height:0},w={x:m.left,y:m.top};return S.x&&S.y?w:Ss(w,S)}}}};function Op(e,t){return!Pa(e)||!Pa(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function KA(e,t){return!Pa(e)||!Pa(t)||!Op(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const un={row:"_row_11nth_1",removeBtn:"_removeBtn_11nth_14",grip:"_grip_11nth_17",ctIcon:"_ctIcon_11nth_34",info:"_info_11nth_38",name:"_name_11nth_46",meta:"_meta_11nth_55"},YA={video:zo,pdf:ks,h5p:Bo,scorm:qo,audio:jo,quiz:Mo,course:pr,default:Fr},ZA=({item:e,onRemove:t,isEditable:r})=>{const n=ae(),s=Hs(e),o=YA[s.key]??Fr,{attributes:a,listeners:i,setNodeRef:c,transform:d,transition:u,isDragging:f}=Pp({id:e.id,disabled:!r}),g={transform:Tr.Transform.toString(d),transition:u,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:g,className:un.row,role:"listitem",children:[r&&l.jsx("span",{className:un.grip,...a,...i,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(mi,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${s.key}`,un.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(o,{size:14})}),l.jsxs("div",{className:un.info,children:[l.jsx("span",{className:un.name,title:e.name,children:e.name}),l.jsx("span",{className:un.meta,children:s.label})]}),l.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&l.jsx("button",{type:"button",className:un.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(or,{size:14})})]})},G={container:"_container_1assk_1",header:"_header_1assk_7",heading:"_heading_1assk_13",count:"_count_1assk_21",list:"_list_1assk_30",emptyState:"_emptyState_1assk_36",skillPicker:"_skillPicker_1assk_52",skillsCovered:"_skillsCovered_1assk_52",chips:"_chips_1assk_64",chip:"_chip_1assk_64",skillWarning:"_skillWarning_1assk_80",selectedSkills:"_selectedSkills_1assk_85",skillPill:"_skillPill_1assk_91",skillPillFlagged:"_skillPillFlagged_1assk_103",skillPillUncovered:"_skillPillUncovered_1assk_107",skillPillRemove:"_skillPillRemove_1assk_112",skillSearchBox:"_skillSearchBox_1assk_127",skillSearchWrap:"_skillSearchWrap_1assk_132",searchIcon:"_searchIcon_1assk_147",skillSearchInput:"_skillSearchInput_1assk_152",skillDropdown:"_skillDropdown_1assk_165",skillOption:"_skillOption_1assk_179",skillCheckbox:"_skillCheckbox_1assk_201",skillCheckboxChecked:"_skillCheckboxChecked_1assk_213",skillDropdownEmpty:"_skillDropdownEmpty_1assk_218",skillPickerNote:"_skillPickerNote_1assk_224",emptyHint:"_emptyHint_1assk_229",assessmentsCard:"_assessmentsCard_1assk_242",assessmentSlots:"_assessmentSlots_1assk_254",assessmentItemRow:"_assessmentItemRow_1assk_260",assessmentItemIcon:"_assessmentItemIcon_1assk_271",assessmentItemInfo:"_assessmentItemInfo_1assk_283",assessmentItemTitle:"_assessmentItemTitle_1assk_290",assessmentItemMeta:"_assessmentItemMeta_1assk_299",coursesCard:"_coursesCard_1assk_304",coursesCardTitle:"_coursesCardTitle_1assk_315",coursesCardDescription:"_coursesCardDescription_1assk_322",coursesList:"_coursesList_1assk_329",courseRow:"_courseRow_1assk_335",courseDragHandle:"_courseDragHandle_1assk_345",courseIcon:"_courseIcon_1assk_357",courseInfo:"_courseInfo_1assk_369",courseTitle:"_courseTitle_1assk_376",courseMeta:"_courseMeta_1assk_385",addRowIcon:"_addRowIcon_1assk_390",assessmentItemBadge:"_assessmentItemBadge_1assk_402",menuWrap:"_menuWrap_1assk_413",menuBtn:"_menuBtn_1assk_418",dropmenu:"_dropmenu_1assk_431",dangerItem:"_dangerItem_1assk_461",addRow:"_addRow_1assk_390",addRowActive:"_addRowActive_1assk_485",addRowAssessment:"_addRowAssessment_1assk_491",addRowText:"_addRowText_1assk_498",requiredBadge:"_requiredBadge_1assk_503"},XA=({options:e,selected:t,outOfScope:r,uncovered:n,onChange:s,isEditable:o,description:a})=>{const i=ae(),[c,d]=p.useState(""),[u,f]=p.useState(!1),g=p.useRef(null);p.useEffect(()=>{if(!u)return;const v=y=>{var b;(b=g.current)!=null&&b.contains(y.target)||f(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]);const m=c?e.filter(v=>v.toLowerCase().includes(c.toLowerCase())):e,C=v=>{o&&s(t.includes(v)?t.filter(y=>y!==v):[...t,v])},h=v=>{o&&s(t.filter(y=>y!==v))};return l.jsxs("div",{className:G.skillPicker,children:[l.jsxs("div",{className:G.header,children:[l.jsx("span",{className:G.heading,children:i.learningPath.skillsHeading}),l.jsx("span",{className:G.count,children:t.length})]}),l.jsx("span",{className:G.skillPickerNote,children:a}),r.length>0&&l.jsx("div",{className:G.skillWarning,role:"alert",children:i.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),n.length>0&&l.jsx("div",{className:G.skillWarning,role:"alert",children:i.learningPath.skillsUncoveredWarning.replace("{skills}",n.join(", "))}),t.length>0&&l.jsx("div",{className:G.selectedSkills,children:t.map(v=>{const y=r.includes(v),b=n.includes(v);return l.jsxs("span",{className:[G.skillPill,y?G.skillPillFlagged:"",b?G.skillPillUncovered:""].filter(Boolean).join(" "),title:b?i.learningPath.skillUncoveredPillTitle:void 0,children:[v,o&&l.jsx("button",{type:"button",className:G.skillPillRemove,onClick:()=>h(v),"aria-label":i.learningPath.removeSkillAriaLabel.replace("{skill}",v),children:l.jsx(or,{size:11})})]},v)})}),o?l.jsxs("div",{className:G.skillSearchBox,ref:g,children:[l.jsxs("div",{className:G.skillSearchWrap,onClick:()=>f(!0),children:[l.jsx("input",{type:"search",className:G.skillSearchInput,placeholder:i.learningPath.searchSkillsPlaceholder,value:c,onChange:v=>d(v.target.value),onFocus:()=>f(!0),"aria-label":i.learningPath.searchSkillsPlaceholder}),l.jsx(Uo,{size:14,className:G.searchIcon})]}),u&&l.jsx("div",{className:G.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:G.skillDropdownEmpty,children:i.learningPath.noSkillsAvailable}):m.length===0?l.jsx("div",{className:G.skillDropdownEmpty,children:i.learningPath.noMatchingSkills}):m.map(v=>{const y=t.includes(v);return l.jsxs("button",{type:"button",role:"option","aria-selected":y,className:G.skillOption,onClick:()=>C(v),children:[l.jsx("span",{className:[G.skillCheckbox,y?G.skillCheckboxChecked:""].join(" "),children:y&&l.jsx(Zr,{size:12})}),v]},v)})})]}):t.length===0&&l.jsx("span",{className:G.emptyHint,children:i.learningPath.noSkillsSelectedYet})]})},Rl=({slot:e,isEditable:t})=>{const r=ae(),{pre:n,post:s,activeAssessmentSlot:o,setActiveAssessmentSlot:a,deleteSlot:i}=Il(),c=se(v=>v.selectNode),[d,u]=p.useState(!1),f=p.useRef(null),g=e==="pre"?n:s,m=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(p.useEffect(()=>{if(!d)return;const v=y=>{var b;(b=f.current)!=null&&b.contains(y.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]),!g.filled){const v=o===e;return l.jsxs("button",{type:"button",className:[G.addRow,G.addRowAssessment,v?G.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:()=>a(v?null:e),"aria-pressed":v,children:[l.jsx("span",{className:G.addRowIcon,children:l.jsx(Er,{size:16})}),l.jsx("span",{className:G.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",m)}),g.required&&l.jsx("span",{className:G.requiredBadge,children:r.learningPath.requiredSlotBadge})]})}const C=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,h=()=>g.level&&c(g.level.id);return l.jsxs("div",{className:G.assessmentItemRow,role:"button",tabIndex:0,onClick:h,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),h())},children:[l.jsx("span",{className:G.assessmentItemIcon,children:l.jsx(pr,{size:16})}),l.jsxs("div",{className:G.assessmentItemInfo,children:[l.jsx("span",{className:G.assessmentItemTitle,children:g.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:G.assessmentItemMeta,children:[m," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:G.assessmentItemBadge,children:C}),t&&l.jsxs("div",{className:G.menuWrap,ref:f,children:[l.jsx("button",{type:"button",className:G.menuBtn,onClick:v=>{v.stopPropagation(),u(y=>!y)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),d&&l.jsxs("div",{className:G.dropmenu,onClick:v=>v.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{u(!1),g.level&&c(g.level.id)},children:[l.jsx(Iy,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:G.dangerItem,onClick:()=>{u(!1),i(e)},children:[l.jsx(Nn,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})};function JA(e){var g,m;const t=ae(),r=se(C=>C.treeData),n=se(C=>C.deleteNode),s=rt(C=>C.activeLevelExamTarget),o=rt(C=>C.setActiveLevelExamTarget),a=rt(C=>C.openModal),i=(m=(g=r[0])==null?void 0:g.children)==null?void 0:m.find(C=>C.id===e),c=Pu(i),d=s===e,u=()=>{e&&o(d?null:e)},f=()=>{c&&a("confirmDelete",{message:t.learningPath.deleteLevelExamConfirm,onConfirm:()=>n(c.id)})};return{course:c,filled:!!c,courseName:c==null?void 0:c.name,isActiveTarget:d,armExam:u,deleteExam:f}}const ek=({levelId:e,isEditable:t})=>{const r=ae(),{filled:n,courseName:s,isActiveTarget:o,armExam:a,deleteExam:i}=JA(e);return n?l.jsxs("div",{className:G.assessmentItemRow,children:[l.jsx("span",{className:G.assessmentItemIcon,children:l.jsx(pr,{size:16})}),l.jsxs("div",{className:G.assessmentItemInfo,children:[l.jsx("span",{className:G.assessmentItemTitle,children:s||r.learningPath.courseNameUnavailable}),l.jsx("span",{className:G.assessmentItemMeta,children:r.learningPath.levelExamMeta})]}),t&&l.jsx("button",{type:"button",className:G.menuBtn,onClick:i,"aria-label":r.treeNode.deleteMenuItem,children:l.jsx(Nn,{size:14})})]}):l.jsxs("button",{type:"button",className:[G.addRow,G.addRowAssessment,o?G.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:a,"aria-pressed":o,children:[l.jsx("span",{className:G.addRowIcon,children:l.jsx(Er,{size:16})}),l.jsx("span",{className:G.addRowText,children:r.learningPath.addLevelExamButton})]})},tk=({item:e,onRemove:t,isEditable:r})=>{const n=ae(),[s,o]=p.useState(!1),a=p.useRef(null),{attributes:i,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:g}=Pp({id:e.id,disabled:!r}),m={transform:Tr.Transform.toString(u),transition:f,opacity:g?.5:1};return p.useEffect(()=>{if(!s)return;const C=h=>{var v;(v=a.current)!=null&&v.contains(h.target)||o(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[s]),l.jsxs("div",{ref:d,style:m,className:G.courseRow,children:[r&&l.jsx("span",{className:G.courseDragHandle,...i,...c,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(mi,{size:16})}),l.jsx("span",{className:G.courseIcon,children:l.jsx(pr,{size:18})}),l.jsxs("div",{className:G.courseInfo,children:[l.jsx("span",{className:G.courseTitle,title:e.name,children:e.name}),l.jsx("span",{className:G.courseMeta,children:n.learningPath.courseMetaLabel})]}),r&&l.jsxs("div",{className:G.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:G.menuBtn,onClick:C=>{C.stopPropagation(),o(h=>!h)},"aria-label":n.treeNode.nodeOptionsAriaLabel,children:"⋮"}),s&&l.jsx("div",{className:G.dropmenu,onClick:C=>C.stopPropagation(),children:l.jsxs("button",{type:"button",className:G.dangerItem,onClick:()=>{o(!1),t(e.id)},children:[l.jsx(Nn,{size:12})," ",n.learningPath.removeFromLevelMenuItem]})})]})]})},rk=({editorMode:e,isRoot:t=!1})=>{const r=ae(),{selectedNodeId:n,getChildrenOf:s,getNodeById:o,reorderChildren:a,deleteNode:i,activeNodeMeta:c,updateNode:d,treeData:u}=se(),f=X(K=>K.editorProfile),g=n?s(n):[],m=e==="edit",C=n?o(n):void 0,h=f.competencyScoped,v=h&&!t&&!st(C),y=h&&t,b=rt(K=>K.activeAssessmentSlot),S=rt(K=>K.activeLevelExamTarget),w=rt(K=>K.setActiveAssessmentSlot),T=!b&&!S,{scope:E,source:N}=Bs(),I=ir(),O=I&&Array.isArray(c[I.code])?c[I.code]:[],B=N==="prior"?O.filter(K=>!E.includes(K)):[],k=y?Bu(u[0],I==null?void 0:I.code):[],F=v?$u(C,O,I==null?void 0:I.code):[],M=p.useCallback(K=>{!n||!(I!=null&&I.code)||d(n,{[I.code]:K},[I.code])},[n,I==null?void 0:I.code,d]),x=Bc(ri(No,{activationConstraint:{distance:5}}),ri(ii,{coordinateGetter:GA})),z=p.useCallback(K=>{const{active:ce,over:te}=K;if(!te||ce.id===te.id||!n)return;const we=se.getState().getChildrenOf(n),ve=we.findIndex($=>$.id===ce.id),q=we.findIndex($=>$.id===te.id);ve<0||q<0||a(n,ve,q)},[n,a]),ne=p.useCallback(K=>{window.confirm(r.unitContentList.removeConfirm)&&i(K)},[i,r.unitContentList.removeConfirm]),R=rt(K=>K.openModal),ge=p.useCallback(K=>{R("confirmDelete",{message:r.learningPath.deleteCourseConfirm,onConfirm:()=>{i(K)||pe.error(r.learningPath.cannotRemoveLastRegularCourseToast)}})},[R,i,r.learningPath.deleteCourseConfirm,r.learningPath.cannotRemoveLastRegularCourseToast]),me=v?g.filter(K=>{var ce;return!((ce=K.metadata)!=null&&ce.isAssessmentCourse)}):[];return n?l.jsxs("div",{className:G.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:G.skillsCovered,children:[l.jsx("span",{className:G.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:G.emptyHint,children:r.learningPath.skillsCoveredDescription}),k.length>0&&l.jsx("div",{className:G.chips,children:k.map(K=>l.jsx("span",{className:G.chip,children:K},K))}),k.length===0&&l.jsx("span",{className:G.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:G.assessmentsCard,children:[l.jsx("span",{className:G.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:G.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:G.assessmentSlots,children:[l.jsx(Rl,{slot:"pre",isEditable:m}),l.jsx(Rl,{slot:"post",isEditable:m})]})]})]}),v&&l.jsx(XA,{options:E,selected:O,outOfScope:B,uncovered:F,onChange:M,isEditable:m,description:N==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),v&&l.jsxs("button",{type:"button",className:[G.addRow,G.addRowAssessment,T?G.addRowActive:""].filter(Boolean).join(" "),disabled:!m,onClick:()=>w(null),"aria-pressed":T,children:[l.jsx("span",{className:G.addRowIcon,children:l.jsx(Er,{size:16})}),l.jsx("span",{className:G.addRowText,children:r.learningPath.addCourseToLevelButton})]}),v&&l.jsx(ek,{levelId:n,isEditable:m}),v&&l.jsxs("div",{className:G.coursesCard,children:[l.jsx("h3",{className:G.coursesCardTitle,children:r.learningPath.coursesCardHeading}),l.jsx("p",{className:G.coursesCardDescription,children:r.learningPath.coursesCardDescription}),me.length>0?l.jsx(hi,{sensors:x,collisionDetection:Vc,onDragEnd:z,children:l.jsx(Dp,{items:me.map(K=>K.id),strategy:kp,children:l.jsx("div",{className:G.coursesList,role:"list",children:me.map(K=>l.jsx(tk,{item:K,onRemove:ge,isEditable:m},K.id))})})}):l.jsx("span",{className:G.emptyHint,children:r.learningPath.coursesEmptyHint})]}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:G.header,children:[l.jsx("span",{className:G.heading,children:r.unitContentList.heading}),l.jsx("span",{className:G.count,children:g.length})]}),g.length>0?l.jsx(hi,{sensors:x,collisionDetection:Vc,onDragEnd:z,children:l.jsx(Dp,{items:g.map(K=>K.id),strategy:kp,children:l.jsx("div",{className:G.list,role:"list",children:g.map(K=>l.jsx(ZA,{item:K,onRemove:ne,isEditable:m},K.id))})})}):l.jsxs("div",{className:G.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),m&&!st(C)&&l.jsxs("button",{className:G.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Er,{size:14})," ",r.unitContentList.addContent]})]})]}):null},xp={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},nk=({isActive:e,label:t,nodeId:r,className:n})=>{const s=ae(),o=t??s.dropZone.dropHere;return l.jsx("div",{className:`${xp.dropZone} ${e?xp.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":o,role:"region",children:l.jsx("span",{children:o})})},Fp=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function sk(e){var a;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((a=(await Me.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??Fp}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:a.result)??{},s=new Set(["count","facets"]);return{content:Object.entries(n).filter(([i])=>!s.has(i)).flatMap(([,i])=>Array.isArray(i)?i:[]),count:n.count??0}}async function ok(e){var r,n;return(n=(r=(await Me.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Mp="application/vnd.sunbird.question";function Bp(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function $p(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=$p(n,t,e);if(s)return s}return null}function ak(e,t){const r=$p(e,t);if(!r)return null;const{question:n,parent:s}=r,o={...e,children:[n],childNodes:[t],shuffle:s==null?void 0:s.shuffle,showSolutions:(s==null?void 0:s.showSolutions)??"No",showFeedback:(s==null?void 0:s.showFeedback)??"No"};return(s==null?void 0:s.shuffle)===!0?o.maxScore=1:n.qType==="SA"?delete o.maxScore:n.maxScore!=null&&(o.maxScore=n.maxScore),o}function ik(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return En({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await Iu(e),s=u=>{if(!u)return[];const f=u.mimeType===Mp&&u.identifier?[u.identifier]:[],g=(u.children??[]).flatMap(s);return[...f,...g]},o=s(n),a=new Map;o.length&&(await fS(o)).forEach(f=>{const g=f.identifier;g&&a.set(g,f)});const i=u=>{if(!u)return u;if(u.mimeType===Mp&&u.identifier){const f=a.get(u.identifier)??u,g=f.outcomeDeclaration;return g!=null&&g.maxScore||(f.outcomeDeclaration={...g??{},maxScore:Bp(f)}),f}return Array.isArray(u.children)&&(u.children=u.children.map(f=>i(f))),u},c=i(n),d=c.outcomeDeclaration;return d!=null&&d.maxScore||(c.outcomeDeclaration={...d??{},maxScore:Bp(c)}),c}})}const jp="/assets/quml-player/sunbird-quml-player.js",lk="/assets/quml-player/styles.css",qp="sunbird-quml-player";function ck(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const mt=class mt{constructor(){ho(this,"eventHandlers",new WeakMap)}loadScript(){return mt.scriptLoaded||customElements.get(qp)?(mt.scriptLoaded=!0,Promise.resolve()):(mt.scriptLoading||(mt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=jp,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{mt.scriptLoaded=!0,mt.scriptLoading=void 0,t()},n.onerror=()=>{mt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${jp}`))},document.body.appendChild(n)})),mt.scriptLoading)}loadStyles(){if(mt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){mt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=lk,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),mt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),mt.stylesLoaded=!1}async createConfig(t,r,n){var o,a,i;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((o=r==null?void 0:r.pdata)==null?void 0:o.id)??"sunbird.portal",ver:((a=r==null?void 0:r.pdata)==null?void 0:a.ver)??"1.0",pid:((i=r==null?void 0:r.pdata)==null?void 0:i.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:ck(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(qp);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const s=a=>r==null?void 0:r(a),o=a=>n==null?void 0:n(a.detail);t.addEventListener("playerEvent",s),t.addEventListener("telemetryEvent",o),this.eventHandlers.set(t,{player:s,telemetry:o})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};ho(mt,"scriptLoaded",!1),ho(mt,"scriptLoading"),ho(mt,"stylesLoaded",!1);let Oa=mt;const xa=new Oa,Re={contentPlayerRoot:"_contentPlayerRoot_r6xk8_1",flowLayout:"_flowLayout_r6xk8_9",stage:"_stage_r6xk8_13",aspectRatio:"_aspectRatio_r6xk8_16",playerHeader:"_playerHeader_r6xk8_32",playerHeaderThumb:"_playerHeaderThumb_r6xk8_46",playerHeaderTitle:"_playerHeaderTitle_r6xk8_56",typeBadge:"_typeBadge_r6xk8_66",typeDot:"_typeDot_r6xk8_105",playerFrame:"_playerFrame_r6xk8_125",coverOverlay:"_coverOverlay_r6xk8_133",coverHidden:"_coverHidden_r6xk8_145",coverThumb:"_coverThumb_r6xk8_150",coverPlayRing:"_coverPlayRing_r6xk8_159",coverPlayIcon:"_coverPlayIcon_r6xk8_172",coverLabel:"_coverLabel_r6xk8_181",coverSkeleton:"_coverSkeleton_r6xk8_187",playerWrapper:"_playerWrapper_r6xk8_213",infoStrip:"_infoStrip_r6xk8_223",infoChip:"_infoChip_r6xk8_239",infoChipLabel:"_infoChipLabel_r6xk8_258",infoChipIcon:"_infoChipIcon_r6xk8_267",playerError:"_playerError_r6xk8_273",playerErrorIcon:"_playerErrorIcon_r6xk8_287",playerErrorMsg:"_playerErrorMsg_r6xk8_292",qumlRoot:"_qumlRoot_r6xk8_299"},dk="application/vnd.sunbird.questionset";function uk(e,t){const r=new Map,n=o=>{for(const a of o)r.set(a.id,a),a.children&&n(a.children)};n(e);let s=r.get(t);for(;s;){if(s.mimeType===dk)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const fk=[{key:"video",mimes:["video/mp4","video/webm","video/ogg"]},{key:"audio",mimes:["audio/mp3","audio/mpeg","audio/ogg","audio/wav"]},{key:"pdf",mimes:["application/pdf"]},{key:"epub",mimes:["application/epub"]},{key:"ecml",mimes:["application/vnd.ekstep.ecml-archive"]},{key:"h5p",mimes:["application/vnd.ekstep.h5p-archive"]},{key:"scorm",mimes:["application/vnd.ekstep.content-collection"]}];function hk(e){return fk.find(t=>t.mimes.includes(e))??{key:"other"}}function pk(e,t){switch(e){case"video":return t.contentPlayer.mimeLabelVideo;case"audio":return t.contentPlayer.mimeLabelAudio;case"pdf":return t.contentPlayer.mimeLabelPdf;case"epub":return t.contentPlayer.mimeLabelEpub;case"ecml":return t.contentPlayer.mimeLabelEcml;case"h5p":return t.contentPlayer.mimeLabelH5p;case"scorm":return t.contentPlayer.mimeLabelScorm;default:return t.contentPlayer.mimeLabelOther}}const gk={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},mk={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},vk={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},yk="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Gl(e){for(const[t,r]of Object.entries(gk))if(r.includes(e))return t;return"default-player"}function bk(e,t,r){var o;const n=r==null?void 0:r.context,s=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((o=n==null?void 0:n.pdata)==null?void 0:o.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/sunbird-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:s==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function Ck(e){return document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(n)})}async function Sk(e,t,r=100){await Ck(mk[t]??""),!customElements.get(e)&&await new Promise((n,s)=>{let o=0;const a=setInterval(()=>{o++,customElements.get(e)?(clearInterval(a),n()):o>=r&&(clearInterval(a),s(new Error(`Custom element <${e}> did not register`)))},100)})}const wk=[{key:"author",icon:Ry},{key:"license",icon:jy},{key:"language",icon:Dy},{key:"gradeLevel",icon:qy},{key:"subject",icon:pr},{key:"contentType",icon:Qy}];function _k(e,t){switch(e){case"author":return t.contentPlayer.infoFieldAuthor;case"license":return t.contentPlayer.infoFieldLicense;case"language":return t.contentPlayer.infoFieldLanguage;case"gradeLevel":return t.contentPlayer.infoFieldClass;case"subject":return t.contentPlayer.infoFieldSubject;case"contentType":return t.contentPlayer.infoFieldType;default:return e}}function Tk({node:e}){const t=ae(),r=e.metadata??{},n=wk.flatMap(s=>{const o=r[s.key];if(!o)return[];const a=Array.isArray(o)?o.join(", "):String(o);return a?[{...s,label:_k(s.key,t),val:a}]:[]});return n.length?l.jsx("div",{className:Re.infoStrip,children:n.map(s=>l.jsxs("div",{className:Re.infoChip,children:[s.icon&&l.jsx(s.icon,{size:13,className:Re.infoChipIcon}),l.jsx("span",{className:Re.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function Up({node:e,hidden:t}){var s;const r=ae(),n=e.appIcon??((s=e.metadata)==null?void 0:s.appIcon);return l.jsx("div",{className:`${Re.coverOverlay} ${t?Re.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:Re.coverThumb}),l.jsx("div",{className:Re.coverPlayRing,children:l.jsx("div",{className:Re.coverPlayIcon})}),l.jsx("span",{className:Re.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:Re.coverSkeleton})})}function zp({message:e}){return l.jsxs("div",{className:Re.playerError,children:[l.jsx(Wy,{size:28,className:Re.playerErrorIcon}),l.jsx("span",{className:Re.playerErrorMsg,children:e})]})}function Ek({mimeType:e}){const t=ae(),r=hk(e);return l.jsxs("span",{className:Re.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:Re.typeDot}),pk(r.key,t)]})}const Kl=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var a;if(r==="quml")return l.jsx(kk,{node:e,editorMode:t,singleQuestion:!!n});const o=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return l.jsxs("div",{className:`${Re.contentPlayerRoot} ${s==="flow"?Re.flowLayout:""}`,children:[l.jsxs("div",{className:Re.stage,children:[l.jsxs("div",{className:Re.playerHeader,children:[o&&l.jsx("img",{src:o,alt:"",className:Re.playerHeaderThumb}),l.jsx("span",{className:Re.playerHeaderTitle,children:e.name}),l.jsx(Ek,{mimeType:e.mimeType??""})]}),l.jsx(Ak,{node:e})]}),l.jsx(Tk,{node:e})]})};function Ak({node:e}){var y;const t=ae(),r=X(b=>b.editorConfig),[n,s]=p.useState(()=>Gl(e.mimeType??"")),[o,a]=p.useState(!1),[i,c]=p.useState(null),[d,u]=p.useState(e.metadata??{}),[f,g]=p.useState(!1),m=p.useRef(null),C=p.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??yk;p.useEffect(()=>{let b=!1;return g(!1),a(!1),c(null),u(e.metadata??{}),s(Gl(e.mimeType??"")),ok(e.identifier).then(S=>{if(b)return;const w={...e.metadata??{},...S};u(w);const T=S.mimeType??e.mimeType??"";s(Gl(T)),g(!0)}).catch(()=>{b||g(!0)}),()=>{b=!0}},[e.identifier]);const v=bk(e,d,r);return p.useEffect(()=>{if(!f||n!=="default-player")return;const b=m.current;if(!b)return;b.src=h;const S=()=>{try{const T=b.contentWindow;if(typeof(T==null?void 0:T.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}T.initializePreview(v),setTimeout(()=>a(!0),300)}catch(T){console.error("[ContentPlayer] initializePreview failed",T),c(t.contentPlayer.failedToInitializePlayer)}},w=()=>c(t.contentPlayer.previewPlayerLoadFailed);return b.addEventListener("load",S),b.addEventListener("error",w),()=>{b.removeEventListener("load",S),b.removeEventListener("error",w),b.src=""}},[e.identifier,n,h,f,t]),p.useEffect(()=>{if(!f||n==="default-player")return;const b=C.current;if(!b)return;const S=vk[n];if(!S)return;const w=v;Sk(S,n).then(()=>{if(!C.current)return;if(!customElements.get(S)){s("default-player");return}const T=document.createElement(S);T.setAttribute("player-config",JSON.stringify(w)),T.addEventListener("playerEvent",()=>{}),T.addEventListener("telemetryEvent",()=>{}),b.innerHTML="",b.appendChild(T),setTimeout(()=>{try{T.playerConfig=w}catch{}a(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),s("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:Re.aspectRatio,children:[i?l.jsx(zp,{message:i}):l.jsx(Up,{node:e,hidden:o}),n==="default-player"?l.jsx("iframe",{ref:m,id:"contentPlayer",title:e.name,className:Re.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:C,className:Re.playerFrame})]})}function kk({node:e,editorMode:t,singleQuestion:r}){const n=ae(),s=X(m=>m.editorConfig),o=se(m=>m.treeData),a=p.useRef(null),i=r?uk(o,e.id):e.identifier,{data:c,isLoading:d,error:u}=ik(i??"",{enabled:!!i}),f=p.useMemo(()=>c?r?ak(c,e.identifier):c:null,[c,r,e.identifier]);p.useEffect(()=>{const m=a.current;if(!m||!f)return;let C=null,h=!1;return(async()=>{try{const v=await xa.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(h||!a.current)return;const y=xa.createElement(v);C=y,xa.attachEventListeners(y,b=>console.debug("[QumlPlayer] playerEvent",b.detail),b=>console.debug("[QumlPlayer] telemetryEvent",b)),m.innerHTML="",m.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,C&&(xa.removeEventListeners(C),C.remove()),Oa.unloadStyles()}},[f,s,t,r]);const g=u?`${n.contentPlayer.unableToLoadQuestionset} ${u.message}`:r&&!i?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:Re.qumlRoot,children:[g?l.jsx(zp,{message:g}):d||!f?l.jsx(Up,{node:e,hidden:!1}):null,l.jsx("div",{ref:a,className:Re.playerWrapper})]})}const Xt={overlay:"_overlay_ifddx_1",modal:"_modal_ifddx_11",header:"_header_ifddx_21",body:"_body_ifddx_37",hint:"_hint_ifddx_43",list:"_list_ifddx_49",item:"_item_ifddx_55",selected:"_selected_ifddx_68",empty:"_empty_ifddx_73",footer:"_footer_ifddx_79",cancelBtn:"_cancelBtn_ifddx_87",moveBtn:"_moveBtn_ifddx_95"};function Ik(e,t,r){const n=[],s=o=>{var a;for(const i of o)i.isFolder&&i.id!==r&&i.id!==t&&n.push(i),(a=i.children)!=null&&a.length&&s(i.children)};return s(e),n}const Lk=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=ae(),{treeData:o,moveNode:a}=se(),i=Ik(o,((f=o[0])==null?void 0:f.id)??"",r),[c,d]=p.useState(null),u=()=>{c&&(a(e,r,c),n())};return l.jsx("div",{className:Xt.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Xt.modal,children:[l.jsxs("div",{className:Xt.header,children:[l.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:l.jsx(or,{size:16})})]}),l.jsxs("div",{className:Xt.body,children:[l.jsx("p",{className:Xt.hint,children:s.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Xt.list,children:[i.map(g=>l.jsxs("li",{className:`${Xt.item} ${c===g.id?Xt.selected:""}`,onClick:()=>d(g.id),children:[l.jsx(Ly,{size:14}),l.jsx("span",{children:g.name})]},g.id)),i.length===0&&l.jsx("li",{className:Xt.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Xt.footer,children:[l.jsx("button",{className:Xt.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Xt.moveBtn,onClick:u,disabled:!c,children:s.resourceReorderDialog.moveButton})]})]})})},mr={overlay:"_overlay_16at9_1",modal:"_modal_16at9_11",header:"_header_16at9_21",body:"_body_16at9_37",table:"_table_16at9_43",pageInput:"_pageInput_16at9_61",empty:"_empty_16at9_68",footer:"_footer_16at9_74",cancelBtn:"_cancelBtn_16at9_82",saveBtn:"_saveBtn_16at9_90"};function Dk(e){const t=[],r=n=>{var s;for(const o of n)!o.isFolder&&(!o.children||o.children.length===0)?t.push(o):(s=o.children)!=null&&s.length&&r(o.children)};return r(e),t}const Nk=({onClose:e})=>{const t=ae(),{treeData:r,updateNode:n}=se(),s=Dk(r),[o,a]=p.useState(()=>Object.fromEntries(s.map(c=>{var d;return[c.id,String(((d=c.metadata)==null?void 0:d.pageNumber)??"")]}))),i=p.useCallback(()=>{for(const[c,d]of Object.entries(o))d!==""&&n(c,{pageNumber:parseInt(d,10)||void 0});e()},[o,n,e]);return l.jsx("div",{className:mr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:mr.modal,children:[l.jsxs("div",{className:mr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(or,{size:16})})]}),l.jsx("div",{className:mr.body,children:s.length===0?l.jsx("p",{className:mr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:mr.table,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),l.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),l.jsx("tbody",{children:s.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:o[c.id]??"",onChange:d=>a(u=>({...u,[c.id]:d.target.value})),className:mr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:mr.footer,children:[l.jsx("button",{className:mr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:mr.saveBtn,onClick:i,children:[l.jsx($y,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},Xe={container:"_container_1a7t2_1",panelHeader:"_panelHeader_1a7t2_10",panelHeaderLeft:"_panelHeaderLeft_1a7t2_19",panelCollapseBtn:"_panelCollapseBtn_1a7t2_27",titleRow:"_titleRow_1a7t2_46",field:"_field_1a7t2_47",moveBtn:"_moveBtn_1a7t2_64",icon:"_icon_1a7t2_84",nameInput:"_nameInput_1a7t2_93",fieldHeader:"_fieldHeader_1a7t2_118",label:"_label_1a7t2_124",fieldCount:"_fieldCount_1a7t2_133",chips:"_chips_1a7t2_170",chip:"_chip_1a7t2_170",chipRemove:"_chipRemove_1a7t2_188",keywordInput:"_keywordInput_1a7t2_202",input:"_input_1a7t2_207",addBtn:"_addBtn_1a7t2_220",radioGroup:"_radioGroup_1a7t2_234",radioLabel:"_radioLabel_1a7t2_239"},Pk=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var F,M;const{updateNode:s,markDirty:o}=se(),a=t==="edit",i=Hs(e),c=ae(),d=X(x=>x.relationalFormConfig),u=x=>d==null?void 0:d.find(z=>z.code===x),f=x=>!d||!!u(x),g=(x,z)=>{var ne;return((ne=u(x))==null?void 0:ne.label)||z},[m,C]=p.useState(!0),h=((F=e.metadata)==null?void 0:F.relationalMetadata)??{},[v,y]=p.useState(h.name??e.name??""),[b,S]=p.useState(""),[w,T]=p.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((M=e.metadata)==null?void 0:M.keywords)?e.metadata.keywords:[]),[E,N]=p.useState(!!h.optional);p.useEffect(()=>{var z,ne;const x=((z=e.metadata)==null?void 0:z.relationalMetadata)??{};y(x.name??e.name??""),T(Array.isArray(x.keywords)?x.keywords:Array.isArray((ne=e.metadata)==null?void 0:ne.keywords)?e.metadata.keywords:[]),N(!!x.optional)},[e.id]);const I=()=>{v.trim()&&v!==e.name&&(s(e.id,{name:v.trim()}),o())},O=()=>{const x=b.trim();if(x&&!w.includes(x)){const z=[...w,x];T(z),s(e.id,{keywords:z}),o()}S("")},B=x=>{const z=w.filter(ne=>ne!==x);T(z),s(e.id,{keywords:z}),o()},k=x=>{N(x),s(e.id,{optional:x}),o()};return l.jsxs("div",{className:Xe.container,children:[l.jsxs("div",{className:Xe.panelHeader,children:[l.jsxs("div",{className:Xe.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${i.key}`,children:i.label}),a&&l.jsx("button",{type:"button",className:Xe.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:Xe.panelCollapseBtn,onClick:()=>C(x=>!x),"aria-expanded":m,"aria-label":m?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:m?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:m?l.jsx(Xr,{size:15}):l.jsx(Ty,{size:15})})]}),m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Xe.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:Xe.icon}),l.jsx("input",{type:"text",className:Xe.nameInput,value:v,disabled:!a,onChange:x=>y(x.target.value),onBlur:I,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:Xe.field,children:[l.jsx("div",{className:Xe.fieldHeader,children:l.jsxs("label",{className:Xe.label,children:[g("keywords",c.contentEditForm.keywordsLabel),w.length>0&&l.jsx("span",{className:Xe.fieldCount,children:w.length})]})}),w.length>0&&l.jsx("div",{className:Xe.chips,children:w.map(x=>l.jsxs("span",{className:Xe.chip,children:[x,a&&l.jsx("button",{type:"button",className:Xe.chipRemove,onClick:()=>B(x),children:"×"})]},x))}),a&&l.jsxs("div",{className:Xe.keywordInput,children:[l.jsx("input",{type:"text",className:Xe.input,value:b,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:x=>S(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),O())}}),l.jsx("button",{type:"button",className:Xe.addBtn,onClick:O,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Xe.field,children:[l.jsx("label",{className:Xe.label,children:g("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:Xe.radioGroup,children:[l.jsxs("label",{className:Xe.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!0,onChange:()=>k(!0),disabled:!a}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Xe.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!1,onChange:()=>k(!1),disabled:!a}),c.contentEditForm.noOption]})]})]})]}),n]})},eo={iconBtn:"_iconBtn_64kgu_1",editable:"_editable_64kgu_14",iconImg:"_iconImg_64kgu_26",placeholder:"_placeholder_64kgu_34",removeBtn:"_removeBtn_64kgu_41"},Ok=({nodeId:e,value:t,editable:r})=>{const[n,s]=p.useState(!1),{updateNode:o,markDirty:a}=se(),i=ae(),c=u=>{o(e,{appIcon:u}),a(),s(!1)},d=u=>{u.stopPropagation(),o(e,{appIcon:""}),a()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[eo.iconBtn,r?eo.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?i.titleAppIcon.selectAppIconAriaLabel:i.titleAppIcon.appIconAriaLabel,onClick:()=>r&&s(!0),onKeyDown:u=>{r&&(u.key==="Enter"||u.key===" ")&&s(!0)},children:[t?l.jsx("img",{src:t,alt:i.titleAppIcon.appIconAlt,className:eo.iconImg}):l.jsx("div",{className:eo.placeholder,children:l.jsx(Td,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:eo.removeBtn,onClick:d,"aria-label":i.titleAppIcon.removeIconAriaLabel,children:l.jsx(Nn,{size:11})})]}),n&&l.jsx(_p,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>s(!1)})]})},xe={courseDetails:"_courseDetails_pkcf3_1",courseDetailsLoading:"_courseDetailsLoading_pkcf3_7",courseDetailsError:"_courseDetailsError_pkcf3_7",detailsCard:"_detailsCard_pkcf3_12",unitsCard:"_unitsCard_pkcf3_12",cardTitle:"_cardTitle_pkcf3_22",fieldGroup:"_fieldGroup_pkcf3_29",fieldGroupLast:"_fieldGroupLast_pkcf3_33",fieldLabel:"_fieldLabel_pkcf3_37",fieldValue:"_fieldValue_pkcf3_47",fieldValueMultiline:"_fieldValueMultiline_pkcf3_52",unitsLabel:"_unitsLabel_pkcf3_58",unitsDescription:"_unitsDescription_pkcf3_68",unitList:"_unitList_pkcf3_74",unitCard:"_unitCard_pkcf3_80",unitHeader:"_unitHeader_pkcf3_86",unitIcon:"_unitIcon_pkcf3_99",unitTitle:"_unitTitle_pkcf3_111",unitCount:"_unitCount_pkcf3_120",unitBody:"_unitBody_pkcf3_126",unitDescription:"_unitDescription_pkcf3_131",unitKeywords:"_unitKeywords_pkcf3_138",keywordPill:"_keywordPill_pkcf3_145",unitTopicsRow:"_unitTopicsRow_pkcf3_155",unitContents:"_unitContents_pkcf3_167",contentRow:"_contentRow_pkcf3_174",contentIcon:"_contentIcon_pkcf3_180",contentTitle:"_contentTitle_pkcf3_185",contentSkills:"_contentSkills_pkcf3_193",skillPill:"_skillPill_pkcf3_200"},xk={video:zo,pdf:ks,h5p:Bo,scorm:qo,audio:jo,quiz:Mo,course:pr,default:Fr};function Yl(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const Vp=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const s=ae(),o=ir(),[a,i]=p.useState(null),[c,d]=p.useState(""),[u,f]=p.useState(null),[g,m]=p.useState({}),C=t==="full";p.useEffect(()=>{let b=!1;return i(null),d(""),f(null),mS(e).then(S=>{if(b)return;const T=(S.children??[]).map(E=>ra(E));i(T),d(S.description??""),m(Object.fromEntries(T.map(E=>[E.id,!0]))),n==null||n({totalContents:T.reduce((E,N)=>{var I;return E+(((I=N.children)==null?void 0:I.length)??0)},0)})}).catch(()=>{b||f(s.learningPath.courseDetailsError)}),()=>{b=!0}},[e,s.learningPath.courseDetailsError]);const h=b=>m(S=>({...S,[b]:!S[b]})),v=b=>{var S;return o?Yl((S=b.metadata)==null?void 0:S[o.code]):[]},y=b=>(b===1?s.learningPath.contentCountLabel:s.learningPath.contentCountLabelPlural).replace("{count}",String(b));return l.jsx("div",{className:xe.courseDetails,children:u?l.jsx("p",{className:xe.courseDetailsError,children:u}):a===null?l.jsx("p",{className:xe.courseDetailsLoading,children:s.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[C&&l.jsxs("div",{className:xe.detailsCard,children:[l.jsx("h3",{className:xe.cardTitle,children:s.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:xe.fieldGroup,children:[l.jsx("span",{className:xe.fieldLabel,children:s.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:xe.fieldValue,children:r})]}),l.jsxs("div",{className:xe.fieldGroupLast,children:[l.jsx("span",{className:xe.fieldLabel,children:s.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:xe.fieldValueMultiline,children:c||s.learningPath.noCourseDescriptionPlaceholder})]})]}),a.length===0?l.jsx("p",{className:xe.courseDetailsLoading,children:s.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:C?xe.unitsCard:void 0,children:[l.jsx("span",{className:xe.unitsLabel,children:s.learningPath.unitsSectionLabel}),C&&l.jsx("p",{className:xe.unitsDescription,children:s.learningPath.unitsSectionDescription}),l.jsx("div",{className:xe.unitList,children:a.map(b=>{var N,I;const S=!!g[b.id],w=(b.children??[]).length,T=Yl((N=b.metadata)==null?void 0:N.keywords),E=Yl((I=b.metadata)==null?void 0:I.topic);return l.jsxs("div",{className:xe.unitCard,children:[l.jsxs("button",{type:"button",className:xe.unitHeader,onClick:()=>h(b.id),"aria-expanded":S,children:[S?l.jsx(Xr,{size:17}):l.jsx(gi,{size:17}),l.jsx("span",{className:xe.unitIcon,children:l.jsx(_d,{size:16})}),l.jsx("span",{className:xe.unitTitle,children:b.name}),C&&l.jsx("span",{className:xe.unitCount,children:y(w)})]}),S&&l.jsxs("div",{className:xe.unitBody,children:[C&&b.description&&l.jsx("p",{className:xe.unitDescription,children:b.description}),C&&T.length>0&&l.jsx("div",{className:xe.unitKeywords,children:T.map(O=>l.jsx("span",{className:xe.keywordPill,children:O},O))}),C&&E.length>0&&l.jsxs("div",{className:xe.unitTopicsRow,children:[l.jsx("span",{className:xe.fieldLabel,children:s.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:E.join(", ")})]}),l.jsx("div",{className:xe.unitContents,children:(b.children??[]).map(O=>{const B=Hs(O),k=xk[B.key]??Fr,F=v(O);return l.jsxs("div",{className:xe.contentRow,children:[l.jsx(k,{size:16,className:xe.contentIcon}),l.jsx("span",{className:xe.contentTitle,children:O.name}),F.length>0&&l.jsx("div",{className:xe.contentSkills,children:F.map(M=>l.jsx("span",{className:xe.skillPill,children:M},M))})]},O.id)})})]})]},b.id)})})]})]})})},Ie={backToPathButton:"_backToPathButton_1u4o4_1",assessmentTitle:"_assessmentTitle_1u4o4_15",slotPills:"_slotPills_1u4o4_22",slotPill:"_slotPill_1u4o4_22",slotPillHint:"_slotPillHint_1u4o4_40",slotPillPurpose:"_slotPillPurpose_1u4o4_45",slotPillWarning:"_slotPillWarning_1u4o4_51",slotPillPrimary:"_slotPillPrimary_1u4o4_56",courseCard:"_courseCard_1u4o4_62",courseCardHeading:"_courseCardHeading_1u4o4_72",courseCardDescription:"_courseCardDescription_1u4o4_79",courseNotAdded:"_courseNotAdded_1u4o4_85",assessmentExplainer:"_assessmentExplainer_1u4o4_93",assessmentExplainerHeading:"_assessmentExplainerHeading_1u4o4_107",leafContentLayout:"_leafContentLayout_1u4o4_117",container:"_container_1u4o4_131",emptyState:"_emptyState_1u4o4_140",titleRow:"_titleRow_1u4o4_150",titleRowLp:"_titleRowLp_1u4o4_157",nodeTitle:"_nodeTitle_1u4o4_171",nodeTitleLpRoot:"_nodeTitleLpRoot_1u4o4_193",nodeTitleSub:"_nodeTitleSub_1u4o4_198",courseDetailHeader:"_courseDetailHeader_1u4o4_203",courseDetailIcon:"_courseDetailIcon_1u4o4_210",courseDetailTitle:"_courseDetailTitle_1u4o4_222",courseDetailMeta:"_courseDetailMeta_1u4o4_229",formArea:"_formArea_1u4o4_234",contentListArea:"_contentListArea_1u4o4_238",contentListAreaLp:"_contentListAreaLp_1u4o4_242",dropZone:"_dropZone_1u4o4_246",reviewComment:"_reviewComment_1u4o4_253",reviewCommentLabel:"_reviewCommentLabel_1u4o4_266",reviewCommentText:"_reviewCommentText_1u4o4_272"},Fk=({slot:e,isEditable:t})=>{var m;const r=ae(),n=se(C=>C.treeData),s=se(C=>C.selectNode),o=(m=n[0])==null?void 0:m.id,{pre:a,post:i}=Il(),c=(e==="pre"?a:i).filled,d=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,u=e==="pre"?Dn:wy,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,g=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:Ie.container,children:[l.jsxs("button",{type:"button",className:Ie.backToPathButton,onClick:()=>o&&s(o),children:[l.jsx(pi,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:Ie.assessmentTitle,children:d}),l.jsx("div",{className:Ie.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillHint}`,children:[l.jsx(Sd,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillPurpose}`,children:[l.jsx(Cy,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillWarning}`,children:[l.jsx(Ed,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillPrimary}`,children:[l.jsx(Sd,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:Ie.formArea,children:[l.jsxs("div",{className:Ie.courseCard,children:[l.jsx("div",{className:Ie.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:Ie.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(Rl,{slot:e,isEditable:t}):l.jsx("div",{className:Ie.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:Ie.assessmentExplainer,children:[l.jsxs("div",{className:Ie.assessmentExplainerHeading,children:[l.jsx(u,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:g})]})]})]})},Mk="application/vnd.sunbird.questionset",Hp="application/vnd.sunbird.question",Bk=[Mk,Hp];function Qp(e){var t,r;if(!(!e||e.status!=="Draft"||((t=e.metadata)==null?void 0:t.prevStatus)!=="Review"))return(r=e.metadata)==null?void 0:r.rejectComment}const $k=({editorMode:e,onToolbarEvent:t})=>{var K,ce,te,we,ve;const r=ae(),[n,s]=p.useState("details"),[o,a]=p.useState([]),[i,c]=p.useState(null),[d,u]=p.useState(!1),[f,g]=p.useState(null),m=p.useRef(null),C=p.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:b,treeData:S,selectNode:w}=se(),T=rt(q=>q.activeAssessmentSlot),E=X(q=>{var $,U,oe,ie;return((U=($=q.editorConfig)==null?void 0:$.context)==null?void 0:U.contentId)??((ie=(oe=q.editorConfig)==null?void 0:oe.context)==null?void 0:ie.identifier)??""}),N=X(q=>q.editorProfile.competencyScoped),I=h?Wp(S,h):null;p.useEffect(()=>{g(null)},[I==null?void 0:I.identifier]);const O=!!I&&!I.parent,B=!!(I!=null&&I.isFolder),k=I&&Bk.includes(I.mimeType??""),F=(I==null?void 0:I.mimeType)===Hp,M=I&&!I.isFolder&&!k&&!O,z=N&&B&&st(I??void 0)?((te=(ce=(K=S[0])==null?void 0:K.children)==null?void 0:ce[0])==null?void 0:te.id)===(I==null?void 0:I.id)?"pre":"post":N?T:null,ne=Qp(I)??(O?Qp(S[0]):void 0),R=p.useCallback(()=>{const q=m.current;if(!q||!h)return;const $=q.innerText.trim();clearTimeout(C.current),C.current=setTimeout(()=>{b(h,{name:$})},600)},[h,b]),ge=p.useCallback(q=>{t({action:"onFormValueChange",data:q})},[t]),me=p.useCallback((q,$)=>{a($),t({action:"onFormStatusChange",data:{isValid:q,nodeId:h}})},[t,h]);if(!I)return l.jsx("div",{className:Ie.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(k)return l.jsx(Kl,{node:I,editorMode:e,type:"quml",singleQuestion:F});if(N&&M&&(I.primaryCategory==="Course"||nn(I))){const q=I.parent?wS(((we=S[0])==null?void 0:we.children)??[],I.parent):null,$=(q==null?void 0:q.role)==="pre"?r.learningPath.priorAssessmentLabel:(q==null?void 0:q.role)==="post"?r.learningPath.outcomeAssessmentLabel:(q==null?void 0:q.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String(q.levelNumber)):null,U=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:Ie.container,children:[l.jsxs("button",{type:"button",className:Ie.backToPathButton,onClick:()=>I.parent&&w(I.parent),children:[l.jsx(pi,{size:14}),$?r.learningPath.backToLevelButton.replace("{label}",$):r.learningPath.backToPathButton]}),l.jsxs("div",{className:Ie.courseDetailHeader,children:[l.jsx("span",{className:Ie.courseDetailIcon,children:l.jsx(pr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:Ie.courseDetailTitle,children:I.name}),l.jsxs("span",{className:Ie.courseDetailMeta,children:[I.primaryCategory,U]})]})]}),l.jsx(Vp,{courseId:I.identifier,variant:"full",title:I.name,onLoaded:({totalContents:oe})=>g(oe)},I.identifier)]})}return z?l.jsx(Fk,{slot:z,isEditable:e==="edit"}):M?l.jsxs("div",{className:Ie.leafContentLayout,children:[l.jsx(Kl,{node:I,editorMode:e,type:"content",layout:"flow"}),l.jsx(Pk,{node:I,editorMode:e,onMoveClick:()=>c(I.identifier),reorderDialog:i?l.jsx(Lk,{resourceId:i,resourceName:I.name,currentUnitId:I.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:Ie.container,children:[l.jsx(wE,{crumbs:v}),ne&&l.jsxs("div",{className:Ie.reviewComment,role:"alert",children:[l.jsx("span",{className:Ie.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:Ie.reviewCommentText,children:ne})]}),l.jsxs("div",{className:[Ie.titleRow,N?Ie.titleRowLp:""].filter(Boolean).join(" "),children:[O&&h&&l.jsx(Ok,{nodeId:h,value:String(I.appIcon??((ve=I.metadata)==null?void 0:ve.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:m,className:[Ie.nodeTitle,N&&O?Ie.nodeTitleLpRoot:"",N&&!O?Ie.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:R,onBlur:R,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:I.name})]}),l.jsx(_E,{activeTab:n,onChange:q=>s(q),errorTabs:o,visibleTabs:O&&!N?void 0:["details"]}),l.jsx("div",{className:Ie.formArea,children:l.jsx(FA,{nodeMetadata:y,activeTab:n,isRoot:O,isFolder:B,editorMode:e,onFormValueChange:ge,onFormStatusChange:me},`${h??"none"}:${O?"root":"node"}`)}),(B||O)&&n==="details"&&l.jsx("div",{className:[Ie.contentListArea,N?Ie.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(rk,{editorMode:e,isRoot:O})}),l.jsx(nk,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:Ie.dropZone}),d&&l.jsx(Nk,{contentId:E,onClose:()=>u(!1)})]})};function Wp(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=Wp(r.children,t);if(n)return n}}}const Rp=Is((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const o=[...t().allContent,...r];e({allContent:o,totalCount:n,offset:o.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:s}=t();let o=r;if(n&&n!=="all"){const a=n.toLowerCase();o=o.filter(i=>[i.mimeType??"",i.primaryCategory??"",i.contentType??""].join(" ").toLowerCase().includes(a))}if(s&&s.trim()!==""){const a=s.toLowerCase().trim();o=o.filter(i=>(i.name??"").toLowerCase().includes(a))}e({filteredContent:o})}}));function jk(e,t,r,n,s){const o={primaryCategory:[t?Nu:"Course"]};return s&&(o.framework=[s]),!e&&r.length&&n&&(o[n]=r),o}function qk(e,t){if(!(!e||!t))return[...Fp,t,"framework"]}function Uk(e,t,r,n,s,o=!1){return!e||o?null:t?r&&!n&&s.length===0?"noSkills":null:"noCurriculum"}const zk=20,Vk=[];function Gp(){var u;const e=X(f=>f.editorConfig),t=X(f=>f.editorProfile),r=se(f=>f.selectedNodeId),n=se(f=>f.treeData);if(t.restrictedContentCategories)return t.restrictedContentCategories;const s=p.useCallback(()=>{if(!r||!n.length)return 0;function f(g,m,C=0){var h;for(const v of g){if(v.id===m)return C;if((h=v.children)!=null&&h.length){const y=f(v.children,m,C+1);if(y>=0)return y}}return-1}return Math.max(0,f(n,r))},[r,n])(),o=(u=e==null?void 0:e.config)==null?void 0:u.hierarchy;if(!o)return[...qh];const a=`level${s}`,i=o[a],c=i==null?void 0:i.children,d=c==null?void 0:c.Content;return d!=null&&d.length?d:[...qh]}function Hk(){const e=Rp(),t=X(k=>{var F,M;return((M=(F=k.editorConfig)==null?void 0:F.context)==null?void 0:M.channel)??""}),r=Gp(),n=X(k=>k.editorProfile),s=rt(k=>k.activeAssessmentSlot),o=rt(k=>k.activeLevelExamTarget),a=se(k=>k.activeNodeMeta),i=se(k=>k.treeData),c=se(k=>k.treeCache),d=se(k=>k.selectedNodeId),u=se(k=>k.getNodeById),f=ir(),g=n.competencyScoped?Fu(i[0],c):void 0,m=p.useRef(),C=f&&Array.isArray(a[f.code])?a[f.code]:Vk,h=d?u(d):void 0,v=n.competencyScoped&&!!(h!=null&&h.isFolder)&&!!h.parent&&!st(h),y=!!s||!!o,b=Uk(n.competencyScoped,g,v,s,C,y),S=p.useRef(0),w=p.useCallback(async(k="",F="all",M={},x=!0,z=!1)=>{var R,ge,me,K,ce;const ne=++S.current;e.setLoading(!0);try{if(b){if(ne!==S.current)return;e.setContent([],0);return}let te;if(n.competencyScoped){const $=jk(s,y,C,f==null?void 0:f.code,g);te={status:["Live"],...$}}else te={status:["Live"],primaryCategory:F&&F!=="all"?[F]:r},(R=M==null?void 0:M.board)!=null&&R.length&&(te.board=M.board),(ge=M==null?void 0:M.medium)!=null&&ge.length&&(te.medium=M.medium),(me=M==null?void 0:M.gradeLevel)!=null&&me.length&&(te.gradeLevel=M.gradeLevel),(K=M==null?void 0:M.subject)!=null&&K.length&&(te.subject=M.subject),(ce=M==null?void 0:M.primaryCategory)!=null&&ce.length&&(te.primaryCategory=M.primaryCategory);const we=x?0:e.offset,{content:ve,count:q}=await sk({filters:te,query:k,limit:k?50:zk,offset:we,channel:t||void 0,sortBy:z?{name:"asc"}:{lastUpdatedOn:"desc"},fields:qk(n.competencyScoped,f==null?void 0:f.code)});if(ne!==S.current)return;x?e.setContent(ve,q):e.appendContent(ve,q)}catch(te){ne===S.current&&console.error("[useLibrary] load error:",te)}finally{ne===S.current&&e.setLoading(!1)}},[r,t,n,s,y,C,f,g,b]);p.useEffect(()=>{clearTimeout(m.current),e.setSearch("")},[g]),p.useEffect(()=>{w()},[t,n.key]),p.useEffect(()=>{n.competencyScoped&&w()},[n.competencyScoped,s,o,C.join("|"),g,d]);const T=p.useCallback(k=>{e.setSearch(k),clearTimeout(m.current),m.current=setTimeout(()=>w(k,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,w]),E=p.useCallback(k=>{e.setFilter(k),w(e.searchQuery,k,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,w]),N=p.useCallback(k=>{e.setAdvancedFilters(k),w(e.searchQuery,e.activeFilter,k,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,w]),I=p.useCallback(()=>{const k=!e.sortAZ;e.setSortAZ(k),w(e.searchQuery,e.activeFilter,e.advancedFilters,!0,k)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,w]),O=p.useCallback(()=>{e.isLoading||w(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,w]),B=e.allContent.length<e.totalCount;return{content:e.filteredContent,isLoading:e.isLoading,totalCount:e.totalCount,activeFilter:e.activeFilter,advancedFilters:e.advancedFilters,searchQuery:e.searchQuery,sortAZ:e.sortAZ,hasMore:B,search:T,setFilter:E,applyAdvancedFilters:N,toggleSort:I,loadMore:O,refetch:()=>w(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:s,emptyReason:b}}function Kp(){var c;const e=ae(),t=X(d=>d.editorProfile.competencyScoped),r=rt(d=>d.activeAssessmentSlot),n=rt(d=>d.activeLevelExamTarget),s=se(d=>d.selectedNodeId),o=se(d=>d.treeData),a=se(d=>d.getNodeById),i=(c=o[0])==null?void 0:c.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n){const d=a(n);return e.learningPath.libraryAddLevelExamCourse.replace("{level}",(d==null?void 0:d.name)??"")}if(s&&s!==i){const d=a(s);if(d!=null&&d.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",d.name??"")}return e.learningPath.libraryOpenLevelToAdd}const Jt={card:"_card_1o49q_1",addBtn:"_addBtn_1o49q_17",dragging:"_dragging_1o49q_24",ctIcon:"_ctIcon_1o49q_29",info:"_info_1o49q_33",name:"_name_1o49q_41",meta:"_meta_1o49q_50",skillTags:"_skillTags_1o49q_58",skillTag:"_skillTag_1o49q_58",addBtnMuted:"_addBtnMuted_1o49q_93",added:"_added_1o49q_102",addedBadge:"_addedBadge_1o49q_111"},Qk={video:zo,pdf:ks,h5p:Bo,scorm:qo,audio:jo,quiz:Mo,course:pr,default:Fr},Wk=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var S,w;const o=ae(),a=Hs(e),i=Qk[a.key]??Fr,c=Al(),d=uE(),u=c&&!s&&d,f=X(T=>T.editorProfile.competencyScoped),g=ir(),m=f&&g?(()=>{const T=e[g.code];return Array.isArray(T)?T:T?[String(T)]:[]})():[],{attributes:C,listeners:h,setNodeRef:v,isDragging:y}=gd({id:e.identifier,disabled:!n||!c||!d,data:{type:"library-item",item:e}}),b=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[Jt.card,y?Jt.dragging:"",s?Jt.added:""].join(" "),"aria-label":e.name,...n?{...C,...h}:{},role:"listitem",onClick:b,children:[l.jsx("span",{className:[`sbx-ct-sq--${a.key}`,Jt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Jt.info,children:[l.jsx("span",{className:Jt.name,title:e.name,children:e.name}),l.jsxs("span",{className:Jt.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(w=e.organisation)!=null&&w[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),m.length>0&&l.jsx("span",{className:Jt.skillTags,children:m.slice(0,3).map(T=>l.jsx("span",{className:Jt.skillTag,children:T},T))})]}),s&&l.jsx("span",{className:Jt.addedBadge,"aria-label":o.libraryCard.alreadyAddedAriaLabel,title:o.libraryCard.alreadyAddedTitle,children:l.jsx(Zr,{size:12})}),!s&&n&&l.jsx("button",{type:"button",className:[Jt.addBtn,!u&&c?Jt.addBtnMuted:""].join(" "),onClick:T=>{T.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!u,"aria-label":o.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?d?o.libraryCard.addToUnitTitle:o.libraryCard.selectUnitToAddTitle:o.libraryCard.draftOnlyTitle,children:l.jsx(Er,{size:14})})]})},Yp={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},Rk=({filters:e,active:t,onChange:r})=>{const n=ae();return l.jsx("div",{className:Yp.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(s=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===s.value,className:["sbx-chip",t===s.value?"filled":"outline",Yp.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},pt={panel:"_panel_1iejx_1",header:"_header_1iejx_10",headerTitle:"_headerTitle_1iejx_19",closeBtn:"_closeBtn_1iejx_25",body:"_body_1iejx_43",section:"_section_1iejx_59",sectionLabel:"_sectionLabel_1iejx_65",chips:"_chips_1iejx_73",chip:"_chip_1iejx_73",active:"_active_1iejx_96",footer:"_footer_1iejx_102",resetBtn:"_resetBtn_1iejx_112",applyBtn:"_applyBtn_1iejx_129"},Gk=e=>[{key:"board",label:e.libraryFilterPanel.boardLabel},{key:"medium",label:e.libraryFilterPanel.mediumLabel},{key:"gradeLevel",label:e.libraryFilterPanel.classLabel},{key:"subject",label:e.libraryFilterPanel.subjectLabel}],Kk=new Set(["board","medium","gradeLevel","subject","topic"]),Yk=({local:e,toggle:t})=>{const r=ae(),n=Gp();return n.length?l.jsxs("div",{className:pt.section,children:[l.jsx("div",{className:pt.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:pt.chips,children:n.map(s=>l.jsx("button",{type:"button",className:[pt.chip,(e.primaryCategory??[]).includes(s)?pt.active:""].join(" "),onClick:()=>t("primaryCategory",s),children:s},s))})]}):null},Zk=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const s=ae(),o=X(b=>b.editorConfig),a=X(b=>b.searchFormConfig),i=X(b=>b.contentFramework),c=X(b=>b.contentTargetFWIds),{organisationFramework:d}=sa(i??((v=o==null?void 0:o.context)==null?void 0:v.framework),c??((y=o==null?void 0:o.context)==null?void 0:y.targetFWIds)),[u,f]=p.useState(t),g=a!=null&&a.length?a.filter(b=>Kk.has(b.code)).map(b=>({key:b.code,label:b.label||b.code})):Gk(s);p.useEffect(()=>{f(t)},[t]);const m=(b,S)=>{f(w=>{const T=w[b]??[],E=T.includes(S)?T.filter(N=>N!==S):[...T,S];return{...w,[b]:E}})},C=(d==null?void 0:d.categories)??[],h=b=>{var S;return((S=C.find(w=>w.code===b))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:pt.panel,role:"dialog","aria-label":s.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:pt.header,children:[l.jsx("span",{className:pt.headerTitle,children:s.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:pt.closeBtn,onClick:n,"aria-label":s.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(or,{size:16})})]}),l.jsxs("div",{className:pt.body,children:[g.map(({key:b,label:S})=>{const w=h(b);return w.length?l.jsxs("div",{className:pt.section,children:[l.jsx("div",{className:pt.sectionLabel,children:S}),l.jsx("div",{className:pt.chips,children:w.slice(0,20).map(T=>l.jsx("button",{type:"button",className:[pt.chip,(u[b]??[]).includes(T.name)?pt.active:""].join(" "),onClick:()=>m(b,T.name),children:T.name},T.identifier))})]},b):null}),l.jsx(Yk,{local:u,toggle:m})]}),l.jsxs("div",{className:pt.footer,children:[l.jsx("button",{type:"button",className:pt.resetBtn,onClick:()=>f({}),children:s.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:pt.applyBtn,onClick:()=>{r(u),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},St={header:"_header_1n6zo_10",headerCourse:"_headerCourse_1n6zo_20",courseIcon:"_courseIcon_1n6zo_25",titleGroup:"_titleGroup_1n6zo_37",courseMeta:"_courseMeta_1n6zo_45",title:"_title_1n6zo_37",headerActions:"_headerActions_1n6zo_67",iconBtn:"_iconBtn_1n6zo_74",playerArea:"_playerArea_1n6zo_92",footer:"_footer_1n6zo_100",footerCourse:"_footerCourse_1n6zo_109",addBtn:"_addBtn_1n6zo_115",addBtnCourse:"_addBtnCourse_1n6zo_134",modalOverlay:"_modalOverlay_1n6zo_159",modalOverlayCourse:"_modalOverlayCourse_1n6zo_174",modalPanel:"_modalPanel_1n6zo_178",modalPanelCourse:"_modalPanelCourse_1n6zo_190"},Xk="application/vnd.sunbird.questionset",Jk=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const s=ae(),o=t==="edit",a=X(g=>g.editorProfile.competencyScoped),i=Kp();if(!e)return null;const c=a&&(e.primaryCategory==="Course"||nn(e)),d=[((f=e.organisation)==null?void 0:f[0])??e.channel??"",e.primaryCategory??""].filter(Boolean).join(" • "),u={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return Ue.createPortal(l.jsx("div",{className:[St.modalOverlay,c?St.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[St.modalPanel,c?St.modalPanelCourse:""].filter(Boolean).join(" "),onClick:g=>g.stopPropagation(),children:[l.jsxs("div",{className:[St.header,c?St.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:St.courseIcon,children:l.jsx(pr,{size:20})}),l.jsxs("div",{className:St.titleGroup,children:[l.jsx("span",{className:St.title,title:e.name,children:e.name}),c&&d&&l.jsx("span",{className:St.courseMeta,children:d})]}),l.jsx("div",{className:St.headerActions,children:l.jsx("button",{type:"button",className:St.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(or,{size:16})})})]}),l.jsx("div",{className:St.playerArea,children:c?l.jsx(Vp,{courseId:e.identifier}):l.jsx(Kl,{node:u,editorMode:"read",type:e.mimeType===Xk?"quml":"content"})}),o&&l.jsx("div",{className:[St.footer,c?St.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:St.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Er,{size:15})," ",i??s.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:St.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},Ve={dock:"_dock_j39wj_1",header:"_header_j39wj_8",libraryTargetLabel:"_libraryTargetLabel_j39wj_18",libraryTargetChip:"_libraryTargetChip_j39wj_28",headerLeft:"_headerLeft_j39wj_46",headerTitle:"_headerTitle_j39wj_54",count:"_count_j39wj_60",searchRow:"_searchRow_j39wj_69",searchWrap:"_searchWrap_j39wj_77",searchIcon:"_searchIcon_j39wj_83",searchInput:"_searchInput_j39wj_92",filterToggleBtn:"_filterToggleBtn_j39wj_110",filterToggleBtnActive:"_filterToggleBtnActive_j39wj_129",filterBadge:"_filterBadge_j39wj_135",filters:"_filters_j39wj_154",mainArea:"_mainArea_j39wj_164",sidePanelOverlay:"_sidePanelOverlay_j39wj_173",cardList:"_cardList_j39wj_182",skeleton:"_skeleton_j39wj_198",skeletonIcon:"_skeletonIcon_j39wj_208",skeletonText:"_skeletonText_j39wj_216",skeletonLine:"_skeletonLine_j39wj_223",skeletonLineSm:"_skeletonLineSm_j39wj_230",loadMoreBtn:"_loadMoreBtn_j39wj_245",emptyState:"_emptyState_j39wj_270",collapseBtn:"_collapseBtn_j39wj_290"},eI=[{label:"Courses",value:"all"}];function tI(e){const t=new Set,r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t.add(n.identifier),n.children&&r.push(...n.children)}return t}const rI=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ae(),{content:s,isLoading:o,totalCount:a,activeFilter:i,searchQuery:c,sortAZ:d,hasMore:u,search:f,setFilter:g,applyAdvancedFilters:m,toggleSort:C,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=Hk(),{addResource:b,selectedNodeId:S,treeData:w,treeCache:T}=se(),E=rt(U=>U.setActiveAssessmentSlot),N=rt(U=>U.activeLevelExamTarget),I=rt(U=>U.setActiveLevelExamTarget),O=X(U=>U.editorProfile.competencyScoped),B=X(U=>U.editorProfile.restrictedContentCategories),k=e==="edit",F=Kp(),[M,x]=p.useState(!1),[z,ne]=p.useState({}),[R,ge]=p.useState(null),me=p.useMemo(()=>tI(w),[w]),K=p.useCallback((U,oe)=>{var fe,ye;const ie=(fe=w[0])==null?void 0:fe.id;if(!ie)return;if(Fs(((ye=w[0])==null?void 0:ye.children)??[],oe)){pe.error(oe==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}if(!nn(U)){pe.error(n.learningPath.notAssessmentCourseToast.replace("{name}",U.name));return}if(b(U,ie,{isAssessmentCourse:!0,slot:oe})===!1){pe.error(n.learningPath.bothSlotsFilledToast);return}pe.success(n.libraryDock.itemAddedToast.replace("{name}",U.name)),E(null)},[w,b,E,n]),ce=p.useCallback((U,oe)=>{var ye;const ie=se.getState().getNodeById(oe);if(!ie)return;if(Pu(ie)){pe.error(n.learningPath.levelExamAlreadyFilledToast);return}if(!nn(U)){pe.error(n.learningPath.notAssessmentCourseToast.replace("{name}",U.name));return}const Se=((ye=w[0])==null?void 0:ye.children)??[];if(Ou(Se,ie)){pe.error(n.learningPath.levelNeedsMixedContentToast);return}if(b(U,oe,{isAssessmentCourse:!0})===!1){pe.error(n.learningPath.itemAlreadyInPathToast.replace("{name}",U.name));return}pe.success(n.libraryDock.itemAddedToast.replace("{name}",U.name)),I(null)},[w,b,I,n]),te=p.useCallback(U=>{var fe,ye,Le,J;if(v){K(U,v);return}if(N){ce(U,N);return}if(O&&!Mu(w[0],T)){pe.error(n.learningPath.selectCurriculumFirstToast);return}if(!S){pe.error(O?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const oe=(fe=w[0])==null?void 0:fe.id,ie=se.getState().getNodeById(S);if(O){const he=((ye=w[0])==null?void 0:ye.children)??[],Q=ie!=null&&ie.isFolder?ie:ie!=null&&ie.parent?se.getState().getNodeById(ie.parent):void 0;if(Q&&Hi(he,Q)){const be=(Le=he[0])==null?void 0:Le.id;pe.error(Q.id===be?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===oe||!(ie!=null&&ie.isFolder)){pe(O?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(Dn,{size:16}),duration:4e3});return}if(O&&Ou(((J=w[0])==null?void 0:J.children)??[],ie)&&nn(U)){pe.error(n.learningPath.levelNeedsMixedContentToast);return}if(b(U,S)===!1){pe.error((O?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",U.name));return}pe.success(n.libraryDock.itemAddedToast.replace("{name}",U.name))},[v,K,N,ce,S,b,w,T,n,O]),we=p.useCallback(U=>{ne(U),m(U)},[m]),ve=p.useCallback(U=>{ge(U)},[]),q=p.useCallback(U=>{te(U),ge(null)},[te]),$=p.useMemo(()=>Object.values(z).reduce((U,oe)=>U+((oe==null?void 0:oe.length)??0),0),[z]);return l.jsxs("div",{className:Ve.dock,children:[l.jsxs("div",{className:Ve.header,children:[l.jsxs("div",{className:Ve.headerLeft,children:[l.jsx("button",{type:"button",className:Ve.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(My,{size:15})}),l.jsx(Py,{size:16}),l.jsx("span",{className:Ve.headerTitle,children:n.libraryDock.headerTitle}),a>0&&l.jsx("span",{className:Ve.count,children:a})]}),F&&(v||N?l.jsxs("button",{type:"button",className:Ve.libraryTargetChip,onClick:()=>E(null),"aria-label":n.libraryDock.cancelTargetAriaLabel,title:n.libraryDock.cancelTargetAriaLabel,children:[l.jsx("span",{className:Ve.libraryTargetLabel,children:F}),l.jsx(or,{size:11,"aria-hidden":"true"})]}):l.jsx("span",{className:Ve.libraryTargetLabel,children:F}))]}),l.jsxs("div",{className:Ve.searchRow,children:[l.jsxs("div",{className:Ve.searchWrap,children:[l.jsx(Uo,{size:14,className:Ve.searchIcon}),l.jsx("input",{type:"search",className:Ve.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:U=>f(U.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[Ve.filterToggleBtn,d?Ve.filterToggleBtnActive:""].join(" "),onClick:C,"aria-label":d?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:d?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:d?l.jsx(Sy,{size:15}):l.jsx(Ay,{size:15})}),!O&&l.jsxs("button",{type:"button",className:[Ve.filterToggleBtn,M?Ve.filterToggleBtnActive:""].join(" "),onClick:()=>x(U=>!U),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":M,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(Hy,{size:15}),$>0&&l.jsx("span",{className:Ve.filterBadge,children:$})]})]}),l.jsx("div",{className:Ve.filters,children:l.jsx(Rk,{filters:O?eI:B?[kl[0],...kl.filter(U=>B.includes(U.value))]:kl,active:i,onChange:g})}),l.jsxs("div",{className:Ve.mainArea,children:[l.jsx("div",{className:Ve.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:o&&s.length===0?Array.from({length:4}).map((U,oe)=>l.jsxs("div",{className:Ve.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:Ve.skeletonIcon}),l.jsxs("div",{className:Ve.skeletonText,children:[l.jsx("div",{className:Ve.skeletonLine}),l.jsx("div",{className:Ve.skeletonLineSm})]})]},oe)):s.length>0?l.jsxs(l.Fragment,{children:[s.map(U=>l.jsx(Wk,{item:U,onAdd:te,onPreview:ve,isDraggable:k,isAdded:me.has(U.identifier)},U.identifier)),u&&l.jsx("button",{type:"button",className:Ve.loadMoreBtn,onClick:h,disabled:o,"aria-label":n.libraryDock.loadMoreAriaLabel,children:o?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:Ve.emptyState,children:[l.jsx(Uo,{size:24}),y==="noCurriculum"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noCurriculumEmptyTitle}),l.jsx("span",{children:n.learningPath.noCurriculumEmptyHint})]}):y==="noSkills"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noSkillsEmptyTitle}),l.jsx("span",{children:n.learningPath.noSkillsEmptyHint})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noContentFound}),l.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})]})}),M&&l.jsx("div",{className:Ve.sidePanelOverlay,children:l.jsx(Zk,{isOpen:M,filters:z,onApply:we,onClose:()=>x(!1)})}),R&&l.jsx(Jk,{content:R,editorMode:e,onAdd:q,onClose:()=>ge(null)})]})]})};function nI(e,t,r,n=Qo){const s={},o={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),c=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","industry","domain","dialcodes"]),d=new Set(["copyrightYear","compatibilityLevel","version"]);function u(m,C=!1){const h={};for(const[v,y]of Object.entries(m))if(!a.has(v)&&!(C&&i.has(v)))if(c.has(v))Array.isArray(y)?h[v]=y:y!=null&&y!==""?h[v]=[y]:h[v]=[];else if(d.has(v)){const b=Number(y);isNaN(b)||(h[v]=b)}else h[v]=y;return h}function f(m){var h;const C={};for(const v of m.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:b,...S}=y;if(Object.keys(S).length===0)continue;const w=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};C[v.identifier]={name:v.name,...w,...S}}return C}function g(m,C){var w,T;const h=m.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),b=!m.isFolder&&!C;if(C||y||v&&!b){let E;if(y)E={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((w=m.metadata)==null?void 0:w.contentType)??n.unitContentType,primaryCategory:((T=m.metadata)==null?void 0:T.primaryCategory)??n.unitPrimaryCategory,name:m.name,visibility:"Parent",channel:r,...u(m.metadata??{})};else if(C){const{isNew:N,...I}=v??{};E={...u(m.metadata??{},!0),...u(I,!1),name:m.name}}else{const{isNew:N,...I}=v??{};E={name:m.name,visibility:"Parent",...u(I,!0)}}s[h]={metadata:E,objectType:m.objectType||(m.isFolder?"Collection":"Content"),root:C,isNew:y}}const S=m.isFolder?f(m):{};o[h]={name:m.name,children:(m.children??[]).map(E=>E.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:C},(m.children??[]).forEach(E=>g(E,!1))}return e.forEach((m,C)=>g(m,C===0)),{nodesModified:s,hierarchy:o}}function sI(){const[e,t]=p.useState(!1),r=se(u=>u.treeCache),n=se(u=>u.treeData),s=X(u=>u.isDirty),o=X(u=>u.lastSaved),{setIsDirty:a,setLastSaved:i}=X(),c=X(u=>u.editorConfig);return{save:p.useCallback(async()=>{if(!c||e)return;const u=c.context.contentId??c.context.identifier??"";if(!u)return;if(n.length===0){pe.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",g=c.context.userId??c.context.uid??"";t(!0);try{const m=X.getState().editorProfile,{nodesModified:C,hierarchy:h}=nI(n,r,f,m),{identifiers:v}=await pS(u,C,h,g);v&&Object.keys(v).length>0&&se.getState().replaceNodeIds(v);const y=new Date().toISOString();i(y),a(!1)}catch(m){console.error("[useSaveHierarchy] save failed:",m),pe.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,a,i]),isSaving:e,isDirty:s,lastSaved:o}}const oI={};function aI(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function iI(e,t,r,n,s,o=oI){const a=[],i=(c,d)=>{var u;for(const f of c){const g=d&&!f.parent,m=g?r:f.isFolder?n:null;if(m&&m.length>0){const C={...f.metadata??{},...t[f.id]??{}},v=mp(m,C,o,g,s).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&aI(y.currentValue)).map(y=>y.label);v.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(u=f.children)!=null&&u.length&&i(f.children,!1)}};return i(e,!0),a}function lI(e){var S,w;const t=X(T=>T.editorConfig),r=X(T=>T.editorProfile),n=X(T=>T.setButtonLoader),s=X(T=>T.validateAllForms),o=X(T=>T.rootFormConfig),a=X(T=>T.unitFormConfig),i=se(T=>T.treeData),c=se(T=>T.treeCache),d=se(T=>T.selectNode),u=ir(),{scope:f}=Bs(),g=X(T=>T.contentFramework),m=X(T=>T.contentTargetFWIds),{organisationFramework:C,targetFrameworks:h}=sa(g??((S=t==null?void 0:t.context)==null?void 0:S.framework),m??((w=t==null?void 0:t.context)==null?void 0:w.targetFWIds)),v=p.useCallback(()=>{var O,B,k;const T={editorMode:"edit",objectType:(O=t==null?void 0:t.config)==null?void 0:O.objectType,userFullName:(k=(B=t==null?void 0:t.context)==null?void 0:B.user)==null?void 0:k.fullName},E=iI(i,c,o,a,T,{organisationFramework:C,targetFrameworks:h});if(E.length===0)return!0;const N=E[0];pe.error(`"${N.nodeName}": please fill required field${N.missing.length>1?"s":""} — ${N.missing.join(", ")}`);const{setFormStatus:I}=X.getState();return E.forEach(F=>I(F.nodeId,!1)),d(N.nodeId),!1},[i,c,o,a,t,d,C,h]),y=p.useCallback(()=>{if(r.key!=="learningPath")return!0;const T=Qi(i[0],u==null?void 0:u.code,f,c);return T.length===0?!0:(pe.error(T[0].message),!1)},[r.key,i,c,u,f]);return{runAction:p.useCallback(async(T,E)=>{var O,B,k,F;const N=((O=t==null?void 0:t.context)==null?void 0:O.contentId)??((B=t==null?void 0:t.context)==null?void 0:B.identifier)??"";if(!N)return pe.error("No content identifier found."),!1;const I=((k=t==null?void 0:t.context)==null?void 0:k.userId)??((F=t==null?void 0:t.context)==null?void 0:F.uid)??"";try{switch(T){case"sendForReview":return v()?s(i)?y()?(n("saveCollection",!0),await e(),await vS(N),pe.success("Content sent for review"),!0):!1:(pe.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const M=(E==null?void 0:E.comment)??"";return await yS(N,M),pe.success("Content rejected and sent back to the author"),!0}case"publish":return v()?s(i)?y()?(n("publishCollection",!0),await e(),await gS(N,I),pe.success("Content published successfully"),!0):!1:(pe.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(M){console.error(`[useToolbarActions] ${T} failed`,M);const x=T==="sendForReview"?"send for review":T==="reject"?"reject":"publish";return pe.error(`Failed to ${x}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,v,y,s,i]),checkRequiredFields:v}}function cI(){const e=ae(),t=X(c=>c.editorProfile.key==="learningPath"),r=se(c=>c.treeData),n=ir(),{scope:s,source:o}=Bs(),a=p.useRef(!1),i=p.useRef("");p.useEffect(()=>{if(!t||o!=="prior"||!n)return;const c=AS(r[0],n.code,s),d=c.map(u=>u.id).sort().join(",");a.current?c.length>0&&d!==i.current&&pe.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):a.current=!0,i.current=d},[t,o,s.join("|"),n==null?void 0:n.code,r])}function dI(){const e=X(a=>a.editorProfile.key==="learningPath"),t=se(a=>a.treeData),r=se(a=>a.treeCache),n=se(a=>a.updateNode),s=ir(),o=s==null?void 0:s.code;p.useEffect(()=>{if(!e||!o)return;const a=t[0],i=ES(a,o,r);i!==null&&n(a.id,{[o]:i},[o])},[e,t,r,o,n])}const jt={shell:"_shell_1k9or_1",workspace:"_workspace_1k9or_8",sidebarCollapsed:"_sidebarCollapsed_1k9or_16",dockCollapsed:"_dockCollapsed_1k9or_19",dock:"_dock_1k9or_19",outline:"_outline_1k9or_40",reopenTab:"_reopenTab_1k9or_45",outlineHidden:"_outlineHidden_1k9or_79",editor:"_editor_1k9or_86",editorLp:"_editorLp_1k9or_92",dockHidden:"_dockHidden_1k9or_105",dockReopenTab:"_dockReopenTab_1k9or_112",dragChip:"_dragChip_1k9or_137",dragChipLabel:"_dragChipLabel_1k9or_152"},uI=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const s=ae(),[o,a]=p.useState(null),[i,c]=p.useState(!1),[d,u]=p.useState(!1),[f,g]=p.useState(!1);cI(),dI();const{addResource:m,treeData:C,treeCache:h}=se(),v=X(R=>R.setFormStatus),y=X(R=>R.editorProfile.key==="learningPath"),[b,S]=p.useState(!0),w=se(R=>R.selectedNodeId),{save:T,isSaving:E,isDirty:N,lastSaved:I}=sI(),{runAction:O,checkRequiredFields:B}=lI(T);p.useEffect(()=>{if(!N)return;const R=ge=>{ge.preventDefault(),ge.returnValue=""};return window.addEventListener("beforeunload",R),()=>window.removeEventListener("beforeunload",R)},[N]);const k=Bc(ri(No,{activationConstraint:{distance:8}})),F=p.useCallback(R=>{var me;const ge=(me=R.active.data.current)==null?void 0:me.item;ge&&a(ge)},[]),M=p.useCallback(R=>{var q,$,U,oe,ie;a(null);const ge=(q=R.active.data.current)==null?void 0:q.item;if(!ge)return;if(y&&!Mu(C[0],h)){pe.error(s.learningPath.selectCurriculumFirstToast);return}const me=R.over,K=(me==null?void 0:me.id)??w??void 0,ce=y?s.learningPath.dropOntoLevelError:s.splitBuilderShell.dropOntoUnitError;if(!K){pe.error(ce);return}const te=($=C[0])==null?void 0:$.id;if(K===te){pe.error(y?s.learningPath.dropOntoPathError:s.splitBuilderShell.dropOntoCourseError);return}const we=se.getState().getNodeById(K);if(!(we!=null&&we.isFolder)){pe.error(ce);return}if(y&&st(we)){const Se=(ie=(oe=(U=C[0])==null?void 0:U.children)==null?void 0:oe[0])==null?void 0:ie.id;pe.error(we.id===Se?s.learningPath.priorSlotFilledToast:s.learningPath.outcomeSlotFilledToast);return}if(!m(ge,K)){pe.error((y?s.learningPath.itemAlreadyInPathToast:s.splitBuilderShell.alreadyInCollectionError).replace("{name}",ge.name));return}r==null||r(ge,K),pe.success((y?s.learningPath.addedToLevelSuccess:s.splitBuilderShell.addedToUnitSuccess).replace("{name}",ge.name))},[w,m,C,h,r,s,y]),x=p.useCallback(async R=>{if(R.action==="onFormStatusChange"){const{isValid:ge,nodeId:me}=R.data??{},K=ge!==!1;S(K),me&&v(me,K);return}if(R.action==="back"&&N&&e==="edit"){g(!0);return}if(R.action==="saveCollection"){if(!b){pe.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!B())return;await T(),n==null||n(C),t==null||t(R);return}if(R.action==="sendForReview"||R.action==="reject"||R.action==="publish"){await O(R.action,R.data)&&(t==null||t(R));return}t==null||t(R)},[T,O,B,t,n,C,N,b,e,s]),z=p.useCallback(async()=>{if(!B()){g(!1);return}await T(),g(!1),n==null||n(C),t==null||t({action:"back"})},[T,B,n,t,C]),ne=p.useCallback(()=>{g(!1),t==null||t({action:"back"})},[t]);return l.jsxs(hi,{sensors:k,onDragStart:F,onDragEnd:M,children:[l.jsxs("div",{className:jt.shell,children:[l.jsx(ZS,{editorMode:e,isSaving:E,isDirty:N,lastSaved:I,isFormValid:b,onToolbarEvent:x}),l.jsxs("div",{className:[jt.workspace,i?jt.sidebarCollapsed:"",d?jt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[jt.outline,i?jt.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":i,children:l.jsx(SE,{editorMode:e,collapsed:i,onToggleCollapse:()=>c(R=>!R)})}),i&&l.jsx("button",{className:jt.reopenTab,onClick:()=>c(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[jt.editor,y?jt.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:l.jsx($k,{editorMode:e,onToolbarEvent:x})}),l.jsx("aside",{className:[jt.dock,d?jt.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:l.jsx(rI,{editorMode:e,collapsed:d,onToggleCollapse:()=>u(R=>!R)})}),d&&l.jsx("button",{className:jt.dockReopenTab,onClick:()=>u(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(my,{dropAnimation:null,children:o?l.jsx("div",{className:jt.dragChip,children:l.jsx("span",{className:jt.dragChipLabel,children:o.name})}):null}),f&&l.jsx(XS,{onSave:z,onDiscard:ne,onCancel:()=>g(!1),isSaving:E})]})},fI="v1";function hI(e){const t=e.validations,r=t==null?void 0:t.find(s=>s.type==="maxlength"||s.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Zp(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:hI(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function jr(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const s=n.name??void 0,o=n.fields.filter(a=>!!a.code).sort((a,i)=>(a.index??0)-(i.index??0));for(const a of o)r.push(Zp(a,s))}else n.code&&r.push(Zp(n));return r}function pI(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,s]of Object.entries(t))s&&"default"in s&&(r[n]=s.default);return r}async function gI(e,t,r="Collection",n=fI){var d,u;const o=(u=(d=(await Me.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:d.result)==null?void 0:u.objectCategoryDefinition,a=(o==null?void 0:o.forms)??{},i=(o==null?void 0:o.objectMetadata)??{},c=i.config??{};return{rootForm:jr(a.create),unitForm:jr(a.unitMetadata),childForm:jr(a.childMetadata),searchForm:jr(a.search??a.searchConfig),relationalForm:jr(a.relationalMetadata),publishChecklist:jr(a.publishchecklist),reviewChecklist:jr(a.review),rfcChecklist:jr(a.requestforchangeschecklist),schemaDefaults:pI(i.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Xp(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function mI({config:e,onError:t}){const[r,n]=p.useState(!0),[s,o]=p.useState(null),[a,i]=p.useState(!1),{setEditorConfig:c,setEditorMode:d,setCategoryDefinition:u,setContentFramework:f,setEditorProfile:g}=X(),{setTreeData:m,selectNode:C}=se();return p.useEffect(()=>{let h=!1;async function v(){var y,b,S;try{n(!0),o(null),e.apiBaseUrl&&Au(e.apiBaseUrl),c(e),d(e.config.mode),g(ub(e));const w=e.context.contentId??e.context.identifier??"",T=e.context.channel??"";let E;if(T)try{E=(y=await pp(T))==null?void 0:y.defaultFramework}catch{}let N=!1;if(w){const I=e.config.objectType==="QuestionSet";let{rootNode:O}=I?await hS(w):await Lu(w);if(O&&e.config.primaryCategory==="Learning Path"&&(O=CS(O)),!h&&(m(O?[O]:[]),O)){C(O.id);const{framework:x,targetFWIds:z}=Xp(O.metadata??{},E,e.context);f(x,z),N=!0}const B=e.config.primaryCategory??"Course",k=e.context.channel??"",F=e.config.categoryDefinitionApiVersion??"v1";try{const M=await gI(B,k,e.config.objectType??"Collection",F);if(!h){u(M);const x=((b=M.sourcingSettings)==null?void 0:b.collection)??{},z={};x.maxDepth&&!e.config.maxDepth&&(z.maxDepth=x.maxDepth),x.children&&!e.config.children&&(z.children=x.children),x.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(z.hierarchy={...e.config.hierarchy??{},...x.hierarchy}),Object.keys(z).length>0&&c({...e,config:{...e.config,...z}})}}catch{}}if(!h&&!N){const{framework:I,targetFWIds:O}=Xp({},E,e.context);f(I,O)}h||i(!0)}catch(w){if(!h){const T=w instanceof Error?w:new Error(String(w));o(T),t==null||t(T)}}finally{h||n(!1)}}return v(),()=>{h=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:a}}function vI(){const e=ki(t=>t.setLanguage);p.useEffect(()=>{e(localStorage.getItem(Ei)||"en",{broadcast:!1});const t=n=>{n.key===Ei&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var o;const s=(o=n.detail)==null?void 0:o.lang;s&&e(s,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(Ai,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(Ai,r)}},[e])}const to={root:"_root_qcpw6_1",loadingState:"_loadingState_qcpw6_10",loadingSpinner:"_loadingSpinner_qcpw6_20",errorState:"_errorState_qcpw6_34"},yI=new Vg({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function bI({error:e,onRetry:t}){const r=ae();return l.jsxs("div",{className:to.errorState,children:[l.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),l.jsx("p",{children:e.message}),l.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class CI extends p.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?l.jsx(bI,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function SI(e){vI();const t=ae(),{isLoading:r,error:n}=mI({config:e,onError:e.onError}),s=X(a=>a.editorMode),o=X(a=>a.editorProfile);return r?l.jsxs("div",{className:to.loadingState,children:[l.jsx("div",{className:to.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:to.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",to.root,o.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(uI,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const Jp=e=>l.jsx(CI,{onError:e.onError,children:l.jsxs(Qg,{client:yI,children:[l.jsx(SI,{...e}),l.jsx(Hm,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),Fa=Symbol.for("r2wc.reactRender"),eg=Symbol.for("r2wc.shouldRender"),Ma=Symbol.for("r2wc.root");function wI(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _I(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var tg={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[Fa]()}}),e[Fa]()}};function TI(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},o=!1,a=function(){var d=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?d.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),d.attachShadow({mode:"open"})),d},i=Object.create(HTMLElement.prototype);i.constructor=a;var c=new Proxy(i,{has:function(d,u){return u in e.propTypes||u in i},set:function(d,u,f,g){return o&&(s[u]=!0),typeof u=="symbol"||s[u]||u in d?(e.propTypes&&u in e.propTypes&&tg.expando(g,u,f),Reflect.set(d,u,f,g)):(tg.expando(g,u,f),!0)},getOwnPropertyDescriptor:function(d,u){var f=Reflect.getOwnPropertyDescriptor(d,u);if(f)return f;if(u in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return a.prototype=c,i.connectedCallback=function(){this[eg]=!0,this[Fa]()},i.disconnectedCallback=function(){typeof r.createRoot=="function"?this[Ma].unmount():r.unmountComponentAtNode(this)},i[Fa]=function(){if(this[eg]===!0){var d={};Object.keys(this).forEach(function(g){s[g]!==!1&&(d[g]=this[g])},this),o=!0;const u=n.shadow?this.shadowRoot:this,f=t.createElement(e,d);typeof r.createRoot=="function"?(this[Ma]||(this[Ma]=r.createRoot(u)),this[Ma].render(f)):r.render(f,u),o=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return wI(d)}):Object.keys(e.propTypes),i.attributeChangedCallback=function(d,u,f){var g=n.dashStyleAttributes?_I(d):d;this[g]=f}),a}var Yn={},rg;function EI(){if(rg)return Yn;rg=1;var e=Ue;if(process.env.NODE_ENV==="production")Yn.createRoot=e.createRoot,Yn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Yn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Yn.hydrateRoot=function(r,n,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,s)}finally{t.usingClientEntryPoint=!1}}}return Yn}var AI=EI();const kI=yi(AI);function II(){if(document.getElementById("sb-ce-react-styles"))return;const e=document.createElement("style");e.id="sb-ce-react-styles",e.textContent="@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function LI(e="sb-collection-editor"){if(II(),typeof customElements>"u"||customElements.get(e))return;const t=TI(Jp,p,kI,{});customElements.define(e,t)}Ae.CollectionEditor=Jp,Ae.registerCollectionEditor=LI,Ae.setApiBaseUrl=Au,Ae.useEditorStore=X,Ae.useLibraryStore=Rp,Ae.useTreeStore=se,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})}));
528
+ */var du;function sC(){return du||(du=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,r=Ri(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,s=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;Qi.useSyncExternalStoreWithSelector=function(d,u,f,g,p){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=i(function(){function y(T){if(!C){if(C=!0,S=T,T=g(T),p!==void 0&&m.hasValue){var E=m.value;if(p(E,T))return w=E}return w=T}if(E=w,n(S,T))return E;var A=g(T);return p!==void 0&&p(E,A)?(S=T,E):(S=T,w=A)}var C=!1,S,w,_=f===void 0?null:f;return[function(){return y(u())},_===null?void 0:function(){return y(_())}]},[u,f,g,p]);var v=o(d,b[0],b[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Qi}var uu;function aC(){return uu||(uu=1,process.env.NODE_ENV==="production"?la.exports=oC():la.exports=sC()),la.exports}var iC=aC();const lC=Ui(iC),fu={},{useDebugValue:cC}=h,{useSyncExternalStoreWithSelector:dC}=lC;let hu=!1;const uC=e=>e;function fC(e,t=uC,r){(fu?"production":void 0)!=="production"&&r&&!hu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),hu=!0);const n=dC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return cC(n),n}const pu=e=>{(fu?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?tC(e):e,r=(n,o)=>fC(t,n,o);return Object.assign(r,t),r},Yo=e=>e?pu(e):pu,da={key:"collection",unitPrimaryCategory:"Course Unit",unitContentType:"CourseUnit",unitLabelKey:"unit",defaultUnitName:"Untitled Unit",maxDepth:4,linkedLeavesOnly:!1,leafPrimaryCategories:[],derivedRoles:!1,competencyScoped:!1,features:{csvUpload:!0,dialcodes:!0,pageNumbers:!0,bulkUpload:!0,collaborators:!0}},hC={key:"learningPath",unitPrimaryCategory:"Level",unitContentType:"Level",unitLabelKey:"level",defaultUnitName:"Untitled Level",maxDepth:1,linkedLeavesOnly:!0,leafPrimaryCategories:["Course"],derivedRoles:!0,competencyScoped:!0,features:{csvUpload:!1,dialcodes:!1,pageNumbers:!1,bulkUpload:!1,collaborators:!1}},pC={...da,key:"evaluationCourse",restrictedContentCategories:["Practice Question Set","Course Assessment"]};function mC(e){switch(e.config.primaryCategory){case"Learning Path":return hC;case"Evaluation Course":return pC;default:return da}}const Z=Yo(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,editorProfile:da,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorProfile:t=>e({editorProfile:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=Z.getState().formStatusMapper,n=[...t];for(;n.length>0;){const o=n.shift();if(r[o.id]===!1)return!1;o.children&&n.push(...o.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),gC=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:Z},Symbol.toStringTag,{value:"Module"})),lt=Yo(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,activeLevelExamTarget:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t,activeLevelExamTarget:null}),setActiveLevelExamTarget:t=>e({activeLevelExamTarget:t,activeAssessmentSlot:null})})),Wi={contextualEditor:{emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},languageSelector:{ariaLabel:"Select language"},collectionEditor:{errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},breadcrumb:{nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},tabBar:{detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},contentEditForm:{moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},titleAppIcon:{selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},unitContentList:{removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},contentRow:{dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},csvUpload:{invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},manageCollaborators:{saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},sparkMetaForm:{shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab.",skillFramework:"Skill framework",selectSkillFramework:"Select a skill framework",skills:"Skills",selectSkills:"Select skills",targetRole:"Target role (optional)",noTargetRole:"No target role"},appIconField:{requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},appIconPickerModal:{dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},chipGroupField:{addPlaceholder:"Add…",addButtonLabel:"Add"},dateTimeField:{requiredError:"{field} is required"},dialcodeInputField:{requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},keywordSuggestField:{requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},licenseSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select license…"},multiSelectField:{requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options",searchPlaceholder:"Search…",noMatchesMessage:"No matches"},nestedSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select…"},radioField:{requiredError:"{field} is required"},selectField:{requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options",searchPlaceholder:"Search…",noMatchesMessage:"No matches"},textField:{requiredError:"{field} is required",maxLengthError:"Max {max} characters"},assetBrowser:{dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},resourceReorderDialog:{dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},assignPageNumber:{dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},confirmDialog:{title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},publishChecklist:{publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",selectAllLabel:"Select all",noButton:"No",yesButton:"Yes"},qualityParamsModal:{reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},unsavedChangesModal:{title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},filterChips:{contentTypeFiltersAriaLabel:"Content type filters"},libraryCard:{alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added",moreSkills:"+{count} more"},libraryDock:{selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",cancelTargetAriaLabel:"Cancel — go back to browsing",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter",noSkillMatchTitle:"No content teaches this course's skills yet",noSkillMatchHint:"Content shows here once it is tagged only with this course's skills. Everything else is under Other content.",matchingHeading:"Teaches this course's skills",otherContentHeading:"Other content ({count})",otherContentHint:"These teach skills outside this course, or none. You can still add them.",pickSkillsHint:"Pick this course's skills to see the content that teaches them first."},libraryFilterPanel:{boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},libraryPreviewPanel:{contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},outlineTree:{maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},treeNode:{expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},contentPlayer:{mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},dialcodePanel:{title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},progressStatus:{unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},splitBuilderShell:{dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},topbar:{draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},reviewCommentModal:{closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},confirmReviewModal:{closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},generateQRModal:{closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},chip:{remove:"Remove"},dropZone:{dropHere:"Drop here"},spinner:{loading:"Loading"},learningPath:{profileBadgeLabel:"Learning Path",pathStructureLabel:"Path Structure",addLevelButton:"Add Level",levelNumberPrefix:"Level {n}",priorAssessmentLabel:"Prior Assessment",priorAssessmentHint:"Always required · not a level",outcomeAssessmentLabel:"Outcome Assessment",outcomeAssessmentHint:"Confirms outcome · not a level",skillCheckBadge:"Skill check",outcomeCheckBadge:"Outcome check",assessmentCourseMeta:"Course · Question set only",addAssessmentSlotButton:"Add {label} — a course with only a question set",requiredSlotBadge:"Required",removeAssessmentSlotButton:"Remove",addCourseToLevelButton:"Add a course from the Library",addLevelExamButton:"Add Level Exam — a course with only a question set",levelExamMeta:"Level Exam · Question set only",deletePriorAssessmentConfirm:"Deleting the Prior Assessment removes the score this path's Adaptive skips are based on. Continue?",deleteAssessmentSlotConfirm:"Remove this assessment course from the path?",deleteLevelExamConfirm:"Remove this Level Exam course from the level?",deleteLevelConfirm:'Delete "{name}" and everything in it?',deleteCourseConfirm:"Remove this course from the path?",deleteMultipleConfirm:"Delete {count} selected items from the path?",courseNameUnavailable:"Course details unavailable",notAssessmentCourseToast:`"{name}" isn't an Evaluation Course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",levelExamAlreadyFilledToast:"This level already has a Level Exam course — remove it before adding a different one.",assessmentCheckFailedToast:"Could not verify this course. Please try again.",skillsHeading:"Skills this level builds",skillsCoveredHeading:"Skills learners earn from this path",skillsCoveredDescription:"Learners get these skills when they finish the path. Made up of the skills taught by the courses on each level, plus the Prior and Outcome Assessments.",noSkillsYet:"No skills yet — add courses tagged with skills to the levels to see them here.",levelCountLabel:"{count} level",levelCountLabelPlural:"{count} levels",courseCountLabel:"{count} course",courseCountLabelPlural:"{count} courses",backToPathButton:"Back to path",backToLevelButton:"Back to {label}",courseDetailsLoading:"Loading course details…",courseDetailsEmpty:"This course has no units yet.",courseDetailsError:"Could not load course details.",courseDetailsCardTitle:"Course details",courseTitleFieldLabel:"Title",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"No description available.",unitsSectionLabel:"Units",unitsSectionDescription:"Units group related content; each content item is tagged with the skills it builds.",unitTopicsFieldLabel:"Topics",contentCountLabel:"{count} content",contentCountLabelPlural:"{count} contents",courseUnitTopicsLabel:"{count} topic",courseUnitTopicsLabelPlural:"{count} topics",verifyingAssessmentCourses:"Verifying assessment courses…",resolveBeforePublishing:"Resolve these before publishing:",resolveBeforeSendingForReview:"Resolve these before sending for review:",assessmentsCardHeading:"Prior & outcome assessments",assessmentsCardDescription:"Add the question-set-only courses that open and close this path.",assessmentNotAddedYet:"Not added yet — pick a question-set-only course from the Library.",viewCourseMenuItem:"View",priorAssessmentExplainerTitle:"Why this can't be skipped",priorAssessmentExplainerBody:"This question set's score is what every level reads to decide a skip — there's nothing to compare against yet, so it always runs in full.",priorAssessmentPurposeLabel:"Sets the skill baseline",outcomeAssessmentExplainerTitle:"Closes the path",outcomeAssessmentExplainerBody:"Passing this question set is what certifies the skill gain for the whole path — its score is what appears on the learner's certificate.",outcomeUnlocksHint:"Unlocks after the last level",assessmentCourseSectionTitle:"Course",assessmentCourseSectionDescription:"A single Evaluation Course — its content can only be Question Sets or Course Assessment, never other content types.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",libraryAddLevelExamCourse:"Add Level Exam course for {level}",policyStrictLabel:"Strict",policyStrictDescription:"Every learner completes every level, in order — regardless of prior assessment score.",policyAdaptiveLabel:"Adaptive",policyAdaptiveDescriptionPre:"A level can be skipped, but only when the learner's score on the Prior Assessment",policyAdaptiveDescriptionPost:" clears its waiver threshold.",policyPriorLearningLabel:"Prior learning",policyPriorLearningDescription:"Skips can also draw on skills the learner already holds — a verified certificate or prior course — not the assessment alone.",selectLevelFirstToast:"Select a level first",selectLevelFromOutlineToast:"Open a level in the path structure to add courses — courses cannot be added to the path itself or under another course.",selectCurriculumFirstToast:"Select a Curriculum or a skill framework for this path before adding courses.",noCurriculumEmptyTitle:"No Curriculum or skill framework selected",noCurriculumEmptyHint:"Select a Curriculum or a skill framework for this path to browse courses.",itemAlreadyInPathToast:'"{name}" is already in this learning path',addedToLevelSuccess:'Added "{name}" to level',dropOntoLevelError:"Drop onto a level to add a course",dropOntoPathError:"Drop courses onto a level, not directly on the learning path.",priorSlotFilledToast:"The Prior Assessment already has a course — remove it before adding a different one.",outcomeSlotFilledToast:"The Outcome Assessment already has a course — remove it before adding a different one.",levelNeedsMixedContentToast:"This level is first or last in the path — a question-set-only course as its only content will be treated as a Prior/Outcome Assessment. Add another course, or one with more than just question sets.",cannotRemoveLastRegularCourseToast:"This level is first or last in the path — removing this course would leave only the Level Exam course, and it would be treated as a Prior/Outcome Assessment. Add another course first.",coursesRemovedFrameworkChangeToast:"{count} course(s) tagged to a different curriculum were removed from this path.",levelSkillsResetFrameworkChangeToast:"{count} Level(s) had their selected skills cleared — they don't apply to the new curriculum.",priorAssessmentNarrowedScopeToast:"The Prior Assessment narrowed the skill scope — {count} Level(s) now have skills outside it.",coursesCardHeading:"Courses",coursesCardDescription:"Courses a learner completes to clear this level. Drag the handle to reorder, use the menu to remove.",coursesEmptyHint:"No courses yet.",courseMetaLabel:"Course",removeFromLevelMenuItem:"Remove from level",courseNotTeachingRoleBadge:"Teaches skills outside this role",roleChangedCoursesFlaggedToast:"{count} course(s) teach skills outside the new role. They're kept and flagged — remove them before sending for review.",priorAssessmentMissingRoleSkills:"The Prior Assessment doesn't test these role skills: {skills}",skillFrameworkChangedToast:"Skill framework changed: the target role and the path's skills were cleared.",roleSkillsCoveredDescription:"The target role's skills. Learners get them when they finish the path. Every one must be taught by a course before the path can be sent for review.",roleSkillNotTaughtSuffix:"not taught yet",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"No course in this path teaches this skill yet",roleSkillTaughtTitle:"A course in this path teaches this skill",levelSkillsFromCoursesNote:"Worked out from the courses in this level. Add or remove courses to change them.",levelSkillsEmpty:"No skills yet — add a course to this level.",levelSkillsOutsidePrior:"These skills aren't tested by the Prior Assessment: {skills}. Remove the course that teaches them."}},vC={contextualEditor:{emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},languageSelector:{ariaLabel:"اختيار اللغة"},collectionEditor:{errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},breadcrumb:{nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},tabBar:{detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},contentEditForm:{moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},titleAppIcon:{selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},unitContentList:{removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},contentRow:{dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},csvUpload:{invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},manageCollaborators:{saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},sparkMetaForm:{shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب.",skillFramework:"إطار المهارات",selectSkillFramework:"اختر إطار مهارات",skills:"المهارات",selectSkills:"اختر المهارات",targetRole:"الدور المستهدف (اختياري)",noTargetRole:"بدون دور مستهدف"},appIconField:{requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},appIconPickerModal:{dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},chipGroupField:{addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},dateTimeField:{requiredError:"{field} مطلوب"},dialcodeInputField:{requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},keywordSuggestField:{requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},licenseSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},multiSelectField:{requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات",searchPlaceholder:"بحث…",noMatchesMessage:"لا توجد نتائج"},nestedSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},radioField:{requiredError:"{field} مطلوب"},selectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات",searchPlaceholder:"بحث…",noMatchesMessage:"لا توجد نتائج"},textField:{requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},assetBrowser:{dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},resourceReorderDialog:{dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},assignPageNumber:{dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},confirmDialog:{title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},publishChecklist:{publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",selectAllLabel:"تحديد الكل",noButton:"لا",yesButton:"نعم"},qualityParamsModal:{reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},unsavedChangesModal:{title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},filterChips:{contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},libraryCard:{alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط",moreSkills:"+{count} أخرى"},libraryDock:{selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",cancelTargetAriaLabel:"إلغاء — العودة إلى التصفح",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا",noSkillMatchTitle:"لا يوجد محتوى يُدرّس مهارات هذه الدورة بعد",noSkillMatchHint:"يظهر المحتوى هنا عندما يُوسم بمهارات هذه الدورة فقط. وكل ما عدا ذلك موجود ضمن محتوى آخر.",matchingHeading:"يُدرّس مهارات هذه الدورة",otherContentHeading:"محتوى آخر ({count})",otherContentHint:"هذا المحتوى يُدرّس مهارات خارج هذه الدورة، أو لا يُدرّس أي مهارة. لا يزال بإمكانك إضافته.",pickSkillsHint:"اختر مهارات هذه الدورة لترى أولًا المحتوى الذي يُدرّسها."},libraryFilterPanel:{boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},libraryPreviewPanel:{contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},outlineTree:{maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},treeNode:{expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},contentPlayer:{mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},dialcodePanel:{title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},progressStatus:{unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},splitBuilderShell:{dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},topbar:{draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},reviewCommentModal:{closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},confirmReviewModal:{closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},generateQRModal:{closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},chip:{remove:"إزالة"},dropZone:{dropHere:"أفلت هنا"},spinner:{loading:"جارٍ التحميل"},learningPath:{profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",addCourseToLevelButton:"أضف دورة من المكتبة",addLevelExamButton:"إضافة اختبار المستوى — مقرر يحتوي على بنك أسئلة فقط",levelExamMeta:"اختبار المستوى · بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelExamConfirm:"هل تريد إزالة مقرر اختبار المستوى هذا من المستوى؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقرر تقييم (Evaluation Course)، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",levelExamAlreadyFilledToast:"يحتوي هذا المستوى بالفعل على مقرر اختبار المستوى — أزِله قبل إضافة مقرر آخر.",assessmentCheckFailedToast:"تعذر التحقق من هذا المقرر. حاول مرة أخرى.",skillsHeading:"المهارات التي يبنيها هذا المستوى",skillsCoveredHeading:"المهارات التي يكتسبها المتعلمون من هذا المسار",skillsCoveredDescription:"يحصل المتعلمون على هذه المهارات عند إنهاء المسار. وتتكون من المهارات التي تُدرّسها الدورات في كل مستوى، إضافة إلى التقييم القبلي والتقييم الختامي.",noSkillsYet:"لا توجد مهارات بعد — أضف إلى المستويات دورات موسومة بمهارات لتظهر هنا.",levelCountLabel:"{count} مستوى",levelCountLabelPlural:"{count} مستويات",courseCountLabel:"{count} مقرر",courseCountLabelPlural:"{count} مقررات",backToPathButton:"العودة إلى المسار",backToLevelButton:"العودة إلى {label}",courseDetailsLoading:"جارٍ تحميل تفاصيل المقرر…",courseDetailsEmpty:"لا يحتوي هذا المقرر على وحدات بعد.",courseDetailsError:"تعذر تحميل تفاصيل المقرر.",courseDetailsCardTitle:"تفاصيل المقرر",courseTitleFieldLabel:"العنوان",courseDescriptionFieldLabel:"الوصف",noCourseDescriptionPlaceholder:"لا يتوفر وصف.",unitsSectionLabel:"الوحدات",unitsSectionDescription:"تجمع الوحدات المحتوى المرتبط؛ كل عنصر محتوى موسوم بالمهارات التي يبنيها.",unitTopicsFieldLabel:"المواضيع",contentCountLabel:"{count} عنصر محتوى",contentCountLabelPlural:"{count} عناصر محتوى",courseUnitTopicsLabel:"{count} موضوع",courseUnitTopicsLabelPlural:"{count} مواضيع",verifyingAssessmentCourses:"جارٍ التحقق من مقررات التقييم…",resolveBeforePublishing:"حل هذه النقاط قبل النشر:",resolveBeforeSendingForReview:"حل هذه النقاط قبل الإرسال للمراجعة:",assessmentsCardHeading:"التقييم المسبق وتقييم النتائج",assessmentsCardDescription:"أضف المقررات التي تحتوي على بنك أسئلة فقط والتي تفتح وتغلق هذا المسار.",assessmentNotAddedYet:"لم تتم إضافته بعد — اختر مقررًا يحتوي على بنك أسئلة فقط من المكتبة.",viewCourseMenuItem:"عرض",priorAssessmentExplainerTitle:"لماذا لا يمكن تخطي هذا",priorAssessmentExplainerBody:"درجة بنك الأسئلة هذا هي ما يعتمد عليه كل مستوى لتحديد التخطي — ولا يوجد حتى الآن ما يُقارن به، لذا يُنفَّذ بالكامل دائمًا.",priorAssessmentPurposeLabel:"يحدد خط أساس المهارة",outcomeAssessmentExplainerTitle:"يُغلق المسار",outcomeAssessmentExplainerBody:"النجاح في بنك الأسئلة هذا هو ما يُصادق على اكتساب المهارة للمسار بأكمله — ودرجته هي ما تظهر في شهادة المتعلم.",outcomeUnlocksHint:"يُفتح بعد المستوى الأخير",assessmentCourseSectionTitle:"المقرر",assessmentCourseSectionDescription:"مقرر تقييم واحد (Evaluation Course) — لا يمكن أن يكون محتواه سوى بنوك أسئلة أو تقييم مقرر، وليس أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",libraryAddLevelExamCourse:"إضافة مقرر اختبار المستوى لـ {level}",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) أو إطار المهارات لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج أو إطار مهارات",noCurriculumEmptyHint:"حدد المنهج (Curriculum) أو إطار المهارات لهذا المسار لاستعراض المقررات.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",levelNeedsMixedContentToast:"هذا المستوى هو الأول أو الأخير في المسار — مقرر يحتوي فقط على بنك أسئلة كمحتوى وحيد له سيُعامل كتقييم مسبق/ختامي. أضف مقررًا آخر، أو مقررًا يحتوي على أكثر من بنك الأسئلة فقط.",cannotRemoveLastRegularCourseToast:"هذا المستوى هو الأول أو الأخير في المسار — إزالة هذا المقرر ستترك فقط مقرر اختبار المستوى، وسيتم التعامل معه كتقييم مسبق/ختامي. أضف مقررًا آخر أولاً.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق.",coursesCardHeading:"المقررات",coursesCardDescription:"الدورات التي يُكملها المتعلم لاجتياز هذا المستوى. اسحب المقبض لإعادة الترتيب، واستخدم القائمة للإزالة.",coursesEmptyHint:"لا توجد دورات بعد.",courseMetaLabel:"مقرر",removeFromLevelMenuItem:"إزالة من المستوى",courseNotTeachingRoleBadge:"تُدرّس مهارات خارج هذا الدور",roleChangedCoursesFlaggedToast:"{count} دورة تُدرّس مهارات خارج الدور الجديد. تم الاحتفاظ بها ووضع علامة عليها — أزلها قبل الإرسال للمراجعة.",priorAssessmentMissingRoleSkills:"التقييم المسبق لا يختبر مهارات الدور هذه: {skills}",skillFrameworkChangedToast:"تم تغيير إطار المهارات: تم مسح الدور المستهدف ومهارات المسار.",roleSkillsCoveredDescription:"مهارات الدور المستهدف. يحصل عليها المتعلمون عند إنهاء المسار. يجب أن تُدرَّس كل مهارة منها في دورة قبل إرسال المسار للمراجعة.",roleSkillNotTaughtSuffix:"لم تُدرَّس بعد",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"لا توجد دورة في هذا المسار تُدرّس هذه المهارة بعد",roleSkillTaughtTitle:"توجد دورة في هذا المسار تُدرّس هذه المهارة",levelSkillsFromCoursesNote:"مستخرجة من الدورات في هذا المستوى. أضف دورات أو أزلها لتغييرها.",levelSkillsEmpty:"لا توجد مهارات بعد — أضف دورة إلى هذا المستوى.",levelSkillsOutsidePrior:"هذه المهارات لا يقيّمها التقييم القبلي: {skills}. أزل الدورة التي تُدرّسها."}},yC={contextualEditor:{emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},languageSelector:{ariaLabel:"Sélectionner la langue"},collectionEditor:{errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},breadcrumb:{nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},tabBar:{detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},contentEditForm:{moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},titleAppIcon:{selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},unitContentList:{removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},contentRow:{dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},csvUpload:{invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},manageCollaborators:{saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},sparkMetaForm:{shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet.",skillFramework:"Cadre de compétences",selectSkillFramework:"Sélectionnez un cadre de compétences",skills:"Compétences",selectSkills:"Sélectionnez des compétences",targetRole:"Rôle cible (facultatif)",noTargetRole:"Aucun rôle cible"},appIconField:{requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},appIconPickerModal:{dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},chipGroupField:{addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},dateTimeField:{requiredError:"{field} est requis"},dialcodeInputField:{requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},keywordSuggestField:{requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},licenseSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},multiSelectField:{requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option",searchPlaceholder:"Rechercher…",noMatchesMessage:"Aucun résultat"},nestedSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},radioField:{requiredError:"{field} est requis"},selectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option",searchPlaceholder:"Rechercher…",noMatchesMessage:"Aucun résultat"},textField:{requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},assetBrowser:{dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},resourceReorderDialog:{dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},assignPageNumber:{dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},confirmDialog:{title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},publishChecklist:{publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",selectAllLabel:"Tout sélectionner",noButton:"Non",yesButton:"Oui"},qualityParamsModal:{reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},unsavedChangesModal:{title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},filterChips:{contentTypeFiltersAriaLabel:"Filtres par type de contenu"},libraryCard:{alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté",moreSkills:"+{count} de plus"},libraryDock:{selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",cancelTargetAriaLabel:"Annuler — revenir à la navigation",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre",noSkillMatchTitle:"Aucun contenu n'enseigne encore les compétences de ce cours",noSkillMatchHint:"Un contenu apparaît ici dès qu'il est associé uniquement aux compétences de ce cours. Tout le reste se trouve dans Autres contenus.",matchingHeading:"Enseigne les compétences de ce cours",otherContentHeading:"Autres contenus ({count})",otherContentHint:"Ces contenus enseignent des compétences hors de ce cours, ou aucune. Vous pouvez quand même les ajouter.",pickSkillsHint:"Choisissez les compétences de ce cours pour voir d'abord les contenus qui les enseignent."},libraryFilterPanel:{boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},libraryPreviewPanel:{contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},outlineTree:{maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},treeNode:{expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},contentPlayer:{mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},dialcodePanel:{title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},progressStatus:{unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},splitBuilderShell:{dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},topbar:{draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},reviewCommentModal:{closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},confirmReviewModal:{closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},generateQRModal:{closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},chip:{remove:"Supprimer"},dropZone:{dropHere:"Déposer ici"},spinner:{loading:"Chargement"},learningPath:{profileBadgeLabel:"Parcours d'apprentissage",pathStructureLabel:"Structure du parcours",addLevelButton:"Ajouter un niveau",levelNumberPrefix:"Niveau {n}",priorAssessmentLabel:"Évaluation préalable",priorAssessmentHint:"Toujours requise · ne compte pas comme un niveau",outcomeAssessmentLabel:"Évaluation finale",outcomeAssessmentHint:"Confirme le résultat · ne compte pas comme un niveau",skillCheckBadge:"Vérification des compétences",outcomeCheckBadge:"Vérification du résultat",assessmentCourseMeta:"Cours · Questionnaire uniquement",addAssessmentSlotButton:"Ajouter {label} — un cours contenant uniquement un questionnaire",addCourseToLevelButton:"Ajouter un cours depuis la bibliothèque",addLevelExamButton:"Ajouter l'examen de niveau — un cours contenant uniquement un questionnaire",levelExamMeta:"Examen de niveau · Questionnaire uniquement",requiredSlotBadge:"Obligatoire",removeAssessmentSlotButton:"Retirer",deletePriorAssessmentConfirm:"Supprimer l'évaluation préalable retire le score sur lequel se basent les sauts adaptatifs de ce parcours. Continuer ?",deleteAssessmentSlotConfirm:"Retirer ce cours d'évaluation du parcours ?",deleteLevelExamConfirm:"Retirer ce cours d'examen de niveau du niveau ?",deleteLevelConfirm:"Supprimer « {name} » et tout son contenu ?",deleteCourseConfirm:"Retirer ce cours du parcours ?",deleteMultipleConfirm:"Supprimer les {count} éléments sélectionnés du parcours ?",courseNameUnavailable:"Détails du cours indisponibles",notAssessmentCourseToast:"« {name} » n'est pas un Cours d'évaluation, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",levelExamAlreadyFilledToast:"Ce niveau a déjà un cours d'examen de niveau — retirez-le avant d'en ajouter un autre.",assessmentCheckFailedToast:"Impossible de vérifier ce cours. Veuillez réessayer.",skillsHeading:"Compétences développées dans ce niveau",skillsCoveredHeading:"Compétences acquises avec ce parcours",skillsCoveredDescription:"Les apprenants obtiennent ces compétences en terminant le parcours. Elles regroupent les compétences enseignées par les cours de chaque niveau, ainsi que l'évaluation préalable et l'évaluation finale.",noSkillsYet:"Aucune compétence pour l'instant — ajoutez aux niveaux des cours associés à des compétences pour les voir ici.",levelCountLabel:"{count} niveau",levelCountLabelPlural:"{count} niveaux",courseCountLabel:"{count} cours",courseCountLabelPlural:"{count} cours",backToPathButton:"Retour au parcours",backToLevelButton:"Retour à {label}",courseDetailsLoading:"Chargement des détails du cours…",courseDetailsEmpty:"Ce cours ne contient pas encore d'unités.",courseDetailsError:"Impossible de charger les détails du cours.",courseDetailsCardTitle:"Détails du cours",courseTitleFieldLabel:"Titre",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"Aucune description disponible.",unitsSectionLabel:"Unités",unitsSectionDescription:"Les unités regroupent le contenu associé ; chaque contenu est associé aux compétences qu'il développe.",unitTopicsFieldLabel:"Sujets",contentCountLabel:"{count} contenu",contentCountLabelPlural:"{count} contenus",courseUnitTopicsLabel:"{count} sujet",courseUnitTopicsLabelPlural:"{count} sujets",verifyingAssessmentCourses:"Vérification des cours d'évaluation…",resolveBeforePublishing:"Résolvez les points suivants avant de publier :",resolveBeforeSendingForReview:"Résolvez les points suivants avant d'envoyer pour révision :",assessmentsCardHeading:"Évaluations préalable et finale",assessmentsCardDescription:"Ajoutez les cours composés uniquement d'un questionnaire qui ouvrent et ferment ce parcours.",assessmentNotAddedYet:"Pas encore ajouté — choisissez un cours composé uniquement d'un questionnaire dans la bibliothèque.",viewCourseMenuItem:"Voir",priorAssessmentExplainerTitle:"Pourquoi cela ne peut pas être ignoré",priorAssessmentExplainerBody:"Le score de ce questionnaire est ce que chaque niveau utilise pour décider d'un saut — il n'y a encore rien à comparer, donc il s'exécute toujours en entier.",priorAssessmentPurposeLabel:"Établit la base de compétences",outcomeAssessmentExplainerTitle:"Termine le parcours",outcomeAssessmentExplainerBody:"Réussir ce questionnaire certifie l'acquisition de la compétence pour l'ensemble du parcours — son score est celui qui apparaît sur le certificat de l'apprenant.",outcomeUnlocksHint:"Se débloque après le dernier niveau",assessmentCourseSectionTitle:"Cours",assessmentCourseSectionDescription:"Un seul Cours d'évaluation — son contenu ne peut être que des questionnaires ou une Évaluation de cours, jamais d'autres types de contenu.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",libraryAddLevelExamCourse:"Ajouter le cours d'examen de niveau pour {level}",policyStrictLabel:"Strict",policyStrictDescription:"Chaque apprenant termine chaque niveau, dans l'ordre — quel que soit le score de l'évaluation préalable.",policyAdaptiveLabel:"Adaptatif",policyAdaptiveDescriptionPre:"Un niveau peut être ignoré, mais seulement si le score de l'apprenant à l'Évaluation préalable",policyAdaptiveDescriptionPost:" dépasse le seuil de dispense.",policyPriorLearningLabel:"Acquis antérieurs",policyPriorLearningDescription:"Les sauts peuvent aussi s'appuyer sur des compétences déjà détenues par l'apprenant — un certificat vérifié ou un cours antérieur — pas seulement l'évaluation.",selectLevelFirstToast:"Sélectionnez d'abord un niveau",selectLevelFromOutlineToast:"Ouvrez un niveau dans la structure du parcours pour ajouter des cours — les cours ne peuvent pas être ajoutés au parcours lui-même ni sous un autre cours.",selectCurriculumFirstToast:"Sélectionnez un programme (Curriculum) ou un cadre de compétences pour ce parcours avant d'ajouter des cours.",noCurriculumEmptyTitle:"Aucun programme ni cadre de compétences sélectionné",noCurriculumEmptyHint:"Sélectionnez un programme (Curriculum) ou un cadre de compétences pour ce parcours afin de parcourir les cours.",itemAlreadyInPathToast:"« {name} » fait déjà partie de ce parcours d'apprentissage",addedToLevelSuccess:"« {name} » ajouté au niveau",dropOntoLevelError:"Déposez sur un niveau pour ajouter un cours",dropOntoPathError:"Déposez les cours sur un niveau, pas directement sur le parcours d'apprentissage.",priorSlotFilledToast:"L'Évaluation préalable contient déjà un cours — retirez-le avant d'en ajouter un autre.",outcomeSlotFilledToast:"L'Évaluation finale contient déjà un cours — retirez-le avant d'en ajouter un autre.",levelNeedsMixedContentToast:"Ce niveau est premier ou dernier dans le parcours — un cours composé uniquement de bancs de questions comme seul contenu sera traité comme une évaluation préalable/finale. Ajoutez un autre cours, ou un cours contenant plus que des bancs de questions.",cannotRemoveLastRegularCourseToast:"Ce niveau est premier ou dernier dans le parcours — retirer ce cours ne laisserait que le cours d'examen de niveau, qui serait alors traité comme une évaluation préalable/finale. Ajoutez d'abord un autre cours.",coursesRemovedFrameworkChangeToast:"{count} cours associé(s) à un autre curriculum ont été retirés de ce parcours.",levelSkillsResetFrameworkChangeToast:"{count} niveau(x) ont eu leurs compétences sélectionnées effacées — elles ne s'appliquent pas au nouveau curriculum.",priorAssessmentNarrowedScopeToast:"L'évaluation préalable a réduit le périmètre des compétences — {count} niveau(x) ont désormais des compétences hors de ce périmètre.",coursesCardHeading:"Cours",coursesCardDescription:"Cours qu'un apprenant termine pour valider ce niveau. Faites glisser la poignée pour réordonner, utilisez le menu pour retirer.",coursesEmptyHint:"Aucun cours pour l'instant.",courseMetaLabel:"Cours",removeFromLevelMenuItem:"Retirer du niveau",courseNotTeachingRoleBadge:"Enseigne des compétences hors de ce rôle",roleChangedCoursesFlaggedToast:"{count} cours enseignent des compétences hors du nouveau rôle. Ils sont conservés et signalés — retirez-les avant de soumettre à révision.",priorAssessmentMissingRoleSkills:"L'évaluation préalable ne teste pas ces compétences du rôle : {skills}",skillFrameworkChangedToast:"Cadre de compétences modifié : le rôle cible et les compétences du parcours ont été effacés.",roleSkillsCoveredDescription:"Les compétences du rôle cible. Les apprenants les obtiennent en terminant le parcours. Chacune doit être enseignée par un cours avant que le parcours puisse être soumis à révision.",roleSkillNotTaughtSuffix:"pas encore enseignée",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"Aucun cours de ce parcours n'enseigne encore cette compétence",roleSkillTaughtTitle:"Un cours de ce parcours enseigne cette compétence",levelSkillsFromCoursesNote:"Déduites des cours de ce niveau. Ajoutez ou retirez des cours pour les modifier.",levelSkillsEmpty:"Aucune compétence pour l'instant — ajoutez un cours à ce niveau.",levelSkillsOutsidePrior:"Ces compétences ne sont pas évaluées par l'évaluation préalable : {skills}. Retirez le cours qui les enseigne."}},bC={contextualEditor:{emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},languageSelector:{ariaLabel:"Selecionar idioma"},collectionEditor:{errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},breadcrumb:{nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},tabBar:{detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},contentEditForm:{moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},titleAppIcon:{selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},unitContentList:{removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},contentRow:{dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},csvUpload:{invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},manageCollaborators:{saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},sparkMetaForm:{shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba.",skillFramework:"Estrutura de habilidades",selectSkillFramework:"Selecione uma estrutura de habilidades",skills:"Habilidades",selectSkills:"Selecione habilidades",targetRole:"Função-alvo (opcional)",noTargetRole:"Nenhuma função-alvo"},appIconField:{requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},appIconPickerModal:{dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},chipGroupField:{addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},dateTimeField:{requiredError:"{field} é obrigatório"},dialcodeInputField:{requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},keywordSuggestField:{requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},licenseSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},multiSelectField:{requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções",searchPlaceholder:"Pesquisar…",noMatchesMessage:"Nenhum resultado"},nestedSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},radioField:{requiredError:"{field} é obrigatório"},selectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções",searchPlaceholder:"Pesquisar…",noMatchesMessage:"Nenhum resultado"},textField:{requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},assetBrowser:{dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},resourceReorderDialog:{dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},assignPageNumber:{dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},confirmDialog:{title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},publishChecklist:{publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",selectAllLabel:"Selecionar tudo",noButton:"Não",yesButton:"Sim"},qualityParamsModal:{reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},unsavedChangesModal:{title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},filterChips:{contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},libraryCard:{alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado",moreSkills:"+{count} mais"},libraryDock:{selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",cancelTargetAriaLabel:"Cancelar — voltar à navegação",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente",noSkillMatchTitle:"Ainda não há conteúdo que ensine as habilidades deste curso",noSkillMatchHint:"O conteúdo aparece aqui quando é marcado apenas com as habilidades deste curso. Todo o resto está em Outros conteúdos.",matchingHeading:"Ensina as habilidades deste curso",otherContentHeading:"Outros conteúdos ({count})",otherContentHint:"Estes ensinam habilidades fora deste curso, ou nenhuma. Você ainda pode adicioná-los.",pickSkillsHint:"Escolha as habilidades deste curso para ver primeiro o conteúdo que as ensina."},libraryFilterPanel:{boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},libraryPreviewPanel:{contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},outlineTree:{maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},treeNode:{expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},contentPlayer:{mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},dialcodePanel:{title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},progressStatus:{unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},splitBuilderShell:{dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},topbar:{draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},reviewCommentModal:{closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},confirmReviewModal:{closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},generateQRModal:{closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},chip:{remove:"Remover"},dropZone:{dropHere:"Solte aqui"},spinner:{loading:"Carregando"},learningPath:{profileBadgeLabel:"Trilha de Aprendizagem",pathStructureLabel:"Estrutura da trilha",addLevelButton:"Adicionar nível",levelNumberPrefix:"Nível {n}",priorAssessmentLabel:"Avaliação prévia",priorAssessmentHint:"Sempre obrigatória · não conta como um nível",outcomeAssessmentLabel:"Avaliação de resultado",outcomeAssessmentHint:"Confirma o resultado · não conta como um nível",skillCheckBadge:"Verificação de habilidade",outcomeCheckBadge:"Verificação de resultado",assessmentCourseMeta:"Curso · Apenas banco de questões",addAssessmentSlotButton:"Adicionar {label} — um curso com apenas um banco de questões",addCourseToLevelButton:"Adicionar um curso da Biblioteca",addLevelExamButton:"Adicionar Exame de nível — um curso com apenas um banco de questões",levelExamMeta:"Exame de nível · Apenas banco de questões",requiredSlotBadge:"Obrigatório",removeAssessmentSlotButton:"Remover",deletePriorAssessmentConfirm:"Excluir a Avaliação prévia remove a pontuação usada pelos avanços adaptativos deste percurso. Continuar?",deleteAssessmentSlotConfirm:"Remover este curso de avaliação do percurso?",deleteLevelExamConfirm:"Remover este curso de Exame de nível do nível?",deleteLevelConfirm:'Excluir "{name}" e tudo o que ele contém?',deleteCourseConfirm:"Remover este curso do percurso?",deleteMultipleConfirm:"Excluir os {count} itens selecionados do percurso?",courseNameUnavailable:"Detalhes do curso indisponíveis",notAssessmentCourseToast:'"{name}" não é um Curso de Avaliação, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",levelExamAlreadyFilledToast:"Este nível já tem um curso de Exame de nível — remova-o antes de adicionar outro.",assessmentCheckFailedToast:"Não foi possível verificar este curso. Tente novamente.",skillsHeading:"Habilidades desenvolvidas neste nível",skillsCoveredHeading:"Habilidades obtidas com esta trilha",skillsCoveredDescription:"Os alunos obtêm essas habilidades ao concluir a trilha. Reúne as habilidades ensinadas pelos cursos de cada nível, mais a Avaliação Prévia e a Avaliação Final.",noSkillsYet:"Nenhuma habilidade ainda — adicione aos níveis cursos marcados com habilidades para vê-las aqui.",levelCountLabel:"{count} nível",levelCountLabelPlural:"{count} níveis",courseCountLabel:"{count} curso",courseCountLabelPlural:"{count} cursos",backToPathButton:"Voltar ao percurso",backToLevelButton:"Voltar a {label}",courseDetailsLoading:"Carregando detalhes do curso…",courseDetailsEmpty:"Este curso ainda não tem unidades.",courseDetailsError:"Não foi possível carregar os detalhes do curso.",courseDetailsCardTitle:"Detalhes do curso",courseTitleFieldLabel:"Título",courseDescriptionFieldLabel:"Descrição",noCourseDescriptionPlaceholder:"Nenhuma descrição disponível.",unitsSectionLabel:"Unidades",unitsSectionDescription:"As unidades agrupam conteúdo relacionado; cada item de conteúdo é marcado com as habilidades que desenvolve.",unitTopicsFieldLabel:"Tópicos",contentCountLabel:"{count} conteúdo",contentCountLabelPlural:"{count} conteúdos",courseUnitTopicsLabel:"{count} tópico",courseUnitTopicsLabelPlural:"{count} tópicos",verifyingAssessmentCourses:"Verificando cursos de avaliação…",resolveBeforePublishing:"Resolva os itens abaixo antes de publicar:",resolveBeforeSendingForReview:"Resolva os itens abaixo antes de enviar para revisão:",assessmentsCardHeading:"Avaliações prévia e de resultado",assessmentsCardDescription:"Adicione os cursos compostos apenas por banco de questões que abrem e encerram este percurso.",assessmentNotAddedYet:"Ainda não adicionado — escolha um curso composto apenas por banco de questões na Biblioteca.",viewCourseMenuItem:"Ver",priorAssessmentExplainerTitle:"Por que isso não pode ser pulado",priorAssessmentExplainerBody:"A pontuação deste banco de questões é o que cada nível usa para decidir um avanço — ainda não há nada para comparar, então ele sempre é executado por completo.",priorAssessmentPurposeLabel:"Define a linha de base de habilidades",outcomeAssessmentExplainerTitle:"Encerra o percurso",outcomeAssessmentExplainerBody:"Passar neste banco de questões certifica o ganho de habilidade de todo o percurso — sua pontuação é o que aparece no certificado do aprendiz.",outcomeUnlocksHint:"Desbloqueia após o último nível",assessmentCourseSectionTitle:"Curso",assessmentCourseSectionDescription:"Um único Curso de Avaliação — seu conteúdo só pode ser Bancos de Questões ou Avaliação de Curso, nunca outros tipos de conteúdo.",libraryOpenLevelToAdd:"Abra um nível para adicionar",libraryAddToLevel:"Adicionar a {level}",libraryAddPriorAssessmentCourse:"Adicionar curso de Avaliação prévia",libraryAddOutcomeAssessmentCourse:"Adicionar curso de Avaliação de resultado",libraryAddLevelExamCourse:"Adicionar curso de Exame de nível para {level}",policyStrictLabel:"Estrita",policyStrictDescription:"Todo aprendiz completa todos os níveis, em ordem — independentemente da pontuação da avaliação prévia.",policyAdaptiveLabel:"Adaptativa",policyAdaptiveDescriptionPre:"Um nível pode ser pulado, mas somente quando a pontuação do aprendiz na Avaliação prévia",policyAdaptiveDescriptionPost:" atinge o limite de dispensa.",policyPriorLearningLabel:"Aprendizagem prévia",policyPriorLearningDescription:"Os avanços também podem se basear em habilidades que o aprendiz já possui — um certificado verificado ou curso anterior — não apenas na avaliação.",selectLevelFirstToast:"Selecione um nível primeiro",selectLevelFromOutlineToast:"Abra um nível na estrutura da trilha para adicionar cursos — cursos não podem ser adicionados à própria trilha nem dentro de outro curso.",selectCurriculumFirstToast:"Selecione um Currículo ou uma estrutura de habilidades para esta trilha antes de adicionar cursos.",noCurriculumEmptyTitle:"Nenhum Currículo ou estrutura de habilidades selecionado",noCurriculumEmptyHint:"Selecione um Currículo ou uma estrutura de habilidades para esta trilha para navegar pelos cursos.",itemAlreadyInPathToast:'"{name}" já está nesta trilha de aprendizagem',addedToLevelSuccess:'"{name}" adicionado ao nível',dropOntoLevelError:"Solte sobre um nível para adicionar um curso",dropOntoPathError:"Solte os cursos sobre um nível, não diretamente na trilha de aprendizagem.",priorSlotFilledToast:"A Avaliação prévia já tem um curso — remova-o antes de adicionar outro.",outcomeSlotFilledToast:"A Avaliação final já tem um curso — remova-o antes de adicionar outro.",levelNeedsMixedContentToast:"Este nível é o primeiro ou o último no percurso — um curso composto apenas por bancos de questões como único conteúdo será tratado como uma Avaliação prévia/final. Adicione outro curso, ou um curso com mais do que apenas bancos de questões.",cannotRemoveLastRegularCourseToast:"Este nível é o primeiro ou o último no percurso — remover este curso deixaria apenas o curso de Exame de Nível, que seria tratado como uma Avaliação prévia/final. Adicione outro curso primeiro.",coursesRemovedFrameworkChangeToast:"{count} curso(s) vinculados a outro currículo foram removidos desta trilha.",levelSkillsResetFrameworkChangeToast:"{count} nível(is) tiveram as habilidades selecionadas apagadas — elas não se aplicam ao novo currículo.",priorAssessmentNarrowedScopeToast:"A Avaliação prévia reduziu o escopo de habilidades — {count} nível(is) agora têm habilidades fora dele.",coursesCardHeading:"Cursos",coursesCardDescription:"Cursos que o aluno conclui para passar deste nível. Arraste a alça para reordenar e use o menu para remover.",coursesEmptyHint:"Nenhum curso ainda.",courseMetaLabel:"Curso",removeFromLevelMenuItem:"Remover do nível",courseNotTeachingRoleBadge:"Ensina habilidades fora desta função",roleChangedCoursesFlaggedToast:"{count} curso(s) ensinam habilidades fora da nova função. Eles foram mantidos e sinalizados — remova-os antes de enviar para revisão.",priorAssessmentMissingRoleSkills:"A Avaliação prévia não testa estas habilidades da função: {skills}",skillFrameworkChangedToast:"Estrutura de habilidades alterada: a função-alvo e as habilidades da trilha foram limpas.",roleSkillsCoveredDescription:"As habilidades da função-alvo. Os alunos as obtêm ao concluir a trilha. Cada uma deve ser ensinada por um curso antes que a trilha possa ser enviada para revisão.",roleSkillNotTaughtSuffix:"ainda não ensinada",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"Nenhum curso desta trilha ensina esta habilidade ainda",roleSkillTaughtTitle:"Um curso desta trilha ensina esta habilidade",levelSkillsFromCoursesNote:"Obtidas a partir dos cursos deste nível. Adicione ou remova cursos para alterá-las.",levelSkillsEmpty:"Nenhuma habilidade ainda — adicione um curso a este nível.",levelSkillsOutsidePrior:"Estas habilidades não são avaliadas pela Avaliação Prévia: {skills}. Remova o curso que as ensina."}},CC=["ar"],SC={en:Wi,ar:vC,fr:yC,pt:bC};function mu(e,t){const r={...e};for(const n of Object.keys(t)){const o=e[n],s=t[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)?r[n]=mu(o,s):s!==void 0&&(r[n]=s)}return r}function gu(e){const t=SC[e];return!t||e==="en"?Wi:mu(Wi,t)}function wC(e){return CC.includes(e)}const Gi="app-language",Ki="app-language-change",Yi=Yo(e=>({lang:"en",labelConfig:gu("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:gu(t)}),localStorage.setItem(Gi,t),document.documentElement.setAttribute("dir",wC(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(Ki,{detail:{lang:t}}))}}));function vu(e,t){return function(){return e.apply(t,arguments)}}const{toString:_C}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:Zo,toStringTag:yu}=Symbol,ua=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Xo=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),ua(r,t))return!0;r=Zn(r)}return!1},TC=(e,t)=>e!=null&&Xo(e,t)?e[t]:void 0,Zi=(e=>t=>{const r=_C.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),wr=e=>(e=e.toLowerCase(),t=>Zi(t)===e),fa=e=>t=>typeof t===e,{isArray:Tn}=Array,Xn=fa("undefined");function Jn(e){return e!==null&&!Xn(e)&&e.constructor!==null&&!Xn(e.constructor)&&Gt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bu=wr("ArrayBuffer");function kC(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bu(e.buffer),t}const EC=fa("string"),Gt=fa("function"),Cu=fa("number"),eo=e=>e!==null&&typeof e=="object",AC=e=>e===!0||e===!1,ha=e=>{if(!eo(e))return!1;const t=Zn(e);return(t===null||t===Object.prototype||Zn(t)===null)&&!Xo(e,yu)&&!Xo(e,Zo)},IC=e=>{if(!eo(e)||Jn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},LC=wr("Date"),DC=wr("File"),NC=e=>!!(e&&typeof e.uri<"u"),OC=e=>e&&typeof e.getParts<"u",PC=wr("Blob"),xC=wr("FileList"),FC=e=>eo(e)&&Gt(e.pipe);function MC(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Su=MC(),wu=typeof Su.FormData<"u"?Su.FormData:void 0,BC=e=>{if(!e)return!1;if(wu&&e instanceof wu)return!0;const t=Zn(e);if(!t||t===Object.prototype||!Gt(e.append))return!1;const r=Zi(e);return r==="formdata"||r==="object"&&Gt(e.toString)&&e.toString()==="[object FormData]"},$C=wr("URLSearchParams"),[qC,jC,UC,HC]=["ReadableStream","Request","Response","Headers"].map(wr),VC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Jo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Tn(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Jn(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let i;for(n=0;n<a;n++)i=s[n],t.call(null,e[i],i,e)}}function _u(e,t){if(Jn(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const kn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Tu=e=>!Xn(e)&&e!==kn;function Xi(...e){const{caseless:t,skipUndefined:r}=Tu(this)&&this||{},n={},o=(s,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const i=t&&typeof a=="string"&&_u(n,a)||a,c=ua(n,i)?n[i]:void 0;ha(c)&&ha(s)?n[i]=Xi(c,s):ha(s)?n[i]=Xi({},s):Tn(s)?n[i]=s.slice():(!r||!Xn(s))&&(n[i]=s)};for(let s=0,a=e.length;s<a;s++){const i=e[s];if(!i||Jn(i)||(Jo(i,o),typeof i!="object"||Tn(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let d=0;d<c.length;d++){const u=c[d];tS.call(i,u)&&o(i[u],u)}}return n}const zC=(e,t,r,{allOwnKeys:n}={})=>(Jo(t,(o,s)=>{r&&Gt(o)?Object.defineProperty(e,s,{__proto__:null,value:vu(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),RC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),QC=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},WC=(e,t,r,n)=>{let o,s,a;const i={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!n||n(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},GC=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},KC=e=>{if(!e)return null;if(Tn(e))return e;let t=e.length;if(!Cu(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},YC=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),ZC=(e,t)=>{const n=(e&&e[Zo]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},XC=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},JC=wr("HTMLFormElement"),eS=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),{propertyIsEnumerable:tS}=Object.prototype,rS=wr("RegExp"),ku=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Jo(r,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(n[s]=a||o)}),Object.defineProperties(e,n)},nS=e=>{ku(e,(t,r)=>{if(Gt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Gt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},oS=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return Tn(e)?n(e):n(String(e).split(t)),r},sS=()=>{},aS=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function iS(e){return!!(e&&Gt(e.append)&&e[yu]==="FormData"&&e[Zo])}const lS=e=>{const t=new WeakSet,r=n=>{if(eo(n)){if(t.has(n))return;if(Jn(n))return n;if(!("toJSON"in n)){t.add(n);const o=Tn(n)?[]:{};return Jo(n,(s,a)=>{const i=r(s);!Xn(i)&&(o[a]=i)}),t.delete(n),o}}return n};return r(e)},cS=wr("AsyncFunction"),dS=e=>e&&(eo(e)||Gt(e))&&Gt(e.then)&&Gt(e.catch),Eu=((e,t)=>e?setImmediate:t?((r,n)=>(kn.addEventListener("message",({source:o,data:s})=>{o===kn&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),kn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Gt(kn.postMessage)),uS=typeof queueMicrotask<"u"?queueMicrotask.bind(kn):typeof process<"u"&&process.nextTick||Eu,Au=e=>e!=null&&Gt(e[Zo]),L={isArray:Tn,isArrayBuffer:bu,isBuffer:Jn,isFormData:BC,isArrayBufferView:kC,isString:EC,isNumber:Cu,isBoolean:AC,isObject:eo,isPlainObject:ha,isEmptyObject:IC,isReadableStream:qC,isRequest:jC,isResponse:UC,isHeaders:HC,isUndefined:Xn,isDate:LC,isFile:DC,isReactNativeBlob:NC,isReactNative:OC,isBlob:PC,isRegExp:rS,isFunction:Gt,isStream:FC,isURLSearchParams:$C,isTypedArray:YC,isFileList:xC,forEach:Jo,merge:Xi,extend:zC,trim:VC,stripBOM:RC,inherits:QC,toFlatObject:WC,kindOf:Zi,kindOfTest:wr,endsWith:GC,toArray:KC,forEachEntry:ZC,matchAll:XC,isHTMLForm:JC,hasOwnProperty:ua,hasOwnProp:ua,hasOwnInPrototypeChain:Xo,getSafeProp:TC,reduceDescriptors:ku,freezeMethods:nS,toObjectSet:oS,toCamelCase:eS,noop:sS,toFiniteNumber:aS,findKey:_u,global:kn,isContextDefined:Tu,isSpecCompliantForm:iS,toJSONObject:lS,isAsyncFn:cS,isThenable:dS,setImmediate:Eu,asap:uS,isIterable:Au,isSafeIterable:e=>e!=null&&Xo(e,Zo)&&Au(e)},fS=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hS=e=>{const t={};let r,n,o;return e&&e.split(`
529
+ `).forEach(function(a){o=a.indexOf(":"),r=a.substring(0,o).trim().toLowerCase(),n=a.substring(o+1).trim(),!(!r||t[r]&&fS[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function pS(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const mS=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),gS=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ji(e,t){return L.isArray(e)?e.map(r=>Ji(r,t)):pS(String(e).replace(t,""))}const vS=e=>Ji(e,mS),yS=e=>Ji(e,gS);function Iu(e){const t=Object.create(null);return L.forEach(e.toJSON(),(r,n)=>{t[n]=yS(r)}),t}const Lu=Symbol("internals");function es(e){return e&&String(e).trim().toLowerCase()}function pa(e){return e===!1||e==null?e:L.isArray(e)?e.map(pa):vS(String(e))}function bS(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const CS=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function el(e,t,r,n,o){if(L.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!L.isString(t)){if(L.isString(n))return t.indexOf(n)!==-1;if(L.isRegExp(n))return n.test(t)}}function SS(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function wS(e,t){const r=L.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(o,s,a){return this[n].call(this,t,o,s,a)},configurable:!0})})}let Nt=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(i,c,d){const u=es(c);if(!u)return;const f=L.findKey(o,u);(!f||o[f]===void 0||d===!0||d===void 0&&o[f]!==!1)&&(o[f||c]=pa(i))}const a=(i,c)=>L.forEach(i,(d,u)=>s(d,u,c));if(L.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(L.isString(t)&&(t=t.trim())&&!CS(t))a(hS(t),r);else if(L.isObject(t)&&L.isSafeIterable(t)){let i=Object.create(null),c,d;for(const u of t){if(!L.isArray(u))throw new TypeError("Object iterator must return a key-value pair");d=u[0],L.hasOwnProp(i,d)?(c=i[d],i[d]=L.isArray(c)?[...c,u[1]]:[c,u[1]]):i[d]=u[1]}a(i,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=es(t),t){const n=L.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return bS(o);if(L.isFunction(r))return r.call(this,o,n);if(L.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=es(t),t){const n=L.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||el(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(a){if(a=es(a),a){const i=L.findKey(n,a);i&&(!r||el(n,n[i],i,r))&&(delete n[i],o=!0)}}return L.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||el(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return L.forEach(this,(o,s)=>{const a=L.findKey(n,s);if(a){r[a]=pa(o),delete r[s];return}const i=t?SS(s):String(s).trim();i!==s&&delete r[s],r[i]=pa(o),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return L.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&L.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
530
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Lu]=this[Lu]={accessors:{}}).accessors,o=this.prototype;function s(a){const i=es(a);n[i]||(wS(o,a),n[i]=!0)}return L.isArray(t)?t.forEach(s):s(t),this}};Nt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(Nt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),L.freezeMethods(Nt);const _S="[REDACTED ****]";function TS(e){if(L.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function kS(e,t){const r=new Set(t.map(s=>String(s).toLowerCase())),n=[],o=s=>{if(s===null||typeof s!="object"||L.isBuffer(s))return s;if(n.indexOf(s)!==-1)return;s instanceof Nt&&(s=s.toJSON()),n.push(s);let a;if(L.isArray(s))a=[],s.forEach((i,c)=>{const d=o(i);L.isUndefined(d)||(a[c]=d)});else{if(!L.isPlainObject(s)&&TS(s))return n.pop(),s;a=Object.create(null);for(const[i,c]of Object.entries(s)){const d=r.has(i.toLowerCase())?_S:o(c);L.isUndefined(d)||(a[i]=d)}}return n.pop(),a};return o(e)}let se=class Cg extends Error{static from(t,r,n,o,s,a){const i=new Cg(t.message,r||t.code,n,o,s);return i.cause=t,i.name=t.name,t.status!=null&&i.status==null&&(i.status=t.status),a&&Object.assign(i,a),i}constructor(t,r,n,o,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){const t=this.config,r=t&&L.hasOwnProp(t,"redact")?t.redact:void 0,n=L.isArray(r)&&r.length>0?kS(t,r):L.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};se.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",se.ERR_BAD_OPTION="ERR_BAD_OPTION",se.ECONNABORTED="ECONNABORTED",se.ETIMEDOUT="ETIMEDOUT",se.ECONNREFUSED="ECONNREFUSED",se.ERR_NETWORK="ERR_NETWORK",se.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",se.ERR_DEPRECATED="ERR_DEPRECATED",se.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",se.ERR_BAD_REQUEST="ERR_BAD_REQUEST",se.ERR_CANCELED="ERR_CANCELED",se.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",se.ERR_INVALID_URL="ERR_INVALID_URL",se.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const ES=null,Du=100;function tl(e){return L.isPlainObject(e)||L.isArray(e)}function Nu(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function rl(e,t,r){return e?e.concat(t).map(function(o,s){return o=Nu(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function AS(e){return L.isArray(e)&&!e.some(tl)}const IS=L.toFlatObject(L,{},null,function(t){return/^is[A-Z]/.test(t)});function ma(e,t,r){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=L.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!L.isUndefined(S[C])});const n=r.metaTokens,o=r.visitor||b,s=r.dots,a=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?Du:r.maxDepth,d=i&&L.isSpecCompliantForm(t),u=[];if(!L.isFunction(o))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(L.isDate(y))return y.toISOString();if(L.isBoolean(y))return y.toString();if(!d&&L.isBlob(y))throw new se("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(y)||L.isTypedArray(y)?d&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function g(y){if(y>c)throw new se("Object is too deeply nested ("+y+" levels). Max depth: "+c,se.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(y,C){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(_,T){if(!L.isObject(T))return T;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(T),g(C+S.length-1),T})}function b(y,C,S){let w=y;if(L.isReactNative(t)&&L.isReactNativeBlob(y))return t.append(rl(S,C,s),f(y)),!1;if(y&&!S&&typeof y=="object"){if(L.endsWith(C,"{}"))C=n?C:C.slice(0,-2),y=p(y,1);else if(L.isArray(y)&&AS(y)||(L.isFileList(y)||L.endsWith(C,"[]"))&&(w=L.toArray(y)))return C=Nu(C),w.forEach(function(T,E){!(L.isUndefined(T)||T===null)&&t.append(a===!0?rl([C],E,s):a===null?C:C+"[]",f(T))}),!1}return tl(y)?!0:(t.append(rl(S,C,s),f(y)),!1)}const m=Object.assign(IS,{defaultVisitor:b,convertValue:f,isVisitable:tl});function v(y,C,S=0){if(!L.isUndefined(y)){if(g(S),u.indexOf(y)!==-1)throw new Error("Circular reference detected in "+C.join("."));u.push(y),L.forEach(y,function(_,T){(!(L.isUndefined(_)||_===null)&&o.call(t,_,L.isString(T)?T.trim():T,C,m))===!0&&v(_,C?C.concat(T):[T],S+1)}),u.pop()}}if(!L.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Ou(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function nl(e,t){this._pairs=[],e&&ma(e,this,t)}const Pu=nl.prototype;Pu.append=function(t,r){this._pairs.push([t,r])},Pu.toString=function(t){const r=t?function(n){return t.call(this,n,Ou)}:Ou;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function LS(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xu(e,t,r){if(!t)return e;const n=L.isFunction(r)?{serialize:r}:r,o=L.getSafeProp(n,"encode")||LS,s=L.getSafeProp(n,"serialize");let a;if(s?a=s(t,n):a=L.isURLSearchParams(t)?t.toString():new nl(t,n).toString(o),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Fu{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){L.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ol={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},DS={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:nl,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},sl=typeof window<"u"&&typeof document<"u",al=typeof navigator=="object"&&navigator||void 0,NS=sl&&(!al||["ReactNative","NativeScript","NS"].indexOf(al.product)<0),OS=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",PS=sl&&window.location.href||"http://localhost",At={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sl,hasStandardBrowserEnv:NS,hasStandardBrowserWebWorkerEnv:OS,navigator:al,origin:PS},Symbol.toStringTag,{value:"Module"})),...DS};function xS(e,t){return ma(e,new At.classes.URLSearchParams,{visitor:function(r,n,o,s){return At.isNode&&L.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}const Mu=Du;function Bu(e){if(e>Mu)throw new se("FormData field is too deeply nested ("+e+" levels). Max depth: "+Mu,se.ERR_FORM_DATA_DEPTH_EXCEEDED)}function FS(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)Bu(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function MS(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function $u(e){function t(r,n,o,s){Bu(s);let a=r[s++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=s>=r.length;return a=!a&&L.isArray(o)?o.length:a,c?(L.hasOwnProp(o,a)?o[a]=L.isArray(o[a])?o[a].concat(n):[o[a],n]:o[a]=n,!i):((!L.hasOwnProp(o,a)||!L.isObject(o[a]))&&(o[a]=[]),t(r,n,o[a],s)&&L.isArray(o[a])&&(o[a]=MS(o[a])),!i)}if(L.isFormData(e)&&L.isFunction(e.entries)){const r={};return L.forEachEntry(e,(n,o)=>{t(FS(n),o,r,0)}),r}return null}const to=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function BS(e,t,r){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ts={transitional:ol,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=L.isObject(t);if(s&&L.isHTMLForm(t)&&(t=new FormData(t)),L.isFormData(t))return o?JSON.stringify($u(t)):t;if(L.isArrayBuffer(t)||L.isBuffer(t)||L.isStream(t)||L.isFile(t)||L.isBlob(t)||L.isReadableStream(t))return t;if(L.isArrayBufferView(t))return t.buffer;if(L.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){const c=to(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return xS(t,c).toString();if((i=L.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=to(this,"env"),u=d&&d.FormData;return ma(i?{"files[]":t}:t,u&&new u,c)}}return s||o?(r.setContentType("application/json",!1),BS(t)):t}],transformResponse:[function(t){const r=to(this,"transitional")||ts.transitional,n=r&&r.forcedJSONParsing,o=to(this,"responseType"),s=o==="json";if(L.isResponse(t)||L.isReadableStream(t))return t;if(t&&L.isString(t)&&(n&&!o||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,to(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?se.from(c,se.ERR_BAD_RESPONSE,this,null,to(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:At.classes.FormData,Blob:At.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch","query"],e=>{ts.headers[e]={}});function il(e,t){const r=this||ts,n=t||r,o=Nt.from(n.headers);let s=n.data;return L.forEach(e,function(i){s=i.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function qu(e){return!!(e&&e.__CANCEL__)}let rs=class extends se{constructor(t,r,n){super(t??"canceled",se.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function ju(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new se("Request failed with status code "+r.status,r.status>=400&&r.status<500?se.ERR_BAD_REQUEST:se.ERR_BAD_RESPONSE,r.config,r.request,r))}function $S(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function qS(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[s];a||(a=d),r[o]=c,n[o]=d;let f=s,g=0;for(;f!==o;)g+=r[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-a<t)return;const p=u&&d-u;return p?Math.round(g*1e3/p):void 0}}function jS(e,t){let r=0,n=1e3/t,o,s;const a=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=n?a(d,u):(o=d,s||(s=setTimeout(()=>{s=null,a(o)},n-f)))},()=>o&&a(o)]}const ga=(e,t,r=3)=>{let n=0;const o=qS(50,250);return jS(s=>{if(!s||typeof s.loaded!="number")return;const a=s.loaded,i=s.lengthComputable?s.total:void 0,c=i!=null?Math.min(a,i):a,d=Math.max(0,c-n),u=o(d);n=Math.max(n,c);const f={loaded:c,total:i,progress:i?c/i:void 0,bytes:d,rate:u||void 0,estimated:u&&i?(i-c)/u:void 0,event:s,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(f)},r)},Uu=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Hu=e=>(...t)=>L.asap(()=>e(...t)),US=At.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,At.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(At.origin),At.navigator&&/(msie|trident)/i.test(At.navigator.userAgent)):()=>!0,HS=At.hasStandardBrowserEnv?{write(e,t,r,n,o,s,a){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];L.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),L.isString(n)&&i.push(`path=${n}`),L.isString(o)&&i.push(`domain=${o}`),s===!0&&i.push("secure"),L.isString(a)&&i.push(`SameSite=${a}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(o!==-1&&n.slice(0,o)===e)return decodeURIComponent(n.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function VS(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zS(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const RS=/^https?:(?!\/\/)/i,QS=/[\t\n\r]/g;function WS(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function GS(e){return WS(e).replace(QS,"")}function Vu(e,t){if(typeof e=="string"&&RS.test(GS(e)))throw new se('Invalid URL: missing "//" after protocol',se.ERR_INVALID_URL,t)}function zu(e,t,r,n){Vu(t,n);let o=!VS(t);return e&&(o||r===!1)?(Vu(e,n),zS(e,t)):t}const Ru=e=>e instanceof Nt?{...e}:e;function En(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(u,f,g,p){return L.isPlainObject(u)&&L.isPlainObject(f)?L.merge.call({caseless:p},u,f):L.isPlainObject(f)?L.merge({},f):L.isArray(f)?f.slice():f}function o(u,f,g,p){if(L.isUndefined(f)){if(!L.isUndefined(u))return n(void 0,u,g,p)}else return n(u,f,g,p)}function s(u,f){if(!L.isUndefined(f))return n(void 0,f)}function a(u,f){if(L.isUndefined(f)){if(!L.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function i(u){const f=L.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!L.isUndefined(f))if(L.isPlainObject(f)){if(L.hasOwnProp(f,u))return f[u]}else return;const g=L.hasOwnProp(e,"transitional")?e.transitional:void 0;if(L.isPlainObject(g)&&L.hasOwnProp(g,u))return g[u]}function c(u,f,g){if(L.hasOwnProp(t,g))return n(u,f);if(L.hasOwnProp(e,g))return n(void 0,u)}const d={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:c,headers:(u,f,g)=>o(Ru(u),Ru(f),g,!0)};return L.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const g=L.hasOwnProp(d,f)?d[f]:o,p=L.hasOwnProp(e,f)?e[f]:void 0,b=L.hasOwnProp(t,f)?t[f]:void 0,m=g(p,b,f);L.isUndefined(m)&&g!==c||(r[f]=m)}),L.hasOwnProp(t,"validateStatus")&&L.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(L.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const KS=["content-type","content-length"];function YS(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{KS.includes(n.toLowerCase())&&e.set(n,o)})}const ZS=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Qu(e){const t=En({},e),r=g=>L.hasOwnProp(t,g)?t[g]:void 0,n=r("data");let o=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let i=r("headers");const c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),f=r("url");if(t.headers=i=Nt.from(i),t.url=xu(zu(d,f,u,t),r("params"),r("paramsSerializer")),c){const g=L.getSafeProp(c,"username")||"",p=L.getSafeProp(c,"password")||"";i.set("Authorization","Basic "+btoa(g+":"+(p?ZS(p):"")))}if(L.isFormData(n)&&(At.hasStandardBrowserEnv||At.hasStandardBrowserWebWorkerEnv||L.isReactNative(n)?i.setContentType(void 0):L.isFunction(n.getHeaders)&&YS(i,n.getHeaders(),r("formDataHeaderPolicy"))),At.hasStandardBrowserEnv&&(L.isFunction(o)&&(o=o(t)),o===!0||o==null&&US(t.url))){const p=s&&a&&HS.read(a);p&&i.set(s,p)}return t}const XS=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Qu(e);let s=o.data;const a=Nt.from(o.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:d}=o,u,f,g,p,b;function m(){p&&p(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function y(){if(!v)return;const S=Nt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),_={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};ju(function(E){r(E),m()},function(E){n(E),m()},_),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(y)},v.onabort=function(){v&&(n(new se("Request aborted",se.ECONNABORTED,e,v)),m(),v=null)},v.onerror=function(w){const _=w&&w.message?w.message:"Network Error",T=new se(_,se.ERR_NETWORK,e,v);T.event=w||null,n(T),m(),v=null},v.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||ol;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),n(new se(w,_.clarifyTimeoutError?se.ETIMEDOUT:se.ECONNABORTED,e,v)),m(),v=null},s===void 0&&a.setContentType(null),"setRequestHeader"in v&&L.forEach(Iu(a),function(w,_){v.setRequestHeader(_,w)}),L.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),i&&i!=="json"&&(v.responseType=o.responseType),d&&([g,b]=ga(d,!0),v.addEventListener("progress",g)),c&&v.upload&&([f,p]=ga(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(u=S=>{v&&(n(!S||S.type?new rs(null,e,v):S),v.abort(),m(),v=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const C=$S(o.url);if(C&&!At.protocols.includes(C)){n(new se("Unsupported protocol "+C+":",se.ERR_BAD_REQUEST,e));return}v.send(s||null)})},JS=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(c){if(!n){n=!0,a();const d=c instanceof Error?c:this.reason;r.abort(d instanceof se?d:new rs(d instanceof Error?d.message:d))}};let s=t&&setTimeout(()=>{s=null,o(new se(`timeout of ${t}ms exceeded`,se.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:i}=r;return i.unsubscribe=()=>L.asap(a),i},ew=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},tw=async function*(e,t){for await(const r of rw(e))yield*ew(r,t)},rw=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Wu=(e,t,r,n)=>{const o=tw(e,t);let s=0,a,i=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){i(),c.close();return}let f=u.byteLength;if(r){let g=s+=f;r(g)}c.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(c){return i(c),o.return()}},{highWaterMark:2})},va=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,nw=(e,t,r)=>t+2<r&&va(e.charCodeAt(t+1))&&va(e.charCodeAt(t+2));function ow(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let a=n.length;const i=n.length;for(let p=0;p<i;p++)if(n.charCodeAt(p)===37&&p+2<i){const b=n.charCodeAt(p+1),m=n.charCodeAt(p+2);va(b)&&va(m)&&(a-=2,p+=2)}let c=0,d=i-1;const u=p=>p>=2&&n.charCodeAt(p-2)===37&&n.charCodeAt(p-1)===51&&(n.charCodeAt(p)===68||n.charCodeAt(p)===100);d>=0&&(n.charCodeAt(d)===61?(c++,d--):u(d)&&(c++,d-=3)),c===1&&d>=0&&(n.charCodeAt(d)===61||u(d))&&c++;const g=Math.floor(a/4)*3-(c||0);return g>0?g:0}let s=0;for(let a=0,i=n.length;a<i;a++){const c=n.charCodeAt(a);if(c===37&&nw(n,a,i))s+=1,a+=2;else if(c<128)s+=1;else if(c<2048)s+=2;else if(c>=55296&&c<=56319&&a+1<i){const d=n.charCodeAt(a+1);d>=56320&&d<=57343?(s+=4,a++):s+=3}else s+=3}return s}const ll="1.18.0",Gu=64*1024,{isFunction:ya}=L,sw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Ku=e=>{if(!L.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Yu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aw=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},iw=e=>{const t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:a}=e,i=o?ya(o):typeof fetch=="function",c=ya(s),d=ya(a);if(!i)return!1;const u=i&&ya(r),f=i&&(typeof n=="function"?(y=>C=>y.encode(C))(new n):async y=>new Uint8Array(await new s(y).arrayBuffer())),g=c&&u&&Yu(()=>{let y=!1;const C=new s(At.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),y&&!S}),p=d&&u&&Yu(()=>L.isReadableStream(new a("").body)),b={stream:p&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!b[y]&&(b[y]=(C,S)=>{let w=C&&C[y];if(w)return w.call(C);throw new se(`Response type '${y}' is not supported`,se.ERR_NOT_SUPPORT,S)})});const m=async y=>{if(y==null)return 0;if(L.isBlob(y))return y.size;if(L.isSpecCompliantForm(y))return(await new s(At.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(L.isArrayBufferView(y)||L.isArrayBuffer(y))return y.byteLength;if(L.isURLSearchParams(y)&&(y=y+""),L.isString(y))return(await f(y)).byteLength},v=async(y,C)=>{const S=L.toFiniteNumber(y.getContentLength());return S??m(C)};return async y=>{let{url:C,method:S,data:w,signal:_,cancelToken:T,timeout:E,onDownloadProgress:A,onUploadProgress:x,responseType:B,headers:D,withCredentials:F="same-origin",fetchOptions:M,maxContentLength:P,maxBodyLength:V}=Qu(y);const ne=L.isNumber(P)&&P>-1,W=L.isNumber(V)&&V>-1,de=q=>L.hasOwnProp(y,q)?y[q]:void 0;let ie=o||fetch;B=B?(B+"").toLowerCase():"text";let ve=JS([_,T&&T.toAbortSignal()],E),me=null;const z=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let Ce,ke=null;const U=()=>new se("Request body larger than maxBodyLength limit",se.ERR_BAD_REQUEST,y,me);try{let q;const le=de("auth");if(le){const G=L.getSafeProp(le,"username")||"",H=L.getSafeProp(le,"password")||"";q={username:G,password:H}}if(aw(C)){const G=new URL(C,At.origin);if(!q&&(G.username||G.password)){const H=Ku(G.username),Ae=Ku(G.password);q={username:H,password:Ae}}(G.username||G.password)&&(G.username="",G.password="",C=G.href)}if(q&&(D.delete("authorization"),D.set("Authorization","Basic "+btoa(sw((q.username||"")+":"+(q.password||""))))),ne&&typeof C=="string"&&C.startsWith("data:")&&ow(C)>P)throw new se("maxContentLength size of "+P+" exceeded",se.ERR_BAD_RESPONSE,y,me);if(W&&S!=="get"&&S!=="head"){const G=await m(w);if(typeof G=="number"&&isFinite(G)&&(Ce=G,G>V))throw U()}const ge=W&&(L.isReadableStream(w)||L.isStream(w)),ee=(G,H,Ae)=>Wu(G,Gu,Te=>{if(W&&Te>V)throw ke=U();H&&H(Te)},Ae);if(g&&S!=="get"&&S!=="head"&&(x||ge)){if(Ce=Ce??await v(D,w),Ce!==0||ge){let G=new s(C,{method:"POST",body:w,duplex:"half"}),H;if(L.isFormData(w)&&(H=G.headers.get("content-type"))&&D.setContentType(H),G.body){const[Ae,Te]=x&&Uu(Ce,ga(Hu(x)))||[];w=ee(G.body,Ae,Te)}}}else if(ge&&!c&&u&&S!=="get"&&S!=="head")w=ee(w);else if(ge&&c&&!g&&S!=="get"&&S!=="head")throw new se("Stream request bodies are not supported by the current fetch implementation",se.ERR_NOT_SUPPORT,y,me);L.isString(F)||(F=F?"include":"omit");const fe=c&&"credentials"in s.prototype;if(L.isFormData(w)){const G=D.getContentType();G&&/^multipart\/form-data/i.test(G)&&!/boundary=/i.test(G)&&D.delete("content-type")}D.set("User-Agent","axios/"+ll,!1);const X={...M,signal:ve,method:S.toUpperCase(),headers:Iu(D.normalize()),body:w,duplex:"half",credentials:fe?F:void 0};me=c&&new s(C,X);let Se=await(c?ie(me,M):ie(C,X));const Me=Nt.from(Se.headers);if(ne){const G=L.toFiniteNumber(Me.getContentLength());if(G!=null&&G>P)throw new se("maxContentLength size of "+P+" exceeded",se.ERR_BAD_RESPONSE,y,me)}const re=p&&(B==="stream"||B==="response");if(p&&Se.body&&(A||ne||re&&z)){const G={};["status","statusText","headers"].forEach(Be=>{G[Be]=Se[Be]});const H=L.toFiniteNumber(Me.getContentLength()),[Ae,Te]=A&&Uu(H,ga(Hu(A),!0))||[];let Ie=0;const we=Be=>{if(ne&&(Ie=Be,Ie>P))throw new se("maxContentLength size of "+P+" exceeded",se.ERR_BAD_RESPONSE,y,me);Ae&&Ae(Be)};Se=new a(Wu(Se.body,Gu,we,()=>{Te&&Te(),z&&z()}),G)}B=B||"text";let ce=await b[L.findKey(b,B)||"text"](Se,y);if(ne&&!p&&!re){let G;if(ce!=null&&(typeof ce.byteLength=="number"?G=ce.byteLength:typeof ce.size=="number"?G=ce.size:typeof ce=="string"&&(G=typeof n=="function"?new n().encode(ce).byteLength:ce.length)),typeof G=="number"&&G>P)throw new se("maxContentLength size of "+P+" exceeded",se.ERR_BAD_RESPONSE,y,me)}return!re&&z&&z(),await new Promise((G,H)=>{ju(G,H,{data:ce,headers:Nt.from(Se.headers),status:Se.status,statusText:Se.statusText,config:y,request:me})})}catch(q){if(z&&z(),ve&&ve.aborted&&ve.reason instanceof se){const le=ve.reason;throw le.config=y,me&&(le.request=me),q!==le&&(le.cause=q),le}throw ke?(me&&!ke.request&&(ke.request=me),ke):q instanceof se?(me&&!q.request&&(q.request=me),q):q&&q.name==="TypeError"&&/Load failed|fetch/i.test(q.message)?Object.assign(new se("Network Error",se.ERR_NETWORK,y,me,q&&q.response),{cause:q.cause||q}):se.from(q,q&&q.code,y,me,q&&q.response)}}},lw=new Map,Zu=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let a=s.length,i=a,c,d,u=lw;for(;i--;)c=s[i],d=u.get(c),d===void 0&&u.set(c,d=i?new Map:iw(t)),u=d;return d};Zu();const cl={http:ES,xhr:XS,fetch:{get:Zu}};L.forEach(cl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Xu=e=>`- ${e}`,cw=e=>L.isFunction(e)||e===null||e===!1;function dw(e,t){e=L.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let a=0;a<r;a++){n=e[a];let i;if(o=n,!cw(n)&&(o=cl[(i=String(n)).toLowerCase()],o===void 0))throw new se(`Unknown adapter '${i}'`);if(o&&(L.isFunction(o)||(o=o.get(t))))break;s[i||"#"+a]=o}if(!o){const a=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=r?a.length>1?`since :
531
+ `+a.map(Xu).join(`
532
+ `):" "+Xu(a[0]):"as no adapter specified";throw new se("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return o}const Ju={getAdapter:dw,adapters:cl};function dl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rs(null,e)}function ef(e){return dl(e),e.headers=Nt.from(e.headers),e.data=il.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ju.getAdapter(e.adapter||ts.adapter,e)(e).then(function(n){dl(e),e.response=n;try{n.data=il.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=Nt.from(n.headers),n},function(n){if(!qu(n)&&(dl(e),n&&n.response)){e.response=n.response;try{n.response.data=il.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=Nt.from(n.response.headers)}return Promise.reject(n)})}const ba={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ba[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const tf={};ba.transitional=function(t,r,n){function o(s,a){return"[Axios v"+ll+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,i)=>{if(t===!1)throw new se(o(a," has been removed"+(r?" in "+r:"")),se.ERR_DEPRECATED);return r&&!tf[a]&&(tf[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,i):!0}},ba.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function uw(e,t,r){if(typeof e!="object")throw new se("options must be an object",se.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],a=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(a){const i=e[s],c=i===void 0||a(i,s,e);if(c!==!0)throw new se("option "+s+" must be "+c,se.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new se("Unknown option "+s,se.ERR_BAD_OPTION)}}const Ca={assertOptions:uw,validators:ba},Ot=Ca.validators;let An=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Fu,response:new Fu}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=(()=>{if(!o.stack)return"";const a=o.stack.indexOf(`
533
+ `);return a===-1?"":o.stack.slice(a+1)})();try{if(!n.stack)n.stack=s;else if(s){const a=s.indexOf(`
534
+ `),i=a===-1?-1:s.indexOf(`
535
+ `,a+1),c=i===-1?"":s.slice(i+1);String(n.stack).endsWith(c)||(n.stack+=`
536
+ `+s)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=En(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Ca.assertOptions(n,{silentJSONParsing:Ot.transitional(Ot.boolean),forcedJSONParsing:Ot.transitional(Ot.boolean),clarifyTimeoutError:Ot.transitional(Ot.boolean),legacyInterceptorReqResOrdering:Ot.transitional(Ot.boolean),advertiseZstdAcceptEncoding:Ot.transitional(Ot.boolean),validateStatusUndefinedResolves:Ot.transitional(Ot.boolean)},!1),o!=null&&(L.isFunction(o)?r.paramsSerializer={serialize:o}:Ca.assertOptions(o,{encode:Ot.function,serialize:Ot.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Ca.assertOptions(r,{baseUrl:Ot.spelling("baseURL"),withXsrfToken:Ot.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&L.merge(s.common,s[r.method]);s&&L.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete s[b]}),r.headers=Nt.concat(a,s);const i=[];let c=!0;this.interceptors.request.forEach(function(m){if(typeof m.runWhen=="function"&&m.runWhen(r)===!1)return;c=c&&m.synchronous;const v=r.transitional||ol;v&&v.legacyInterceptorReqResOrdering?i.unshift(m.fulfilled,m.rejected):i.push(m.fulfilled,m.rejected)});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let u,f=0,g;if(!c){const b=[ef.bind(this),void 0];for(b.unshift(...i),b.push(...d),g=b.length,u=Promise.resolve(r);f<g;)u=u.then(b[f++],b[f++]);return u}g=i.length;let p=r;for(;f<g;){const b=i[f++],m=i[f++];try{p=b(p)}catch(v){m.call(this,v);break}}try{u=ef.call(this,p)}catch(b){return Promise.reject(b)}for(f=0,g=d.length;f<g;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=En(this.defaults,t);const r=zu(t.baseURL,t.url,t.allowAbsoluteUrls,t);return xu(r,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(t){An.prototype[t]=function(r,n){return this.request(En(n||{},{method:t,url:r,data:n&&L.hasOwnProp(n,"data")?n.data:void 0}))}}),L.forEach(["post","put","patch","query"],function(t){function r(n){return function(s,a,i){return this.request(En(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}An.prototype[t]=r(),t!=="query"&&(An.prototype[t+"Form"]=r(!0))});let fw=class Sg{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(i=>{n.subscribe(i),s=i}).then(o);return a.cancel=function(){n.unsubscribe(s)},a},t(function(s,a,i){n.reason||(n.reason=new rs(s,a,i),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sg(function(o){t=o}),cancel:t}}};function hw(e){return function(r){return e.apply(null,r)}}function pw(e){return L.isObject(e)&&e.isAxiosError===!0}const ul={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ul).forEach(([e,t])=>{ul[t]=e});function rf(e){const t=new An(e),r=vu(An.prototype.request,t);return L.extend(r,An.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return rf(En(e,o))},r}const ct=rf(ts);ct.Axios=An,ct.CanceledError=rs,ct.CancelToken=fw,ct.isCancel=qu,ct.VERSION=ll,ct.toFormData=ma,ct.AxiosError=se,ct.Cancel=ct.CanceledError,ct.all=function(t){return Promise.all(t)},ct.spread=hw,ct.isAxiosError=pw,ct.mergeConfig=En,ct.AxiosHeaders=Nt,ct.formToJSON=e=>$u(L.isHTMLForm(e)?new FormData(e):e),ct.getAdapter=Ju.getAdapter,ct.HttpStatusCode=ul,ct.default=ct;const{Axios:rx,AxiosError:nx,CanceledError:ox,isCancel:sx,CancelToken:ax,VERSION:ix,all:lx,Cancel:cx,isAxiosError:dx,spread:ux,toFormData:fx,AxiosHeaders:hx,HttpStatusCode:px,formToJSON:mx,getAdapter:gx,mergeConfig:vx,create:yx}=ct;let fl="";function nf(e){fl=e}const Ve=ct.create({timeout:3e4});function mw(e,t){if(!e||typeof t!="string"||!t.trim())return e;const r=t.trim().replace(/\/+$/,""),n=r.startsWith("/")?r:`/${r}`;return e.replace(/^\/(action|api|portal)(?=\/|$)/,n)}Ve.interceptors.request.use(async e=>{var o,s,a;const{useEditorStore:t}=await Promise.resolve().then(()=>gC),r=t.getState(),n=(o=r.editorConfig)==null?void 0:o.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),e.url=mw(e.url,(a=(s=r.editorConfig)==null?void 0:s.config)==null?void 0:a.apiSlug),fl&&(e.baseURL=fl),e});const of="/portal";async function sf(e){var n,o,s,a,i,c,d;const t=await Ve.get(`${of}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.questionset;if(!r||!r.identifier){const u=((a=(s=t.data)==null?void 0:s.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${u}`)}return r}async function gw(e){var r,n;return e.length?((n=(r=(await Ve.post(`${of}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Sa(e,t){const r=e??{},n=r.identifier??"",o=r.objectType??"",s=r.mimeType??"",a=r.children,i=Array.isArray(a)?a.map(d=>Sa(d,n)):[],c=s==="application/vnd.ekstep.content-collection"||o.toLowerCase().includes("unit")||o.toLowerCase().includes("textbook")||o.toLowerCase().includes("collection")||o.toLowerCase().includes("course")||o.toLowerCase().includes("lesson")||r.visibility==="Parent"||s==="application/vnd.sunbird.questionset"&&i.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:o,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:i,metadata:r,parent:t}}async function af(e){var o,s,a,i,c,d,u;const t=await Ve.get(`/action/collection/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(o=t.data)==null?void 0:o.result)==null?void 0:s.content;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((d=(c=t.data)==null?void 0:c.params)==null?void 0:d.err)||((u=t.data)==null?void 0:u.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=Sa(r);return{content:r,rootNode:n}}async function vw(e){const t=await sf(e),r=Sa(t);return{content:t,rootNode:r}}async function yw(e,t,r,n){var s;return((s=(await Ve.patch("/action/collection/v1/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:s.result)??{}}async function bw(e,t=""){await Ve.post(`/action/collection/v1/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function Cw(e){var n,o,s,a,i,c,d;const t=await Ve.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.content;if(!r||!r.identifier){const u=((a=(s=t.data)==null?void 0:s.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((d=t.data)==null?void 0:d.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${u}`)}return r}async function lf(e){var r,n;return(n=(r=(await Ve.get(`/action/collection/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function Sw(e){await Ve.post(`/action/collection/v1/review/${e}`,{request:{content:{}}})}async function ww(e,t){await Ve.post(`/action/collection/v1/reject/${e}`,{request:{content:{rejectComment:t}}})}async function _w(e,t){await Ve.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}function ns(e,t){if(!(t!=null&&t.length))return;const r=t.find(o=>o.code===e);if(r)return r;const n=e.toLowerCase();return t.find(o=>{var s;return((s=o.name)==null?void 0:s.toLowerCase())===n})}function Tw(e,t){var r;return((r=ns(e,t))==null?void 0:r.code)??e}function on(e,t){const r=Array.isArray(e)?e:e!=null&&e!==""?[e]:[];return Array.from(new Set(r.map(n=>Tw(String(n),t))))}function wa(e,t){var r;return((r=ns(e,t))==null?void 0:r.name)??e}function _a(e,t){return Array.from(new Set(e.flatMap(r=>{const n=ns(r,t);return n?[n.code,n.name]:[r]})))}const rr="competencyFramework",In="targetRole",cf="skill";function df(e,t,r){var s,a;if(!e)return;const n=(s=t[e.id])==null?void 0:s[r],o=n!==void 0?n:(a=e.metadata)==null?void 0:a[r];return typeof o=="string"&&o?o:void 0}function Ta(e,t){return df(e,t,rr)}function kw(e,t){return df(e,t,In)}function ro(e,t=cf,r){const n=e&&"metadata"in e?e.metadata:e;return on(n==null?void 0:n[t],r)}function hl(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function uf(e){return(e.children??[]).filter(t=>!st(t)).flatMap(t=>t.children??[]).filter(t=>{var r;return!((r=t.metadata)!=null&&r.isAssessmentCourse)})}function ff(e,t,r,n){return!e||!t.length?[]:uf(e).filter(o=>hl(ro(o,r,n),t).length>0)}function hf(e,t,r,n){if(!e||!t.length)return[];const o=new Set(uf(e).flatMap(s=>ro(s,r,n)));return t.filter(s=>!o.has(s))}const pl="Evaluation Course";function no(e){return(e==null?void 0:e.primaryCategory)===pl}function Ew(e){const t=(e.children??[]).map(r=>({...r,children:(r.children??[]).map(n=>{var s;const o=!!((s=n.metadata)!=null&&s.isAssessmentCourse)||no(n.metadata);return{...n,isFolder:!1,children:[],metadata:{...n.metadata??{},...o?{isAssessmentCourse:!0}:{}}}})}));return{...e,children:t}}function st(e){var r,n;const t=(e==null?void 0:e.children)??[];return t.length===1&&!!((n=(r=t[0])==null?void 0:r.metadata)!=null&&n.isAssessmentCourse)}function pf(e){var r,n;const t=(r=e==null?void 0:e.children)==null?void 0:r[0];return st(t)?(n=t==null?void 0:t.children)==null?void 0:n[0]:void 0}function mf(e){return((e==null?void 0:e.children)??[]).find(t=>{var r;return!!((r=t.metadata)!=null&&r.isAssessmentCourse)})}function Aw(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function Iw(e,t){const r=e.findIndex(o=>o.id===t);return r===-1?null:ss(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((o,s)=>!ss(e,s)).length}}function os(e,t){return t==="pre"?e.length>0&&st(e[0]):e.length>1&&st(e[e.length-1])}function ss(e,t){const r=Aw(t,e.length,st(e[t]));return r==="pre"||r==="post"}function ml(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&ss(e,r)}function gf(e,t){var n,o;return(((n=e[0])==null?void 0:n.id)===t.id||((o=e[e.length-1])==null?void 0:o.id)===t.id)&&(t.children??[]).length===0}function Lw(e){return os(e,"pre")?os(e,"post")?null:"post":"pre"}function Dw(e,t,r){if(t<0||t>=e.length)return!1;const n=st(e[0])?e[0]:null,o=e.length>1&&st(e[e.length-1])?e[e.length-1]:null,s=[...e],[a]=s.splice(t,1);return s.splice(r,0,a),!(n&&s[0]!==n||o&&s[s.length-1]!==o||!n&&st(s[0])||!o&&s.length>1&&st(s[s.length-1]))}function vf(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(o=>{var s;return!!((s=o.metadata)!=null&&s.isAssessmentCourse)}):!0}function yf(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function bf(e,t){var n,o;return e?((n=t[e.id])==null?void 0:n.framework)??((o=e.metadata)==null?void 0:o.framework):void 0}function Cf(e,t){return!!bf(e,t)}function Sf(e,t,r=[]){if(!e||!t)return[];const n=new Set,o=e.children??[];return o.forEach((s,a)=>{var i;ss(o,a)?on((i=s.children[0].metadata)==null?void 0:i[t],r).forEach(c=>n.add(c)):as(s,t,r).forEach(c=>n.add(c))}),Array.from(n)}function as(e,t,r=[]){var o,s;if(!e||!t)return[];const n=new Set;for(const a of e.children??[])(o=a.metadata)!=null&&o.isAssessmentCourse||on((s=a.metadata)==null?void 0:s[t],r).forEach(i=>n.add(i));return Array.from(n)}function Nw(e,t,r,n=[],o=[]){var f,g;if(!e||!t)return null;const s=o.length?[...o]:Sf(e,t,n),a=((f=r[e.id])==null?void 0:f[t])??((g=e.metadata)==null?void 0:g[t]),i=yf(a),c=[...s].sort(),d=[...i].sort();return c.length===d.length&&c.every((p,b)=>p===d[b])?null:s}function Ow(e,t,r,n=[]){if(!e||!t||r.length===0)return[];const o=e.children??[];return o.filter((s,a)=>ss(o,a)?!1:as(s,t,n).some(i=>!r.includes(i)))}const wf=new Set(["adaptive"]);function gl(e,t,r,n={},o=[],s=[]){var y,C,S;const a=w=>w.map(_=>wa(_,o)).join(", "),i=[];if(!e)return i;const c=((y=n[e.id])==null?void 0:y.policy)??((C=e.metadata)==null?void 0:C.policy);c||i.push({code:"policyMissing",message:"Set a consumption policy for this path."});const d=e.children??[],u=d[0],f=d.length>1?d[d.length-1]:void 0,g=st(u),p=st(f);!g&&c&&wf.has(c)&&i.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[u,"Prior Assessment"],[f,"Outcome Assessment"]].forEach(([w,_])=>{if(!w)return;const T=w.children??[],E=T.filter(A=>{var x;return!!((x=A.metadata)!=null&&x.isAssessmentCourse)});E.length!==0&&(E.length<T.length||T.length!==1&&i.push({code:"slotNotPure",nodeId:w.id,message:`${_} must contain exactly one question-set-only course.`}))});const b=new Set,m=(w,_)=>{b.has(w)&&i.push({code:"duplicateCourse",nodeId:_,message:"A course appears more than once in this path."}),b.add(w)},v=d.slice(g?1:0,d.length-(p?1:0));g&&m(u.children[0].id,u.id),p&&m(f.children[0].id,f.id);for(const w of v){const _=w.children??[];if(_.length===0&&i.push({code:"emptyLevel",nodeId:w.id,message:`"${w.name}" has no courses yet.`}),!s.length&&r.length>0){const E=as(w,t,o).filter(A=>!r.includes(A));E.length>0&&i.push({code:"levelSkillsOutOfScope",nodeId:w.id,message:`"${w.name}" has courses teaching skills outside the Prior Assessment: ${a(E)}.`})}for(const E of _)m(E.id,w.id),(t?yf((S=E.metadata)==null?void 0:S[t]):[]).length===0&&i.push({code:"courseMissingSkillTag",nodeId:E.id,message:`"${E.name}" has no skill tag.`})}if(s.length>0){for(const _ of ff(e,s,t,o)){const T=hl(ro(_,t,o),s);i.push({code:"courseOutsideRole",nodeId:_.id,message:`"${_.name}" teaches skills outside the target role: ${a(T)}. Remove it from the path.`})}const w=hf(e,s,t,o);w.length>0&&i.push({code:"roleSkillsNotTaught",message:`This path must teach every skill of the target role. Not taught yet: ${a(w)}.`})}return i}async function Pw(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],o=r.length>1?r[r.length-1]:void 0;for(const[s,a]of[[n,"Prior Assessment"],[o,"Outcome Assessment"]]){if(!s||!st(s))continue;const i=s.children[0].id,c=await lf(i);no(c)||t.push({code:"slotCourseChanged",nodeId:s.id,message:`${a}'s course is no longer an Evaluation Course — pick a different course.`})}return t}function It(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function _f(e,t,r=0){var n;for(const o of e){if(o.id===t)return r;if((n=o.children)!=null&&n.length){const s=_f(o.children,t,r+1);if(s>=0)return s}}return-1}const Tf=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function kf(e,t,r,n){return e.map(o=>{if(o.id===t){const s=r.metadata??{},a=n!=null&&n.length?new Set([...Tf,...n]):Tf,i={};for(const c of a)c in r&&(i[c]=r[c]);return{...o,...r,metadata:{...o.metadata??{},...i,...s}}}return o.children&&o.children.length>0?{...o,children:kf(o.children,t,r,n)}:o})}function ka(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:ka(n.children,t,r)}:n)}function Ef(e,t,r,n){return e.map(o=>{if(o.id===t){const s=[...o.children??[]];return s.splice(n,0,r),{...o,children:s}}return o.children&&o.children.length>0?{...o,children:Ef(o.children,t,r,n)}:o})}function vl(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?vl(r.children,t):[]}))}function yl(e,t,r,n){return e.map(o=>{if(o.id===t){const s=[...o.children??[]],[a]=s.splice(r,1);return s.splice(n,0,a),{...o,children:s}}return o.children&&o.children.length>0?{...o,children:yl(o.children,t,r,n)}:o})}function Af(e,t){return e.map(r=>{const n=t[r.id]??r.id,o=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:o,children:r.children?Af(r.children,t):[]}})}function xw(e){let t=0;const r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t++,n.children&&r.push(...n.children)}return t}function Fw(e,t){const r=It(e,t);if(!r)return[];const n=[];let o=r;for(;o;)n.unshift({id:o.id,name:o.name}),o=o.parent?It(e,o.parent):void 0;return n}const ae=Yo((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var o;const n=((o=r[0])==null?void 0:o.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:o,getBreadcrumb:s}=t(),a=It(n,r),i=s(r),c={...(a==null?void 0:a.metadata)??{},...o[r]??{}};Z.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),lt.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:i,activeNodeMeta:c})},updateNode:(r,n,o,s)=>{var c;const a={...((c=It(t().treeData,r))==null?void 0:c.metadata)??{},...t().treeCache[r]??{}},i=Object.entries(n).some(([d,u])=>JSON.stringify(u)!==JSON.stringify(a[d]));if(e(d=>({treeData:kf(d.treeData,r,n,o),treeCache:{...d.treeCache,[r]:{...d.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const d=It(t().treeData,r);e(u=>({activeNodeMeta:{...(d==null?void 0:d.metadata)??{},...u.treeCache[r]??{}}}))}i&&!(s!=null&&s.silent)&&t().markDirty()},addNode:(r,n)=>{var g,p,b;const o=t(),s=Z.getState().editorProfile,a=((p=(g=Z.getState().editorConfig)==null?void 0:g.config)==null?void 0:p.maxDepth)??s.maxDepth,i=_f(o.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const c="temp-"+Math.random().toString(36).slice(2),d={id:c,identifier:c,name:s.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:crypto.randomUUID(),name:s.defaultUnitName,contentType:s.unitContentType,primaryCategory:s.unitPrimaryCategory,visibility:"Parent"}},u=((b=It(o.treeData,r))==null?void 0:b.children)??[],f=s.derivedRoles&&os(u,"post");return e(m=>({treeData:f?Ef(m.treeData,r,d,u.length-1):ka(m.treeData,r,d),treeCache:{...m.treeCache,[c]:{...d.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var s,a,i;const n=(s=t().treeData[0])==null?void 0:s.id;if(r===n)return!1;if(Z.getState().editorProfile.derivedRoles){const c=It(t().treeData,r),d=c!=null&&c.parent?It(t().treeData,c.parent):void 0,u=((a=t().treeData[0])==null?void 0:a.children)??[],f=d?u.findIndex(g=>g.id===d.id):-1;if(f===0||f===u.length-1){const g=(d.children??[]).filter(p=>p.id!==r);if(g.length===1&&((i=g[0].metadata)!=null&&i.isAssessmentCourse))return!1}}return e(c=>({treeData:vl(c.treeData,r),selectedNodeId:c.selectedNodeId===r?null:c.selectedNodeId})),!0},reorderChildren:(r,n,o)=>{var i;const s=Z.getState().editorProfile,a=(i=t().treeData[0])==null?void 0:i.id;if(s.derivedRoles&&r===a){const c=It(t().treeData,r);if(c!=null&&c.children&&!Dw(c.children,n,o))return}e(c=>({treeData:yl(c.treeData,r,n,o)}))},moveNode:(r,n,o)=>{var d,u,f;const s=Z.getState().editorProfile,a=It(t().treeData,r),i=It(t().treeData,o);if(!(i!=null&&i.isFolder))return;const c=(d=t().treeData[0])==null?void 0:d.id;if(!(s.derivedRoles&&(a!=null&&a.isFolder)&&o!==c)){if(s.derivedRoles&&a&&!a.isFolder){const g=!!((u=a.metadata)!=null&&u.isAssessmentCourse),p=((f=t().treeData[0])==null?void 0:f.children)??[];if(!vf(i,g,ml(p,i)))return}e(g=>{const p=It(g.treeData,r);if(!p)return g;let b=vl(g.treeData,r);return b=ka(b,o,{...p,parent:o}),{treeData:b}}),t().markDirty()}},addResource:(r,n,o)=>{var b,m,v,y,C,S;const s=Z.getState().editorConfig,a=Z.getState().editorProfile,i=(b=t().treeData[0])==null?void 0:b.id,c=!!(o!=null&&o.isAssessmentCourse);if(a.derivedRoles&&n===i){if(!c||It(t().treeData,r.identifier))return!1;const w=t().treeData[0],_=(w==null?void 0:w.children)??[],T=(o==null?void 0:o.slot)??Lw(_);if(!T||os(_,T))return!1;const E=t().addNode(i,"unit");if(!E)return!1;const{learningPath:A}=Yi.getState().labelConfig;if(t().updateNode(E,{name:T==="pre"?A.priorAssessmentLabel:A.outcomeAssessmentLabel}),T==="pre"){const x=(((v=(m=t().treeData[0])==null?void 0:m.children)==null?void 0:v.length)??1)-1;e(B=>({treeData:yl(B.treeData,i,x,0)}))}return t().addResource(r,E,o)}if(!(((y=s==null?void 0:s.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===i||It(t().treeData,r.identifier))return!1;const u=It(t().treeData,n);if(!(u!=null&&u.isFolder))return!1;if(a.derivedRoles){const w=((C=t().treeData[0])==null?void 0:C.children)??[];if(!vf(u,c,ml(w,u)))return!1}const f=((S=s==null?void 0:s.config)==null?void 0:S.maxContentsLimit)??1200;if(xw(t().treeData)>=f)return!1;const p={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:{...r,...c?{isAssessmentCourse:!0}:{}}};return e(w=>({treeData:ka(w.treeData,n,p)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=Z.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(o=>{const s=o.treeData[0];if(!s)return o;const a=[];for(const i of s.children??[]){const c=st(i),d=(i.children??[]).filter(u=>{var p;if(u.isFolder)return!0;const f=(p=u.metadata)==null?void 0:p.framework,g=!f||(Array.isArray(f)?f.includes(r):f===r);return g||n++,g});c&&d.length===0||a.push(d.length===(i.children??[]).length?i:{...i,children:d})}return n===0?o:{treeData:[{...s,children:a}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(o=>{const s=o.treeData[0];if(!s)return o;const a={...o.treeCache},i=(s.children??[]).map(c=>{var g,p;if(!(((g=c.metadata)==null?void 0:g[r])!==void 0||((p=a[c.id])==null?void 0:p[r])!==void 0))return c;n++;const{[r]:u,...f}=c.metadata??{};if(a[c.id]){const{[r]:b,...m}=a[c.id];a[c.id]=m}return{...c,metadata:f}});return n===0?o:{treeData:[{...s,children:i}],treeCache:a}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const o=Af(n.treeData,r),s={};for(const[i,c]of Object.entries(n.treeCache)){const d=r[i]??i,{isNew:u,...f}=c;s[d]=f}const a=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:o,treeCache:s,selectedNodeId:a}})},getNodeById:r=>It(t().treeData,r),getChildrenOf:r=>{const n=It(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>Fw(t().treeData,r)})),Mw={spin:"_spin_1ah4d_9"};function ue(){return Yi(e=>e.labelConfig)}const Bw=({size:e=16,color:t="currentColor"})=>{const r=ue();return l.jsx("svg",{className:Mw.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:l.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},Re=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:o,children:s,className:a,type:i="button"})=>l.jsxs("button",{type:i,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${a??""}`,onClick:o,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(Bw,{size:14}):null,s]}),If=({size:e=16,...t})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[l.jsx("circle",{cx:"58",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("circle",{cx:"8",cy:"58",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{d:"M52 12 H24 A12 12 0 0 0 24 36 H40 A12 12 0 0 1 40 60 H12",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]});async function Lf(e){var r,n;return(n=(r=(await Ve.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function $w(e){var r,n;return((n=(r=(await Ve.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function Ea(e,t){const r=Ur({queryKey:["framework",e],queryFn:()=>Lf(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],o=Ur({queryKey:["framework",n],queryFn:()=>Lf(n),enabled:!!n,staleTime:300*1e3}),s=o.data?[o.data]:[];return{organisationFramework:r.data,targetFrameworks:s,isLoading:r.isLoading||o.isLoading}}async function qw(e){var n,o;return(((o=(n=(await Ve.post("/action/composite/v3/search",{request:{filters:{objectType:["CompetencyFramework"],status:["Live"],...e?{channel:[e]}:{}},fields:["identifier","name"],limit:100,sort_by:{name:"asc"}}})).data)==null?void 0:n.result)==null?void 0:o.CompetencyFramework)??[]).map(s=>({identifier:s.identifier,name:s.name||s.identifier}))}async function jw(e){var r,n;return(n=(r=(await Ve.get(`/action/competency-framework/v3/read/${encodeURIComponent(e)}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function Uw(e){var t,r;try{const o=((t=(await Ve.get(`/action/competency/v1/role/list/${encodeURIComponent(e)}`)).data)==null?void 0:t.result)??{};return Object.entries(o.roles??{}).map(([s,a])=>{var i;return{id:s,name:((i=o.roleNames)==null?void 0:i[s])||s,skills:a??[]}}).sort((s,a)=>s.name.localeCompare(a.name))}catch(n){if(((r=n.response)==null?void 0:r.status)===404)return[];throw n}}function Df(e){var r;const t=(e??[]).map((n,o)=>({c:n,key:typeof n.index=="number"?n.index:o})).sort((n,o)=>n.key-o.key);return(r=t[t.length-1])==null?void 0:r.c}function Hw(e){var t;return((t=Df(e))==null?void 0:t.code)||void 0}function Nf(e){return e.flatMap(t=>[t,...Nf(t.children??[])])}function Vw(e){var t;return Nf(((t=Df(e))==null?void 0:t.terms)??[])}function zw(e){const t=new Set(e.map(o=>o.code).filter(o=>!!o)),r=new Set(e.map(o=>{var s,a;return o.parentCode??((a=(s=o.parents)==null?void 0:s.find(i=>i.code))==null?void 0:a.code)}).filter(o=>!!o&&t.has(o))),n=e.filter(o=>{var s;return o.code&&!((s=o.children)!=null&&s.length)&&!r.has(o.code)}).map(o=>o.code);return[...new Set(n)].sort()}function Rw(e){const t=Vw(e),r=new Map;return t.forEach(n=>{n.code&&n.name&&!r.has(n.code)&&r.set(n.code,n.name)}),zw(t).map(n=>({code:n,name:r.get(n)??n})).sort((n,o)=>n.name.localeCompare(o.name))}const Qw=[],Ww=[],Gw=[],Kw=[],bl=600*1e3;function Yw(e){const t=Rw(e==null?void 0:e.categories);return{skills:t,skillField:Hw(e==null?void 0:e.categories),terms:t.map(r=>({identifier:r.code,code:r.code,name:r.name}))}}function Of(e,t=!0){const r=Ur({queryKey:["competency-frameworks",e??""],queryFn:()=>qw(e),enabled:t,staleTime:bl});return{frameworks:r.data??Qw,isLoaded:r.isSuccess}}function Cl(e){var n,o,s;const t=Ur({queryKey:["competency-framework",e],queryFn:()=>jw(e),enabled:!!e,staleTime:bl,select:Yw}),r=((n=t.data)==null?void 0:n.skills)??Ww;return{skills:r,skillField:(o=t.data)==null?void 0:o.skillField,terms:((s=t.data)==null?void 0:s.terms)??Kw,isLoaded:t.isSuccess,usableFrameworkId:e&&t.isSuccess&&r.length>0?e:void 0}}function Pf(e){return{roles:Ur({queryKey:["competency-roles",e],queryFn:()=>Uw(e),enabled:!!e,staleTime:bl}).data??Gw}}const Zw=[],Xw=[];function Qr(){const e=Z(u=>u.editorProfile.key==="learningPath"),t=ae(u=>u.treeData[0]),r=ae(u=>u.treeCache),n=e?Ta(t,r):void 0,o=e?kw(t,r):void 0,{usableFrameworkId:s,skillField:a,terms:i}=Cl(n),{roles:c}=Pf(s),d=o?c.find(u=>u.id===o):void 0;return{frameworkId:s,terms:s?i:Xw,skillField:s?a:void 0,roleSkills:(d==null?void 0:d.skills)??Zw}}const xf=[];function Sl(e){if(!(e!=null&&e.length))return null;const t=e.find(n=>n.code==="skill");if(t)return{code:t.code,terms:t.terms??xf};const r=e.reduce((n,o)=>(o.index??-1/0)>(n.index??-1/0)?o:n);return{code:r.code,terms:r.terms??xf}}function Jw(e){var n,o,s,a;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!st(t))return;const r=(a=(s=(o=t==null?void 0:t.children)==null?void 0:o[0])==null?void 0:s.metadata)==null?void 0:a.framework;return Array.isArray(r)?r[0]:r}function e_(e){const{competency:t,storedFramework:r,channelFrameworks:n,curriculum:o}=e;return t||(r&&(!n||n.includes(r))?null:o)}function _r(){var b,m;const e=Z(v=>v.editorConfig),t=Z(v=>v.contentFramework),r=ae(v=>v.treeData),n=Jw(r[0])??t??((b=e==null?void 0:e.context)==null?void 0:b.framework),{organisationFramework:o}=Ea(n),s=Qr(),a=Z(v=>v.editorProfile.key==="learningPath"),i=ae(v=>v.treeCache),c=a?Ta(r[0],i):void 0,d=(m=e==null?void 0:e.context)==null?void 0:m.channel,{frameworks:u,isLoaded:f}=Of(d,!!c),g=Sl(o==null?void 0:o.categories),p=h.useMemo(()=>f?u.map(v=>v.identifier):void 0,[f,u]);return h.useMemo(()=>e_({competency:s.frameworkId?{code:s.skillField??cf,terms:s.terms}:null,storedFramework:c,channelFrameworks:p,curriculum:g}),[s.frameworkId,s.skillField,s.terms,c,p,g==null?void 0:g.code,g==null?void 0:g.terms])}function t_(e,t,r,n=[]){var c,d;if(n.length)return{scope:[...n],source:"role"};const o={scope:((t==null?void 0:t.terms)??[]).map(u=>u.code),source:"manual"};if(!t)return o;const s=pf(e);if(!s)return o;const i=((c=r[s.id])==null?void 0:c[t.code])??((d=s.metadata)==null?void 0:d[t.code]);return{scope:on(i,t.terms),source:"prior"}}function oo(){const e=_r(),t=ae(o=>o.treeData),r=ae(o=>o.treeCache),{roleSkills:n}=Qr();return h.useMemo(()=>t_(t[0],e,r,n),[t,e,r,n])}const Ne={overlay:"_overlay_12iiv_1",modal:"_modal_12iiv_15",modalHeader:"_modalHeader_12iiv_27",modalHeaderClose:"_modalHeaderClose_12iiv_37",modalBody:"_modalBody_12iiv_55",modalFooter:"_modalFooter_12iiv_62",checkRow:"_checkRow_12iiv_69",formGroup:"_formGroup_12iiv_112",textarea:"_textarea_12iiv_123",sliderGroup:"_sliderGroup_12iiv_144",sliderValue:"_sliderValue_12iiv_156",sliderLabels:"_sliderLabels_12iiv_164",sectionTitle:"_sectionTitle_12iiv_172"},r_=({objectType:e,onConfirm:t,onCancel:r})=>{const n=ue(),o=ae(m=>m.treeData[0]),s=ae(m=>m.treeCache),a=_r(),{scope:i}=oo(),{roleSkills:c}=Qr(),[d,u]=h.useState(null),f=gl(o,a==null?void 0:a.code,i,s,a==null?void 0:a.terms,c);h.useEffect(()=>{let m=!1;return u(null),Pw(o).then(v=>{m||u(v)}).catch(v=>{console.error("[PublishChecklist] assessment-course re-check failed:",v),m||u([{code:"slotCourseCheckFailed",message:n.learningPath.assessmentCheckFailedToast}])}),()=>{m=!0}},[o]);const g=d===null,p=[...f,...d??[]],b=!g&&p.length===0;return l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:p.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:g?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ne.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:p.map((m,v)=>l.jsx("li",{children:m.message},`${m.code}-${m.nodeId??v}`))})]})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:t,disabled:!b,children:n.publishChecklist.yesButton})]})]})})},n_=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ue(),o=Z(g=>{var p,b;return(b=(p=g.editorConfig)==null?void 0:p.config)==null?void 0:b.objectType})||"Content",s=Z(g=>g.editorProfile.key==="learningPath"),a=Z(g=>g.publishChecklist)??[],[i,c]=h.useState({}),d=a.every(g=>i[g.code]),u=a.length===0||d,f=()=>{t()};return s?l.jsx(r_,{objectType:o,onConfirm:t,onCancel:r}):l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",o]}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:a.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",o,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ne.sectionTitle,children:n.publishChecklist.checklistInstructions}),l.jsxs("label",{className:Ne.checkRow,children:[l.jsx("input",{type:"checkbox",checked:d,onChange:g=>c(Object.fromEntries(a.map(p=>[p.code,g.target.checked])))}),l.jsx("span",{children:l.jsx("strong",{children:n.publishChecklist.selectAllLabel})})]}),a.map(g=>l.jsxs("label",{className:Ne.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!i[g.code],onChange:p=>c(b=>({...b,[g.code]:p.target.checked}))}),l.jsx("span",{children:g.label})]},g.code))]})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:f,disabled:!u,children:n.publishChecklist.yesButton})]})]})})},o_=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const o=ue(),[s,a]=h.useState(""),[i,c]=h.useState(7),d=t==="approve",u=d?o.qualityParamsModal.reviewQualityTitle:o.qualityParamsModal.rejectContentTitle,f=!d&&s.trim().length===0,g=()=>{d?r(s.trim(),i):r(s.trim())};return l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:u}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:n,"aria-label":o.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:d?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ne.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:o.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Ne.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:i,onChange:p=>c(Number(p.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":i}),l.jsx("span",{className:Ne.sliderValue,children:i})]}),l.jsxs("div",{className:Ne.sliderLabels,children:[l.jsx("span",{children:o.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:o.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Ne.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[o.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:o.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:Ne.textarea,placeholder:o.qualityParamsModal.commentPlaceholder,value:s,onChange:p=>a(p.target.value),rows:4})]})]}):l.jsxs("div",{className:Ne.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[o.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:Ne.textarea,placeholder:o.qualityParamsModal.rejectReasonPlaceholder,value:s,onChange:p=>a(p.target.value),rows:5,required:!0,"aria-required":"true"}),s.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:o.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:n,children:o.qualityParamsModal.cancelButton}),l.jsx(Re,{variant:d?"primary":"danger",onClick:g,disabled:f,children:d?o.qualityParamsModal.approveButton:o.qualityParamsModal.rejectButton})]})]})})},s_=({message:e,onConfirm:t,onCancel:r})=>{const n=ue();return Ke.createPortal(l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Ff=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function a_(e,t={}){var c,d,u,f;const n={"organisations.roles":[((c=t.objectType)==null?void 0:c.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const o=e.includes("@"),s=/^\d{10,}$/.test(e.trim()),a={filters:n,fields:Ff,offset:0,limit:t.limit??200};return o?n.email=e.trim():s?n.phone=e.trim():a.query=e,((f=(u=(d=(await Ve.post("/action/user/v1/search",{request:a},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:d.result)==null?void 0:u.response)==null?void 0:f.content)??[]}async function i_(e){var r,n,o;return e.length?((o=(n=(r=(await Ve.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Ff,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:o.content)??[]:[]}async function l_(e){var r,n;return((n=(r=(await Ve.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const Qe={container:"_container_r27rp_1",header:"_header_r27rp_13",title:"_title_r27rp_22",closeBtn:"_closeBtn_r27rp_29",body:"_body_r27rp_45",label:"_label_r27rp_54",searchSection:"_searchSection_r27rp_62",searchRow:"_searchRow_r27rp_68",searchInput:"_searchInput_r27rp_74",searchSpinner:"_searchSpinner_r27rp_89",resultsList:"_resultsList_r27rp_105",resultItem:"_resultItem_r27rp_118",userInfo:"_userInfo_r27rp_133",userName:"_userName_r27rp_141",userEmail:"_userEmail_r27rp_150",userOrg:"_userOrg_r27rp_158",noResults:"_noResults_r27rp_167",collabSection:"_collabSection_r27rp_174",sectionTitle:"_sectionTitle_r27rp_179",badge:"_badge_r27rp_189",emptyCollab:"_emptyCollab_r27rp_203",collabList:"_collabList_r27rp_214",collabItem:"_collabItem_r27rp_223",userAvatar:"_userAvatar_r27rp_237",error:"_error_r27rp_251",success:"_success_r27rp_257",footer:"_footer_r27rp_263"},c_=({contentId:e,onClose:t})=>{var x,B;const r=ue(),n=Z(D=>D.editorConfig),o=(x=n==null?void 0:n.context)==null?void 0:x.channel,s=(B=n==null?void 0:n.config)==null?void 0:B.objectType,[a,i]=h.useState(""),[c,d]=h.useState([]),[u,f]=h.useState(!1),[g,p]=h.useState([]),[b,m]=h.useState(!1),[v,y]=h.useState(""),[C,S]=h.useState(!1),w=h.useRef(null);h.useEffect(()=>{let D=!1;return(async()=>{try{const F=await lf(e),M=(F==null?void 0:F.collaborators)??[];if(!M.length)return;const P=await i_(M);if(D)return;const V=M.map(ne=>P.find(W=>W.identifier===ne)??{identifier:ne,firstName:ne});p(V)}catch{}})(),()=>{D=!0}},[e]),h.useEffect(()=>{w.current&&clearTimeout(w.current);const D=a.trim();if(D.length<2){d([]);return}return w.current=setTimeout(async()=>{f(!0);try{const F=await a_(D,{rootOrgId:o,objectType:s}),M=new Set(g.map(P=>P.identifier));d(F.filter(P=>!M.has(P.identifier)))}catch{d([])}finally{f(!1)}},300),()=>{w.current&&clearTimeout(w.current)}},[a,g,o,s]);const _=h.useCallback(D=>{p(F=>F.find(M=>M.identifier===D.identifier)?F:[...F,D]),d(F=>F.filter(M=>M.identifier!==D.identifier)),S(!1)},[]),T=h.useCallback(D=>{p(F=>F.filter(M=>M.identifier!==D)),S(!1)},[]),E=h.useCallback(async()=>{m(!0),y(""),S(!1);try{await _w(e,g.map(D=>D.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{m(!1)}},[e,g,r.manageCollaborators.saveFailed]),A=D=>`${D.firstName}${D.lastName?` ${D.lastName}`:""}`;return l.jsxs("div",{className:Qe.container,children:[l.jsxs("div",{className:Qe.header,children:[l.jsx("h2",{className:Qe.title,children:r.manageCollaborators.title}),l.jsx("button",{className:Qe.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(Or,{size:18})})]}),l.jsxs("div",{className:Qe.body,children:[l.jsxs("div",{className:Qe.searchSection,children:[l.jsx("label",{className:Qe.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:Qe.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Qe.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:a,onChange:D=>i(D.target.value)}),u&&l.jsx("span",{className:Qe.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:Qe.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(D=>{var F,M,P,V;return l.jsxs("li",{className:Qe.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Qe.userInfo,children:[l.jsx("span",{className:Qe.userName,children:A(D)}),D.email&&l.jsx("span",{className:Qe.userEmail,children:D.email}),(((M=(F=D.organisations)==null?void 0:F[0])==null?void 0:M.orgName)??D.rootOrgName)&&l.jsx("span",{className:Qe.userOrg,children:((V=(P=D.organisations)==null?void 0:P[0])==null?void 0:V.orgName)??D.rootOrgName})]}),l.jsx(Re,{variant:"primary",size:"sm",onClick:()=>_(D),children:r.manageCollaborators.add})]},D.identifier)})}),a.trim().length>=2&&!u&&c.length===0&&l.jsx("p",{className:Qe.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:Qe.collabSection,children:[l.jsxs("h3",{className:Qe.sectionTitle,children:[r.manageCollaborators.currentCollaborators,g.length>0&&l.jsx("span",{className:Qe.badge,children:g.length})]}),g.length===0?l.jsx("p",{className:Qe.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:Qe.collabList,children:g.map(D=>{var F,M,P,V;return l.jsxs("li",{className:Qe.collabItem,children:[l.jsx("div",{className:Qe.userAvatar,"aria-hidden":"true",children:A(D).charAt(0).toUpperCase()}),l.jsxs("div",{className:Qe.userInfo,children:[l.jsx("span",{className:Qe.userName,children:A(D)}),D.email&&l.jsx("span",{className:Qe.userEmail,children:D.email}),(((M=(F=D.organisations)==null?void 0:F[0])==null?void 0:M.orgName)??D.rootOrgName)&&l.jsx("span",{className:Qe.userOrg,children:((V=(P=D.organisations)==null?void 0:P[0])==null?void 0:V.orgName)??D.rootOrgName})]}),l.jsx(Re,{variant:"danger",size:"sm",onClick:()=>T(D.identifier),children:r.manageCollaborators.remove})]},D.identifier)})})]}),v&&l.jsx("p",{className:Qe.error,role:"alert",children:v}),C&&l.jsx("p",{className:Qe.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:Qe.footer,children:[l.jsx(Re,{variant:"ghost",onClick:t,disabled:b,children:r.manageCollaborators.cancel}),l.jsx(Re,{variant:"primary",isLoading:b,onClick:E,children:r.manageCollaborators.save})]})]})};async function d_(e){return(await Ve.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function u_(e,t){var o;const n=((o=(await Ve.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:o.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function f_(e){var n;const r=((n=(await Ve.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const Ee={topbar:"_topbar_lk8lp_1",left:"_left_lk8lp_15",right:"_right_lk8lp_23",backBtn:"_backBtn_lk8lp_30",title:"_title_lk8lp_49",profileBadge:"_profileBadge_lk8lp_61",statusChip:"_statusChip_lk8lp_76",savedIndicator:"_savedIndicator_lk8lp_88",unsaved:"_unsaved_lk8lp_98",iconBtn:"_iconBtn_lk8lp_103",iconBtnLabel:"_iconBtnLabel_lk8lp_130",qrDropdown:"_qrDropdown_lk8lp_134",qrMenu:"_qrMenu_lk8lp_138",reviewBtns:"_reviewBtns_lk8lp_173",sourcingBtns:"_sourcingBtns_lk8lp_182",modalOverlay:"_modalOverlay_lk8lp_191",sbOverlay:"_sbOverlay_lk8lp_201",sbModal:"_sbModal_lk8lp_211",sbModalHeader:"_sbModalHeader_lk8lp_222",sbModalTitle:"_sbModalTitle_lk8lp_230",sbModalClose:"_sbModalClose_lk8lp_237",sbModalBody:"_sbModalBody_lk8lp_250",sbLabel:"_sbLabel_lk8lp_257",sbTextarea:"_sbTextarea_lk8lp_264",sbError:"_sbError_lk8lp_281",sbModalFooter:"_sbModalFooter_lk8lp_288"};function h_(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function p_(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const m_=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:o="primary",onConfirm:s,onCancel:a})=>{const i=ue(),[c,d]=h.useState(""),u=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:Ee.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${u}-title`,children:l.jsxs("div",{className:Ee.sbModal,children:[l.jsxs("div",{className:Ee.sbModalHeader,children:[l.jsx("span",{id:`${u}-title`,className:Ee.sbModalTitle,children:e}),l.jsx("button",{className:Ee.sbModalClose,onClick:a,"aria-label":i.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:Ee.sbModalBody,children:[l.jsxs("label",{className:Ee.sbLabel,htmlFor:`${u}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${u}-comment`,className:Ee.sbTextarea,placeholder:r,value:c,onChange:f=>d(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:Ee.sbError,children:i.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:Ee.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:a,children:i.reviewCommentModal.cancelButton}),l.jsx(Re,{variant:o,onClick:()=>s(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},g_=({onConfirm:e,onCancel:t})=>{const r=ue(),[n,o]=h.useState(!1),s=Z(p=>p.editorProfile.key==="learningPath"),a=ae(p=>p.treeData[0]),i=ae(p=>p.treeCache),c=_r(),{scope:d}=oo(),{roleSkills:u}=Qr(),f=s?gl(a,c==null?void 0:c.code,d,i,c==null?void 0:c.terms,u):[],g=f.length>0;return l.jsx("div",{className:Ee.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:Ee.sbModal,children:[l.jsxs("div",{className:Ee.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:Ee.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:Ee.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:Ee.sbModalBody,children:g?l.jsxs(l.Fragment,{children:[l.jsx("p",{style:{margin:"0 0 8px",fontSize:13,fontWeight:600},children:r.learningPath.resolveBeforeSendingForReview}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:f.map((p,b)=>l.jsx("li",{children:p.message},`${p.code}-${p.nodeId??b}`))})]}):l.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[l.jsx("input",{type:"checkbox",checked:n,onChange:p=>o(p.target.checked),style:{marginTop:2}}),l.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",l.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",l.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),l.jsxs("div",{className:Ee.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!g&&l.jsx(Re,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},v_=({onConfirm:e,onCancel:t})=>{const r=ue(),[n,o]=h.useState(""),s=parseInt(n,10),a=!isNaN(s)&&s>=2&&s<=250;return l.jsx("div",{className:Ee.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:Ee.sbModal,children:[l.jsxs("div",{className:Ee.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:Ee.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:Ee.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:Ee.sbModalBody,children:[l.jsxs("label",{className:Ee.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:Ee.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:i=>o(i.target.value)}),n&&!a&&l.jsx("p",{className:Ee.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:Ee.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(Re,{variant:"primary",onClick:()=>e(s),disabled:!a,children:r.generateQRModal.generateButton})]})]})})},y_=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:o=!0,onToolbarEvent:s})=>{var ee,fe;const a=ue(),c=ae(X=>X.treeData)[0],d=(c==null?void 0:c.name)??a.contextualEditor.untitledPlaceholder,u=p_(((ee=c==null?void 0:c.metadata)==null?void 0:ee.status)??(c==null?void 0:c.status),a.topbar.draftStatusFallback),f=Z(X=>{var Se,Me,re,ce;return((Me=(Se=X.editorConfig)==null?void 0:Se.context)==null?void 0:Me.contentId)??((ce=(re=X.editorConfig)==null?void 0:re.context)==null?void 0:ce.identifier)??""}),{activeModal:g,modalData:p,closeModal:b,openModal:m}=lt(),v=Z(X=>X.buttonLoaders),y=Z(X=>X.categoryMeta),C=Z(X=>X.editorProfile),S=C.key==="learningPath",w=C.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[_,T]=h.useState(!1),[E,A]=h.useState(!1),[x,B]=h.useState(!1),D=h.useRef(null),[F,M]=h.useState(!1);h.useEffect(()=>{if(!x)return;const X=Se=>{var Me;(Me=D.current)!=null&&Me.contains(Se.target)||B(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[x]);const[P,V]=h.useState(!1),[ne,W]=h.useState(!1),{updateNode:de}=ae(),ie=(fe=c==null?void 0:c.metadata)==null?void 0:fe.qrCodeProcessId,ve=h.useCallback(async X=>{if(f){M(!1),V(!0);try{const{processId:Se,reservedDialcodes:Me}=await u_(f,X);Se&&c&&de(c.id,{qrCodeProcessId:Se,reservedDialcodes:Me}),be.success(a.topbar.qrGenerationStartedToast)}catch{be.error(a.topbar.qrGenerationFailedToast)}finally{V(!1)}}},[f,c,de,a]),me=h.useCallback(async()=>{if(!ie){be.error(a.topbar.qrCodesNotGeneratedToast);return}W(!0);try{const X=await f_(ie);if(X.status==="in-process"){be(a.topbar.qrGenerationInProgressToast,{icon:l.jsx(zr,{size:16})});return}const Se=X.url;if(!Se){be.error(a.topbar.qrCodesNotReadyToast);return}const Me=await fetch(Se).then(we=>we.blob()),re=await new Promise(we=>{const Be=new FileReader;Be.onloadend=()=>we(Be.result),Be.readAsDataURL(Me)}),ce=(c==null?void 0:c.metadata)??{},G=we=>Array.isArray(we)?we.join("_"):typeof we=="string"?we:"",H=[f,G(ce.medium),G(ce.gradeLevel),G(ce.subject)].filter(Boolean),Ae=new Date().toISOString().replace(/[:.]/g,"-"),Te=`${H.join("_")}_${Ae}.zip`,Ie=document.createElement("a");Ie.href=re,Ie.download=Te,Ie.style.display="none",document.body.appendChild(Ie),Ie.click(),document.body.removeChild(Ie),be.success(a.topbar.qrCodesDownloadedToast)}catch{be.error(a.topbar.qrCodesDownloadFailedToast)}finally{W(!1)}},[ie,c,f,a]),z=e==="edit",Ce=e==="review",ke=e==="sourcingreview",U=e==="read",q=h.useCallback((X,Se)=>{s({action:X,data:Se})},[s]),le=h.useCallback(()=>{b(),q("publish")},[b,q]),ge=h.useCallback((X,Se)=>{const Me=p==null?void 0:p.action;b(),Me==="approve"?q("sourcingApprove",{comment:X,score:Se}):q("reject",{comment:X})},[b,q,p]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:Ee.topbar,role:"banner",children:[l.jsxs("div",{className:Ee.left,children:[l.jsx("button",{className:Ee.backBtn,onClick:()=>q("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:l.jsx($i,{size:18})}),l.jsx("h1",{className:Ee.title,title:d,children:d}),S&&l.jsxs("span",{className:Ee.profileBadge,children:[l.jsx(If,{size:13,"aria-hidden":"true"}),a.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${Ee.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${u}`,children:u})]}),l.jsxs("div",{className:Ee.right,children:[t?l.jsx("span",{className:Ee.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&z?l.jsx("span",{className:`${Ee.savedIndicator} ${Ee.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?l.jsxs("span",{className:Ee.savedIndicator,"aria-live":"polite",children:[l.jsx(Kn,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",h_(n)]}):null,!U&&!Ce&&!ke&&u!=="Review"&&l.jsx("span",{title:o?void 0:a.topbar.fillRequiredFieldsTooltip,children:l.jsx(Re,{variant:"ghost",size:"sm",onClick:()=>q("saveCollection"),disabled:!o,children:a.topbar.saveAsDraftButton})}),z&&l.jsxs(l.Fragment,{children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>A(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(Rb,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),C.features.collaborators&&l.jsx("button",{className:Ee.iconBtn,onClick:()=>m("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:l.jsx(Xb,{size:16,"aria-hidden":"true"})}),w&&l.jsxs("div",{className:Ee.qrDropdown,ref:D,children:[l.jsxs("button",{className:Ee.iconBtn,onClick:()=>B(X=>!X),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":x,children:[l.jsx(nu,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:Ee.iconBtnLabel,children:a.topbar.qrCodesLabel}),l.jsx(rn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),x&&l.jsxs("div",{className:Ee.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{B(!1),M(!0)},disabled:P,children:[l.jsx(nu,{size:14}),P?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{B(!1),me()},disabled:ne||!ie,children:[l.jsx(Nb,{size:14}),ne?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),Ce&&l.jsxs("div",{className:Ee.reviewBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>m("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(Yd,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>T(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(ou,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),ke&&l.jsxs("div",{className:Ee.sourcingBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>m("qualityParams",{action:"approve"}),children:[l.jsx(Wb,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>m("qualityParams",{action:"reject"}),children:[l.jsx(ou,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),g==="publishChecklist"&&l.jsx(n_,{contentId:f,onConfirm:le,onCancel:b}),g==="qualityParams"&&l.jsx(o_,{contentId:f,action:(p==null?void 0:p.action)??"reject",onConfirm:ge,onCancel:b}),g==="manageCollaborators"&&l.jsx("div",{className:Ee.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(c_,{contentId:f,onClose:b})}),g==="confirmDelete"&&l.jsx(s_,{message:(p==null?void 0:p.message)??"",onConfirm:()=>{const X=p==null?void 0:p.onConfirm;b(),X==null||X()},onCancel:b}),E&&l.jsx(g_,{onConfirm:()=>{A(!1),q("sendForReview")},onCancel:()=>A(!1)}),_&&l.jsx(m_,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:X=>{T(!1),q("reject",{comment:X})},onCancel:()=>T(!1)}),F&&l.jsx(v_,{onConfirm:ve,onCancel:()=>M(!1)})]})},b_=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const o=ue();return Ke.createPortal(l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:o.unsavedChangesModal.title}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:r,"aria-label":o.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:o.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:n,children:o.unsavedChangesModal.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,disabled:n,children:o.unsavedChangesModal.discardButton}),l.jsx(Re,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:o.unsavedChangesModal.saveButton})]})]})}),document.body)};var C_=Ri();const Mf=h.createContext(null);function Kt(){const e=h.useContext(Mf);if(e===null)throw new Error("No Tree Api Provided");return e}const Bf=h.createContext(null);function S_(){const e=h.useContext(Bf);if(e===null)throw new Error("Provide a NodesContext");return e}const $f=h.createContext(null);function w_(){const e=h.useContext($f);if(e===null)throw new Error("Provide a DnDContext");return e}const qf=h.createContext(0);function jf(){h.useContext(qf)}function Aa(e,t,r){return Math.max(Math.min(e,r),t)}function Uf(e){return e&&e.isLeaf}function Hf(e){return e&&e.isInternal&&!e.isOpen}function Vf(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const zf=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Rf=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function wl(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=wl(r,t);if(n)return n}return null}function Ia(e,t){if(t(e),e.children)for(let r of e.children)Ia(r,t)}function Qf(e){const t=Gf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=__(t,n);break}r==null||r.focus()}function Wf(e){const t=Gf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=T_(t,n);break}r==null||r.focus()}function __(e,t){return t+1<e.length?e[t+1]:e[0]}function T_(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Gf(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function is(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function so(e){return typeof e=="string"?e:e.id}function k_(e,...t){if(e)return e(...t)}function Kf(e){return new Promise((t,r)=>{let n=0;function o(){n+=1,n===100&&r(),e()?t():setTimeout(o,10)}o()})}function Yf(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function Zf(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const E_=Object.freeze(Object.defineProperty({__proto__:null,access:is,bound:Aa,dfs:wl,focusNextElement:Qf,focusPrevElement:Wf,getInsertIndex:Yf,getInsertParentId:Zf,identify:so,indexOf:Rf,isClosed:Hf,isDescendant:zf,isItem:Uf,isOpenWithEmptyChildren:Vf,safeRun:k_,waitFor:Kf,walk:Ia},Symbol.toStringTag,{value:"Module"})),A_={display:"flex",alignItems:"center",zIndex:1},I_={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},L_={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},D_=h.memo(function({top:t,left:r,indent:n}){const o={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},A_),o),children:[l.jsx("div",{style:Object.assign({},L_)}),l.jsx("div",{style:Object.assign({},I_)})]})});function N_({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:o=>o.stopPropagation(),onClick:e.handleClick,children:n}))}function O_(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx(x_,Object.assign({},e)):l.jsx(P_,Object.assign({},e))]})}function P_(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function x_({node:e}){const t=h.useRef();return h.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const ls="__REACT_ARBORIST_INTERNAL_ROOT__";function Xf(e){var t;function r(s,a,i){const c=e.accessId(s),d=new cs({tree:e,data:s,level:a,parent:i,id:c,children:null,isDraggable:e.isDraggable(s),rowIndex:null}),u=e.accessChildren(s);return u&&(d.children=u.map(f=>r(f,a+1,d))),d}const n=new cs({tree:e,id:ls,data:{id:ls},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),o=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=o.map(s=>r(s,0,n)),n}class cs{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===ls}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new cs(Object.assign({},this))}edit(){return this.tree.edit(this)}}function _l(e){return{type:"EDIT",id:e}}function F_(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function ao(e){return{type:"FOCUS",id:e}}function M_(){return{type:"TREE_BLUR"}}function B_(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}const Tl={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function Jf(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function $_(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:Jf(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:Jf(e.unfiltered,t)}):e}const io=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},sn={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:so(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(so)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(so)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:so(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:so(e)})};function q_(e=io().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const lo={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function j_(e=io().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return io().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const U_={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},H_=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},V_=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function eh({offset:e,mouse:t,id:r,dragIds:n,isDragging:o}){return l.jsxs(z_,{isDragging:o,children:[l.jsx(R_,{offset:e,children:l.jsx(W_,{id:r,dragIds:n})}),l.jsx(Q_,{mouse:t,count:n.length})]})}const z_=h.memo(function(t){return t.isDragging?l.jsx("div",{style:U_,children:t.children}):null});function R_(e){return l.jsx("div",{className:"row preview",style:H_(e.offset),children:e.children})}function Q_(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:V_(r),children:t}):null}const W_=h.memo(function(t){const r=Kt(),n=r.get(t.id);return n?l.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function kl(){return kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kl.apply(null,arguments)}function th(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function El(e,t){return El=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},El(e,t)}function G_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,El(e,t)}var rh=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function K_(e,t){return!!(e===t||rh(e)&&rh(t))}function Y_(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!K_(e[r],t[r]))return!1;return!0}function Al(e,t){t===void 0&&(t=Y_);var r,n=[],o,s=!1;function a(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return s&&r===this&&t(i,n)||(o=e.apply(this,i),s=!0,r=this,n=i),o}return a}var Z_=typeof performance=="object"&&typeof performance.now=="function",nh=Z_?function(){return performance.now()}:function(){return Date.now()};function oh(e){cancelAnimationFrame(e.id)}function X_(e,t){var r=nh();function n(){nh()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Il=-1;function sh(e){if(e===void 0&&(e=!1),Il===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Il=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Il}var co=null;function ah(e){if(e===void 0&&(e=!1),co===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?co="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?co="negative":co="positive-ascending"),document.body.removeChild(t),co}return co}process.env.NODE_ENV;var J_=150,eT=function(t,r){return t},La=null,Da=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(La=new WeakSet,Da=new WeakSet);function ih(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,s=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,i=e.getStopIndexForStartIndex,c=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=(function(f){G_(g,f);function g(b){var m;return m=f.call(this,b)||this,m._instanceProps=c(m.props,th(m)),m._outerRef=void 0,m._resetIsScrollingTimeoutId=null,m.state={instance:th(m),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof m.props.initialScrollOffset=="number"?m.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},m._callOnItemsRendered=void 0,m._callOnItemsRendered=Al(function(v,y,C,S){return m.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:S})}),m._callOnScroll=void 0,m._callOnScroll=Al(function(v,y,C){return m.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:C})}),m._getItemStyle=void 0,m._getItemStyle=function(v){var y=m.props,C=y.direction,S=y.itemSize,w=y.layout,_=m._getItemStyleCache(d&&S,d&&w,d&&C),T;if(_.hasOwnProperty(v))T=_[v];else{var E=r(m.props,v,m._instanceProps),A=o(m.props,v,m._instanceProps),x=C==="horizontal"||w==="horizontal",B=C==="rtl",D=x?E:0;_[v]=T={position:"absolute",left:B?void 0:D,right:B?D:void 0,top:x?0:E,height:x?"100%":A,width:x?A:"100%"}}return T},m._getItemStyleCache=void 0,m._getItemStyleCache=Al(function(v,y,C){return{}}),m._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,S=y.scrollLeft,w=y.scrollWidth;m.setState(function(_){if(_.scrollOffset===S)return null;var T=m.props.direction,E=S;if(T==="rtl")switch(ah()){case"negative":E=-S;break;case"positive-descending":E=w-C-S;break}return E=Math.max(0,Math.min(E,w-C)),{isScrolling:!0,scrollDirection:_.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,S=y.scrollHeight,w=y.scrollTop;m.setState(function(_){if(_.scrollOffset===w)return null;var T=Math.max(0,Math.min(w,S-C));return{isScrolling:!0,scrollDirection:_.scrollOffset<T?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._outerRefSetter=function(v){var y=m.props.outerRef;m._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},m._resetIsScrollingDebounced=function(){m._resetIsScrollingTimeoutId!==null&&oh(m._resetIsScrollingTimeoutId),m._resetIsScrollingTimeoutId=X_(m._resetIsScrolling,J_)},m._resetIsScrolling=function(){m._resetIsScrollingTimeoutId=null,m.setState({isScrolling:!1},function(){m._getItemStyleCache(-1,null)})},m}g.getDerivedStateFromProps=function(m,v){return tT(m,v),u(m),null};var p=g.prototype;return p.scrollTo=function(m){m=Math.max(0,m),this.setState(function(v){return v.scrollOffset===m?null:{scrollDirection:v.scrollOffset<m?"forward":"backward",scrollOffset:m,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},p.scrollToItem=function(m,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,S=y.layout,w=this.state.scrollOffset;m=Math.max(0,Math.min(m,C-1));var _=0;if(this._outerRef){var T=this._outerRef;S==="vertical"?_=T.scrollWidth>T.clientWidth?sh():0:_=T.scrollHeight>T.clientHeight?sh():0}this.scrollTo(s(this.props,m,v,w,this._instanceProps,_))},p.componentDidMount=function(){var m=this.props,v=m.direction,y=m.initialScrollOffset,C=m.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||C==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},p.componentDidUpdate=function(){var m=this.props,v=m.direction,y=m.layout,C=this.state,S=C.scrollOffset,w=C.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var _=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(ah()){case"negative":_.scrollLeft=-S;break;case"positive-ascending":_.scrollLeft=S;break;default:var T=_.clientWidth,E=_.scrollWidth;_.scrollLeft=E-T-S;break}else _.scrollLeft=S;else _.scrollTop=S}this._callPropsCallbacks()},p.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oh(this._resetIsScrollingTimeoutId)},p.render=function(){var m=this.props,v=m.children,y=m.className,C=m.direction,S=m.height,w=m.innerRef,_=m.innerElementType,T=m.innerTagName,E=m.itemCount,A=m.itemData,x=m.itemKey,B=x===void 0?eT:x,D=m.layout,F=m.outerElementType,M=m.outerTagName,P=m.style,V=m.useIsScrolling,ne=m.width,W=this.state.isScrolling,de=C==="horizontal"||D==="horizontal",ie=de?this._onScrollHorizontal:this._onScrollVertical,ve=this._getRangeToRender(),me=ve[0],z=ve[1],Ce=[];if(E>0)for(var ke=me;ke<=z;ke++)Ce.push(h.createElement(v,{data:A,key:B(ke,A),index:ke,isScrolling:V?W:void 0,style:this._getItemStyle(ke)}));var U=n(this.props,this._instanceProps);return h.createElement(F||M||"div",{className:y,onScroll:ie,ref:this._outerRefSetter,style:kl({position:"relative",height:S,width:ne,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},P)},h.createElement(_||T||"div",{children:Ce,ref:w,style:{height:de?"100%":U,pointerEvents:W?"none":void 0,width:de?U:"100%"}}))},p._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var m=this.props.itemCount;if(m>0){var v=this._getRangeToRender(),y=v[0],C=v[1],S=v[2],w=v[3];this._callOnItemsRendered(y,C,S,w)}}if(typeof this.props.onScroll=="function"){var _=this.state,T=_.scrollDirection,E=_.scrollOffset,A=_.scrollUpdateWasRequested;this._callOnScroll(T,E,A)}},p._getRangeToRender=function(){var m=this.props,v=m.itemCount,y=m.overscanCount,C=this.state,S=C.isScrolling,w=C.scrollDirection,_=C.scrollOffset;if(v===0)return[0,0,0,0];var T=a(this.props,_,this._instanceProps),E=i(this.props,T,_,this._instanceProps),A=!S||w==="backward"?Math.max(1,y):1,x=!S||w==="forward"?Math.max(1,y):1;return[Math.max(0,T-A),Math.max(0,Math.min(v-1,E+x)),T,E]},g})(h.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var tT=function(t,r){var n=t.children,o=t.direction,s=t.height,a=t.layout,i=t.innerTagName,c=t.outerTagName,d=t.width,u=r.instance;if(process.env.NODE_ENV!=="production"){(i!=null||c!=null)&&Da&&!Da.has(u)&&(Da.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=o==="horizontal"||a==="horizontal";switch(o){case"horizontal":case"vertical":La&&!La.has(u)&&(La.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(f&&typeof d!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(d===null?"null":typeof d)+'" was specified.'));if(!f&&typeof s!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(s===null?"null":typeof s)+'" was specified.'))}},rT=50,uo=function(t,r,n){var o=t,s=o.itemSize,a=n.itemMetadataMap,i=n.lastMeasuredIndex;if(r>i){var c=0;if(i>=0){var d=a[i];c=d.offset+d.size}for(var u=i+1;u<=r;u++){var f=s(u);a[u]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return a[r]},nT=function(t,r,n){var o=r.itemMetadataMap,s=r.lastMeasuredIndex,a=s>0?o[s].offset:0;return a>=n?lh(t,r,s,0,n):oT(t,r,Math.max(0,s),n)},lh=function(t,r,n,o,s){for(;o<=n;){var a=o+Math.floor((n-o)/2),i=uo(t,a,r).offset;if(i===s)return a;i<s?o=a+1:i>s&&(n=a-1)}return o>0?o-1:0},oT=function(t,r,n,o){for(var s=t.itemCount,a=1;n<s&&uo(t,n,r).offset<o;)n+=a,a*=2;return lh(t,r,Math.min(n,s-1),Math.floor(n/2),o)},ch=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,s=r.estimatedItemSize,a=r.lastMeasuredIndex,i=0;if(a>=n&&(a=n-1),a>=0){var c=o[a];i=c.offset+c.size}var d=n-a-1,u=d*s;return i+u},sT=ih({getItemOffset:function(t,r,n){return uo(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:ch,getOffsetForIndexAndAlignment:function(t,r,n,o,s,a){var i=t.direction,c=t.height,d=t.layout,u=t.width,f=i==="horizontal"||d==="horizontal",g=f?u:c,p=uo(t,r,s),b=ch(t,s),m=Math.max(0,Math.min(b-g,p.offset)),v=Math.max(0,p.offset-g+p.size+a);switch(n==="smart"&&(o>=v-g&&o<=m+g?n="auto":n="center"),n){case"start":return m;case"end":return v;case"center":return Math.round(v+(m-v)/2);case"auto":default:return o>=v&&o<=m?o:o<v?v:m}},getStartIndexForOffset:function(t,r,n){return nT(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var s=t.direction,a=t.height,i=t.itemCount,c=t.layout,d=t.width,u=s==="horizontal"||c==="horizontal",f=u?d:a,g=uo(t,r,o),p=n+f,b=g.offset+g.size,m=r;m<i-1&&b<p;)m++,b+=uo(t,m,o).size;return m},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,s={itemMetadataMap:{},estimatedItemSize:o||rT,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,i){i===void 0&&(i=!0),s.lastMeasuredIndex=Math.min(s.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),i&&r.forceUpdate()},s},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),aT=ih({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,o,s,a){var i=t.direction,c=t.height,d=t.itemCount,u=t.itemSize,f=t.layout,g=t.width,p=i==="horizontal"||f==="horizontal",b=p?g:c,m=Math.max(0,d*u-b),v=Math.min(m,r*u),y=Math.max(0,r*u-b+u+a);switch(n==="smart"&&(o>=y-b&&o<=v+b?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var C=Math.round(y+(v-y)/2);return C<Math.ceil(b/2)?0:C>m+Math.floor(b/2)?m:C}case"auto":default:return o>=y&&o<=v?o:o<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/o)))},getStopIndexForStartIndex:function(t,r,n){var o=t.direction,s=t.height,a=t.itemCount,i=t.itemSize,c=t.layout,d=t.width,u=o==="horizontal"||c==="horizontal",f=r*i,g=u?d:s,p=Math.ceil((g+n-f)/i);return Math.max(0,Math.min(a-1,r+p-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function iT(){var e,t;const r=Kt(),o=w_().cursor;if(!o||o.type!=="line")return null;const s=r.indent,a=r.rowTopPosition(o.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),i=s*o.level,c=r.renderCursor;return l.jsx(c,{top:a,left:i,indent:s})}var lT=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const cT=h.forwardRef(function(t,r){const{children:n}=t,o=lT(t,["children"]),s=Kt();return l.jsxs("div",Object.assign({ref:r},o,{onClick:a=>{a.currentTarget===a.target&&s.deselectAll()},children:[l.jsx(dT,{}),n]}))}),dT=()=>{const e=Kt();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(iT,{})})};var uT=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const fT=h.forwardRef(function(t,r){var n,o,s,a,{style:i}=t,c=uT(t,["style"]);const d=Kt(),u=(o=(n=d.props.padding)!==null&&n!==void 0?n:d.props.paddingTop)!==null&&o!==void 0?o:0,f=(a=(s=d.props.padding)!==null&&s!==void 0?s:d.props.paddingBottom)!==null&&a!==void 0?a:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},i),{height:`${parseFloat(i.height)+u+f}px`})},c))});var dh=h.createContext({dragDropManager:void 0}),ur;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(ur||(ur={}));function De(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;s=new Error(t.replace(/%s/g,function(){return n[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var Ll="dnd-core/INIT_COORDS",Na="dnd-core/BEGIN_DRAG",Dl="dnd-core/PUBLISH_DRAG_SOURCE",Oa="dnd-core/HOVER",Pa="dnd-core/DROP",xa="dnd-core/END_DRAG";function uh(e,t){return{type:Ll,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Fa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fa=function(r){return typeof r}:Fa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fa(e)}function hT(e,t,r){return t.split(".").reduce(function(n,o){return n&&n[o]?n[o]:r||null},e)}function pT(e,t){return e.filter(function(r){return r!==t})}function fh(e){return Fa(e)==="object"}function mT(e,t){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(s,a){s===1&&o.push(a)}),o}function gT(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var vT={type:Ll,payload:{clientOffset:null,sourceClientOffset:null}};function yT(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},o=n.publishSource,s=o===void 0?!0:o,a=n.clientOffset,i=n.getSourceClientOffset,c=e.getMonitor(),d=e.getRegistry();e.dispatch(uh(a)),bT(r,c,d);var u=wT(r,c);if(u===null){e.dispatch(vT);return}var f=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");CT(i),f=i(u)}e.dispatch(uh(a,f));var g=d.getSource(u),p=g.beginDrag(c,u);if(p!=null){ST(p),d.pinSource(u);var b=d.getSourceType(u);return{type:Na,payload:{itemType:b,item:p,sourceId:u,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!s}}}}}function bT(e,t,r){De(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){De(r.getSource(n),"Expected sourceIds to be registered.")})}function CT(e){De(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ST(e){De(fh(e),"Item must be an object.")}function wT(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function _T(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Dl}}}function Nl(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function TT(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.clientOffset;kT(r);var s=r.slice(0),a=e.getMonitor(),i=e.getRegistry();ET(s,a,i);var c=a.getItemType();return AT(s,i,c),IT(s,a,i),{type:Oa,payload:{targetIds:s,clientOffset:o||null}}}}function kT(e){De(Array.isArray(e),"Expected targetIds to be an array.")}function ET(e,t,r){De(t.isDragging(),"Cannot call hover while not dragging."),De(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];De(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");var s=r.getTarget(o);De(s,"Expected targetIds to be registered.")}}function AT(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n],s=t.getTargetType(o);Nl(s,r)||e.splice(n,1)}}function IT(e,t,r){e.forEach(function(n){var o=r.getTarget(n);o.hover(t,n)})}function hh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ph(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hh(Object(r),!0).forEach(function(n){LT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DT(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),o=e.getRegistry();NT(n);var s=xT(n);s.forEach(function(a,i){var c=OT(a,i,o,n),d={type:Pa,payload:{dropResult:ph(ph({},r),c)}};e.dispatch(d)})}}function NT(e){De(e.isDragging(),"Cannot call drop while not dragging."),De(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function OT(e,t,r,n){var o=r.getTarget(e),s=o?o.drop(n,e):void 0;return PT(s),typeof s>"u"&&(s=t===0?{}:n.getDropResult()),s}function PT(e){De(typeof e>"u"||fh(e),"Drop result must either be an object or undefined.")}function xT(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function FT(e){return function(){var r=e.getMonitor(),n=e.getRegistry();MT(r);var o=r.getSourceId();if(o!=null){var s=n.getSource(o,!0);s.endDrag(r,o),n.unpinSource()}return{type:xa}}}function MT(e){De(e.isDragging(),"Cannot call endDrag while not dragging.")}function BT(e){return{beginDrag:yT(e),publishDragSource:_T(e),hover:TT(e),drop:DT(e),endDrag:FT(e)}}function $T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jT(e,t,r){return t&&qT(e.prototype,t),e}function ds(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var UT=(function(){function e(t,r){var n=this;$T(this,e),ds(this,"store",void 0),ds(this,"monitor",void 0),ds(this,"backend",void 0),ds(this,"isSetUp",!1),ds(this,"handleRefCountChange",function(){var o=n.store.getState().refCount>0;n.backend&&(o&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!o&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return jT(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function o(a){return function(){for(var i=arguments.length,c=new Array(i),d=0;d<i;d++)c[d]=arguments[d];var u=a.apply(r,c);typeof u<"u"&&n(u)}}var s=BT(this);return Object.keys(s).reduce(function(a,i){var c=s[i];return a[i]=o(c),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function fr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var mh=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),gh=function(){return Math.random().toString(36).substring(7).split("").join(".")},vh={INIT:"@@redux/INIT"+gh(),REPLACE:"@@redux/REPLACE"+gh()};function HT(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function VT(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(QT(e))return"date";if(RT(e))return"error";var r=zT(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function zT(e){return typeof e.constructor=="function"?e.constructor.name:null}function RT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function QT(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function fo(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=VT(e)),t}function yh(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?fr(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?fr(1):"Expected the enhancer to be a function. Instead, received: '"+fo(r)+"'");return r(yh)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?fr(2):"Expected the root reducer to be a function. Instead, received: '"+fo(e)+"'");var o=e,s=t,a=[],i=a,c=!1;function d(){i===a&&(i=a.slice())}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?fr(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function f(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?fr(4):"Expected the listener to be a function. Instead, received: '"+fo(m)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?fr(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return d(),i.push(m),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?fr(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,d();var C=i.indexOf(m);i.splice(C,1),a=null}}}function g(m){if(!HT(m))throw new Error(process.env.NODE_ENV==="production"?fr(7):"Actions must be plain objects. Instead, the actual type was: '"+fo(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?fr(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?fr(9):"Reducers may not dispatch actions.");try{c=!0,s=o(s,m)}finally{c=!1}for(var v=a=i,y=0;y<v.length;y++){var C=v[y];C()}return m}function p(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?fr(10):"Expected the nextReducer to be a function. Instead, received: '"+fo(m));o=m,g({type:vh.REPLACE})}function b(){var m,v=f;return m={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?fr(11):"Expected the observer to be an object. Instead, received: '"+fo(C)+"'");function S(){C.next&&C.next(u())}S();var w=v(S);return{unsubscribe:w}}},m[mh]=function(){return this},m}return g({type:vh.INIT}),n={dispatch:g,subscribe:f,getState:u,replaceReducer:p},n[mh]=b,n}var WT=function(t,r){return t===r};function GT(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function KT(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:WT;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function bh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ch(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bh(Object(r),!0).forEach(function(n){YT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Sh={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ZT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sh,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ll:case Na:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Oa:return GT(e.clientOffset,r.clientOffset)?e:Ch(Ch({},e),{},{clientOffset:r.clientOffset});case xa:case Pa:return Sh;default:return e}}var Ol="dnd-core/ADD_SOURCE",Pl="dnd-core/ADD_TARGET",xl="dnd-core/REMOVE_SOURCE",Ma="dnd-core/REMOVE_TARGET";function XT(e){return{type:Ol,payload:{sourceId:e}}}function JT(e){return{type:Pl,payload:{targetId:e}}}function e1(e){return{type:xl,payload:{sourceId:e}}}function t1(e){return{type:Ma,payload:{targetId:e}}}function wh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wh(Object(r),!0).forEach(function(n){r1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function r1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var n1={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function o1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n1,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Na:return hr(hr({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Dl:return hr(hr({},e),{},{isSourcePublic:!0});case Oa:return hr(hr({},e),{},{targetIds:r.targetIds});case Ma:return e.targetIds.indexOf(r.targetId)===-1?e:hr(hr({},e),{},{targetIds:pT(e.targetIds,r.targetId)});case Pa:return hr(hr({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case xa:return hr(hr({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function s1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ol:case Pl:return e+1;case xl:case Ma:return e-1;default:return e}}var Ba=[],Fl=[];Ba.__IS_NONE__=!0,Fl.__IS_ALL__=!0;function a1(e,t){if(e===Ba)return!1;if(e===Fl||typeof t>"u")return!0;var r=gT(t,e);return r.length>0}function i1(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Oa:break;case Ol:case Pl:case Ma:case xl:return Ba;case Na:case Dl:case xa:case Pa:default:return Fl}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,o=t.prevTargetIds,s=o===void 0?[]:o,a=mT(n,s),i=a.length>0||!KT(n,s);if(!i)return Ba;var c=s[s.length-1],d=n[n.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function l1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Th(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_h(Object(r),!0).forEach(function(n){c1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:i1(e.dirtyHandlerIds,{type:t.type,payload:Th(Th({},t.payload),{},{prevTargetIds:hT(e,"dragOperation.targetIds",[])})}),dragOffset:ZT(e.dragOffset,t),refCount:s1(e.refCount,t),dragOperation:o1(e.dragOperation,t),stateId:l1(e.stateId)}}function u1(e,t){return{x:e.x+t.x,y:e.y+t.y}}function kh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function f1(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:kh(u1(t,n),r)}function h1(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:kh(t,r)}function p1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g1(e,t,r){return t&&m1(e.prototype,t),e}function Eh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var v1=(function(){function e(t,r){p1(this,e),Eh(this,"store",void 0),Eh(this,"registry",void 0),this.store=t,this.registry=r}return g1(e,[{key:"subscribeToStateChange",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},s=o.handlerIds;De(typeof r=="function","listener must be a function."),De(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,i=function(){var d=n.store.getState(),u=d.stateId;try{var f=u===a||u===a+1&&!a1(d.dirtyHandlerIds,s);f||r()}finally{a=u}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;De(typeof r=="function","listener must be a function.");var o=this.store.getState().dragOffset,s=function(){var i=n.store.getState().dragOffset;i!==o&&(o=i,r())};return this.store.subscribe(s)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return De(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(De(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var o=this.registry.getTargetType(r),s=this.getItemType();return Nl(o,s)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(De(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var o=this.registry.getSourceType(r),s=this.getItemType();return o!==s?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var o=n.shallow;if(!this.isDragging())return!1;var s=this.registry.getTargetType(r),a=this.getItemType();if(a&&!Nl(s,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var c=i.indexOf(r);return o?c===i.length-1:c>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return f1(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return h1(this.store.getState().dragOffset)}}]),e})(),y1=0;function b1(){return y1++}function $a(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$a=function(r){return typeof r}:$a=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$a(e)}function C1(e){De(typeof e.canDrag=="function","Expected canDrag to be a function."),De(typeof e.beginDrag=="function","Expected beginDrag to be a function."),De(typeof e.endDrag=="function","Expected endDrag to be a function.")}function S1(e){De(typeof e.canDrop=="function","Expected canDrop to be a function."),De(typeof e.hover=="function","Expected hover to be a function."),De(typeof e.drop=="function","Expected beginDrag to be a function.")}function Ml(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return Ml(r,!1)});return}De(typeof e=="string"||$a(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Ah=typeof global<"u"?global:self,Ih=Ah.MutationObserver||Ah.WebKitMutationObserver;function Lh(e){return function(){const r=setTimeout(o,0),n=setInterval(o,50);function o(){clearTimeout(r),clearInterval(n),e()}}}function w1(e){let t=1;const r=new Ih(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const _1=typeof Ih=="function"?w1:Lh;class T1{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,o=t.length-this.index;n<o;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=_1(this.flush),this.requestErrorThrow=Lh(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class k1{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class E1{create(t){const r=this.freeTasks,n=r.length?r.pop():new k1(this.onError,o=>r[r.length]=o);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Dh=new T1,A1=new E1(Dh.registerPendingError);function I1(e){Dh.enqueueTask(A1.create(e))}function L1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function N1(e,t,r){return t&&D1(e.prototype,t),e}function ho(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O1(e,t){return M1(e)||F1(e,t)||x1(e,t)||P1()}function P1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
537
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x1(e,t){if(e){if(typeof e=="string")return Nh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nh(e,t)}}function Nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function F1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function M1(e){if(Array.isArray(e))return e}function B1(e){var t=b1().toString();switch(e){case ur.SOURCE:return"S".concat(t);case ur.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Oh(e){switch(e[0]){case"S":return ur.SOURCE;case"T":return ur.TARGET;default:De(!1,"Cannot parse handler ID: ".concat(e))}}function Ph(e,t){var r=e.entries(),n=!1;do{var o=r.next(),s=o.done,a=O1(o.value,2),i=a[1];if(i===t)return!0;n=!!s}while(!n);return!1}var $1=(function(){function e(t){L1(this,e),ho(this,"types",new Map),ho(this,"dragSources",new Map),ho(this,"dropTargets",new Map),ho(this,"pinnedSourceId",null),ho(this,"pinnedSource",null),ho(this,"store",void 0),this.store=t}return N1(e,[{key:"addSource",value:function(r,n){Ml(r),C1(n);var o=this.addHandler(ur.SOURCE,r,n);return this.store.dispatch(XT(o)),o}},{key:"addTarget",value:function(r,n){Ml(r,!0),S1(n);var o=this.addHandler(ur.TARGET,r,n);return this.store.dispatch(JT(o)),o}},{key:"containsHandler",value:function(r){return Ph(this.dragSources,r)||Ph(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;De(this.isSourceId(r),"Expected a valid source ID.");var o=n&&r===this.pinnedSourceId,s=o?this.pinnedSource:this.dragSources.get(r);return s}},{key:"getTarget",value:function(r){return De(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return De(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return De(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Oh(r);return n===ur.SOURCE}},{key:"isTargetId",value:function(r){var n=Oh(r);return n===ur.TARGET}},{key:"removeSource",value:function(r){var n=this;De(this.getSource(r),"Expected an existing source."),this.store.dispatch(e1(r)),I1(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){De(this.getTarget(r),"Expected an existing target."),this.store.dispatch(t1(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);De(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){De(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,o){var s=B1(r);return this.types.set(s,n),r===ur.SOURCE?this.dragSources.set(s,o):r===ur.TARGET&&this.dropTargets.set(s,o),s}}]),e})();function q1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=j1(n),s=new v1(o,new $1(o)),a=new UT(o,s),i=e(a,t,r);return a.receiveBackend(i),a}function j1(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return yh(d1,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var U1=["children"];function H1(e,t){return Q1(e)||R1(e,t)||z1(e,t)||V1()}function V1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
538
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z1(e,t){if(e){if(typeof e=="string")return xh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xh(e,t)}}function xh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function Q1(e){if(Array.isArray(e))return e}function W1(e,t){if(e==null)return{};var r=G1(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function G1(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var Fh=0,qa=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),K1=h.memo(function(t){var r=t.children,n=W1(t,U1),o=Y1(n),s=H1(o,2),a=s[0],i=s[1];return h.useEffect(function(){if(i){var c=Mh();return++Fh,function(){--Fh===0&&(c[qa]=null)}}},[]),l.jsx(dh.Provider,Object.assign({value:a},{children:r}),void 0)});function Y1(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=Z1(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function Z1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mh(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[qa]||(o[qa]={dragDropManager:q1(e,t,r,n)}),o[qa]}function Mh(){return typeof global<"u"?global:window}function X1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function e0(e,t,r){return t&&J1(e.prototype,t),e}function Bh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Bl=!1,$l=!1,t0=(function(){function e(t){X1(this,e),Bh(this,"internalMonitor",void 0),Bh(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return e0(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){De(!Bl,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Bl=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Bl=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;De(!$l,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return $l=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{$l=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function r0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o0(e,t,r){return t&&n0(e.prototype,t),e}function $h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ql=!1,s0=(function(){function e(t){r0(this,e),$h(this,"internalMonitor",void 0),$h(this,"targetId",null),this.internalMonitor=t.getMonitor()}return o0(e,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;De(!ql,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ql=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ql=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function a0(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function i0(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!h.isValidElement(t)){var n=t;return e(n,r),n}var o=t;a0(o);var s=r?function(a){return e(a,r)}:e;return l0(o,s)}}function qh(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var o=i0(n);t[r]=function(){return o}}}),t}function jh(e,t){typeof e=="function"?e(t):e.current=t}function l0(e,t){var r=e.ref;return De(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:function(o){jh(r,o),jh(t,o)}}):h.cloneElement(e,{ref:t})}function ja(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ja=function(r){return typeof r}:ja=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ja(e)}function jl(e){return e!==null&&ja(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ul(e,t,r,n){var o=void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),c=0;c<s.length;c++){var d=s[c];if(!i(d))return!1;var u=e[d],f=t[d];if(o=void 0,o===!1||o===void 0&&u!==f)return!1}return!0}function c0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u0(e,t,r){return t&&d0(e.prototype,t),e}function Pt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f0=(function(){function e(t){var r=this;c0(this,e),Pt(this,"hooks",qh({dragSource:function(o,s){r.clearDragSource(),r.dragSourceOptions=s||null,jl(o)?r.dragSourceRef=o:r.dragSourceNode=o,r.reconnectDragSource()},dragPreview:function(o,s){r.clearDragPreview(),r.dragPreviewOptions=s||null,jl(o)?r.dragPreviewRef=o:r.dragPreviewNode=o,r.reconnectDragPreview()}})),Pt(this,"handlerId",null),Pt(this,"dragSourceRef",null),Pt(this,"dragSourceNode",void 0),Pt(this,"dragSourceOptionsInternal",null),Pt(this,"dragSourceUnsubscribe",void 0),Pt(this,"dragPreviewRef",null),Pt(this,"dragPreviewNode",void 0),Pt(this,"dragPreviewOptionsInternal",null),Pt(this,"dragPreviewUnsubscribe",void 0),Pt(this,"lastConnectedHandlerId",null),Pt(this,"lastConnectedDragSource",null),Pt(this,"lastConnectedDragSourceOptions",null),Pt(this,"lastConnectedDragPreview",null),Pt(this,"lastConnectedDragPreviewOptions",null),Pt(this,"backend",void 0),this.backend=t}return u0(e,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Ul(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Ul(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e})();function h0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m0(e,t,r){return t&&p0(e.prototype,t),e}function Pr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var g0=(function(){function e(t){var r=this;h0(this,e),Pr(this,"hooks",qh({dropTarget:function(o,s){r.clearDropTarget(),r.dropTargetOptions=s,jl(o)?r.dropTargetRef=o:r.dropTargetNode=o,r.reconnect()}})),Pr(this,"handlerId",null),Pr(this,"dropTargetRef",null),Pr(this,"dropTargetNode",void 0),Pr(this,"dropTargetOptionsInternal",null),Pr(this,"unsubscribeDropTarget",void 0),Pr(this,"lastConnectedHandlerId",null),Pr(this,"lastConnectedDropTarget",null),Pr(this,"lastConnectedDropTargetOptions",null),Pr(this,"backend",void 0),this.backend=t}return m0(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Ul(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e})();function v0(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function y0(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}var Ln=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Ua(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ua=function(r){return typeof r}:Ua=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ua(e)}function b0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function S0(e,t,r){return t&&C0(e.prototype,t),e}function Hl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w0=(function(){function e(t,r,n){b0(this,e),Hl(this,"spec",void 0),Hl(this,"monitor",void 0),Hl(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return S0(e,[{key:"beginDrag",value:function(){var r,n=this.spec,o=this.monitor,s=null;return Ua(n.item)==="object"?s=n.item:typeof n.item=="function"?s=n.item(o):s={},(r=s)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var o=this.spec,s=this.monitor,a=o.isDragging;return a?a(s):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,o=this.connector,s=r.end;s&&s(n.getItem(),n),o.reconnect()}}]),e})();function _0(e,t,r){var n=h.useMemo(function(){return new w0(e,t,r)},[t,r]);return h.useEffect(function(){n.spec=e},[e]),n}function Dn(){var e=h.useContext(dh),t=e.dragDropManager;return De(t!=null,"Expected drag drop context"),t}function T0(e){return h.useMemo(function(){var t=e.type;return De(t!=null,"spec.type must be defined"),t},[e])}function k0(e,t){return L0(e)||I0(e,t)||A0(e,t)||E0()}function E0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A0(e,t){if(e){if(typeof e=="string")return Uh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uh(e,t)}}function Uh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function I0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function L0(e){if(Array.isArray(e))return e}function D0(e,t,r){var n=Dn(),o=_0(e,t,r),s=T0(e);Ln(function(){if(s!=null){var i=y0(s,o,n),c=k0(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u}},[n,t,r,o,s])}function N0(e){return F0(e)||x0(e)||P0(e)||O0()}function O0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
540
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P0(e,t){if(e){if(typeof e=="string")return Vl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vl(e,t)}}function x0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function F0(e){if(Array.isArray(e))return Vl(e)}function Vl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Hh(e,t){var r=N0(t||[]);return t==null&&typeof e!="function"&&r.push(e),h.useMemo(function(){return typeof e=="function"?e():e},r)}function M0(){var e=Dn();return h.useMemo(function(){return new t0(e)},[e])}function B0(e,t){var r=Dn(),n=h.useMemo(function(){return new f0(r.getBackend())},[r]);return Ln(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),Ln(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var zl,Vh;function $0(){return Vh||(Vh=1,zl=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var a=s[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),zl}var q0=$0();const j0=Ui(q0);function U0(e,t){return R0(e)||z0(e,t)||V0(e,t)||H0()}function H0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
541
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V0(e,t){if(e){if(typeof e=="string")return zh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zh(e,t)}}function zh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function z0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function R0(e){if(Array.isArray(e))return e}function Rh(e,t,r){var n=h.useState(function(){return t(e)}),o=U0(n,2),s=o[0],a=o[1],i=h.useCallback(function(){var c=t(e);j0(s,c)||(a(c),r&&r())},[s,e,r]);return Ln(i),[s,i]}function Q0(e,t){return Y0(e)||K0(e,t)||G0(e,t)||W0()}function W0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
542
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G0(e,t){if(e){if(typeof e=="string")return Qh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qh(e,t)}}function Qh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function K0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function Y0(e){if(Array.isArray(e))return e}function Z0(e,t,r){var n=Rh(e,t,r),o=Q0(n,2),s=o[0],a=o[1];return Ln(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(a,{handlerIds:[c]})},[e,a]),s}function Wh(e,t,r){return Z0(t,e||function(){return{}},function(){return r.reconnect()})}function X0(e){return h.useMemo(function(){return e.hooks.dragSource()},[e])}function J0(e){return h.useMemo(function(){return e.hooks.dragPreview()},[e])}function ek(e,t){var r=Hh(e,t);De(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=M0(),o=B0(r.options,r.previewOptions);return D0(r,n,o),[Wh(r.collect,n,o),X0(o),J0(o)]}function tk(e){var t=e.accept;return h.useMemo(function(){return De(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function rk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ok(e,t,r){return t&&nk(e.prototype,t),e}function Gh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sk=(function(){function e(t,r){rk(this,e),Gh(this,"spec",void 0),Gh(this,"monitor",void 0),this.spec=t,this.monitor=r}return ok(e,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),e})();function ak(e,t){var r=h.useMemo(function(){return new sk(e,t)},[t]);return h.useEffect(function(){r.spec=e},[e]),r}function ik(e,t){return uk(e)||dk(e,t)||ck(e,t)||lk()}function lk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
543
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ck(e,t){if(e){if(typeof e=="string")return Kh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kh(e,t)}}function Kh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function uk(e){if(Array.isArray(e))return e}function fk(e,t,r){var n=Dn(),o=ak(e,t),s=tk(e);Ln(function(){var i=v0(s,o,n),c=ik(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u},[n,t,o,r,s.map(function(a){return a.toString()}).join("|")])}function hk(){var e=Dn();return h.useMemo(function(){return new s0(e)},[e])}function pk(e){var t=Dn(),r=h.useMemo(function(){return new g0(t.getBackend())},[t]);return Ln(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function mk(e){return h.useMemo(function(){return e.hooks.dropTarget()},[e])}function Yh(e,t){var r=Hh(e,t),n=hk(),o=pk(r.options);return fk(r,n,o),[Wh(r.collect,n,o),mk(o)]}function gk(e,t){return Ck(e)||bk(e,t)||yk(e,t)||vk()}function vk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
544
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yk(e,t){if(e){if(typeof e=="string")return Zh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zh(e,t)}}function Zh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,a,i;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw i}}return n}}function Ck(e){if(Array.isArray(e))return e}function Sk(e){var t=Dn(),r=t.getMonitor(),n=Rh(r,e),o=gk(n,2),s=o[0],a=o[1];return h.useEffect(function(){return r.subscribeToOffsetChange(a)}),h.useEffect(function(){return r.subscribeToStateChange(a)}),s}function Xh(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function wk(e,t){return e.filter(function(r){return r!==t})}function _k(e,t){var r=new Set,n=function(a){return r.add(a)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(s){return o.push(s)}),o}function Tk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ek(e,t,r){return t&&kk(e.prototype,t),e}function Jh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ak=(function(){function e(t){Tk(this,e),Jh(this,"entered",[]),Jh(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return Ek(e,[{key:"enter",value:function(r){var n=this,o=this.entered.length,s=function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(r))};return this.entered=_k(this.entered.filter(s),[r]),o===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=wk(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),Ik=Xh(function(){return/firefox/i.test(navigator.userAgent)}),ep=Xh(function(){return!!window.safari});function Lk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Nk(e,t,r){return t&&Dk(e.prototype,t),e}function us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tp=(function(){function e(t,r){Lk(this,e),us(this,"xs",void 0),us(this,"ys",void 0),us(this,"c1s",void 0),us(this,"c2s",void 0),us(this,"c3s",void 0);for(var n=t.length,o=[],s=0;s<n;s++)o.push(s);o.sort(function(A,x){return t[A]<t[x]?-1:1});for(var a=[],i=[],c,d,u=0;u<n-1;u++)c=t[u+1]-t[u],d=r[u+1]-r[u],a.push(c),i.push(d/c);for(var f=[i[0]],g=0;g<a.length-1;g++){var p=i[g],b=i[g+1];if(p*b<=0)f.push(0);else{c=a[g];var m=a[g+1],v=c+m;f.push(3*v/((v+m)/p+(v+c)/b))}}f.push(i[i.length-1]);for(var y=[],C=[],S,w=0;w<f.length-1;w++){S=i[w];var _=f[w],T=1/a[w],E=_+f[w+1]-S-S;y.push((S-_-E)*T),C.push(E*T*T)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=C}return Nk(e,[{key:"interpolate",value:function(r){var n=this.xs,o=this.ys,s=this.c1s,a=this.c2s,i=this.c3s,c=n.length-1;if(r===n[c])return o[c];for(var d=0,u=i.length-1,f;d<=u;){f=Math.floor(.5*(d+u));var g=n[f];if(g<r)d=f+1;else if(g>r)u=f-1;else return o[f]}c=Math.max(0,u);var p=r-n[c],b=p*p;return o[c]+s[c]*p+a[c]*b+i[c]*p*b}}]),e})(),Ok=1;function rp(e){var t=e.nodeType===Ok?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function Ha(e){return{x:e.clientX,y:e.clientY}}function Pk(e){var t;return e.nodeName==="IMG"&&(Ik()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function xk(e,t,r,n){var o=e?t.width:r,s=e?t.height:n;return ep()&&e&&(s/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:s}}function Fk(e,t,r,n,o){var s=Pk(t),a=s?e:t,i=rp(a),c={x:r.x-i.x,y:r.y-i.y},d=e.offsetWidth,u=e.offsetHeight,f=n.anchorX,g=n.anchorY,p=xk(s,t,d,u),b=p.dragPreviewWidth,m=p.dragPreviewHeight,v=function(){var E=new tp([0,.5,1],[c.y,c.y/u*m,c.y+m-u]),A=E.interpolate(g);return ep()&&s&&(A+=(window.devicePixelRatio-1)*m),A},y=function(){var E=new tp([0,.5,1],[c.x,c.x/d*b,c.x+b-d]);return E.interpolate(f)},C=o.offsetX,S=o.offsetY,w=C===0||C,_=S===0||S;return{x:w?C:y(),y:_?S:v()}}var np="__NATIVE_FILE__",op="__NATIVE_URL__",sp="__NATIVE_TEXT__",ap="__NATIVE_HTML__";const ip=Object.freeze(Object.defineProperty({__proto__:null,FILE:np,HTML:ap,TEXT:sp,URL:op},Symbol.toStringTag,{value:"Module"}));function Rl(e,t,r){var n=t.reduce(function(o,s){return o||e.getData(s)},"");return n??r}var po;function Va(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ql=(po={},Va(po,np,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Va(po,ap,{exposeProperties:{html:function(t,r){return Rl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Va(po,op,{exposeProperties:{urls:function(t,r){return Rl(t,r,"").split(`
545
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Va(po,sp,{exposeProperties:{text:function(t,r){return Rl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),po);function Mk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $k(e,t,r){return t&&Bk(e.prototype,t),e}function lp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var qk=(function(){function e(t){Mk(this,e),lp(this,"item",void 0),lp(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return $k(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var o={};Object.keys(this.config.exposeProperties).forEach(function(s){o[s]={value:n.config.exposeProperties[s](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,o)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e})();function jk(e,t){var r=new qk(Ql[e]);return r.loadDataTransfer(t),r}function Wl(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ql).filter(function(r){var n=Ql[r].matchesTypes;return n.some(function(o){return t.indexOf(o)>-1})})[0]||null}function Uk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vk(e,t,r){return t&&Hk(e.prototype,t),e}function Gl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zk=(function(){function e(t,r){Uk(this,e),Gl(this,"ownerDocument",null),Gl(this,"globalContext",void 0),Gl(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return Vk(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e})();function cp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function dp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cp(Object(r),!0).forEach(function(n){$e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wk(e,t,r){return t&&Qk(e.prototype,t),e}function $e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Gk=(function(){function e(t,r,n){var o=this;Rk(this,e),$e(this,"options",void 0),$e(this,"actions",void 0),$e(this,"monitor",void 0),$e(this,"registry",void 0),$e(this,"enterLeaveCounter",void 0),$e(this,"sourcePreviewNodes",new Map),$e(this,"sourcePreviewNodeOptions",new Map),$e(this,"sourceNodes",new Map),$e(this,"sourceNodeOptions",new Map),$e(this,"dragStartSourceIds",null),$e(this,"dropTargetIds",[]),$e(this,"dragEnterTargetIds",[]),$e(this,"currentNativeSource",null),$e(this,"currentNativeHandle",null),$e(this,"currentDragSourceNode",null),$e(this,"altKeyPressed",!1),$e(this,"mouseMoveTimeoutTimer",null),$e(this,"asyncEndDragFrameId",null),$e(this,"dragOverTargetIds",null),$e(this,"lastClientOffset",null),$e(this,"hoverRafId",null),$e(this,"getSourceClientOffset",function(s){var a=o.sourceNodes.get(s);return a&&rp(a)||null}),$e(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),$e(this,"isNodeInDocument",function(s){return!!(s&&o.document&&o.document.body&&o.document.body.contains(s))}),$e(this,"endDragIfSourceWasRemovedFromDOM",function(){var s=o.currentDragSourceNode;s==null||o.isNodeInDocument(s)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),$e(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),$e(this,"handleTopDragStart",function(s){if(!s.defaultPrevented){var a=o.dragStartSourceIds;o.dragStartSourceIds=null;var i=Ha(s);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:i});var c=s.dataTransfer,d=Wl(c);if(o.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=o.monitor.getSourceId(),f=o.sourceNodes.get(u),g=o.sourcePreviewNodes.get(u)||f;if(g){var p=o.getCurrentSourcePreviewNodeOptions(),b=p.anchorX,m=p.anchorY,v=p.offsetX,y=p.offsetY,C={anchorX:b,anchorY:m},S={offsetX:v,offsetY:y},w=Fk(f,g,i,C,S);c.setDragImage(g,w.x,w.y)}}try{c==null||c.setData("application/json",{})}catch{}o.setCurrentDragSourceNode(s.target);var _=o.getCurrentSourcePreviewNodeOptions(),T=_.captureDraggingState;T?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(d)o.beginDragNativeItem(d);else{if(c&&!c.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}}}),$e(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),$e(this,"handleTopDragEnterCapture",function(s){o.dragEnterTargetIds=[];var a=o.enterLeaveCounter.enter(s.target);if(!(!a||o.monitor.isDragging())){var i=s.dataTransfer,c=Wl(i);c&&o.beginDragNativeItem(c,i)}}),$e(this,"handleTopDragEnter",function(s){var a=o.dragEnterTargetIds;if(o.dragEnterTargetIds=[],!!o.monitor.isDragging()){o.altKeyPressed=s.altKey,a.length>0&&o.actions.hover(a,{clientOffset:Ha(s)});var i=a.some(function(c){return o.monitor.canDropOnTarget(c)});i&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=o.getCurrentDropEffect()))}}),$e(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),$e(this,"handleTopDragOver",function(s){var a=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging()){s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none");return}o.altKeyPressed=s.altKey,o.lastClientOffset=Ha(s),o.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(a||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}));var i=(a||[]).some(function(c){return o.monitor.canDropOnTarget(c)});i?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))}),$e(this,"handleTopDragLeaveCapture",function(s){o.isDraggingNativeItem()&&s.preventDefault();var a=o.enterLeaveCounter.leave(s.target);a&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),$e(this,"handleTopDropCapture",function(s){if(o.dropTargetIds=[],o.isDraggingNativeItem()){var a;s.preventDefault(),(a=o.currentNativeSource)===null||a===void 0||a.loadDataTransfer(s.dataTransfer)}else Wl(s.dataTransfer)&&s.preventDefault();o.enterLeaveCounter.reset()}),$e(this,"handleTopDrop",function(s){var a=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(a,{clientOffset:Ha(s)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),$e(this,"handleSelectStart",function(s){var a=s.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(s.preventDefault(),a.dragDrop()))}),this.options=new zk(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ak(this.isNodeInDocument)}return Wk(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,o){var s=this;return this.sourcePreviewNodeOptions.set(r,o),this.sourcePreviewNodes.set(r,n),function(){s.sourcePreviewNodes.delete(r),s.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,o){var s=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,o);var a=function(d){return s.handleDragStart(d,r)},i=function(d){return s.handleSelectStart(d)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),function(){s.sourceNodes.delete(r),s.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var o=this,s=function(d){return o.handleDragEnter(d,r)},a=function(d){return o.handleDragOver(d,r)},i=function(d){return o.handleDrop(d,r)};return n.addEventListener("dragenter",s),n.addEventListener("dragover",a),n.addEventListener("drop",i),function(){n.removeEventListener("dragenter",s),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return dp({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return dp({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(ip).some(function(n){return ip[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=jk(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var o=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var s;return(s=n.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},o)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e})(),za;function Kk(){return za||(za=new Image,za.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),za}var Yk=function(t,r,n){return new Gk(t,r,n)};function Zk(e,t){return typeof e=="function"?e(t):e??"NODE"}function Xk(e){return e.isDraggable&&!e.isEditing}function Jk(e){const t=Kt(),r=t.selectedIds,[n,o,s]=ek(()=>({canDrag:()=>Xk(e),type:Zk(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(lo.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(lo.dragEnd())}}),[r,e,t.props.dragType]);return h.useEffect(()=>{s(Kk())},[s]),o}function eE(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),o=t.y-Math.round(r.y),s=r.height,a=o<s/2,i=!a,c=s/4,d=o>c&&o<s-c;return{x:n,inTopHalf:a,inBottomHalf:i,inMiddle:d,atTop:!d&&a,atBottom:!d&&i}}function tE(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function Ra(e,t){return{parentId:e||null,index:t}}function mo(e,t){return{type:"line",index:e,level:t}}function rE(e){return{type:"highlight",id:e}}function Kl(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const o=((r=n.parent)===null||r===void 0?void 0:r.id)||null,s=Rf(n)+1;return{parentId:o,index:s}}function up(e){var t;const r=eE(e.element,e.offset),n=e.indent,o=Math.round(Math.max(0,r.x-n)/n),{node:s,nextNode:a,prevNode:i}=e,[c,d]=tE(s,i,a,r);if(s&&s.isInternal&&r.inMiddle)return{drop:Ra(s.id,null),cursor:rE(s.id)};if(!c)return{drop:Ra((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:mo(0,0)};if(Uf(c)){const u=Aa(o,(d==null?void 0:d.level)||0,c.level);return{drop:Kl(c,u),cursor:mo(c.rowIndex+1,u)}}if(Hf(c)){const u=Aa(o,(d==null?void 0:d.level)||0,c.level);return{drop:Kl(c,u),cursor:mo(c.rowIndex+1,u)}}if(Vf(c)){const u=Aa(o,0,c.level+1);return u>c.level?{drop:Ra(c.id,0),cursor:mo(c.rowIndex+1,u)}:{drop:Kl(c,u),cursor:mo(c.rowIndex+1,u)}}return{drop:Ra(c==null?void 0:c.id,0),cursor:mo(c.rowIndex+1,c.level+1)}}function nE(e,t){const r=Kt(),[n,o]=Yh(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(s,a)=>{const i=a.getClientOffset();if(!e.current||!i)return;const{cursor:c,drop:d}=up({element:e.current,offset:i,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch(lo.hovering(d.parentId,d.index)),a.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(s,a)=>{if(!a.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return o}function oE(e){const t=Kt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return h.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const fp=h.memo(function({index:t,style:r}){jf(),S_();const n=Kt(),o=oE(t),s=h.useRef(null),a=Jk(o),i=nE(s,o),c=h.useCallback(m=>{s.current=m,i(m)},[i]),d=n.indent*o.level,u=h.useMemo(()=>({paddingLeft:d}),[d]),f=h.useMemo(()=>{var m,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(m=n.props.padding)!==null&&m!==void 0?m:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":o.level+1,"aria-selected":o.isSelected,"aria-expanded":o.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};h.useEffect(()=>{var m;!o.isEditing&&o.isFocused&&((m=s.current)===null||m===void 0||m.focus({preventScroll:!0}))},[o.isEditing,o.isFocused,s.current]);const p=n.renderNode,b=n.renderRow;return l.jsx(b,{node:o,innerRef:c,attrs:g,children:l.jsx(p,{node:o,tree:n,style:u,dragHandle:a})})});let Yl="",hp=null;function pp(){jf();const e=Kt();return l.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const o=Array.from(e.selectedIds);if(o.length>1){let s=e.mostRecentNode;for(;s&&s.isSelected;)s=s.nextSibling;s||(s=e.lastNode),e.focus(s,{scroll:!1}),e.delete(Array.from(o))}else{const s=e.focusedNode;if(s){const a=s.nextSibling,i=s.parent;e.focus(a||i,{scroll:!1}),e.delete(s)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Qf(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),Wf(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const o=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const s=e.focusedNode;s?s.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const o=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const s=e.focusedNode;s?s.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const o=e.focusedNode;if(!o)return;o.isInternal&&o.isOpen?e.focus(e.nextNode):o.isInternal&&e.open(o.id);return}if(t.key==="ArrowLeft"){const o=e.focusedNode;if(!o||o.isRoot)return;o.isInternal&&o.isOpen?e.close(o.id):!((r=o.parent)===null||r===void 0)&&r.isRoot||e.focus(o.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const o=e.focusedNode;if(!o||!o.isEditable||!e.props.onRename)return;setTimeout(()=>{o&&e.edit(o)});return}if(t.key===" "){t.preventDefault();const o=e.focusedNode;if(!o)return;o.isLeaf?(o.select(),o.activate()):o.toggle();return}if(t.key==="*"){const o=e.focusedNode;if(!o)return;e.openSiblings(o);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(hp),Yl+=t.key,hp=setTimeout(()=>{Yl=""},600);const n=e.visibleNodes.find(o=>{const s=o.data.name;return typeof s=="string"?s.toLowerCase().startsWith(Yl):!1});n&&e.focus(n.id)},children:l.jsx(sE,{})})}function sE(){var e,t;const r=Kt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:o=>{var s;return((s=r.visibleNodes[o])===null||s===void 0?void 0:s.id)||o},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:cT,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:fT,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(sT,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:fp})):l.jsx(aT,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:fp}))}function mp(e){return e.isFiltered?iE(e.root,e.isMatch.bind(e)):aE(e.root)}function aE(e){const t=[];function r(n){var o;n.level>=0&&t.push(n),n.isOpen&&((o=n.children)===null||o===void 0||o.forEach(r))}return r(e),t.forEach(gp),t}function iE(e,t){const r={},n=[];function o(a){if(!a.isRoot&&t(a)){r[a.id]=!0;let c=a.parent;for(;c;)r[c.id]=!0,c=c.parent}if(a.children)for(let c of a.children)o(c)}function s(a){var i;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((i=a.children)===null||i===void 0||i.forEach(s))}return o(e),s(e),n.forEach(gp),n}function gp(e,t){e.rowIndex=t}const vp=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var Zl=function(e,t,r,n){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function i(u){try{d(n.next(u))}catch(f){a(f)}}function c(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?s(u.value):o(u.value).then(i,c)}d((n=n.apply(e,t||[])).next())})};const{safeRun:xt}=E_;class fs{constructor(t,r,n,o){this.store=t,this.props=r,this.list=n,this.listEl=o,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=s=>{const a=this.props.rowHeight;if(typeof a=="function"){const i=this.at(s);return i?a(i):this.rowHeight}return a??24},this.rowTopPosition=s=>{if(typeof this.props.rowHeight!="function")return s*this.rowHeight;const a=this.getRowOffsets(),i=Math.max(0,Math.min(s,a.length-1));return a[i]},this.redrawList=(s=0)=>{this.rowOffsets=null;const a=this.list.current;a&&"resetAfterIndex"in a&&a.resetAfterIndex(Math.max(0,s))},this.root=Xf(this),this.visibleNodes=mp(this),this.idToIndex=vp(this.visibleNodes)}update(t){this.props=t,this.root=Xf(this),this.visibleNodes=mp(this),this.idToIndex=vp(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:((n,o)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(o.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=is(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=is(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof cs)return t.id;const r=this.props.idAccessor||"id";return is(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const o=(n=this.indexOf(t))!==null&&n!==void 0?n:0,s=this.indexOf(r);if(s===null)return[];const a=Math.min(o,s),i=Math.max(o,s);return this.visibleNodes.slice(a,i+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Zl(this,arguments,void 0,function*(t={}){var r,n;const o=t.parentId===void 0?Zf(this):t.parentId,s=(r=t.index)!==null&&r!==void 0?r:Yf(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",i=yield xt(this.props.onCreate,{type:a,parentId:o,index:s,parentNode:this.get(o)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(t){return Zl(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(a=>this.identify(a)),o=n.map(a=>this.get(a)).filter(a=>!!a),s=o.length?Math.min(...o.map(a=>{var i;return(i=a.rowIndex)!==null&&i!==void 0?i:0})):0;yield xt(this.props.onDelete,{nodes:o,ids:n}),this.redrawList(s)})}edit(t){var r,n;const o=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(o),this.dispatch(_l(o)),this.redrawList((n=(r=this.get(o))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(s=>{fs.editPromise=s})}submit(t,r){return Zl(this,void 0,void 0,function*(){var n,o;if(!t)return;const s=this.identify(t);yield xt(this.props.onRename,{id:s,name:r,node:this.get(s)}),this.dispatch(_l(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(_l(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&xt(this.props.onActivate,r)}resolveEdit(t){const r=fs.editPromise;r&&r(t),fs.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(ao(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&xt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-s,0),this.focus(this.at(a))}pageDown(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex,s=o-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a<o?a=o:a=Math.min(a+s,this.visibleNodes.length-1),this.focus(this.at(a))}select(t,r={}){var n;if(!t)return;const o=r.focus!==!1,s=this.identify(t);o&&this.dispatch(ao(s)),!((n=this.get(s))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[s],anchor:s,mostRecent:s}),this.scrollTo(s,r.align),this.focusedNode&&o&&xt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(sn.remove(r)),xt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const o=r.focus!==!1;o&&this.dispatch(ao(n.id)),n.isSelectable&&(this.dispatch(sn.add(n.id)),this.dispatch(sn.anchor(n.id)),this.dispatch(sn.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&o&&xt(this.props.onFocus,this.focusedNode),xt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(ao(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:o,mostRecent:s}=this.state.nodes.selection,a=this.filterSelectableNodes(this.nodesBetween(o,this.identifyNull(n)));this.dispatch(sn.remove(this.nodesBetween(o,s))),this.dispatch(sn.add(a)),this.dispatch(sn.mostRecent(n))}this.scrollTo(n),this.focusedNode&&xt(this.props.onFocus,this.focusedNode),xt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const o=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:o,anchor:(t=o[0])!==null&&t!==void 0?t:null,mostRecent:(r=o[o.length-1])!==null&&r!==void 0?r:null}),this.dispatch(ao((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&xt(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(a=>this.identify(a))),o=this.identifyNull(t.anchor),s=this.identifyNull(t.mostRecent);this.dispatch(sn.set({ids:n,anchor:o,mostRecent:s})),xt(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,o=this.props.disableDrop;for(const s of n)if(!s||!r||s.isInternal&&zf(r,s))return!1;return typeof o=="function"?!o({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof o=="string"?!r.data[o]:typeof o=="boolean"?!o:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;xt(this.props.onMove,{dragIds:n,parentId:t===ls?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(lo.cursor({type:"none"}))}showCursor(t){this.dispatch(lo.cursor(t))}open(t,r=!0){var n,o;const s=this.identifyNull(t);s&&(this.isOpen(s)||(this.dispatch(Tl.open(s,this.isFiltered)),r&&this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),xt(this.props.onToggle,s)))}close(t,r=!0){var n,o;const s=this.identifyNull(t);s&&this.isOpen(s)&&(this.dispatch(Tl.close(s,this.isFiltered)),r&&this.redrawList((o=(n=this.get(s))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),xt(this.props.onToggle,s))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=wl(this.root,r);let o=n==null?void 0:n.parent;for(;o;)this.open(o.id,!1),o=o.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let o of r.children)o.isInternal&&(n?this.close(o.id,!1):this.open(o.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){Ia(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){Ia(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),Kf(()=>n in this.idToIndex).then(()=>{var o;const s=this.idToIndex[n];s!==void 0&&((o=this.list.current)===null||o===void 0||o.scrollToItem(s,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,o;if(!t)return!1;if(t===ls)return!0;const s=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(o=this.state.nodes.open.unfiltered[t])!==null&&o!==void 0?o:s}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!is(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:o}=this.state.nodes.drag;return r===n&&o===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(ao(t.id))}onBlur(){this.dispatch(M_())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||pp}get renderRow(){return this.props.renderRow||N_}get renderNode(){return this.props.children||O_}get renderDragPreview(){return this.props.renderDragPreview||eh}get renderCursor(){return this.props.renderCursor||D_}}function Ft(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var lE=typeof Symbol=="function"&&Symbol.observable||"@@observable",yp=lE,Xl=()=>Math.random().toString(36).substring(7).split("").join("."),cE={INIT:`@@redux/INIT${Xl()}`,REPLACE:`@@redux/REPLACE${Xl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Xl()}`},Nn=cE;function bp(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function dE(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(hE(e))return"date";if(fE(e))return"error";const r=uE(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function uE(e){return typeof e.constructor=="function"?e.constructor.name:null}function fE(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function hE(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function an(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=dE(e)),t}function Cp(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(2):`Expected the root reducer to be a function. Instead, received: '${an(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ft(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(1):`Expected the enhancer to be a function. Instead, received: '${an(r)}'`);return r(Cp)(e,t)}let n=e,o=t,s=new Map,a=s,i=0,c=!1;function d(){a===s&&(a=new Map,s.forEach((v,y)=>{a.set(y,v)}))}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(4):`Expected the listener to be a function. Instead, received: '${an(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;d();const C=i++;return a.set(C,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d(),a.delete(C),s=null}}}function g(v){if(!bp(v))throw new Error(process.env.NODE_ENV==="production"?Ft(7):`Actions must be plain objects. Instead, the actual type was: '${an(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ft(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?Ft(17):`Action "type" property must be a string. Instead, the actual type was: '${an(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?Ft(9):"Reducers may not dispatch actions.");try{c=!0,o=n(o,v)}finally{c=!1}return(s=a).forEach(C=>{C()}),v}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ft(10):`Expected the nextReducer to be a function. Instead, received: '${an(v)}`);n=v,g({type:Nn.REPLACE})}function b(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?Ft(11):`Expected the observer to be an object. Instead, received: '${an(y)}'`);function C(){const w=y;w.next&&w.next(u())}return C(),{unsubscribe:v(C)}},[yp](){return this}}}return g({type:Nn.INIT}),{dispatch:g,subscribe:f,getState:u,replaceReducer:p,[yp]:b}}function Sp(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function pE(e,t,r,n){const o=Object.keys(t),s=r&&r.type===Nn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!bp(e))return`The ${s} has unexpected type of "${an(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const a=Object.keys(e).filter(i=>!t.hasOwnProperty(i)&&!n[i]);if(a.forEach(i=>{n[i]=!0}),!(r&&r.type===Nn.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function mE(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Nn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Ft(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Nn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Ft(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Nn.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function wp(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const i=t[a];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&Sp(`No reducer provided for key "${i}"`),typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let o;process.env.NODE_ENV!=="production"&&(o={});let s;try{mE(r)}catch(a){s=a}return function(i={},c){if(s)throw s;if(process.env.NODE_ENV!=="production"){const f=pE(i,r,c,o);f&&Sp(f)}let d=!1;const u={};for(let f=0;f<n.length;f++){const g=n[f],p=r[g],b=i[g],m=p(b,c);if(typeof m>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?Ft(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${g}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[g]=m,d=d||m!==b}return d=d||n.length!==Object.keys(i).length,d?u:i}}function gE(e=io().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const vE=wp({nodes:wp({focus:B_,edit:F_,open:$_,selection:q_,drag:gE}),dnd:j_}),yE=io();function bE({treeProps:e,imperativeHandle:t,children:r}){const n=h.useRef(null),o=h.useRef(null),s=h.useRef(Cp(vE,io(e))),a=C_.useSyncExternalStore(s.current.subscribe,s.current.getState,()=>yE),i=h.useMemo(()=>new fs(s.current,e,n,o),[]),c=h.useRef(0);return h.useMemo(()=>{c.current+=1,i.update(e)},Object.values(e)),h.useMemo(()=>{c.current+=1,i.update(i.props)},[a.nodes.open]),h.useImperativeHandle(t,()=>i),h.useEffect(()=>{i.props.selection?i.select(i.props.selection,{focus:!1}):i.deselectAll()},[i.props.selection]),h.useEffect(()=>{i.props.searchTerm||s.current.dispatch(Tl.clear(!0))},[i.props.searchTerm]),l.jsx(Mf.Provider,{value:i,children:l.jsx(qf.Provider,{value:c.current,children:l.jsx(Bf.Provider,{value:a.nodes,children:l.jsx($f.Provider,{value:a.dnd,children:l.jsx(K1,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||Yk,options:{rootElement:i.props.dndRootElement||void 0}},{children:r}))})})})})}function CE(){const e=Kt(),[,t]=Yh(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const o=n.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:s,drop:a}=up({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(lo.hovering(a.parentId,a.index)),n.canDrop()?s&&e.showCursor(s):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function SE(e){return CE(),e.children}function wE(){const t=Kt().props.renderContainer||pp;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function _E(){const e=Kt(),{offset:t,mouse:r,item:n,isDragging:o}=Sk(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),s=e.props.renderDragPreview||eh;return l.jsx(s,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:o})}function TE(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",o=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:s=>s[n],getChildren:typeof o=="function"?o:s=>s[o],childrenKey:typeof o=="string"?o:"children"}}class kE{constructor(t,r={}){this.accessors=TE(r),this.root=EE(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const o=this.find(t,n);if(o)return o}return null}return null}}function EE(e,t){const r=new _p({},null,t,"ROOT");return r.children=e.map(n=>Jl(n,r,t)),r}function Jl(e,t,r){const n=new _p(e,t,r),o=r.getChildren(e);return o&&(n.children=o.map(s=>Jl(s,n,r))),n}class _p{constructor(t,r,n,o){this.data=t,this.parent=r,this.accessors=n,this.id=o??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,o;const s=Jl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,s);const a=this.accessors.childrenKey,i=this.data;i[a]=(o=i[a])!==null&&o!==void 0?o:[],i[a].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let AE=0;function IE(e,t={}){const[r,n]=h.useState(e),o=t.idAccessor,s=t.childrenAccessor,a=h.useMemo(()=>new kE(r,{idAccessor:o,childrenAccessor:s}),[r,o,s]),i=b=>{for(const m of b.dragIds)a.move({id:m,parentId:b.parentId,index:b.index});n(a.data)},c=({name:b,id:m})=>{a.update({id:m,changes:{name:b}}),n(a.data)},d=typeof o=="string"?o:"id",u=typeof s=="string"?s:"children";return[r,{onMove:i,onRename:c,onCreate:({parentId:b,index:m,type:v})=>{if(typeof o=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(v==="internal"&&typeof s=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const y={[d]:`simple-tree-id-${AE++}`,name:""};return v==="internal"&&(y[u]=[]),a.create({parentId:b,index:m,data:y}),n(a.data),y},onDelete:b=>{b.ids.forEach(m=>a.drop({id:m})),n(a.data)}}]}function LE(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
546
+ Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=IE(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function DE(e,t){const r=LE(e);return l.jsxs(bE,{treeProps:r,imperativeHandle:t,children:[l.jsx(SE,{children:l.jsx(wE,{})}),l.jsx(_E,{})]})}const NE=h.forwardRef(DE);function ec(){return ae(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function OE(){return ae(e=>{var o;if(!e.selectedNodeId)return!1;const t=(o=e.treeData[0])==null?void 0:o.id,r=s=>{var a;for(const i of s){if(i.id===e.selectedNodeId)return i;if((a=i.children)!=null&&a.length){const c=r(i.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Tp={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},kp={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},Ep=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource","Dynamic Course Assessment","Dynamic QuestionSet"],tc=[{label:"All",value:"all"},{label:"Course Assessment",value:"Course Assessment"},{label:"eTextbook",value:"eTextbook"},{label:"Exam Question",value:"Exam Question"},{label:"Explanation Content",value:"Explanation Content"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"},{label:"SCORM Content",value:"SCORM Content"},{label:"Teacher Resource",value:"Teacher Resource"},{label:"Dynamic Course Assessment",value:"Dynamic Course Assessment"},{label:"Dynamic QuestionSet",value:"Dynamic QuestionSet"}];function PE(e){var r;if((r=e.metadata)!=null&&r.isAssessmentCourse)return"quiz";const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":e.primaryCategory==="Course"?"course":"default"}function hs(e){const t=PE(e);return{key:t,color:Tp[t]??Tp.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:kp[t]??kp.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const vt={row:"_row_1yoqj_1",grip:"_grip_1yoqj_16",menuBtn:"_menuBtn_1yoqj_19",rowLp:"_rowLp_1yoqj_23",selected:"_selected_1yoqj_27",title:"_title_1yoqj_32",dropTarget:"_dropTarget_1yoqj_41",toggle:"_toggle_1yoqj_58",ctIcon:"_ctIcon_1yoqj_73",ctIconLp:"_ctIconLp_1yoqj_85",folderIcon:"_folderIcon_1yoqj_89",rootIcon:"_rootIcon_1yoqj_94",titleLp:"_titleLp_1yoqj_110",levelTitle:"_levelTitle_1yoqj_114",renameInput:"_renameInput_1yoqj_119",dropHere:"_dropHere_1yoqj_128",menuWrap:"_menuWrap_1yoqj_138",menu:"_menu_1yoqj_19",dangerItem:"_dangerItem_1yoqj_190"},xE={video:ia,pdf:Ko,h5p:ra,scorm:sa,audio:oa,quiz:ta,course:Nr,default:nn},FE=({node:e,style:t,dragHandle:r,editorMode:n})=>{var M;const[o,s]=h.useState(!1),[a,i]=h.useState(!1),[c,d]=h.useState(e.data.name),u=h.useRef(null),f=ue(),g=Z(P=>P.editorProfile),p=n==="edit",b=ec(),m=hs(e.data),v=xE[m.key]??nn,y=e.isSelected,C=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),w=g.key==="learningPath",_=C?w?If:Ab:S?w?Bb:eu:v,T=w&&S&&!C&&!st(e.data),E=w&&!!((M=e.data.metadata)!=null&&M.isAssessmentCourse),A=e.level+1<=g.maxDepth,x=w?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,B=w?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;h.useEffect(()=>{if(!o)return;const P=V=>{var ne;(ne=u.current)!=null&&ne.contains(V.target)||s(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[o]);const D=h.useCallback(()=>{c.trim()&&e.submit(c.trim()),i(!1)},[c,e]),F=h.useCallback(P=>{P.key==="Enter"&&D(),P.key==="Escape"&&(d(e.data.name),i(!1))},[D,e.data.name]);return l.jsxs("div",{className:[vt.row,w?vt.rowLp:"",y?vt.selected:"",e.state.isOver&&S?vt.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":S?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":S?!e.isClosed:void 0,children:[p&&l.jsx("span",{ref:r,className:vt.grip,"aria-hidden":"true",children:l.jsx(qi,{size:14})}),l.jsx("button",{className:vt.toggle,onClick:P=>{P.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(ea,{size:14}):l.jsx(rn,{size:14})}),l.jsx("span",{className:[vt.ctIcon,C||S||E?vt.folderIcon:m.bgClass,w?vt.ctIconLp:"",C&&w?vt.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(_,{size:C&&w?15:12})}),a?l.jsx("input",{className:vt.renameInput,value:c,autoFocus:!0,onChange:P=>d(P.target.value),onBlur:D,onKeyDown:F,onClick:P=>P.stopPropagation()}):l.jsx("span",{className:[vt.title,w?vt.titleLp:"",T?vt.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>p&&i(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:vt.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),p&&l.jsxs("div",{className:vt.menuWrap,ref:u,children:[l.jsx("button",{className:vt.menuBtn,onClick:P=>{P.stopPropagation(),s(V=>!V)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(Zd,{size:14})}),o&&l.jsxs("div",{className:vt.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{i(!0),s(!1)},children:[l.jsx(Ub,{size:13})," ",f.treeNode.renameMenuItem]}),S&&b&&A&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),s(!1)},children:[l.jsx(Jd,{size:13})," ",x]}),e.data.parent&&b&&!w&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),s(!1)},children:[l.jsx(Rr,{size:13})," ",B]}),!C&&l.jsxs("button",{role:"menuitem",className:vt.dangerItem,onClick:()=>{e.tree.delete(e.id),s(!1)},children:[l.jsx(Yn,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function ME(e,t){var s,a;const n=((s=(await Ve.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)??{},o=((a=n.content)==null?void 0:a.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!o)throw new Error("Could not obtain an upload URL");return o}async function BE(e,t){const r=await fetch(e,{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"text/csv"},body:t});if(!r.ok)throw new Error(`Blob upload failed (${r.status})`);return e.split("?")[0]}async function $E(e,t){var i;const r=await ME(e,t.name),n=await BE(r,t),o=new FormData;return o.append("fileUrl",n),o.append("mimeType",t.type||"text/csv"),{processId:(((i=(await Ve.post(`/action/collection/v1/import/${e}`,o)).data)==null?void 0:i.result)??{}).processId??""}}async function qE(e){var r;return((r=(await Ve.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Ap(e){var n,o,s;const r=(s=(o=(n=(await Ve.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:o.collection)==null?void 0:s.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function jE(e){return Ap(e)}const Ye={container:"_container_jr3ij_1",header:"_header_jr3ij_13",title:"_title_jr3ij_22",closeBtn:"_closeBtn_jr3ij_29",body:"_body_jr3ij_45",dropZone:"_dropZone_jr3ij_54",dragOver:"_dragOver_jr3ij_67",hasFile:"_hasFile_jr3ij_72",hiddenInput:"_hiddenInput_jr3ij_78",fileInfo:"_fileInfo_jr3ij_82",fileIcon:"_fileIcon_jr3ij_89",fileName:"_fileName_jr3ij_93",fileSize:"_fileSize_jr3ij_100",dropHint:"_dropHint_jr3ij_105",dropIcon:"_dropIcon_jr3ij_112",dropText:"_dropText_jr3ij_117",dropSubtext:"_dropSubtext_jr3ij_124",sampleLink:"_sampleLink_jr3ij_130",statusBar:"_statusBar_jr3ij_145",status_uploading:"_status_uploading_jr3ij_154",status_processing:"_status_processing_jr3ij_154",status_done:"_status_done_jr3ij_159",status_error:"_status_error_jr3ij_164",successDetail:"_successDetail_jr3ij_170",spinner:"_spinner_jr3ij_175",spin:"_spin_jr3ij_175",errorMsg:"_errorMsg_jr3ij_191",failedSection:"_failedSection_jr3ij_197",failedTitle:"_failedTitle_jr3ij_203",tableWrap:"_tableWrap_jr3ij_213",failedTable:"_failedTable_jr3ij_219",reasonCell:"_reasonCell_jr3ij_244",footer:"_footer_jr3ij_248"},UE=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const o=ue(),[s,a]=h.useState(null),[i,c]=h.useState(!1),[d,u]=h.useState("idle"),[f,g]=h.useState(""),[p,b]=h.useState([]),[m,v]=h.useState(null),y=h.useRef(null),C=h.useRef(null),S=h.useCallback(()=>{C.current!==null&&(clearInterval(C.current),C.current=null)},[]);h.useEffect(()=>()=>S(),[S]);const w=D=>D.name.toLowerCase().endsWith(".csv")?D.size>50*1024*1024?(g(o.csvUpload.fileTooLarge),!1):!0:(g(o.csvUpload.invalidFileType),!1),_=h.useCallback(D=>{g(""),b([]),v(null),u("idle"),w(D)&&a(D)},[]),T=h.useCallback(D=>{D.preventDefault(),c(!1);const F=D.dataTransfer.files[0];F&&_(F)},[_]),E=h.useCallback(D=>{var M;const F=(M=D.target.files)==null?void 0:M[0];F&&_(F),D.target.value=""},[_]),A=h.useCallback(async()=>{try{const D=await jE(e),F=document.createElement("a");F.href=D,F.download="sample_hierarchy.csv",F.target="_blank",F.click()}catch{g(o.csvUpload.downloadSampleFailed)}},[e,o.csvUpload.downloadSampleFailed]),x=h.useCallback(async()=>{if(s){u("uploading"),g(""),b([]);try{const{processId:D}=await $E(e,s);if(!D){u("done"),v(null),setTimeout(t,1500);return}u("processing"),C.current=setInterval(async()=>{try{const F=await qE(D);F.status==="COMPLETED"?(S(),u("done"),v(F.successCount??null),F.failedRecords&&F.failedRecords.length>0?b(F.failedRecords):setTimeout(t,1500)):F.status==="FAILED"&&(S(),u("error"),g(o.csvUpload.processingFailed),F.failedRecords&&b(F.failedRecords))}catch{S(),u("error"),g(o.csvUpload.connectionLost)}},2e3)}catch{u("error"),g(o.csvUpload.uploadFailed)}}},[e,s,t,S,o.csvUpload.processingFailed,o.csvUpload.connectionLost,o.csvUpload.uploadFailed]),B={idle:"",uploading:o.csvUpload.statusUploading,processing:o.csvUpload.statusProcessing,done:o.csvUpload.statusDone,error:o.csvUpload.statusError};return l.jsxs("div",{className:Ye.container,children:[l.jsxs("div",{className:Ye.header,children:[l.jsx("h2",{className:Ye.title,children:n==="update"?o.csvUpload.titleUpdate:o.csvUpload.titleCreate}),l.jsx("button",{className:Ye.closeBtn,onClick:r,"aria-label":o.csvUpload.closeAriaLabel,children:l.jsx(Or,{size:18})})]}),l.jsxs("div",{className:Ye.body,children:[l.jsxs("div",{className:`${Ye.dropZone} ${i?Ye.dragOver:""} ${s?Ye.hasFile:""}`,onDragEnter:D=>{D.preventDefault(),c(!0)},onDragOver:D=>{D.preventDefault(),c(!0)},onDragLeave:D=>{D.preventDefault(),c(!1)},onDrop:T,onClick:()=>{var D;return(D=y.current)==null?void 0:D.click()},role:"button",tabIndex:0,"aria-label":o.csvUpload.dropZoneAriaLabel,onKeyDown:D=>{var F;return D.key==="Enter"&&((F=y.current)==null?void 0:F.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:Ye.hiddenInput,onChange:E,"aria-hidden":"true"}),s?l.jsxs("div",{className:Ye.fileInfo,children:[l.jsx(Ko,{size:24,className:Ye.fileIcon}),l.jsx("span",{className:Ye.fileName,children:s.name}),l.jsxs("span",{className:Ye.fileSize,children:["(",(s.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Ye.dropHint,children:[l.jsx(ji,{size:32,className:Ye.dropIcon}),l.jsx("p",{className:Ye.dropText,children:o.csvUpload.dropText}),l.jsx("p",{className:Ye.dropSubtext,children:o.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:Ye.sampleLink,onClick:A,type:"button",children:o.csvUpload.downloadSample}),d!=="idle"&&l.jsxs("div",{className:`${Ye.statusBar} ${Ye[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&l.jsx("span",{className:Ye.spinner,"aria-hidden":"true"}),B[d],d==="done"&&m!==null&&l.jsx("span",{className:Ye.successDetail,children:o.csvUpload.itemsImportedSuffix.replace("{count}",String(m))})]}),f&&l.jsx("p",{className:Ye.errorMsg,role:"alert",children:f}),p.length>0&&l.jsxs("div",{className:Ye.failedSection,children:[l.jsx("h4",{className:Ye.failedTitle,children:o.csvUpload.failedRowsTitle.replace("{count}",String(p.length))}),l.jsx("div",{className:Ye.tableWrap,children:l.jsxs("table",{className:Ye.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:o.csvUpload.rowHeader}),l.jsx("th",{children:o.csvUpload.nameHeader}),l.jsx("th",{children:o.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:p.map((D,F)=>l.jsxs("tr",{children:[l.jsx("td",{children:D.rowNumber??F+1}),l.jsx("td",{children:D.name??"—"}),l.jsx("td",{className:Ye.reasonCell,children:D.reason??o.csvUpload.unknownError})]},F))})]})})]})]}),l.jsxs("div",{className:Ye.footer,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:o.csvUpload.cancel}),l.jsx(Re,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!s||d==="done",onClick:x,children:d==="done"?o.csvUpload.uploaded:o.csvUpload.upload})]})]})};function rc(){var v,y,C,S,w,_,T;const e=ue(),t=ae(E=>E.treeData),r=ae(E=>E.treeCache),n=ae(E=>E.deleteNode),o=lt(E=>E.activeAssessmentSlot),s=lt(E=>E.setActiveAssessmentSlot),a=lt(E=>E.openModal),i=((v=t[0])==null?void 0:v.children)??[],c=i[0],d=i.length>1?i[i.length-1]:void 0,u=st(c),f=st(d),g=t[0],p=g?((y=r[g.id])==null?void 0:y.policy)??((C=g.metadata)==null?void 0:C.policy):void 0,b=!!p&&wf.has(p),m=E=>{const A=E==="pre"?c:d;if(!A)return;const x=E==="pre"&&b?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;a("confirmDelete",{message:x,onConfirm:()=>n(A.id)})};return{pre:{level:c,filled:u,courseName:u?(w=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:w.name:void 0,required:b},post:{level:d,filled:f,courseName:f?(T=(_=d==null?void 0:d.children)==null?void 0:_[0])==null?void 0:T.name:void 0,required:!1},activeAssessmentSlot:o,setActiveAssessmentSlot:s,deleteSlot:m}}const Tr={container:"_container_1ghxo_1",header:"_header_1ghxo_8",sectionLabel:"_sectionLabel_1ghxo_18",headerActions:"_headerActions_1ghxo_26",iconBtn:"_iconBtn_1ghxo_33",menuWrap:"_menuWrap_1ghxo_51",dropdownMenu:"_dropdownMenu_1ghxo_55",treeWrapper:"_treeWrapper_1ghxo_87",csvModal:"_csvModal_1ghxo_103",footer:"_footer_1ghxo_113"},HE=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Me;const n=ue(),o=h.useRef(null),s=h.useRef(null),a=h.useRef(null),[i,c]=h.useState(400),[d,u]=h.useState(!1),[f,g]=h.useState(!1),[p,b]=h.useState("create"),{treeData:m,selectedNodeId:v,selectNode:y,addNode:C,deleteNode:S,getNodeById:w,reorderChildren:_,moveNode:T,setTreeData:E}=ae(),A=lt(re=>re.openModal),x=Z(re=>re.editorProfile),B=x.key==="learningPath",D=e==="edit",F=ec(),M=D&&F,P=B?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,V=x.maxDepth>1,ne=(((Me=m[0])==null?void 0:Me.children)??[]).some(re=>re.isFolder),{pre:W,post:de,deleteSlot:ie}=rc(),{level:ve}=W,{level:me}=de,z=Z(re=>{var ce,G,H,Ae;return((G=(ce=re.editorConfig)==null?void 0:ce.context)==null?void 0:G.contentId)??((Ae=(H=re.editorConfig)==null?void 0:H.context)==null?void 0:Ae.identifier)??""}),Ce=Z(re=>{var G,H;const ce=(H=(G=re.categoryMeta)==null?void 0:G.sourcingSettings)==null?void 0:H.collection;return(ce==null?void 0:ce.enableBulkUpload)!==!1}),ke=x.features.csvUpload&&Ce;h.useEffect(()=>{const re=s.current;if(!re)return;const ce=new ResizeObserver(()=>{c(re.clientHeight||400)});return ce.observe(re),c(re.clientHeight||400),()=>ce.disconnect()},[]),h.useEffect(()=>{if(!d)return;const re=ce=>{var G;(G=a.current)!=null&&G.contains(ce.target)||u(!1)};return document.addEventListener("mousedown",re),()=>document.removeEventListener("mousedown",re)},[d]);const U=h.useCallback(re=>{re.length>0&&y(re[0].data.id)},[y]),q=h.useCallback(({parentId:re,index:ce,dragIds:G})=>{if(!re)return;const H=G[0],Ae=nc(m,H);if(!Ae)return;const Te=Ae.parent;if(Te===re){const Ie=nc(m,re);if(!(Ie!=null&&Ie.children))return;const we=Ie.children.findIndex(Be=>Be.id===H);if(we<0)return;_(re,we,ce>we?ce-1:ce)}else T(H,Te??"",re)},[m,_,T]),le=h.useCallback(({ids:re})=>{if(!B){for(const G of re)S(G);return}if(re.length===1){const G=re[0];if((ve==null?void 0:ve.id)===G){ie("pre");return}if((me==null?void 0:me.id)===G){ie("post");return}const H=w(G),Ae=H!=null&&H.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",H.name):n.learningPath.deleteCourseConfirm;A("confirmDelete",{message:Ae,onConfirm:()=>S(G)});return}const ce=n.learningPath.deleteMultipleConfirm.replace("{count}",String(re.length));A("confirmDelete",{message:ce,onConfirm:()=>{for(const G of re)S(G)}})},[S,ie,B,ve,me,w,A,n]),ge=h.useCallback(({parentId:re})=>{var H;const ce=re??((H=m[0])==null?void 0:H.id)??"";if(!ce)return{id:crypto.randomUUID()};const G=C(ce,"unit");return G?{id:G}:(be.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[C,m,n]),ee=h.useCallback(()=>{var ce;const re=(ce=m[0])==null?void 0:ce.id;re&&(C(re,"unit")||be.error(n.outlineTree.maxDepthReachedToast))},[m,C,n]),fe=h.useCallback(()=>{v&&(C(v,"subunit")||be.error(n.outlineTree.maxDepthReachedToast))},[v,C,n]),X=h.useCallback(async()=>{if(u(!1),!!z)try{const re=await Ap(z),ce=await fetch(re).then(Ae=>Ae.blob()),G=URL.createObjectURL(ce),H=document.createElement("a");H.href=G,H.download=`${z}-folders.csv`,H.style.display="none",document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(G)}catch{be.error(n.outlineTree.downloadCsvFailedToast)}},[z,n]),Se=h.useCallback(async()=>{if(g(!1),!!z)try{const{rootNode:re}=await af(z);E([re]),be.success(n.outlineTree.outlineRefreshedToast)}catch{be.error(n.outlineTree.outlineRefreshFailedToast)}},[z,E,n]);return l.jsxs("div",{className:Tr.container,children:[l.jsxs("div",{className:Tr.header,children:[B&&l.jsx("span",{className:Tr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:Tr.headerActions,children:[D&&ke&&l.jsxs("div",{className:Tr.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:Tr.iconBtn,onClick:()=>u(re=>!re),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:l.jsx(Zd,{size:15})}),d&&l.jsxs("div",{className:Tr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:ne,title:ne?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{u(!1),b("create"),g(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ne,title:ne?void 0:n.outlineTree.noFoldersYetTitle,onClick:X,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ne,title:ne?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{u(!1),b("update"),g(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:Tr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(qb,{size:15}):l.jsx($b,{size:15})})]})]}),l.jsx("div",{className:Tr.treeWrapper,ref:s,children:l.jsx(NE,{ref:o,data:m,idAccessor:"id",childrenAccessor:"children",onSelect:U,onMove:D?q:void 0,onDelete:D?le:void 0,onCreate:D?ge:void 0,disableEdit:!D,disableDrop:!D,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:i,width:"100%",children:re=>l.jsx(FE,{...re,editorMode:e})})}),D&&l.jsxs("div",{className:Tr.footer,children:[l.jsxs(Re,{variant:"ghost",size:"sm",onClick:ee,disabled:!M,children:[l.jsx(Rr,{size:14})," ",P]}),V&&l.jsxs(Re,{variant:"ghost",size:"sm",onClick:fe,disabled:!M||!v,children:[l.jsx(Jd,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:Tr.csvModal,children:l.jsx(UE,{contentId:z,mode:p,onComplete:Se,onClose:()=>g(!1)})})]})};function nc(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=nc(r.children,t);if(n)return n}}}const ps={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},VE=({crumbs:e})=>{const t=ae(n=>n.selectNode),r=ue();return e.length?l.jsxs("nav",{className:ps.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:ps.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Fb,{size:13})}),e.map((n,o)=>l.jsxs(h.Fragment,{children:[l.jsx(ea,{size:13,className:ps.sep}),o<e.length-1?l.jsx("button",{className:ps.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:ps.current,children:n.name})]},n.id))]}):null},ms={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},zE=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const o=ue(),s=[{id:"details",label:o.tabBar.detailsTab},{id:"audience",label:o.tabBar.audienceCurriculumTab},{id:"licensing",label:o.tabBar.licensingTab}],a=n?s.filter(i=>n.includes(i.id)):s;return l.jsx("div",{className:ms.tabBar,role:"tablist","aria-label":o.tabBar.metadataSectionsAriaLabel,children:a.map(i=>l.jsxs("button",{role:"tab","aria-selected":e===i.id,"aria-controls":`panel-${i.id}`,className:[ms.tab,e===i.id?ms.active:"",r.includes(i.id)?ms.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:ms.errorDot,"aria-label":o.tabBar.hasErrorsAriaLabel})]},i.id))})};var gs=e=>e.type==="checkbox",On=e=>e instanceof Date,Lt=e=>e==null;const Ip=e=>typeof e=="object";var nt=e=>!Lt(e)&&!Array.isArray(e)&&Ip(e)&&!On(e),oc=e=>nt(e)&&e.target?gs(e.target)?e.target.checked:e.target.value:e,Lp=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),Dp=e=>{const t=e.constructor&&e.constructor.prototype;return nt(t)&&t.hasOwnProperty("isPrototypeOf")},Qa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function at(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Qa&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(nt(e)&&Dp(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=at(e[o]));return n}const ln={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},kr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Er={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},sc="form",Np="root",Op=["__proto__","constructor","prototype"];var vs=e=>/^\w*$/.test(e),Je=e=>e===void 0,Wa=e=>e.split(/[.[\]'"]/g).filter(Boolean),te=(e,t,r)=>{if(!t||!nt(e))return r;const n=vs(t)?[t]:Wa(t);if(n.some(s=>Op.includes(s)))return r;const o=n.reduce((s,a)=>Lt(s)?void 0:s[a],e);return Je(o)||o===e?Je(e[t])?r:e[t]:o},nr=e=>typeof e=="boolean",Mt=e=>typeof e=="function",Ze=(e,t,r)=>{let n=-1;const o=vs(t)?[t]:Wa(t),s=o.length,a=s-1;for(;++n<s;){const i=o[n];let c=r;if(n!==a){const d=e[i];c=nt(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(Op.includes(i))return;e[i]=c,e=e[i]}};const ac=h.createContext(null);ac.displayName="HookFormControlContext";const ic=()=>h.useContext(ac);var Pp=(e,t,r,n=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==kr.all&&(t._proxyFormState[a]=!n||kr.all),r&&(r[a]=!0),e[a]}});return o};const lc=Qa?h.useLayoutEffect:h.useEffect;function RE(e){const t=ic(),{control:r=t,disabled:n,name:o,exact:s}=e||{},[a,i]=h.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=h.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return lc(()=>r._subscribe({name:o,formState:c.current,exact:s,callback:d=>{!n&&i({...r._formState,...d,defaultValues:r._defaultValues})}}),[o,n,s]),h.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),h.useMemo(()=>Pp(a,r,c.current,!1),[a,r])}var Bt=e=>typeof e=="string",cc=(e,t,r,n,o)=>Bt(e)?(n&&t.watch.add(e),te(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),te(r,s))):(n&&(t.watchAll=!0),r),dc=e=>Lt(e)||!Ip(e);const xp=(e,t)=>t.length===0&&!Array.isArray(e)&&!Dp(e);function or(e,t,r=new WeakMap){if(e===t)return!0;if(dc(e)||dc(t))return Object.is(e,t);if(On(e)&&On(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(xp(e,n)||xp(t,o))return Object.is(e,t);const s=r.get(e);if(s&&s.has(t))return!0;s?s.add(t):r.set(e,new WeakSet([t]));for(const a of n){const i=e[a];if(!(a in t))return!1;if(a!=="ref"){const c=t[a];if(On(i)&&On(c)||(nt(i)||Array.isArray(i))&&(nt(c)||Array.isArray(c))?!or(i,c,r):!Object.is(i,c))return!1}}return!0}function QE(e){const t=ic(),{control:r=t,name:n,defaultValue:o,disabled:s,exact:a,compute:i}=e||{},c=h.useRef(o),d=h.useRef(i),u=h.useRef(void 0),f=h.useRef(r),g=h.useRef(n);d.current=i;const[p,b]=h.useState(()=>{const w=r._getWatch(n,c.current);return d.current?d.current(w):w}),m=h.useCallback(w=>{const _=cc(n,r._names,w||r._formValues,!1,c.current);return d.current?d.current(_):_},[r._formValues,r._names,n]),v=h.useCallback(w=>{if(!s){const _=cc(n,r._names,w||r._formValues,!1,c.current);if(d.current){const T=d.current(_);or(T,u.current)||(b(T),u.current=T)}else b(_)}},[r._formValues,r._names,s,n]);lc(()=>((f.current!==r||!or(g.current,n))&&(f.current=r,g.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:w=>{v(w.values)}})),[r,a,n,v]),h.useEffect(()=>r._removeUnmounted());const y=f.current!==r,C=g.current,S=h.useMemo(()=>{if(s)return null;const w=!y&&!or(C,n);return y||w?m():null},[s,y,n,C,m]);return S!==null?S:p}function ys(e){const t=ic(),{name:r,disabled:n,control:o=t,shouldUnregister:s,defaultValue:a,exact:i=!0}=e,c=Lp(o._names.array,r),d=h.useMemo(()=>te(o._formValues,r,te(o._defaultValues,r,a)),[o,r,a]),u=QE({control:o,name:r,defaultValue:d,exact:i}),f=RE({control:o,name:r,exact:i}),g=h.useRef(e),p=h.useRef(null),b=h.useRef(o.register(r,{...e.rules,value:u,...nr(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const m=h.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!te(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!te(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!te(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!te(f.validatingFields,r)},error:{enumerable:!0,get:()=>te(f.errors,r)}}),[f,r]),v=h.useCallback(w=>{const _=oc(w);return te(o._fields,r)||(b.current=o.register(r,{...g.current.rules,value:_})),b.current.onChange({target:{value:oc(w),name:r},type:ln.CHANGE})},[r,o]),y=h.useCallback(()=>b.current.onBlur({target:{value:te(o._formValues,r),name:r},type:ln.BLUR}),[r,o._formValues]),C=h.useCallback(w=>{w&&(p.current={focus:()=>Mt(w.focus)&&w.focus(),select:()=>Mt(w.select)&&w.select(),setCustomValidity:T=>Mt(w.setCustomValidity)&&w.setCustomValidity(T),reportValidity:()=>Mt(w.reportValidity)&&w.reportValidity()});const _=te(o._fields,r);_&&_._f&&w&&(_._f.ref=p.current)},[o._fields,r]),S=h.useMemo(()=>({name:r,value:u,...nr(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:C}),[r,n,f.disabled,v,y,C,u]);return h.useEffect(()=>{const w=o._options.shouldUnregister||s;o.register(r,{...g.current.rules,...nr(g.current.disabled)?{disabled:g.current.disabled}:{}});const _=(T,E)=>{const A=te(o._fields,T);A&&A._f&&(A._f.mount=E)};if(_(r,!0),w){const T=at(te(s?o._defaultValues:o._options.values||o._defaultValues,r,te(o._options.defaultValues,r,g.current.defaultValue)));Ze(o._defaultValues,r,T),Je(te(o._formValues,r))&&Ze(o._formValues,r,T)}if(!c&&o.register(r),p.current){const T=te(o._fields,r);T&&T._f&&(T._f.ref=p.current)}return()=>{(c?w&&!o._state.action:w)?o.unregister(r):_(r,!1)}},[r,o,c,s]),h.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),h.useMemo(()=>({field:S,formState:f,fieldState:m}),[S,f,m])}const WE=e=>e.render(ys(e)),uc=h.createContext(null);uc.displayName="HookFormContext";const pr=()=>h.useContext(uc),GE=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:g,unregister:p,control:b,register:m,setFocus:v,subscribe:y})=>{const C=h.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:a,setValues:i,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:g,unregister:p,control:b,register:m,setFocus:v,subscribe:y}),[s,b,d,n,r,g,m,f,u,o,v,a,i,y,c,p,t]);return h.createElement(uc.Provider,{value:C},h.createElement(ac.Provider,{value:C.control},e))};var KE=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Fp=e=>Array.isArray(e)?e.filter(Boolean):[],Ga=e=>Array.isArray(e)?e:[e],Mp=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function Bp(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&nt(o)&&s){const a=Bp(o,s);nt(a)&&(r[n]=a)}else e[n]&&(r[n]=s)}return r}var bt=e=>nt(e)&&!Object.keys(e).length,fc=e=>e.type==="file",Ka=e=>{if(!Qa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},$p=e=>e.type==="select-multiple",hc=e=>e.type==="radio",YE=e=>hc(e)||gs(e),pc=e=>Ka(e)&&e.isConnected;function ZE(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(Lt(e)){e=void 0;break}e=e[t[n]],n++}return e}function XE(e){for(const t in e)if(e.hasOwnProperty(t)&&!Je(e[t]))return!1;return!0}function dt(e,t){if(Bt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:vs(t)?[t]:Wa(t),n=r.length===1?e:ZE(e,r),o=r.length-1,s=r[o];return n&&delete n[s],o!==0&&(nt(n)&&bt(n)||Array.isArray(n)&&XE(n))&&dt(e,r.slice(0,-1)),e}var JE=e=>{for(const t in e)if(Mt(e[t]))return!0;return!1};function qp(e){return Array.isArray(e)||nt(e)&&!JE(e)}function mc(e,t={}){for(const r in e){const n=e[r];qp(n)?(t[r]=Array.isArray(n)?[]:{},mc(n,t[r])):Je(n)||(t[r]=!0)}return t}function gc(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>gc(r));return t.some(r=>r!==void 0)?t:void 0}if(nt(e)){const t={};for(const r in e){const n=gc(e[r]);Je(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Pn(e,t,r){r||(r=mc(t));for(const n in e){const o=e[n];if(qp(o))Je(t)||dc(r[n])?r[n]=mc(o,Array.isArray(o)?[]:{}):Pn(o,Lt(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!or(o,s)}}return gc(r)||{}}const jp={value:!1,isValid:!1},Up={value:!0,isValid:!0};var Hp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Je(e[0].attributes.value)?Je(e[0].value)||e[0].value===""?Up:{value:e[0].value,isValid:!0}:Up:jp}return jp},Vp=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Je(e)?e:t?e===""?NaN:e&&+e:r&&Bt(e)?new Date(e):n?n(e):e;const zp={isValid:!1,value:null};var Rp=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,zp):zp;function Qp(e){const t=e.ref;return fc(t)?t.files:hc(t)?Rp(e.refs).value:$p(t)?[...t.selectedOptions].map(({value:r})=>r):gs(t)?Hp(e.refs).value:Vp(Je(t.value)?e.ref.value:t.value,e)}var eA=(e,t,r,n)=>{const o={};for(const s of e){const a=te(t,s);a&&Ze(o,s,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Ya=e=>e instanceof RegExp,bs=e=>Je(e)?e:Ya(e)?e.source:nt(e)?Ya(e.value)?e.value.source:e.value:e,Wp=e=>({isOnSubmit:!e||e===kr.onSubmit,isOnBlur:e===kr.onBlur,isOnChange:e===kr.onChange,isOnAll:e===kr.all,isOnTouch:e===kr.onTouched});const Gp="AsyncFunction";var tA=e=>!!e&&!!e.validate&&!!(Mt(e.validate)&&e.validate.constructor.name===Gp||nt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Gp)),rA=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),vc=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Cs=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=te(e,o);if(s){const{_f:a,...i}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Cs(i,t))break}else if(nt(i)&&Cs(i,t))break}}};function Kp(e,t,r){const n=te(e,r);if(n||vs(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),a=te(t,s),i=te(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(i&&i.type)return{name:s,error:i};if(i&&i.root&&i.root.type)return{name:`${s}.root`,error:i.root};o.pop()}return{name:r}}var nA=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return bt(s)||n&&Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!n||kr.all))},oA=(e,t,r)=>!e||!t||e===t||Ga(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),sA=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,aA=(e,t)=>!Fp(te(e,t)).length&&dt(e,t),Yp=(e,t,r)=>{const n=te(e,r),o=Array.isArray(n)?n:[];return Ze(o,Np,t[r]),Ze(e,r,o),e};function Zp(e,t,r="validate"){if(Bt(e)||Array.isArray(e)&&e.every(Bt)||nr(e)&&!e)return{type:r,message:Bt(e)?e:"",ref:t}}var go=e=>nt(e)&&!Ya(e)?e:{value:e,message:""},Xp=async(e,t,r,n,o,s)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:f,max:g,pattern:p,validate:b,name:m,valueAsNumber:v,mount:y}=e._f,C=te(r,m);if(!y||t.has(m))return{};const S=i?i[0]:a,w=F=>{if(o&&S.reportValidity){const M=nr(F)?"":F||"";i?i.forEach(P=>P.setCustomValidity(M)):S.setCustomValidity(M),S.reportValidity()}},_={},T=hc(a),E=gs(a),A=T||E,x=(v||fc(a))&&Je(a.value)&&Je(C)||Ka(a)&&a.value===""||C===""||Array.isArray(C)&&!C.length,B=KE.bind(null,m,n,_),D=(F,M,P,V=Er.maxLength,ne=Er.minLength)=>{const W=F?M:P;_[m]={type:F?V:ne,message:W,ref:a,...B(F?V:ne,W)}};if(s?!Array.isArray(C)||!C.length:c&&(!A&&(x||Lt(C))||nr(C)&&!C||E&&!Hp(i).isValid||T&&!Rp(i).isValid)){const{value:F,message:M}=Bt(c)?{value:!!c,message:c}:go(c);if(F&&(_[m]={type:Er.required,message:M,ref:S,...B(Er.required,M)},!n))return w(M),_}if(!x&&(!Lt(f)||!Lt(g))){let F,M;const P=go(g),V=go(f);if(!Lt(C)&&!isNaN(C)){const ne=a.valueAsNumber||C&&+C;Lt(P.value)||(F=ne>P.value),Lt(V.value)||(M=ne<V.value)}else{const ne=a.valueAsDate||new Date(C),W=ve=>new Date(new Date().toDateString()+" "+ve),de=a.type=="time",ie=a.type=="week";Bt(P.value)&&C&&(F=de?W(C)>W(P.value):ie?C>P.value:ne>new Date(P.value)),Bt(V.value)&&C&&(M=de?W(C)<W(V.value):ie?C<V.value:ne<new Date(V.value))}if((F||M)&&(D(!!F,P.message,V.message,Er.max,Er.min),!n))return w(_[m].message),_}if((d||u)&&!x&&(Bt(C)||s&&Array.isArray(C))){const F=go(d),M=go(u),P=!Lt(F.value)&&C.length>+F.value,V=!Lt(M.value)&&C.length<+M.value;if((P||V)&&(D(P,F.message,M.message),!n))return w(_[m].message),_}if(p&&!x&&Bt(C)){const{value:F,message:M}=go(p);if(Ya(F)&&!C.match(F)&&(_[m]={type:Er.pattern,message:M,ref:a,...B(Er.pattern,M)},!n))return w(M),_}if(b){if(Mt(b)){const F=await b(C,r),M=Zp(F,S);if(M&&(_[m]={...M,...B(Er.validate,M.message)},!n))return w(M.message),_}else if(nt(b)){let F={};for(const M in b){if(!bt(F)&&!n)break;const P=Zp(await b[M](C,r),S,M);P&&(F={...P,...B(M,P.message)},w(P.message),n&&(_[m]=F))}if(!bt(F)&&(_[m]={ref:S,...F},!n))return _}}return w(!0),_};const iA={mode:kr.onSubmit,reValidateMode:kr.onChange,shouldFocusError:!0},Jp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function lA(e={}){let t={...iA,...e},r={...at(Jp),isLoading:Mt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=nt(t.defaultValues)||nt(t.values)?at(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:at(o),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...u};let g={...f};const p={array:Mp(),state:Mp()},b=t.criteriaMode===kr.all,m=k=>N=>{clearTimeout(d),d=setTimeout(k,N)},v=async k=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||g.isValid||k)){let N;t.resolver?(N=bt((await B()).errors),y()):N=await M({fields:n,onlyCheckValid:!0,eventType:ln.VALID}),N!==r.isValid&&p.state.next({isValid:N})}},y=(k,N)=>{!t.disabled&&(f.isValidating||f.validatingFields||g.isValidating||g.validatingFields)&&((k||Array.from(i.mount)).forEach(O=>{O&&(N?Ze(r.validatingFields,O,N):dt(r.validatingFields,O))}),p.state.next({validatingFields:r.validatingFields,isValidating:!bt(r.validatingFields)}))},C=()=>{r.dirtyFields=Pn(o,s)},S=(k,N=[],O,R,Q=!0,K=!0)=>{if(R&&O&&!t.disabled){if(a.action=!0,K&&Array.isArray(te(n,k))){const Y=O(te(n,k),R.argA,R.argB);Q&&Ze(n,k,Y)}if(K&&Array.isArray(te(r.errors,k))){const Y=O(te(r.errors,k),R.argA,R.argB);Q&&Ze(r.errors,k,Y),aA(r.errors,k)}if((f.touchedFields||g.touchedFields)&&K&&Array.isArray(te(r.touchedFields,k))){const Y=O(te(r.touchedFields,k),R.argA,R.argB);Q&&Ze(r.touchedFields,k,Y)}(f.dirtyFields||g.dirtyFields)&&C(),p.state.next({name:k,isDirty:V(k,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ze(s,k,N)},w=(k,N)=>{Ze(r.errors,k,N),r.errors={...r.errors},p.state.next({errors:r.errors})},_=k=>{r.errors=k,p.state.next({errors:r.errors,isValid:!1})},T=k=>{const N=vs(k)?[k]:Wa(k);let O=s,R=o;for(let Q=0;Q<N.length-1;Q++){const K=N[Q];if(O=Lt(O)?O:O[K],R=Lt(R)?R:R[K],O===null&&R!==null)return!0}return!1},E=(k,N,O,R)=>{const Q=te(n,k);if(Q){if(T(k))return;const K=Je(te(s,k)),Y=te(s,k,Je(O)?te(o,k):O);Je(Y)||R&&R.defaultChecked||N?Ze(s,k,N?Y:Qp(Q._f)):de(k,Y),a.mount&&!a.action&&(v(),K&&r.isDirty&&(f.isDirty||g.isDirty)&&(V()||(r.isDirty=!1,p.state.next({...r}))),e.shouldUnregister&&K&&!Je(te(s,k))&&vc(k,i)&&(a.watch=!0))}},A=(k,N,O,R,Q)=>{let K=!1,Y=!1;const he={name:k};if(!t.disabled){if(!O||R){(f.isDirty||g.isDirty)&&(Y=r.isDirty,r.isDirty=he.isDirty=V(),K=Y!==he.isDirty);const Pe=or(te(o,k),N);Y=!!te(r.dirtyFields,k),Pe!==r.isDirty?r.dirtyFields=Pn(o,s):Pe?dt(r.dirtyFields,k):Ze(r.dirtyFields,k,!0),he.dirtyFields=r.dirtyFields,K=K||(f.dirtyFields||g.dirtyFields)&&Y!==!Pe}if(O){const Pe=te(r.touchedFields,k);Pe||(Ze(r.touchedFields,k,O),he.touchedFields=r.touchedFields,K=K||(f.touchedFields||g.touchedFields)&&Pe!==O)}K&&Q&&p.state.next(he)}return K?he:{}},x=(k,N,O,R)=>{const Q=te(r.errors,k),K=(f.isValid||g.isValid)&&nr(N)&&r.isValid!==N;if(t.delayError&&O?(c=m(()=>w(k,O)),c(t.delayError)):(clearTimeout(d),c=null,O?Ze(r.errors,k,O):dt(r.errors,k),r.errors={...r.errors}),(O?!or(Q,O):Q)||!bt(R)||K){const Y={...R,...K&&nr(N)?{isValid:N}:{},errors:r.errors,name:k};r={...r,...Y},p.state.next(Y)}},B=async k=>(y(k,!0),await t.resolver(s,t.context,eA(k||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),D=async k=>{const{errors:N}=await B(k);if(y(k),k){for(const O of k){const R=te(N,O);R?i.array.has(O)&&nt(R)&&!Object.keys(R).some(Q=>!Number.isNaN(Number(Q)))?Yp(r.errors,{[O]:R},O):Ze(r.errors,O,R):dt(r.errors,O)}r.errors={...r.errors}}else r.errors=N;return N},F=async({name:k,eventType:N})=>{if(e.validate){const O=await e.validate({formValues:s,formState:r,name:k,eventType:N});if(nt(O))for(const R in O){const Q=O[R];Q&&ee(`${sc}.${R}`,{message:Bt(Q.message)?Q.message:"",type:Q.type||Er.validate})}else Bt(O)||!O?ee(sc,{message:O||"",type:Er.validate}):ge(sc);return O}return!0},M=async({fields:k,onlyCheckValid:N,name:O,eventType:R,context:Q={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Q.runRootValidation=!0,!await F({name:O,eventType:R})&&(Q.valid=!1,N)))return Q.valid;for(const K in k){const Y=k[K];if(Y){const{_f:he,...Pe}=Y;if(he){const et=i.array.has(he.name),jt=Y._f&&tA(Y._f),_t=f.validatingFields||f.isValidating||g.validatingFields||g.isValidating;jt&&_t&&y([he.name],!0);const ft=await Xp(Y,i.disabled,s,b,t.shouldUseNativeValidation&&!N,et);if(jt&&_t&&y([he.name]),ft[he.name]&&(Q.valid=!1,N)||(!N&&(te(ft,he.name)?et?Yp(r.errors,ft,he.name):Ze(r.errors,he.name,ft[he.name]):dt(r.errors,he.name)),e.shouldUseNativeValidation&&ft[he.name]))break}!bt(Pe)&&await M({context:Q,onlyCheckValid:N,fields:Pe,name:K,eventType:R})}}return Q.valid},P=()=>{for(const k of i.unMount){const N=te(n,k);N&&(N._f.refs?N._f.refs.every(O=>!pc(O)):!pc(N._f.ref))&&Me(k)}i.unMount=new Set},V=(k,N)=>!t.disabled&&(k&&N&&Ze(s,k,N),!or(q(),o)),ne=(k,N,O)=>cc(k,i,{...a.mount?s:Je(N)?o:Bt(k)?{[k]:N}:N},O,N),W=k=>Fp(te(a.mount?s:o,k,t.shouldUnregister?te(o,k,[]):[])),de=(k,N,O={},R=!1)=>{const Q=te(n,k);let K=N;if(Q){const Y=Q._f;Y&&(!Y.disabled&&Ze(s,k,Vp(N,Y)),K=Ka(Y.ref)&&Lt(N)?"":N,$p(Y.ref)?[...Y.ref.options].forEach(he=>he.selected=K.includes(he.value)):Y.refs?gs(Y.ref)?Y.refs.forEach(he=>{(!he.defaultChecked||!he.disabled)&&(Array.isArray(K)?he.checked=!!K.find(Pe=>Pe===he.value):he.checked=K===he.value||!!K)}):Y.refs.forEach(he=>he.checked=he.value===K):fc(Y.ref)?Y.ref.value="":(Y.ref.value=K,Y.ref.type||p.state.next({name:k,values:R?s:at(s)})))}(O.shouldDirty||O.shouldTouch)&&A(k,K,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&U(k)},ie=(k,N,O,R=!1)=>{for(const Q in N){if(!N.hasOwnProperty(Q))return;const K=N[Q],Y=k+"."+Q,he=te(n,Y);(i.array.has(k)||nt(K)||he&&!he._f)&&!On(K)?ie(Y,K,O,R):de(Y,K,O,R)}},ve=(k,N,O,R)=>{const Q=te(n,k),K=i.array.has(k),Y=R?N:at(N),he=te(s,k),Pe=or(he,Y);if(Pe||Ze(s,k,Y),K)p.array.next({name:k,values:R?s:at(s)}),(f.isDirty||f.dirtyFields||g.isDirty||g.dirtyFields)&&O.shouldDirty&&(C(),p.state.next({name:k,dirtyFields:r.dirtyFields,isDirty:V(k,Y)}));else{const et=Array.isArray(Y)&&!Y.length||bt(Y);!Q||Q._f||Lt(Y)||et?de(k,Y,O,R):ie(k,Y,O,R)}if(!Pe){const et=vc(k,i),jt=R?s:at(s);p.state.next({...et&&r,name:a.mount||et?k:void 0,values:jt})}},me=(k,N,O={})=>ve(k,N,O,!1),z=(k,N={})=>{const O=Mt(k)?k(s):k;if(!or(s,O)){s={...s,...O};for(const R of i.mount)ve(R,te(O,R),N,!0);p.state.next({...r,name:void 0,type:void 0,values:s}),N.shouldValidate&&v()}},Ce=async k=>{a.mount=!0;const N=k.target;let O=N.name,R=!0;const Q=te(n,O),K=Pe=>{R=Number.isNaN(Pe)||On(Pe)&&isNaN(Pe.getTime())||or(Pe,te(s,O,Pe))},Y=Wp(t.mode),he=Wp(t.reValidateMode);if(Q){let Pe,et;const jt=N.type?Qp(Q._f):oc(k),_t=k.type===ln.BLUR||k.type===ln.FOCUS_OUT,ft=!rA(Q._f)&&!e.validate&&!t.resolver&&!te(r.errors,O)&&!Q._f.deps||sA(_t,te(r.touchedFields,O),r.isSubmitted,he,Y),vn=vc(O,i,_t);Ze(s,O,jt),_t?(!N||!N.readOnly)&&(Q._f.onBlur&&Q._f.onBlur(k),c&&c(0)):Q._f.onChange&&Q._f.onChange(k);const qr=A(O,jt,_t),ht=!bt(qr)||vn;if(!_t&&p.state.next({name:O,type:k.type,values:at(s)}),ft)return(f.isValid||g.isValid)&&(t.mode==="onBlur"?_t&&v():_t||v()),ht&&p.state.next({name:O,...vn?{}:qr});if(!t.resolver&&e.validate&&await F({name:O,eventType:k.type}),!_t&&vn&&p.state.next({...r}),t.resolver){const{errors:Tt}=await B([O]);if(y([O]),K(jt),!R){!bt(qr)&&p.state.next(qr);return}const kt=Kp(r.errors,n,O),Jt=Kp(Tt,n,kt.name||O);Pe=Jt.error,O=Jt.name,et=bt(Tt)}else y([O],!0),Pe=(await Xp(Q,i.disabled,s,b,t.shouldUseNativeValidation))[O],y([O]),K(jt),R&&(Pe?et=!1:(f.isValid||g.isValid)&&(et=await M({fields:n,onlyCheckValid:!0,name:O,eventType:k.type})));R&&(Q._f.deps&&(!Array.isArray(Q._f.deps)||Q._f.deps.length>0)&&U(Q._f.deps),x(O,et,Pe,qr))}},ke=(k,N)=>{if(te(r.errors,N)&&k.focus)return k.focus(),1},U=async(k,N={})=>{let O,R;const Q=Ga(k);if(t.resolver){const K=await D(Je(k)?k:Q);O=bt(K),R=k?!Q.some(Y=>te(K,Y)):O}else k?(R=(await Promise.all(Q.map(async K=>{const Y=te(n,K);return await M({fields:Y&&Y._f?{[K]:Y}:Y,eventType:ln.TRIGGER})}))).every(Boolean),!(!R&&!r.isValid)&&v()):R=O=await M({fields:n,name:k,eventType:ln.TRIGGER});return p.state.next({...!Bt(k)||(f.isValid||g.isValid)&&O!==r.isValid?{}:{name:k},...t.resolver||!k?{isValid:O}:{},errors:r.errors}),N.shouldFocus&&!R&&Cs(n,ke,k?Q:i.mount),R},q=(k,N)=>{let O={...a.mount?s:o};return N&&(O=Bp(N.dirtyFields?r.dirtyFields:r.touchedFields,O)),Je(k)?O:Bt(k)?te(O,k):k.map(R=>te(O,R))},le=(k,N)=>({invalid:!!te((N||r).errors,k),isDirty:!!te((N||r).dirtyFields,k),error:te((N||r).errors,k),isValidating:!!te(r.validatingFields,k),isTouched:!!te((N||r).touchedFields,k)}),ge=k=>{const N=k?Ga(k):void 0;N==null||N.forEach(O=>dt(r.errors,O)),N?N.forEach(O=>{p.state.next({name:O,errors:r.errors})}):p.state.next({errors:{}})},ee=(k,N,O)=>{const R=(te(n,k,{_f:{}})._f||{}).ref,Q=te(r.errors,k)||{},{ref:K,message:Y,type:he,...Pe}=Q;Ze(r.errors,k,{...Pe,...N,ref:R}),p.state.next({name:k,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&R&&R.focus&&R.focus()},fe=(k,N)=>Mt(k)?p.state.subscribe({next:O=>"values"in O&&k(O.values||ne(void 0,N),O)}):ne(k,N,!0),X=k=>p.state.subscribe({next:N=>{if(oA(k.name,N.name,k.exact)&&nA(N,k.formState||f,zt,k.reRenderRoot)){const O={...s};k.callback({values:O,...r,...N,defaultValues:o})}}}).unsubscribe,Se=k=>(a.mount=!0,g={...g,...k.formState},X({...k,formState:{...u,...k.formState}})),Me=(k,N={})=>{for(const O of k?Ga(k):i.mount)i.mount.delete(O),i.array.delete(O),N.keepValue||(dt(n,O),dt(s,O)),!N.keepError&&dt(r.errors,O),!N.keepDirty&&dt(r.dirtyFields,O),!N.keepTouched&&dt(r.touchedFields,O),!N.keepIsValidating&&dt(r.validatingFields,O),!t.shouldUnregister&&!N.keepDefaultValue&&dt(o,O);p.state.next({values:at(s)}),p.state.next({...r,...N.keepDirty?{isDirty:V()}:{}}),!N.keepIsValid&&v()},re=({disabled:k,name:N})=>{if(nr(k)&&a.mount||k||i.disabled.has(N)){const Q=i.disabled.has(N)!==!!k;k?i.disabled.add(N):i.disabled.delete(N),Q&&a.mount&&!a.action&&v()}},ce=(k,N={})=>{let O=te(n,k);const R=nr(N.disabled)||nr(t.disabled),Q=!i.registerName.has(k)&&O&&O._f&&!O._f.mount;return Ze(n,k,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:k}},name:k,mount:!0,...N}}),i.mount.add(k),O&&!Q?re({disabled:nr(N.disabled)?N.disabled:t.disabled,name:k}):E(k,!0,N.value),{...R?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:bs(N.min),max:bs(N.max),minLength:bs(N.minLength),maxLength:bs(N.maxLength),pattern:bs(N.pattern)}:{},name:k,onChange:Ce,onBlur:Ce,ref:K=>{if(K){i.registerName.add(k),ce(k,N),i.registerName.delete(k),O=te(n,k);const Y=Je(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,he=YE(Y),Pe=O._f.refs||[];if(he?Pe.find(et=>et===Y):Y===O._f.ref)return;Ze(n,k,{_f:{...O._f,...he?{refs:[...Pe.filter(pc),Y,...Array.isArray(te(o,k))?[{}]:[]],ref:{type:Y.type,name:k}}:{ref:Y}}}),E(k,!1,void 0,Y)}else O=te(n,k,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Lp(i.array,k)&&a.action)&&i.unMount.add(k)}}},G=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Cs(n,ke,i.mount),H=k=>{nr(k)&&(p.state.next({disabled:k}),Cs(n,(N,O)=>{const R=te(n,O);R&&(N.disabled=R._f.disabled||k,Array.isArray(R._f.refs)&&R._f.refs.forEach(Q=>{Q.disabled=R._f.disabled||k}))},0,!1))},Ae=(k,N)=>async O=>{let R;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let Q=at(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:K,values:Y}=await B();y(),r.errors=K,Q=at(Y)}else await M({fields:n,eventType:ln.SUBMIT});if(i.disabled.size)for(const K of i.disabled)dt(Q,K);if(dt(r.errors,Np),bt(r.errors)){p.state.next({errors:{}});try{await k(Q,O)}catch(K){R=K}}else N&&await N({...r.errors},O),G(),setTimeout(G);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:bt(r.errors)&&!R,submitCount:r.submitCount+1,errors:r.errors}),R)throw R},Te=(k,N={})=>{te(n,k)&&(Je(N.defaultValue)?me(k,at(te(o,k))):(me(k,N.defaultValue),Ze(o,k,at(N.defaultValue))),N.keepTouched||dt(r.touchedFields,k),N.keepDirty||(dt(r.dirtyFields,k),r.isDirty=N.defaultValue?V(k,at(te(o,k))):V()),N.keepError||(dt(r.errors,k),f.isValid&&v()),p.state.next({...r}))},Ie=(k,N={})=>{const O=k?at(k):o,R=at(O),Q=bt(k),K=R;if(N.keepDefaultValues||(o=O),!N.keepValues){if(N.keepDirtyValues){const Y=new Set([...i.mount,...Object.keys(Pn(o,s))]);for(const he of Array.from(Y)){const Pe=te(r.dirtyFields,he),et=te(s,he),jt=te(K,he);Pe&&!Je(et)?Ze(K,he,et):!Pe&&!Je(jt)&&me(he,jt)}}else{if(Qa&&Je(k))for(const Y of i.mount){const he=te(n,Y);if(he&&he._f){const Pe=Array.isArray(he._f.refs)?he._f.refs[0]:he._f.ref;if(Ka(Pe)){const et=Pe.closest("form");if(et){et.reset();break}}}}if(N.keepFieldsRef)for(const Y of i.mount)me(Y,te(K,Y));else n={}}if(t.shouldUnregister){if(s=N.keepDefaultValues?at(o):{},N.keepFieldsRef)for(const Y of i.mount)Ze(s,Y,te(K,Y))}else s=at(K);p.array.next({values:{...K}}),p.state.next({values:{...K}})}i={mount:N.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues||!t.shouldUnregister&&!bt(K),a.watch=!!t.shouldUnregister,a.keepIsValid=!!N.keepIsValid,a.action=!1,N.keepErrors||(r.errors={}),p.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:Q?!1:N.keepDirty?r.isDirty:N.keepValues?V():!!(N.keepDefaultValues&&!or(k,o)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Q?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Pn(o,s):r.dirtyFields:N.keepDefaultValues&&k?Pn(o,k):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},we=(k,N)=>Ie(Mt(k)?k(s):k,{...t.resetOptions,...N}),Be=(k,N={})=>{const O=te(n,k),R=O&&O._f;if(R){const Q=R.refs?R.refs[0]:R.ref;Q.focus&&setTimeout(()=>{Q.focus(),N.shouldSelect&&Mt(Q.select)&&Q.select()})}},zt=k=>{r={...r,...k}},qt={control:{register:ce,unregister:Me,getFieldState:le,handleSubmit:Ae,setError:ee,_subscribe:X,_runSchema:B,_updateIsValidating:y,_focusError:G,_getWatch:ne,_getDirty:V,_setValid:v,_setFieldArray:S,_setDisabledField:re,_setErrors:_,_getFieldArray:W,_reset:Ie,_resetDefaultValues:()=>Mt(t.defaultValues)&&t.defaultValues().then(k=>{we(k,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:H,_subjects:p,_proxyFormState:f,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(k){a=k},get _defaultValues(){return o},get _names(){return i},set _names(k){i=k},get _formState(){return r},get _options(){return t},set _options(k){t={...t,...k}}},subscribe:Se,trigger:U,register:ce,handleSubmit:Ae,watch:fe,setValue:me,setValues:z,getValues:q,reset:we,resetField:Te,resetDefaultValues:(k,N={})=>{if(o=at(k),!N.keepDirty){const O=Pn(o,s);r.dirtyFields=O,r.isDirty=!bt(O)}N.keepIsValid||v(),p.state.next({...r,defaultValues:o})},clearErrors:ge,unregister:Me,setError:ee,setFocus:Be,getFieldState:le};return{...qt,formControl:qt}}function cA(e={}){const t=h.useRef(void 0),r=h.useRef(void 0),n=h.useRef(e.formControl),[o,s]=h.useState(()=>({...at(Jp),isLoading:Mt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Mt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Mt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...c}=lA(e);t.current={...c,formState:o}}const a=t.current.control;return a._options=e,lc(()=>{const i=a._subscribe({formState:a._proxyFormState,callback:()=>s({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return s(c=>({...c,isReady:!0})),a._formState.isReady=!0,i},[a]),h.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),h.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),h.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),h.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),h.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==o.isDirty&&a._subjects.state.next({isDirty:i})}},[a,o.isDirty]),h.useEffect(()=>{var i;e.values&&!or(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((i=a._options.resetOptions)===null||i===void 0)&&i.keepIsValid||a._setValid(),r.current=e.values,s(c=>({...c}))):a._resetDefaultValues()},[a,e.values]),h.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=h.useMemo(()=>Pp(o,a),[a,o]),t.current}function dA(e,t,r){const n=e??[],o=new Set(n.map(u=>u.type).filter(Boolean)),s=(t??[]).filter(u=>!o.has(u)),{data:a}=Ur({queryKey:["framework-search",s.sort().join(","),r],queryFn:()=>$w({type:s,systemDefault:"Yes"}),enabled:s.length>0,staleTime:600*1e3}),i=t&&t.length?n.filter(u=>u.type&&t.includes(u.type)):n,c=[...(a??[]).map(u=>({label:u.name,value:u.identifier})),...i.map(u=>({label:u.name,value:u.identifier}))],d=new Set;return c.filter(u=>d.has(u.value)?!1:(d.add(u.value),!0))}async function em(e){var r,n;return(n=(r=(await Ve.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function uA(e){var r,n,o,s,a,i,c;const t=Ur({queryKey:["channel",e],queryFn:()=>em(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(o=t.data)==null?void 0:o.frameworks,collectionAdditionalCategories:(s=t.data)==null?void 0:s.collectionAdditionalCategories,contentAdditionalCategories:(a=t.data)==null?void 0:a.contentAdditionalCategories,defaultLicense:(i=t.data)==null?void 0:i.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function fA(e){const{data:t}=Ur({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>l_(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const tm=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],hA={"First Section":{title:"Basic Information",description:"Core details that define the content identity."},"Second Section":{title:"Categorisation",description:"Category and type classification for the content."},"Third Section":{title:"Categorisation",description:"Category and type classification for the content."},"Organisation Framework Terms":{title:"Curriculum",description:"Framework-aligned categorisation."},"Target Framework Terms":{title:"Target Audience",description:"Curriculum alignment for the intended learners."},"Fourth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Sixth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Consumption policy":{title:"Consumption policy",description:"How learners move through this path."},Skills:{title:"Skills",description:"The skills learners gain from this course."},"Path skills":{title:"Skill framework and role",description:"The skill framework and, optionally, the role this path prepares learners for."}},yc={skillFramework:"Skill framework",selectSkillFramework:"Select a skill framework",skills:"Skills",selectSkills:"Select skills",targetRole:"Target role (optional)",noTargetRole:"No target role"},pA=new Set(["review","read","sourcingreview","orgreview"]),Za={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},mA={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},gA={name:"details",description:"details",keywords:"details",appIcon:"details",primaryCategory:"details",additionalCategories:"details",board:"details",boardIds:"details",subject:"details",subjectIds:"details",medium:"details",framework:"details",topicsIds:"details",topic:"details",dialcodeRequired:"details",dialcodes:"details",audience:"audience",targetBoardIds:"audience",targetMediumIds:"audience",targetGradeLevelIds:"audience",targetSubjectIds:"audience",gradeLevel:"audience",creator:"licensing",author:"licensing",attributions:"licensing",license:"licensing",copyright:"licensing",copyrightYear:"licensing"},vo={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},bc=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]),vA=new Set(Object.values(vo));function rm(e){var r;const t=Sl((r=e.organisationFramework)==null?void 0:r.categories);return t&&!vA.has(t.code)?t:void 0}function nm(e,t,r,n,o={}){if(!(e!=null&&e.length))return om($A(t,n,r,o),r,t,n,o);const s=new Map;for(const d of e){const u=d.code;u&&!s.has(u)&&s.set(u,d)}const a=rm(r),i=new Set,c=e.filter(d=>{var f;if(n&&(d.code==="dialCode"||d.code==="dialcode")||((f=o.profile)==null?void 0:f.key)==="learningPath"&&bc.has(d.code)||d.visible===!1)return!1;const u=d.code;return i.has(u)?!1:(i.add(u),!0)}).map(d=>{const u=d.code??"",f=!!a&&u===a.code,g=f?"multiselect":EA(d),p=f?Sc(u,a.code,d,r,t,s,!0):AA(d,r,t,s,o),b=t[u],m=f?on(b,a.terms):SA(u,lm(b,g),g,t,o),v={code:u,label:d.label??u,inputType:g,required:!!(d.required===!0||Array.isArray(d.validations)&&d.validations.some(y=>y.type==="required")),editable:Xa(u,d.editable!==!1,o),placeholder:d.placeholder,maxLength:d.maxLength,options:TA(p,m,g,r),depends:d.depends,tab:kA(d),section:d.section,sourceCategory:d.sourceCategory??(f?u:void 0),defaultValue:d.defaultValue??d.default,currentValue:m,...f?{isSkillField:f}:{}};if(u==="dialcodes"){const y=t.dialcodeRequired==="Yes";return{...v,required:y,visible:y}}return v});return om(c,r,t,n,o)}function om(e,t,r,n,o){var a;if(((a=o.profile)==null?void 0:a.key)==="learningPath"){const i=BA(e,t,r,n);return n&&t.competency?bA(i,t.competency,r,o):i}const s=MA(e,t,r,n);return n&&t.competency?yA(s,t.competency,r,o):s}const sm="Skills",am="Path skills";function im(e,t,r,n){const o=r.competencyLabels??yc,s=typeof t[rr]=="string"?t[rr]:"",a=s&&e.frameworks.some(i=>i.value===s)?s:"";return{selected:a,field:{code:rr,label:o.skillFramework,inputType:"select",editable:Xa(rr,!0,r),tab:"details",section:n,placeholder:o.selectSkillFramework,options:e.frameworks,currentValue:a||void 0}}}function yA(e,t,r,n){if(t.frameworksLoaded&&t.frameworks.length===0)return e;const{field:o,selected:s}=im(t,r,n,sm),a=t.skillField,i=e.filter(f=>f.code!==rr&&(!s||!a||f.code!==a));if(!s||!a)return[...i,o];const c=n.competencyLabels??yc,d=on(r[a],t.skills),u={code:a,label:c.skills,inputType:"multiselect",editable:Xa(a,!0,n),tab:"details",section:sm,placeholder:c.selectSkills,options:CA(t.skills.map(f=>({label:f.name,value:f.code})),d),sourceCategory:a,isSkillField:!0,currentValue:d};return[...i,o,u]}function bA(e,t,r,n){if(t.frameworksLoaded&&t.frameworks.length===0)return e;const{field:o,selected:s}=im(t,r,n,am),a=e.filter(f=>f.code!==rr&&f.code!==In).map(f=>s&&f.section===Ja?{...f,required:!1}:f),i=t.roles??[];if(!s||i.length===0)return[...a,o];const c=n.competencyLabels??yc,d=typeof r[In]=="string"?r[In]:"",u={code:In,label:c.targetRole,inputType:"select",editable:Xa(In,!0,n),tab:"details",section:am,placeholder:c.noTargetRole,options:[{label:c.noTargetRole,value:""},...i],currentValue:d&&i.some(f=>f.value===d)?d:void 0};return[...a,o,u]}function CA(e,t){const r=new Set(e.map(n=>n.value));return[...e,...t.filter(n=>!r.has(n)).map(n=>({label:n,value:n}))]}function Xa(e,t,r){var s;const n=r.editorMode??"edit";if(!pA.has(n))return t!==!1;const o=(s=r.editableFields)==null?void 0:s[n];return!!(o&&o.includes(e))}function SA(e,t,r,n,o){const s=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return s?o.defaultLicense??"":t;case"copyright":return s&&o.channelName?o.channelName:t;case"copyrightYear":return s?String(new Date().getFullYear()):t;case"author":case"creator":return s&&o.userFullName?o.userFullName:t;case"instructions":{const a=n.instructions;return a&&typeof a=="object"&&!Array.isArray(a)?a.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!s)return t;const a=n.timeLimits,i=a==null?void 0:a[e];return i!=null&&i!==""?wA(Number(i)):t}default:return t}}function wA(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),o=s=>String(s).padStart(2,"0");return n>0?`${o(n)}:${o(r)}:${o(t)}`:`${o(r)}:${o(t)}`}function _A(e){var n,o,s;const t=new Map,r=a=>a==null?void 0:a.forEach(i=>{i.identifier&&t.set(i.identifier,i.name),i.name&&t.set(i.name,i.name)});return(o=(n=e.organisationFramework)==null?void 0:n.categories)==null||o.forEach(a=>r(a.terms)),(s=e.targetFrameworks)==null||s.forEach(a=>{var i;return(i=a.categories)==null?void 0:i.forEach(c=>r(c.terms))}),t}function TA(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const o=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!o.length)return e;const s=e?[...e]:[],a=new Set(s.map(c=>c.value)),i=_A(n);for(const c of o){const d=String(c);a.has(d)||(s.push({label:i.get(d)??d,value:d}),a.add(d))}return s}function kA(e){const t=e.section;if(t){if(Za[t])return Za[t];const n=mA[t];if(n&&Za[n])return Za[n]}const r=e.code??"";return gA[r]??"details"}function lm(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function EA(e){const t=(e.inputType??e.dataType??"").toLowerCase(),n=(e.dataType??"").toLowerCase()==="list";return t==="select"?"select":t==="framework"||t==="frameworkcategoryselect"?n?"multiselect":"select":t==="topicselector"?"chips":t==="multiselect"||t==="multi-select"?"multiselect":t==="keywords"||e.code==="keywords"||e.code==="topic"||e.code==="topicsIds"?"chips":t==="radio"?"radio":e.code==="appIcon"||t==="appicon"?"appIcon":t==="textarea"||e.code==="description"?"textarea":t==="datepicker"||t==="date"?"datepicker":t==="datetime"||t==="datetime-local"?"datetime":t==="tagsinput"?"tagsinput":t==="nestedselect"||t==="nested-select"?n?"multiselect":"select":t==="license"?"license":t==="dialcode"||t==="dial-code"?"dialcode":"text"}function AA(e,t,r,n,o){var d;const s=e.code??"";if(((d=o.profile)==null?void 0:d.key)==="learningPath"&&s==="policy")return tm;if(s==="maxQuestions"){const u=o.childCount??0;if(u>0)return Array.from({length:u},(f,g)=>({label:String(g+1),value:String(g+1)}))}const a=e.range;if(Array.isArray(a)&&a.length)return typeof a[0]=="string"?a.map(u=>({label:u,value:u})):a.map(u=>({label:u.name,value:u.identifier}));const i=e.enum;if(i!=null&&i.length)return i.map(u=>({label:u,value:u}));if(s==="framework")return t.orgFrameworks;if(s==="additionalCategories"){const f=(o.objectType??"")==="QuestionSet"?o.contentAdditionalCategories??o.collectionAdditionalCategories:o.collectionAdditionalCategories??o.contentAdditionalCategories,g=(f&&f.length?f:o.contextAdditionalCategories)??t.channelAdditionalCategories;return g!=null&&g.length?NA(g).map(p=>({label:p,value:p})):void 0}const c=e.sourceCategory??vo[s];if(c)return Sc(s,c,e,t,r,n)}function IA(e,t){return bc.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function LA(e,t){return bc.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function Cc(e,t,r){var s,a,i,c,d;const n=(a=(s=e.organisationFramework)==null?void 0:s.categories)==null?void 0:a.find(u=>u.code===t),o=(d=(c=(i=e.targetFrameworks)==null?void 0:i[0])==null?void 0:c.categories)==null?void 0:d.find(u=>u.code===t);return r?(o==null?void 0:o.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(o==null?void 0:o.terms)??[]}function DA(e){const t=new Set,r=[];for(const n of e){const o=n.identifier??n.name;o&&!t.has(o)&&(t.add(o),r.push(n))}return r}function NA(e){return Array.from(new Set(e))}function OA(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function Sc(e,t,r,n,o,s,a=!1){const i=IA(e,r),c=LA(e,r),d=v=>({label:v.name,value:a?v.code:i?v.identifier:v.name}),u=r.depends;if(!(u!=null&&u.length))return Cc(n,t,c).map(d);const f=u.flatMap(v=>OA(o[v])).map(String);if(!f.length)return[];const g=[];for(const v of u){const y=s.get(v),C=(y==null?void 0:y.sourceCategory)??vo[v]??v;g.push(...Cc(n,C,c))}const b=g.filter(v=>f.includes(String(v.name))||f.includes(String(v.identifier))||f.includes(String(v.code))).flatMap(v=>v.associations??[]).filter(v=>String(v.category??"").toLowerCase()===t.toLowerCase()),m=DA(b);return m.length?m.map(d):Cc(n,t,c).map(d)}function Ss(e,t){const r=vo[e];if(r)return Sc(e,r,{},t,{},new Map)}function rt(e,t,r){return lm(e[t],r)}const PA=["board","medium","gradeLevel","subject"];function xA(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>PA.includes(n.code)):!0}function FA(e,t){var r,n,o;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(s=>s.code===t)||(o=e.targetFrameworks)!=null&&o.some(s=>{var a;return(a=s.categories)==null?void 0:a.some(i=>i.code===t)}))}function MA(e,t,r,n){var d,u;if(!n||xA(t))return e;const o=e.filter(f=>{const g=f.sourceCategory??vo[f.code];return!g||FA(t,g)}),s=new Set(o.map(f=>f.code)),a=(d=rm(t))==null?void 0:d.code,i=[];for(const f of((u=t.organisationFramework)==null?void 0:u.categories)??[]){if(s.has(f.code))continue;const g=f.code===a;i.push({code:f.code,label:f.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",...g?{isSkillField:!0}:{},options:(f.terms??[]).map(p=>({label:p.name,value:g?p.code:p.name})),currentValue:g?on(r[f.code],f.terms):rt(r,f.code,"multiselect")})}if(!i.length)return o;const c=o.findIndex(f=>f.code==="framework");return c>=0?[...o.slice(0,c+1),...i,...o.slice(c+1)]:[...o,...i]}const Ja="Organisation Framework Terms";function BA(e,t,r,n){var p,b;if(!n)return e;const o=[...((p=t.organisationFramework)==null?void 0:p.categories)??[]].sort((m,v)=>(m.index??1/0)-(v.index??1/0));if(!o.length)return e;const s=(b=Sl(o))==null?void 0:b.code,a=m=>m.sourceCategory??vo[m.code];let c=e.filter(m=>{const v=a(m);return v?v!==s&&o.some(y=>y.code===v):!0}).map(m=>a(m)?{...m,section:Ja,required:!0,inputType:"select",currentValue:rt(r,m.code,"select")}:m),d=c.findIndex(m=>m.code==="framework");if(d===-1){const m={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:Ja,options:t.orgFrameworks,currentValue:rt(r,"framework","select")},v=c.findIndex(y=>!!a(y));d=v>=0?v:c.length,c=[...c.slice(0,d),m,...c.slice(d)]}if(!!!rt(r,"framework","select"))return c.filter(m=>m.code==="framework"||!a(m));const f=new Set(c.map(m=>m.code)),g=o.filter(m=>m.code!==s&&!f.has(m.code)).map(m=>({code:m.code,label:m.name,inputType:"select",required:!0,editable:!0,tab:"details",section:Ja,options:(m.terms??[]).map(v=>({label:v.name,value:v.name})),currentValue:rt(r,m.code,"select")}));return g.length?[...c.slice(0,d+1),...g,...c.slice(d+1)]:c}function $A(e,t,r,n={}){var s,a;const o=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:rt(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:rt(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:rt(e,"keywords","chips")}];return t?((s=n.profile)==null?void 0:s.key)==="learningPath"?(o.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:rt(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:tm,currentValue:rt(e,"policy","select")||"strict"}),o):(o.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:rt(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:rt(e,"additionalCategories","multiselect"),options:(a=r.channelAdditionalCategories)==null?void 0:a.map(i=>({label:i,value:i}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:rt(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Ss("subjectIds",r),currentValue:rt(e,"subjectIds","multiselect")}),o.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:rt(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Ss("targetBoardIds",r),currentValue:rt(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:Ss("targetMediumIds",r),currentValue:rt(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:Ss("targetGradeLevelIds",r),currentValue:rt(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:Ss("targetSubjectIds",r),currentValue:rt(e,"targetSubjectIds","multiselect")}),o.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:rt(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:rt(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:rt(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:rt(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:rt(e,"license","select")}),o):o}const qA=["allowECM","levels","setPeriod","instances"];function cm(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function jA(e,t={}){const r={...e};for(const s of qA)delete r[s];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:cm(n)});const o=e.instances;return o!=null&&o!==""&&(r.instances={label:o}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function UA(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?cm(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function HA(e,t){const{watch:r,setValue:n}=e,o=h.useRef(!1);h.useEffect(()=>{const s=r((a,{name:i})=>{var c;if(!(!i||o.current)){o.current=!0;try{const d=new Set([i]);let u=!0;for(;u;){u=!1;for(const f of t)d.has(f.code)||(c=f.depends)!=null&&c.some(g=>d.has(g))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),d.add(f.code),u=!0)}}finally{o.current=!1}}});return()=>s.unsubscribe()},[r,n,t])}const yo={section:"_section_ylgu8_1",header:"_header_ylgu8_11",title:"_title_ylgu8_17",description:"_description_ylgu8_24",divider:"_divider_ylgu8_30",fields:"_fields_ylgu8_36"},VA=({title:e,description:t,children:r})=>l.jsxs("div",{className:yo.section,children:[l.jsxs("div",{className:yo.header,children:[l.jsx("h3",{className:yo.title,children:e}),t&&l.jsx("p",{className:yo.description,children:t})]}),l.jsx("hr",{className:yo.divider}),l.jsx("div",{className:yo.fields,children:r})]}),$={field:"_field_16hjq_1",fullWidth:"_fullWidth_16hjq_7",label:"_label_16hjq_11",required:"_required_16hjq_19",input:"_input_16hjq_24",textarea:"_textarea_16hjq_45",inputError:"_inputError_16hjq_50",error:"_error_16hjq_54",selectBtn:"_selectBtn_16hjq_59",selectOpen:"_selectOpen_16hjq_83",placeholder:"_placeholder_16hjq_87",selectedVal:"_selectedVal_16hjq_91",chevronUp:"_chevronUp_16hjq_95",dropdown:"_dropdown_16hjq_100",option:"_option_16hjq_116",optionSelected:"_optionSelected_16hjq_134",noOpts:"_noOpts_16hjq_139",chipGroup:"_chipGroup_16hjq_146",chipInput:"_chipInput_16hjq_158",addChipBtn:"_addChipBtn_16hjq_167",radioGroup:"_radioGroup_16hjq_184",radioLabel:"_radioLabel_16hjq_191",iconWrap:"_iconWrap_16hjq_199",iconPreview:"_iconPreview_16hjq_214",iconPlaceholder:"_iconPlaceholder_16hjq_220",removeIconBtn:"_removeIconBtn_16hjq_233",tagChip:"_tagChip_16hjq_252",tagChipRemove:"_tagChipRemove_16hjq_264",nestedSelectRow:"_nestedSelectRow_16hjq_278",dialcodeRow:"_dialcodeRow_16hjq_287",validateBtn:"_validateBtn_16hjq_293",dialcodeValid:"_dialcodeValid_16hjq_315",dialcodeSpinner:"_dialcodeSpinner_16hjq_325",optionSearch:"_optionSearch_16hjq_329"},dm=({name:e,label:t,required:r,disabled:n,multiline:o,maxLength:s,placeholder:a})=>{const i=ue(),{register:c,formState:{errors:d}}=pr(),u=d[e],f={required:r?i.textField.requiredError.replace("{field}",t):!1,maxLength:s?{value:s,message:i.textField.maxLengthError.replace("{max}",String(s))}:void 0};return l.jsxs("div",{className:[$.field,o?$.fullWidth:""].join(" "),children:[l.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:$.required,children:"*"})]}),o?l.jsx("textarea",{id:e,className:[$.input,$.textarea,u?$.inputError:""].join(" "),disabled:n,placeholder:a,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[$.input,u?$.inputError:""].join(" "),disabled:n,placeholder:a,...c(e,f)}),u&&l.jsx("span",{className:$.error,children:String(u.message)})]})},zA=7;function RA(e,t){const r=t.trim().toLowerCase();return r?e.filter(n=>n.label.toLowerCase().includes(r)):e}function um(e){const[t,r]=h.useState(""),n=h.useMemo(()=>RA(e,t),[e,t]);return{query:t,setQuery:r,filtered:n,searchable:e.length>=zA}}const fm=({value:e,onChange:t,placeholder:r})=>l.jsxs("div",{className:$.optionSearch,children:[l.jsx(aa,{size:13,"aria-hidden":!0}),l.jsx("input",{type:"text",autoFocus:!0,value:e,placeholder:r,"aria-label":r,onChange:n=>t(n.target.value)})]}),QA=({name:e,label:t,options:r,required:n,disabled:o})=>{var w;const s=ue(),[a,i]=h.useState(!1),c=h.useRef(null),{query:d,setQuery:u,filtered:f,searchable:g}=um(r),{register:p,watch:b,setValue:m,formState:{errors:v}}=pr(),y=b(e),C=((w=r.find(_=>_.value===y))==null?void 0:w.label)??s.selectField.selectPlaceholder,S=v[e];return h.useEffect(()=>{if(!a){u("");return}const _=T=>{var E;(E=c.current)!=null&&E.contains(T.target)||i(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[a]),l.jsxs("div",{className:$.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:$.label,children:[t,n&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx("input",{type:"hidden",...p(e,{required:n?s.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:o,className:[$.selectBtn,S?$.inputError:"",a?$.selectOpen:""].join(" "),onClick:()=>i(_=>!_),children:[l.jsx("span",{className:y?$.selectedVal:$.placeholder,children:C}),l.jsx(rn,{size:14,className:a?$.chevronUp:""})]}),a&&l.jsxs("div",{className:$.dropdown,children:[g&&l.jsx(fm,{value:d,onChange:u,placeholder:s.selectField.searchPlaceholder}),f.map(_=>l.jsxs("button",{type:"button",className:[$.option,y===_.value?$.optionSelected:""].join(" "),onClick:()=>{m(e,_.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:_.label}),y===_.value&&l.jsx(Kn,{size:13})]},_.value)),!r.length&&l.jsx("span",{className:$.noOpts,children:s.selectField.noOptionsMessage}),r.length>0&&!f.length&&l.jsx("span",{className:$.noOpts,children:s.selectField.noMatchesMessage})]}),S&&l.jsx("span",{className:$.error,children:String(S.message)})]})},WA=({name:e,label:t,options:r,required:n,disabled:o})=>{const s=ue(),[a,i]=h.useState(!1),c=h.useRef(null),{query:d,setQuery:u,filtered:f,searchable:g}=um(r),{register:p,watch:b,setValue:m,formState:{errors:v}}=pr(),y=b(e)??[],C=v[e],S=y.length?`${y.length} ${s.multiSelectField.selectedCountSuffix}`:s.multiSelectField.selectPlaceholder;h.useEffect(()=>{if(!a){u("");return}const _=T=>{var E;(E=c.current)!=null&&E.contains(T.target)||i(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[a]);const w=_=>{const T=y.includes(_)?y.filter(E=>E!==_):[...y,_];m(e,T,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:$.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:$.label,children:[t,n&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx("input",{type:"hidden",...p(e,{required:n?s.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:o,className:[$.selectBtn,C?$.inputError:"",a?$.selectOpen:""].join(" "),onClick:()=>i(_=>!_),children:[l.jsx("span",{className:y.length?$.selectedVal:$.placeholder,children:S}),l.jsx(rn,{size:14,className:a?$.chevronUp:""})]}),a&&l.jsxs("div",{className:$.dropdown,children:[g&&l.jsx(fm,{value:d,onChange:u,placeholder:s.multiSelectField.searchPlaceholder}),f.map(_=>l.jsxs("button",{type:"button",className:[$.option,y.includes(_.value)?$.optionSelected:""].join(" "),onClick:()=>w(_.value),children:[l.jsx(Kn,{size:13,style:{opacity:y.includes(_.value)?1:0}}),l.jsx("span",{children:_.label})]},_.value)),!r.length&&l.jsx("span",{className:$.noOpts,children:s.multiSelectField.noOptionsMessage}),r.length>0&&!f.length&&l.jsx("span",{className:$.noOpts,children:s.multiSelectField.noMatchesMessage})]}),C&&l.jsx("span",{className:$.error,children:String(C.message)})]})},GA=({name:e,label:t,required:r,disabled:n,placeholder:o})=>{const s=ue(),a=o??s.chipGroupField.addPlaceholder,[i,c]=h.useState(""),[d,u]=h.useState(!1),f=h.useRef(null),{watch:g,setValue:p,formState:{errors:b}}=pr(),m=g(e)??[],v=b[e],y=()=>{const S=i.trim();S&&!m.includes(S)&&p(e,[...m,S],{shouldDirty:!0}),c(""),u(!1)},C=S=>p(e,m.filter(w=>w!==S),{shouldDirty:!0});return l.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[l.jsxs("label",{className:$.label,children:[t,r&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsxs("div",{className:$.chipGroup,children:[m.map(S=>l.jsxs("span",{className:"sbx-chip filled",children:[S,!n&&l.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>C(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(d?l.jsx("input",{ref:f,autoFocus:!0,className:$.chipInput,value:i,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),u(!1))},onBlur:y,placeholder:a}):l.jsxs("button",{type:"button",className:$.addChipBtn,onClick:()=>{u(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(Rr,{size:12})," ",s.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:$.error,children:String(v.message)})]})},KA=({name:e,label:t,options:r,required:n,disabled:o})=>{const s=ue(),{register:a,formState:{errors:i}}=pr(),c=i[e];return l.jsxs("div",{className:$.field,children:[l.jsxs("label",{className:$.label,children:[t,n&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx("div",{className:$.radioGroup,children:r.map(d=>l.jsxs("label",{className:$.radioLabel,children:[l.jsx("input",{type:"radio",value:d.value,disabled:o,...a(e,{required:n?s.radioField.requiredError.replace("{field}",t):!1})}),d.label]},d.value))}),c&&l.jsx("span",{className:$.error,children:String(c.message)})]})};async function YA(e,t,r,n){var a,i;const s=(i=(a=(await Ve.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:a.result)==null?void 0:i.node_id;if(!s)throw new Error("Asset creation failed: no node_id returned");return s}async function ZA(e,t){var o,s;const n=(s=(o=(await Ve.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)==null?void 0:s.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function XA(e,t,r={}){const n=await fetch(e,{method:"PUT",body:t,headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"application/octet-stream",...r}});if(!n.ok)throw new Error(`Blob upload failed: ${n.status} ${n.statusText}`)}async function JA(e,t,r){var a,i;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const s=(i=(a=(await Ve.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:a.result)==null?void 0:i.content_url;if(!s)throw new Error("Asset finalize failed: no content_url returned");return s}const Oe={overlay:"_overlay_ga6eh_1",modal:"_modal_ga6eh_12",header:"_header_ga6eh_24",title:"_title_ga6eh_33",closeBtn:"_closeBtn_ga6eh_39",tabs:"_tabs_ga6eh_57",tab:"_tab_ga6eh_57",activeTab:"_activeTab_ga6eh_83",body:"_body_ga6eh_88",searchWrap:"_searchWrap_ga6eh_99",searchIcon:"_searchIcon_ga6eh_104",searchInput:"_searchInput_ga6eh_113",grid:"_grid_ga6eh_132",imgCell:"_imgCell_ga6eh_148",imgCellSelected:"_imgCellSelected_ga6eh_166",thumb:"_thumb_ga6eh_171",noThumb:"_noThumb_ga6eh_177",checkBadge:"_checkBadge_ga6eh_183",loadMoreBtn:"_loadMoreBtn_ga6eh_198",loadingRow:"_loadingRow_ga6eh_220",empty:"_empty_ga6eh_230",spinner:"_spinner_ga6eh_237",uploadArea:"_uploadArea_ga6eh_247",dropZone:"_dropZone_ga6eh_256",uploadIcon:"_uploadIcon_ga6eh_277",dropText:"_dropText_ga6eh_281",dropSubtext:"_dropSubtext_ga6eh_288",uploadPreview:"_uploadPreview_ga6eh_294",hiddenInput:"_hiddenInput_ga6eh_301",fileName:"_fileName_ga6eh_305",errorText:"_errorText_ga6eh_311",footer:"_footer_ga6eh_318",cancelBtn:"_cancelBtn_ga6eh_328",confirmBtn:"_confirmBtn_ga6eh_345"},hm=18,pm=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const o=ue(),[s,a]=h.useState("my"),[i,c]=h.useState(""),[d,u]=h.useState([]),[f,g]=h.useState(0),[p,b]=h.useState(!1),[m,v]=h.useState(null),[y,C]=h.useState(0),[S,w]=h.useState(null),[_,T]=h.useState(""),[E,A]=h.useState(!1),[x,B]=h.useState(""),D=h.useRef(null),F=Z(U=>{var q,le;return((le=(q=U.editorConfig)==null?void 0:q.context)==null?void 0:le.channel)??""}),M=Z(U=>{var q,le;return((le=(q=U.editorConfig)==null?void 0:q.context)==null?void 0:le.uid)??""}),P=Z(U=>{var q,le,ge;return((ge=(le=(q=U.editorConfig)==null?void 0:q.context)==null?void 0:le.cloudStorage)==null?void 0:ge.presigned_headers)??{}}),V=Z(U=>{var q,le,ge;return((ge=(le=(q=U.editorConfig)==null?void 0:q.config)==null?void 0:le.assetConfig)==null?void 0:ge.size)??1*1024*1024}),ne=Z(U=>{var q,le,ge;return((ge=(le=(q=U.editorConfig)==null?void 0:q.config)==null?void 0:le.assetConfig)==null?void 0:ge.accepted)??"image/png,image/jpeg"}),W=h.useCallback(async(U,q,le=!1)=>{var ge;b(!0);try{const ee={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};s==="my"&&M&&(ee.createdBy=M),F&&(ee.channel=F);const X=((ge=(await Ve.post("/action/composite/v3/search",{request:{filters:ee,query:U,limit:hm,offset:q,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:ge.result)??{},Se=X.content??[];g(X.count??0),u(Me=>le?[...Me,...Se]:Se)}catch{}finally{b(!1)}},[s,M,F]);h.useEffect(()=>{s!=="upload"&&(u([]),C(0),W(i,0))},[s]);const de=h.useRef(),ie=U=>{c(U),clearTimeout(de.current),de.current=setTimeout(()=>{u([]),C(0),W(U,0)},400)},ve=()=>{const U=y+hm;C(U),W(i,U,!0)},me=()=>{const U=(m==null?void 0:m.artifactUrl)??(m==null?void 0:m.appIcon)??(m==null?void 0:m.downloadUrl)??"";U&&r(U)};h.useEffect(()=>()=>{_&&URL.revokeObjectURL(_)},[_]);const z=U=>{var ge;const q=(ge=U.target.files)==null?void 0:ge[0];if(U.target.value="",!q)return;const le=ne.split(",").map(ee=>ee.trim());if(!le.includes(q.type)){const ee=le.map(fe=>fe.replace("image/","").toUpperCase()).join(", ");B(o.appIconPickerModal.invalidFileTypeError.replace("{types}",ee));return}if(q.size>V){const ee=(V/1048576).toFixed(0);B(o.appIconPickerModal.fileTooLargeError.replace("{size}",ee));return}_&&URL.revokeObjectURL(_),w(q),T(URL.createObjectURL(q)),B("")},Ce=async()=>{if(S){A(!0),B("");try{const U=await YA(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,M,F),q=await ZA(U,S.name);await XA(q,S,P);const le=q.split("?")[0],ge=await JA(U,le,S.type);r(ge)}catch(U){B(U instanceof Error?U.message:o.appIconPickerModal.uploadFailedError)}finally{A(!1)}}},ke=d.length<f;return l.jsx("div",{className:Oe.overlay,role:"dialog","aria-modal":"true","aria-label":o.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Oe.modal,children:[l.jsxs("div",{className:Oe.header,children:[l.jsx("span",{className:Oe.title,children:o.appIconPickerModal.title}),l.jsx("button",{className:Oe.closeBtn,onClick:n,"aria-label":o.appIconPickerModal.closeAriaLabel,children:l.jsx(Or,{size:18})})]}),l.jsxs("div",{className:Oe.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":s==="my",className:`${Oe.tab} ${s==="my"?Oe.activeTab:""}`,onClick:()=>a("my"),children:o.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":s==="all",className:`${Oe.tab} ${s==="all"?Oe.activeTab:""}`,onClick:()=>a("all"),children:o.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":s==="upload",className:`${Oe.tab} ${s==="upload"?Oe.activeTab:""}`,onClick:()=>a("upload"),children:[l.jsx(ji,{size:13,style:{marginRight:4}}),o.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Oe.body,children:s!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Oe.searchWrap,children:[l.jsx(aa,{size:14,className:Oe.searchIcon}),l.jsx("input",{type:"search",className:Oe.searchInput,placeholder:o.appIconPickerModal.searchPlaceholder,value:i,onChange:U=>ie(U.target.value)})]}),p&&d.length===0?l.jsxs("div",{className:Oe.loadingRow,children:[l.jsx(na,{size:20,className:Oe.spinner}),l.jsx("span",{children:o.appIconPickerModal.loadingText})]}):d.length===0?l.jsx("div",{className:Oe.empty,children:o.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Oe.grid,children:d.map(U=>{const q=U.appIcon??U.artifactUrl??U.downloadUrl??"",le=(m==null?void 0:m.identifier)===U.identifier;return l.jsxs("button",{type:"button",className:`${Oe.imgCell} ${le?Oe.imgCellSelected:""}`,onClick:()=>v(U),title:U.name,children:[q?l.jsx("img",{src:q,alt:U.name,className:Oe.thumb}):l.jsx("div",{className:Oe.noThumb,children:o.appIconPickerModal.noThumbnailText}),le&&l.jsx("div",{className:Oe.checkBadge,children:l.jsx(Kn,{size:12})})]},U.identifier)})}),ke&&!p&&l.jsx("button",{className:Oe.loadMoreBtn,onClick:ve,children:o.appIconPickerModal.loadMoreButton}),p&&d.length>0&&l.jsx("div",{className:Oe.loadingRow,children:l.jsx(na,{size:16,className:Oe.spinner})})]}):l.jsxs("div",{className:Oe.uploadArea,children:[l.jsx("div",{className:Oe.dropZone,onClick:()=>{var U;return(U=D.current)==null?void 0:U.click()},onDragOver:U=>U.preventDefault(),onDrop:U=>{U.preventDefault();const q=U.dataTransfer.files[0];q&&z({target:{files:[q],value:""}})},children:_?l.jsx("img",{src:_,alt:o.appIconPickerModal.previewAlt,className:Oe.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(ji,{size:32,className:Oe.uploadIcon}),l.jsx("p",{className:Oe.dropText,children:o.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Oe.dropSubtext,children:o.appIconPickerModal.acceptedTypesInfo.replace("{types}",ne.split(",").map(U=>U.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(V/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:D,type:"file",accept:ne,className:Oe.hiddenInput,onChange:z}),S&&l.jsx("p",{className:Oe.fileName,children:S.name}),x&&l.jsx("p",{className:Oe.errorText,children:x})]})}),l.jsxs("div",{className:Oe.footer,children:[l.jsx("button",{className:Oe.cancelBtn,onClick:n,children:o.appIconPickerModal.cancelButton}),s==="upload"?l.jsx("button",{className:Oe.confirmBtn,disabled:!S||E,onClick:Ce,children:E?l.jsxs(l.Fragment,{children:[l.jsx(na,{size:14,className:Oe.spinner})," ",o.appIconPickerModal.uploadingText]}):o.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Oe.confirmBtn,disabled:!m,onClick:me,children:o.appIconPickerModal.useSelectedButton})]})]})})},eI=({name:e,label:t,nodeId:r,required:n,disabled:o})=>{const s=ue(),[a,i]=h.useState(!1),{watch:c,setValue:d,register:u,formState:{errors:f}}=pr(),g=c(e),p=f[e],b=v=>{d(e,v,{shouldDirty:!0,shouldValidate:!0}),i(!1)},m=()=>{d(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:$.field,children:[l.jsxs("label",{className:$.label,children:[t,n&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?s.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:$.iconWrap,role:"button",tabIndex:o?-1:0,"aria-label":s.appIconField.selectIconAriaLabel,onClick:()=>!o&&i(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!o&&i(!0)},children:g?l.jsx("img",{src:g,alt:s.appIconField.iconAlt,className:$.iconPreview}):l.jsxs("div",{className:$.iconPlaceholder,children:[l.jsx(tu,{size:20}),l.jsx("span",{children:s.appIconField.selectIconLabel})]})}),g&&!o&&l.jsxs("button",{type:"button",className:$.removeIconBtn,onClick:m,"aria-label":s.appIconField.removeIconAriaLabel,children:[l.jsx(Yn,{size:13}),l.jsx("span",{children:s.appIconField.removeLabel})]}),p&&l.jsx("span",{className:$.error,children:String(p.message)}),a&&l.jsx(pm,{nodeId:r,currentValue:g,onSelect:b,onClose:()=>i(!1)})]})},tI=({name:e,label:t,required:r,disabled:n})=>{const o=ue(),{control:s}=pr(),{field:a,fieldState:{error:i}}=ys({name:e,control:s,rules:{required:r?o.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:$.field,children:[l.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[$.input,i?$.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:a.onChange,onBlur:a.onBlur,ref:a.ref}),i&&l.jsx("span",{className:$.error,children:String(i.message)})]})},rI=({name:e,label:t,required:r,disabled:n})=>{const o=ue(),{control:s}=pr(),{field:a,fieldState:{error:i}}=ys({name:e,control:s,rules:{required:r?o.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,d]=h.useState(""),u=h.useRef(null),f=a.value??[],g=v=>{const y=v.trim();!y||f.includes(y)||a.onChange([...f,y])},p=v=>{a.onChange(f.filter(y=>y!==v))},b=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),g(c),d("")):v.key==="Backspace"&&c===""&&f.length>0&&p(f[f.length-1])},m=()=>{c.trim()&&(g(c),d("")),a.onBlur()};return l.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[l.jsxs("label",{className:$.label,children:[t,r&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsxs("div",{className:[$.chipGroup,i?$.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=u.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:$.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:$.tagChipRemove,onClick:y=>{y.stopPropagation(),p(v)},"aria-label":`Remove ${v}`,children:l.jsx(Or,{size:11})})]},v)),!n&&l.jsx("input",{ref:u,className:$.chipInput,value:c,onChange:v=>d(v.target.value),onKeyDown:b,onBlur:m,placeholder:f.length===0?o.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),i&&l.jsx("span",{className:$.error,children:String(i.message)})]})},nI=({name:e,label:t,levels:r,required:n,disabled:o})=>{const s=ue(),{control:a}=pr(),{field:i,fieldState:{error:c}}=ys({name:e,control:a,rules:{required:n?s.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=i.value??{},u=(f,g,p)=>{const b={};for(let m=0;m<g;m++)b[r[m].code]=d[r[m].code]??"";b[f]=p;for(let m=g+1;m<r.length;m++)b[r[m].code]="";i.onChange(b)};return l.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[l.jsxs("label",{className:$.label,children:[t,n&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx("div",{className:$.nestedSelectRow,children:r.map((f,g)=>{const p=g>0&&!d[r[g-1].code];return l.jsxs("div",{className:$.field,style:{flex:1},children:[l.jsx("label",{className:$.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[$.input,c?$.inputError:""].join(" "),disabled:o||p,value:d[f.code]??"",onChange:b=>u(f.code,g,b.target.value),onBlur:i.onBlur,children:[l.jsx("option",{value:"",children:s.nestedSelectField.selectPlaceholder}),f.options.map(b=>l.jsx("option",{value:b.value,children:b.label},b.value))]})]},f.code)})}),c&&l.jsx("span",{className:$.error,children:String(c.message)})]})},mm=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC0 1.0 (Public Domain)",value:"CC0 1.0"}],oI=({name:e,label:t,required:r,disabled:n})=>{const o=ue(),[s,a]=h.useState(!1),i=h.useRef(null),{register:c,watch:d,setValue:u,formState:{errors:f}}=pr(),g=d(e),p=mm.find(v=>v.value===g),b=(p==null?void 0:p.label)??o.licenseSelectField.selectPlaceholder,m=f[e];return h.useEffect(()=>{if(!s)return;const v=y=>{var C;(C=i.current)!=null&&C.contains(y.target)||a(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[s]),l.jsxs("div",{className:$.field,ref:i,style:{position:"relative"},children:[l.jsxs("label",{className:$.label,children:[t,r&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?o.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[$.selectBtn,m?$.inputError:"",s?$.selectOpen:""].join(" "),onClick:()=>a(v=>!v),"aria-haspopup":"listbox","aria-expanded":s,children:[l.jsx("span",{className:g?$.selectedVal:$.placeholder,children:b}),l.jsx(rn,{size:14,className:s?$.chevronUp:""})]}),s&&l.jsx("div",{className:$.dropdown,role:"listbox",children:mm.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":g===v.value,className:[$.option,g===v.value?$.optionSelected:""].join(" "),onClick:()=>{u(e,v.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:v.label}),g===v.value&&l.jsx(Kn,{size:13})]},v.value))}),m&&l.jsx("span",{className:$.error,children:String(m.message)})]})},sI=({name:e,label:t,required:r,disabled:n})=>{const o=ue(),{control:s}=pr(),{field:a,fieldState:{error:i}}=ys({name:e,control:s,rules:{required:r?o.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,d]=h.useState("idle"),[u,f]=h.useState(""),g=async()=>{const b=(a.value??"").trim();if(!b){d("invalid"),f(o.dialcodeInputField.enterCodeMessage);return}d("loading"),f("");try{const m=await d_(b),v=m==null?void 0:m.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(d("valid"),f(o.dialcodeInputField.validMessage)):(d("invalid"),f(o.dialcodeInputField.notFoundMessage))}catch{d("invalid"),f(o.dialcodeInputField.validationFailedMessage)}},p=()=>c==="loading"?l.jsx(na,{size:16,className:$.dialcodeSpinner}):c==="valid"?l.jsx(Yd,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(Lb,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:$.field,children:[l.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsxs("div",{className:$.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[$.input,i?$.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:b=>{a.onChange(b),d("idle"),f("")},onBlur:a.onBlur,ref:a.ref,placeholder:o.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:$.validateBtn,onClick:g,disabled:n||c==="loading","aria-label":o.dialcodeInputField.validateAriaLabel,children:c==="loading"?o.dialcodeInputField.validatingLabel:o.dialcodeInputField.validateButtonLabel}),p()]}),i&&l.jsx("span",{className:$.error,children:String(i.message)}),!i&&u&&l.jsx("span",{className:c==="valid"?$.dialcodeValid:$.error,children:u})]})},sr={cards:"_cards_1j7eu_1",card:"_card_1j7eu_1",cardActive:"_cardActive_1j7eu_30",cardIcon:"_cardIcon_1j7eu_35",cardIconPrimary:"_cardIconPrimary_1j7eu_46",cardIconHover:"_cardIconHover_1j7eu_50",radioDot:"_radioDot_1j7eu_54",radioDotActive:"_radioDotActive_1j7eu_65",cardTitle:"_cardTitle_1j7eu_70",cardTitleInk:"_cardTitleInk_1j7eu_76",cardDescription:"_cardDescription_1j7eu_80",cardDescriptionCharcoal:"_cardDescriptionCharcoal_1j7eu_86"},aI=({name:e,label:t,required:r,disabled:n})=>{const o=ue(),{control:s}=pr(),a=[{value:"strict",Icon:ru,iconVariant:sr.cardIconPrimary,title:o.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:o.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:Jb,iconVariant:sr.cardIconPrimary,title:o.learningPath.policyAdaptiveLabel,titleVariant:sr.cardTitleInk,description:l.jsxs(l.Fragment,{children:[o.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:$.required,children:"*"}),o.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:sr.cardDescriptionCharcoal},{value:"priorLearning",Icon:Qb,iconVariant:sr.cardIconHover,title:o.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:o.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:$.field,children:[l.jsxs("label",{className:$.label,children:[t,r&&l.jsx("span",{className:$.required,children:"*"})]}),l.jsx(WE,{name:e,control:s,rules:{required:r?o.selectField.requiredError.replace("{field}",t):!1},render:({field:i})=>l.jsx("div",{className:sr.cards,children:a.map(({value:c,Icon:d,iconVariant:u,title:f,titleVariant:g,description:p,descriptionVariant:b})=>{const m=i.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[sr.card,m?sr.cardActive:""].join(" "),onClick:()=>i.onChange(c),children:[l.jsx("span",{className:[sr.cardIcon,u].join(" "),children:l.jsx(d,{size:16})}),l.jsx("span",{className:[sr.radioDot,m?sr.radioDotActive:""].join(" ")}),l.jsx("span",{className:[sr.cardTitle,g].join(" "),children:f}),l.jsx("span",{className:[sr.cardDescription,b].join(" "),children:p})]},c)})})})]})},bo={form:"_form_lktqh_1",formLp:"_formLp_lktqh_7",ungrouped:"_ungrouped_lktqh_12",ungroupedLp:"_ungroupedLp_lktqh_23",fullWidthField:"_fullWidthField_lktqh_27",noFields:"_noFields_lktqh_31"},gm=e=>e==null||e===""||Array.isArray(e)&&e.length===0,iI=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:o,onFormValueChange:s,onFormStatusChange:a})=>{var Jt,Qt,Ut,ir,Kr,pt,Ir,lr,yr,yn,bn;const i=ue(),c=Z(j=>j.editorConfig),d=Z(j=>j.editorProfile),u=d.key==="learningPath",f=Z(j=>j.rootFormConfig),g=Z(j=>j.unitFormConfig),p=Z(j=>j.categoryMeta),b=Z(j=>j.contentFramework),m=Z(j=>j.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:C}=Ea(b??((Jt=c==null?void 0:c.context)==null?void 0:Jt.framework),m??((Qt=c==null?void 0:c.context)==null?void 0:Qt.targetFWIds)),{frameworks:S,collectionAdditionalCategories:w,contentAdditionalCategories:_,defaultLicense:T,name:E}=uA((Ut=c==null?void 0:c.context)==null?void 0:Ut.channel),A=fA(((ir=c==null?void 0:c.context)==null?void 0:ir.userId)??((Kr=c==null?void 0:c.context)==null?void 0:Kr.uid)),x=dA(S,(pt=p==null?void 0:p.frameworkMetadata)==null?void 0:pt.orgFWType,(Ir=c==null?void 0:c.context)==null?void 0:Ir.channel),B=ae(j=>j.selectedNodeId),D=ae(j=>j.treeData),F=ae(j=>j.treeCache),M=B?F[B]??{}:{},P={...e,...M},V=P.primaryCategory??((lr=c==null?void 0:c.config)==null?void 0:lr.primaryCategory),ne=r&&!u&&(V==="Course"||V===pl),W=r&&u,{frameworks:de,isLoaded:ie}=Of((yr=c==null?void 0:c.context)==null?void 0:yr.channel,ne||W),ve=typeof P.competencyFramework=="string"?P.competencyFramework:void 0,me=h.useMemo(()=>de.map(j=>({label:j.name,value:j.identifier})),[de]),z=(ne||W)&&ve&&de.some(j=>j.identifier===ve)?ve:void 0,{skills:Ce,skillField:ke}=Cl(ne?z:void 0),U=h.useRef(ke);U.current=ke;const{roles:q}=Pf(W?z:void 0),le=h.useMemo(()=>q.map(j=>({label:j.name,value:j.id})),[q]),ge=h.useRef(P.targetRole);ge.current=P.targetRole;const ee=h.useRef(q);ee.current=q;const fe=h.useRef(ve);fe.current=ve;const X=h.useRef(P.framework);X.current=P.framework;const Se={organisationFramework:v,targetFrameworks:y,orgFrameworks:x,channelAdditionalCategories:w,...ne||W?{competency:{frameworks:me,frameworksLoaded:ie,skills:Ce,skillField:ke,...W?{roles:le}:{}}}:{}},Me=h.useMemo(()=>{var ye;if(!B)return 0;const j=[...D];for(;j.length;){const Le=j.shift();if(Le.id===B)return((ye=Le.children)==null?void 0:ye.length)??0;Le.children&&j.push(...Le.children)}return 0},[D,B]),re=(c==null?void 0:c.config)??{},ce=(c==null?void 0:c.context)??{},G={editorMode:o,editableFields:re.editableFields,objectType:re.objectType,setDefaultCopyRight:re.setDefaultCopyRight===!0,defaultLicense:ce.defaultLicense??T,contextAdditionalCategories:ce.additionalCategories,userFullName:((yn=ce.user)==null?void 0:yn.fullName)??A,channelName:E,collectionAdditionalCategories:w,contentAdditionalCategories:_,childCount:Me,profile:d,competencyLabels:i.sparkMetaForm},H=r?f:g,Ae=H||(((bn=c==null?void 0:c.config.hierarchy)==null?void 0:bn.formConfig)??[]),Te=nm(Ae,P,Se,r,G),Ie=Te.filter(j=>j.tab===t&&j.inputType!=="appIcon"&&j.visible!==!1),we=cA({mode:"onChange",defaultValues:Object.fromEntries(Te.map(j=>{const ye=["multiselect","chips","keywords","tagsinput"],Le=["nestedselect"];return ye.includes(j.inputType)?[j.code,j.currentValue??j.defaultValue??[]]:Le.includes(j.inputType)?[j.code,j.currentValue??j.defaultValue??{}]:[j.code,j.currentValue??j.defaultValue??""]}))});HA(we,Te);const Be=h.useRef(!1),zt=(j,ye)=>{Be.current=!0;try{we.setValue(j,ye,{shouldDirty:!1})}finally{Be.current=!1}},{updateNode:vr}=ae(),Rt=h.useRef(Te);Rt.current=Te;const qt=h.useRef(B);qt.current=B;const k=h.useRef(s);k.current=s;const N=h.useRef(a);N.current=a;const O=h.useRef(typeof P.shuffle=="boolean"?P.shuffle:void 0),R=h.useRef(P.name??"");R.current=P.name??"";const Q=h.useRef(o);Q.current=o;const K=_r(),Y=h.useRef(K==null?void 0:K.code);Y.current=K==null?void 0:K.code;const he=h.useRef(K==null?void 0:K.terms);he.current=K==null?void 0:K.terms;const Pe=["review","read","sourcingreview","orgreview"],et=()=>{we.trigger().then(()=>{const j=we.formState.errors,ye=Rt.current,Le=Array.from(new Set(Object.keys(j).map(Lr=>{var Cn;return(Cn=ye.find(er=>er.code===Lr))==null?void 0:Cn.tab}).filter(Boolean)));N.current(Object.keys(j).length===0,Le)})};h.useEffect(()=>{const j=qt.current;if(j){const ye=Object.fromEntries(Rt.current.filter(Le=>Le.currentValue!==void 0&&Le.currentValue!==null).map(Le=>[Le.code,Le.currentValue]));Object.keys(ye).length>0&&vr(j,ye,void 0,{silent:!0})}et()},[]);const jt=Te.map(j=>j.code).join("|"),_t=h.useRef(Te.map(j=>j.code));h.useEffect(()=>{const j=Rt.current,ye=new Set(j.map(er=>er.code)),Le=new Set(_t.current),Lr=_t.current.filter(er=>!ye.has(er)),Cn=j.filter(er=>!Le.has(er.code));if(_t.current=Array.from(ye),Lr.length){Be.current=!0;try{we.unregister(Lr,{keepValue:!0,keepDefaultValue:!0})}finally{Be.current=!1}}for(const er of Cn){const Ls=er.currentValue;gm(Ls)||!gm(we.getValues(er.code))||zt(er.code,Ls)}(Lr.length||Cn.length)&&et()},[jt]),h.useEffect(()=>{const j=we.watch((ye,{name:Le})=>{var mg,gg;const Lr=qt.current;if(!Lr)return;const Cn=Rt.current,er=new Set(Cn.map(tt=>tt.code));if(Le&&er.has(Le)){let tt=we.getValues(Le);if(Le==="dialcodes"&&(tt=Array.isArray(tt)?tt:tt?[tt]:[]),Le==="shuffle"&&(tt===!0&&O.current===!1&&be(i.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(zr,{size:16})}),O.current=tt),Le==="framework"&&r&&typeof tt=="string"&&tt){const Dt=Z.getState();if(Dt.setContentFramework(tt,Dt.contentTargetFWIds),u&&!fe.current&&tt!==X.current){const cr=ae.getState().pruneCoursesByFramework(tt);cr>0&&be(i.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(cr)),{icon:l.jsx(zr,{size:16}),duration:5e3});const Sn=ae.getState().clearLevelSkills(Y.current);Sn>0&&be(i.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(Sn)),{icon:l.jsx(zr,{size:16}),duration:5e3})}}let jr=!1,br;if(Le==="competencyFramework"&&r&&u&&tt!==fe.current){jr=!!we.getValues("targetRole"),jr&&we.setValue("targetRole","",{shouldDirty:!0});const Dt=Y.current,cr=ae.getState().treeData[0],Sn=Dt&&cr?((mg=ae.getState().treeCache[cr.id])==null?void 0:mg[Dt])??((gg=cr.metadata)==null?void 0:gg[Dt]):void 0;Dt&&(Array.isArray(Sn)?Sn.length>0:Sn)&&(br=Dt),(jr||br)&&be(i.learningPath.skillFrameworkChangedToast,{icon:l.jsx(zr,{size:16}),duration:5e3})}if(Le==="targetRole"&&r&&u&&typeof tt=="string"&&tt&&tt!==ge.current){const Dt=ee.current.find(Sn=>Sn.id===tt),cr=Dt?ff(ae.getState().treeData[0],Dt.skills,Y.current,he.current).length:0;cr>0&&be(i.learningPath.roleChangedCoursesFlaggedToast.replace("{count}",String(cr)),{icon:l.jsx(zr,{size:16}),duration:6e3})}if(Le==="competencyFramework"&&r&&!u&&tt!==fe.current){const Dt=U.current,cr=Dt?we.getValues(Dt):void 0;Dt&&(Array.isArray(cr)?cr.length>0:cr)&&(br=Dt,we.setValue(Dt,[],{shouldDirty:!0}))}const Ds=UA(Le,tt),Ic=Ds&&(br||jr)?{...Ds,...br?{[br]:[]}:{},...jr?{targetRole:""}:{}}:Ds;Ic&&(vr(Lr,Ic,void 0,Be.current?{silent:!0}:void 0),k.current(Ic))}else if(!Le){const tt=we.getValues(),jr=Object.fromEntries(Object.entries(tt).filter(([Ds])=>er.has(Ds))),br=jA(jr,{isReview:Pe.includes(Q.current),nodeTitle:R.current});Object.keys(br).length>0&&(vr(Lr,br,void 0,Be.current?{silent:!0}:void 0),k.current(br))}const Ls=we.formState.errors,iD=Array.from(new Set(Object.keys(Ls).map(tt=>{var jr;return(jr=Cn.find(br=>br.code===tt))==null?void 0:jr.tab}).filter(Boolean)));N.current(Object.keys(Ls).length===0,iD)});return()=>j.unsubscribe()},[we]),h.useEffect(()=>{for(const j of["author","creator","copyright","copyrightYear","license"]){const ye=Rt.current.find(Lr=>Lr.code===j);if(!ye||ye.currentValue===void 0||ye.currentValue===null||ye.currentValue==="")continue;const Le=we.getValues(j);(Le==null||Le==="")&&zt(j,ye.currentValue)}},[A,E,we]);const ft=Te.find(j=>j.isSkillField&&j.editable!==!1),vn=JSON.stringify((ft==null?void 0:ft.currentValue)??null);h.useEffect(()=>{ft&&JSON.stringify(we.getValues(ft.code)??null)!==vn&&zt(ft.code,ft.currentValue)},[ft==null?void 0:ft.code,vn,we]);const qr=[rr,In].map(j=>{var ye;return[j,(ye=Te.find(Le=>Le.code===j))==null?void 0:ye.currentValue]}),ht=JSON.stringify(qr);h.useEffect(()=>{for(const[j,ye]of qr)ye&&we.getValues(j)!==ye&&zt(j,ye)},[ht,we]);const Tt=Ie.reduce((j,ye)=>{const Le=j[j.length-1];return Le&&Le.section===ye.section?Le.fields.push(ye):j.push({section:ye.section,fields:[ye]}),j},[]),kt=j=>{const ye={key:j.code,name:j.code,label:j.label,required:j.required,disabled:j.editable===!1};if(u&&j.code==="policy")return l.jsx("div",{className:bo.fullWidthField,children:l.jsx(aI,{...ye})},j.code);switch(j.inputType){case"textarea":return l.jsx(dm,{...ye,multiline:!0,maxLength:j.maxLength});case"select":return l.jsx(QA,{...ye,options:j.options??[]});case"multiselect":return l.jsx(WA,{...ye,options:j.options??[]});case"chips":return l.jsx(GA,{...ye});case"radio":return l.jsx(KA,{...ye,options:j.options??[]});case"appIcon":return l.jsx(eI,{...ye,nodeId:B??""});case"datepicker":case"datetime":return l.jsx(tI,{...ye});case"keywords":case"tagsinput":return l.jsx(rI,{...ye});case"nestedselect":return l.jsx(nI,{...ye,levels:j.levels??[]});case"license":return l.jsx(oI,{...ye});case"dialcode":return l.jsx(sI,{...ye});default:return l.jsx(dm,{...ye,maxLength:j.maxLength})}};return l.jsx(GE,{...we,children:l.jsxs("div",{className:[bo.form,u?bo.formLp:""].filter(Boolean).join(" "),children:[Tt.map((j,ye)=>{const Le=j.section?hA[j.section]:void 0;return Le?l.jsx(VA,{title:Le.title,description:Le.description,children:j.fields.map(kt)},j.section??ye):l.jsx("div",{className:[bo.ungrouped,u?bo.ungroupedLp:""].filter(Boolean).join(" "),children:j.fields.map(kt)},ye)}),Ie.length===0&&!C&&l.jsx("p",{className:bo.noFields,children:i.sparkMetaForm.noFieldsMessage})]})})};function vm(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function lI(e,t){return e.reduce((r,n,o)=>{const s=t.get(n);return s&&(r[o]=s),r},Array(e.length))}function ei(e){return e!==null&&e>=0}function cI(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function dI(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ym=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const s=vm(t,n,r),a=t[o],i=s[o];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},ti={scaleX:1,scaleY:1},bm=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:s,overIndex:a}=e;const i=(t=s[r])!=null?t:n;if(!i)return null;if(o===r){const d=s[a];return d?{x:0,y:r<a?d.top+d.height-(i.top+i.height):d.top-i.top,...ti}:null}const c=uI(s,o,r);return o>r&&o<=a?{x:0,y:-i.height-c,...ti}:o<r&&o>=a?{x:0,y:i.height+c,...ti}:{x:0,y:0,...ti}};function uI(e,t,r){const n=e[t],o=e[t-1],s=e[t+1];return n?r<t?o?n.top-(o.top+o.height):s?s.top-(n.top+n.height):0:s?s.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Cm="Sortable",Sm=h.createContext({activeIndex:-1,containerId:Cm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ym,disabled:{draggable:!1,droppable:!1}});function wm(e){let{children:t,id:r,items:n,strategy:o=ym,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:c,over:d,measureDroppableContainers:u}=Wd(),f=Ho(Cm,r),g=i.rect!==null,p=h.useMemo(()=>n.map(T=>typeof T=="object"&&"id"in T?T.id:T),[n]),b=a!=null,m=a?p.indexOf(a.id):-1,v=d?p.indexOf(d.id):-1,y=h.useRef(p),C=!cI(p,y.current),S=v!==-1&&m===-1||C,w=dI(s);Cr(()=>{C&&b&&u(p)},[C,p,b,u]),h.useEffect(()=>{y.current=p},[p]);const _=h.useMemo(()=>({activeIndex:m,containerId:f,disabled:w,disableTransforms:S,items:p,overIndex:v,useDragOverlay:g,sortedRects:lI(p,c),strategy:o}),[m,f,w.draggable,w.droppable,S,p,v,c,g,o]);return h.createElement(Sm.Provider,{value:_},t)}const fI=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return vm(r,n,o).indexOf(t)},hI=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:s,newIndex:a,previousItems:i,previousContainerId:c,transition:d}=e;return!d||!n||i!==s&&o===a?!1:r?!0:a!==o&&t===c},pI={duration:200,easing:"ease"},_m="transform",mI=Vr.Transition.toString({property:_m,duration:0,easing:"linear"}),gI={roleDescription:"sortable"};function vI(e){let{disabled:t,index:r,node:n,rect:o}=e;const[s,a]=h.useState(null),i=h.useRef(r);return Cr(()=>{if(!t&&r!==i.current&&n.current){const c=o.current;if(c){const d=Gn(n.current,{ignoreTransform:!0}),u={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(u.x||u.y)&&a(u)}}r!==i.current&&(i.current=r)},[t,r,n,o]),h.useEffect(()=>{s&&a(null)},[s]),s}function Tm(e){let{animateLayoutChanges:t=hI,attributes:r,disabled:n,data:o,getNewIndex:s=fI,id:a,strategy:i,resizeObserverConfig:c,transition:d=pI}=e;const{items:u,containerId:f,activeIndex:g,disabled:p,disableTransforms:b,sortedRects:m,overIndex:v,useDragOverlay:y,strategy:C}=h.useContext(Sm),S=yI(n,p),w=u.indexOf(a),_=h.useMemo(()=>({sortable:{containerId:f,index:w,items:u},...o}),[f,o,w,u]),T=h.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:E,node:A,isOver:x,setNodeRef:B}=cb({id:a,data:_,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:D,activatorEvent:F,activeNodeRect:M,attributes:P,setNodeRef:V,listeners:ne,isDragging:W,over:de,setActivatorNodeRef:ie,transform:ve}=Qd({id:a,data:_,attributes:{...gI,...r},disabled:S.draggable}),me=Kv(B,V),z=!!D,Ce=z&&!b&&ei(g)&&ei(v),ke=!y&&W,U=ke&&Ce?ve:null,le=Ce?U??(i??C)({rects:m,activeNodeRect:M,activeIndex:g,overIndex:v,index:w}):null,ge=ei(g)&&ei(v)?s({id:a,items:u,activeIndex:g,overIndex:v}):w,ee=D==null?void 0:D.id,fe=h.useRef({activeId:ee,items:u,newIndex:ge,containerId:f}),X=u!==fe.current.items,Se=t({active:D,containerId:f,isDragging:W,isSorting:z,id:a,index:w,items:u,newIndex:fe.current.newIndex,previousItems:fe.current.items,previousContainerId:fe.current.containerId,transition:d,wasDragging:fe.current.activeId!=null}),Me=vI({disabled:!Se,index:w,node:A,rect:E});return h.useEffect(()=>{z&&fe.current.newIndex!==ge&&(fe.current.newIndex=ge),f!==fe.current.containerId&&(fe.current.containerId=f),u!==fe.current.items&&(fe.current.items=u)},[z,ge,f,u]),h.useEffect(()=>{if(ee===fe.current.activeId)return;if(ee&&!fe.current.activeId){fe.current.activeId=ee;return}const ce=setTimeout(()=>{fe.current.activeId=ee},50);return()=>clearTimeout(ce)},[ee]),{active:D,activeIndex:g,attributes:P,data:_,rect:E,index:w,newIndex:ge,items:u,isOver:x,isSorting:z,isDragging:W,listeners:ne,node:A,overIndex:v,over:de,setNodeRef:me,setActivatorNodeRef:ie,setDroppableNodeRef:B,setDraggableNodeRef:V,transform:Me??le,transition:re()};function re(){if(Me||X&&fe.current.newIndex===w)return mI;if(!(ke&&!Rs(F)||!d)&&(z||Se))return Vr.Transition.toString({...d,property:_m})}}function yI(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function ri(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const bI=[je.Down,je.Right,je.Up,je.Left],CI=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(bI.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];s.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const g=o.get(f.id);if(g)switch(e.code){case je.Down:n.top<g.top&&c.push(f);break;case je.Up:n.top>g.top&&c.push(f);break;case je.Left:n.left>g.left&&c.push(f);break;case je.Right:n.left<g.left&&c.push(f);break}});const d=uy({collisionRect:n,droppableRects:o,droppableContainers:c});let u=yd(d,"id");if(u===(a==null?void 0:a.id)&&d.length>1&&(u=d[1].id),u!=null){const f=s.get(r.id),g=s.get(u),p=g?o.get(g.id):null,b=g==null?void 0:g.node.current;if(b&&p&&f&&g){const v=Gs(b).some((T,E)=>i[E]!==T),y=km(f,g),C=SI(f,g),S=v||!y?{x:0,y:0}:{x:C?n.width-p.width:0,y:C?n.height-p.height:0},w={x:p.left,y:p.top};return S.x&&S.y?w:Vo(w,S)}}}};function km(e,t){return!ri(e)||!ri(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function SI(e,t){return!ri(e)||!ri(t)||!km(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const xn={row:"_row_11nth_1",removeBtn:"_removeBtn_11nth_14",grip:"_grip_11nth_17",ctIcon:"_ctIcon_11nth_34",info:"_info_11nth_38",name:"_name_11nth_46",meta:"_meta_11nth_55"},wI={video:ia,pdf:Ko,h5p:ra,scorm:sa,audio:oa,quiz:ta,course:Nr,default:nn},_I=({item:e,onRemove:t,isEditable:r})=>{const n=ue(),o=hs(e),s=wI[o.key]??nn,{attributes:a,listeners:i,setNodeRef:c,transform:d,transition:u,isDragging:f}=Tm({id:e.id,disabled:!r}),g={transform:Vr.Transform.toString(d),transition:u,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:g,className:xn.row,role:"listitem",children:[r&&l.jsx("span",{className:xn.grip,...a,...i,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(qi,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${o.key}`,xn.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(s,{size:14})}),l.jsxs("div",{className:xn.info,children:[l.jsx("span",{className:xn.name,title:e.name,children:e.name}),l.jsx("span",{className:xn.meta,children:o.label})]}),l.jsx("span",{className:`sbx-ct-badge--${o.key}`,children:o.label}),r&&l.jsx("button",{type:"button",className:xn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(Or,{size:14})})]})},J={container:"_container_bv5qe_1",header:"_header_bv5qe_7",heading:"_heading_bv5qe_13",count:"_count_bv5qe_21",list:"_list_bv5qe_30",emptyState:"_emptyState_bv5qe_36",skillsCovered:"_skillsCovered_bv5qe_52",chips:"_chips_bv5qe_64",chip:"_chip_bv5qe_64",emptyHint:"_emptyHint_bv5qe_80",assessmentsCard:"_assessmentsCard_bv5qe_93",assessmentSlots:"_assessmentSlots_bv5qe_105",assessmentItemRow:"_assessmentItemRow_bv5qe_111",assessmentItemIcon:"_assessmentItemIcon_bv5qe_122",assessmentItemInfo:"_assessmentItemInfo_bv5qe_134",assessmentItemTitle:"_assessmentItemTitle_bv5qe_141",assessmentItemMeta:"_assessmentItemMeta_bv5qe_150",coursesCard:"_coursesCard_bv5qe_155",coursesCardTitle:"_coursesCardTitle_bv5qe_166",coursesCardDescription:"_coursesCardDescription_bv5qe_173",coursesList:"_coursesList_bv5qe_180",courseRow:"_courseRow_bv5qe_186",courseDragHandle:"_courseDragHandle_bv5qe_196",courseIcon:"_courseIcon_bv5qe_208",courseInfo:"_courseInfo_bv5qe_220",courseTitle:"_courseTitle_bv5qe_227",courseMeta:"_courseMeta_bv5qe_236",addRowIcon:"_addRowIcon_bv5qe_241",assessmentItemBadge:"_assessmentItemBadge_bv5qe_253",menuWrap:"_menuWrap_bv5qe_264",menuBtn:"_menuBtn_bv5qe_269",dropmenu:"_dropmenu_bv5qe_282",dangerItem:"_dangerItem_bv5qe_312",addRow:"_addRow_bv5qe_241",addRowActive:"_addRowActive_bv5qe_336",addRowAssessment:"_addRowAssessment_bv5qe_342",addRowText:"_addRowText_bv5qe_349",requiredBadge:"_requiredBadge_bv5qe_354",chipWarn:"_chipWarn_bv5qe_365",warnHint:"_warnHint_bv5qe_370",courseFlag:"_courseFlag_bv5qe_377"},wc=({slot:e,isEditable:t})=>{const r=ue(),{pre:n,post:o,activeAssessmentSlot:s,setActiveAssessmentSlot:a,deleteSlot:i}=rc(),c=ae(v=>v.selectNode),[d,u]=h.useState(!1),f=h.useRef(null),g=e==="pre"?n:o,p=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(h.useEffect(()=>{if(!d)return;const v=y=>{var C;(C=f.current)!=null&&C.contains(y.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]),!g.filled){const v=s===e;return l.jsxs("button",{type:"button",className:[J.addRow,J.addRowAssessment,v?J.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:()=>a(v?null:e),"aria-pressed":v,children:[l.jsx("span",{className:J.addRowIcon,children:l.jsx(Rr,{size:16})}),l.jsx("span",{className:J.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",p)}),g.required&&l.jsx("span",{className:J.requiredBadge,children:r.learningPath.requiredSlotBadge})]})}const b=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,m=()=>g.level&&c(g.level.id);return l.jsxs("div",{className:J.assessmentItemRow,role:"button",tabIndex:0,onClick:m,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),m())},children:[l.jsx("span",{className:J.assessmentItemIcon,children:l.jsx(Nr,{size:16})}),l.jsxs("div",{className:J.assessmentItemInfo,children:[l.jsx("span",{className:J.assessmentItemTitle,children:g.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:J.assessmentItemMeta,children:[p," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:J.assessmentItemBadge,children:b}),t&&l.jsxs("div",{className:J.menuWrap,ref:f,children:[l.jsx("button",{type:"button",className:J.menuBtn,onClick:v=>{v.stopPropagation(),u(y=>!y)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),d&&l.jsxs("div",{className:J.dropmenu,onClick:v=>v.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{u(!1),g.level&&c(g.level.id)},children:[l.jsx(Ob,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:J.dangerItem,onClick:()=>{u(!1),i(e)},children:[l.jsx(Yn,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})};function TI(e){var g,p;const t=ue(),r=ae(b=>b.treeData),n=ae(b=>b.deleteNode),o=lt(b=>b.activeLevelExamTarget),s=lt(b=>b.setActiveLevelExamTarget),a=lt(b=>b.openModal),i=(p=(g=r[0])==null?void 0:g.children)==null?void 0:p.find(b=>b.id===e),c=mf(i),d=o===e,u=()=>{e&&s(d?null:e)},f=()=>{c&&a("confirmDelete",{message:t.learningPath.deleteLevelExamConfirm,onConfirm:()=>n(c.id)})};return{course:c,filled:!!c,courseName:c==null?void 0:c.name,isActiveTarget:d,armExam:u,deleteExam:f}}const kI=({levelId:e,isEditable:t})=>{const r=ue(),{filled:n,courseName:o,isActiveTarget:s,armExam:a,deleteExam:i}=TI(e);return n?l.jsxs("div",{className:J.assessmentItemRow,children:[l.jsx("span",{className:J.assessmentItemIcon,children:l.jsx(Nr,{size:16})}),l.jsxs("div",{className:J.assessmentItemInfo,children:[l.jsx("span",{className:J.assessmentItemTitle,children:o||r.learningPath.courseNameUnavailable}),l.jsx("span",{className:J.assessmentItemMeta,children:r.learningPath.levelExamMeta})]}),t&&l.jsx("button",{type:"button",className:J.menuBtn,onClick:i,"aria-label":r.treeNode.deleteMenuItem,children:l.jsx(Yn,{size:14})})]}):l.jsxs("button",{type:"button",className:[J.addRow,J.addRowAssessment,s?J.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:a,"aria-pressed":s,children:[l.jsx("span",{className:J.addRowIcon,children:l.jsx(Rr,{size:16})}),l.jsx("span",{className:J.addRowText,children:r.learningPath.addLevelExamButton})]})},EI=({item:e,onRemove:t,isEditable:r,notTeachingRole:n=!1})=>{const o=ue(),[s,a]=h.useState(!1),i=h.useRef(null),{attributes:c,listeners:d,setNodeRef:u,transform:f,transition:g,isDragging:p}=Tm({id:e.id,disabled:!r}),b={transform:Vr.Transform.toString(f),transition:g,opacity:p?.5:1};return h.useEffect(()=>{if(!s)return;const m=v=>{var y;(y=i.current)!=null&&y.contains(v.target)||a(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),l.jsxs("div",{ref:u,style:b,className:J.courseRow,children:[r&&l.jsx("span",{className:J.courseDragHandle,...c,...d,"aria-label":o.contentRow.dragToReorderAriaLabel,children:l.jsx(qi,{size:16})}),l.jsx("span",{className:J.courseIcon,children:l.jsx(Nr,{size:18})}),l.jsxs("div",{className:J.courseInfo,children:[l.jsx("span",{className:J.courseTitle,title:e.name,children:e.name}),l.jsx("span",{className:J.courseMeta,children:o.learningPath.courseMetaLabel}),n&&l.jsx("span",{className:J.courseFlag,role:"status",children:o.learningPath.courseNotTeachingRoleBadge})]}),r&&l.jsxs("div",{className:J.menuWrap,ref:i,children:[l.jsx("button",{type:"button",className:J.menuBtn,onClick:m=>{m.stopPropagation(),a(v=>!v)},"aria-label":o.treeNode.nodeOptionsAriaLabel,children:"⋮"}),s&&l.jsx("div",{className:J.dropmenu,onClick:m=>m.stopPropagation(),children:l.jsxs("button",{type:"button",className:J.dangerItem,onClick:()=>{a(!1),t(e.id)},children:[l.jsx(Yn,{size:12})," ",o.learningPath.removeFromLevelMenuItem]})})]})]})},AI=({editorMode:e,isRoot:t=!1})=>{const r=ue(),{selectedNodeId:n,getChildrenOf:o,getNodeById:s,reorderChildren:a,deleteNode:i,treeData:c}=ae(),d=Z(z=>z.editorProfile),u=n?o(n):[],f=e==="edit",g=n?s(n):void 0,p=d.competencyScoped,b=p&&!t&&!st(g),m=p&&t,v=lt(z=>z.activeAssessmentSlot),y=lt(z=>z.activeLevelExamTarget),C=lt(z=>z.setActiveAssessmentSlot),S=!v&&!y,{scope:w,source:_}=oo(),T=_r(),E=T==null?void 0:T.terms,A=b?as(g,T==null?void 0:T.code,E):[],x=h.useCallback(z=>wa(z,E),[E]),B=_==="prior"?A.filter(z=>!w.includes(z)):[],{roleSkills:D}=Qr(),F=m?hf(c[0],D,T==null?void 0:T.code,E):[],M=m?pf(c[0]):void 0,P=M&&D.length?D.filter(z=>!ro(M,T==null?void 0:T.code,E).includes(z)):[],V=m?Sf(c[0],T==null?void 0:T.code,E):[],ne=pd(Ei(Ks,{activationConstraint:{distance:5}}),Ei(Ni,{coordinateGetter:CI})),W=h.useCallback(z=>{const{active:Ce,over:ke}=z;if(!ke||Ce.id===ke.id||!n)return;const U=ae.getState().getChildrenOf(n),q=U.findIndex(ge=>ge.id===Ce.id),le=U.findIndex(ge=>ge.id===ke.id);q<0||le<0||a(n,q,le)},[n,a]),de=h.useCallback(z=>{window.confirm(r.unitContentList.removeConfirm)&&i(z)},[i,r.unitContentList.removeConfirm]),ie=lt(z=>z.openModal),ve=h.useCallback(z=>{ie("confirmDelete",{message:r.learningPath.deleteCourseConfirm,onConfirm:()=>{i(z)||be.error(r.learningPath.cannotRemoveLastRegularCourseToast)}})},[ie,i,r.learningPath.deleteCourseConfirm,r.learningPath.cannotRemoveLastRegularCourseToast]),me=b?u.filter(z=>{var Ce;return!((Ce=z.metadata)!=null&&Ce.isAssessmentCourse)}):[];return n?l.jsxs("div",{className:J.container,children:[m&&l.jsxs(l.Fragment,{children:[D.length>0?l.jsxs("div",{className:J.skillsCovered,children:[l.jsx("span",{className:J.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:J.emptyHint,children:r.learningPath.roleSkillsCoveredDescription}),l.jsx("div",{className:J.chips,children:D.map(z=>{const Ce=F.includes(z);return l.jsxs("span",{className:Ce?[J.chip,J.chipWarn].join(" "):J.chip,title:Ce?r.learningPath.roleSkillNotTaughtTitle:r.learningPath.roleSkillTaughtTitle,children:[x(z),Ce?` · ${r.learningPath.roleSkillNotTaughtSuffix}`:` ${r.learningPath.roleSkillTaughtSuffix}`]},z)})})]}):l.jsxs("div",{className:J.skillsCovered,children:[l.jsx("span",{className:J.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:J.emptyHint,children:r.learningPath.skillsCoveredDescription}),V.length>0&&l.jsx("div",{className:J.chips,children:V.map(z=>l.jsx("span",{className:J.chip,children:x(z)},z))}),V.length===0&&l.jsx("span",{className:J.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:J.assessmentsCard,children:[l.jsx("span",{className:J.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:J.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:J.assessmentSlots,children:[l.jsx(wc,{slot:"pre",isEditable:f}),l.jsx(wc,{slot:"post",isEditable:f})]}),P.length>0&&l.jsx("span",{className:J.warnHint,role:"status",children:r.learningPath.priorAssessmentMissingRoleSkills.replace("{skills}",P.map(x).join(", "))})]})]}),b&&l.jsxs("div",{className:J.skillsCovered,children:[l.jsx("span",{className:J.heading,children:r.learningPath.skillsHeading}),l.jsx("span",{className:J.emptyHint,children:r.learningPath.levelSkillsFromCoursesNote}),A.length>0?l.jsx("div",{className:J.chips,children:A.map(z=>l.jsx("span",{className:B.includes(z)?[J.chip,J.chipWarn].join(" "):J.chip,children:x(z)},z))}):l.jsx("span",{className:J.emptyHint,children:r.learningPath.levelSkillsEmpty}),B.length>0&&l.jsx("span",{className:J.warnHint,role:"status",children:r.learningPath.levelSkillsOutsidePrior.replace("{skills}",B.map(x).join(", "))})]}),b&&l.jsxs("div",{className:J.coursesCard,children:[l.jsx("h3",{className:J.coursesCardTitle,children:r.learningPath.coursesCardHeading}),l.jsx("p",{className:J.coursesCardDescription,children:r.learningPath.coursesCardDescription}),me.length>0?l.jsx(Bi,{sensors:ne,collisionDetection:Cd,onDragEnd:W,children:l.jsx(wm,{items:me.map(z=>z.id),strategy:bm,children:l.jsx("div",{className:J.coursesList,role:"list",children:me.map(z=>l.jsx(EI,{item:z,onRemove:ve,isEditable:f,notTeachingRole:hl(ro(z,T==null?void 0:T.code,E),D).length>0},z.id))})})}):l.jsx("span",{className:J.emptyHint,children:r.learningPath.coursesEmptyHint}),l.jsxs("button",{type:"button",className:[J.addRow,J.addRowAssessment,S?J.addRowActive:""].filter(Boolean).join(" "),disabled:!f,onClick:()=>C(null),"aria-pressed":S,children:[l.jsx("span",{className:J.addRowIcon,children:l.jsx(Rr,{size:16})}),l.jsx("span",{className:J.addRowText,children:r.learningPath.addCourseToLevelButton})]}),l.jsx(kI,{levelId:n,isEditable:f})]}),!p&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:J.header,children:[l.jsx("span",{className:J.heading,children:r.unitContentList.heading}),l.jsx("span",{className:J.count,children:u.length})]}),u.length>0?l.jsx(Bi,{sensors:ne,collisionDetection:Cd,onDragEnd:W,children:l.jsx(wm,{items:u.map(z=>z.id),strategy:bm,children:l.jsx("div",{className:J.list,role:"list",children:u.map(z=>l.jsx(_I,{item:z,onRemove:de,isEditable:f},z.id))})})}):l.jsxs("div",{className:J.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),f&&!st(g)&&l.jsxs("button",{className:J.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Rr,{size:14})," ",r.unitContentList.addContent]})]})]}):null},Em={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},II=({isActive:e,label:t,nodeId:r,className:n})=>{const o=ue(),s=t??o.dropZone.dropHere;return l.jsx("div",{className:`${Em.dropZone} ${e?Em.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":s,role:"region",children:l.jsx("span",{children:s})})},_c=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function Am(e){var a;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((a=(await Ve.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??_c}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:a.result)??{},o=new Set(["count","facets"]);return{content:Object.entries(n).filter(([i])=>!o.has(i)).flatMap(([,i])=>Array.isArray(i)?i:[]),count:n.count??0}}async function Im(e,t){var o,s;const r=t!=null&&t.length?`?fields=${t.join(",")}`:"";return(s=(o=(await Ve.get(`/action/content/v3/read/${e}${r}`)).data)==null?void 0:o.result)==null?void 0:s.content}const Lm="application/vnd.sunbird.question";function Dm(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Nm(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const o=Nm(n,t,e);if(o)return o}return null}function LI(e,t){const r=Nm(e,t);if(!r)return null;const{question:n,parent:o}=r,s={...e,children:[n],childNodes:[t],shuffle:o==null?void 0:o.shuffle,showSolutions:(o==null?void 0:o.showSolutions)??"No",showFeedback:(o==null?void 0:o.showFeedback)??"No"};return(o==null?void 0:o.shuffle)===!0?s.maxScore=1:n.qType==="SA"?delete s.maxScore:n.maxScore!=null&&(s.maxScore=n.maxScore),s}function DI(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return Ur({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await sf(e),o=u=>{if(!u)return[];const f=u.mimeType===Lm&&u.identifier?[u.identifier]:[],g=(u.children??[]).flatMap(o);return[...f,...g]},s=o(n),a=new Map;s.length&&(await gw(s)).forEach(f=>{const g=f.identifier;g&&a.set(g,f)});const i=u=>{if(!u)return u;if(u.mimeType===Lm&&u.identifier){const f=a.get(u.identifier)??u,g=f.outcomeDeclaration;return g!=null&&g.maxScore||(f.outcomeDeclaration={...g??{},maxScore:Dm(f)}),f}return Array.isArray(u.children)&&(u.children=u.children.map(f=>i(f))),u},c=i(n),d=c.outcomeDeclaration;return d!=null&&d.maxScore||(c.outcomeDeclaration={...d??{},maxScore:Dm(c)}),c}})}const Om="/assets/quml-player/sunbird-quml-player.js",NI="/assets/quml-player/styles.css",Pm="sunbird-quml-player";function OI(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const wt=class wt{constructor(){Ns(this,"eventHandlers",new WeakMap)}loadScript(){return wt.scriptLoaded||customElements.get(Pm)?(wt.scriptLoaded=!0,Promise.resolve()):(wt.scriptLoading||(wt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Om,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{wt.scriptLoaded=!0,wt.scriptLoading=void 0,t()},n.onerror=()=>{wt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Om}`))},document.body.appendChild(n)})),wt.scriptLoading)}loadStyles(){if(wt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){wt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=NI,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),wt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),wt.stylesLoaded=!1}async createConfig(t,r,n){var s,a,i;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((s=r==null?void 0:r.pdata)==null?void 0:s.id)??"sunbird.portal",ver:((a=r==null?void 0:r.pdata)==null?void 0:a.ver)??"1.0",pid:((i=r==null?void 0:r.pdata)==null?void 0:i.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:OI(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Pm);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const o=a=>r==null?void 0:r(a),s=a=>n==null?void 0:n(a.detail);t.addEventListener("playerEvent",o),t.addEventListener("telemetryEvent",s),this.eventHandlers.set(t,{player:o,telemetry:s})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};Ns(wt,"scriptLoaded",!1),Ns(wt,"scriptLoading"),Ns(wt,"stylesLoaded",!1);let ni=wt;const oi=new ni,Xe={contentPlayerRoot:"_contentPlayerRoot_r6xk8_1",flowLayout:"_flowLayout_r6xk8_9",stage:"_stage_r6xk8_13",aspectRatio:"_aspectRatio_r6xk8_16",playerHeader:"_playerHeader_r6xk8_32",playerHeaderThumb:"_playerHeaderThumb_r6xk8_46",playerHeaderTitle:"_playerHeaderTitle_r6xk8_56",typeBadge:"_typeBadge_r6xk8_66",typeDot:"_typeDot_r6xk8_105",playerFrame:"_playerFrame_r6xk8_125",coverOverlay:"_coverOverlay_r6xk8_133",coverHidden:"_coverHidden_r6xk8_145",coverThumb:"_coverThumb_r6xk8_150",coverPlayRing:"_coverPlayRing_r6xk8_159",coverPlayIcon:"_coverPlayIcon_r6xk8_172",coverLabel:"_coverLabel_r6xk8_181",coverSkeleton:"_coverSkeleton_r6xk8_187",playerWrapper:"_playerWrapper_r6xk8_213",infoStrip:"_infoStrip_r6xk8_223",infoChip:"_infoChip_r6xk8_239",infoChipLabel:"_infoChipLabel_r6xk8_258",infoChipIcon:"_infoChipIcon_r6xk8_267",playerError:"_playerError_r6xk8_273",playerErrorIcon:"_playerErrorIcon_r6xk8_287",playerErrorMsg:"_playerErrorMsg_r6xk8_292",qumlRoot:"_qumlRoot_r6xk8_299"},PI="application/vnd.sunbird.questionset",xI="application/vnd.ekstep.ecml-archive";function FI(e,t){const r=new Map,n=s=>{for(const a of s)r.set(a.id,a),a.children&&n(a.children)};n(e);let o=r.get(t);for(;o;){if(o.mimeType===PI)return o.identifier;o=o.parent?r.get(o.parent):void 0}return null}const MI=[{key:"video",mimes:["video/mp4","video/webm","video/ogg"]},{key:"audio",mimes:["audio/mp3","audio/mpeg","audio/ogg","audio/wav"]},{key:"pdf",mimes:["application/pdf"]},{key:"epub",mimes:["application/epub"]},{key:"ecml",mimes:["application/vnd.ekstep.ecml-archive"]},{key:"h5p",mimes:["application/vnd.ekstep.h5p-archive"]},{key:"scorm",mimes:["application/vnd.ekstep.content-collection"]}];function BI(e){return MI.find(t=>t.mimes.includes(e))??{key:"other"}}function $I(e,t){switch(e){case"video":return t.contentPlayer.mimeLabelVideo;case"audio":return t.contentPlayer.mimeLabelAudio;case"pdf":return t.contentPlayer.mimeLabelPdf;case"epub":return t.contentPlayer.mimeLabelEpub;case"ecml":return t.contentPlayer.mimeLabelEcml;case"h5p":return t.contentPlayer.mimeLabelH5p;case"scorm":return t.contentPlayer.mimeLabelScorm;default:return t.contentPlayer.mimeLabelOther}}const qI={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},jI={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},UI={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},HI="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Tc(e){for(const[t,r]of Object.entries(qI))if(r.includes(e))return t;return"default-player"}function VI(e,t,r){var s;const n=r==null?void 0:r.context,o=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((s=n==null?void 0:n.pdata)==null?void 0:s.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/content-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:o==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function zI(e){return document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(n)})}async function RI(e,t,r=100){await zI(jI[t]??""),!customElements.get(e)&&await new Promise((n,o)=>{let s=0;const a=setInterval(()=>{s++,customElements.get(e)?(clearInterval(a),n()):s>=r&&(clearInterval(a),o(new Error(`Custom element <${e}> did not register`)))},100)})}const QI=[{key:"author",icon:Zb},{key:"license",icon:Vb},{key:"language",icon:xb},{key:"gradeLevel",icon:zb},{key:"subject",icon:Nr},{key:"contentType",icon:Kb}];function WI(e,t){switch(e){case"author":return t.contentPlayer.infoFieldAuthor;case"license":return t.contentPlayer.infoFieldLicense;case"language":return t.contentPlayer.infoFieldLanguage;case"gradeLevel":return t.contentPlayer.infoFieldClass;case"subject":return t.contentPlayer.infoFieldSubject;case"contentType":return t.contentPlayer.infoFieldType;default:return e}}function GI({node:e}){const t=ue(),r=e.metadata??{},n=QI.flatMap(o=>{const s=r[o.key];if(!s)return[];const a=Array.isArray(s)?s.join(", "):String(s);return a?[{...o,label:WI(o.key,t),val:a}]:[]});return n.length?l.jsx("div",{className:Xe.infoStrip,children:n.map(o=>l.jsxs("div",{className:Xe.infoChip,children:[o.icon&&l.jsx(o.icon,{size:13,className:Xe.infoChipIcon}),l.jsx("span",{className:Xe.infoChipLabel,children:o.label}),o.val]},o.key))}):null}function xm({node:e,hidden:t}){var o;const r=ue(),n=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return l.jsx("div",{className:`${Xe.coverOverlay} ${t?Xe.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:Xe.coverThumb}),l.jsx("div",{className:Xe.coverPlayRing,children:l.jsx("div",{className:Xe.coverPlayIcon})}),l.jsx("span",{className:Xe.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:Xe.coverSkeleton})})}function Fm({message:e}){return l.jsxs("div",{className:Xe.playerError,children:[l.jsx(Yb,{size:28,className:Xe.playerErrorIcon}),l.jsx("span",{className:Xe.playerErrorMsg,children:e})]})}function KI({mimeType:e}){const t=ue(),r=BI(e);return l.jsxs("span",{className:Xe.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:Xe.typeDot}),$I(r.key,t)]})}const kc=({node:e,editorMode:t,type:r,singleQuestion:n,layout:o="fill"})=>{var a;if(r==="quml")return l.jsx(ZI,{node:e,editorMode:t,singleQuestion:!!n});const s=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return l.jsxs("div",{className:`${Xe.contentPlayerRoot} ${o==="flow"?Xe.flowLayout:""}`,children:[l.jsxs("div",{className:Xe.stage,children:[l.jsxs("div",{className:Xe.playerHeader,children:[s&&l.jsx("img",{src:s,alt:"",className:Xe.playerHeaderThumb}),l.jsx("span",{className:Xe.playerHeaderTitle,children:e.name}),l.jsx(KI,{mimeType:e.mimeType??""})]}),l.jsx(YI,{node:e})]}),l.jsx(GI,{node:e})]})};function YI({node:e}){var y;const t=ue(),r=Z(C=>C.editorConfig),[n,o]=h.useState(()=>Tc(e.mimeType??"")),[s,a]=h.useState(!1),[i,c]=h.useState(null),[d,u]=h.useState(e.metadata??{}),[f,g]=h.useState(!1),p=h.useRef(null),b=h.useRef(null),m=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??HI;h.useEffect(()=>{let C=!1;return g(!1),a(!1),c(null),u(e.metadata??{}),o(Tc(e.mimeType??"")),Im(e.identifier).then(async S=>{if((S.mimeType??e.mimeType??"")!==xI||S.body)return S;const _=await Im(e.identifier,["body"]).catch(()=>{});return _!=null&&_.body?{...S,body:_.body}:S}).then(S=>{if(C)return;const w={...e.metadata??{},...S};u(w);const _=S.mimeType??e.mimeType??"";o(Tc(_)),g(!0)}).catch(()=>{C||g(!0)}),()=>{C=!0}},[e.identifier]);const v=VI(e,d,r);return h.useEffect(()=>{if(!f||n!=="default-player")return;const C=p.current;if(!C)return;C.src=m;const S=()=>{try{const _=C.contentWindow;if(typeof(_==null?void 0:_.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}_.initializePreview(v),setTimeout(()=>a(!0),300)}catch(_){console.error("[ContentPlayer] initializePreview failed",_),c(t.contentPlayer.failedToInitializePlayer)}},w=()=>c(t.contentPlayer.previewPlayerLoadFailed);return C.addEventListener("load",S),C.addEventListener("error",w),()=>{C.removeEventListener("load",S),C.removeEventListener("error",w),C.src=""}},[e.identifier,n,m,f,t]),h.useEffect(()=>{if(!f||n==="default-player")return;const C=b.current;if(!C)return;const S=UI[n];if(!S)return;const w=v;RI(S,n).then(()=>{if(!b.current)return;if(!customElements.get(S)){o("default-player");return}const _=document.createElement(S);_.setAttribute("player-config",JSON.stringify(w)),_.addEventListener("playerEvent",()=>{}),_.addEventListener("telemetryEvent",()=>{}),C.innerHTML="",C.appendChild(_),setTimeout(()=>{try{_.playerConfig=w}catch{}a(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),o("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:Xe.aspectRatio,children:[i?l.jsx(Fm,{message:i}):l.jsx(xm,{node:e,hidden:s}),n==="default-player"?l.jsx("iframe",{ref:p,id:"contentPlayer",title:e.name,className:Xe.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:b,className:Xe.playerFrame})]})}function ZI({node:e,editorMode:t,singleQuestion:r}){const n=ue(),o=Z(p=>p.editorConfig),s=ae(p=>p.treeData),a=h.useRef(null),i=r?FI(s,e.id):e.identifier,{data:c,isLoading:d,error:u}=DI(i??"",{enabled:!!i}),f=h.useMemo(()=>c?r?LI(c,e.identifier):c:null,[c,r,e.identifier]);h.useEffect(()=>{const p=a.current;if(!p||!f)return;let b=null,m=!1;return(async()=>{try{const v=await oi.createConfig(f,o==null?void 0:o.context,{mode:t==="edit"?"edit":"play"});if(m||!a.current)return;const y=oi.createElement(v);b=y,oi.attachEventListeners(y,C=>console.debug("[QumlPlayer] playerEvent",C.detail),C=>console.debug("[QumlPlayer] telemetryEvent",C)),p.innerHTML="",p.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{m=!0,b&&(oi.removeEventListeners(b),b.remove()),ni.unloadStyles()}},[f,o,t,r]);const g=u?`${n.contentPlayer.unableToLoadQuestionset} ${u.message}`:r&&!i?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:Xe.qumlRoot,children:[g?l.jsx(Fm,{message:g}):d||!f?l.jsx(xm,{node:e,hidden:!1}):null,l.jsx("div",{ref:a,className:Xe.playerWrapper})]})}const mr={overlay:"_overlay_ifddx_1",modal:"_modal_ifddx_11",header:"_header_ifddx_21",body:"_body_ifddx_37",hint:"_hint_ifddx_43",list:"_list_ifddx_49",item:"_item_ifddx_55",selected:"_selected_ifddx_68",empty:"_empty_ifddx_73",footer:"_footer_ifddx_79",cancelBtn:"_cancelBtn_ifddx_87",moveBtn:"_moveBtn_ifddx_95"};function XI(e,t,r){const n=[],o=s=>{var a;for(const i of s)i.isFolder&&i.id!==r&&i.id!==t&&n.push(i),(a=i.children)!=null&&a.length&&o(i.children)};return o(e),n}const JI=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const o=ue(),{treeData:s,moveNode:a}=ae(),i=XI(s,((f=s[0])==null?void 0:f.id)??"",r),[c,d]=h.useState(null),u=()=>{c&&(a(e,r,c),n())};return l.jsx("div",{className:mr.overlay,role:"dialog","aria-label":o.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:mr.modal,children:[l.jsxs("div",{className:mr.header,children:[l.jsxs("span",{children:[o.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":o.resourceReorderDialog.closeAriaLabel,children:l.jsx(Or,{size:16})})]}),l.jsxs("div",{className:mr.body,children:[l.jsx("p",{className:mr.hint,children:o.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:mr.list,children:[i.map(g=>l.jsxs("li",{className:`${mr.item} ${c===g.id?mr.selected:""}`,onClick:()=>d(g.id),children:[l.jsx(Pb,{size:14}),l.jsx("span",{children:g.name})]},g.id)),i.length===0&&l.jsx("li",{className:mr.empty,children:o.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:mr.footer,children:[l.jsx("button",{className:mr.cancelBtn,onClick:n,children:o.resourceReorderDialog.cancelButton}),l.jsx("button",{className:mr.moveBtn,onClick:u,disabled:!c,children:o.resourceReorderDialog.moveButton})]})]})})},xr={overlay:"_overlay_16at9_1",modal:"_modal_16at9_11",header:"_header_16at9_21",body:"_body_16at9_37",table:"_table_16at9_43",pageInput:"_pageInput_16at9_61",empty:"_empty_16at9_68",footer:"_footer_16at9_74",cancelBtn:"_cancelBtn_16at9_82",saveBtn:"_saveBtn_16at9_90"};function eL(e){const t=[],r=n=>{var o;for(const s of n)!s.isFolder&&(!s.children||s.children.length===0)?t.push(s):(o=s.children)!=null&&o.length&&r(s.children)};return r(e),t}const tL=({onClose:e})=>{const t=ue(),{treeData:r,updateNode:n}=ae(),o=eL(r),[s,a]=h.useState(()=>Object.fromEntries(o.map(c=>{var d;return[c.id,String(((d=c.metadata)==null?void 0:d.pageNumber)??"")]}))),i=h.useCallback(()=>{for(const[c,d]of Object.entries(s))d!==""&&n(c,{pageNumber:parseInt(d,10)||void 0});e()},[s,n,e]);return l.jsx("div",{className:xr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:xr.modal,children:[l.jsxs("div",{className:xr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(Or,{size:16})})]}),l.jsx("div",{className:xr.body,children:o.length===0?l.jsx("p",{className:xr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:xr.table,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),l.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),l.jsx("tbody",{children:o.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:s[c.id]??"",onChange:d=>a(u=>({...u,[c.id]:d.target.value})),className:xr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:xr.footer,children:[l.jsx("button",{className:xr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:xr.saveBtn,onClick:i,children:[l.jsx(Hb,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},ot={container:"_container_1a7t2_1",panelHeader:"_panelHeader_1a7t2_10",panelHeaderLeft:"_panelHeaderLeft_1a7t2_19",panelCollapseBtn:"_panelCollapseBtn_1a7t2_27",titleRow:"_titleRow_1a7t2_46",field:"_field_1a7t2_47",moveBtn:"_moveBtn_1a7t2_64",icon:"_icon_1a7t2_84",nameInput:"_nameInput_1a7t2_93",fieldHeader:"_fieldHeader_1a7t2_118",label:"_label_1a7t2_124",fieldCount:"_fieldCount_1a7t2_133",chips:"_chips_1a7t2_170",chip:"_chip_1a7t2_170",chipRemove:"_chipRemove_1a7t2_188",keywordInput:"_keywordInput_1a7t2_202",input:"_input_1a7t2_207",addBtn:"_addBtn_1a7t2_220",radioGroup:"_radioGroup_1a7t2_234",radioLabel:"_radioLabel_1a7t2_239"},rL=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var F,M;const{updateNode:o,markDirty:s}=ae(),a=t==="edit",i=hs(e),c=ue(),d=Z(P=>P.relationalFormConfig),u=P=>d==null?void 0:d.find(V=>V.code===P),f=P=>!d||!!u(P),g=(P,V)=>{var ne;return((ne=u(P))==null?void 0:ne.label)||V},[p,b]=h.useState(!0),m=((F=e.metadata)==null?void 0:F.relationalMetadata)??{},[v,y]=h.useState(m.name??e.name??""),[C,S]=h.useState(""),[w,_]=h.useState(Array.isArray(m.keywords)?m.keywords:Array.isArray((M=e.metadata)==null?void 0:M.keywords)?e.metadata.keywords:[]),[T,E]=h.useState(!!m.optional);h.useEffect(()=>{var V,ne;const P=((V=e.metadata)==null?void 0:V.relationalMetadata)??{};y(P.name??e.name??""),_(Array.isArray(P.keywords)?P.keywords:Array.isArray((ne=e.metadata)==null?void 0:ne.keywords)?e.metadata.keywords:[]),E(!!P.optional)},[e.id]);const A=()=>{v.trim()&&v!==e.name&&(o(e.id,{name:v.trim()}),s())},x=()=>{const P=C.trim();if(P&&!w.includes(P)){const V=[...w,P];_(V),o(e.id,{keywords:V}),s()}S("")},B=P=>{const V=w.filter(ne=>ne!==P);_(V),o(e.id,{keywords:V}),s()},D=P=>{E(P),o(e.id,{optional:P}),s()};return l.jsxs("div",{className:ot.container,children:[l.jsxs("div",{className:ot.panelHeader,children:[l.jsxs("div",{className:ot.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${i.key}`,children:i.label}),a&&l.jsx("button",{type:"button",className:ot.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:ot.panelCollapseBtn,onClick:()=>b(P=>!P),"aria-expanded":p,"aria-label":p?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:p?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:p?l.jsx(rn,{size:15}):l.jsx(Ib,{size:15})})]}),p&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ot.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:ot.icon}),l.jsx("input",{type:"text",className:ot.nameInput,value:v,disabled:!a,onChange:P=>y(P.target.value),onBlur:A,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:ot.field,children:[l.jsx("div",{className:ot.fieldHeader,children:l.jsxs("label",{className:ot.label,children:[g("keywords",c.contentEditForm.keywordsLabel),w.length>0&&l.jsx("span",{className:ot.fieldCount,children:w.length})]})}),w.length>0&&l.jsx("div",{className:ot.chips,children:w.map(P=>l.jsxs("span",{className:ot.chip,children:[P,a&&l.jsx("button",{type:"button",className:ot.chipRemove,onClick:()=>B(P),children:"×"})]},P))}),a&&l.jsxs("div",{className:ot.keywordInput,children:[l.jsx("input",{type:"text",className:ot.input,value:C,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:P=>S(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),x())}}),l.jsx("button",{type:"button",className:ot.addBtn,onClick:x,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:ot.field,children:[l.jsx("label",{className:ot.label,children:g("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:ot.radioGroup,children:[l.jsxs("label",{className:ot.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:T===!0,onChange:()=>D(!0),disabled:!a}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:ot.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:T===!1,onChange:()=>D(!1),disabled:!a}),c.contentEditForm.noOption]})]})]})]}),n]})},ws={iconBtn:"_iconBtn_64kgu_1",editable:"_editable_64kgu_14",iconImg:"_iconImg_64kgu_26",placeholder:"_placeholder_64kgu_34",removeBtn:"_removeBtn_64kgu_41"},nL=({nodeId:e,value:t,editable:r})=>{const[n,o]=h.useState(!1),{updateNode:s,markDirty:a}=ae(),i=ue(),c=u=>{s(e,{appIcon:u}),a(),o(!1)},d=u=>{u.stopPropagation(),s(e,{appIcon:""}),a()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[ws.iconBtn,r?ws.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?i.titleAppIcon.selectAppIconAriaLabel:i.titleAppIcon.appIconAriaLabel,onClick:()=>r&&o(!0),onKeyDown:u=>{r&&(u.key==="Enter"||u.key===" ")&&o(!0)},children:[t?l.jsx("img",{src:t,alt:i.titleAppIcon.appIconAlt,className:ws.iconImg}):l.jsx("div",{className:ws.placeholder,children:l.jsx(tu,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:ws.removeBtn,onClick:d,"aria-label":i.titleAppIcon.removeIconAriaLabel,children:l.jsx(Yn,{size:11})})]}),n&&l.jsx(pm,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>o(!1)})]})},ze={courseDetails:"_courseDetails_pkcf3_1",courseDetailsLoading:"_courseDetailsLoading_pkcf3_7",courseDetailsError:"_courseDetailsError_pkcf3_7",detailsCard:"_detailsCard_pkcf3_12",unitsCard:"_unitsCard_pkcf3_12",cardTitle:"_cardTitle_pkcf3_22",fieldGroup:"_fieldGroup_pkcf3_29",fieldGroupLast:"_fieldGroupLast_pkcf3_33",fieldLabel:"_fieldLabel_pkcf3_37",fieldValue:"_fieldValue_pkcf3_47",fieldValueMultiline:"_fieldValueMultiline_pkcf3_52",unitsLabel:"_unitsLabel_pkcf3_58",unitsDescription:"_unitsDescription_pkcf3_68",unitList:"_unitList_pkcf3_74",unitCard:"_unitCard_pkcf3_80",unitHeader:"_unitHeader_pkcf3_86",unitIcon:"_unitIcon_pkcf3_99",unitTitle:"_unitTitle_pkcf3_111",unitCount:"_unitCount_pkcf3_120",unitBody:"_unitBody_pkcf3_126",unitDescription:"_unitDescription_pkcf3_131",unitKeywords:"_unitKeywords_pkcf3_138",keywordPill:"_keywordPill_pkcf3_145",unitTopicsRow:"_unitTopicsRow_pkcf3_155",unitContents:"_unitContents_pkcf3_167",contentRow:"_contentRow_pkcf3_174",contentIcon:"_contentIcon_pkcf3_180",contentTitle:"_contentTitle_pkcf3_185",contentSkills:"_contentSkills_pkcf3_193",skillPill:"_skillPill_pkcf3_200"},oL={video:ia,pdf:Ko,h5p:ra,scorm:sa,audio:oa,quiz:ta,course:Nr,default:nn};function Ec(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const Mm=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const o=ue(),s=_r(),[a,i]=h.useState(null),[c,d]=h.useState(""),[u,f]=h.useState(null),[g,p]=h.useState({}),b=t==="full";h.useEffect(()=>{let C=!1;return i(null),d(""),f(null),Cw(e).then(S=>{if(C)return;const _=(S.children??[]).map(T=>Sa(T));i(_),d(S.description??""),p(Object.fromEntries(_.map(T=>[T.id,!0]))),n==null||n({totalContents:_.reduce((T,E)=>{var A;return T+(((A=E.children)==null?void 0:A.length)??0)},0)})}).catch(()=>{C||f(o.learningPath.courseDetailsError)}),()=>{C=!0}},[e,o.learningPath.courseDetailsError]);const m=C=>p(S=>({...S,[C]:!S[C]})),v=C=>{var S;return s?Ec((S=C.metadata)==null?void 0:S[s.code]).map(w=>wa(w,s.terms)):[]},y=C=>(C===1?o.learningPath.contentCountLabel:o.learningPath.contentCountLabelPlural).replace("{count}",String(C));return l.jsx("div",{className:ze.courseDetails,children:u?l.jsx("p",{className:ze.courseDetailsError,children:u}):a===null?l.jsx("p",{className:ze.courseDetailsLoading,children:o.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[b&&l.jsxs("div",{className:ze.detailsCard,children:[l.jsx("h3",{className:ze.cardTitle,children:o.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:ze.fieldGroup,children:[l.jsx("span",{className:ze.fieldLabel,children:o.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:ze.fieldValue,children:r})]}),l.jsxs("div",{className:ze.fieldGroupLast,children:[l.jsx("span",{className:ze.fieldLabel,children:o.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:ze.fieldValueMultiline,children:c||o.learningPath.noCourseDescriptionPlaceholder})]})]}),a.length===0?l.jsx("p",{className:ze.courseDetailsLoading,children:o.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:b?ze.unitsCard:void 0,children:[l.jsx("span",{className:ze.unitsLabel,children:o.learningPath.unitsSectionLabel}),b&&l.jsx("p",{className:ze.unitsDescription,children:o.learningPath.unitsSectionDescription}),l.jsx("div",{className:ze.unitList,children:a.map(C=>{var E,A;const S=!!g[C.id],w=(C.children??[]).length,_=Ec((E=C.metadata)==null?void 0:E.keywords),T=Ec((A=C.metadata)==null?void 0:A.topic);return l.jsxs("div",{className:ze.unitCard,children:[l.jsxs("button",{type:"button",className:ze.unitHeader,onClick:()=>m(C.id),"aria-expanded":S,children:[S?l.jsx(rn,{size:17}):l.jsx(ea,{size:17}),l.jsx("span",{className:ze.unitIcon,children:l.jsx(eu,{size:16})}),l.jsx("span",{className:ze.unitTitle,children:C.name}),b&&l.jsx("span",{className:ze.unitCount,children:y(w)})]}),S&&l.jsxs("div",{className:ze.unitBody,children:[b&&C.description&&l.jsx("p",{className:ze.unitDescription,children:C.description}),b&&_.length>0&&l.jsx("div",{className:ze.unitKeywords,children:_.map(x=>l.jsx("span",{className:ze.keywordPill,children:x},x))}),b&&T.length>0&&l.jsxs("div",{className:ze.unitTopicsRow,children:[l.jsx("span",{className:ze.fieldLabel,children:o.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:T.join(", ")})]}),l.jsx("div",{className:ze.unitContents,children:(C.children??[]).map(x=>{const B=hs(x),D=oL[B.key]??nn,F=v(x);return l.jsxs("div",{className:ze.contentRow,children:[l.jsx(D,{size:16,className:ze.contentIcon}),l.jsx("span",{className:ze.contentTitle,children:x.name}),F.length>0&&l.jsx("div",{className:ze.contentSkills,children:F.map(M=>l.jsx("span",{className:ze.skillPill,children:M},M))})]},x.id)})})]})]},C.id)})})]})]})})},Fe={backToPathButton:"_backToPathButton_1u4o4_1",assessmentTitle:"_assessmentTitle_1u4o4_15",slotPills:"_slotPills_1u4o4_22",slotPill:"_slotPill_1u4o4_22",slotPillHint:"_slotPillHint_1u4o4_40",slotPillPurpose:"_slotPillPurpose_1u4o4_45",slotPillWarning:"_slotPillWarning_1u4o4_51",slotPillPrimary:"_slotPillPrimary_1u4o4_56",courseCard:"_courseCard_1u4o4_62",courseCardHeading:"_courseCardHeading_1u4o4_72",courseCardDescription:"_courseCardDescription_1u4o4_79",courseNotAdded:"_courseNotAdded_1u4o4_85",assessmentExplainer:"_assessmentExplainer_1u4o4_93",assessmentExplainerHeading:"_assessmentExplainerHeading_1u4o4_107",leafContentLayout:"_leafContentLayout_1u4o4_117",container:"_container_1u4o4_131",emptyState:"_emptyState_1u4o4_140",titleRow:"_titleRow_1u4o4_150",titleRowLp:"_titleRowLp_1u4o4_157",nodeTitle:"_nodeTitle_1u4o4_171",nodeTitleLpRoot:"_nodeTitleLpRoot_1u4o4_193",nodeTitleSub:"_nodeTitleSub_1u4o4_198",courseDetailHeader:"_courseDetailHeader_1u4o4_203",courseDetailIcon:"_courseDetailIcon_1u4o4_210",courseDetailTitle:"_courseDetailTitle_1u4o4_222",courseDetailMeta:"_courseDetailMeta_1u4o4_229",formArea:"_formArea_1u4o4_234",contentListArea:"_contentListArea_1u4o4_238",contentListAreaLp:"_contentListAreaLp_1u4o4_242",dropZone:"_dropZone_1u4o4_246",reviewComment:"_reviewComment_1u4o4_253",reviewCommentLabel:"_reviewCommentLabel_1u4o4_266",reviewCommentText:"_reviewCommentText_1u4o4_272"},sL=({slot:e,isEditable:t})=>{var p;const r=ue(),n=ae(b=>b.treeData),o=ae(b=>b.selectNode),s=(p=n[0])==null?void 0:p.id,{pre:a,post:i}=rc(),c=(e==="pre"?a:i).filled,d=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,u=e==="pre"?zr:Eb,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,g=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:Fe.container,children:[l.jsxs("button",{type:"button",className:Fe.backToPathButton,onClick:()=>s&&o(s),children:[l.jsx($i,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:Fe.assessmentTitle,children:d}),l.jsx("div",{className:Fe.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Fe.slotPill} ${Fe.slotPillHint}`,children:[l.jsx(Xd,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${Fe.slotPill} ${Fe.slotPillPurpose}`,children:[l.jsx(Tb,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Fe.slotPill} ${Fe.slotPillWarning}`,children:[l.jsx(ru,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${Fe.slotPill} ${Fe.slotPillPrimary}`,children:[l.jsx(Xd,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:Fe.formArea,children:[l.jsxs("div",{className:Fe.courseCard,children:[l.jsx("div",{className:Fe.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:Fe.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(wc,{slot:e,isEditable:t}):l.jsx("div",{className:Fe.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:Fe.assessmentExplainer,children:[l.jsxs("div",{className:Fe.assessmentExplainerHeading,children:[l.jsx(u,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:g})]})]})]})},aL="application/vnd.sunbird.questionset",Bm="application/vnd.sunbird.question",iL=[aL,Bm];function $m(e){var t,r;if(!(!e||e.status!=="Draft"||((t=e.metadata)==null?void 0:t.prevStatus)!=="Review"))return(r=e.metadata)==null?void 0:r.rejectComment}const lL=({editorMode:e,onToolbarEvent:t})=>{var ve,me,z,Ce,ke;const r=ue(),[n,o]=h.useState("details"),[s,a]=h.useState([]),[i,c]=h.useState(null),[d,u]=h.useState(!1),[f,g]=h.useState(null),p=h.useRef(null),b=h.useRef(),{selectedNodeId:m,breadcrumb:v,activeNodeMeta:y,updateNode:C,treeData:S,selectNode:w}=ae(),_=lt(U=>U.activeAssessmentSlot),T=Z(U=>{var q,le,ge,ee;return((le=(q=U.editorConfig)==null?void 0:q.context)==null?void 0:le.contentId)??((ee=(ge=U.editorConfig)==null?void 0:ge.context)==null?void 0:ee.identifier)??""}),E=Z(U=>U.editorProfile.competencyScoped),A=m?qm(S,m):null;h.useEffect(()=>{g(null)},[A==null?void 0:A.identifier]);const x=!!A&&!A.parent,B=!!(A!=null&&A.isFolder),D=A&&iL.includes(A.mimeType??""),F=(A==null?void 0:A.mimeType)===Bm,M=A&&!A.isFolder&&!D&&!x,V=E&&B&&st(A??void 0)?((z=(me=(ve=S[0])==null?void 0:ve.children)==null?void 0:me[0])==null?void 0:z.id)===(A==null?void 0:A.id)?"pre":"post":E?_:null,ne=$m(A)??(x?$m(S[0]):void 0),W=h.useCallback(()=>{const U=p.current;if(!U||!m)return;const q=U.innerText.trim();clearTimeout(b.current),b.current=setTimeout(()=>{C(m,{name:q})},600)},[m,C]),de=h.useCallback(U=>{t({action:"onFormValueChange",data:U})},[t]),ie=h.useCallback((U,q)=>{a(q),t({action:"onFormStatusChange",data:{isValid:U,nodeId:m}})},[t,m]);if(!A)return l.jsx("div",{className:Fe.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(D)return l.jsx(kc,{node:A,editorMode:e,type:"quml",singleQuestion:F});if(E&&M&&(A.primaryCategory==="Course"||no(A))){const U=A.parent?Iw(((Ce=S[0])==null?void 0:Ce.children)??[],A.parent):null,q=(U==null?void 0:U.role)==="pre"?r.learningPath.priorAssessmentLabel:(U==null?void 0:U.role)==="post"?r.learningPath.outcomeAssessmentLabel:(U==null?void 0:U.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String(U.levelNumber)):null,le=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:Fe.container,children:[l.jsxs("button",{type:"button",className:Fe.backToPathButton,onClick:()=>A.parent&&w(A.parent),children:[l.jsx($i,{size:14}),q?r.learningPath.backToLevelButton.replace("{label}",q):r.learningPath.backToPathButton]}),l.jsxs("div",{className:Fe.courseDetailHeader,children:[l.jsx("span",{className:Fe.courseDetailIcon,children:l.jsx(Nr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:Fe.courseDetailTitle,children:A.name}),l.jsxs("span",{className:Fe.courseDetailMeta,children:[A.primaryCategory,le]})]})]}),l.jsx(Mm,{courseId:A.identifier,variant:"full",title:A.name,onLoaded:({totalContents:ge})=>g(ge)},A.identifier)]})}return V?l.jsx(sL,{slot:V,isEditable:e==="edit"}):M?l.jsxs("div",{className:Fe.leafContentLayout,children:[l.jsx(kc,{node:A,editorMode:e,type:"content",layout:"flow"}),l.jsx(rL,{node:A,editorMode:e,onMoveClick:()=>c(A.identifier),reorderDialog:i?l.jsx(JI,{resourceId:i,resourceName:A.name,currentUnitId:A.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:Fe.container,children:[l.jsx(VE,{crumbs:v}),ne&&l.jsxs("div",{className:Fe.reviewComment,role:"alert",children:[l.jsx("span",{className:Fe.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:Fe.reviewCommentText,children:ne})]}),l.jsxs("div",{className:[Fe.titleRow,E?Fe.titleRowLp:""].filter(Boolean).join(" "),children:[x&&m&&l.jsx(nL,{nodeId:m,value:String(A.appIcon??((ke=A.metadata)==null?void 0:ke.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:p,className:[Fe.nodeTitle,E&&x?Fe.nodeTitleLpRoot:"",E&&!x?Fe.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:W,onBlur:W,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:A.name})]}),l.jsx(zE,{activeTab:n,onChange:U=>o(U),errorTabs:s,visibleTabs:x&&!E?void 0:["details"]}),l.jsx("div",{className:Fe.formArea,children:l.jsx(iI,{nodeMetadata:y,activeTab:n,isRoot:x,isFolder:B,editorMode:e,onFormValueChange:de,onFormStatusChange:ie},`${m??"none"}:${x?"root":"node"}`)}),(B||x)&&n==="details"&&l.jsx("div",{className:[Fe.contentListArea,E?Fe.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(AI,{editorMode:e,isRoot:x})}),l.jsx(II,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:m??void 0,className:Fe.dropZone}),d&&l.jsx(tL,{contentId:T,onClose:()=>u(!1)})]})};function qm(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=qm(r.children,t);if(n)return n}}}const jm=Yo((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const s=[...t().allContent,...r];e({allContent:s,totalCount:n,offset:s.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:o}=t();let s=r;if(n&&n!=="all"){const a=n.toLowerCase();s=s.filter(i=>[i.mimeType??"",i.primaryCategory??"",i.contentType??""].join(" ").toLowerCase().includes(a))}if(o&&o.trim()!==""){const a=o.toLowerCase().trim();s=s.filter(i=>(i.name??"").toLowerCase().includes(a))}e({filteredContent:s})}})),Um={isCourse:!1,frameworkId:void 0,skillField:void 0,skills:[],terms:[],ready:!1};function cL(e,t){return e?{...e.metadata??{},...t[e.id]??{}}:{}}function dL(e,t,r){return e==="learningPath"?!1:(t.primaryCategory??r)==="Course"}function uL(e,t,r){if(!e)return Um;const{usableFrameworkId:n,skillField:o,terms:s}=r;if(!n||!o)return{...Um,isCourse:!0};const a=ro(t,o,s);return{isCourse:!0,frameworkId:n,skillField:o,skills:a,terms:s,ready:a.length>0}}function Ac(){const e=Z(g=>g.editorProfile.key),t=Z(g=>{var p,b;return(b=(p=g.editorConfig)==null?void 0:p.config)==null?void 0:b.primaryCategory}),r=ae(g=>g.treeData[0]),n=ae(g=>g.treeCache),o=h.useMemo(()=>cL(r,n),[r,n]),s=dL(e,o,t),a=s?Ta(r,n):void 0,{usableFrameworkId:i,skillField:c,terms:d}=Cl(a),u=uL(s,o,{usableFrameworkId:i,skillField:c,terms:d}),f=u.skills.join("|");return h.useMemo(()=>u,[u.isCourse,u.ready,u.frameworkId,u.skillField,f,u.terms])}function fL(e,t,r,n){return{[rr]:[e],[t]:{subsetOf:_a(r,n)}}}function hL(e,t,r,n){if(e[rr]!==t)return!1;const o=e[r],s=Array.isArray(o)?o:o==null?[]:[o];if(s.length===0)return!1;const a=new Set(n);return s.every(i=>a.has(String(i)))}function pL(e,t){return e<t}function mL(e){return e.isCourse&&!e.ready?"pickSkills":null}function gL(e,t,r,n,o,s){const a={primaryCategory:[t?pl:"Course"]};if(s){if(a[rr]=[s.frameworkId],e&&s.roleSkillValues.length&&n)return a[n]=s.roleSkillValues,a}else o&&(a.framework=[o]);return!e&&r.length&&n&&(a[n]={subsetOf:r}),a}function Hm(e,t,r){if(!e&&r)return[..._c,r,rr];if(!(!e||!t))return[..._c,t,"framework",rr]}function vL(e,t,r=!1){return!e||r||t?null:"noCurriculum"}function yL(e){return e.source==="manual"?[]:e.scope}function bL(e,t,r){return e?{frameworkId:e,roleSkillValues:_a(t,r)}:void 0}function CL(e,t,r){return{content:r===0?t:[...e,...t.filter(o=>!e.some(s=>s.identifier===o.identifier))],nextOffset:r+t.length}}function Vm(){let e=0;return{next:()=>++e,isLatest:t=>t===e,invalidate:()=>{e+=1}}}const zm=20,Rm=[];function Qm(){var u;const e=Z(f=>f.editorConfig),t=Z(f=>f.editorProfile),r=ae(f=>f.selectedNodeId),n=ae(f=>f.treeData);if(t.restrictedContentCategories)return t.restrictedContentCategories;const o=h.useCallback(()=>{if(!r||!n.length)return 0;function f(g,p,b=0){var m;for(const v of g){if(v.id===p)return b;if((m=v.children)!=null&&m.length){const y=f(v.children,p,b+1);if(y>=0)return y}}return-1}return Math.max(0,f(n,r))},[r,n])(),s=(u=e==null?void 0:e.config)==null?void 0:u.hierarchy;if(!s)return[...Ep];const a=`level${o}`,i=s[a],c=i==null?void 0:i.children,d=c==null?void 0:c.Content;return d!=null&&d.length?d:[...Ep]}function SL(){const e=jm(),t=Z(ee=>{var fe,X;return((X=(fe=ee.editorConfig)==null?void 0:fe.context)==null?void 0:X.channel)??""}),r=Qm(),n=Z(ee=>ee.editorProfile),o=lt(ee=>ee.activeAssessmentSlot),s=lt(ee=>ee.activeLevelExamTarget),a=ae(ee=>ee.treeData),i=ae(ee=>ee.treeCache),c=_r(),d=n.competencyScoped?bf(a[0],i):void 0,u=h.useRef(),f=Qr(),g=n.competencyScoped?bL(f.frameworkId,f.roleSkills,f.terms):void 0,p=Ac(),b=p.ready,[m,v]=h.useState(Rm),y=h.useRef(m);y.current=m;const[C,S]=h.useState(0),[w,_]=h.useState(0),[T,E]=h.useState(0),[A,x]=h.useState(!1),B=h.useRef(null),D=h.useRef(Vm()).current,F=h.useRef(Vm()).current,M=()=>{D.invalidate(),B.current=null,v(Rm),S(0),_(0),E(0),x(!1)},P=async(ee,fe)=>{const X=D.next();x(!0);try{const{content:Se,count:Me}=await Am({filters:ee.filters,query:ee.query,limit:zm,offset:fe,channel:t||void 0,sortBy:ee.sortBy,fields:ee.fields});if(!D.isLatest(X))return;const re=CL(y.current,Se.filter(ce=>!ee.isMatch(ce)),fe);v(re.content),_(fe+Se.length),S(Math.max(0,Me-ee.matchedCount)),E(Me)}catch(Se){console.error("[useLibrary] other content load error:",Se)}finally{D.isLatest(X)&&x(!1)}},V=!!o||!!s,ne=oo(),W=yL(ne),de=vL(n.competencyScoped,(g==null?void 0:g.frameworkId)??d,V),ie=h.useCallback(async(ee="",fe="all",X={},Se=!0,Me=!1)=>{var ce,G,H,Ae,Te;const re=F.next();e.setLoading(!0);try{if(de){e.setContent([],0),M();return}let Ie;if(n.competencyScoped){const k=gL(o,V,_a(W,c==null?void 0:c.terms),c==null?void 0:c.code,d,g);Ie={status:["Live"],...k}}else Ie={status:["Live"],primaryCategory:fe&&fe!=="all"?[fe]:r},(ce=X==null?void 0:X.board)!=null&&ce.length&&(Ie.board=X.board),(G=X==null?void 0:X.medium)!=null&&G.length&&(Ie.medium=X.medium),(H=X==null?void 0:X.gradeLevel)!=null&&H.length&&(Ie.gradeLevel=X.gradeLevel),(Ae=X==null?void 0:X.subject)!=null&&Ae.length&&(Ie.subject=X.subject),(Te=X==null?void 0:X.primaryCategory)!=null&&Te.length&&(Ie.primaryCategory=X.primaryCategory);const we={...Ie},Be=b&&p.frameworkId&&p.skillField?fL(p.frameworkId,p.skillField,p.skills,p.terms):void 0;Be&&Object.assign(Ie,Be);const zt=Me?{name:"asc"}:{lastUpdatedOn:"desc"},vr=Se?0:e.offset,{content:Rt,count:qt}=await Am({filters:Ie,query:ee,limit:ee?50:zm,offset:vr,channel:t||void 0,sortBy:zt,fields:Hm(n.competencyScoped,c==null?void 0:c.code,p.skillField)});if(!F.isLatest(re))return;if(Se?e.setContent(Rt,qt):e.appendContent(Rt,qt),Se)if(!Be||!p.skillField||!p.frameworkId)M();else{const{frameworkId:k,skillField:N}=p,O=_a(p.skills,p.terms),R={filters:we,isMatch:Q=>hL(Q,k,N,O),matchedCount:qt,query:ee,sortBy:zt,fields:Hm(n.competencyScoped,c==null?void 0:c.code,p.skillField)};B.current=R,P(R,0)}}catch(Ie){console.error("[useLibrary] load error:",Ie)}finally{F.isLatest(re)&&e.setLoading(!1)}},[r,t,n,o,V,W,c,d,de,g==null?void 0:g.frameworkId,g==null?void 0:g.roleSkillValues,b,p]);h.useEffect(()=>{clearTimeout(u.current),e.setSearch("")},[d]),h.useEffect(()=>{ie()},[t,n.key]),h.useEffect(()=>{n.competencyScoped&&ie()},[n.competencyScoped,o,s,W.join("|"),d,g==null?void 0:g.frameworkId,g==null?void 0:g.roleSkillValues.join("|")]);const ve=p.skills.join("|"),me=h.useRef(!1);h.useEffect(()=>{if(!me.current){me.current=!0;return}n.competencyScoped||ie(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ)},[p.ready,p.frameworkId,p.skillField,ve]);const z=h.useCallback(ee=>{e.setSearch(ee),clearTimeout(u.current),u.current=setTimeout(()=>ie(ee,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,ie]),Ce=h.useCallback(ee=>{e.setFilter(ee),ie(e.searchQuery,ee,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,ie]),ke=h.useCallback(ee=>{e.setAdvancedFilters(ee),ie(e.searchQuery,e.activeFilter,ee,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,ie]),U=h.useCallback(()=>{const ee=!e.sortAZ;e.setSortAZ(ee),ie(e.searchQuery,e.activeFilter,e.advancedFilters,!0,ee)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,ie]),q=h.useCallback(()=>{e.isLoading||ie(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,ie]),le=e.allContent.length<e.totalCount,ge=h.useCallback(()=>{const ee=B.current;!ee||A||P(ee,w)},[A,w,t]);return{content:e.filteredContent,isLoading:e.isLoading,totalCount:e.totalCount,activeFilter:e.activeFilter,advancedFilters:e.advancedFilters,searchQuery:e.searchQuery,sortAZ:e.sortAZ,hasMore:le,search:z,setFilter:Ce,applyAdvancedFilters:ke,toggleSort:U,loadMore:q,refetch:()=>ie(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:o,emptyReason:de,skillMatched:b,otherContent:m,otherTotal:C,otherLoading:A,otherHasMore:pL(w,T),loadMoreOther:ge,courseHint:mL(p)}}function Wm(){var c;const e=ue(),t=Z(d=>d.editorProfile.competencyScoped),r=lt(d=>d.activeAssessmentSlot),n=lt(d=>d.activeLevelExamTarget),o=ae(d=>d.selectedNodeId),s=ae(d=>d.treeData),a=ae(d=>d.getNodeById),i=(c=s[0])==null?void 0:c.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n){const d=a(n);return e.learningPath.libraryAddLevelExamCourse.replace("{level}",(d==null?void 0:d.name)??"")}if(o&&o!==i){const d=a(o);if(d!=null&&d.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",d.name??"")}return e.learningPath.libraryOpenLevelToAdd}function Gm(e){const t=(e.organisation??[]).map(n=>String(n??"").trim()).find(Boolean)??"",r=String(e.primaryCategory??"").trim();return[t,r].filter(Boolean).join(" · ")}function Km(e,t,r){var i;const n=(Array.isArray(e)?e:e!=null&&e!==""?[e]:[]).map(String),o=new Set(t.map(c=>{var d;return((d=ns(c,r))==null?void 0:d.code)??c})),s=new Set,a=[];for(const c of n){const d=((i=ns(c,r))==null?void 0:i.code)??c;s.has(d)||(s.add(d),a.push({code:d,label:wa(c,r),matched:o.has(d)}))}return[...a.filter(c=>c.matched),...a.filter(c=>!c.matched)]}function Ym(e,t){const{frameworkId:r,skillField:n,skills:o,terms:s}=t;return!r||!n||e.competencyFramework!==r?[]:Km(e[n],o,s)}const Yt={card:"_card_1nmp3_1",addBtn:"_addBtn_1nmp3_17",dragging:"_dragging_1nmp3_24",ctIcon:"_ctIcon_1nmp3_29",info:"_info_1nmp3_33",name:"_name_1nmp3_41",meta:"_meta_1nmp3_50",skillTags:"_skillTags_1nmp3_58",skillTag:"_skillTag_1nmp3_58",skillTagMatched:"_skillTagMatched_1nmp3_73",addBtnMuted:"_addBtnMuted_1nmp3_99",added:"_added_1nmp3_108",addedBadge:"_addedBadge_1nmp3_117"},wL={video:ia,pdf:Ko,h5p:ra,scorm:sa,audio:oa,quiz:ta,course:Nr,default:nn},Zm=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:o})=>{const s=ue(),a=hs(e),i=wL[a.key]??nn,c=ec(),d=OE(),u=c&&!o&&d,f=Z(T=>T.editorProfile.competencyScoped),g=_r(),{roleSkills:p}=Qr(),b=Ac(),m=e,v=f?g?Km(m[g.code],p,g.terms):[]:Ym(m,b),{attributes:y,listeners:C,setNodeRef:S,isDragging:w}=Qd({id:e.identifier,disabled:!n||!c||!d,data:{type:"library-item",item:e}}),_=()=>{r&&r(e)};return l.jsxs("div",{ref:S,className:[Yt.card,w?Yt.dragging:"",o?Yt.added:""].join(" "),"aria-label":e.name,...n?{...y,...C}:{},role:"listitem",onClick:_,children:[l.jsx("span",{className:[`sbx-ct-sq--${a.key}`,Yt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Yt.info,children:[l.jsx("span",{className:Yt.name,title:e.name,children:e.name}),l.jsx("span",{className:Yt.meta,children:Gm(e)}),v.length>0&&l.jsxs("span",{className:Yt.skillTags,children:[v.slice(0,3).map(T=>l.jsx("span",{className:[Yt.skillTag,T.matched?Yt.skillTagMatched:""].filter(Boolean).join(" "),children:T.label},T.code)),v.length>3&&l.jsx("span",{className:Yt.skillTag,title:v.slice(3).map(T=>T.label).join(", "),children:s.libraryCard.moreSkills.replace("{count}",String(v.length-3))})]})]}),o&&l.jsx("span",{className:Yt.addedBadge,"aria-label":s.libraryCard.alreadyAddedAriaLabel,title:s.libraryCard.alreadyAddedTitle,children:l.jsx(Kn,{size:12})}),!o&&n&&l.jsx("button",{type:"button",className:[Yt.addBtn,!u&&c?Yt.addBtnMuted:""].join(" "),onClick:T=>{T.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!u,"aria-label":s.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?d?s.libraryCard.addToUnitTitle:s.libraryCard.selectUnitToAddTitle:s.libraryCard.draftOnlyTitle,children:l.jsx(Rr,{size:14})})]})},Xm={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},_L=({filters:e,active:t,onChange:r})=>{const n=ue();return l.jsx("div",{className:Xm.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(o=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===o.value,className:["sbx-chip",t===o.value?"filled":"outline",Xm.chip].join(" "),onClick:()=>r(o.value),children:o.label},o.value))})},Ct={panel:"_panel_1iejx_1",header:"_header_1iejx_10",headerTitle:"_headerTitle_1iejx_19",closeBtn:"_closeBtn_1iejx_25",body:"_body_1iejx_43",section:"_section_1iejx_59",sectionLabel:"_sectionLabel_1iejx_65",chips:"_chips_1iejx_73",chip:"_chip_1iejx_73",active:"_active_1iejx_96",footer:"_footer_1iejx_102",resetBtn:"_resetBtn_1iejx_112",applyBtn:"_applyBtn_1iejx_129"},TL=e=>[{key:"board",label:e.libraryFilterPanel.boardLabel},{key:"medium",label:e.libraryFilterPanel.mediumLabel},{key:"gradeLevel",label:e.libraryFilterPanel.classLabel},{key:"subject",label:e.libraryFilterPanel.subjectLabel}],kL=new Set(["board","medium","gradeLevel","subject","topic"]),EL=({local:e,toggle:t})=>{const r=ue(),n=Qm();return n.length?l.jsxs("div",{className:Ct.section,children:[l.jsx("div",{className:Ct.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:Ct.chips,children:n.map(o=>l.jsx("button",{type:"button",className:[Ct.chip,(e.primaryCategory??[]).includes(o)?Ct.active:""].join(" "),onClick:()=>t("primaryCategory",o),children:o},o))})]}):null},AL=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const o=ue(),s=Z(C=>C.editorConfig),a=Z(C=>C.searchFormConfig),i=Z(C=>C.contentFramework),c=Z(C=>C.contentTargetFWIds),{organisationFramework:d}=Ea(i??((v=s==null?void 0:s.context)==null?void 0:v.framework),c??((y=s==null?void 0:s.context)==null?void 0:y.targetFWIds)),[u,f]=h.useState(t),g=a!=null&&a.length?a.filter(C=>kL.has(C.code)).map(C=>({key:C.code,label:C.label||C.code})):TL(o);h.useEffect(()=>{f(t)},[t]);const p=(C,S)=>{f(w=>{const _=w[C]??[],T=_.includes(S)?_.filter(E=>E!==S):[..._,S];return{...w,[C]:T}})},b=(d==null?void 0:d.categories)??[],m=C=>{var S;return((S=b.find(w=>w.code===C))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:Ct.panel,role:"dialog","aria-label":o.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:Ct.header,children:[l.jsx("span",{className:Ct.headerTitle,children:o.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:Ct.closeBtn,onClick:n,"aria-label":o.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(Or,{size:16})})]}),l.jsxs("div",{className:Ct.body,children:[g.map(({key:C,label:S})=>{const w=m(C);return w.length?l.jsxs("div",{className:Ct.section,children:[l.jsx("div",{className:Ct.sectionLabel,children:S}),l.jsx("div",{className:Ct.chips,children:w.slice(0,20).map(_=>l.jsx("button",{type:"button",className:[Ct.chip,(u[C]??[]).includes(_.name)?Ct.active:""].join(" "),onClick:()=>p(C,_.name),children:_.name},_.identifier))})]},C):null}),l.jsx(EL,{local:u,toggle:p})]}),l.jsxs("div",{className:Ct.footer,children:[l.jsx("button",{type:"button",className:Ct.resetBtn,onClick:()=>f({}),children:o.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:Ct.applyBtn,onClick:()=>{r(u),n()},children:o.libraryFilterPanel.applyButton})]})]}):null},ut={header:"_header_u96hx_10",headerCourse:"_headerCourse_u96hx_20",courseIcon:"_courseIcon_u96hx_25",titleGroup:"_titleGroup_u96hx_37",courseMeta:"_courseMeta_u96hx_45",title:"_title_u96hx_37",headerActions:"_headerActions_u96hx_67",iconBtn:"_iconBtn_u96hx_74",playerArea:"_playerArea_u96hx_92",footer:"_footer_u96hx_100",footerCourse:"_footerCourse_u96hx_109",addBtn:"_addBtn_u96hx_115",addBtnCourse:"_addBtnCourse_u96hx_134",modalOverlay:"_modalOverlay_u96hx_159",modalOverlayCourse:"_modalOverlayCourse_u96hx_174",modalPanel:"_modalPanel_u96hx_178",modalPanelCourse:"_modalPanelCourse_u96hx_190",skillTags:"_skillTags_u96hx_198",skillTag:"_skillTag_u96hx_198",skillTagMatched:"_skillTagMatched_u96hx_213"},IL="application/vnd.sunbird.questionset",LL=({content:e,editorMode:t,onAdd:r,onClose:n})=>{const o=ue(),s=t==="edit",a=Z(p=>p.editorProfile.competencyScoped),i=Wm(),c=Ac();if(!e)return null;const d=a?[]:Ym(e,c),u=a&&e.primaryCategory==="Course",f=Gm(e),g={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return Ke.createPortal(l.jsx("div",{className:[ut.modalOverlay,u?ut.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":o.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[ut.modalPanel,u?ut.modalPanelCourse:""].filter(Boolean).join(" "),onClick:p=>p.stopPropagation(),children:[l.jsxs("div",{className:[ut.header,u?ut.headerCourse:""].filter(Boolean).join(" "),children:[u&&l.jsx("span",{className:ut.courseIcon,children:l.jsx(Nr,{size:20})}),l.jsxs("div",{className:ut.titleGroup,children:[l.jsx("span",{className:ut.title,title:e.name,children:e.name}),u&&f&&l.jsx("span",{className:ut.courseMeta,children:f}),d.length>0&&l.jsx("span",{className:ut.skillTags,children:d.map(p=>l.jsx("span",{className:[ut.skillTag,p.matched?ut.skillTagMatched:""].filter(Boolean).join(" "),children:p.label},p.code))})]}),l.jsx("div",{className:ut.headerActions,children:l.jsx("button",{type:"button",className:ut.iconBtn,onClick:n,"aria-label":o.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(Or,{size:16})})})]}),l.jsx("div",{className:ut.playerArea,children:u?l.jsx(Mm,{courseId:e.identifier}):l.jsx(kc,{node:g,editorMode:"read",type:e.mimeType===IL?"quml":"content"})}),s&&l.jsx("div",{className:[ut.footer,u?ut.footerCourse:""].filter(Boolean).join(" "),children:u?l.jsxs("button",{type:"button",className:ut.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Rr,{size:15})," ",i??o.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:ut.addBtn,onClick:()=>r(e),children:o.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},Ue={dock:"_dock_1rq19_1",header:"_header_1rq19_8",libraryTargetLabel:"_libraryTargetLabel_1rq19_18",libraryTargetChip:"_libraryTargetChip_1rq19_28",headerLeft:"_headerLeft_1rq19_46",headerTitle:"_headerTitle_1rq19_54",count:"_count_1rq19_60",searchRow:"_searchRow_1rq19_69",searchWrap:"_searchWrap_1rq19_77",searchIcon:"_searchIcon_1rq19_83",searchInput:"_searchInput_1rq19_92",filterToggleBtn:"_filterToggleBtn_1rq19_110",filterToggleBtnActive:"_filterToggleBtnActive_1rq19_129",filterBadge:"_filterBadge_1rq19_135",filters:"_filters_1rq19_154",mainArea:"_mainArea_1rq19_164",sidePanelOverlay:"_sidePanelOverlay_1rq19_173",cardList:"_cardList_1rq19_182",skeleton:"_skeleton_1rq19_198",skeletonIcon:"_skeletonIcon_1rq19_208",skeletonText:"_skeletonText_1rq19_216",skeletonLine:"_skeletonLine_1rq19_223",skeletonLineSm:"_skeletonLineSm_1rq19_230",loadMoreBtn:"_loadMoreBtn_1rq19_245",emptyState:"_emptyState_1rq19_270",collapseBtn:"_collapseBtn_1rq19_290",courseHint:"_courseHint_1rq19_309",sectionHeading:"_sectionHeading_1rq19_326",otherContent:"_otherContent_1rq19_335",otherContentToggle:"_otherContentToggle_1rq19_344",otherContentHint:"_otherContentHint_1rq19_359"},DL=[{label:"Courses",value:"all"}];function NL(e){const t=new Set,r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t.add(n.identifier),n.children&&r.push(...n.children)}return t}const OL=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ue(),{content:o,isLoading:s,totalCount:a,activeFilter:i,searchQuery:c,sortAZ:d,hasMore:u,search:f,setFilter:g,applyAdvancedFilters:p,toggleSort:b,loadMore:m,activeAssessmentSlot:v,emptyReason:y,skillMatched:C,otherContent:S,otherTotal:w,otherLoading:_,otherHasMore:T,loadMoreOther:E,courseHint:A}=SL(),[x,B]=h.useState(!1),{addResource:D,selectedNodeId:F,treeData:M,treeCache:P}=ae(),V=lt(H=>H.setActiveAssessmentSlot),ne=lt(H=>H.activeLevelExamTarget),W=lt(H=>H.setActiveLevelExamTarget),de=Z(H=>H.editorProfile.competencyScoped),ie=Z(H=>H.editorProfile.restrictedContentCategories),ve=e==="edit",me=Wm(),[z,Ce]=h.useState(!1),[ke,U]=h.useState({}),[q,le]=h.useState(null),ge=h.useMemo(()=>NL(M),[M]),ee=h.useCallback((H,Ae)=>{var we,Be;const Te=(we=M[0])==null?void 0:we.id;if(!Te)return;if(os(((Be=M[0])==null?void 0:Be.children)??[],Ae)){be.error(Ae==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}if(!no(H)){be.error(n.learningPath.notAssessmentCourseToast.replace("{name}",H.name));return}if(D(H,Te,{isAssessmentCourse:!0,slot:Ae})===!1){be.error(n.learningPath.bothSlotsFilledToast);return}be.success(n.libraryDock.itemAddedToast.replace("{name}",H.name)),V(null)},[M,D,V,n]),fe=h.useCallback((H,Ae)=>{var Be;const Te=ae.getState().getNodeById(Ae);if(!Te)return;if(mf(Te)){be.error(n.learningPath.levelExamAlreadyFilledToast);return}if(!no(H)){be.error(n.learningPath.notAssessmentCourseToast.replace("{name}",H.name));return}const Ie=((Be=M[0])==null?void 0:Be.children)??[];if(gf(Ie,Te)){be.error(n.learningPath.levelNeedsMixedContentToast);return}if(D(H,Ae,{isAssessmentCourse:!0})===!1){be.error(n.learningPath.itemAlreadyInPathToast.replace("{name}",H.name));return}be.success(n.libraryDock.itemAddedToast.replace("{name}",H.name)),W(null)},[M,D,W,n]),X=h.useCallback(H=>{var we,Be,zt,vr;if(v){ee(H,v);return}if(ne){fe(H,ne);return}if(de&&!Cf(M[0],P)&&!Ta(M[0],P)){be.error(n.learningPath.selectCurriculumFirstToast);return}if(!F){be.error(de?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const Ae=(we=M[0])==null?void 0:we.id,Te=ae.getState().getNodeById(F);if(de){const Rt=((Be=M[0])==null?void 0:Be.children)??[],qt=Te!=null&&Te.isFolder?Te:Te!=null&&Te.parent?ae.getState().getNodeById(Te.parent):void 0;if(qt&&ml(Rt,qt)){const k=(zt=Rt[0])==null?void 0:zt.id;be.error(qt.id===k?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(F===Ae||!(Te!=null&&Te.isFolder)){be(de?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(zr,{size:16}),duration:4e3});return}if(de&&gf(((vr=M[0])==null?void 0:vr.children)??[],Te)&&no(H)){be.error(n.learningPath.levelNeedsMixedContentToast);return}if(D(H,F)===!1){be.error((de?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",H.name));return}be.success(n.libraryDock.itemAddedToast.replace("{name}",H.name))},[v,ee,ne,fe,F,D,M,P,n,de]),Se=h.useCallback(H=>{U(H),p(H)},[p]),Me=h.useCallback(H=>{le(H)},[]),re=h.useCallback(H=>{X(H),le(null)},[X]),ce=h.useMemo(()=>Object.values(ke).reduce((H,Ae)=>H+((Ae==null?void 0:Ae.length)??0),0),[ke]),G=()=>C&&w>0?l.jsxs("div",{className:Ue.otherContent,"data-testid":"library-other-content",children:[l.jsxs("button",{type:"button",className:Ue.otherContentToggle,onClick:()=>B(H=>!H),"aria-expanded":x,children:[x?l.jsx(rn,{size:14}):l.jsx(ea,{size:14}),l.jsx("span",{children:n.libraryDock.otherContentHeading.replace("{count}",String(w))})]}),x&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:Ue.otherContentHint,children:n.libraryDock.otherContentHint}),S.map(H=>l.jsx(Zm,{item:H,onAdd:X,onPreview:Me,isDraggable:ve,isAdded:ge.has(H.identifier)},H.identifier)),T&&l.jsx("button",{type:"button",className:Ue.loadMoreBtn,onClick:E,disabled:_,"aria-label":n.libraryDock.loadMoreAriaLabel,children:_?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]})]}):null;return l.jsxs("div",{className:Ue.dock,children:[l.jsxs("div",{className:Ue.header,children:[l.jsxs("div",{className:Ue.headerLeft,children:[l.jsx("button",{type:"button",className:Ue.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(jb,{size:15})}),l.jsx(Mb,{size:16}),l.jsx("span",{className:Ue.headerTitle,children:n.libraryDock.headerTitle}),a>0&&l.jsx("span",{className:Ue.count,children:a})]}),me&&(v||ne?l.jsxs("button",{type:"button",className:Ue.libraryTargetChip,onClick:()=>V(null),"aria-label":n.libraryDock.cancelTargetAriaLabel,title:n.libraryDock.cancelTargetAriaLabel,children:[l.jsx("span",{className:Ue.libraryTargetLabel,children:me}),l.jsx(Or,{size:11,"aria-hidden":"true"})]}):l.jsx("span",{className:Ue.libraryTargetLabel,children:me}))]}),l.jsxs("div",{className:Ue.searchRow,children:[l.jsxs("div",{className:Ue.searchWrap,children:[l.jsx(aa,{size:14,className:Ue.searchIcon}),l.jsx("input",{type:"search",className:Ue.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:H=>f(H.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[Ue.filterToggleBtn,d?Ue.filterToggleBtnActive:""].join(" "),onClick:b,"aria-label":d?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:d?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:d?l.jsx(kb,{size:15}):l.jsx(Db,{size:15})}),!de&&l.jsxs("button",{type:"button",className:[Ue.filterToggleBtn,z?Ue.filterToggleBtnActive:""].join(" "),onClick:()=>Ce(H=>!H),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":z,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(Gb,{size:15}),ce>0&&l.jsx("span",{className:Ue.filterBadge,children:ce})]})]}),l.jsx("div",{className:Ue.filters,children:l.jsx(_L,{filters:de?DL:ie?[tc[0],...tc.filter(H=>ie.includes(H.value))]:tc,active:i,onChange:g})}),l.jsxs("div",{className:Ue.mainArea,children:[l.jsxs("div",{className:Ue.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:[A==="pickSkills"&&l.jsxs("div",{className:Ue.courseHint,"data-testid":"library-pick-skills-hint",children:[l.jsx(zr,{size:14}),l.jsx("span",{children:n.libraryDock.pickSkillsHint})]}),C&&o.length>0&&l.jsx("div",{className:Ue.sectionHeading,children:n.libraryDock.matchingHeading}),s&&o.length===0?Array.from({length:4}).map((H,Ae)=>l.jsxs("div",{className:Ue.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:Ue.skeletonIcon}),l.jsxs("div",{className:Ue.skeletonText,children:[l.jsx("div",{className:Ue.skeletonLine}),l.jsx("div",{className:Ue.skeletonLineSm})]})]},Ae)):o.length>0?l.jsxs(l.Fragment,{children:[o.map(H=>l.jsx(Zm,{item:H,onAdd:X,onPreview:Me,isDraggable:ve,isAdded:ge.has(H.identifier)},H.identifier)),u&&l.jsx("button",{type:"button",className:Ue.loadMoreBtn,onClick:m,disabled:s,"aria-label":n.libraryDock.loadMoreAriaLabel,children:s?n.libraryDock.loadingText:n.libraryDock.loadMoreText}),G()]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ue.emptyState,children:[l.jsx(aa,{size:24}),y==="noCurriculum"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noCurriculumEmptyTitle}),l.jsx("span",{children:n.learningPath.noCurriculumEmptyHint})]}):C?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noSkillMatchTitle}),l.jsx("span",{children:n.libraryDock.noSkillMatchHint})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noContentFound}),l.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})]}),G()]})]}),z&&l.jsx("div",{className:Ue.sidePanelOverlay,children:l.jsx(AL,{isOpen:z,filters:ke,onApply:Se,onClose:()=>Ce(!1)})}),q&&l.jsx(LL,{content:q,editorMode:e,onAdd:re,onClose:()=>le(null)})]})]})};function PL(e,t,r,n=da){const o={},s={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),c=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","industry","domain","dialcodes"]),d=new Set(["copyrightYear","compatibilityLevel","version"]);function u(p,b=!1){const m={};for(const[v,y]of Object.entries(p))if(!a.has(v)&&!(b&&i.has(v)))if(c.has(v))Array.isArray(y)?m[v]=y:y!=null&&y!==""?m[v]=[y]:m[v]=[];else if(d.has(v)){const C=Number(y);isNaN(C)||(m[v]=C)}else m[v]=y;return m}function f(p){var m;const b={};for(const v of p.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:C,...S}=y;if(Object.keys(S).length===0)continue;const w=((m=v.metadata)==null?void 0:m.relationalMetadata)??{};b[v.identifier]={name:v.name,...w,...S}}return b}function g(p,b){var w,_;const m=p.identifier,v=t[m],y=m.startsWith("temp-")||!!(v!=null&&v.isNew),C=!p.isFolder&&!b;if(b||y||v&&!C){let T;if(y)T={mimeType:"application/vnd.ekstep.content-collection",code:m,contentType:((w=p.metadata)==null?void 0:w.contentType)??n.unitContentType,primaryCategory:((_=p.metadata)==null?void 0:_.primaryCategory)??n.unitPrimaryCategory,name:p.name,visibility:"Parent",channel:r,...u(p.metadata??{})};else if(b){const{isNew:E,...A}=v??{};T={...u(p.metadata??{},!0),...u(A,!1),name:p.name}}else{const{isNew:E,...A}=v??{};T={name:p.name,visibility:"Parent",...u(A,!0)}}o[m]={metadata:T,objectType:p.objectType||(p.isFolder?"Collection":"Content"),root:b,isNew:y}}const S=p.isFolder?f(p):{};s[m]={name:p.name,children:(p.children??[]).map(T=>T.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:b},(p.children??[]).forEach(T=>g(T,!1))}return e.forEach((p,b)=>g(p,b===0)),{nodesModified:o,hierarchy:s}}function xL(){const[e,t]=h.useState(!1),r=ae(u=>u.treeCache),n=ae(u=>u.treeData),o=Z(u=>u.isDirty),s=Z(u=>u.lastSaved),{setIsDirty:a,setLastSaved:i}=Z(),c=Z(u=>u.editorConfig);return{save:h.useCallback(async()=>{if(!c||e)return;const u=c.context.contentId??c.context.identifier??"";if(!u)return;if(n.length===0){be.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",g=c.context.userId??c.context.uid??"";t(!0);try{const p=Z.getState().editorProfile,{nodesModified:b,hierarchy:m}=PL(n,r,f,p),{identifiers:v}=await yw(u,b,m,g);v&&Object.keys(v).length>0&&ae.getState().replaceNodeIds(v);const y=new Date().toISOString();i(y),a(!1)}catch(p){console.error("[useSaveHierarchy] save failed:",p),be.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,a,i]),isSaving:e,isDirty:o,lastSaved:s}}const FL={};function ML(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function BL(e,t,r,n,o,s=FL){const a=[],i=(c,d)=>{var u;for(const f of c){const g=d&&!f.parent,p=g?r:f.isFolder?n:null;if(p&&p.length>0){const b={...f.metadata??{},...t[f.id]??{}},v=nm(p,b,s,g,o).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&ML(y.currentValue)).map(y=>y.label);v.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(u=f.children)!=null&&u.length&&i(f.children,!1)}};return i(e,!0),a}function $L(e){var w,_;const t=Z(T=>T.editorConfig),r=Z(T=>T.editorProfile),n=Z(T=>T.setButtonLoader),o=Z(T=>T.validateAllForms),s=Z(T=>T.rootFormConfig),a=Z(T=>T.unitFormConfig),i=ae(T=>T.treeData),c=ae(T=>T.treeCache),d=ae(T=>T.selectNode),u=_r(),{scope:f}=oo(),{roleSkills:g}=Qr(),p=Z(T=>T.contentFramework),b=Z(T=>T.contentTargetFWIds),{organisationFramework:m,targetFrameworks:v}=Ea(p??((w=t==null?void 0:t.context)==null?void 0:w.framework),b??((_=t==null?void 0:t.context)==null?void 0:_.targetFWIds)),y=h.useCallback(()=>{var B,D,F;const T={editorMode:"edit",objectType:(B=t==null?void 0:t.config)==null?void 0:B.objectType,userFullName:(F=(D=t==null?void 0:t.context)==null?void 0:D.user)==null?void 0:F.fullName},E=BL(i,c,s,a,T,{organisationFramework:m,targetFrameworks:v});if(E.length===0)return!0;const A=E[0];be.error(`"${A.nodeName}": please fill required field${A.missing.length>1?"s":""} — ${A.missing.join(", ")}`);const{setFormStatus:x}=Z.getState();return E.forEach(M=>x(M.nodeId,!1)),d(A.nodeId),!1},[i,c,s,a,t,d,m,v]),C=h.useCallback(()=>{if(r.key!=="learningPath")return!0;const T=gl(i[0],u==null?void 0:u.code,f,c,u==null?void 0:u.terms,g);return T.length===0?!0:(be.error(T[0].message),!1)},[r.key,i,c,u,f,g]);return{runAction:h.useCallback(async(T,E)=>{var B,D,F,M;const A=((B=t==null?void 0:t.context)==null?void 0:B.contentId)??((D=t==null?void 0:t.context)==null?void 0:D.identifier)??"";if(!A)return be.error("No content identifier found."),!1;const x=((F=t==null?void 0:t.context)==null?void 0:F.userId)??((M=t==null?void 0:t.context)==null?void 0:M.uid)??"";try{switch(T){case"sendForReview":return y()?o(i)?C()?(n("saveCollection",!0),await e(),await Sw(A),be.success("Content sent for review"),!0):!1:(be.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const P=(E==null?void 0:E.comment)??"";return await ww(A,P),be.success("Content rejected and sent back to the author"),!0}case"publish":return y()?o(i)?C()?(n("publishCollection",!0),await e(),await bw(A,x),be.success("Content published successfully"),!0):!1:(be.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(P){console.error(`[useToolbarActions] ${T} failed`,P);const V=T==="sendForReview"?"send for review":T==="reject"?"reject":"publish";return be.error(`Failed to ${V}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,y,C,o,i]),checkRequiredFields:y}}function qL(){const e=ue(),t=Z(c=>c.editorProfile.key==="learningPath"),r=ae(c=>c.treeData),n=_r(),{scope:o,source:s}=oo(),a=h.useRef(!1),i=h.useRef("");h.useEffect(()=>{if(!t||s!=="prior"||!n)return;const c=Ow(r[0],n.code,o,n.terms),d=c.map(u=>u.id).sort().join(",");a.current?c.length>0&&d!==i.current&&be.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):a.current=!0,i.current=d},[t,s,o.join("|"),n==null?void 0:n.code,r])}function jL(e,t,r,n){return e.flatMap(o=>{var u,f;if(st(o))return[];const s=as(o,t,n),a=on(((u=r[o.id])==null?void 0:u[t])??((f=o.metadata)==null?void 0:f[t]),n),i=[...s].sort(),c=[...a].sort();return i.length===c.length&&i.every((g,p)=>g===c[p])?[]:[{id:o.id,skills:s}]})}function UL(){const e=Z(c=>c.editorProfile.key==="learningPath"),t=ae(c=>c.treeData),r=ae(c=>c.treeCache),n=ae(c=>c.updateNode),o=_r(),s=o==null?void 0:o.code,a=o==null?void 0:o.terms,{roleSkills:i}=Qr();h.useEffect(()=>{var c;!e||!s||jL(((c=t[0])==null?void 0:c.children)??[],s,r,a).forEach(({id:d,skills:u})=>n(d,{[s]:u},[s],{silent:!0}))},[e,t,r,s,a,n]),h.useEffect(()=>{if(!e||!s)return;const c=t[0],d=Nw(c,s,r,a,i);d!==null&&n(c.id,{[s]:d},[s],{silent:!0})},[e,t,r,s,a,i,n])}const Zt={shell:"_shell_1k9or_1",workspace:"_workspace_1k9or_8",sidebarCollapsed:"_sidebarCollapsed_1k9or_16",dockCollapsed:"_dockCollapsed_1k9or_19",dock:"_dock_1k9or_19",outline:"_outline_1k9or_40",reopenTab:"_reopenTab_1k9or_45",outlineHidden:"_outlineHidden_1k9or_79",editor:"_editor_1k9or_86",editorLp:"_editorLp_1k9or_92",dockHidden:"_dockHidden_1k9or_105",dockReopenTab:"_dockReopenTab_1k9or_112",dragChip:"_dragChip_1k9or_137",dragChipLabel:"_dragChipLabel_1k9or_152"},HL=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const o=ue(),[s,a]=h.useState(null),[i,c]=h.useState(!1),[d,u]=h.useState(!1),[f,g]=h.useState(!1);qL(),UL();const{addResource:p,treeData:b,treeCache:m}=ae(),v=Z(W=>W.setFormStatus),y=Z(W=>W.editorProfile.key==="learningPath"),[C,S]=h.useState(!0),w=ae(W=>W.selectedNodeId),{save:_,isSaving:T,isDirty:E,lastSaved:A}=xL(),{runAction:x,checkRequiredFields:B}=$L(_);h.useEffect(()=>{if(!E)return;const W=de=>{de.preventDefault(),de.returnValue=""};return window.addEventListener("beforeunload",W),()=>window.removeEventListener("beforeunload",W)},[E]);const D=pd(Ei(Ks,{activationConstraint:{distance:8}})),F=h.useCallback(W=>{var ie;const de=(ie=W.active.data.current)==null?void 0:ie.item;de&&a(de)},[]),M=h.useCallback(W=>{var U,q,le,ge,ee;a(null);const de=(U=W.active.data.current)==null?void 0:U.item;if(!de)return;if(y&&!Cf(b[0],m)){be.error(o.learningPath.selectCurriculumFirstToast);return}const ie=W.over,ve=(ie==null?void 0:ie.id)??w??void 0,me=y?o.learningPath.dropOntoLevelError:o.splitBuilderShell.dropOntoUnitError;if(!ve){be.error(me);return}const z=(q=b[0])==null?void 0:q.id;if(ve===z){be.error(y?o.learningPath.dropOntoPathError:o.splitBuilderShell.dropOntoCourseError);return}const Ce=ae.getState().getNodeById(ve);if(!(Ce!=null&&Ce.isFolder)){be.error(me);return}if(y&&st(Ce)){const fe=(ee=(ge=(le=b[0])==null?void 0:le.children)==null?void 0:ge[0])==null?void 0:ee.id;be.error(Ce.id===fe?o.learningPath.priorSlotFilledToast:o.learningPath.outcomeSlotFilledToast);return}if(!p(de,ve)){be.error((y?o.learningPath.itemAlreadyInPathToast:o.splitBuilderShell.alreadyInCollectionError).replace("{name}",de.name));return}r==null||r(de,ve),be.success((y?o.learningPath.addedToLevelSuccess:o.splitBuilderShell.addedToUnitSuccess).replace("{name}",de.name))},[w,p,b,m,r,o,y]),P=h.useCallback(async W=>{if(W.action==="onFormStatusChange"){const{isValid:de,nodeId:ie}=W.data??{},ve=de!==!1;S(ve),ie&&v(ie,ve);return}if(W.action==="back"&&E&&e==="edit"){g(!0);return}if(W.action==="saveCollection"){if(!C){be.error(o.splitBuilderShell.fillRequiredMetadataError);return}if(!B())return;await _(),n==null||n(b),t==null||t(W);return}if(W.action==="sendForReview"||W.action==="reject"||W.action==="publish"){await x(W.action,W.data)&&(t==null||t(W));return}t==null||t(W)},[_,x,B,t,n,b,E,C,e,o]),V=h.useCallback(async()=>{if(!B()){g(!1);return}await _(),g(!1),n==null||n(b),t==null||t({action:"back"})},[_,B,n,t,b]),ne=h.useCallback(()=>{g(!1),t==null||t({action:"back"})},[t]);return l.jsxs(Bi,{sensors:D,onDragStart:F,onDragEnd:M,children:[l.jsxs("div",{className:Zt.shell,children:[l.jsx(y_,{editorMode:e,isSaving:T,isDirty:E,lastSaved:A,isFormValid:C,onToolbarEvent:P}),l.jsxs("div",{className:[Zt.workspace,i?Zt.sidebarCollapsed:"",d?Zt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Zt.outline,i?Zt.outlineHidden:""].join(" "),"aria-label":o.splitBuilderShell.outlineAriaLabel,"aria-hidden":i,children:l.jsx(HE,{editorMode:e,collapsed:i,onToggleCollapse:()=>c(W=>!W)})}),i&&l.jsx("button",{className:Zt.reopenTab,onClick:()=>c(!1),title:o.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Zt.editor,y?Zt.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":o.splitBuilderShell.editorAriaLabel,children:l.jsx(lL,{editorMode:e,onToolbarEvent:P})}),l.jsx("aside",{className:[Zt.dock,d?Zt.dockHidden:""].filter(Boolean).join(" "),"aria-label":o.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:l.jsx(OL,{editorMode:e,collapsed:d,onToggleCollapse:()=>u(W=>!W)})}),d&&l.jsx("button",{className:Zt.dockReopenTab,onClick:()=>u(!1),title:o.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(Cb,{dropAnimation:null,children:s?l.jsx("div",{className:Zt.dragChip,children:l.jsx("span",{className:Zt.dragChipLabel,children:s.name})}):null}),f&&l.jsx(b_,{onSave:V,onDiscard:ne,onCancel:()=>g(!1),isSaving:T})]})},VL="v1";function zL(e){const t=e.validations,r=t==null?void 0:t.find(o=>o.type==="maxlength"||o.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Jm(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:zL(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function cn(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const o=n.name??void 0,s=n.fields.filter(a=>!!a.code).sort((a,i)=>(a.index??0)-(i.index??0));for(const a of s)r.push(Jm(a,o))}else n.code&&r.push(Jm(n));return r}function RL(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,o]of Object.entries(t))o&&"default"in o&&(r[n]=o.default);return r}async function QL(e,t,r="Collection",n=VL){var d,u;const s=(u=(d=(await Ve.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:d.result)==null?void 0:u.objectCategoryDefinition,a=(s==null?void 0:s.forms)??{},i=(s==null?void 0:s.objectMetadata)??{},c=i.config??{};return{rootForm:cn(a.create),unitForm:cn(a.unitMetadata),childForm:cn(a.childMetadata),searchForm:cn(a.search??a.searchConfig),relationalForm:cn(a.relationalMetadata),publishChecklist:cn(a.publishchecklist),reviewChecklist:cn(a.review),rfcChecklist:cn(a.requestforchangeschecklist),schemaDefaults:RL(i.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function eg(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function WL({config:e,onError:t}){const[r,n]=h.useState(!0),[o,s]=h.useState(null),[a,i]=h.useState(!1),{setEditorConfig:c,setEditorMode:d,setCategoryDefinition:u,setContentFramework:f,setEditorProfile:g}=Z(),{setTreeData:p,selectNode:b}=ae();return h.useEffect(()=>{let m=!1;async function v(){var y,C,S;try{n(!0),s(null),e.apiBaseUrl&&nf(e.apiBaseUrl),c(e),d(e.config.mode),g(mC(e));const w=e.context.contentId??e.context.identifier??"",_=e.context.channel??"";let T;if(_)try{T=(y=await em(_))==null?void 0:y.defaultFramework}catch{}let E=!1;if(w){const A=e.config.objectType==="QuestionSet";let{rootNode:x}=A?await vw(w):await af(w);if(x&&e.config.primaryCategory==="Learning Path"&&(x=Ew(x)),!m&&(p(x?[x]:[]),x)){b(x.id);const{framework:P,targetFWIds:V}=eg(x.metadata??{},T,e.context);f(P,V),E=!0}const B=e.config.primaryCategory??"Course",D=e.context.channel??"",F=e.config.categoryDefinitionApiVersion??"v1";try{const M=await QL(B,D,e.config.objectType??"Collection",F);if(!m){u(M);const P=((C=M.sourcingSettings)==null?void 0:C.collection)??{},V={};P.maxDepth&&!e.config.maxDepth&&(V.maxDepth=P.maxDepth),P.children&&!e.config.children&&(V.children=P.children),P.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(V.hierarchy={...e.config.hierarchy??{},...P.hierarchy}),Object.keys(V).length>0&&c({...e,config:{...e.config,...V}})}}catch{}}if(!m&&!E){const{framework:A,targetFWIds:x}=eg({},T,e.context);f(A,x)}m||i(!0)}catch(w){if(!m){const _=w instanceof Error?w:new Error(String(w));s(_),t==null||t(_)}}finally{m||n(!1)}}return v(),()=>{m=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:o,isReady:a}}function GL(){const e=Yi(t=>t.setLanguage);h.useEffect(()=>{e(localStorage.getItem(Gi)||"en",{broadcast:!1});const t=n=>{n.key===Gi&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var s;const o=(s=n.detail)==null?void 0:s.lang;o&&e(o,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(Ki,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(Ki,r)}},[e])}const _s={root:"_root_qcpw6_1",loadingState:"_loadingState_qcpw6_10",loadingSpinner:"_loadingSpinner_qcpw6_20",errorState:"_errorState_qcpw6_34"},KL=new Wg({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function YL({error:e,onRetry:t}){const r=ue();return l.jsxs("div",{className:_s.errorState,children:[l.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),l.jsx("p",{children:e.message}),l.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class ZL extends h.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?l.jsx(YL,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function XL(e){GL();const t=ue(),{isLoading:r,error:n}=WL({config:e,onError:e.onError}),o=Z(a=>a.editorMode),s=Z(a=>a.editorProfile);return r?l.jsxs("div",{className:_s.loadingState,children:[l.jsx("div",{className:_s.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:_s.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",_s.root,s.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(HL,{editorMode:o,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const tg=e=>l.jsx(ZL,{onError:e.onError,children:l.jsxs(Kg,{client:KL,children:[l.jsx(XL,{...e}),l.jsx(Gv,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),si=Symbol.for("r2wc.reactRender"),rg=Symbol.for("r2wc.shouldRender"),ai=Symbol.for("r2wc.root");function JL(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function eD(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var ng={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[si]()}}),e[si]()}};function tD(e,t,r,n={}){var o={isConnected:"isConnected"in HTMLElement.prototype},s=!1,a=function(){var d=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?d.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),d.attachShadow({mode:"open"})),d},i=Object.create(HTMLElement.prototype);i.constructor=a;var c=new Proxy(i,{has:function(d,u){return u in e.propTypes||u in i},set:function(d,u,f,g){return s&&(o[u]=!0),typeof u=="symbol"||o[u]||u in d?(e.propTypes&&u in e.propTypes&&ng.expando(g,u,f),Reflect.set(d,u,f,g)):(ng.expando(g,u,f),!0)},getOwnPropertyDescriptor:function(d,u){var f=Reflect.getOwnPropertyDescriptor(d,u);if(f)return f;if(u in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return a.prototype=c,i.connectedCallback=function(){this[rg]=!0,this[si]()},i.disconnectedCallback=function(){typeof r.createRoot=="function"?this[ai].unmount():r.unmountComponentAtNode(this)},i[si]=function(){if(this[rg]===!0){var d={};Object.keys(this).forEach(function(g){o[g]!==!1&&(d[g]=this[g])},this),s=!0;const u=n.shadow?this.shadowRoot:this,f=t.createElement(e,d);typeof r.createRoot=="function"?(this[ai]||(this[ai]=r.createRoot(u)),this[ai].render(f)):r.render(f,u),s=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return JL(d)}):Object.keys(e.propTypes),i.attributeChangedCallback=function(d,u,f){var g=n.dashStyleAttributes?eD(d):d;this[g]=f}),a}var Co={},og;function rD(){if(og)return Co;og=1;var e=Ke;if(process.env.NODE_ENV==="production")Co.createRoot=e.createRoot,Co.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Co.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Co.hydrateRoot=function(r,n,o){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,o)}finally{t.usingClientEntryPoint=!1}}}return Co}var nD=rD();const oD=Ui(nD);function sD(){if(document.getElementById("sb-ce-react-styles"))return;const e=document.createElement("style");e.id="sb-ce-react-styles",e.textContent="@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function aD(e="sb-collection-editor"){if(sD(),typeof customElements>"u"||customElements.get(e))return;const t=tD(tg,h,oD,{});customElements.define(e,t)}xe.CollectionEditor=tg,xe.registerCollectionEditor=aD,xe.setApiBaseUrl=nf,xe.useEditorStore=Z,xe.useLibraryStore=jm,xe.useTreeStore=ae,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})}));