@project-sunbird/collection-editor-react 1.0.0 → 1.0.3

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 (108) hide show
  1. package/README.md +55 -0
  2. package/dist/api/content.d.ts +1 -1
  3. package/dist/api/framework.d.ts +0 -1
  4. package/dist/api/hierarchy.d.ts +7 -1
  5. package/dist/collection-editor.umd.js +144 -104
  6. package/dist/components/AssetBrowser/AssetBrowser.d.ts +0 -1
  7. package/dist/components/AssignPageNumber/AssignPageNumber.d.ts +0 -1
  8. package/dist/components/BulkUpload/CsvUpload.d.ts +0 -1
  9. package/dist/components/Collaborators/ManageCollaborators.d.ts +0 -1
  10. package/dist/components/CollectionEditor/CollectionEditor.d.ts +0 -1
  11. package/dist/components/ContentPlayer/ContentPlayer.d.ts +0 -1
  12. package/dist/components/ContextualEditor/AssessmentDetailPanel.d.ts +7 -0
  13. package/dist/components/ContextualEditor/Breadcrumb.d.ts +0 -1
  14. package/dist/components/ContextualEditor/ContentEditForm.d.ts +0 -1
  15. package/dist/components/ContextualEditor/ContextualEditor.d.ts +0 -1
  16. package/dist/components/ContextualEditor/TabBar.d.ts +0 -1
  17. package/dist/components/ContextualEditor/TitleAppIcon.d.ts +0 -1
  18. package/dist/components/Dialcode/DialcodePanel.d.ts +0 -1
  19. package/dist/components/LibraryDock/FilterChips.d.ts +0 -1
  20. package/dist/components/LibraryDock/LibraryCard.d.ts +0 -1
  21. package/dist/components/LibraryDock/LibraryDock.d.ts +0 -1
  22. package/dist/components/LibraryDock/LibraryFilterPanel.d.ts +0 -1
  23. package/dist/components/LibraryDock/LibraryPreviewPanel.d.ts +0 -1
  24. package/dist/components/OutlineTree/OutlineTree.d.ts +0 -1
  25. package/dist/components/OutlineTree/TreeNode.d.ts +0 -1
  26. package/dist/components/ProgressStatus/ProgressStatus.d.ts +0 -1
  27. package/dist/components/ResourceReorder/ResourceReorderDialog.d.ts +0 -1
  28. package/dist/components/SparkMetaForm/FormSection.d.ts +0 -1
  29. package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +0 -1
  30. package/dist/components/SparkMetaForm/fields/AppIconField.d.ts +0 -1
  31. package/dist/components/SparkMetaForm/fields/AppIconPickerModal.d.ts +0 -1
  32. package/dist/components/SparkMetaForm/fields/ChipGroupField.d.ts +0 -1
  33. package/dist/components/SparkMetaForm/fields/DateTimeField.d.ts +0 -1
  34. package/dist/components/SparkMetaForm/fields/DialcodeInputField.d.ts +0 -1
  35. package/dist/components/SparkMetaForm/fields/KeywordSuggestField.d.ts +0 -1
  36. package/dist/components/SparkMetaForm/fields/LicenseSelectField.d.ts +0 -1
  37. package/dist/components/SparkMetaForm/fields/MultiSelectField.d.ts +0 -1
  38. package/dist/components/SparkMetaForm/fields/NestedSelectField.d.ts +0 -1
  39. package/dist/components/SparkMetaForm/fields/PolicyCardField.d.ts +9 -0
  40. package/dist/components/SparkMetaForm/fields/RadioField.d.ts +0 -1
  41. package/dist/components/SparkMetaForm/fields/SelectField.d.ts +0 -1
  42. package/dist/components/SparkMetaForm/fields/TextField.d.ts +0 -1
  43. package/dist/components/SparkMetaForm/hooks/useCascade.d.ts +0 -1
  44. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +9 -1
  45. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.learningPath.test.d.ts +1 -0
  46. package/dist/components/SplitBuilderShell/SplitBuilderShell.d.ts +0 -1
  47. package/dist/components/Topbar/Topbar.d.ts +0 -1
  48. package/dist/components/UnitContentList/AssessmentSlotItem.d.ts +7 -0
  49. package/dist/components/UnitContentList/ContentRow.d.ts +0 -1
  50. package/dist/components/UnitContentList/SkillPicker.d.ts +15 -0
  51. package/dist/components/UnitContentList/UnitContentList.d.ts +1 -1
  52. package/dist/components/modals/ConfirmDialog.d.ts +0 -1
  53. package/dist/components/modals/PublishChecklist.d.ts +0 -1
  54. package/dist/components/modals/QualityParamsModal.d.ts +0 -1
  55. package/dist/components/modals/UnsavedChangesModal.d.ts +0 -1
  56. package/dist/components/shared/Button.d.ts +0 -1
  57. package/dist/components/shared/Card.d.ts +0 -1
  58. package/dist/components/shared/Chip.d.ts +0 -1
  59. package/dist/components/shared/CourseDetailsPanel.d.ts +11 -0
  60. package/dist/components/shared/DropZone.d.ts +0 -1
  61. package/dist/components/shared/LanguageSelector/LanguageSelector.d.ts +0 -1
  62. package/dist/components/shared/LearningPathIcon.d.ts +6 -0
  63. package/dist/components/shared/Spinner.d.ts +0 -1
  64. package/dist/components/shared/index.d.ts +2 -0
  65. package/dist/dev-mock-api.d.ts +1 -0
  66. package/dist/hooks/useAssessmentSlots.d.ts +16 -0
  67. package/dist/hooks/useChannelData.d.ts +0 -1
  68. package/dist/hooks/useContentType.d.ts +0 -1
  69. package/dist/hooks/useEditorInit.d.ts +0 -1
  70. package/dist/hooks/useFramework.d.ts +0 -1
  71. package/dist/hooks/useLabels.d.ts +0 -1
  72. package/dist/hooks/useLibrary.d.ts +30 -1
  73. package/dist/hooks/useLibrary.test.d.ts +1 -0
  74. package/dist/hooks/useLibraryTargetLabel.d.ts +1 -0
  75. package/dist/hooks/useQumlContent.d.ts +0 -1
  76. package/dist/hooks/useSaveHierarchy.d.ts +6 -0
  77. package/dist/hooks/useSaveHierarchy.test.d.ts +1 -0
  78. package/dist/hooks/useSkillCategory.d.ts +24 -0
  79. package/dist/hooks/useSkillCategory.test.d.ts +1 -0
  80. package/dist/hooks/useSkillScope.d.ts +14 -0
  81. package/dist/hooks/useSkillScope.test.d.ts +1 -0
  82. package/dist/hooks/useToolbarActions.d.ts +0 -1
  83. package/dist/hooks/useTree.d.ts +0 -1
  84. package/dist/i18n/index.d.ts +0 -1
  85. package/dist/i18n/locales/ar.json.d.ts +92 -0
  86. package/dist/i18n/locales/en.json.d.ts +92 -0
  87. package/dist/i18n/locales/fr.json.d.ts +92 -0
  88. package/dist/i18n/locales/pt.json.d.ts +92 -0
  89. package/dist/index.cjs +144 -104
  90. package/dist/index.d.ts +1 -0
  91. package/dist/index.js +10861 -11055
  92. package/dist/services/quml/QumlPlayerService.d.ts +0 -1
  93. package/dist/store/editor.store.d.ts +3 -1
  94. package/dist/store/i18n.store.d.ts +0 -1
  95. package/dist/store/library.store.d.ts +0 -1
  96. package/dist/store/tree.store.d.ts +8 -3
  97. package/dist/store/tree.store.learningPath.test.d.ts +1 -0
  98. package/dist/store/ui.store.d.ts +2 -0
  99. package/dist/style.css +1 -1
  100. package/dist/types/content.d.ts +2 -0
  101. package/dist/types/framework.d.ts +4 -0
  102. package/dist/types/profile.d.ts +30 -0
  103. package/dist/types/profile.test.d.ts +1 -0
  104. package/dist/utils/lpStructure.d.ts +151 -0
  105. package/dist/utils/lpStructure.test.d.ts +1 -0
  106. package/dist/utils/validateRequiredFields.d.ts +0 -1
  107. package/dist/web-component/configRoundTrip.test.d.ts +1 -0
  108. package/package.json +13 -4
@@ -1,4 +1,4 @@
1
- (function(me,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):(me=typeof globalThis<"u"?globalThis:me||self,h(me.CollectionEditorReact={},me.React,me.ReactDOM,me.jsxRuntime))})(this,function(me,h,Pe,c){"use strict";var nO=Object.defineProperty;var wp=me=>{throw TypeError(me)};var oO=(me,h,Pe)=>h in me?nO(me,h,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):me[h]=Pe;var Yo=(me,h,Pe)=>oO(me,typeof h!="symbol"?h+"":h,Pe),Il=(me,h,Pe)=>h.has(me)||wp("Cannot "+Pe);var E=(me,h,Pe)=>(Il(me,h,"read from private field"),Pe?Pe.call(me):h.get(me)),se=(me,h,Pe)=>h.has(me)?wp("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(me):h.set(me,Pe),Y=(me,h,Pe,c)=>(Il(me,h,"write to private field"),c?c.call(me,Pe):h.set(me,Pe),Pe),Se=(me,h,Pe)=>(Il(me,h,"access private method"),Pe);var gi=(me,h,Pe,c)=>({set _(mi){Y(me,h,mi,Pe)},get _(){return E(me,h,c)}});var nn,Pr,qn,dp,dr,on,up,Un,Fr,Vn,fp,an,hp,zn,sn,Hn,Qt,ln,lt,Uo,cn,jt,Cp,_r,pp,xt,Te,Vo,Et,dn,Rn,br,Mr,zo,Qn,Gn,un,fn,$r,Wn,xe,Zo,Ol,Al,Dl,Nl,kl,xl,Ll,Sp,gp,Ho,ur,St,hn,fr,zr,mp,wr,nr,Ro,yp,hr,vp,Xe,Br,jr,Kn,Yn,qr,Zn,Xn,bp;function mi(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 Ne=mi(h);var eo=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(){}},Ep=(dp=class extends eo{constructor(){super();se(this,nn);se(this,Pr);se(this,qn);Y(this,qn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){E(this,Pr)||this.setEventListener(E(this,qn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Pr))==null||t.call(this),Y(this,Pr,void 0))}setEventListener(t){var r;Y(this,qn,t),(r=E(this,Pr))==null||r.call(this),Y(this,Pr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){E(this,nn)!==t&&(Y(this,nn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof E(this,nn)=="boolean"?E(this,nn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},nn=new WeakMap,Pr=new WeakMap,qn=new WeakMap,dp),yi=new Ep,Ip={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Op=(up=class{constructor(){se(this,dr,Ip);se(this,on,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&E(this,on)&&e!==E(this,dr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:E(this,dr),provider:e}),Y(this,dr,e),process.env.NODE_ENV!=="production"&&Y(this,on,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&Y(this,on,!0),E(this,dr).setTimeout(e,t)}clearTimeout(e){E(this,dr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&Y(this,on,!0),E(this,dr).setInterval(e,t)}clearInterval(e){E(this,dr).clearInterval(e)}},dr=new WeakMap,on=new WeakMap,up),Hr=new Op;function Ap(e){setTimeout(e,0)}var Dp=typeof window>"u"||"Deno"in globalThis;function At(){}function Np(e,t){return typeof e=="function"?e(t):e}function vi(e){return typeof e=="number"&&e>=0&&e!==1/0}function Pl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tr(e,t){return typeof e=="function"?e(t):e}function Ft(e,t){return typeof e=="function"?e(t):e}function Fl(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:i,stale:s}=e;if(i){if(n){if(t.queryHash!==bi(i,t.options))return!1}else if(!ro(t.queryKey,i))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||a&&!a(t))}function Ml(e,t){const{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(to(t.options.mutationKey)!==to(a))return!1}else if(!ro(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function bi(e,t){return((t==null?void 0:t.queryKeyHashFn)||to)(e)}function to(e){return JSON.stringify(e,(t,r)=>Si(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function ro(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ro(e[r],t[r])):!1}var kp=Object.prototype.hasOwnProperty;function wi(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=$l(e)&&$l(t);if(!n&&!(Si(e)&&Si(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),s=i.length,l=n?new Array(s):{};let d=0;for(let u=0;u<s;u++){const f=n?u:i[u],m=e[f],g=t[f];if(m===g){l[f]=m,(n?u<a:kp.call(e,f))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){l[f]=g;continue}const C=wi(m,g,r+1);l[f]=C,C===m&&d++}return a===s&&d===a?e:l}function Ci(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 $l(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Si(e){if(!Bl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Bl(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Bl(e){return Object.prototype.toString.call(e)==="[object Object]"}function xp(e){return new Promise(t=>{Hr.setTimeout(t,e)})}function _i(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 wi(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 wi(e,t)}return t}function Lp(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Pp(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Xo=Symbol();function jl(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Xo&&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===Xo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ql(e,t){return typeof e=="function"?e(...t):!!e}function Fp(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 no=(()=>{let e=()=>Dp;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ti(){let e,t;const r=new Promise((o,a)=>{e=o,t=a});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 Mp=Ap;function $p(){let e=[],t=0,r=s=>{s()},n=s=>{s()},o=Mp;const a=s=>{t?e.push(s):o(()=>{r(s)})},i=()=>{const s=e;e=[],s.length&&o(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||i()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{o=s}}}var ut=$p(),Bp=(fp=class extends eo{constructor(){super();se(this,Un,!0);se(this,Fr);se(this,Vn);Y(this,Vn,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(){E(this,Fr)||this.setEventListener(E(this,Vn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Fr))==null||t.call(this),Y(this,Fr,void 0))}setEventListener(t){var r;Y(this,Vn,t),(r=E(this,Fr))==null||r.call(this),Y(this,Fr,t(this.setOnline.bind(this)))}setOnline(t){E(this,Un)!==t&&(Y(this,Un,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return E(this,Un)}},Un=new WeakMap,Fr=new WeakMap,Vn=new WeakMap,fp),Jo=new Bp;function jp(e){return Math.min(1e3*2**e,3e4)}function Ul(e){return(e??"online")==="online"?Jo.isOnline():!0}var Ei=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vl(e){let t=!1,r=0,n;const o=Ti(),a=()=>o.status!=="pending",i=p=>{var y;if(!a()){const v=new Ei(p);m(v),(y=e.onCancel)==null||y.call(e,v)}},s=()=>{t=!0},l=()=>{t=!1},d=()=>yi.isFocused()&&(e.networkMode==="always"||Jo.isOnline())&&e.canRun(),u=()=>Ul(e.networkMode)&&e.canRun(),f=p=>{a()||(n==null||n(),o.resolve(p))},m=p=>{a()||(n==null||n(),o.reject(p))},g=()=>new Promise(p=>{var y;n=v=>{(a()||d())&&p(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var p;n=void 0,a()||(p=e.onContinue)==null||p.call(e)}),C=()=>{if(a())return;let p;const y=r===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(f).catch(v=>{var I;if(a())return;const b=e.retry??(no.isServer()?0:3),w=e.retryDelay??jp,S=typeof w=="function"?w(r,v):w,T=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,v);if(t||!T){m(v);return}r++,(I=e.onFail)==null||I.call(e,r,v),xp(S).then(()=>d()?void 0:g()).then(()=>{t?m(v):C()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?C():g().then(C),o)}}var zl=(hp=class{constructor(){se(this,an)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vi(this.gcTime)&&Y(this,an,Hr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(no.isServer()?1/0:5*60*1e3))}clearGcTimeout(){E(this,an)!==void 0&&(Hr.clearTimeout(E(this,an)),Y(this,an,void 0))}},an=new WeakMap,hp);function qp(e){return{onFetch:(t,r)=>{var u,f,m,g,C;const n=t.options,o=(m=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],i=((C=t.state.data)==null?void 0:C.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const d=async()=>{let p=!1;const y=w=>{Fp(w,()=>t.signal,()=>p=!0)},v=jl(t.options,t.fetchOptions),b=async(w,S,T)=>{if(p)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const N=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:S,direction:T?"backward":"forward",meta:t.options.meta};return y(k),k})(),x=await v(N),{maxPages:B}=t.options,q=T?Pp:Lp;return{pages:q(w.pages,x,B),pageParams:q(w.pageParams,S,B)}};if(o&&a.length){const w=o==="backward",S=w?Up:Hl,T={pages:a,pageParams:i},I=S(n,T);s=await b(T,I,w)}else{const w=e??a.length;do{const S=l===0?i[0]??n.initialPageParam:Hl(n,s);if(l>0&&S==null)break;s=await b(s,S),l++}while(l<w)}return s};t.options.persister?t.fetchFn=()=>{var p,y;return(y=(p=t.options).persister)==null?void 0:y.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function Hl(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 Up(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 Vp=(pp=class extends zl{constructor(t){super();se(this,jt);se(this,zn);se(this,sn);se(this,Hn);se(this,Qt);se(this,ln);se(this,lt);se(this,Uo);se(this,cn);Y(this,cn,!1),Y(this,Uo,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,ln,t.client),Y(this,Qt,E(this,ln).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,sn,Gl(this.options)),this.state=t.state??E(this,sn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return E(this,zn)}get promise(){var t;return(t=E(this,lt))==null?void 0:t.promise}setOptions(t){if(this.options={...E(this,Uo),...t},t!=null&&t._type&&Y(this,zn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Gl(this.options);r.data!==void 0&&(this.setState(Ql(r.data,r.dataUpdatedAt)),Y(this,sn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Qt).remove(this)}setData(t,r){const n=_i(this.state.data,t,this.options);return Se(this,jt,_r).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Se(this,jt,_r).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=E(this,lt))==null?void 0:n.promise;return(o=E(this,lt))==null||o.cancel(t),r?r.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return E(this,sn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ft(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xo||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Tr(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:!Pl(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,lt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,lt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Qt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(E(this,lt)&&(E(this,cn)||Se(this,jt,Cp).call(this)?E(this,lt).cancel({revert:!0}):E(this,lt).cancelRetry()),this.scheduleGc()),E(this,Qt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,jt,_r).call(this,{type:"invalidate"})}async fetch(t,r){var d,u,f,m,g,C,p,y,v,b,w;if(this.state.fetchStatus!=="idle"&&((d=E(this,lt))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(E(this,lt))return E(this,lt).continueRetry(),E(this,lt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(T=>T.options.queryFn);S&&this.setOptions(S.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=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,cn,!0),n.signal)})},a=()=>{const S=jl(this.options,r),I=(()=>{const N={client:E(this,ln),queryKey:this.queryKey,meta:this.meta};return o(N),N})();return Y(this,cn,!1),this.options.persister?this.options.persister(S,I,this):S(I)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:E(this,ln),state:this.state,fetchFn:a};return o(S),S})(),l=E(this,zn)==="infinite"?qp(this.options.pages):this.options.behavior;l==null||l.onFetch(s,this),Y(this,Hn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Se(this,jt,_r).call(this,{type:"fetch",meta:(f=s.fetchOptions)==null?void 0:f.meta}),Y(this,lt,Vl({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof Ei&&S.revert&&this.setState({...E(this,Hn),fetchStatus:"idle"}),n.abort()},onFail:(S,T)=>{Se(this,jt,_r).call(this,{type:"failed",failureCount:S,error:T})},onPause:()=>{Se(this,jt,_r).call(this,{type:"pause"})},onContinue:()=>{Se(this,jt,_r).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await E(this,lt).start();if(S===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(S),(g=(m=E(this,Qt).config).onSuccess)==null||g.call(m,S,this),(p=(C=E(this,Qt).config).onSettled)==null||p.call(C,S,this.state.error,this),S}catch(S){if(S instanceof Ei){if(S.silent)return E(this,lt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Se(this,jt,_r).call(this,{type:"error",error:S}),(v=(y=E(this,Qt).config).onError)==null||v.call(y,S,this),(w=(b=E(this,Qt).config).onSettled)==null||w.call(b,this.state.data,S,this),S}finally{this.scheduleGc()}}},zn=new WeakMap,sn=new WeakMap,Hn=new WeakMap,Qt=new WeakMap,ln=new WeakMap,lt=new WeakMap,Uo=new WeakMap,cn=new WeakMap,jt=new WeakSet,Cp=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},_r=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,...Rl(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Ql(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Hn,t.manual?o:void 0),o;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),ut.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),E(this,Qt).notify({query:this,type:"updated",action:t})})},pp);function Rl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ul(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ql(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gl(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 zp=(gp=class extends eo{constructor(t,r){super();se(this,xe);se(this,xt);se(this,Te);se(this,Vo);se(this,Et);se(this,dn);se(this,Rn);se(this,br);se(this,Mr);se(this,zo);se(this,Qn);se(this,Gn);se(this,un);se(this,fn);se(this,$r);se(this,Wn,new Set);this.options=r,Y(this,xt,t),Y(this,Mr,null),Y(this,br,Ti()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Te).addObserver(this),Wl(E(this,Te),this.options)?Se(this,xe,Zo).call(this):this.updateResult(),Se(this,xe,Nl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ii(E(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ii(E(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,xe,kl).call(this),Se(this,xe,xl).call(this),E(this,Te).removeObserver(this)}setOptions(t){const r=this.options,n=E(this,Te);if(this.options=E(this,xt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ft(this.options.enabled,E(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,xe,Ll).call(this),E(this,Te).setOptions(this.options),r._defaulted&&!Ci(this.options,r)&&E(this,xt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Te),observer:this});const o=this.hasListeners();o&&Kl(E(this,Te),n,this.options,r)&&Se(this,xe,Zo).call(this),this.updateResult(),o&&(E(this,Te)!==n||Ft(this.options.enabled,E(this,Te))!==Ft(r.enabled,E(this,Te))||Tr(this.options.staleTime,E(this,Te))!==Tr(r.staleTime,E(this,Te)))&&Se(this,xe,Ol).call(this);const a=Se(this,xe,Al).call(this);o&&(E(this,Te)!==n||Ft(this.options.enabled,E(this,Te))!==Ft(r.enabled,E(this,Te))||a!==E(this,$r))&&Se(this,xe,Dl).call(this,a)}getOptimisticResult(t){const r=E(this,xt).getQueryCache().build(E(this,xt),t),n=this.createResult(r,t);return Rp(this,n)&&(Y(this,Et,n),Y(this,Rn,this.options),Y(this,dn,E(this,Te).state)),n}getCurrentResult(){return E(this,Et)}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&&E(this,br).status==="pending"&&E(this,br).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){E(this,Wn).add(t)}getCurrentQuery(){return E(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=E(this,xt).defaultQueryOptions(t),n=E(this,xt).getQueryCache().build(E(this,xt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,xe,Zo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Et)))}createResult(t,r){var B;const n=E(this,Te),o=this.options,a=E(this,Et),i=E(this,dn),s=E(this,Rn),d=t!==n?t.state:E(this,Vo),{state:u}=t;let f={...u},m=!1,g;if(r._optimisticResults){const q=this.hasListeners(),k=!q&&Wl(t,r),P=q&&Kl(t,n,r,o);(k||P)&&(f={...f,...Rl(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:C,errorUpdatedAt:p,status:y}=f;g=f.data;let v=!1;if(r.placeholderData!==void 0&&g===void 0&&y==="pending"){let q;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(q=a.data,v=!0):q=typeof r.placeholderData=="function"?r.placeholderData((B=E(this,Gn))==null?void 0:B.state.data,E(this,Gn)):r.placeholderData,q!==void 0&&(y="success",g=_i(a==null?void 0:a.data,q,r),m=!0)}if(r.select&&g!==void 0&&!v)if(a&&g===(i==null?void 0:i.data)&&r.select===E(this,zo))g=E(this,Qn);else try{Y(this,zo,r.select),g=r.select(g),g=_i(a==null?void 0:a.data,g,r),Y(this,Qn,g),Y(this,Mr,null)}catch(q){Y(this,Mr,q)}E(this,Mr)&&(C=E(this,Mr),g=E(this,Qn),p=Date.now(),y="error");const b=f.fetchStatus==="fetching",w=y==="pending",S=y==="error",T=w&&b,I=g!==void 0,x={status:y,fetchStatus:f.fetchStatus,isPending:w,isSuccess:y==="success",isError:S,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:f.dataUpdatedAt,error:C,errorUpdatedAt:p,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&&!w,isLoadingError:S&&!I,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&I,isStale:Oi(t,r),refetch:this.refetch,promise:E(this,br),isEnabled:Ft(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=x.data!==void 0,k=x.status==="error"&&!q,P=F=>{k?F.reject(x.error):q&&F.resolve(x.data)},M=()=>{const F=Y(this,br,x.promise=Ti());P(F)},L=E(this,br);switch(L.status){case"pending":t.queryHash===n.queryHash&&P(L);break;case"fulfilled":(k||x.data!==L.value)&&M();break;case"rejected":(!k||x.error!==L.reason)&&M();break}}return x}updateResult(){const t=E(this,Et),r=this.createResult(E(this,Te),this.options);if(Y(this,dn,E(this,Te).state),Y(this,Rn,this.options),E(this,dn).data!==void 0&&Y(this,Gn,E(this,Te)),Ci(r,t))return;Y(this,Et,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!E(this,Wn).size)return!0;const i=new Set(a??E(this,Wn));return this.options.throwOnError&&i.add("error"),Object.keys(E(this,Et)).some(s=>{const l=s;return E(this,Et)[l]!==t[l]&&i.has(l)})};Se(this,xe,Sp).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,xe,Nl).call(this)}},xt=new WeakMap,Te=new WeakMap,Vo=new WeakMap,Et=new WeakMap,dn=new WeakMap,Rn=new WeakMap,br=new WeakMap,Mr=new WeakMap,zo=new WeakMap,Qn=new WeakMap,Gn=new WeakMap,un=new WeakMap,fn=new WeakMap,$r=new WeakMap,Wn=new WeakMap,xe=new WeakSet,Zo=function(t){Se(this,xe,Ll).call(this);let r=E(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(At)),r},Ol=function(){Se(this,xe,kl).call(this);const t=Tr(this.options.staleTime,E(this,Te));if(no.isServer()||E(this,Et).isStale||!vi(t))return;const n=Pl(E(this,Et).dataUpdatedAt,t)+1;Y(this,un,Hr.setTimeout(()=>{E(this,Et).isStale||this.updateResult()},n))},Al=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Te)):this.options.refetchInterval)??!1},Dl=function(t){Se(this,xe,xl).call(this),Y(this,$r,t),!(no.isServer()||Ft(this.options.enabled,E(this,Te))===!1||!vi(E(this,$r))||E(this,$r)===0)&&Y(this,fn,Hr.setInterval(()=>{(this.options.refetchIntervalInBackground||yi.isFocused())&&Se(this,xe,Zo).call(this)},E(this,$r)))},Nl=function(){Se(this,xe,Ol).call(this),Se(this,xe,Dl).call(this,Se(this,xe,Al).call(this))},kl=function(){E(this,un)!==void 0&&(Hr.clearTimeout(E(this,un)),Y(this,un,void 0))},xl=function(){E(this,fn)!==void 0&&(Hr.clearInterval(E(this,fn)),Y(this,fn,void 0))},Ll=function(){const t=E(this,xt).getQueryCache().build(E(this,xt),this.options);if(t===E(this,Te))return;const r=E(this,Te);Y(this,Te,t),Y(this,Vo,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Sp=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(E(this,Et))}),E(this,xt).getQueryCache().notify({query:E(this,Te),type:"observerResultsUpdated"})})},gp);function Hp(e,t){return Ft(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ft(t.retryOnMount,e)===!1)}function Wl(e,t){return Hp(e,t)||e.state.data!==void 0&&Ii(e,t,t.refetchOnMount)}function Ii(e,t,r){if(Ft(t.enabled,e)!==!1&&Tr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Oi(e,t)}return!1}function Kl(e,t,r,n){return(e!==t||Ft(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Oi(e,r)}function Oi(e,t){return Ft(t.enabled,e)!==!1&&e.isStaleByTime(Tr(t.staleTime,e))}function Rp(e,t){return!Ci(e.getCurrentResult(),t)}var Qp=(mp=class extends zl{constructor(t){super();se(this,fr);se(this,Ho);se(this,ur);se(this,St);se(this,hn);Y(this,Ho,t.client),this.mutationId=t.mutationId,Y(this,St,t.mutationCache),Y(this,ur,[]),this.state=t.state||Gp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,ur).includes(t)||(E(this,ur).push(t),this.clearGcTimeout(),E(this,St).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,ur,E(this,ur).filter(r=>r!==t)),this.scheduleGc(),E(this,St).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,ur).length||(this.state.status==="pending"?this.scheduleGc():E(this,St).remove(this))}continue(){var t;return((t=E(this,hn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,l,d,u,f,m,g,C,p,y,v,b,w,S,T,I,N;const r=()=>{Se(this,fr,zr).call(this,{type:"continue"})},n={client:E(this,Ho),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,hn,Vl({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,B)=>{Se(this,fr,zr).call(this,{type:"failed",failureCount:x,error:B})},onPause:()=>{Se(this,fr,zr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,St).canRun(this)}));const o=this.state.status==="pending",a=!E(this,hn).canStart();try{if(o)r();else{Se(this,fr,zr).call(this,{type:"pending",variables:t,isPaused:a}),E(this,St).config.onMutate&&await E(this,St).config.onMutate(t,this,n);const B=await((s=(i=this.options).onMutate)==null?void 0:s.call(i,t,n));B!==this.state.context&&Se(this,fr,zr).call(this,{type:"pending",context:B,variables:t,isPaused:a})}const x=await E(this,hn).start();return await((d=(l=E(this,St).config).onSuccess)==null?void 0:d.call(l,x,t,this.state.context,this,n)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,x,t,this.state.context,n)),await((g=(m=E(this,St).config).onSettled)==null?void 0:g.call(m,x,null,this.state.variables,this.state.context,this,n)),await((p=(C=this.options).onSettled)==null?void 0:p.call(C,x,null,t,this.state.context,n)),Se(this,fr,zr).call(this,{type:"success",data:x}),x}catch(x){try{await((v=(y=E(this,St).config).onError)==null?void 0:v.call(y,x,t,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((w=(b=this.options).onError)==null?void 0:w.call(b,x,t,this.state.context,n))}catch(B){Promise.reject(B)}try{await((T=(S=E(this,St).config).onSettled)==null?void 0:T.call(S,void 0,x,this.state.variables,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((N=(I=this.options).onSettled)==null?void 0:N.call(I,void 0,x,t,this.state.context,n))}catch(B){Promise.reject(B)}throw Se(this,fr,zr).call(this,{type:"error",error:x}),x}finally{E(this,St).runNext(this)}}},Ho=new WeakMap,ur=new WeakMap,St=new WeakMap,hn=new WeakMap,fr=new WeakSet,zr=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),ut.batch(()=>{E(this,ur).forEach(n=>{n.onMutationUpdate(t)}),E(this,St).notify({mutation:this,type:"updated",action:t})})},mp);function Gp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wp=(yp=class extends eo{constructor(t={}){super();se(this,wr);se(this,nr);se(this,Ro);this.config=t,Y(this,wr,new Set),Y(this,nr,new Map),Y(this,Ro,0)}build(t,r,n){const o=new Qp({client:t,mutationCache:this,mutationId:++gi(this,Ro)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){E(this,wr).add(t);const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r);n?n.push(t):E(this,nr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,wr).delete(t)){const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&E(this,nr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r),o=n==null?void 0:n.find(a=>a.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=ea(t);if(typeof r=="string"){const o=(n=E(this,nr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ut.batch(()=>{E(this,wr).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,wr).clear(),E(this,nr).clear()})}getAll(){return Array.from(E(this,wr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ml(r,n))}findAll(t={}){return this.getAll().filter(r=>Ml(t,r))}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return ut.batch(()=>Promise.all(t.map(r=>r.continue().catch(At))))}},wr=new WeakMap,nr=new WeakMap,Ro=new WeakMap,yp);function ea(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Kp=(vp=class extends eo{constructor(t={}){super();se(this,hr);this.config=t,Y(this,hr,new Map)}build(t,r,n){const o=r.queryKey,a=r.queryHash??bi(o,r);let i=this.get(a);return i||(i=new Vp({client:t,queryKey:o,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){E(this,hr).has(t.queryHash)||(E(this,hr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=E(this,hr).get(t.queryHash);r&&(t.destroy(),r===t&&E(this,hr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,hr).get(t)}getAll(){return[...E(this,hr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Fl(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Fl(t,n)):r}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hr=new WeakMap,vp),Yp=(bp=class{constructor(e={}){se(this,Xe);se(this,Br);se(this,jr);se(this,Kn);se(this,Yn);se(this,qr);se(this,Zn);se(this,Xn);Y(this,Xe,e.queryCache||new Kp),Y(this,Br,e.mutationCache||new Wp),Y(this,jr,e.defaultOptions||{}),Y(this,Kn,new Map),Y(this,Yn,new Map),Y(this,qr,0)}mount(){gi(this,qr)._++,E(this,qr)===1&&(Y(this,Zn,yi.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onFocus())})),Y(this,Xn,Jo.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onOnline())})))}unmount(){var e,t;gi(this,qr)._--,E(this,qr)===0&&((e=E(this,Zn))==null||e.call(this),Y(this,Zn,void 0),(t=E(this,Xn))==null||t.call(this),Y(this,Xn,void 0))}isFetching(e){return E(this,Xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,Br).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=E(this,Xe).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Tr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return E(this,Xe).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=E(this,Xe).get(n.queryHash),a=o==null?void 0:o.state.data,i=Np(t,a);if(i!==void 0)return E(this,Xe).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return ut.batch(()=>E(this,Xe).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=E(this,Xe);ut.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=E(this,Xe);return ut.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=ut.batch(()=>E(this,Xe).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(At).catch(At)}invalidateQueries(e,t={}){return ut.batch(()=>(E(this,Xe).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=ut.batch(()=>E(this,Xe).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let a=o.fetch(void 0,r);return r.throwOnError||(a=a.catch(At)),o.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(At)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=E(this,Xe).build(this,t);return r.isStaleByTime(Tr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(At).catch(At)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(At).catch(At)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Jo.isOnline()?E(this,Br).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Xe)}getMutationCache(){return E(this,Br)}getDefaultOptions(){return E(this,jr)}setDefaultOptions(e){Y(this,jr,e)}setQueryDefaults(e,t){E(this,Kn).set(to(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,Kn).values()],r={};return t.forEach(n=>{ro(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){E(this,Yn).set(to(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,Yn).values()],r={};return t.forEach(n=>{ro(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,jr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bi(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===Xo&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,jr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,Xe).clear(),E(this,Br).clear()}},Xe=new WeakMap,Br=new WeakMap,jr=new WeakMap,Kn=new WeakMap,Yn=new WeakMap,qr=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,bp),Yl=Ne.createContext(void 0),Zp=e=>{const t=Ne.useContext(Yl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Xp=({client:e,children:t})=>(Ne.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Yl.Provider,{value:e,children:t})),Zl=Ne.createContext(!1),Jp=()=>Ne.useContext(Zl);Zl.Provider;function eg(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tg=Ne.createContext(eg()),rg=()=>Ne.useContext(tg),ng=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?ql(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},og=e=>{Ne.useEffect(()=>{e.clearReset()},[e])},ag=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||ql(r,[e.error,n])),ig=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))}},sg=(e,t)=>e.isLoading&&e.isFetching&&!t,lg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Xl=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function cg(e,t,r){var g,C,p,y;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=Jp(),o=rg(),a=Zp(),i=a.defaultQueryOptions(e);(C=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||C.call(g,i);const s=a.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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 l=e.subscribed!==!1;i._optimisticResults=n?"isRestoring":l?"optimistic":void 0,ig(i),ng(i,o,s),og(o);const d=!a.getQueryCache().get(i.queryHash),[u]=Ne.useState(()=>new t(a,i)),f=u.getOptimisticResult(i),m=!n&&l;if(Ne.useSyncExternalStore(Ne.useCallback(v=>{const b=m?u.subscribe(ut.batchCalls(v)):At;return u.updateResult(),b},[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),Ne.useEffect(()=>{u.setOptions(i)},[i,u]),lg(i,f))throw Xl(i,u,o);if(ag({result:f,errorResetBoundary:o,throwOnError:i.throwOnError,query:s,suspense:i.suspense}))throw f.error;if((y=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||y.call(p,i,f),i.experimental_prefetchInRender&&!no.isServer()&&sg(f,n)){const v=d?Xl(i,u,o):s==null?void 0:s.promise;v==null||v.catch(At).finally(()=>{u.updateResult()})}return i.notifyOnChangeProps?f:u.trackResult(f)}function gn(e,t){return cg(e,zp)}let dg={data:""},ug=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||dg},fg=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,hg=/\/\*[^]*?\*\/| +/g,Jl=/\n+/g,Er=(e,t)=>{let r="",n="",o="";for(let a in e){let i=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+i+";":n+=a[1]=="f"?Er(i,a):a+"{"+Er(i,a[1]=="k"?"":t)+"}":typeof i=="object"?n+=Er(i,t?t.replace(/([^,])+/g,s=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,s):s?s+" "+l:l)):a):i!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Er.p?Er.p(a,i):a+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Ir={},ec=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+ec(e[r]);return t}return e},pg=(e,t,r,n,o)=>{let a=ec(e),i=Ir[a]||(Ir[a]=(l=>{let d=0,u=11;for(;d<l.length;)u=101*u+l.charCodeAt(d++)>>>0;return"go"+u})(a));if(!Ir[i]){let l=a!==e?e:(d=>{let u,f,m=[{}];for(;u=fg.exec(d.replace(hg,""));)u[4]?m.shift():u[3]?(f=u[3].replace(Jl," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][u[1]]=u[2].replace(Jl," ").trim();return m[0]})(e);Ir[i]=Er(o?{["@keyframes "+i]:l}:l,r?"":"."+i)}let s=r&&Ir.g;return r&&(Ir.g=Ir[i]),((l,d,u,f)=>{f?d.data=d.data.replace(f,l):d.data.indexOf(l)===-1&&(d.data=u?l+d.data:d.data+l)})(Ir[i],t,n,s),i},gg=(e,t,r)=>e.reduce((n,o,a)=>{let i=t[a];if(i&&i.call){let s=i(r),l=s&&s.props&&s.props.className||/^go/.test(s)&&s;i=l?"."+l:s&&typeof s=="object"?s.props?"":Er(s,""):s===!1?"":s}return n+o+(i??"")},"");function ta(e){let t=this||{},r=e.call?e(t.p):e;return pg(r.unshift?r.raw?gg(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,ug(t.target),t.g,t.o,t.k)}let tc,Ai,Di;ta.bind({g:1});let mr=ta.bind({k:1});function mg(e,t,r,n){Er.p=t,tc=e,Ai=r,Di=n}function Or(e,t){let r=this||{};return function(){let n=arguments;function o(a,i){let s=Object.assign({},a),l=s.className||o.className;r.p=Object.assign({theme:Ai&&Ai()},s),r.o=/go\d/.test(l),s.className=ta.apply(r,n)+(l?" "+l:"");let d=e;return e[0]&&(d=s.as||e,delete s.as),Di&&d[0]&&Di(s),tc(d,s)}return o}}var yg=e=>typeof e=="function",ra=(e,t)=>yg(e)?e(t):e,vg=(()=>{let e=0;return()=>(++e).toString()})(),rc=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),bg=20,Ni="default",nc=(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(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return nc(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+a}))}}},na=[],oc={toasts:[],pausedAt:void 0,settings:{toastLimit:bg}},ar={},ac=(e,t=Ni)=>{ar[t]=nc(ar[t]||oc,e),na.forEach(([r,n])=>{r===t&&n(ar[t])})},ic=e=>Object.keys(ar).forEach(t=>ac(e,t)),wg=e=>Object.keys(ar).find(t=>ar[t].toasts.some(r=>r.id===e)),oa=(e=Ni)=>t=>{ac(t,e)},Cg={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Sg=(e={},t=Ni)=>{let[r,n]=h.useState(ar[t]||oc),o=h.useRef(ar[t]);h.useEffect(()=>(o.current!==ar[t]&&n(ar[t]),na.push([t,n]),()=>{let i=na.findIndex(([s])=>s===t);i>-1&&na.splice(i,1)}),[t]);let a=r.toasts.map(i=>{var s,l,d;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((s=e[i.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((l=e[i.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||Cg[i.type],style:{...e.style,...(d=e[i.type])==null?void 0:d.style,...i.style}}});return{...r,toasts:a}},_g=(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)||vg()}),oo=e=>(t,r)=>{let n=_g(t,e,r);return oa(n.toasterId||wg(n.id))({type:2,toast:n}),n.id},rt=(e,t)=>oo("blank")(e,t);rt.error=oo("error"),rt.success=oo("success"),rt.loading=oo("loading"),rt.custom=oo("custom"),rt.dismiss=(e,t)=>{let r={type:3,toastId:e};t?oa(t)(r):ic(r)},rt.dismissAll=e=>rt.dismiss(void 0,e),rt.remove=(e,t)=>{let r={type:4,toastId:e};t?oa(t)(r):ic(r)},rt.removeAll=e=>rt.remove(void 0,e),rt.promise=(e,t,r)=>{let n=rt.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let a=t.success?ra(t.success,o):void 0;return a?rt.success(a,{id:n,...r,...r==null?void 0:r.success}):rt.dismiss(n),o}).catch(o=>{let a=t.error?ra(t.error,o):void 0;a?rt.error(a,{id:n,...r,...r==null?void 0:r.error}):rt.dismiss(n)}),e};var Tg=1e3,Eg=(e,t="default")=>{let{toasts:r,pausedAt:n}=Sg(e,t),o=h.useRef(new Map).current,a=h.useCallback((f,m=Tg)=>{if(o.has(f))return;let g=setTimeout(()=>{o.delete(f),i({type:4,toastId:f})},m);o.set(f,g)},[]);h.useEffect(()=>{if(n)return;let f=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let C=(g.duration||0)+g.pauseDuration-(f-g.createdAt);if(C<0){g.visible&&rt.dismiss(g.id);return}return setTimeout(()=>rt.dismiss(g.id,t),C)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let i=h.useCallback(oa(t),[t]),s=h.useCallback(()=>{i({type:5,time:Date.now()})},[i]),l=h.useCallback((f,m)=>{i({type:1,toast:{id:f,height:m}})},[i]),d=h.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),u=h.useCallback((f,m)=>{let{reverseOrder:g=!1,gutter:C=8,defaultPosition:p}=m||{},y=r.filter(w=>(w.position||p)===(f.position||p)&&w.height),v=y.findIndex(w=>w.id===f.id),b=y.filter((w,S)=>S<v&&w.visible).length;return y.filter(w=>w.visible).slice(...g?[b+1]:[0,b]).reduce((w,S)=>w+(S.height||0)+C,0)},[r]);return h.useEffect(()=>{r.forEach(f=>{if(f.dismissed)a(f.id,f.removeDelay);else{let m=o.get(f.id);m&&(clearTimeout(m),o.delete(f.id))}})},[r,a]),{toasts:r,handlers:{updateHeight:l,startPause:s,endPause:d,calculateOffset:u}}},Ig=mr`
1
+ (function(ke,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):(ke=typeof globalThis<"u"?globalThis:ke||self,p(ke.CollectionEditorReact={},ke.React,ke.ReactDOM,ke.jsxRuntime))})(this,(function(ke,p,ze,l){"use strict";var Ck=Object.defineProperty;var og=ke=>{throw TypeError(ke)};var Sk=(ke,p,ze)=>p in ke?Ck(ke,p,{enumerable:!0,configurable:!0,writable:!0,value:ze}):ke[p]=ze;var io=(ke,p,ze)=>Sk(ke,typeof p!="symbol"?p+"":p,ze),Wl=(ke,p,ze)=>p.has(ke)||og("Cannot "+ze);var I=(ke,p,ze)=>(Wl(ke,p,"read from private field"),ze?ze.call(ke):p.get(ke)),fe=(ke,p,ze)=>p.has(ke)?og("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(ke):p.set(ke,ze),X=(ke,p,ze,l)=>(Wl(ke,p,"write to private field"),l?l.call(ke,ze):p.set(ke,ze),ze),Oe=(ke,p,ze)=>(Wl(ke,p,"access private method"),ze);var xa=(ke,p,ze,l)=>({set _(Fa){X(ke,p,Fa,ze)},get _(){return I(ke,p,l)}});var un,jr,Gn,Kp,gr,fn,Yp,Kn,Ur,Yn,Zp,hn,Xp,Zn,pn,Xn,tr,gn,pt,Xs,mn,Wt,ag,Ar,Jp,qt,xe,Js,Nt,vn,Jn,wr,zr,eo,es,ts,yn,bn,Vr,rs,qe,lo,Rl,Gl,Kl,Yl,Zl,Xl,Jl,ig,eg,to,mr,Dt,Cn,vr,Kr,tg,_r,cr,ro,rg,yr,ng,tt,Hr,Qr,ns,ss,Wr,os,as,sg;function Fa(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 Be=Fa(p);var cs=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(){}},dg=(Kp=class extends cs{constructor(){super();fe(this,un);fe(this,jr);fe(this,Gn);X(this,Gn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,jr)||this.setEventListener(I(this,Gn))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,jr))==null||t.call(this),X(this,jr,void 0))}setEventListener(t){var r;X(this,Gn,t),(r=I(this,jr))==null||r.call(this),X(this,jr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){I(this,un)!==t&&(X(this,un,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof I(this,un)=="boolean"?I(this,un):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},un=new WeakMap,jr=new WeakMap,Gn=new WeakMap,Kp),Ma=new dg,ug={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fg=(Yp=class{constructor(){fe(this,gr,ug);fe(this,fn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&I(this,fn)&&e!==I(this,gr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:I(this,gr),provider:e}),X(this,gr,e),process.env.NODE_ENV!=="production"&&X(this,fn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&X(this,fn,!0),I(this,gr).setTimeout(e,t)}clearTimeout(e){I(this,gr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&X(this,fn,!0),I(this,gr).setInterval(e,t)}clearInterval(e){I(this,gr).clearInterval(e)}},gr=new WeakMap,fn=new WeakMap,Yp),Yr=new fg;function hg(e){setTimeout(e,0)}var pg=typeof window>"u"||"Deno"in globalThis;function xt(){}function gg(e,t){return typeof e=="function"?e(t):e}function $a(e){return typeof e=="number"&&e>=0&&e!==1/0}function ec(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ir(e,t){return typeof e=="function"?e(t):e}function zt(e,t){return typeof e=="function"?e(t):e}function tc(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==Ba(a,t.options))return!1}else if(!us(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 rc(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(ds(t.options.mutationKey)!==ds(o))return!1}else if(!us(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Ba(e,t){return((t==null?void 0:t.queryKeyHashFn)||ds)(e)}function ds(e){return JSON.stringify(e,(t,r)=>Ua(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function us(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>us(e[r],t[r])):!1}var mg=Object.prototype.hasOwnProperty;function qa(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=nc(e)&&nc(t);if(!n&&!(Ua(e)&&Ua(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],m=e[f],g=t[f];if(m===g){c[f]=m,(n?u<o:mg.call(e,f))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){c[f]=g;continue}const b=qa(m,g,r+1);c[f]=b,b===m&&d++}return o===i&&d===o?e:c}function ja(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 nc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ua(e){if(!sc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!sc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function sc(e){return Object.prototype.toString.call(e)==="[object Object]"}function vg(e){return new Promise(t=>{Yr.setTimeout(t,e)})}function za(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 qa(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 qa(e,t)}return t}function yg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function bg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var co=Symbol();function oc(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===co&&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===co?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ac(e,t){return typeof e=="function"?e(...t):!!e}function Cg(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 fs=(()=>{let e=()=>pg;return{isServer(){return e()},setIsServer(t){e=t}}})();function Va(){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 Sg=hg;function wg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Sg;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 vt=wg(),_g=(Zp=class extends cs{constructor(){super();fe(this,Kn,!0);fe(this,Ur);fe(this,Yn);X(this,Yn,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,Ur)||this.setEventListener(I(this,Yn))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,Ur))==null||t.call(this),X(this,Ur,void 0))}setEventListener(t){var r;X(this,Yn,t),(r=I(this,Ur))==null||r.call(this),X(this,Ur,t(this.setOnline.bind(this)))}setOnline(t){I(this,Kn)!==t&&(X(this,Kn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return I(this,Kn)}},Kn=new WeakMap,Ur=new WeakMap,Yn=new WeakMap,Zp),uo=new _g;function Tg(e){return Math.min(1e3*2**e,3e4)}function ic(e){return(e??"online")==="online"?uo.isOnline():!0}var Ha=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function lc(e){let t=!1,r=0,n;const s=Va(),o=()=>s.status!=="pending",a=h=>{var v;if(!o()){const y=new Ha(h);m(y),(v=e.onCancel)==null||v.call(e,y)}},i=()=>{t=!0},c=()=>{t=!1},d=()=>Ma.isFocused()&&(e.networkMode==="always"||uo.isOnline())&&e.canRun(),u=()=>ic(e.networkMode)&&e.canRun(),f=h=>{o()||(n==null||n(),s.resolve(h))},m=h=>{o()||(n==null||n(),s.reject(h))},g=()=>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)}),b=()=>{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 A;if(o())return;const C=e.retry??(fs.isServer()?0:3),S=e.retryDelay??Tg,w=typeof S=="function"?S(r,y):S,T=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,y);if(t||!T){m(y);return}r++,(A=e.onFail)==null||A.call(e,r,y),vg(w).then(()=>d()?void 0:g()).then(()=>{t?m(y):b()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():g().then(b),s)}}var cc=(Xp=class{constructor(){fe(this,hn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$a(this.gcTime)&&X(this,hn,Yr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fs.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,hn)!==void 0&&(Yr.clearTimeout(I(this,hn)),X(this,hn,void 0))}},hn=new WeakMap,Xp);function Eg(e){return{onFetch:(t,r)=>{var u,f,m,g,b;const n=t.options,s=(m=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,o=((g=t.state.data)==null?void 0:g.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let h=!1;const v=S=>{Cg(S,()=>t.signal,()=>h=!0)},y=oc(t.options,t.fetchOptions),C=async(S,w,T)=>{if(h)return Promise.reject(t.signal.reason);if(w==null&&S.pages.length)return Promise.resolve(S);const L=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return v(N),N})(),E=await y(L),{maxPages:x}=t.options,$=T?bg:yg;return{pages:$(S.pages,E,x),pageParams:$(S.pageParams,w,x)}};if(s&&o.length){const S=s==="backward",w=S?Ag:dc,T={pages:o,pageParams:a},A=w(n,T);i=await C(T,A,S)}else{const S=e??o.length;do{const w=c===0?a[0]??n.initialPageParam:dc(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 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 dc(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 Ag(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 Ig=(Jp=class extends cc{constructor(t){super();fe(this,Wt);fe(this,Zn);fe(this,pn);fe(this,Xn);fe(this,tr);fe(this,gn);fe(this,pt);fe(this,Xs);fe(this,mn);X(this,mn,!1),X(this,Xs,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,gn,t.client),X(this,tr,I(this,gn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,pn,hc(this.options)),this.state=t.state??I(this,pn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return I(this,Zn)}get promise(){var t;return(t=I(this,pt))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,Xs),...t},t!=null&&t._type&&X(this,Zn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=hc(this.options);r.data!==void 0&&(this.setState(fc(r.data,r.dataUpdatedAt)),X(this,pn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,tr).remove(this)}setData(t,r){const n=za(this.state.data,t,this.options);return Oe(this,Wt,Ar).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Oe(this,Wt,Ar).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=I(this,pt))==null?void 0:n.promise;return(s=I(this,pt))==null||s.cancel(t),r?r.then(xt).catch(xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,pn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>zt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===co||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ir(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:!ec(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,pt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=I(this,pt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,tr).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,pt)&&(I(this,mn)||Oe(this,Wt,ag).call(this)?I(this,pt).cancel({revert:!0}):I(this,pt).cancelRetry()),this.scheduleGc()),I(this,tr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,Wt,Ar).call(this,{type:"invalidate"})}async fetch(t,r){var d,u,f,m,g,b,h,v,y,C,S;if(this.state.fetchStatus!=="idle"&&((d=I(this,pt))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,pt))return I(this,pt).continueRetry(),I(this,pt).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:()=>(X(this,mn,!0),n.signal)})},o=()=>{const w=oc(this.options,r),A=(()=>{const L={client:I(this,gn),queryKey:this.queryKey,meta:this.meta};return s(L),L})();return X(this,mn,!1),this.options.persister?this.options.persister(w,A,this):w(A)},i=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,gn),state:this.state,fetchFn:o};return s(w),w})(),c=I(this,Zn)==="infinite"?Eg(this.options.pages):this.options.behavior;c==null||c.onFetch(i,this),X(this,Xn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Oe(this,Wt,Ar).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),X(this,pt,lc({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:w=>{w instanceof Ha&&w.revert&&this.setState({...I(this,Xn),fetchStatus:"idle"}),n.abort()},onFail:(w,T)=>{Oe(this,Wt,Ar).call(this,{type:"failed",failureCount:w,error:T})},onPause:()=>{Oe(this,Wt,Ar).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Wt,Ar).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const w=await I(this,pt).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),(g=(m=I(this,tr).config).onSuccess)==null||g.call(m,w,this),(h=(b=I(this,tr).config).onSettled)==null||h.call(b,w,this.state.error,this),w}catch(w){if(w instanceof Ha){if(w.silent)return I(this,pt).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Oe(this,Wt,Ar).call(this,{type:"error",error:w}),(y=(v=I(this,tr).config).onError)==null||y.call(v,w,this),(S=(C=I(this,tr).config).onSettled)==null||S.call(C,this.state.data,w,this),w}finally{this.scheduleGc()}}},Zn=new WeakMap,pn=new WeakMap,Xn=new WeakMap,tr=new WeakMap,gn=new WeakMap,pt=new WeakMap,Xs=new WeakMap,mn=new WeakMap,Wt=new WeakSet,ag=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ar=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,...uc(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...fc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return X(this,Xn,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),vt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),I(this,tr).notify({query:this,type:"updated",action:t})})},Jp);function uc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ic(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hc(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 kg=(eg=class extends cs{constructor(t,r){super();fe(this,qe);fe(this,qt);fe(this,xe);fe(this,Js);fe(this,Nt);fe(this,vn);fe(this,Jn);fe(this,wr);fe(this,zr);fe(this,eo);fe(this,es);fe(this,ts);fe(this,yn);fe(this,bn);fe(this,Vr);fe(this,rs,new Set);this.options=r,X(this,qt,t),X(this,zr,null),X(this,wr,Va()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,xe).addObserver(this),pc(I(this,xe),this.options)?Oe(this,qe,lo).call(this):this.updateResult(),Oe(this,qe,Yl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qa(I(this,xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qa(I(this,xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,qe,Zl).call(this),Oe(this,qe,Xl).call(this),I(this,xe).removeObserver(this)}setOptions(t){const r=this.options,n=I(this,xe);if(this.options=I(this,qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zt(this.options.enabled,I(this,xe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,qe,Jl).call(this),I(this,xe).setOptions(this.options),r._defaulted&&!ja(this.options,r)&&I(this,qt).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,xe),observer:this});const s=this.hasListeners();s&&gc(I(this,xe),n,this.options,r)&&Oe(this,qe,lo).call(this),this.updateResult(),s&&(I(this,xe)!==n||zt(this.options.enabled,I(this,xe))!==zt(r.enabled,I(this,xe))||Ir(this.options.staleTime,I(this,xe))!==Ir(r.staleTime,I(this,xe)))&&Oe(this,qe,Rl).call(this);const o=Oe(this,qe,Gl).call(this);s&&(I(this,xe)!==n||zt(this.options.enabled,I(this,xe))!==zt(r.enabled,I(this,xe))||o!==I(this,Vr))&&Oe(this,qe,Kl).call(this,o)}getOptimisticResult(t){const r=I(this,qt).getQueryCache().build(I(this,qt),t),n=this.createResult(r,t);return Lg(this,n)&&(X(this,Nt,n),X(this,Jn,this.options),X(this,vn,I(this,xe).state)),n}getCurrentResult(){return I(this,Nt)}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&&I(this,wr).status==="pending"&&I(this,wr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){I(this,rs).add(t)}getCurrentQuery(){return I(this,xe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=I(this,qt).defaultQueryOptions(t),n=I(this,qt).getQueryCache().build(I(this,qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Oe(this,qe,lo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Nt)))}createResult(t,r){var x;const n=I(this,xe),s=this.options,o=I(this,Nt),a=I(this,vn),i=I(this,Jn),d=t!==n?t.state:I(this,Js),{state:u}=t;let f={...u},m=!1,g;if(r._optimisticResults){const $=this.hasListeners(),N=!$&&pc(t,r),P=$&&gc(t,n,r,s);(N||P)&&(f={...f,...uc(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:h,status:v}=f;g=f.data;let y=!1;if(r.placeholderData!==void 0&&g===void 0&&v==="pending"){let $;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?($=o.data,y=!0):$=typeof r.placeholderData=="function"?r.placeholderData((x=I(this,ts))==null?void 0:x.state.data,I(this,ts)):r.placeholderData,$!==void 0&&(v="success",g=za(o==null?void 0:o.data,$,r),m=!0)}if(r.select&&g!==void 0&&!y)if(o&&g===(a==null?void 0:a.data)&&r.select===I(this,eo))g=I(this,es);else try{X(this,eo,r.select),g=r.select(g),g=za(o==null?void 0:o.data,g,r),X(this,es,g),X(this,zr,null)}catch($){X(this,zr,$)}I(this,zr)&&(b=I(this,zr),g=I(this,es),h=Date.now(),v="error");const C=f.fetchStatus==="fetching",S=v==="pending",w=v==="error",T=S&&C,A=g!==void 0,E={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:w,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:h,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&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:w&&A,isStale:Wa(t,r),refetch:this.refetch,promise:I(this,wr),isEnabled:zt(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=E.data!==void 0,N=E.status==="error"&&!$,P=z=>{N?z.reject(E.error):$&&z.resolve(E.data)},q=()=>{const z=X(this,wr,E.promise=Va());P(z)},F=I(this,wr);switch(F.status){case"pending":t.queryHash===n.queryHash&&P(F);break;case"fulfilled":(N||E.data!==F.value)&&q();break;case"rejected":(!N||E.error!==F.reason)&&q();break}}return E}updateResult(){const t=I(this,Nt),r=this.createResult(I(this,xe),this.options);if(X(this,vn,I(this,xe).state),X(this,Jn,this.options),I(this,vn).data!==void 0&&X(this,ts,I(this,xe)),ja(r,t))return;X(this,Nt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!I(this,rs).size)return!0;const a=new Set(o??I(this,rs));return this.options.throwOnError&&a.add("error"),Object.keys(I(this,Nt)).some(i=>{const c=i;return I(this,Nt)[c]!==t[c]&&a.has(c)})};Oe(this,qe,ig).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,qe,Yl).call(this)}},qt=new WeakMap,xe=new WeakMap,Js=new WeakMap,Nt=new WeakMap,vn=new WeakMap,Jn=new WeakMap,wr=new WeakMap,zr=new WeakMap,eo=new WeakMap,es=new WeakMap,ts=new WeakMap,yn=new WeakMap,bn=new WeakMap,Vr=new WeakMap,rs=new WeakMap,qe=new WeakSet,lo=function(t){Oe(this,qe,Jl).call(this);let r=I(this,xe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(xt)),r},Rl=function(){Oe(this,qe,Zl).call(this);const t=Ir(this.options.staleTime,I(this,xe));if(fs.isServer()||I(this,Nt).isStale||!$a(t))return;const n=ec(I(this,Nt).dataUpdatedAt,t)+1;X(this,yn,Yr.setTimeout(()=>{I(this,Nt).isStale||this.updateResult()},n))},Gl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,xe)):this.options.refetchInterval)??!1},Kl=function(t){Oe(this,qe,Xl).call(this),X(this,Vr,t),!(fs.isServer()||zt(this.options.enabled,I(this,xe))===!1||!$a(I(this,Vr))||I(this,Vr)===0)&&X(this,bn,Yr.setInterval(()=>{(this.options.refetchIntervalInBackground||Ma.isFocused())&&Oe(this,qe,lo).call(this)},I(this,Vr)))},Yl=function(){Oe(this,qe,Rl).call(this),Oe(this,qe,Kl).call(this,Oe(this,qe,Gl).call(this))},Zl=function(){I(this,yn)!==void 0&&(Yr.clearTimeout(I(this,yn)),X(this,yn,void 0))},Xl=function(){I(this,bn)!==void 0&&(Yr.clearInterval(I(this,bn)),X(this,bn,void 0))},Jl=function(){const t=I(this,qt).getQueryCache().build(I(this,qt),this.options);if(t===I(this,xe))return;const r=I(this,xe);X(this,xe,t),X(this,Js,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},ig=function(t){vt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(I(this,Nt))}),I(this,qt).getQueryCache().notify({query:I(this,xe),type:"observerResultsUpdated"})})},eg);function Dg(e,t){return zt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&zt(t.retryOnMount,e)===!1)}function pc(e,t){return Dg(e,t)||e.state.data!==void 0&&Qa(e,t,t.refetchOnMount)}function Qa(e,t,r){if(zt(t.enabled,e)!==!1&&Ir(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Wa(e,t)}return!1}function gc(e,t,r,n){return(e!==t||zt(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Wa(e,r)}function Wa(e,t){return zt(t.enabled,e)!==!1&&e.isStaleByTime(Ir(t.staleTime,e))}function Lg(e,t){return!ja(e.getCurrentResult(),t)}var Og=(tg=class extends cc{constructor(t){super();fe(this,vr);fe(this,to);fe(this,mr);fe(this,Dt);fe(this,Cn);X(this,to,t.client),this.mutationId=t.mutationId,X(this,Dt,t.mutationCache),X(this,mr,[]),this.state=t.state||Ng(),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,Dt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,mr,I(this,mr).filter(r=>r!==t)),this.scheduleGc(),I(this,Dt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,mr).length||(this.state.status==="pending"?this.scheduleGc():I(this,Dt).remove(this))}continue(){var t;return((t=I(this,Cn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,c,d,u,f,m,g,b,h,v,y,C,S,w,T,A,L;const r=()=>{Oe(this,vr,Kr).call(this,{type:"continue"})},n={client:I(this,to),meta:this.options.meta,mutationKey:this.options.mutationKey};X(this,Cn,lc({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(E,x)=>{Oe(this,vr,Kr).call(this,{type:"failed",failureCount:E,error:x})},onPause:()=>{Oe(this,vr,Kr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,Dt).canRun(this)}));const s=this.state.status==="pending",o=!I(this,Cn).canStart();try{if(s)r();else{Oe(this,vr,Kr).call(this,{type:"pending",variables:t,isPaused:o}),I(this,Dt).config.onMutate&&await I(this,Dt).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&&Oe(this,vr,Kr).call(this,{type:"pending",context:x,variables:t,isPaused:o})}const E=await I(this,Cn).start();return await((d=(c=I(this,Dt).config).onSuccess)==null?void 0:d.call(c,E,t,this.state.context,this,n)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,E,t,this.state.context,n)),await((g=(m=I(this,Dt).config).onSettled)==null?void 0:g.call(m,E,null,this.state.variables,this.state.context,this,n)),await((h=(b=this.options).onSettled)==null?void 0:h.call(b,E,null,t,this.state.context,n)),Oe(this,vr,Kr).call(this,{type:"success",data:E}),E}catch(E){try{await((y=(v=I(this,Dt).config).onError)==null?void 0:y.call(v,E,t,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,E,t,this.state.context,n))}catch(x){Promise.reject(x)}try{await((T=(w=I(this,Dt).config).onSettled)==null?void 0:T.call(w,void 0,E,this.state.variables,this.state.context,this,n))}catch(x){Promise.reject(x)}try{await((L=(A=this.options).onSettled)==null?void 0:L.call(A,void 0,E,t,this.state.context,n))}catch(x){Promise.reject(x)}throw Oe(this,vr,Kr).call(this,{type:"error",error:E}),E}finally{I(this,Dt).runNext(this)}}},to=new WeakMap,mr=new WeakMap,Dt=new WeakMap,Cn=new WeakMap,vr=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),vt.batch(()=>{I(this,mr).forEach(n=>{n.onMutationUpdate(t)}),I(this,Dt).notify({mutation:this,type:"updated",action:t})})},tg);function Ng(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Pg=(rg=class extends cs{constructor(t={}){super();fe(this,_r);fe(this,cr);fe(this,ro);this.config=t,X(this,_r,new Set),X(this,cr,new Map),X(this,ro,0)}build(t,r,n){const s=new Og({client:t,mutationCache:this,mutationId:++xa(this,ro)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){I(this,_r).add(t);const r=fo(t);if(typeof r=="string"){const n=I(this,cr).get(r);n?n.push(t):I(this,cr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,_r).delete(t)){const r=fo(t);if(typeof r=="string"){const n=I(this,cr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&I(this,cr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=fo(t);if(typeof r=="string"){const n=I(this,cr).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=fo(t);if(typeof r=="string"){const s=(n=I(this,cr).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(){vt.batch(()=>{I(this,_r).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,_r).clear(),I(this,cr).clear()})}getAll(){return Array.from(I(this,_r))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>rc(r,n))}findAll(t={}){return this.getAll().filter(r=>rc(t,r))}notify(t){vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return vt.batch(()=>Promise.all(t.map(r=>r.continue().catch(xt))))}},_r=new WeakMap,cr=new WeakMap,ro=new WeakMap,rg);function fo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var xg=(ng=class extends cs{constructor(t={}){super();fe(this,yr);this.config=t,X(this,yr,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??Ba(s,r);let a=this.get(o);return a||(a=new Ig({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){I(this,yr).has(t.queryHash)||(I(this,yr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=I(this,yr).get(t.queryHash);r&&(t.destroy(),r===t&&I(this,yr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,yr).get(t)}getAll(){return[...I(this,yr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>tc(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>tc(t,n)):r}notify(t){vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yr=new WeakMap,ng),Fg=(sg=class{constructor(e={}){fe(this,tt);fe(this,Hr);fe(this,Qr);fe(this,ns);fe(this,ss);fe(this,Wr);fe(this,os);fe(this,as);X(this,tt,e.queryCache||new xg),X(this,Hr,e.mutationCache||new Pg),X(this,Qr,e.defaultOptions||{}),X(this,ns,new Map),X(this,ss,new Map),X(this,Wr,0)}mount(){xa(this,Wr)._++,I(this,Wr)===1&&(X(this,os,Ma.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,tt).onFocus())})),X(this,as,uo.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,tt).onOnline())})))}unmount(){var e,t;xa(this,Wr)._--,I(this,Wr)===0&&((e=I(this,os))==null||e.call(this),X(this,os,void 0),(t=I(this,as))==null||t.call(this),X(this,as,void 0))}isFetching(e){return I(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,Hr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=I(this,tt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=I(this,tt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ir(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return I(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=I(this,tt).get(n.queryHash),o=s==null?void 0:s.state.data,a=gg(t,o);if(a!==void 0)return I(this,tt).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return vt.batch(()=>I(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=I(this,tt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=I(this,tt);vt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=I(this,tt);return vt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=vt.batch(()=>I(this,tt).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(xt).catch(xt)}invalidateQueries(e,t={}){return vt.batch(()=>(I(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=vt.batch(()=>I(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(xt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(xt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=I(this,tt).build(this,t);return r.isStaleByTime(Ir(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xt).catch(xt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xt).catch(xt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return uo.isOnline()?I(this,Hr).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,tt)}getMutationCache(){return I(this,Hr)}getDefaultOptions(){return I(this,Qr)}setDefaultOptions(e){X(this,Qr,e)}setQueryDefaults(e,t){I(this,ns).set(ds(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,ns).values()],r={};return t.forEach(n=>{us(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){I(this,ss).set(ds(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,ss).values()],r={};return t.forEach(n=>{us(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,Qr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ba(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===co&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,Qr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,tt).clear(),I(this,Hr).clear()}},tt=new WeakMap,Hr=new WeakMap,Qr=new WeakMap,ns=new WeakMap,ss=new WeakMap,Wr=new WeakMap,os=new WeakMap,as=new WeakMap,sg),mc=Be.createContext(void 0),Mg=e=>{const t=Be.useContext(mc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$g=({client:e,children:t})=>(Be.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(mc.Provider,{value:e,children:t})),vc=Be.createContext(!1),Bg=()=>Be.useContext(vc);vc.Provider;function qg(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jg=Be.createContext(qg()),Ug=()=>Be.useContext(jg),zg=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?ac(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Vg=e=>{Be.useEffect(()=>{e.clearReset()},[e])},Hg=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||ac(r,[e.error,n])),Qg=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))}},Wg=(e,t)=>e.isLoading&&e.isFetching&&!t,Rg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,yc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Gg(e,t,r){var g,b,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=Bg(),s=Ug(),o=Mg(),a=o.defaultQueryOptions(e);(b=(g=o.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||b.call(g,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,Qg(a),zg(a,s,i),Vg(s);const d=!o.getQueryCache().get(a.queryHash),[u]=Be.useState(()=>new t(o,a)),f=u.getOptimisticResult(a),m=!n&&c;if(Be.useSyncExternalStore(Be.useCallback(y=>{const C=m?u.subscribe(vt.batchCalls(y)):xt;return u.updateResult(),C},[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),Be.useEffect(()=>{u.setOptions(a)},[a,u]),Rg(a,f))throw yc(a,u,s);if(Hg({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&&!fs.isServer()&&Wg(f,n)){const y=d?yc(a,u,s):i==null?void 0:i.promise;y==null||y.catch(xt).finally(()=>{u.updateResult()})}return a.notifyOnChangeProps?f:u.trackResult(f)}function _n(e,t){return Gg(e,kg)}let Kg={data:""},Yg=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||Kg},Zg=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Xg=/\/\*[^]*?\*\/| +/g,bc=/\n+/g,kr=(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"?kr(a,o):o+"{"+kr(a,o[1]=="k"?"":t)+"}":typeof a=="object"?n+=kr(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+=kr.p?kr.p(o,a):o+":"+a+";")}return r+(t&&s?t+"{"+s+"}":s)+n},Dr={},Cc=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Cc(e[r]);return t}return e},Jg=(e,t,r,n,s)=>{let o=Cc(e),a=Dr[o]||(Dr[o]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(o));if(!Dr[a]){let c=o!==e?e:(d=>{let u,f,m=[{}];for(;u=Zg.exec(d.replace(Xg,""));)u[4]?m.shift():u[3]?(f=u[3].replace(bc," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][u[1]]=u[2].replace(bc," ").trim();return m[0]})(e);Dr[a]=kr(s?{["@keyframes "+a]:c}:c,r?"":"."+a)}let i=r&&Dr.g;return r&&(Dr.g=Dr[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)})(Dr[a],t,n,i),a},em=(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?"":kr(i,""):i===!1?"":i}return n+s+(a??"")},"");function ho(e){let t=this||{},r=e.call?e(t.p):e;return Jg(r.unshift?r.raw?em(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,Yg(t.target),t.g,t.o,t.k)}let Sc,Ra,Ga;ho.bind({g:1});let Sr=ho.bind({k:1});function tm(e,t,r,n){kr.p=t,Sc=e,Ra=r,Ga=n}function Lr(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:Ra&&Ra()},i),r.o=/go\d/.test(c),i.className=ho.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=i.as||e,delete i.as),Ga&&d[0]&&Ga(i),Sc(d,i)}return s}}var rm=e=>typeof e=="function",po=(e,t)=>rm(e)?e(t):e,nm=(()=>{let e=0;return()=>(++e).toString()})(),wc=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),sm=20,Ka="default",_c=(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 _c(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}))}}},go=[],Tc={toasts:[],pausedAt:void 0,settings:{toastLimit:sm}},ur={},Ec=(e,t=Ka)=>{ur[t]=_c(ur[t]||Tc,e),go.forEach(([r,n])=>{r===t&&n(ur[t])})},Ac=e=>Object.keys(ur).forEach(t=>Ec(e,t)),om=e=>Object.keys(ur).find(t=>ur[t].toasts.some(r=>r.id===e)),mo=(e=Ka)=>t=>{Ec(t,e)},am={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},im=(e={},t=Ka)=>{let[r,n]=p.useState(ur[t]||Tc),s=p.useRef(ur[t]);p.useEffect(()=>(s.current!==ur[t]&&n(ur[t]),go.push([t,n]),()=>{let a=go.findIndex(([i])=>i===t);a>-1&&go.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)||am[a.type],style:{...e.style,...(d=e[a.type])==null?void 0:d.style,...a.style}}});return{...r,toasts:o}},lm=(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)||nm()}),hs=e=>(t,r)=>{let n=lm(t,e,r);return mo(n.toasterId||om(n.id))({type:2,toast:n}),n.id},at=(e,t)=>hs("blank")(e,t);at.error=hs("error"),at.success=hs("success"),at.loading=hs("loading"),at.custom=hs("custom"),at.dismiss=(e,t)=>{let r={type:3,toastId:e};t?mo(t)(r):Ac(r)},at.dismissAll=e=>at.dismiss(void 0,e),at.remove=(e,t)=>{let r={type:4,toastId:e};t?mo(t)(r):Ac(r)},at.removeAll=e=>at.remove(void 0,e),at.promise=(e,t,r)=>{let n=at.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let o=t.success?po(t.success,s):void 0;return o?at.success(o,{id:n,...r,...r==null?void 0:r.success}):at.dismiss(n),s}).catch(s=>{let o=t.error?po(t.error,s):void 0;o?at.error(o,{id:n,...r,...r==null?void 0:r.error}):at.dismiss(n)}),e};var cm=1e3,dm=(e,t="default")=>{let{toasts:r,pausedAt:n}=im(e,t),s=p.useRef(new Map).current,o=p.useCallback((f,m=cm)=>{if(s.has(f))return;let g=setTimeout(()=>{s.delete(f),a({type:4,toastId:f})},m);s.set(f,g)},[]);p.useEffect(()=>{if(n)return;let f=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(f-g.createdAt);if(b<0){g.visible&&at.dismiss(g.id);return}return setTimeout(()=>at.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let a=p.useCallback(mo(t),[t]),i=p.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=p.useCallback((f,m)=>{a({type:1,toast:{id:f,height:m}})},[a]),d=p.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),u=p.useCallback((f,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:h}=m||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&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(...g?[C+1]:[0,C]).reduce((S,w)=>S+(w.height||0)+b,0)},[r]);return p.useEffect(()=>{r.forEach(f=>{if(f.dismissed)o(f.id,f.removeDelay);else{let m=s.get(f.id);m&&(clearTimeout(m),s.delete(f.id))}})},[r,o]),{toasts:r,handlers:{updateHeight:c,startPause:i,endPause:d,calculateOffset:u}}},um=Sr`
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
- }`,Og=mr`
9
+ }`,fm=Sr`
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
- }`,Ag=mr`
17
+ }`,hm=Sr`
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
- }`,Dg=Or("div")`
25
+ }`,pm=Lr("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: ${Ig} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
34
+ animation: ${um} 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: ${Og} 0.15s ease-out forwards;
41
+ animation: ${fm} 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: ${Ag} 0.15s ease-out forwards;
54
+ animation: ${hm} 0.15s ease-out forwards;
55
55
  animation-delay: 180ms;
56
56
  transform: rotate(90deg);
57
57
  }
58
- `,Ng=mr`
58
+ `,gm=Sr`
59
59
  from {
60
60
  transform: rotate(0deg);
61
61
  }
62
62
  to {
63
63
  transform: rotate(360deg);
64
64
  }
65
- `,kg=Or("div")`
65
+ `,mm=Lr("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: ${Ng} 1s linear infinite;
74
- `,xg=mr`
73
+ animation: ${gm} 1s linear infinite;
74
+ `,vm=Sr`
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
- }`,Lg=mr`
82
+ }`,ym=Sr`
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
- }`,Pg=Or("div")`
96
+ }`,bm=Lr("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: ${xg} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
105
+ animation: ${vm} 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: ${Lg} 0.2s ease-out forwards;
111
+ animation: ${ym} 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
- `,Fg=Or("div")`
123
+ `,Cm=Lr("div")`
124
124
  position: absolute;
125
- `,Mg=Or("div")`
125
+ `,Sm=Lr("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
- `,$g=mr`
132
+ `,wm=Sr`
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
- }`,Bg=Or("div")`
140
+ }`,_m=Lr("div")`
141
141
  position: relative;
142
142
  transform: scale(0.6);
143
143
  opacity: 0.4;
144
144
  min-width: 20px;
145
- animation: ${$g} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
145
+ animation: ${wm} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
146
146
  forwards;
147
- `,jg=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?Ne.createElement(Bg,null,t):t:r==="blank"?null:Ne.createElement(Mg,null,Ne.createElement(kg,{...n}),r!=="loading"&&Ne.createElement(Fg,null,r==="error"?Ne.createElement(Dg,{...n}):Ne.createElement(Pg,{...n})))},qg=e=>`
147
+ `,Tm=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?Be.createElement(_m,null,t):t:r==="blank"?null:Be.createElement(Sm,null,Be.createElement(mm,{...n}),r!=="loading"&&Be.createElement(Cm,null,r==="error"?Be.createElement(pm,{...n}):Be.createElement(bm,{...n})))},Em=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
- `,Ug=e=>`
150
+ `,Am=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
- `,Vg="0%{opacity:0;} 100%{opacity:1;}",zg="0%{opacity:1;} 100%{opacity:0;}",Hg=Or("div")`
153
+ `,Im="0%{opacity:0;} 100%{opacity:1;}",km="0%{opacity:1;} 100%{opacity:0;}",Dm=Lr("div")`
154
154
  display: flex;
155
155
  align-items: center;
156
156
  background: #fff;
@@ -162,298 +162,338 @@ to {
162
162
  pointer-events: auto;
163
163
  padding: 8px 10px;
164
164
  border-radius: 8px;
165
- `,Rg=Or("div")`
165
+ `,Lm=Lr("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
- `,Qg=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=rc()?[Vg,zg]:[qg(r),Ug(r)];return{animation:t?`${mr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${mr(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Gg=Ne.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Qg(e.position||t||"top-center",e.visible):{opacity:0},a=Ne.createElement(jg,{toast:e}),i=Ne.createElement(Rg,{...e.ariaProps},ra(e.message,e));return Ne.createElement(Hg,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:a,message:i}):Ne.createElement(Ne.Fragment,null,a,i))});mg(Ne.createElement);var Wg=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let a=Ne.useCallback(i=>{if(i){let s=()=>{let l=i.getBoundingClientRect().height;n(e,l)};s(),new MutationObserver(s).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return Ne.createElement("div",{ref:a,className:t,style:r},o)},Kg=(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:rc()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Yg=ta`
172
+ `,Om=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=wc()?[Im,km]:[Em(r),Am(r)];return{animation:t?`${Sr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Sr(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Nm=Be.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?Om(e.position||t||"top-center",e.visible):{opacity:0},o=Be.createElement(Tm,{toast:e}),a=Be.createElement(Lm,{...e.ariaProps},po(e.message,e));return Be.createElement(Dm,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:o,message:a}):Be.createElement(Be.Fragment,null,o,a))});tm(Be.createElement);var Pm=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let o=Be.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 Be.createElement("div",{ref:o,className:t,style:r},s)},xm=(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:wc()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},Fm=ho`
173
173
  z-index: 9999;
174
174
  > * {
175
175
  pointer-events: auto;
176
176
  }
177
- `,aa=16,Zg=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:a,containerStyle:i,containerClassName:s})=>{let{toasts:l,handlers:d}=Eg(r,a);return Ne.createElement("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:aa,left:aa,right:aa,bottom:aa,pointerEvents:"none",...i},className:s,onMouseEnter:d.startPause,onMouseLeave:d.endPause},l.map(u=>{let f=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Kg(f,m);return Ne.createElement(Wg,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Yg:"",style:g},u.type==="custom"?ra(u.message,u):o?o(u):Ne.createElement(Gg,{toast:u,position:f}))}))},Ie=rt;function Xg(){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 ia=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ki(e){return"nodeType"in e}function Tt(e){var t,r;return e?mn(e)?e:ki(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function xi(e){const{Document:t}=Tt(e);return e instanceof t}function ao(e){return mn(e)?!1:e instanceof Tt(e).HTMLElement}function sc(e){return e instanceof Tt(e).SVGElement}function yn(e){return e?mn(e)?e.document:ki(e)?xi(e)?e:ao(e)||sc(e)?e.ownerDocument:document:document:document}const Yt=ia?h.useLayoutEffect:h.useEffect;function sa(e){const t=h.useRef(e);return Yt(()=>{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 Jg(){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 io(e,t){t===void 0&&(t=[e]);const r=h.useRef(e);return Yt(()=>{r.current!==e&&(r.current=e)},t),r}function so(e,t){const r=h.useRef();return h.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function la(e){const t=sa(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 ca(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let Li={};function lo(e,t){return h.useMemo(()=>{if(t)return t;const r=Li[e]==null?0:Li[e]+1;return Li[e]=r,e+"-"+r},[e,t])}function lc(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((a,i)=>{const s=Object.entries(i);for(const[l,d]of s){const u=a[l];u!=null&&(a[l]=u+e*d)}return a},{...t})}}const vn=lc(1),co=lc(-1);function em(e){return"clientX"in e&&"clientY"in e}function da(e){if(!e)return!1;const{KeyboardEvent:t}=Tt(e.target);return t&&e instanceof t}function tm(e){if(!e)return!1;const{TouchEvent:t}=Tt(e.target);return t&&e instanceof t}function ua(e){if(tm(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 em(e)?{x:e.clientX,y:e.clientY}:null}const Ar=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[Ar.Translate.toString(e),Ar.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),cc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function rm(e){return e.matches(cc)?e:e.querySelector(cc)}const nm={display:"none"};function om(e){let{id:t,value:r}=e;return h.createElement("div",{id:t,style:nm},r)}function am(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 im(){const[e,t]=h.useState("");return{announce:h.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const dc=h.createContext(null);function sm(e){const t=h.useContext(dc);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function lm(){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:a}=n;e.forEach(i=>{var s;return(s=i[o])==null?void 0:s.call(i,a)})},[e]),t]}const cm={draggable:`
177
+ `,vo=16,Mm=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:o,containerStyle:a,containerClassName:i})=>{let{toasts:c,handlers:d}=dm(r,o);return Be.createElement("div",{"data-rht-toaster":o||"",style:{position:"fixed",zIndex:9999,top:vo,left:vo,right:vo,bottom:vo,pointerEvents:"none",...a},className:i,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let f=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=xm(f,m);return Be.createElement(Pm,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Fm:"",style:g},u.type==="custom"?po(u.message,u):s?s(u):Be.createElement(Nm,{toast:u,position:f}))}))},we=at;function $m(){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 yo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Tn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ya(e){return"nodeType"in e}function Ot(e){var t,r;return e?Tn(e)?e:Ya(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Za(e){const{Document:t}=Ot(e);return e instanceof t}function ps(e){return Tn(e)?!1:e instanceof Ot(e).HTMLElement}function Ic(e){return e instanceof Ot(e).SVGElement}function En(e){return e?Tn(e)?e.document:Ya(e)?Za(e)?e:ps(e)||Ic(e)?e.ownerDocument:document:document:document}const nr=yo?p.useLayoutEffect:p.useEffect;function bo(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 Bm(){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 gs(e,t){t===void 0&&(t=[e]);const r=p.useRef(e);return nr(()=>{r.current!==e&&(r.current=e)},t),r}function ms(e,t){const r=p.useRef();return p.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Co(e){const t=bo(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 So(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let Xa={};function vs(e,t){return p.useMemo(()=>{if(t)return t;const r=Xa[e]==null?0:Xa[e]+1;return Xa[e]=r,e+"-"+r},[e,t])}function kc(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 An=kc(1),ys=kc(-1);function qm(e){return"clientX"in e&&"clientY"in e}function wo(e){if(!e)return!1;const{KeyboardEvent:t}=Ot(e.target);return t&&e instanceof t}function jm(e){if(!e)return!1;const{TouchEvent:t}=Ot(e.target);return t&&e instanceof t}function _o(e){if(jm(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 qm(e)?{x:e.clientX,y:e.clientY}:null}const Or=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[Or.Translate.toString(e),Or.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Dc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Um(e){return e.matches(Dc)?e:e.querySelector(Dc)}const zm={display:"none"};function Vm(e){let{id:t,value:r}=e;return p.createElement("div",{id:t,style:zm},r)}function Hm(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 Qm(){const[e,t]=p.useState("");return{announce:p.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Lc=p.createContext(null);function Wm(e){const t=p.useContext(Lc);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Rm(){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 Gm={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
- `},dm={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 um(e){let{announcements:t=dm,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=cm}=e;const{announce:a,announcement:i}=im(),s=lo("DndLiveRegion"),[l,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),sm(h.useMemo(()=>({onDragStart(f){let{active:m}=f;a(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:g}=f;t.onDragMove&&a(t.onDragMove({active:m,over:g}))},onDragOver(f){let{active:m,over:g}=f;a(t.onDragOver({active:m,over:g}))},onDragEnd(f){let{active:m,over:g}=f;a(t.onDragEnd({active:m,over:g}))},onDragCancel(f){let{active:m,over:g}=f;a(t.onDragCancel({active:m,over:g}))}}),[a,t])),!l)return null;const u=h.createElement(h.Fragment,null,h.createElement(om,{id:n,value:o.draggable}),h.createElement(am,{id:s,announcement:i}));return r?Pe.createPortal(u,r):u}var nt;(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"})(nt||(nt={}));function fa(){}function Pi(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function uc(){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 Zt=Object.freeze({x:0,y:0});function fc(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fm(e,t){const r=ua(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 hc(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function hm(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function pc(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 gc(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function mc(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 pm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=mc(t,t.left,t.top),a=[];for(const i of n){const{id:s}=i,l=r.get(s);if(l){const d=fc(mc(l),o);a.push({id:s,data:{droppableContainer:i,value:d}})}}return a.sort(hc)},gm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=pc(t),a=[];for(const i of n){const{id:s}=i,l=r.get(s);if(l){const d=pc(l),u=o.reduce((m,g,C)=>m+fc(d[C],g),0),f=Number((u/4).toFixed(4));a.push({id:s,data:{droppableContainer:i,value:f}})}}return a.sort(hc)};function mm(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),a=Math.min(t.top+t.height,e.top+e.height),i=o-n,s=a-r;if(n<o&&r<a){const l=t.width*t.height,d=e.width*e.height,u=i*s,f=u/(l+d-u);return Number(f.toFixed(4))}return 0}const ym=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:i}=a,s=r.get(i);if(s){const l=mm(s,t);l>0&&o.push({id:i,data:{droppableContainer:a,value:l}})}}return o.sort(hm)};function vm(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function yc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zt}function bm(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((i,s)=>({...i,top:i.top+e*s.y,bottom:i.bottom+e*s.y,left:i.left+e*s.x,right:i.right+e*s.x}),{...r})}}const wm=bm(1);function vc(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 Cm(e,t,r){const n=vc(t);if(!n)return e;const{scaleX:o,scaleY:a,x:i,y:s}=n,l=e.left-i-(1-o)*parseFloat(r),d=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),u=o?e.width/o:e.width,f=a?e.height/a:e.height;return{width:u,height:f,top:d,right:l+u,bottom:d+f,left:l}}const Sm={ignoreTransform:!1};function bn(e,t){t===void 0&&(t=Sm);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Tt(e).getComputedStyle(e);d&&(r=Cm(r,d,u))}const{top:n,left:o,width:a,height:i,bottom:s,right:l}=r;return{top:n,left:o,width:a,height:i,bottom:s,right:l}}function bc(e){return bn(e,{ignoreTransform:!0})}function _m(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Tm(e,t){return t===void 0&&(t=Tt(e).getComputedStyle(e)),t.position==="fixed"}function Em(e,t){t===void 0&&(t=Tt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function ha(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(xi(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!ao(o)||sc(o)||r.includes(o))return r;const a=Tt(e).getComputedStyle(o);return o!==e&&Em(o,a)&&r.push(o),Tm(o,a)?r:n(o.parentNode)}return e?n(e):r}function wc(e){const[t]=ha(e,1);return t??null}function Fi(e){return!ia||!e?null:mn(e)?e:ki(e)?xi(e)||e===yn(e).scrollingElement?window:ao(e)?e:null:null}function Cc(e){return mn(e)?e.scrollX:e.scrollLeft}function Sc(e){return mn(e)?e.scrollY:e.scrollTop}function Mi(e){return{x:Cc(e),y:Sc(e)}}var ot;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ot||(ot={}));function _c(e){return!ia||!e?!1:e===document.scrollingElement}function Tc(e){const t={x:0,y:0},r=_c(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,a=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:i,isRight:s,maxScroll:n,minScroll:t}}const Im={x:.2,y:.2};function Om(e,t,r,n,o){let{top:a,left:i,right:s,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Im);const{isTop:d,isBottom:u,isLeft:f,isRight:m}=Tc(e),g={x:0,y:0},C={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!d&&a<=t.top+p.height?(g.y=ot.Backward,C.y=n*Math.abs((t.top+p.height-a)/p.height)):!u&&l>=t.bottom-p.height&&(g.y=ot.Forward,C.y=n*Math.abs((t.bottom-p.height-l)/p.height)),!m&&s>=t.right-p.width?(g.x=ot.Forward,C.x=n*Math.abs((t.right-p.width-s)/p.width)):!f&&i<=t.left+p.width&&(g.x=ot.Backward,C.x=n*Math.abs((t.left+p.width-i)/p.width)),{direction:g,speed:C}}function Am(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:i}=window;return{top:0,left:0,right:a,bottom:i,width:a,height:i}}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 Ec(e){return e.reduce((t,r)=>vn(t,Mi(r)),Zt)}function Dm(e){return e.reduce((t,r)=>t+Cc(r),0)}function Nm(e){return e.reduce((t,r)=>t+Sc(r),0)}function Ic(e,t){if(t===void 0&&(t=bn),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);wc(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const km=[["x",["left","right"],Dm],["y",["top","bottom"],Nm]];class $i{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=ha(r),o=Ec(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,i,s]of km)for(const l of i)Object.defineProperty(this,l,{get:()=>{const d=s(n),u=o[a]-d;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class uo{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 xm(e){const{EventTarget:t}=Tt(e);return e instanceof t?e:yn(e)}function Bi(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 Ut;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ut||(Ut={}));function Oc(e){e.preventDefault()}function Lm(e){e.stopPropagation()}var _e;(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"})(_e||(_e={}));const Ac={start:[_e.Space,_e.Enter],cancel:[_e.Esc],end:[_e.Space,_e.Enter,_e.Tab]},Pm=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case _e.Right:return{...r,x:r.x+25};case _e.Left:return{...r,x:r.x-25};case _e.Down:return{...r,y:r.y+25};case _e.Up:return{...r,y:r.y-25}}};class ji{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 uo(yn(r)),this.windowListeners=new uo(Tt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ut.Resize,this.handleCancel),this.windowListeners.add(Ut.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ut.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Ic(n),r(Zt)}handleKeyDown(t){if(da(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=Ac,coordinateGetter:i=Pm,scrollBehavior:s="smooth"}=o,{code:l}=t;if(a.end.includes(l)){this.handleEnd(t);return}if(a.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:Zt;this.referenceCoordinates||(this.referenceCoordinates=u);const f=i(t,{active:r,context:n.current,currentCoordinates:u});if(f){const m=co(f,u),g={x:0,y:0},{scrollableAncestors:C}=n.current;for(const p of C){const y=t.code,{isTop:v,isRight:b,isLeft:w,isBottom:S,maxScroll:T,minScroll:I}=Tc(p),N=Am(p),x={x:Math.min(y===_e.Right?N.right-N.width/2:N.right,Math.max(y===_e.Right?N.left:N.left+N.width/2,f.x)),y:Math.min(y===_e.Down?N.bottom-N.height/2:N.bottom,Math.max(y===_e.Down?N.top:N.top+N.height/2,f.y))},B=y===_e.Right&&!b||y===_e.Left&&!w,q=y===_e.Down&&!S||y===_e.Up&&!v;if(B&&x.x!==f.x){const k=p.scrollLeft+m.x,P=y===_e.Right&&k<=T.x||y===_e.Left&&k>=I.x;if(P&&!m.y){p.scrollTo({left:k,behavior:s});return}P?g.x=p.scrollLeft-k:g.x=y===_e.Right?p.scrollLeft-T.x:p.scrollLeft-I.x,g.x&&p.scrollBy({left:-g.x,behavior:s});break}else if(q&&x.y!==f.y){const k=p.scrollTop+m.y,P=y===_e.Down&&k<=T.y||y===_e.Up&&k>=I.y;if(P&&!m.x){p.scrollTo({top:k,behavior:s});return}P?g.y=p.scrollTop-k:g.y=y===_e.Down?p.scrollTop-T.y:p.scrollTop-I.y,g.y&&p.scrollBy({top:-g.y,behavior:s});break}}this.handleMove(t,vn(co(f,this.referenceCoordinates),g))}}}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()}}ji.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Ac,onActivation:o}=t,{active:a}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Dc(e){return!!(e&&"distance"in e)}function Nc(e){return!!(e&&"delay"in e)}class qi{constructor(t,r,n){var o;n===void 0&&(n=xm(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:a}=t,{target:i}=a;this.props=t,this.events=r,this.document=yn(i),this.documentListeners=new uo(this.document),this.listeners=new uo(n),this.windowListeners=new uo(Tt(i)),this.initialCoordinates=(o=ua(a))!=null?o:Zt,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(Ut.Resize,this.handleCancel),this.windowListeners.add(Ut.DragStart,Oc),this.windowListeners.add(Ut.VisibilityChange,this.handleCancel),this.windowListeners.add(Ut.ContextMenu,Oc),this.documentListeners.add(Ut.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Nc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Dc(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(Ut.Click,Lm,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ut.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:i,options:{activationConstraint:s}}=a;if(!o)return;const l=(r=ua(t))!=null?r:Zt,d=co(o,l);if(!n&&s){if(Dc(s)){if(s.tolerance!=null&&Bi(d,s.tolerance))return this.handleCancel();if(Bi(d,s.distance))return this.handleStart()}if(Nc(s)&&Bi(d,s.tolerance))return this.handleCancel();this.handlePending(s,d);return}t.cancelable&&t.preventDefault(),i(l)}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===_e.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Fm={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class pa extends qi{constructor(t){const{event:r}=t,n=yn(r.target);super(t,Fm,n)}}pa.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 Mm={move:{name:"mousemove"},end:{name:"mouseup"}};var Ui;(function(e){e[e.RightClick=2]="RightClick"})(Ui||(Ui={}));class $m extends qi{constructor(t){super(t,Mm,yn(t.event.target))}}$m.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Ui.RightClick?!1:(n==null||n({event:r}),!0)}}];const Vi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Bm extends qi{constructor(t){super(t,Vi)}static setup(){return window.addEventListener(Vi.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Vi.move.name,t)};function t(){}}}Bm.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 fo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(fo||(fo={}));var ga;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ga||(ga={}));function jm(e){let{acceleration:t,activator:r=fo.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:i=5,order:s=ga.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:m}=e;const g=Um({delta:f,disabled:!a}),[C,p]=Jg(),y=h.useRef({x:0,y:0}),v=h.useRef({x:0,y:0}),b=h.useMemo(()=>{switch(r){case fo.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case fo.DraggableRect:return o}},[r,o,l]),w=h.useRef(null),S=h.useCallback(()=>{const I=w.current;if(!I)return;const N=y.current.x*v.current.x,x=y.current.y*v.current.y;I.scrollBy(N,x)},[]),T=h.useMemo(()=>s===ga.TreeOrder?[...d].reverse():d,[s,d]);h.useEffect(()=>{if(!a||!d.length||!b){p();return}for(const I of T){if((n==null?void 0:n(I))===!1)continue;const N=d.indexOf(I),x=u[N];if(!x)continue;const{direction:B,speed:q}=Om(I,x,b,t,m);for(const k of["x","y"])g[k][B[k]]||(q[k]=0,B[k]=0);if(q.x>0||q.y>0){p(),w.current=I,C(S,i),y.current=q,v.current=B;return}}y.current={x:0,y:0},v.current={x:0,y:0},p()},[t,S,n,p,a,i,JSON.stringify(b),JSON.stringify(g),C,d,T,u,JSON.stringify(m)])}const qm={x:{[ot.Backward]:!1,[ot.Forward]:!1},y:{[ot.Backward]:!1,[ot.Forward]:!1}};function Um(e){let{delta:t,disabled:r}=e;const n=ca(t);return so(o=>{if(r||!n||!o)return qm;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ot.Backward]:o.x[ot.Backward]||a.x===-1,[ot.Forward]:o.x[ot.Forward]||a.x===1},y:{[ot.Backward]:o.y[ot.Backward]||a.y===-1,[ot.Forward]:o.y[ot.Forward]||a.y===1}}},[r,t,n])}function Vm(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return so(o=>{var a;return t==null?null:(a=n??o)!=null?a:null},[n,t])}function zm(e,t){return h.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...a]},[]),[e,t])}var ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ho||(ho={}));var zi;(function(e){e.Optimized="optimized"})(zi||(zi={}));const kc=new Map;function Hm(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,i]=h.useState(null),{frequency:s,measure:l,strategy:d}=o,u=h.useRef(e),f=y(),m=io(f),g=h.useCallback(function(v){v===void 0&&(v=[]),!m.current&&i(b=>b===null?v:b.concat(v.filter(w=>!b.includes(w))))},[m]),C=h.useRef(null),p=so(v=>{if(f&&!r)return kc;if(!v||v===kc||u.current!==e||a!=null){const b=new Map;for(let w of e){if(!w)continue;if(a&&a.length>0&&!a.includes(w.id)&&w.rect.current){b.set(w.id,w.rect.current);continue}const S=w.node.current,T=S?new $i(l(S),S):null;w.rect.current=T,T&&b.set(w.id,T)}return b}return v},[e,a,r,f,l]);return h.useEffect(()=>{u.current=e},[e]),h.useEffect(()=>{f||g()},[r,f]),h.useEffect(()=>{a&&a.length>0&&i(null)},[JSON.stringify(a)]),h.useEffect(()=>{f||typeof s!="number"||C.current!==null||(C.current=setTimeout(()=>{g(),C.current=null},s))},[s,f,g,...n]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:a!=null};function y(){switch(d){case ho.Always:return!1;case ho.BeforeDragging:return r;default:return!r}}}function Hi(e,t){return so(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Rm(e,t){return Hi(e,t)}function Qm(e){let{callback:t,disabled:r}=e;const n=sa(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ma(e){let{callback:t,disabled:r}=e;const n=sa(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Gm(e){return new $i(bn(e),e)}function xc(e,t,r){t===void 0&&(t=Gm);const[n,o]=h.useState(null);function a(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??r)!=null?d:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const i=Qm({callback(l){if(e)for(const d of l){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),s=ma({callback:a});return Yt(()=>{a(),e?(s==null||s.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),i==null||i.disconnect())},[e]),n}function Wm(e){const t=Hi(e);return yc(e,t)}const Lc=[];function Km(e){const t=h.useRef(e),r=so(n=>e?n&&n!==Lc&&e&&t.current&&e.parentNode===t.current.parentNode?n:ha(e):Lc,[e]);return h.useEffect(()=>{t.current=e},[e]),r}function Ym(e){const[t,r]=h.useState(null),n=h.useRef(e),o=h.useCallback(a=>{const i=Fi(a.target);i&&r(s=>s?(s.set(i,Mi(i)),new Map(s)):null)},[]);return h.useEffect(()=>{const a=n.current;if(e!==a){i(a);const s=e.map(l=>{const d=Fi(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Mi(d)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{i(e),i(a)};function i(s){s.forEach(l=>{const d=Fi(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,i)=>vn(a,i),Zt):Ec(e):Zt,[e,t])}function Pc(e,t){t===void 0&&(t=[]);const r=h.useRef(null);return h.useEffect(()=>{r.current=null},t),h.useEffect(()=>{const n=e!==Zt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?co(e,r.current):Zt}function Zm(e){h.useEffect(()=>{if(!ia)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 Xm(e,t){return h.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=i=>{a(i,t)},r},{}),[e,t])}function Fc(e){return h.useMemo(()=>e?_m(e):null,[e])}const Mc=[];function Jm(e,t){t===void 0&&(t=bn);const[r]=e,n=Fc(r?Tt(r):null),[o,a]=h.useState(Mc);function i(){a(()=>e.length?e.map(l=>_c(l)?n:new $i(t(l),l)):Mc)}const s=ma({callback:i});return Yt(()=>{s==null||s.disconnect(),i(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),o}function $c(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ao(t)?t:e}function ey(e){let{measure:t}=e;const[r,n]=h.useState(null),o=h.useCallback(d=>{for(const{target:u}of d)if(ao(u)){n(f=>{const m=t(u);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),a=ma({callback:o}),i=h.useCallback(d=>{const u=$c(d);a==null||a.disconnect(),u&&(a==null||a.observe(u)),n(u?t(u):null)},[t,a]),[s,l]=la(i);return h.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const ty=[{sensor:pa,options:{}},{sensor:ji,options:{}}],ry={current:{}},ya={draggable:{measure:bc},droppable:{measure:bc,strategy:ho.WhileDragging,frequency:zi.Optimized},dragOverlay:{measure:bn}};class po 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 ny={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new po,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fa},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ya,measureDroppableContainers:fa,windowRect:null,measuringScheduled:!1},Bc={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fa,draggableNodes:new Map,over:null,measureDroppableContainers:fa},go=h.createContext(Bc),jc=h.createContext(ny);function oy(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new po}}}function ay(e,t){switch(t.type){case nt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case nt.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 nt.DragEnd:case nt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case nt.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new po(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case nt.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new po(e.droppable.containers);return i.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case nt.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new po(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function iy(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=h.useContext(go),a=ca(n),i=ca(r==null?void 0:r.id);return h.useEffect(()=>{if(!t&&!n&&a&&i!=null){if(!da(a)||document.activeElement===a.target)return;const s=o.get(i);if(!s)return;const{activatorNode:l,node:d}=s;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[l.current,d.current]){if(!u)continue;const f=rm(u);if(f){f.focus();break}}})}},[n,t,o,i,a]),null}function qc(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function sy(e){return h.useMemo(()=>({draggable:{...ya.draggable,...e==null?void 0:e.draggable},droppable:{...ya.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ya.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 ly(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=h.useRef(!1),{x:i,y:s}=typeof o=="boolean"?{x:o,y:o}:o;Yt(()=>{if(!i&&!s||!t){a.current=!1;return}if(a.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),f=yc(u,n);if(i||(f.x=0),s||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=wc(d);m&&m.scrollBy({top:f.y,left:f.x})}},[t,i,s,n,r])}const va=h.createContext({...Zt,scaleX:1,scaleY:1});var Dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Dr||(Dr={}));const Uc=h.memo(function(t){var r,n,o,a;let{id:i,accessibility:s,autoScroll:l=!0,children:d,sensors:u=ty,collisionDetection:f=ym,measuring:m,modifiers:g,...C}=t;const p=h.useReducer(ay,void 0,oy),[y,v]=p,[b,w]=lm(),[S,T]=h.useState(Dr.Uninitialized),I=S===Dr.Initialized,{draggable:{active:N,nodes:x,translate:B},droppable:{containers:q}}=y,k=N!=null?x.get(N):null,P=h.useRef({initial:null,translated:null}),M=h.useMemo(()=>{var dt;return N!=null?{id:N,data:(dt=k==null?void 0:k.data)!=null?dt:ry,rect:P}:null},[N,k]),L=h.useRef(null),[F,H]=h.useState(null),[X,ve]=h.useState(null),Ee=io(C,Object.values(C)),Ce=lo("DndDescribedBy",i),ue=h.useMemo(()=>q.getEnabled(),[q]),Q=sy(m),{droppableRects:ne,measureDroppableContainers:te,measuringScheduled:V}=Hm(ue,{dragging:I,dependencies:[B.x,B.y],config:Q.droppable}),R=Vm(x,N),ie=h.useMemo(()=>X?ua(X):null,[X]),fe=pn(),J=Rm(R,Q.draggable.measure);ly({activeNode:N!=null?x.get(N):null,config:fe.layoutShiftCompensation,initialRect:J,measure:Q.draggable.measure});const oe=xc(R,Q.draggable.measure,J),Me=xc(R?R.parentElement:null),Oe=h.useRef({activatorEvent:null,active:null,activeNode:R,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:q,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ve=q.getNodeFor((r=Oe.current.over)==null?void 0:r.id),We=ey({measure:Q.dragOverlay.measure}),ze=(n=We.nodeRef.current)!=null?n:R,re=I?(o=We.rect)!=null?o:oe:null,Ke=!!(We.nodeRef.current&&We.rect),Re=Wm(Ke?null:oe),He=Fc(ze?Tt(ze):null),et=Km(I?Ve??R:null),Gt=Jm(et),It=qc(g,{transform:{x:B.x-Re.x,y:B.y-Re.y,scaleX:1,scaleY:1},activatorEvent:X,active:M,activeNodeRect:oe,containerNodeRect:Me,draggingNodeRect:re,over:Oe.current.over,overlayNodeRect:We.rect,scrollableAncestors:et,scrollableAncestorRects:Gt,windowRect:He}),K=ie?vn(ie,B):null,ge=Ym(et),be=Pc(ge),Wt=Pc(ge,[oe]),_=vn(It,be),A=re?wm(re,It):null,D=M&&A?f({active:M,collisionRect:A,droppableRects:ne,droppableContainers:ue,pointerCoordinates:K}):null,z=gc(D,"id"),[j,G]=h.useState(null),U=Ke?It:vn(It,Wt),ee=vm(U,(a=j==null?void 0:j.rect)!=null?a:null,oe),ye=h.useRef(null),Ye=h.useCallback((dt,_t)=>{let{sensor:Ot,options:or}=_t;if(L.current==null)return;const Kt=x.get(L.current);if(!Kt)return;const qt=dt.nativeEvent,pr=new Ot({active:L.current,activeNode:Kt,event:qt,options:or,context:Oe,onAbort(pt){if(!x.get(pt))return;const{onDragAbort:gr}=Ee.current,Sr={id:pt};gr==null||gr(Sr),b({type:"onDragAbort",event:Sr})},onPending(pt,Ur,gr,Sr){if(!x.get(pt))return;const{onDragPending:Wo}=Ee.current,Vr={id:pt,constraint:Ur,initialCoordinates:gr,offset:Sr};Wo==null||Wo(Vr),b({type:"onDragPending",event:Vr})},onStart(pt){const Ur=L.current;if(Ur==null)return;const gr=x.get(Ur);if(!gr)return;const{onDragStart:Sr}=Ee.current,Go={activatorEvent:qt,active:{id:Ur,data:gr.data,rect:P}};Pe.unstable_batchedUpdates(()=>{Sr==null||Sr(Go),T(Dr.Initializing),v({type:nt.DragStart,initialCoordinates:pt,active:Ur}),b({type:"onDragStart",event:Go}),H(ye.current),ve(qt)})},onMove(pt){v({type:nt.DragMove,coordinates:pt})},onEnd:Jn(nt.DragEnd),onCancel:Jn(nt.DragCancel)});ye.current=pr;function Jn(pt){return async function(){const{active:gr,collisions:Sr,over:Go,scrollAdjustedTranslate:Wo}=Oe.current;let Vr=null;if(gr&&Wo){const{cancelDrop:Ko}=Ee.current;Vr={activatorEvent:qt,active:gr,collisions:Sr,delta:Wo,over:Go},pt===nt.DragEnd&&typeof Ko=="function"&&await Promise.resolve(Ko(Vr))&&(pt=nt.DragCancel)}L.current=null,Pe.unstable_batchedUpdates(()=>{v({type:pt}),T(Dr.Uninitialized),G(null),H(null),ve(null),ye.current=null;const Ko=pt===nt.DragEnd?"onDragEnd":"onDragCancel";if(Vr){const El=Ee.current[Ko];El==null||El(Vr),b({type:Ko,event:Vr})}})}}},[x]),Lt=h.useCallback((dt,_t)=>(Ot,or)=>{const Kt=Ot.nativeEvent,qt=x.get(or);if(L.current!==null||!qt||Kt.dndKit||Kt.defaultPrevented)return;const pr={active:qt};dt(Ot,_t.options,pr)===!0&&(Kt.dndKit={capturedBy:_t.sensor},L.current=or,Ye(Ot,_t))},[x,Ye]),Pt=zm(u,Lt);Zm(u),Yt(()=>{oe&&S===Dr.Initializing&&T(Dr.Initialized)},[oe,S]),h.useEffect(()=>{const{onDragMove:dt}=Ee.current,{active:_t,activatorEvent:Ot,collisions:or,over:Kt}=Oe.current;if(!_t||!Ot)return;const qt={active:_t,activatorEvent:Ot,collisions:or,delta:{x:_.x,y:_.y},over:Kt};Pe.unstable_batchedUpdates(()=>{dt==null||dt(qt),b({type:"onDragMove",event:qt})})},[_.x,_.y]),h.useEffect(()=>{const{active:dt,activatorEvent:_t,collisions:Ot,droppableContainers:or,scrollAdjustedTranslate:Kt}=Oe.current;if(!dt||L.current==null||!_t||!Kt)return;const{onDragOver:qt}=Ee.current,pr=or.get(z),Jn=pr&&pr.rect.current?{id:pr.id,rect:pr.rect.current,data:pr.data,disabled:pr.disabled}:null,pt={active:dt,activatorEvent:_t,collisions:Ot,delta:{x:Kt.x,y:Kt.y},over:Jn};Pe.unstable_batchedUpdates(()=>{G(Jn),qt==null||qt(pt),b({type:"onDragOver",event:pt})})},[z]),Yt(()=>{Oe.current={activatorEvent:X,active:M,activeNode:R,collisionRect:A,collisions:D,droppableRects:ne,draggableNodes:x,draggingNode:ze,draggingNodeRect:re,droppableContainers:q,over:j,scrollableAncestors:et,scrollAdjustedTranslate:_},P.current={initial:re,translated:A}},[M,R,D,A,x,ze,re,ne,q,j,et,_]),jm({...fe,delta:B,draggingRect:A,pointerCoordinates:K,scrollableAncestors:et,scrollableAncestorRects:Gt});const Cr=h.useMemo(()=>({active:M,activeNode:R,activeNodeRect:oe,activatorEvent:X,collisions:D,containerNodeRect:Me,dragOverlay:We,draggableNodes:x,droppableContainers:q,droppableRects:ne,over:j,measureDroppableContainers:te,scrollableAncestors:et,scrollableAncestorRects:Gt,measuringConfiguration:Q,measuringScheduled:V,windowRect:He}),[M,R,oe,X,D,Me,We,x,q,ne,j,te,et,Gt,Q,V,He]),Qo=h.useMemo(()=>({activatorEvent:X,activators:Pt,active:M,activeNodeRect:oe,ariaDescribedById:{draggable:Ce},dispatch:v,draggableNodes:x,over:j,measureDroppableContainers:te}),[X,Pt,M,oe,v,Ce,x,j,te]);return h.createElement(dc.Provider,{value:w},h.createElement(go.Provider,{value:Qo},h.createElement(jc.Provider,{value:Cr},h.createElement(va.Provider,{value:ee},d)),h.createElement(iy,{disabled:(s==null?void 0:s.restoreFocus)===!1})),h.createElement(um,{...s,hiddenTextDescribedById:Ce}));function pn(){const dt=(F==null?void 0:F.autoScrollEnabled)===!1,_t=typeof l=="object"?l.enabled===!1:l===!1,Ot=I&&!dt&&!_t;return typeof l=="object"?{...l,enabled:Ot}:{enabled:Ot}}}),cy=h.createContext(null),Vc="button",dy="Draggable";function zc(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=lo(dy),{activators:i,activatorEvent:s,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:m}=h.useContext(go),{role:g=Vc,roleDescription:C="draggable",tabIndex:p=0}=o??{},y=(l==null?void 0:l.id)===t,v=h.useContext(y?va:cy),[b,w]=la(),[S,T]=la(),I=Xm(i,t),N=io(r);Yt(()=>(f.set(t,{id:t,key:a,node:b,activatorNode:S,data:N}),()=>{const B=f.get(t);B&&B.key===a&&f.delete(t)}),[f,t]);const x=h.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":n,"aria-pressed":y&&g===Vc?!0:void 0,"aria-roledescription":C,"aria-describedby":u.draggable}),[n,g,p,y,C,u.draggable]);return{active:l,activatorEvent:s,activeNodeRect:d,attributes:x,isDragging:y,listeners:n?void 0:I,node:b,over:m,setNodeRef:w,setActivatorNodeRef:T,transform:v}}function Hc(){return h.useContext(jc)}const uy="Droppable",fy={timeout:25};function hy(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=lo(uy),{active:i,dispatch:s,over:l,measureDroppableContainers:d}=h.useContext(go),u=h.useRef({disabled:r}),f=h.useRef(!1),m=h.useRef(null),g=h.useRef(null),{disabled:C,updateMeasurementsFor:p,timeout:y}={...fy,...o},v=io(p??n),b=h.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),g.current=null},y)},[y]),w=ma({callback:b,disabled:C||!i}),S=h.useCallback((x,B)=>{w&&(B&&(w.unobserve(B),f.current=!1),x&&w.observe(x))},[w]),[T,I]=la(S),N=io(t);return h.useEffect(()=>{!w||!T.current||(w.disconnect(),f.current=!1,w.observe(T.current))},[T,w]),h.useEffect(()=>(s({type:nt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:T,rect:m,data:N}}),()=>s({type:nt.UnregisterDroppable,key:a,id:n})),[n]),h.useEffect(()=>{r!==u.current.disabled&&(s({type:nt.SetDroppableDisabled,id:n,key:a,disabled:r}),u.current.disabled=r)},[n,a,r,s]),{active:i,rect:m,isOver:(l==null?void 0:l.id)===n,node:T,over:l,setNodeRef:I}}function py(e){let{animation:t,children:r}=e;const[n,o]=h.useState(null),[a,i]=h.useState(null),s=ca(r);return!r&&!n&&s&&o(s),Yt(()=>{if(!a)return;const l=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(l==null||d==null){o(null);return}Promise.resolve(t(d,a)).then(()=>{o(null)})},[t,n,a]),h.createElement(h.Fragment,null,r,n?h.cloneElement(n,{ref:i}):null)}const gy={x:0,y:0,scaleX:1,scaleY:1};function my(e){let{children:t}=e;return h.createElement(go.Provider,{value:Bc},h.createElement(va.Provider,{value:gy},t))}const yy={position:"fixed",touchAction:"none"},vy=e=>da(e)?"transform 250ms ease":void 0,by=h.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:a,className:i,rect:s,style:l,transform:d,transition:u=vy}=e;if(!s)return null;const f=o?d:{...d,scaleX:1,scaleY:1},m={...yy,width:s.width,height:s.height,top:s.top,left:s.left,transform:Ar.Transform.toString(f),transformOrigin:o&&n?fm(n,s):void 0,transition:typeof u=="function"?u(n):u,...l};return h.createElement(r,{className:i,style:m,ref:t},a)}),wy={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Ar.Transform.toString(t)},{transform:Ar.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:a,className:i}=e;if(a!=null&&a.active)for(const[s,l]of Object.entries(a.active))l!==void 0&&(o[s]=r.node.style.getPropertyValue(s),r.node.style.setProperty(s,l));if(a!=null&&a.dragOverlay)for(const[s,l]of Object.entries(a.dragOverlay))l!==void 0&&n.node.style.setProperty(s,l);return i!=null&&i.active&&r.node.classList.add(i.active),i!=null&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[l,d]of Object.entries(o))r.node.style.setProperty(l,d);i!=null&&i.active&&r.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function Cy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return sa((a,i)=>{if(t===null)return;const s=r.get(a);if(!s)return;const l=s.node.current;if(!l)return;const d=$c(i);if(!d)return;const{transform:u}=Tt(i).getComputedStyle(i),f=vc(u);if(!f)return;const m=typeof t=="function"?t:Sy(t);return Ic(l,o.draggable.measure),m({active:{id:a,data:s.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function Sy(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...wy,...e};return a=>{let{active:i,dragOverlay:s,transform:l,...d}=a;if(!t)return;const u={x:s.rect.left-i.rect.left,y:s.rect.top-i.rect.top},f={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/s.rect.height:1},m={x:l.x-u.x,y:l.y-u.y,...f},g=o({...d,active:i,dragOverlay:s,transform:{initial:l,final:m}}),[C]=g,p=g[g.length-1];if(JSON.stringify(C)===JSON.stringify(p))return;const y=n==null?void 0:n({active:i,dragOverlay:s,...d}),v=s.node.animate(g,{duration:t,easing:r,fill:"forwards"});return new Promise(b=>{v.onfinish=()=>{y==null||y(),b()}})}}let Rc=0;function _y(e){return h.useMemo(()=>{if(e!=null)return Rc++,Rc},[e])}const Ty=h.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:a,modifiers:i,wrapperElement:s="div",className:l,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:m,containerNodeRect:g,draggableNodes:C,droppableContainers:p,dragOverlay:y,over:v,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:S,windowRect:T}=Hc(),I=h.useContext(va),N=_y(f==null?void 0:f.id),x=qc(i,{activatorEvent:u,active:f,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:y.rect,over:v,overlayNodeRect:y.rect,scrollableAncestors:w,scrollableAncestorRects:S,transform:I,windowRect:T}),B=Hi(m),q=Cy({config:n,draggableNodes:C,droppableContainers:p,measuringConfiguration:b}),k=B?y.setRef:void 0;return h.createElement(my,null,h.createElement(py,{animation:q},f&&N?h.createElement(by,{key:N,id:f.id,ref:k,as:s,activatorEvent:u,adjustScale:t,className:l,transition:a,rect:B,style:{zIndex:d,...o},transform:x},r):null))});/**
181
+ `},Km={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 Ym(e){let{announcements:t=Km,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=Gm}=e;const{announce:o,announcement:a}=Qm(),i=vs("DndLiveRegion"),[c,d]=p.useState(!1);if(p.useEffect(()=>{d(!0)},[]),Wm(p.useMemo(()=>({onDragStart(f){let{active:m}=f;o(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:g}=f;t.onDragMove&&o(t.onDragMove({active:m,over:g}))},onDragOver(f){let{active:m,over:g}=f;o(t.onDragOver({active:m,over:g}))},onDragEnd(f){let{active:m,over:g}=f;o(t.onDragEnd({active:m,over:g}))},onDragCancel(f){let{active:m,over:g}=f;o(t.onDragCancel({active:m,over:g}))}}),[o,t])),!c)return null;const u=p.createElement(p.Fragment,null,p.createElement(Vm,{id:n,value:s.draggable}),p.createElement(Hm,{id:i,announcement:a}));return r?ze.createPortal(u,r):u}var it;(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"})(it||(it={}));function To(){}function Ja(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Oc(){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 Nc(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Zm(e,t){const r=_o(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 Pc(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Xm(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function xc(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 Fc(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Mc(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 Jm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Mc(t,t.left,t.top),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=Nc(Mc(c),s);o.push({id:i,data:{droppableContainer:a,value:d}})}}return o.sort(Pc)},ev=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=xc(t),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const d=xc(c),u=s.reduce((m,g,b)=>m+Nc(d[b],g),0),f=Number((u/4).toFixed(4));o.push({id:i,data:{droppableContainer:a,value:f}})}}return o.sort(Pc)};function tv(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 rv=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=tv(i,t);c>0&&s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(Xm)};function nv(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function $c(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:sr}function sv(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 ov=sv(1);function Bc(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 av(e,t,r){const n=Bc(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 iv={ignoreTransform:!1};function In(e,t){t===void 0&&(t=iv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Ot(e).getComputedStyle(e);d&&(r=av(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 qc(e){return In(e,{ignoreTransform:!0})}function lv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function cv(e,t){return t===void 0&&(t=Ot(e).getComputedStyle(e)),t.position==="fixed"}function dv(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 Eo(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(Za(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!ps(s)||Ic(s)||r.includes(s))return r;const o=Ot(e).getComputedStyle(s);return s!==e&&dv(s,o)&&r.push(s),cv(s,o)?r:n(s.parentNode)}return e?n(e):r}function jc(e){const[t]=Eo(e,1);return t??null}function ei(e){return!yo||!e?null:Tn(e)?e:Ya(e)?Za(e)||e===En(e).scrollingElement?window:ps(e)?e:null:null}function Uc(e){return Tn(e)?e.scrollX:e.scrollLeft}function zc(e){return Tn(e)?e.scrollY:e.scrollTop}function ti(e){return{x:Uc(e),y:zc(e)}}var ut;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));function Vc(e){return!yo||!e?!1:e===document.scrollingElement}function Hc(e){const t={x:0,y:0},r=Vc(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 uv={x:.2,y:.2};function fv(e,t,r,n,s){let{top:o,left:a,right:i,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=uv);const{isTop:d,isBottom:u,isLeft:f,isRight:m}=Hc(e),g={x:0,y:0},b={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!d&&o<=t.top+h.height?(g.y=ut.Backward,b.y=n*Math.abs((t.top+h.height-o)/h.height)):!u&&c>=t.bottom-h.height&&(g.y=ut.Forward,b.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!m&&i>=t.right-h.width?(g.x=ut.Forward,b.x=n*Math.abs((t.right-h.width-i)/h.width)):!f&&a<=t.left+h.width&&(g.x=ut.Backward,b.x=n*Math.abs((t.left+h.width-a)/h.width)),{direction:g,speed:b}}function hv(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 Qc(e){return e.reduce((t,r)=>An(t,ti(r)),sr)}function pv(e){return e.reduce((t,r)=>t+Uc(r),0)}function gv(e){return e.reduce((t,r)=>t+zc(r),0)}function Wc(e,t){if(t===void 0&&(t=In),!e)return;const{top:r,left:n,bottom:s,right:o}=t(e);jc(e)&&(s<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const mv=[["x",["left","right"],pv],["y",["top","bottom"],gv]];class ri{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=Eo(r),s=Qc(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,i]of mv)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 bs{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 vv(e){const{EventTarget:t}=Ot(e);return e instanceof t?e:En(e)}function ni(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 Gt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Gt||(Gt={}));function Rc(e){e.preventDefault()}function yv(e){e.stopPropagation()}var Ne;(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"})(Ne||(Ne={}));const Gc={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter,Ne.Tab]},bv=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ne.Right:return{...r,x:r.x+25};case Ne.Left:return{...r,x:r.x-25};case Ne.Down:return{...r,y:r.y+25};case Ne.Up:return{...r,y:r.y-25}}};class si{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 bs(En(r)),this.windowListeners=new bs(Ot(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gt.Resize,this.handleCancel),this.windowListeners.add(Gt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Wc(n),r(sr)}handleKeyDown(t){if(wo(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:o=Gc,coordinateGetter:a=bv,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 m=ys(f,u),g={x:0,y:0},{scrollableAncestors:b}=n.current;for(const h of b){const v=t.code,{isTop:y,isRight:C,isLeft:S,isBottom:w,maxScroll:T,minScroll:A}=Hc(h),L=hv(h),E={x:Math.min(v===Ne.Right?L.right-L.width/2:L.right,Math.max(v===Ne.Right?L.left:L.left+L.width/2,f.x)),y:Math.min(v===Ne.Down?L.bottom-L.height/2:L.bottom,Math.max(v===Ne.Down?L.top:L.top+L.height/2,f.y))},x=v===Ne.Right&&!C||v===Ne.Left&&!S,$=v===Ne.Down&&!w||v===Ne.Up&&!y;if(x&&E.x!==f.x){const N=h.scrollLeft+m.x,P=v===Ne.Right&&N<=T.x||v===Ne.Left&&N>=A.x;if(P&&!m.y){h.scrollTo({left:N,behavior:i});return}P?g.x=h.scrollLeft-N:g.x=v===Ne.Right?h.scrollLeft-T.x:h.scrollLeft-A.x,g.x&&h.scrollBy({left:-g.x,behavior:i});break}else if($&&E.y!==f.y){const N=h.scrollTop+m.y,P=v===Ne.Down&&N<=T.y||v===Ne.Up&&N>=A.y;if(P&&!m.x){h.scrollTo({top:N,behavior:i});return}P?g.y=h.scrollTop-N:g.y=v===Ne.Down?h.scrollTop-T.y:h.scrollTop-A.y,g.y&&h.scrollBy({top:-g.y,behavior:i});break}}this.handleMove(t,An(ys(f,this.referenceCoordinates),g))}}}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()}}si.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Gc,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 Kc(e){return!!(e&&"distance"in e)}function Yc(e){return!!(e&&"delay"in e)}class oi{constructor(t,r,n){var s;n===void 0&&(n=vv(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=En(a),this.documentListeners=new bs(this.document),this.listeners=new bs(n),this.windowListeners=new bs(Ot(a)),this.initialCoordinates=(s=_o(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(Gt.Resize,this.handleCancel),this.windowListeners.add(Gt.DragStart,Rc),this.windowListeners.add(Gt.VisibilityChange,this.handleCancel),this.windowListeners.add(Gt.ContextMenu,Rc),this.documentListeners.add(Gt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Kc(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(Gt.Click,yv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gt.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=_o(t))!=null?r:sr,d=ys(s,c);if(!n&&i){if(Kc(i)){if(i.tolerance!=null&&ni(d,i.tolerance))return this.handleCancel();if(ni(d,i.distance))return this.handleStart()}if(Yc(i)&&ni(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===Ne.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Cv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ao extends oi{constructor(t){const{event:r}=t,n=En(r.target);super(t,Cv,n)}}Ao.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 Sv={move:{name:"mousemove"},end:{name:"mouseup"}};var ai;(function(e){e[e.RightClick=2]="RightClick"})(ai||(ai={}));class wv extends oi{constructor(t){super(t,Sv,En(t.event.target))}}wv.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===ai.RightClick?!1:(n==null||n({event:r}),!0)}}];const ii={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _v extends oi{constructor(t){super(t,ii)}static setup(){return window.addEventListener(ii.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ii.move.name,t)};function t(){}}}_v.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 Cs;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Cs||(Cs={}));var Io;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Io||(Io={}));function Tv(e){let{acceleration:t,activator:r=Cs.Pointer,canScroll:n,draggingRect:s,enabled:o,interval:a=5,order:i=Io.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:m}=e;const g=Av({delta:f,disabled:!o}),[b,h]=Bm(),v=p.useRef({x:0,y:0}),y=p.useRef({x:0,y:0}),C=p.useMemo(()=>{switch(r){case Cs.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Cs.DraggableRect:return s}},[r,s,c]),S=p.useRef(null),w=p.useCallback(()=>{const A=S.current;if(!A)return;const L=v.current.x*y.current.x,E=v.current.y*y.current.y;A.scrollBy(L,E)},[]),T=p.useMemo(()=>i===Io.TreeOrder?[...d].reverse():d,[i,d]);p.useEffect(()=>{if(!o||!d.length||!C){h();return}for(const A of T){if((n==null?void 0:n(A))===!1)continue;const L=d.indexOf(A),E=u[L];if(!E)continue;const{direction:x,speed:$}=fv(A,E,C,t,m);for(const N of["x","y"])g[N][x[N]]||($[N]=0,x[N]=0);if($.x>0||$.y>0){h(),S.current=A,b(w,a),v.current=$,y.current=x;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,w,n,h,o,a,JSON.stringify(C),JSON.stringify(g),b,d,T,u,JSON.stringify(m)])}const Ev={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};function Av(e){let{delta:t,disabled:r}=e;const n=So(t);return ms(s=>{if(r||!n||!s)return Ev;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ut.Backward]:s.x[ut.Backward]||o.x===-1,[ut.Forward]:s.x[ut.Forward]||o.x===1},y:{[ut.Backward]:s.y[ut.Backward]||o.y===-1,[ut.Forward]:s.y[ut.Forward]||o.y===1}}},[r,t,n])}function Iv(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return ms(s=>{var o;return t==null?null:(o=n??s)!=null?o:null},[n,t])}function kv(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 Ss;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ss||(Ss={}));var li;(function(e){e.Optimized="optimized"})(li||(li={}));const Zc=new Map;function Dv(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(),m=gs(f),g=p.useCallback(function(y){y===void 0&&(y=[]),!m.current&&a(C=>C===null?y:C.concat(y.filter(S=>!C.includes(S))))},[m]),b=p.useRef(null),h=ms(y=>{if(f&&!r)return Zc;if(!y||y===Zc||u.current!==e||o!=null){const C=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const w=S.node.current,T=w?new ri(c(w),w):null;S.rect.current=T,T&&C.set(S.id,T)}return C}return y},[e,o,r,f,c]);return p.useEffect(()=>{u.current=e},[e]),p.useEffect(()=>{f||g()},[r,f]),p.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),p.useEffect(()=>{f||typeof i!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},i))},[i,f,g,...n]),{droppableRects:h,measureDroppableContainers:g,measuringScheduled:o!=null};function v(){switch(d){case Ss.Always:return!1;case Ss.BeforeDragging:return r;default:return!r}}}function ci(e,t){return ms(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Lv(e,t){return ci(e,t)}function Ov(e){let{callback:t,disabled:r}=e;const n=bo(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 ko(e){let{callback:t,disabled:r}=e;const n=bo(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 Nv(e){return new ri(In(e),e)}function Xc(e,t,r){t===void 0&&(t=Nv);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=Ov({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=ko({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 Pv(e){const t=ci(e);return $c(e,t)}const Jc=[];function xv(e){const t=p.useRef(e),r=ms(n=>e?n&&n!==Jc&&e&&t.current&&e.parentNode===t.current.parentNode?n:Eo(e):Jc,[e]);return p.useEffect(()=>{t.current=e},[e]),r}function Fv(e){const[t,r]=p.useState(null),n=p.useRef(e),s=p.useCallback(o=>{const a=ei(o.target);a&&r(i=>i?(i.set(a,ti(a)),new Map(i)):null)},[]);return p.useEffect(()=>{const o=n.current;if(e!==o){a(o);const i=e.map(c=>{const d=ei(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,ti(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=ei(c);d==null||d.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>An(o,a),sr):Qc(e):sr,[e,t])}function ed(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?ys(e,r.current):sr}function Mv(e){p.useEffect(()=>{if(!yo)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 $v(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 td(e){return p.useMemo(()=>e?lv(e):null,[e])}const rd=[];function Bv(e,t){t===void 0&&(t=In);const[r]=e,n=td(r?Ot(r):null),[s,o]=p.useState(rd);function a(){o(()=>e.length?e.map(c=>Vc(c)?n:new ri(t(c),c)):rd)}const i=ko({callback:a});return nr(()=>{i==null||i.disconnect(),a(),e.forEach(c=>i==null?void 0:i.observe(c))},[e]),s}function nd(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ps(t)?t:e}function qv(e){let{measure:t}=e;const[r,n]=p.useState(null),s=p.useCallback(d=>{for(const{target:u}of d)if(ps(u)){n(f=>{const m=t(u);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),o=ko({callback:s}),a=p.useCallback(d=>{const u=nd(d);o==null||o.disconnect(),u&&(o==null||o.observe(u)),n(u?t(u):null)},[t,o]),[i,c]=Co(a);return p.useMemo(()=>({nodeRef:i,rect:r,setRef:c}),[r,i,c])}const jv=[{sensor:Ao,options:{}},{sensor:si,options:{}}],Uv={current:{}},Do={draggable:{measure:qc},droppable:{measure:qc,strategy:Ss.WhileDragging,frequency:li.Optimized},dragOverlay:{measure:In}};class ws 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 zv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ws,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:To},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Do,measureDroppableContainers:To,windowRect:null,measuringScheduled:!1},sd={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:To,draggableNodes:new Map,over:null,measureDroppableContainers:To},_s=p.createContext(sd),od=p.createContext(zv);function Vv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ws}}}function Hv(e,t){switch(t.type){case it.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case it.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 it.DragEnd:case it.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case it.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new ws(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case it.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 ws(e.droppable.containers);return a.set(r,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case it.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const o=new ws(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Qv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=p.useContext(_s),o=So(n),a=So(r==null?void 0:r.id);return p.useEffect(()=>{if(!t&&!n&&o&&a!=null){if(!wo(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=Um(u);if(f){f.focus();break}}})}},[n,t,s,a,o]),null}function ad(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...n}),r):r}function Wv(e){return p.useMemo(()=>({draggable:{...Do.draggable,...e==null?void 0:e.draggable},droppable:{...Do.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Do.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 Rv(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=$c(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 m=jc(d);m&&m.scrollBy({top:f.y,left:f.x})}},[t,a,i,n,r])}const Lo=p.createContext({...sr,scaleX:1,scaleY:1});var Nr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Nr||(Nr={}));const id=p.memo(function(t){var r,n,s,o;let{id:a,accessibility:i,autoScroll:c=!0,children:d,sensors:u=jv,collisionDetection:f=rv,measuring:m,modifiers:g,...b}=t;const h=p.useReducer(Hv,void 0,Vv),[v,y]=h,[C,S]=Rm(),[w,T]=p.useState(Nr.Uninitialized),A=w===Nr.Initialized,{draggable:{active:L,nodes:E,translate:x},droppable:{containers:$}}=v,N=L!=null?E.get(L):null,P=p.useRef({initial:null,translated:null}),q=p.useMemo(()=>{var mt;return L!=null?{id:L,data:(mt=N==null?void 0:N.data)!=null?mt:Uv,rect:P}:null},[L,N]),F=p.useRef(null),[z,ne]=p.useState(null),[Q,te]=p.useState(null),pe=gs(b,Object.values(b)),ie=vs("DndDescribedBy",a),me=p.useMemo(()=>$.getEnabled(),[$]),ve=Wv(m),{droppableRects:Ee,measureDroppableContainers:ye,measuringScheduled:M}=Dv(me,{dragging:A,dependencies:[x.x,x.y],config:ve.droppable}),B=Iv(E,L),Z=p.useMemo(()=>Q?_o(Q):null,[Q]),ce=wn(),Ce=Lv(B,ve.draggable.measure);Rv({activeNode:L!=null?E.get(L):null,config:ce.layoutShiftCompensation,initialRect:Ce,measure:ve.draggable.measure});const ue=Xc(B,ve.draggable.measure,Ce),de=Xc(B?B.parentElement:null),W=p.useRef({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:Ee,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=$.getNodeFor((r=W.current.over)==null?void 0:r.id),Ae=qv({measure:ve.dragOverlay.measure}),ge=(n=Ae.nodeRef.current)!=null?n:B,ee=A?(s=Ae.rect)!=null?s:ue:null,Ge=!!(Ae.nodeRef.current&&Ae.rect),Ye=Pv(Ge?null:ue),rt=td(ge?Ot(ge):null),Ke=xv(A?se??B:null),st=Bv(Ke),dt=ad(g,{transform:{x:x.x-Ye.x,y:x.y-Ye.y,scaleX:1,scaleY:1},activatorEvent:Q,active:q,activeNodeRect:ue,containerNodeRect:de,draggingNodeRect:ee,over:W.current.over,overlayNodeRect:Ae.rect,scrollableAncestors:Ke,scrollableAncestorRects:st,windowRect:rt}),Sn=Z?An(Z,x):null,is=Fv(Ke),K=ed(is),_e=ed(is,[ue]),_=An(dt,K),D=ee?ov(ee,dt):null,O=q&&D?f({active:q,collisionRect:D,droppableRects:Ee,droppableContainers:me,pointerCoordinates:Sn}):null,V=Fc(O,"id"),[H,G]=p.useState(null),U=Ge?dt:An(dt,_e),re=nv(U,(o=H==null?void 0:H.rect)!=null?o:null,ue),be=p.useRef(null),Ve=p.useCallback((mt,Lt)=>{let{sensor:Pt,options:dr}=Lt;if(F.current==null)return;const rr=E.get(F.current);if(!rr)return;const Rt=mt.nativeEvent,br=new Pt({active:F.current,activeNode:rr,event:Rt,options:dr,context:W,onAbort(St){if(!E.get(St))return;const{onDragAbort:Cr}=pe.current,Er={id:St};Cr==null||Cr(Er),C({type:"onDragAbort",event:Er})},onPending(St,Rr,Cr,Er){if(!E.get(St))return;const{onDragPending:oo}=pe.current,Gr={id:St,constraint:Rr,initialCoordinates:Cr,offset:Er};oo==null||oo(Gr),C({type:"onDragPending",event:Gr})},onStart(St){const Rr=F.current;if(Rr==null)return;const Cr=E.get(Rr);if(!Cr)return;const{onDragStart:Er}=pe.current,so={activatorEvent:Rt,active:{id:Rr,data:Cr.data,rect:P}};ze.unstable_batchedUpdates(()=>{Er==null||Er(so),T(Nr.Initializing),y({type:it.DragStart,initialCoordinates:St,active:Rr}),C({type:"onDragStart",event:so}),ne(be.current),te(Rt)})},onMove(St){y({type:it.DragMove,coordinates:St})},onEnd:ls(it.DragEnd),onCancel:ls(it.DragCancel)});be.current=br;function ls(St){return async function(){const{active:Cr,collisions:Er,over:so,scrollAdjustedTranslate:oo}=W.current;let Gr=null;if(Cr&&oo){const{cancelDrop:ao}=pe.current;Gr={activatorEvent:Rt,active:Cr,collisions:Er,delta:oo,over:so},St===it.DragEnd&&typeof ao=="function"&&await Promise.resolve(ao(Gr))&&(St=it.DragCancel)}F.current=null,ze.unstable_batchedUpdates(()=>{y({type:St}),T(Nr.Uninitialized),G(null),ne(null),te(null),be.current=null;const ao=St===it.DragEnd?"onDragEnd":"onDragCancel";if(Gr){const Ql=pe.current[ao];Ql==null||Ql(Gr),C({type:ao,event:Gr})}})}}},[E]),jt=p.useCallback((mt,Lt)=>(Pt,dr)=>{const rr=Pt.nativeEvent,Rt=E.get(dr);if(F.current!==null||!Rt||rr.dndKit||rr.defaultPrevented)return;const br={active:Rt};mt(Pt,Lt.options,br)===!0&&(rr.dndKit={capturedBy:Lt.sensor},F.current=dr,Ve(Pt,Lt))},[E,Ve]),Ut=kv(u,jt);Mv(u),nr(()=>{ue&&w===Nr.Initializing&&T(Nr.Initialized)},[ue,w]),p.useEffect(()=>{const{onDragMove:mt}=pe.current,{active:Lt,activatorEvent:Pt,collisions:dr,over:rr}=W.current;if(!Lt||!Pt)return;const Rt={active:Lt,activatorEvent:Pt,collisions:dr,delta:{x:_.x,y:_.y},over:rr};ze.unstable_batchedUpdates(()=>{mt==null||mt(Rt),C({type:"onDragMove",event:Rt})})},[_.x,_.y]),p.useEffect(()=>{const{active:mt,activatorEvent:Lt,collisions:Pt,droppableContainers:dr,scrollAdjustedTranslate:rr}=W.current;if(!mt||F.current==null||!Lt||!rr)return;const{onDragOver:Rt}=pe.current,br=dr.get(V),ls=br&&br.rect.current?{id:br.id,rect:br.rect.current,data:br.data,disabled:br.disabled}:null,St={active:mt,activatorEvent:Lt,collisions:Pt,delta:{x:rr.x,y:rr.y},over:ls};ze.unstable_batchedUpdates(()=>{G(ls),Rt==null||Rt(St),C({type:"onDragOver",event:St})})},[V]),nr(()=>{W.current={activatorEvent:Q,active:q,activeNode:B,collisionRect:D,collisions:O,droppableRects:Ee,draggableNodes:E,draggingNode:ge,draggingNodeRect:ee,droppableContainers:$,over:H,scrollableAncestors:Ke,scrollAdjustedTranslate:_},P.current={initial:ee,translated:D}},[q,B,O,D,E,ge,ee,Ee,$,H,Ke,_]),Tv({...ce,delta:x,draggingRect:D,pointerCoordinates:Sn,scrollableAncestors:Ke,scrollableAncestorRects:st});const Tr=p.useMemo(()=>({active:q,activeNode:B,activeNodeRect:ue,activatorEvent:Q,collisions:O,containerNodeRect:de,dragOverlay:Ae,draggableNodes:E,droppableContainers:$,droppableRects:Ee,over:H,measureDroppableContainers:ye,scrollableAncestors:Ke,scrollableAncestorRects:st,measuringConfiguration:ve,measuringScheduled:M,windowRect:rt}),[q,B,ue,Q,O,de,Ae,E,$,Ee,H,ye,Ke,st,ve,M,rt]),no=p.useMemo(()=>({activatorEvent:Q,activators:Ut,active:q,activeNodeRect:ue,ariaDescribedById:{draggable:ie},dispatch:y,draggableNodes:E,over:H,measureDroppableContainers:ye}),[Q,Ut,q,ue,y,ie,E,H,ye]);return p.createElement(Lc.Provider,{value:S},p.createElement(_s.Provider,{value:no},p.createElement(od.Provider,{value:Tr},p.createElement(Lo.Provider,{value:re},d)),p.createElement(Qv,{disabled:(i==null?void 0:i.restoreFocus)===!1})),p.createElement(Ym,{...i,hiddenTextDescribedById:ie}));function wn(){const mt=(z==null?void 0:z.autoScrollEnabled)===!1,Lt=typeof c=="object"?c.enabled===!1:c===!1,Pt=A&&!mt&&!Lt;return typeof c=="object"?{...c,enabled:Pt}:{enabled:Pt}}}),Gv=p.createContext(null),ld="button",Kv="Draggable";function cd(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const o=vs(Kv),{activators:a,activatorEvent:i,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:m}=p.useContext(_s),{role:g=ld,roleDescription:b="draggable",tabIndex:h=0}=s??{},v=(c==null?void 0:c.id)===t,y=p.useContext(v?Lo:Gv),[C,S]=Co(),[w,T]=Co(),A=$v(a,t),L=gs(r);nr(()=>(f.set(t,{id:t,key:o,node:C,activatorNode:w,data:L}),()=>{const x=f.get(t);x&&x.key===o&&f.delete(t)}),[f,t]);const E=p.useMemo(()=>({role:g,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&g===ld?!0:void 0,"aria-roledescription":b,"aria-describedby":u.draggable}),[n,g,h,v,b,u.draggable]);return{active:c,activatorEvent:i,activeNodeRect:d,attributes:E,isDragging:v,listeners:n?void 0:A,node:C,over:m,setNodeRef:S,setActivatorNodeRef:T,transform:y}}function dd(){return p.useContext(od)}const Yv="Droppable",Zv={timeout:25};function Xv(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const o=vs(Yv),{active:a,dispatch:i,over:c,measureDroppableContainers:d}=p.useContext(_s),u=p.useRef({disabled:r}),f=p.useRef(!1),m=p.useRef(null),g=p.useRef(null),{disabled:b,updateMeasurementsFor:h,timeout:v}={...Zv,...s},y=gs(h??n),C=p.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),g.current=null},v)},[v]),S=ko({callback:C,disabled:b||!a}),w=p.useCallback((E,x)=>{S&&(x&&(S.unobserve(x),f.current=!1),E&&S.observe(E))},[S]),[T,A]=Co(w),L=gs(t);return p.useEffect(()=>{!S||!T.current||(S.disconnect(),f.current=!1,S.observe(T.current))},[T,S]),p.useEffect(()=>(i({type:it.RegisterDroppable,element:{id:n,key:o,disabled:r,node:T,rect:m,data:L}}),()=>i({type:it.UnregisterDroppable,key:o,id:n})),[n]),p.useEffect(()=>{r!==u.current.disabled&&(i({type:it.SetDroppableDisabled,id:n,key:o,disabled:r}),u.current.disabled=r)},[n,o,r,i]),{active:a,rect:m,isOver:(c==null?void 0:c.id)===n,node:T,over:c,setNodeRef:A}}function Jv(e){let{animation:t,children:r}=e;const[n,s]=p.useState(null),[o,a]=p.useState(null),i=So(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 ey={x:0,y:0,scaleX:1,scaleY:1};function ty(e){let{children:t}=e;return p.createElement(_s.Provider,{value:sd},p.createElement(Lo.Provider,{value:ey},t))}const ry={position:"fixed",touchAction:"none"},ny=e=>wo(e)?"transform 250ms ease":void 0,sy=p.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:o,className:a,rect:i,style:c,transform:d,transition:u=ny}=e;if(!i)return null;const f=s?d:{...d,scaleX:1,scaleY:1},m={...ry,width:i.width,height:i.height,top:i.top,left:i.left,transform:Or.Transform.toString(f),transformOrigin:s&&n?Zm(n,i):void 0,transition:typeof u=="function"?u(n):u,...c};return p.createElement(r,{className:a,style:m,ref:t},o)}),oy={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Or.Transform.toString(t)},{transform:Or.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 ay(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return bo((o,a)=>{if(t===null)return;const i=r.get(o);if(!i)return;const c=i.node.current;if(!c)return;const d=nd(a);if(!d)return;const{transform:u}=Ot(a).getComputedStyle(a),f=Bc(u);if(!f)return;const m=typeof t=="function"?t:iy(t);return Wc(c,s.draggable.measure),m({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 iy(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...oy,...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},m={x:c.x-u.x,y:c.y-u.y,...f},g=s({...d,active:a,dragOverlay:i,transform:{initial:c,final:m}}),[b]=g,h=g[g.length-1];if(JSON.stringify(b)===JSON.stringify(h))return;const v=n==null?void 0:n({active:a,dragOverlay:i,...d}),y=i.node.animate(g,{duration:t,easing:r,fill:"forwards"});return new Promise(C=>{y.onfinish=()=>{v==null||v(),C()}})}}let ud=0;function ly(e){return p.useMemo(()=>{if(e!=null)return ud++,ud},[e])}const cy=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:m,containerNodeRect:g,draggableNodes:b,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:w,windowRect:T}=dd(),A=p.useContext(Lo),L=ly(f==null?void 0:f.id),E=ad(a,{activatorEvent:u,active:f,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:w,transform:A,windowRect:T}),x=ci(m),$=ay({config:n,draggableNodes:b,droppableContainers:h,measuringConfiguration:C}),N=x?v.setRef:void 0;return p.createElement(ty,null,p.createElement(Jv,{animation:$},f&&L?p.createElement(sy,{key:L,id:f.id,ref:N,as:i,activatorEvent:u,adjustScale:t,className:c,transition:o,rect:x,style:{zIndex:d,...s},transform:E},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 Ey=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qc=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
186
+ */const dy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fd=(...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 Iy={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 uy={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 Oy=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:i,...s},l)=>h.createElement("svg",{ref:l,...Iy,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Qc("lucide",o),...s},[...i.map(([d,u])=>h.createElement(d,u)),...Array.isArray(a)?a:[a]]));/**
196
+ */const fy=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,...uy,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:fd("lucide",s),...i},[...a.map(([d,u])=>p.createElement(d,u)),...Array.isArray(o)?o:[o]]));/**
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=h.forwardRef(({className:n,...o},a)=>h.createElement(Oy,{ref:a,iconNode:t,className:Qc(`lucide-${Ey(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
201
+ */const oe=(e,t)=>{const r=p.forwardRef(({className:n,...s},o)=>p.createElement(fy,{ref:o,iconNode:t,className:fd(`lucide-${dy(e)}`,n),...s}));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 Ay=le("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
206
+ */const hy=oe("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 Dy=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"}]]);/**
211
+ */const di=oe("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 Ny=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"}]]);/**
216
+ */const py=oe("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 ky=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"}]]);/**
221
+ */const gy=oe("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 wn=le("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
226
+ */const Pr=oe("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 Cn=le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
231
+ */const my=oe("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 Gc=le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
236
+ */const Zr=oe("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 xy=le("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
241
+ */const Xr=oe("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 Wc=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"}]]);/**
246
+ */const ui=oe("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 Ri=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"}]]);/**
251
+ */const vy=oe("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 Ly=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"}]]);/**
256
+ */const hd=oe("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 Py=le("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
261
+ */const Oo=oe("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 Fy=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"}]]);/**
266
+ */const yy=oe("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 Kc=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"}]]);/**
271
+ */const by=oe("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 ba=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"}]]);/**
276
+ */const Cy=oe("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 Sn=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"}]]);/**
281
+ */const pd=oe("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 My=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"}]]);/**
286
+ */const Sy=oe("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 Yc=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"}]]);/**
291
+ */const Ts=oe("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 $y=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"}]]);/**
296
+ */const xr=oe("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 By=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"}]]);/**
301
+ */const gd=oe("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 Zc=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"}]]);/**
306
+ */const wy=oe("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 jy=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"}]]);/**
311
+ */const md=oe("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 Xc=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"}]]);/**
316
+ */const vd=oe("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 Qi=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"}]]);/**
321
+ */const _y=oe("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 Gi=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"}]]);/**
326
+ */const yd=oe("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 qy=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"}]]);/**
331
+ */const Ty=oe("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 wa=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"}]]);/**
336
+ */const bd=oe("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 Wi=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"}]]);/**
341
+ */const Es=oe("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 Ki=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"}]]);/**
346
+ */const No=oe("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 Uy=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"}]]);/**
351
+ */const Ey=oe("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 Vy=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"}]]);/**
356
+ */const Po=oe("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 zy=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"}]]);/**
361
+ */const Cd=oe("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 Hy=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"}]]);/**
366
+ */const Ay=oe("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 mo=le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
371
+ */const xo=oe("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 Jc=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"}]]);/**
376
+ */const Fo=oe("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 ed=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"}]]);/**
381
+ */const Iy=oe("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 Ry=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"}]]);/**
386
+ */const ky=oe("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 Qy=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"}]]);/**
391
+ */const Dy=oe("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 Gy=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"}]]);/**
396
+ */const Ly=oe("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 Yi=le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
401
+ */const Jr=oe("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 Wy=le("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
406
+ */const Sd=oe("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 Ky=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"}]]);/**
411
+ */const wd=oe("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 Yy=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"}]]);/**
416
+ */const Oy=oe("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 Zy=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"}]]);/**
421
+ */const Ny=oe("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 Zi=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"}]]);/**
426
+ */const Py=oe("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 Xy=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"}]]);/**
431
+ */const Mo=oe("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 Xi=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"}]]);/**
436
+ */const xy=oe("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 Jy=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"}]]);/**
441
+ */const Fy=oe("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 ev=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"}]]);/**
446
+ */const My=oe("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 Ji=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"}]]);/**
451
+ */const $y=oe("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 yr=le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tv={},td=e=>{let t;const r=new Set,n=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const g=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(C=>C(t,g))}},o=()=>t,l={setState:n,getState:o,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(tv?"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,l);return l},rv=e=>e?td(e):td;function rd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var es={exports:{}},ts={},Ca={exports:{}},rs={};/**
456
+ */const By=oe("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
+ * @license lucide-react v0.400.0 - ISC
458
+ *
459
+ * This source code is licensed under the ISC license.
460
+ * See the LICENSE file in the root directory of this source tree.
461
+ */const $o=oe("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
+ * @license lucide-react v0.400.0 - ISC
463
+ *
464
+ * This source code is licensed under the ISC license.
465
+ * See the LICENSE file in the root directory of this source tree.
466
+ */const qy=oe("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
+ * @license lucide-react v0.400.0 - ISC
468
+ *
469
+ * This source code is licensed under the ISC license.
470
+ * See the LICENSE file in the root directory of this source tree.
471
+ */const fi=oe("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
+ * @license lucide-react v0.400.0 - ISC
473
+ *
474
+ * This source code is licensed under the ISC license.
475
+ * See the LICENSE file in the root directory of this source tree.
476
+ */const jy=oe("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
+ * @license lucide-react v0.400.0 - ISC
478
+ *
479
+ * This source code is licensed under the ISC license.
480
+ * See the LICENSE file in the root directory of this source tree.
481
+ */const Uy=oe("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
+ * @license lucide-react v0.400.0 - ISC
483
+ *
484
+ * This source code is licensed under the ISC license.
485
+ * See the LICENSE file in the root directory of this source tree.
486
+ */const Bo=oe("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
+ * @license lucide-react v0.400.0 - ISC
488
+ *
489
+ * This source code is licensed under the ISC license.
490
+ * See the LICENSE file in the root directory of this source tree.
491
+ */const fr=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
492
+ * @license lucide-react v0.400.0 - ISC
493
+ *
494
+ * This source code is licensed under the ISC license.
495
+ * See the LICENSE file in the root directory of this source tree.
496
+ */const zy=oe("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"}]]),Vy={},_d=e=>{let t;const r=new Set,n=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const g=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(b=>b(t,g))}},s=()=>t,c={setState:n,getState:s,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(Vy?"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},Hy=e=>e?_d(e):_d;function hi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qo={exports:{}},pi={},jo={exports:{}},gi={};/**
457
497
  * @license React
458
498
  * use-sync-external-store-shim.production.js
459
499
  *
@@ -461,7 +501,7 @@ to {
461
501
  *
462
502
  * This source code is licensed under the MIT license found in the
463
503
  * LICENSE file in the root directory of this source tree.
464
- */var nd;function nv(){if(nd)return rs;nd=1;var e=h;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(f,m){var g=m(),C=n({inst:{value:g,getSnapshot:m}}),p=C[0].inst,y=C[1];return a(function(){p.value=g,p.getSnapshot=m,l(p)&&y({inst:p})},[f,g,m]),o(function(){return l(p)&&y({inst:p}),f(function(){l(p)&&y({inst:p})})},[f]),i(g),g}function l(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!r(f,g)}catch{return!0}}function d(f,m){return m()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:s;return rs.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,rs}var ns={};/**
504
+ */var Td;function Qy(){if(Td)return gi;Td=1;var e=p;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function i(f,m){var g=m(),b=n({inst:{value:g,getSnapshot:m}}),h=b[0].inst,v=b[1];return o(function(){h.value=g,h.getSnapshot=m,c(h)&&v({inst:h})},[f,g,m]),s(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),a(g),g}function c(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!r(f,g)}catch{return!0}}function d(f,m){return m()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:i;return gi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,gi}var mi={};/**
465
505
  * @license React
466
506
  * use-sync-external-store-shim.development.js
467
507
  *
@@ -469,7 +509,7 @@ to {
469
509
  *
470
510
  * This source code is licensed under the MIT license found in the
471
511
  * LICENSE file in the root directory of this source tree.
472
- */var od;function ov(){return od||(od=1,process.env.NODE_ENV!=="production"&&function(){function e(g,C){return g===C&&(g!==0||1/g===1/C)||g!==g&&C!==C}function t(g,C){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 p=C();if(!f){var y=C();a(p,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}y=i({inst:{value:p,getSnapshot:C}});var v=y[0].inst,b=y[1];return l(function(){v.value=p,v.getSnapshot=C,r(v)&&b({inst:v})},[g,p,C]),s(function(){return r(v)&&b({inst:v}),g(function(){r(v)&&b({inst:v})})},[g]),d(p),p}function r(g){var C=g.getSnapshot;g=g.value;try{var p=C();return!a(g,p)}catch{return!0}}function n(g,C){return C()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,a=typeof Object.is=="function"?Object.is:e,i=o.useState,s=o.useEffect,l=o.useLayoutEffect,d=o.useDebugValue,u=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;ns.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ns}var ad;function os(){return ad||(ad=1,process.env.NODE_ENV==="production"?Ca.exports=nv():Ca.exports=ov()),Ca.exports}/**
512
+ */var Ed;function Wy(){return Ed||(Ed=1,process.env.NODE_ENV!=="production"&&(function(){function e(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}function t(g,b){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=b();if(!f){var v=b();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:b}});var y=v[0].inst,C=v[1];return c(function(){y.value=h,y.getSnapshot=b,r(y)&&C({inst:y})},[g,h,b]),i(function(){return r(y)&&C({inst:y}),g(function(){r(y)&&C({inst:y})})},[g]),d(h),h}function r(g){var b=g.getSnapshot;g=g.value;try{var h=b();return!o(g,h)}catch{return!0}}function n(g,b){return b()}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,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;mi.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),mi}var Ad;function vi(){return Ad||(Ad=1,process.env.NODE_ENV==="production"?jo.exports=Qy():jo.exports=Wy()),jo.exports}/**
473
513
  * @license React
474
514
  * use-sync-external-store-shim/with-selector.production.js
475
515
  *
@@ -477,7 +517,7 @@ to {
477
517
  *
478
518
  * This source code is licensed under the MIT license found in the
479
519
  * LICENSE file in the root directory of this source tree.
480
- */var id;function av(){if(id)return ts;id=1;var e=h,t=os();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,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return ts.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var C=a(null);if(C.current===null){var p={hasValue:!1,value:null};C.current=p}else p=C.current;C=s(function(){function v(I){if(!b){if(b=!0,w=I,I=m(I),g!==void 0&&p.hasValue){var N=p.value;if(g(N,I))return S=N}return S=I}if(N=S,n(w,I))return N;var x=m(I);return g!==void 0&&g(N,x)?(w=I,N):(w=I,S=x)}var b=!1,w,S,T=f===void 0?null:f;return[function(){return v(u())},T===null?void 0:function(){return v(T())}]},[u,f,m,g]);var y=o(d,C[0],C[1]);return i(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},ts}var as={};/**
520
+ */var Id;function Ry(){if(Id)return pi;Id=1;var e=p,t=vi();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 pi.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var b=o(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=i(function(){function y(A){if(!C){if(C=!0,S=A,A=m(A),g!==void 0&&h.hasValue){var L=h.value;if(g(L,A))return w=L}return w=A}if(L=w,n(S,A))return L;var E=m(A);return g!==void 0&&g(L,E)?(S=A,L):(S=A,w=E)}var C=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,m,g]);var v=s(d,b[0],b[1]);return a(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},pi}var yi={};/**
481
521
  * @license React
482
522
  * use-sync-external-store-shim/with-selector.development.js
483
523
  *
@@ -485,22 +525,22 @@ to {
485
525
  *
486
526
  * This source code is licensed under the MIT license found in the
487
527
  * LICENSE file in the root directory of this source tree.
488
- */var sd;function iv(){return sd||(sd=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=os(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;as.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var C=a(null);if(C.current===null){var p={hasValue:!1,value:null};C.current=p}else p=C.current;C=s(function(){function v(I){if(!b){if(b=!0,w=I,I=m(I),g!==void 0&&p.hasValue){var N=p.value;if(g(N,I))return S=N}return S=I}if(N=S,n(w,I))return N;var x=m(I);return g!==void 0&&g(N,x)?(w=I,N):(w=I,S=x)}var b=!1,w,S,T=f===void 0?null:f;return[function(){return v(u())},T===null?void 0:function(){return v(T())}]},[u,f,m,g]);var y=o(d,C[0],C[1]);return i(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),as}process.env.NODE_ENV==="production"?es.exports=av():es.exports=iv();var sv=es.exports;const lv=rd(sv),ld={},{useDebugValue:cv}=h,{useSyncExternalStoreWithSelector:dv}=lv;let cd=!1;const uv=e=>e;function fv(e,t=uv,r){(ld?"production":void 0)!=="production"&&r&&!cd&&(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"),cd=!0);const n=dv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return cv(n),n}const dd=e=>{(ld?"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"?rv(e):e,r=(n,o)=>fv(t,n,o);return Object.assign(r,t),r},yo=e=>e?dd(e):dd,ae=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,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig: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=ae.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}})})),hv=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:ae},Symbol.toStringTag,{value:"Module"}));function Rr(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 ud(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 a=ud(o.children,t,r+1);if(a>=0)return a}}return-1}const pv=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function fd(e,t,r){return e.map(n=>{if(n.id===t){const o=r.metadata??{},a={};for(const i of pv)i in r&&(a[i]=r[i]);return{...n,...r,metadata:{...n.metadata??{},...a,...o}}}return n.children&&n.children.length>0?{...n,children:fd(n.children,t,r)}:n})}function Sa(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:Sa(n.children,t,r)}:n)}function is(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?is(r.children,t):[]}))}function hd(e,t,r,n){return e.map(o=>{if(o.id===t){const a=[...o.children??[]],[i]=a.splice(r,1);return a.splice(n,0,i),{...o,children:a}}return o.children&&o.children.length>0?{...o,children:hd(o.children,t,r,n)}:o})}function pd(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?pd(r.children,t):[]}})}function gv(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 mv(e,t){const r=Rr(e,t);if(!r)return[];const n=[];let o=r;for(;o;)n.unshift({id:o.id,name:o.name}),o=o.parent?Rr(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:a}=t(),i=Rr(n,r),s=a(r),l={...(i==null?void 0:i.metadata)??{},...o[r]??{}};ae.getState().setNodeFlags({isFolder:(i==null?void 0:i.isFolder)??!1,isRoot:!(i!=null&&i.parent),isQuml:!1}),e({selectedNodeId:r,breadcrumb:s,activeNodeMeta:l})},updateNode:(r,n)=>{e(o=>({treeData:fd(o.treeData,r,n),treeCache:{...o.treeCache,[r]:{...o.treeCache[r]??{},...n}}})),t().markDirty()},addNode:(r,n)=>{var d,u;const o=t(),a=((u=(d=ae.getState().editorConfig)==null?void 0:d.config)==null?void 0:u.maxDepth)??4,i=ud(o.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const s="temp-"+Math.random().toString(36).slice(2),l={id:s,identifier:s,name:"Untitled Unit",isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:s,name:"Untitled Unit",visibility:"Parent"}};return e(f=>({treeData:Sa(f.treeData,r,l),treeCache:{...f.treeCache,[s]:{...l.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(s),0),s},deleteNode:r=>{e(n=>({treeData:is(n.treeData,r),selectedNodeId:n.selectedNodeId===r?null:n.selectedNodeId}))},reorderChildren:(r,n,o)=>{e(a=>({treeData:hd(a.treeData,r,n,o)}))},moveNode:(r,n,o)=>{e(a=>{const i=Rr(a.treeData,r);if(!i)return a;let s=is(a.treeData,r);return s=Sa(s,o,{...i,parent:o}),{treeData:s}}),t().markDirty()},addResource:(r,n)=>{var u,f,m;const o=ae.getState().editorConfig,a=((u=o==null?void 0:o.config)==null?void 0:u.allowContentUnderRoot)??!1,i=(f=t().treeData[0])==null?void 0:f.id;if(!a&&n===i||Rr(t().treeData,r.identifier))return!1;const s=((m=o==null?void 0:o.config)==null?void 0:m.maxContentsLimit)??1200;if(gv(t().treeData)>=s)return!1;const d={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};return e(g=>({treeData:Sa(g.treeData,n,d)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=ae.getState();r==="edit"&&n(!0)},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const o=pd(n.treeData,r),a={};for(const[s,l]of Object.entries(n.treeCache)){const d=r[s]??s,{isNew:u,...f}=l;a[d]=f}const i=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:o,treeCache:a,selectedNodeId:i}})},getNodeById:r=>Rr(t().treeData,r),getChildrenOf:r=>{const n=Rr(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>mv(t().treeData,r)})),yv=yo(e=>({activeModal:null,modalData:{},openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}})})),vv={spin:"_spin_1ah4d_9"},ss={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:{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",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"}},bv={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:{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:"طي المكتبة",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:"جارٍ التحميل"}},wv={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:{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",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"}},Cv={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:{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",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"}},Sv=["ar"],_v={en:ss,ar:bv,fr:wv,pt:Cv};function gd(e,t){const r={...e};for(const n of Object.keys(t)){const o=e[n],a=t[n];o&&a&&typeof o=="object"&&typeof a=="object"&&!Array.isArray(o)&&!Array.isArray(a)?r[n]=gd(o,a):a!==void 0&&(r[n]=a)}return r}function md(e){const t=_v[e];return!t||e==="en"?ss:gd(ss,t)}function Tv(e){return Sv.includes(e)}const ls="app-language",cs="app-language-change",yd=yo(e=>({lang:"en",labelConfig:md("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:md(t)}),localStorage.setItem(ls,t),document.documentElement.setAttribute("dir",Tv(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(cs,{detail:{lang:t}}))}}));function ce(){return yd(e=>e.labelConfig)}const Ev=({size:e=16,color:t="currentColor"})=>{const r=ce();return c.jsx("svg",{className:vv.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:c.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},$e=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:o,children:a,className:i,type:s="button"})=>c.jsxs("button",{type:s,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${i??""}`,onClick:o,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?c.jsx(Ev,{size:14}):null,a]}),Fe={overlay:"_overlay_w9xez_1",modal:"_modal_w9xez_11",modalHeader:"_modalHeader_w9xez_23",modalHeaderClose:"_modalHeaderClose_w9xez_33",modalBody:"_modalBody_w9xez_51",modalFooter:"_modalFooter_w9xez_58",checkRow:"_checkRow_w9xez_65",formGroup:"_formGroup_w9xez_108",textarea:"_textarea_w9xez_119",sliderGroup:"_sliderGroup_w9xez_140",sliderValue:"_sliderValue_w9xez_152",sliderLabels:"_sliderLabels_w9xez_160",sectionTitle:"_sectionTitle_w9xez_168"},Iv=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ce(),o=ae(f=>{var m,g;return(g=(m=f.editorConfig)==null?void 0:m.config)==null?void 0:g.objectType})||"Content",a=ae(f=>f.publishChecklist)??[],[i,s]=h.useState({}),l=a.every(f=>i[f.code]),d=a.length===0||l,u=()=>{t()};return c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",o]}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:a.length===0?c.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",o,"?"]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:Fe.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(f=>c.jsxs("label",{className:Fe.checkRow,children:[c.jsx("input",{type:"checkbox",checked:!!i[f.code],onChange:m=>s(g=>({...g,[f.code]:m.target.checked}))}),c.jsx("span",{children:f.label})]},f.code))]})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),c.jsx($e,{variant:"primary",onClick:u,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},Ov=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const o=ce(),[a,i]=h.useState(""),[s,l]=h.useState(7),d=t==="approve",u=d?o.qualityParamsModal.reviewQualityTitle:o.qualityParamsModal.rejectContentTitle,f=!d&&a.trim().length===0,m=()=>{d?r(a.trim(),s):r(a.trim())};return c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsx("span",{id:"quality-modal-title",children:u}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:n,"aria-label":o.qualityParamsModal.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:d?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:Fe.formGroup,children:[c.jsx("label",{htmlFor:"quality-score",children:o.qualityParamsModal.qualityScoreLabel}),c.jsxs("div",{className:Fe.sliderGroup,children:[c.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:s,onChange:g=>l(Number(g.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":s}),c.jsx("span",{className:Fe.sliderValue,children:s})]}),c.jsxs("div",{className:Fe.sliderLabels,children:[c.jsx("span",{children:o.qualityParamsModal.scorePoorLabel}),c.jsx("span",{children:o.qualityParamsModal.scoreExcellentLabel})]})]}),c.jsxs("div",{className:Fe.formGroup,children:[c.jsxs("label",{htmlFor:"quality-comment",children:[o.qualityParamsModal.commentLabel," ",c.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:o.qualityParamsModal.optionalLabel})]}),c.jsx("textarea",{id:"quality-comment",className:Fe.textarea,placeholder:o.qualityParamsModal.commentPlaceholder,value:a,onChange:g=>i(g.target.value),rows:4})]})]}):c.jsxs("div",{className:Fe.formGroup,children:[c.jsxs("label",{htmlFor:"reject-reason",children:[o.qualityParamsModal.rejectionReasonLabel," ",c.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:"reject-reason",className:Fe.textarea,placeholder:o.qualityParamsModal.rejectReasonPlaceholder,value:a,onChange:g=>i(g.target.value),rows:5,required:!0,"aria-required":"true"}),a.trim().length===0&&c.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:o.qualityParamsModal.rejectionRequiredMessage})]})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:n,children:o.qualityParamsModal.cancelButton}),c.jsx($e,{variant:d?"primary":"danger",onClick:m,disabled:f,children:d?o.qualityParamsModal.approveButton:o.qualityParamsModal.rejectButton})]})]})})};function vd(e,t){return function(){return e.apply(t,arguments)}}const{toString:Av}=Object.prototype,{getPrototypeOf:_n}=Object,{iterator:vo,toStringTag:bd}=Symbol,_a=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),bo=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),_a(r,t))return!0;r=_n(r)}return!1},Dv=(e,t)=>e!=null&&bo(e,t)?e[t]:void 0,ds=(e=>t=>{const r=Av.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xt=e=>(e=e.toLowerCase(),t=>ds(t)===e),Ta=e=>t=>typeof t===e,{isArray:Qr}=Array,Tn=Ta("undefined");function En(e){return e!==null&&!Tn(e)&&e.constructor!==null&&!Tn(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wd=Xt("ArrayBuffer");function Nv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&wd(e.buffer),t}const kv=Ta("string"),Dt=Ta("function"),Cd=Ta("number"),In=e=>e!==null&&typeof e=="object",xv=e=>e===!0||e===!1,Ea=e=>{if(!In(e))return!1;const t=_n(e);return(t===null||t===Object.prototype||_n(t)===null)&&!bo(e,bd)&&!bo(e,vo)},Lv=e=>{if(!In(e)||En(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pv=Xt("Date"),Fv=Xt("File"),Mv=e=>!!(e&&typeof e.uri<"u"),$v=e=>e&&typeof e.getParts<"u",Bv=Xt("Blob"),jv=Xt("FileList"),qv=e=>In(e)&&Dt(e.pipe);function Uv(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Sd=Uv(),_d=typeof Sd.FormData<"u"?Sd.FormData:void 0,Vv=e=>{if(!e)return!1;if(_d&&e instanceof _d)return!0;const t=_n(e);if(!t||t===Object.prototype||!Dt(e.append))return!1;const r=ds(e);return r==="formdata"||r==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"},zv=Xt("URLSearchParams"),[Hv,Rv,Qv,Gv]=["ReadableStream","Request","Response","Headers"].map(Xt),Wv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Qr(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(En(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let s;for(n=0;n<i;n++)s=a[n],t.call(null,e[s],s,e)}}function Td(e,t){if(En(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 Gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ed=e=>!Tn(e)&&e!==Gr;function us(...e){const{caseless:t,skipUndefined:r}=Ed(this)&&this||{},n={},o=(a,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=t&&typeof i=="string"&&Td(n,i)||i,l=_a(n,s)?n[s]:void 0;Ea(l)&&Ea(a)?n[s]=us(l,a):Ea(a)?n[s]=us({},a):Qr(a)?n[s]=a.slice():(!r||!Tn(a))&&(n[s]=a)};for(let a=0,i=e.length;a<i;a++){const s=e[a];if(!s||En(s)||(wo(s,o),typeof s!="object"||Qr(s)))continue;const l=Object.getOwnPropertySymbols(s);for(let d=0;d<l.length;d++){const u=l[d];ib.call(s,u)&&o(s[u],u)}}return n}const Kv=(e,t,r,{allOwnKeys:n}={})=>(wo(t,(o,a)=>{r&&Dt(o)?Object.defineProperty(e,a,{__proto__:null,value:vd(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Yv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Zv=(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)},Xv=(e,t,r,n)=>{let o,a,i;const s={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],(!n||n(i,e,t))&&!s[i]&&(t[i]=e[i],s[i]=!0);e=r!==!1&&_n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Jv=(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},eb=e=>{if(!e)return null;if(Qr(e))return e;let t=e.length;if(!Cd(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},tb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_n(Uint8Array)),rb=(e,t)=>{const n=(e&&e[vo]).call(e);let o;for(;(o=n.next())&&!o.done;){const a=o.value;t.call(e,a[0],a[1])}},nb=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ob=Xt("HTMLFormElement"),ab=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),{propertyIsEnumerable:ib}=Object.prototype,sb=Xt("RegExp"),Id=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};wo(r,(o,a)=>{let i;(i=t(o,a,e))!==!1&&(n[a]=i||o)}),Object.defineProperties(e,n)},lb=e=>{Id(e,(t,r)=>{if(Dt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Dt(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+"'")})}})},cb=(e,t)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return Qr(e)?n(e):n(String(e).split(t)),r},db=()=>{},ub=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function fb(e){return!!(e&&Dt(e.append)&&e[bd]==="FormData"&&e[vo])}const hb=e=>{const t=new WeakSet,r=n=>{if(In(n)){if(t.has(n))return;if(En(n))return n;if(!("toJSON"in n)){t.add(n);const o=Qr(n)?[]:{};return wo(n,(a,i)=>{const s=r(a);!Tn(s)&&(o[i]=s)}),t.delete(n),o}}return n};return r(e)},pb=Xt("AsyncFunction"),gb=e=>e&&(In(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),Od=((e,t)=>e?setImmediate:t?((r,n)=>(Gr.addEventListener("message",({source:o,data:a})=>{o===Gr&&a===r&&n.length&&n.shift()()},!1),o=>{n.push(o),Gr.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Dt(Gr.postMessage)),mb=typeof queueMicrotask<"u"?queueMicrotask.bind(Gr):typeof process<"u"&&process.nextTick||Od,Ad=e=>e!=null&&Dt(e[vo]),O={isArray:Qr,isArrayBuffer:wd,isBuffer:En,isFormData:Vv,isArrayBufferView:Nv,isString:kv,isNumber:Cd,isBoolean:xv,isObject:In,isPlainObject:Ea,isEmptyObject:Lv,isReadableStream:Hv,isRequest:Rv,isResponse:Qv,isHeaders:Gv,isUndefined:Tn,isDate:Pv,isFile:Fv,isReactNativeBlob:Mv,isReactNative:$v,isBlob:Bv,isRegExp:sb,isFunction:Dt,isStream:qv,isURLSearchParams:zv,isTypedArray:tb,isFileList:jv,forEach:wo,merge:us,extend:Kv,trim:Wv,stripBOM:Yv,inherits:Zv,toFlatObject:Xv,kindOf:ds,kindOfTest:Xt,endsWith:Jv,toArray:eb,forEachEntry:rb,matchAll:nb,isHTMLForm:ob,hasOwnProperty:_a,hasOwnProp:_a,hasOwnInPrototypeChain:bo,getSafeProp:Dv,reduceDescriptors:Id,freezeMethods:lb,toObjectSet:cb,toCamelCase:ab,noop:db,toFiniteNumber:ub,findKey:Td,global:Gr,isContextDefined:Ed,isSpecCompliantForm:fb,toJSONObject:hb,isAsyncFn:pb,isThenable:gb,setImmediate:Od,asap:mb,isIterable:Ad,isSafeIterable:e=>e!=null&&bo(e,vo)&&Ad(e)},yb=O.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"]),vb=e=>{const t={};let r,n,o;return e&&e.split(`
489
- `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&yb[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function bb(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 wb=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Cb=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function fs(e,t){return O.isArray(e)?e.map(r=>fs(r,t)):bb(String(e).replace(t,""))}const Sb=e=>fs(e,wb),_b=e=>fs(e,Cb);function Dd(e){const t=Object.create(null);return O.forEach(e.toJSON(),(r,n)=>{t[n]=_b(r)}),t}const Nd=Symbol("internals");function Co(e){return e&&String(e).trim().toLowerCase()}function Ia(e){return e===!1||e==null?e:O.isArray(e)?e.map(Ia):Sb(String(e))}function Tb(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 Eb=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function hs(e,t,r,n,o){if(O.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!O.isString(t)){if(O.isString(n))return t.indexOf(n)!==-1;if(O.isRegExp(n))return n.test(t)}}function Ib(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Ob(e,t){const r=O.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(o,a,i){return this[n].call(this,t,o,a,i)},configurable:!0})})}let gt=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function a(s,l,d){const u=Co(l);if(!u)return;const f=O.findKey(o,u);(!f||o[f]===void 0||d===!0||d===void 0&&o[f]!==!1)&&(o[f||l]=Ia(s))}const i=(s,l)=>O.forEach(s,(d,u)=>a(d,u,l));if(O.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(O.isString(t)&&(t=t.trim())&&!Eb(t))i(vb(t),r);else if(O.isObject(t)&&O.isSafeIterable(t)){let s=Object.create(null),l,d;for(const u of t){if(!O.isArray(u))throw new TypeError("Object iterator must return a key-value pair");d=u[0],O.hasOwnProp(s,d)?(l=s[d],s[d]=O.isArray(l)?[...l,u[1]]:[l,u[1]]):s[d]=u[1]}i(s,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=Co(t),t){const n=O.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Tb(o);if(O.isFunction(r))return r.call(this,o,n);if(O.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Co(t),t){const n=O.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||hs(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function a(i){if(i=Co(i),i){const s=O.findKey(n,i);s&&(!r||hs(n,n[s],s,r))&&(delete n[s],o=!0)}}return O.isArray(t)?t.forEach(a):a(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const a=r[n];(!t||hs(this,this[a],a,t,!0))&&(delete this[a],o=!0)}return o}normalize(t){const r=this,n={};return O.forEach(this,(o,a)=>{const i=O.findKey(n,a);if(i){r[i]=Ia(o),delete r[a];return}const s=t?Ib(a):String(a).trim();s!==a&&delete r[a],r[s]=Ia(o),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return O.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&O.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(`
490
- `)}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[Nd]=this[Nd]={accessors:{}}).accessors,o=this.prototype;function a(i){const s=Co(i);n[s]||(Ob(o,i),n[s]=!0)}return O.isArray(t)?t.forEach(a):a(t),this}};gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(gt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),O.freezeMethods(gt);const Ab="[REDACTED ****]";function Db(e){if(O.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(O.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Nb(e,t){const r=new Set(t.map(a=>String(a).toLowerCase())),n=[],o=a=>{if(a===null||typeof a!="object"||O.isBuffer(a))return a;if(n.indexOf(a)!==-1)return;a instanceof gt&&(a=a.toJSON()),n.push(a);let i;if(O.isArray(a))i=[],a.forEach((s,l)=>{const d=o(s);O.isUndefined(d)||(i[l]=d)});else{if(!O.isPlainObject(a)&&Db(a))return n.pop(),a;i=Object.create(null);for(const[s,l]of Object.entries(a)){const d=r.has(s.toLowerCase())?Ab:o(l);O.isUndefined(d)||(i[s]=d)}}return n.pop(),i};return o(e)}let Z=class _p extends Error{static from(t,r,n,o,a,i){const s=new _p(t.message,r||t.code,n,o,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),i&&Object.assign(s,i),s}constructor(t,r,n,o,a){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),a&&(this.response=a,this.status=a.status)}toJSON(){const t=this.config,r=t&&O.hasOwnProp(t,"redact")?t.redact:void 0,n=O.isArray(r)&&r.length>0?Nb(t,r):O.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}}};Z.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Z.ERR_BAD_OPTION="ERR_BAD_OPTION",Z.ECONNABORTED="ECONNABORTED",Z.ETIMEDOUT="ETIMEDOUT",Z.ECONNREFUSED="ECONNREFUSED",Z.ERR_NETWORK="ERR_NETWORK",Z.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Z.ERR_DEPRECATED="ERR_DEPRECATED",Z.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Z.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Z.ERR_CANCELED="ERR_CANCELED",Z.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Z.ERR_INVALID_URL="ERR_INVALID_URL",Z.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const kb=null,kd=100;function ps(e){return O.isPlainObject(e)||O.isArray(e)}function xd(e){return O.endsWith(e,"[]")?e.slice(0,-2):e}function gs(e,t,r){return e?e.concat(t).map(function(o,a){return o=xd(o),!r&&a?"["+o+"]":o}).join(r?".":""):t}function xb(e){return O.isArray(e)&&!e.some(ps)}const Lb=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function Oa(e,t,r){if(!O.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=O.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!O.isUndefined(w[b])});const n=r.metaTokens,o=r.visitor||C,a=r.dots,i=r.indexes,s=r.Blob||typeof Blob<"u"&&Blob,l=r.maxDepth===void 0?kd:r.maxDepth,d=s&&O.isSpecCompliantForm(t),u=[];if(!O.isFunction(o))throw new TypeError("visitor must be a function");function f(v){if(v===null)return"";if(O.isDate(v))return v.toISOString();if(O.isBoolean(v))return v.toString();if(!d&&O.isBlob(v))throw new Z("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(v)||O.isTypedArray(v)?d&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function m(v){if(v>l)throw new Z("Object is too deeply nested ("+v+" levels). Max depth: "+l,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(v,b){if(l===1/0)return JSON.stringify(v);const w=[];return JSON.stringify(v,function(T,I){if(!O.isObject(I))return I;for(;w.length&&w[w.length-1]!==this;)w.pop();return w.push(I),m(b+w.length-1),I})}function C(v,b,w){let S=v;if(O.isReactNative(t)&&O.isReactNativeBlob(v))return t.append(gs(w,b,a),f(v)),!1;if(v&&!w&&typeof v=="object"){if(O.endsWith(b,"{}"))b=n?b:b.slice(0,-2),v=g(v,1);else if(O.isArray(v)&&xb(v)||(O.isFileList(v)||O.endsWith(b,"[]"))&&(S=O.toArray(v)))return b=xd(b),S.forEach(function(I,N){!(O.isUndefined(I)||I===null)&&t.append(i===!0?gs([b],N,a):i===null?b:b+"[]",f(I))}),!1}return ps(v)?!0:(t.append(gs(w,b,a),f(v)),!1)}const p=Object.assign(Lb,{defaultVisitor:C,convertValue:f,isVisitable:ps});function y(v,b,w=0){if(!O.isUndefined(v)){if(m(w),u.indexOf(v)!==-1)throw new Error("Circular reference detected in "+b.join("."));u.push(v),O.forEach(v,function(T,I){(!(O.isUndefined(T)||T===null)&&o.call(t,T,O.isString(I)?I.trim():I,b,p))===!0&&y(T,b?b.concat(I):[I],w+1)}),u.pop()}}if(!O.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Ld(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function ms(e,t){this._pairs=[],e&&Oa(e,this,t)}const Pd=ms.prototype;Pd.append=function(t,r){this._pairs.push([t,r])},Pd.toString=function(t){const r=t?function(n){return t.call(this,n,Ld)}:Ld;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Pb(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Fd(e,t,r){if(!t)return e;const n=O.isFunction(r)?{serialize:r}:r,o=O.getSafeProp(n,"encode")||Pb,a=O.getSafeProp(n,"serialize");let i;if(a?i=a(t,n):i=O.isURLSearchParams(t)?t.toString():new ms(t,n).toString(o),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Md{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){O.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ys={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Fb={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ms,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},vs=typeof window<"u"&&typeof document<"u",bs=typeof navigator=="object"&&navigator||void 0,Mb=vs&&(!bs||["ReactNative","NativeScript","NS"].indexOf(bs.product)<0),$b=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bb=vs&&window.location.href||"http://localhost",ft={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vs,hasStandardBrowserEnv:Mb,hasStandardBrowserWebWorkerEnv:$b,navigator:bs,origin:Bb},Symbol.toStringTag,{value:"Module"})),...Fb};function jb(e,t){return Oa(e,new ft.classes.URLSearchParams,{visitor:function(r,n,o,a){return ft.isNode&&O.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}const $d=kd;function Bd(e){if(e>$d)throw new Z("FormData field is too deeply nested ("+e+" levels). Max depth: "+$d,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function qb(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)Bd(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function Ub(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n<o;n++)a=r[n],t[a]=e[a];return t}function jd(e){function t(r,n,o,a){Bd(a);let i=r[a++];if(i==="__proto__")return!0;const s=Number.isFinite(+i),l=a>=r.length;return i=!i&&O.isArray(o)?o.length:i,l?(O.hasOwnProp(o,i)?o[i]=O.isArray(o[i])?o[i].concat(n):[o[i],n]:o[i]=n,!s):((!O.hasOwnProp(o,i)||!O.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],a)&&O.isArray(o[i])&&(o[i]=Ub(o[i])),!s)}if(O.isFormData(e)&&O.isFunction(e.entries)){const r={};return O.forEachEntry(e,(n,o)=>{t(qb(n),o,r,0)}),r}return null}const On=(e,t)=>e!=null&&O.hasOwnProp(e,t)?e[t]:void 0;function Vb(e,t,r){if(O.isString(e))try{return(t||JSON.parse)(e),O.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const So={transitional:ys,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,a=O.isObject(t);if(a&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return o?JSON.stringify(jd(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t)||O.isReadableStream(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){const l=On(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return jb(t,l).toString();if((s=O.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=On(this,"env"),u=d&&d.FormData;return Oa(s?{"files[]":t}:t,u&&new u,l)}}return a||o?(r.setContentType("application/json",!1),Vb(t)):t}],transformResponse:[function(t){const r=On(this,"transitional")||So.transitional,n=r&&r.forcedJSONParsing,o=On(this,"responseType"),a=o==="json";if(O.isResponse(t)||O.isReadableStream(t))return t;if(t&&O.isString(t)&&(n&&!o||a)){const s=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t,On(this,"parseReviver"))}catch(l){if(s)throw l.name==="SyntaxError"?Z.from(l,Z.ERR_BAD_RESPONSE,this,null,On(this,"response")):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch","query"],e=>{So.headers[e]={}});function ws(e,t){const r=this||So,n=t||r,o=gt.from(n.headers);let a=n.data;return O.forEach(e,function(s){a=s.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function qd(e){return!!(e&&e.__CANCEL__)}let _o=class extends Z{constructor(t,r,n){super(t??"canceled",Z.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ud(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Z("Request failed with status code "+r.status,r.status>=400&&r.status<500?Z.ERR_BAD_REQUEST:Z.ERR_BAD_RESPONSE,r.config,r.request,r))}function zb(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Hb(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,a=0,i;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),u=n[a];i||(i=d),r[o]=l,n[o]=d;let f=a,m=0;for(;f!==o;)m+=r[f++],f=f%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),d-i<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Rb(e,t){let r=0,n=1e3/t,o,a;const i=(d,u=Date.now())=>{r=u,o=null,a&&(clearTimeout(a),a=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=n?i(d,u):(o=d,a||(a=setTimeout(()=>{a=null,i(o)},n-f)))},()=>o&&i(o)]}const Aa=(e,t,r=3)=>{let n=0;const o=Hb(50,250);return Rb(a=>{if(!a||typeof a.loaded!="number")return;const i=a.loaded,s=a.lengthComputable?a.total:void 0,l=s!=null?Math.min(i,s):i,d=Math.max(0,l-n),u=o(d);n=Math.max(n,l);const f={loaded:l,total:s,progress:s?l/s:void 0,bytes:d,rate:u||void 0,estimated:u&&s?(s-l)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},r)},Vd=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},zd=e=>(...t)=>O.asap(()=>e(...t)),Qb=ft.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ft.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,Gb=ft.hasStandardBrowserEnv?{write(e,t,r,n,o,a,i){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];O.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),O.isString(n)&&s.push(`path=${n}`),O.isString(o)&&s.push(`domain=${o}`),a===!0&&s.push("secure"),O.isString(i)&&s.push(`SameSite=${i}`),document.cookie=s.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 Wb(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Kb(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Yb=/^https?:(?!\/\/)/i,Zb=/[\t\n\r]/g;function Xb(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Jb(e){return Xb(e).replace(Zb,"")}function Hd(e,t){if(typeof e=="string"&&Yb.test(Jb(e)))throw new Z('Invalid URL: missing "//" after protocol',Z.ERR_INVALID_URL,t)}function Rd(e,t,r,n){Hd(t,n);let o=!Wb(t);return e&&(o||r===!1)?(Hd(e,n),Kb(e,t)):t}const Qd=e=>e instanceof gt?{...e}:e;function Wr(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,m,g){return O.isPlainObject(u)&&O.isPlainObject(f)?O.merge.call({caseless:g},u,f):O.isPlainObject(f)?O.merge({},f):O.isArray(f)?f.slice():f}function o(u,f,m,g){if(O.isUndefined(f)){if(!O.isUndefined(u))return n(void 0,u,m,g)}else return n(u,f,m,g)}function a(u,f){if(!O.isUndefined(f))return n(void 0,f)}function i(u,f){if(O.isUndefined(f)){if(!O.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function s(u){const f=O.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!O.isUndefined(f))if(O.isPlainObject(f)){if(O.hasOwnProp(f,u))return f[u]}else return;const m=O.hasOwnProp(e,"transitional")?e.transitional:void 0;if(O.isPlainObject(m)&&O.hasOwnProp(m,u))return m[u]}function l(u,f,m){if(O.hasOwnProp(t,m))return n(u,f);if(O.hasOwnProp(e,m))return n(void 0,u)}const d={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:l,headers:(u,f,m)=>o(Qd(u),Qd(f),m,!0)};return O.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const m=O.hasOwnProp(d,f)?d[f]:o,g=O.hasOwnProp(e,f)?e[f]:void 0,C=O.hasOwnProp(t,f)?t[f]:void 0,p=m(g,C,f);O.isUndefined(p)&&m!==l||(r[f]=p)}),O.hasOwnProp(t,"validateStatus")&&O.isUndefined(t.validateStatus)&&s("validateStatusUndefinedResolves")===!1&&(O.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const ew=["content-type","content-length"];function tw(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{ew.includes(n.toLowerCase())&&e.set(n,o)})}const rw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Gd(e){const t=Wr({},e),r=m=>O.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let o=r("withXSRFToken");const a=r("xsrfHeaderName"),i=r("xsrfCookieName");let s=r("headers");const l=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),f=r("url");if(t.headers=s=gt.from(s),t.url=Fd(Rd(d,f,u,t),r("params"),r("paramsSerializer")),l){const m=O.getSafeProp(l,"username")||"",g=O.getSafeProp(l,"password")||"";s.set("Authorization","Basic "+btoa(m+":"+(g?rw(g):"")))}if(O.isFormData(n)&&(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv||O.isReactNative(n)?s.setContentType(void 0):O.isFunction(n.getHeaders)&&tw(s,n.getHeaders(),r("formDataHeaderPolicy"))),ft.hasStandardBrowserEnv&&(O.isFunction(o)&&(o=o(t)),o===!0||o==null&&Qb(t.url))){const g=a&&i&&Gb.read(i);g&&s.set(a,g)}return t}const nw=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Gd(e);let a=o.data;const i=gt.from(o.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:d}=o,u,f,m,g,C;function p(){g&&g(),C&&C(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function v(){if(!y)return;const w=gt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),T={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:e,request:y};Ud(function(N){r(N),p()},function(N){n(N),p()},T),y=null}"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(v)},y.onabort=function(){y&&(n(new Z("Request aborted",Z.ECONNABORTED,e,y)),p(),y=null)},y.onerror=function(S){const T=S&&S.message?S.message:"Network Error",I=new Z(T,Z.ERR_NETWORK,e,y);I.event=S||null,n(I),p(),y=null},y.ontimeout=function(){let S=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||ys;o.timeoutErrorMessage&&(S=o.timeoutErrorMessage),n(new Z(S,T.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,e,y)),p(),y=null},a===void 0&&i.setContentType(null),"setRequestHeader"in y&&O.forEach(Dd(i),function(S,T){y.setRequestHeader(T,S)}),O.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),s&&s!=="json"&&(y.responseType=o.responseType),d&&([m,C]=Aa(d,!0),y.addEventListener("progress",m)),l&&y.upload&&([f,g]=Aa(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{y&&(n(!w||w.type?new _o(null,e,y):w),y.abort(),p(),y=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const b=zb(o.url);if(b&&!ft.protocols.includes(b)){n(new Z("Unsupported protocol "+b+":",Z.ERR_BAD_REQUEST,e));return}y.send(a||null)})},ow=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(l){if(!n){n=!0,i();const d=l instanceof Error?l:this.reason;r.abort(d instanceof Z?d:new _o(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,o(new Z(`timeout of ${t}ms exceeded`,Z.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>O.asap(i),s},aw=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},iw=async function*(e,t){for await(const r of sw(e))yield*aw(r,t)},sw=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()}},Wd=(e,t,r,n)=>{const o=iw(e,t);let a=0,i,s=l=>{i||(i=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await o.next();if(d){s(),l.close();return}let f=u.byteLength;if(r){let m=a+=f;r(m)}l.enqueue(new Uint8Array(u))}catch(d){throw s(d),d}},cancel(l){return s(l),o.return()}},{highWaterMark:2})},Da=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,lw=(e,t,r)=>t+2<r&&Da(e.charCodeAt(t+1))&&Da(e.charCodeAt(t+2));function cw(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 i=n.length;const s=n.length;for(let g=0;g<s;g++)if(n.charCodeAt(g)===37&&g+2<s){const C=n.charCodeAt(g+1),p=n.charCodeAt(g+2);Da(C)&&Da(p)&&(i-=2,g+=2)}let l=0,d=s-1;const u=g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100);d>=0&&(n.charCodeAt(d)===61?(l++,d--):u(d)&&(l++,d-=3)),l===1&&d>=0&&(n.charCodeAt(d)===61||u(d))&&l++;const m=Math.floor(i/4)*3-(l||0);return m>0?m:0}let a=0;for(let i=0,s=n.length;i<s;i++){const l=n.charCodeAt(i);if(l===37&&lw(n,i,s))a+=1,i+=2;else if(l<128)a+=1;else if(l<2048)a+=2;else if(l>=55296&&l<=56319&&i+1<s){const d=n.charCodeAt(i+1);d>=56320&&d<=57343?(a+=4,i++):a+=3}else a+=3}return a}const Cs="1.18.0",Kd=64*1024,{isFunction:Na}=O,dw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Yd=e=>{if(!O.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Zd=(e,...t)=>{try{return!!e(...t)}catch{return!1}},uw=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},fw=e=>{const t=O.global!==void 0&&O.global!==null?O.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=O.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:a,Response:i}=e,s=o?Na(o):typeof fetch=="function",l=Na(a),d=Na(i);if(!s)return!1;const u=s&&Na(r),f=s&&(typeof n=="function"?(v=>b=>v.encode(b))(new n):async v=>new Uint8Array(await new a(v).arrayBuffer())),m=l&&u&&Zd(()=>{let v=!1;const b=new a(ft.origin,{body:new r,method:"POST",get duplex(){return v=!0,"half"}}),w=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),v&&!w}),g=d&&u&&Zd(()=>O.isReadableStream(new i("").body)),C={stream:g&&(v=>v.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!C[v]&&(C[v]=(b,w)=>{let S=b&&b[v];if(S)return S.call(b);throw new Z(`Response type '${v}' is not supported`,Z.ERR_NOT_SUPPORT,w)})});const p=async v=>{if(v==null)return 0;if(O.isBlob(v))return v.size;if(O.isSpecCompliantForm(v))return(await new a(ft.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(O.isArrayBufferView(v)||O.isArrayBuffer(v))return v.byteLength;if(O.isURLSearchParams(v)&&(v=v+""),O.isString(v))return(await f(v)).byteLength},y=async(v,b)=>{const w=O.toFiniteNumber(v.getContentLength());return w??p(b)};return async v=>{let{url:b,method:w,data:S,signal:T,cancelToken:I,timeout:N,onDownloadProgress:x,onUploadProgress:B,responseType:q,headers:k,withCredentials:P="same-origin",fetchOptions:M,maxContentLength:L,maxBodyLength:F}=Gd(v);const H=O.isNumber(L)&&L>-1,X=O.isNumber(F)&&F>-1,ve=R=>O.hasOwnProp(v,R)?v[R]:void 0;let Ee=o||fetch;q=q?(q+"").toLowerCase():"text";let Ce=ow([T,I&&I.toAbortSignal()],N),ue=null;const Q=Ce&&Ce.unsubscribe&&(()=>{Ce.unsubscribe()});let ne,te=null;const V=()=>new Z("Request body larger than maxBodyLength limit",Z.ERR_BAD_REQUEST,v,ue);try{let R;const ie=ve("auth");if(ie){const re=O.getSafeProp(ie,"username")||"",Ke=O.getSafeProp(ie,"password")||"";R={username:re,password:Ke}}if(uw(b)){const re=new URL(b,ft.origin);if(!R&&(re.username||re.password)){const Ke=Yd(re.username),Re=Yd(re.password);R={username:Ke,password:Re}}(re.username||re.password)&&(re.username="",re.password="",b=re.href)}if(R&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa(dw((R.username||"")+":"+(R.password||""))))),H&&typeof b=="string"&&b.startsWith("data:")&&cw(b)>L)throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue);if(X&&w!=="get"&&w!=="head"){const re=await p(S);if(typeof re=="number"&&isFinite(re)&&(ne=re,re>F))throw V()}const fe=X&&(O.isReadableStream(S)||O.isStream(S)),J=(re,Ke,Re)=>Wd(re,Kd,He=>{if(X&&He>F)throw te=V();Ke&&Ke(He)},Re);if(m&&w!=="get"&&w!=="head"&&(B||fe)){if(ne=ne??await y(k,S),ne!==0||fe){let re=new a(b,{method:"POST",body:S,duplex:"half"}),Ke;if(O.isFormData(S)&&(Ke=re.headers.get("content-type"))&&k.setContentType(Ke),re.body){const[Re,He]=B&&Vd(ne,Aa(zd(B)))||[];S=J(re.body,Re,He)}}}else if(fe&&!l&&u&&w!=="get"&&w!=="head")S=J(S);else if(fe&&l&&!m&&w!=="get"&&w!=="head")throw new Z("Stream request bodies are not supported by the current fetch implementation",Z.ERR_NOT_SUPPORT,v,ue);O.isString(P)||(P=P?"include":"omit");const oe=l&&"credentials"in a.prototype;if(O.isFormData(S)){const re=k.getContentType();re&&/^multipart\/form-data/i.test(re)&&!/boundary=/i.test(re)&&k.delete("content-type")}k.set("User-Agent","axios/"+Cs,!1);const Me={...M,signal:Ce,method:w.toUpperCase(),headers:Dd(k.normalize()),body:S,duplex:"half",credentials:oe?P:void 0};ue=l&&new a(b,Me);let Oe=await(l?Ee(ue,M):Ee(b,Me));const Ve=gt.from(Oe.headers);if(H){const re=O.toFiniteNumber(Ve.getContentLength());if(re!=null&&re>L)throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue)}const We=g&&(q==="stream"||q==="response");if(g&&Oe.body&&(x||H||We&&Q)){const re={};["status","statusText","headers"].forEach(It=>{re[It]=Oe[It]});const Ke=O.toFiniteNumber(Ve.getContentLength()),[Re,He]=x&&Vd(Ke,Aa(zd(x),!0))||[];let et=0;const Gt=It=>{if(H&&(et=It,et>L))throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue);Re&&Re(It)};Oe=new i(Wd(Oe.body,Kd,Gt,()=>{He&&He(),Q&&Q()}),re)}q=q||"text";let ze=await C[O.findKey(C,q)||"text"](Oe,v);if(H&&!g&&!We){let re;if(ze!=null&&(typeof ze.byteLength=="number"?re=ze.byteLength:typeof ze.size=="number"?re=ze.size:typeof ze=="string"&&(re=typeof n=="function"?new n().encode(ze).byteLength:ze.length)),typeof re=="number"&&re>L)throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue)}return!We&&Q&&Q(),await new Promise((re,Ke)=>{Ud(re,Ke,{data:ze,headers:gt.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:v,request:ue})})}catch(R){if(Q&&Q(),Ce&&Ce.aborted&&Ce.reason instanceof Z){const ie=Ce.reason;throw ie.config=v,ue&&(ie.request=ue),R!==ie&&(ie.cause=R),ie}throw te?(ue&&!te.request&&(te.request=ue),te):R instanceof Z?(ue&&!R.request&&(R.request=ue),R):R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new Z("Network Error",Z.ERR_NETWORK,v,ue,R&&R.response),{cause:R.cause||R}):Z.from(R,R&&R.code,v,ue,R&&R.response)}}},hw=new Map,Xd=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,a=[n,o,r];let i=a.length,s=i,l,d,u=hw;for(;s--;)l=a[s],d=u.get(l),d===void 0&&u.set(l,d=s?new Map:fw(t)),u=d;return d};Xd();const Ss={http:kb,xhr:nw,fetch:{get:Xd}};O.forEach(Ss,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Jd=e=>`- ${e}`,pw=e=>O.isFunction(e)||e===null||e===!1;function gw(e,t){e=O.isArray(e)?e:[e];const{length:r}=e;let n,o;const a={};for(let i=0;i<r;i++){n=e[i];let s;if(o=n,!pw(n)&&(o=Ss[(s=String(n)).toLowerCase()],o===void 0))throw new Z(`Unknown adapter '${s}'`);if(o&&(O.isFunction(o)||(o=o.get(t))))break;a[s||"#"+i]=o}if(!o){const i=Object.entries(a).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=r?i.length>1?`since :
491
- `+i.map(Jd).join(`
492
- `):" "+Jd(i[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o}const eu={getAdapter:gw,adapters:Ss};function _s(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _o(null,e)}function tu(e){return _s(e),e.headers=gt.from(e.headers),e.data=ws.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),eu.getAdapter(e.adapter||So.adapter,e)(e).then(function(n){_s(e),e.response=n;try{n.data=ws.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=gt.from(n.headers),n},function(n){if(!qd(n)&&(_s(e),n&&n.response)){e.response=n.response;try{n.response.data=ws.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=gt.from(n.response.headers)}return Promise.reject(n)})}const ka={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ka[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ru={};ka.transitional=function(t,r,n){function o(a,i){return"[Axios v"+Cs+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,s)=>{if(t===!1)throw new Z(o(i," has been removed"+(r?" in "+r:"")),Z.ERR_DEPRECATED);return r&&!ru[i]&&(ru[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,i,s):!0}},ka.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function mw(e,t,r){if(typeof e!="object")throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const a=n[o],i=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(i){const s=e[a],l=s===void 0||i(s,a,e);if(l!==!0)throw new Z("option "+a+" must be "+l,Z.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Z("Unknown option "+a,Z.ERR_BAD_OPTION)}}const xa={assertOptions:mw,validators:ka},mt=xa.validators;let Kr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Md,response:new Md}}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 a=(()=>{if(!o.stack)return"";const i=o.stack.indexOf(`
493
- `);return i===-1?"":o.stack.slice(i+1)})();try{if(!n.stack)n.stack=a;else if(a){const i=a.indexOf(`
494
- `),s=i===-1?-1:a.indexOf(`
495
- `,i+1),l=s===-1?"":a.slice(s+1);String(n.stack).endsWith(l)||(n.stack+=`
496
- `+a)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Wr(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:a}=r;n!==void 0&&xa.assertOptions(n,{silentJSONParsing:mt.transitional(mt.boolean),forcedJSONParsing:mt.transitional(mt.boolean),clarifyTimeoutError:mt.transitional(mt.boolean),legacyInterceptorReqResOrdering:mt.transitional(mt.boolean),advertiseZstdAcceptEncoding:mt.transitional(mt.boolean),validateStatusUndefinedResolves:mt.transitional(mt.boolean)},!1),o!=null&&(O.isFunction(o)?r.paramsSerializer={serialize:o}:xa.assertOptions(o,{encode:mt.function,serialize:mt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),xa.assertOptions(r,{baseUrl:mt.spelling("baseURL"),withXsrfToken:mt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&O.merge(a.common,a[r.method]);a&&O.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete a[C]}),r.headers=gt.concat(i,a);const s=[];let l=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(r)===!1)return;l=l&&p.synchronous;const y=r.transitional||ys;y&&y.legacyInterceptorReqResOrdering?s.unshift(p.fulfilled,p.rejected):s.push(p.fulfilled,p.rejected)});const d=[];this.interceptors.response.forEach(function(p){d.push(p.fulfilled,p.rejected)});let u,f=0,m;if(!l){const C=[tu.bind(this),void 0];for(C.unshift(...s),C.push(...d),m=C.length,u=Promise.resolve(r);f<m;)u=u.then(C[f++],C[f++]);return u}m=s.length;let g=r;for(;f<m;){const C=s[f++],p=s[f++];try{g=C(g)}catch(y){p.call(this,y);break}}try{u=tu.call(this,g)}catch(C){return Promise.reject(C)}for(f=0,m=d.length;f<m;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=Wr(this.defaults,t);const r=Rd(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Fd(r,t.params,t.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(t){Kr.prototype[t]=function(r,n){return this.request(Wr(n||{},{method:t,url:r,data:n&&O.hasOwnProp(n,"data")?n.data:void 0}))}}),O.forEach(["post","put","patch","query"],function(t){function r(n){return function(a,i,s){return this.request(Wr(s||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Kr.prototype[t]=r(),t!=="query"&&(Kr.prototype[t+"Form"]=r(!0))});let yw=class Tp{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const n=this;this.promise.then(o=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](o);n._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{n.subscribe(s),a=s}).then(o);return i.cancel=function(){n.unsubscribe(a)},i},t(function(a,i,s){n.reason||(n.reason=new _o(a,i,s),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 Tp(function(o){t=o}),cancel:t}}};function vw(e){return function(r){return e.apply(null,r)}}function bw(e){return O.isObject(e)&&e.isAxiosError===!0}const Ts={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(Ts).forEach(([e,t])=>{Ts[t]=e});function nu(e){const t=new Kr(e),r=vd(Kr.prototype.request,t);return O.extend(r,Kr.prototype,t,{allOwnKeys:!0}),O.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return nu(Wr(e,o))},r}const Je=nu(So);Je.Axios=Kr,Je.CanceledError=_o,Je.CancelToken=yw,Je.isCancel=qd,Je.VERSION=Cs,Je.toFormData=Oa,Je.AxiosError=Z,Je.Cancel=Je.CanceledError,Je.all=function(t){return Promise.all(t)},Je.spread=vw,Je.isAxiosError=bw,Je.mergeConfig=Wr,Je.AxiosHeaders=gt,Je.formToJSON=e=>jd(O.isHTMLForm(e)?new FormData(e):e),Je.getAdapter=eu.getAdapter,Je.HttpStatusCode=Ts,Je.default=Je;const{Axios:sk,AxiosError:lk,CanceledError:ck,isCancel:dk,CancelToken:uk,VERSION:fk,all:hk,Cancel:pk,isAxiosError:gk,spread:mk,toFormData:yk,AxiosHeaders:vk,HttpStatusCode:bk,formToJSON:wk,getAdapter:Ck,mergeConfig:Sk,create:_k}=Je;let Es="";function ou(e){Es=e}const ke=Je.create({timeout:3e4});ke.interceptors.request.use(async e=>{var o;const{useEditorStore:t}=await Promise.resolve().then(()=>hv),n=(o=t.getState().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),Es&&(e.baseURL=Es),e});const au=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function ww(e,t={}){var l,d,u,f;const n={"organisations.roles":[((l=t.objectType)==null?void 0:l.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const o=e.includes("@"),a=/^\d{10,}$/.test(e.trim()),i={filters:n,fields:au,offset:0,limit:t.limit??200};return o?n.email=e.trim():a?n.phone=e.trim():i.query=e,((f=(u=(d=(await ke.post("/action/user/v1/search",{request:i},{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 Cw(e){var r,n,o;return e.length?((o=(n=(r=(await ke.post("/action/user/v1/search",{request:{filters:{userId:e},fields:au,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 Sw(e){var r,n;return((n=(r=(await ke.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const iu="/portal";async function su(e){var n,o,a,i,s,l,d;const t=await ke.get(`${iu}/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=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((l=(s=t.data)==null?void 0:s.params)==null?void 0:l.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 _w(e){var r,n;return e.length?((n=(r=(await ke.post(`${iu}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Is(e,t){const r=e??{},n=r.identifier??"",o=r.objectType??"",a=r.mimeType??"",i=r.children,s=Array.isArray(i)?i.map(d=>Is(d,n)):[],l=a==="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"||a==="application/vnd.sunbird.questionset"&&s.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:l,children:s,metadata:r,parent:t}}async function lu(e){var o,a,i,s,l,d,u;const t=await ke.get(`/action/content/v3/hierarchy/${e}`,{params:{mode:"edit"}}),r=(a=(o=t.data)==null?void 0:o.result)==null?void 0:a.content;if(!r||!r.identifier){const f=((s=(i=t.data)==null?void 0:i.params)==null?void 0:s.errmsg)||((d=(l=t.data)==null?void 0:l.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=Is(r);return{content:r,rootNode:n}}async function Tw(e){const t=await su(e),r=Is(t);return{content:t,rootNode:r}}async function Ew(e,t,r,n){var a;return((a=(await ke.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:a.result)??{}}async function Iw(e,t=""){await ke.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function Ow(e){var r,n;return(n=(r=(await ke.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function Aw(e){await ke.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function Dw(e,t){await ke.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function Nw(e,t){await ke.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const De={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"},kw=({contentId:e,onClose:t})=>{var B,q;const r=ce(),n=ae(k=>k.editorConfig),o=(B=n==null?void 0:n.context)==null?void 0:B.channel,a=(q=n==null?void 0:n.config)==null?void 0:q.objectType,[i,s]=h.useState(""),[l,d]=h.useState([]),[u,f]=h.useState(!1),[m,g]=h.useState([]),[C,p]=h.useState(!1),[y,v]=h.useState(""),[b,w]=h.useState(!1),S=h.useRef(null);h.useEffect(()=>{let k=!1;return(async()=>{try{const P=await Ow(e),M=(P==null?void 0:P.collaborators)??[];if(!M.length)return;const L=await Cw(M);if(k)return;const F=M.map(H=>L.find(X=>X.identifier===H)??{identifier:H,firstName:H});g(F)}catch{}})(),()=>{k=!0}},[e]),h.useEffect(()=>{S.current&&clearTimeout(S.current);const k=i.trim();if(k.length<2){d([]);return}return S.current=setTimeout(async()=>{f(!0);try{const P=await ww(k,{rootOrgId:o,objectType:a}),M=new Set(m.map(L=>L.identifier));d(P.filter(L=>!M.has(L.identifier)))}catch{d([])}finally{f(!1)}},300),()=>{S.current&&clearTimeout(S.current)}},[i,m,o,a]);const T=h.useCallback(k=>{g(P=>P.find(M=>M.identifier===k.identifier)?P:[...P,k]),d(P=>P.filter(M=>M.identifier!==k.identifier)),w(!1)},[]),I=h.useCallback(k=>{g(P=>P.filter(M=>M.identifier!==k)),w(!1)},[]),N=h.useCallback(async()=>{p(!0),v(""),w(!1);try{await Nw(e,m.map(k=>k.identifier)),w(!0)}catch{v(r.manageCollaborators.saveFailed)}finally{p(!1)}},[e,m,r.manageCollaborators.saveFailed]),x=k=>`${k.firstName}${k.lastName?` ${k.lastName}`:""}`;return c.jsxs("div",{className:De.container,children:[c.jsxs("div",{className:De.header,children:[c.jsx("h2",{className:De.title,children:r.manageCollaborators.title}),c.jsx("button",{className:De.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:De.body,children:[c.jsxs("div",{className:De.searchSection,children:[c.jsx("label",{className:De.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),c.jsxs("div",{className:De.searchRow,children:[c.jsx("input",{id:"collab-search",type:"text",className:De.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:i,onChange:k=>s(k.target.value)}),u&&c.jsx("span",{className:De.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),l.length>0&&c.jsx("ul",{className:De.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:l.map(k=>{var P,M,L,F;return c.jsxs("li",{className:De.resultItem,role:"option","aria-selected":"false",children:[c.jsxs("div",{className:De.userInfo,children:[c.jsx("span",{className:De.userName,children:x(k)}),k.email&&c.jsx("span",{className:De.userEmail,children:k.email}),(((M=(P=k.organisations)==null?void 0:P[0])==null?void 0:M.orgName)??k.rootOrgName)&&c.jsx("span",{className:De.userOrg,children:((F=(L=k.organisations)==null?void 0:L[0])==null?void 0:F.orgName)??k.rootOrgName})]}),c.jsx($e,{variant:"primary",size:"sm",onClick:()=>T(k),children:r.manageCollaborators.add})]},k.identifier)})}),i.trim().length>=2&&!u&&l.length===0&&c.jsx("p",{className:De.noResults,children:r.manageCollaborators.noUsersFound})]}),c.jsxs("div",{className:De.collabSection,children:[c.jsxs("h3",{className:De.sectionTitle,children:[r.manageCollaborators.currentCollaborators,m.length>0&&c.jsx("span",{className:De.badge,children:m.length})]}),m.length===0?c.jsx("p",{className:De.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):c.jsx("ul",{className:De.collabList,children:m.map(k=>{var P,M,L,F;return c.jsxs("li",{className:De.collabItem,children:[c.jsx("div",{className:De.userAvatar,"aria-hidden":"true",children:x(k).charAt(0).toUpperCase()}),c.jsxs("div",{className:De.userInfo,children:[c.jsx("span",{className:De.userName,children:x(k)}),k.email&&c.jsx("span",{className:De.userEmail,children:k.email}),(((M=(P=k.organisations)==null?void 0:P[0])==null?void 0:M.orgName)??k.rootOrgName)&&c.jsx("span",{className:De.userOrg,children:((F=(L=k.organisations)==null?void 0:L[0])==null?void 0:F.orgName)??k.rootOrgName})]}),c.jsx($e,{variant:"danger",size:"sm",onClick:()=>I(k.identifier),children:r.manageCollaborators.remove})]},k.identifier)})})]}),y&&c.jsx("p",{className:De.error,role:"alert",children:y}),b&&c.jsx("p",{className:De.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),c.jsxs("div",{className:De.footer,children:[c.jsx($e,{variant:"ghost",onClick:t,disabled:C,children:r.manageCollaborators.cancel}),c.jsx($e,{variant:"primary",isLoading:C,onClick:N,children:r.manageCollaborators.save})]})]})};async function xw(e){return(await ke.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function Lw(e,t){var o;const n=((o=(await ke.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 Pw(e){var n;const r=((n=(await ke.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 de={topbar:"_topbar_zj8wk_1",left:"_left_zj8wk_15",right:"_right_zj8wk_23",backBtn:"_backBtn_zj8wk_30",title:"_title_zj8wk_49",statusChip:"_statusChip_zj8wk_61",savedIndicator:"_savedIndicator_zj8wk_73",unsaved:"_unsaved_zj8wk_83",iconBtn:"_iconBtn_zj8wk_88",iconBtnLabel:"_iconBtnLabel_zj8wk_115",qrDropdown:"_qrDropdown_zj8wk_119",qrMenu:"_qrMenu_zj8wk_123",reviewBtns:"_reviewBtns_zj8wk_158",sourcingBtns:"_sourcingBtns_zj8wk_167",modalOverlay:"_modalOverlay_zj8wk_176",sbOverlay:"_sbOverlay_zj8wk_186",sbModal:"_sbModal_zj8wk_196",sbModalHeader:"_sbModalHeader_zj8wk_207",sbModalTitle:"_sbModalTitle_zj8wk_215",sbModalClose:"_sbModalClose_zj8wk_222",sbModalBody:"_sbModalBody_zj8wk_235",sbLabel:"_sbLabel_zj8wk_242",sbTextarea:"_sbTextarea_zj8wk_249",sbError:"_sbError_zj8wk_266",sbModalFooter:"_sbModalFooter_zj8wk_273"};function Fw(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function Mw(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const $w=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:o="primary",onConfirm:a,onCancel:i})=>{const s=ce(),[l,d]=h.useState(""),u=e.toLowerCase().replace(/\s+/g,"-");return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${u}-title`,children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:`${u}-title`,className:de.sbModalTitle,children:e}),c.jsx("button",{className:de.sbModalClose,onClick:i,"aria-label":s.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:de.sbModalBody,children:[c.jsxs("label",{className:de.sbLabel,htmlFor:`${u}-comment`,children:[t," ",c.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:`${u}-comment`,className:de.sbTextarea,placeholder:r,value:l,onChange:f=>d(f.target.value),rows:4,required:!0,"aria-required":"true"}),l.trim().length===0&&c.jsx("p",{className:de.sbError,children:s.reviewCommentModal.fillCommentsError})]}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:i,children:s.reviewCommentModal.cancelButton}),c.jsx($e,{variant:o,onClick:()=>a(l.trim()),disabled:l.trim().length===0,children:n})]})]})})},Bw=({onConfirm:e,onCancel:t})=>{const r=ce(),[n,o]=h.useState(!1);return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:"review-confirm-title",className:de.sbModalTitle,children:r.confirmReviewModal.title}),c.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsx("div",{className:de.sbModalBody,children:c.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[c.jsx("input",{type:"checkbox",checked:n,onChange:a=>o(a.target.checked),style:{marginTop:2}}),c.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",c.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," ",c.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),c.jsx($e,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},jw=({onConfirm:e,onCancel:t})=>{const r=ce(),[n,o]=h.useState(""),a=parseInt(n,10),i=!isNaN(a)&&a>=2&&a<=250;return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:"genqr-title",className:de.sbModalTitle,children:r.generateQRModal.title}),c.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:de.sbModalBody,children:[c.jsxs("label",{className:de.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",c.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:de.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:s=>o(s.target.value)}),n&&!i&&c.jsx("p",{className:de.sbError,children:r.generateQRModal.countRangeError})]}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),c.jsx($e,{variant:"primary",onClick:()=>e(a),disabled:!i,children:r.generateQRModal.generateButton})]})]})})},qw=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:o=!0,onToolbarEvent:a})=>{var ie,fe;const i=ce(),l=Ae(J=>J.treeData)[0],d=(l==null?void 0:l.name)??i.contextualEditor.untitledPlaceholder,u=Mw(((ie=l==null?void 0:l.metadata)==null?void 0:ie.status)??(l==null?void 0:l.status),i.topbar.draftStatusFallback),f=ae(J=>{var oe,Me,Oe,Ve;return((Me=(oe=J.editorConfig)==null?void 0:oe.context)==null?void 0:Me.contentId)??((Ve=(Oe=J.editorConfig)==null?void 0:Oe.context)==null?void 0:Ve.identifier)??""}),{activeModal:m,modalData:g,closeModal:C,openModal:p}=yv(),y=ae(J=>J.buttonLoaders),v=ae(J=>J.categoryMeta),b=!v||v.schemaDefaults.generateDIALCodes!=="No",[w,S]=h.useState(!1),[T,I]=h.useState(!1),[N,x]=h.useState(!1),B=h.useRef(null),[q,k]=h.useState(!1);h.useEffect(()=>{if(!N)return;const J=oe=>{var Me;(Me=B.current)!=null&&Me.contains(oe.target)||x(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[N]);const[P,M]=h.useState(!1),[L,F]=h.useState(!1),{updateNode:H}=Ae(),X=(fe=l==null?void 0:l.metadata)==null?void 0:fe.qrCodeProcessId,ve=h.useCallback(async J=>{if(f){k(!1),M(!0);try{const{processId:oe,reservedDialcodes:Me}=await Lw(f,J);oe&&l&&H(l.id,{qrCodeProcessId:oe,reservedDialcodes:Me}),Ie.success(i.topbar.qrGenerationStartedToast)}catch{Ie.error(i.topbar.qrGenerationFailedToast)}finally{M(!1)}}},[f,l,H,i]),Ee=h.useCallback(async()=>{if(!X){Ie.error(i.topbar.qrCodesNotGeneratedToast);return}F(!0);try{const J=await Pw(X);if(J.status==="in-process"){Ie(i.topbar.qrGenerationInProgressToast,{icon:c.jsx(Qi,{size:16})});return}const oe=J.url;if(!oe){Ie.error(i.topbar.qrCodesNotReadyToast);return}const Me=await fetch(oe).then(He=>He.blob()),Oe=await new Promise(He=>{const et=new FileReader;et.onloadend=()=>He(et.result),et.readAsDataURL(Me)}),Ve=(l==null?void 0:l.metadata)??{},We=He=>Array.isArray(He)?He.join("_"):typeof He=="string"?He:"",ze=[f,We(Ve.medium),We(Ve.gradeLevel),We(Ve.subject)].filter(Boolean),re=new Date().toISOString().replace(/[:.]/g,"-"),Ke=`${ze.join("_")}_${re}.zip`,Re=document.createElement("a");Re.href=Oe,Re.download=Ke,Re.style.display="none",document.body.appendChild(Re),Re.click(),document.body.removeChild(Re),Ie.success(i.topbar.qrCodesDownloadedToast)}catch{Ie.error(i.topbar.qrCodesDownloadFailedToast)}finally{F(!1)}},[X,l,f,i]),Ce=e==="edit",ue=e==="review",Q=e==="sourcingreview",ne=e==="read",te=h.useCallback((J,oe)=>{a({action:J,data:oe})},[a]),V=h.useCallback(()=>{C(),te("publish")},[C,te]),R=h.useCallback((J,oe)=>{const Me=g==null?void 0:g.action;C(),Me==="approve"?te("sourcingApprove",{comment:J,score:oe}):te("reject",{comment:J})},[C,te,g]);return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:de.topbar,role:"banner",children:[c.jsxs("div",{className:de.left,children:[c.jsx("button",{className:de.backBtn,onClick:()=>te("back"),"aria-label":i.topbar.backAriaLabel,type:"button",children:c.jsx(Ay,{size:18})}),c.jsx("h1",{className:de.title,title:d,children:d}),c.jsx("span",{className:`sbx-chip ${de.statusChip}`,"aria-label":`${i.topbar.statusAriaLabelPrefix} ${u}`,children:u})]}),c.jsxs("div",{className:de.right,children:[t?c.jsx("span",{className:de.savedIndicator,"aria-live":"polite",children:i.topbar.savingIndicator}):r&&Ce?c.jsx("span",{className:`${de.savedIndicator} ${de.unsaved}`,"aria-live":"polite",children:i.topbar.unsavedIndicator}):n?c.jsxs("span",{className:de.savedIndicator,"aria-live":"polite",children:[c.jsx(wn,{size:14,"aria-hidden":"true"}),i.topbar.savedIndicatorPrefix," ",Fw(n)]}):null,!ne&&!ue&&!Q&&u!=="Review"&&c.jsx("span",{title:o?void 0:i.topbar.fillRequiredFieldsTooltip,children:c.jsx($e,{variant:"ghost",size:"sm",onClick:()=>te("saveCollection"),disabled:!o,children:i.topbar.saveAsDraftButton})}),Ce&&c.jsxs(c.Fragment,{children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>I(!0),disabled:y.saveCollection,isLoading:y.saveCollection,children:[c.jsx(Wy,{size:14,"aria-hidden":"true"})," ",i.topbar.sendForReviewButton]}),c.jsx("button",{className:de.iconBtn,onClick:()=>p("manageCollaborators"),"aria-label":i.topbar.collaboratorsLabel,title:i.topbar.collaboratorsLabel,type:"button",children:c.jsx(ev,{size:16,"aria-hidden":"true"})}),b&&c.jsxs("div",{className:de.qrDropdown,ref:B,children:[c.jsxs("button",{className:de.iconBtn,onClick:()=>x(J=>!J),"aria-label":i.topbar.qrCodesLabel,title:i.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":N,children:[c.jsx(Jc,{size:16,"aria-hidden":"true"}),c.jsx("span",{className:de.iconBtnLabel,children:i.topbar.qrCodesLabel}),c.jsx(Cn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),N&&c.jsxs("div",{className:de.qrMenu,role:"menu",children:[c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{x(!1),k(!0)},disabled:P,children:[c.jsx(Jc,{size:14}),P?i.topbar.generatingEllipsis:i.topbar.generateQrCodesMenuItem]}),c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{x(!1),Ee()},disabled:L||!X,children:[c.jsx(Fy,{size:14}),L?i.topbar.downloadingEllipsis:i.topbar.downloadQrCodesMenuItem]})]})]})]}),ue&&c.jsxs("div",{className:de.reviewBtns,children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("publishChecklist"),disabled:y.publishCollection,isLoading:y.publishCollection,children:[c.jsx(Wc,{size:14,"aria-hidden":"true"})," ",i.topbar.publishButton]}),c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>S(!0),disabled:y.rejectCollection,isLoading:y.rejectCollection,children:[c.jsx(ed,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]}),Q&&c.jsxs("div",{className:de.sourcingBtns,children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"approve"}),children:[c.jsx(Ky,{size:14,"aria-hidden":"true"})," ",i.topbar.approveButton]}),c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"reject"}),children:[c.jsx(ed,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&c.jsx(Iv,{contentId:f,onConfirm:V,onCancel:C}),m==="qualityParams"&&c.jsx(Ov,{contentId:f,action:(g==null?void 0:g.action)??"reject",onConfirm:R,onCancel:C}),m==="manageCollaborators"&&c.jsx("div",{className:de.modalOverlay,role:"dialog","aria-modal":"true",children:c.jsx(kw,{contentId:f,onClose:C})}),T&&c.jsx(Bw,{onConfirm:()=>{I(!1),te("sendForReview")},onCancel:()=>I(!1)}),w&&c.jsx($w,{titleText:i.topbar.requestChangesTitle,labelText:i.topbar.changesRequestedLabel,placeholderText:i.topbar.describeChangesPlaceholder,submitLabel:i.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:J=>{S(!1),te("reject",{comment:J})},onCancel:()=>S(!1)}),q&&c.jsx(jw,{onConfirm:ve,onCancel:()=>k(!1)})]})},Uw=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const o=ce();return Pe.createPortal(c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsx("span",{id:"unsaved-title",children:o.unsavedChangesModal.title}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:r,"aria-label":o.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:c.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:o.unsavedChangesModal.bodyMessage})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:r,disabled:n,children:o.unsavedChangesModal.cancelButton}),c.jsx($e,{variant:"danger",onClick:t,disabled:n,children:o.unsavedChangesModal.discardButton}),c.jsx($e,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:o.unsavedChangesModal.saveButton})]})]})}),document.body)};var Vw=os();const cu=h.createContext(null);function Nt(){const e=h.useContext(cu);if(e===null)throw new Error("No Tree Api Provided");return e}const du=h.createContext(null);function zw(){const e=h.useContext(du);if(e===null)throw new Error("Provide a NodesContext");return e}const uu=h.createContext(null);function Hw(){const e=h.useContext(uu);if(e===null)throw new Error("Provide a DnDContext");return e}const fu=h.createContext(0);function hu(){h.useContext(fu)}function La(e,t,r){return Math.max(Math.min(e,r),t)}function pu(e){return e&&e.isLeaf}function gu(e){return e&&e.isInternal&&!e.isOpen}function mu(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const yu=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},vu=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Os(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Os(r,t);if(n)return n}return null}function Pa(e,t){if(t(e),e.children)for(let r of e.children)Pa(r,t)}function bu(e){const t=Cu(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 wu(e){const t=Cu(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Qw(t,n);break}r==null||r.focus()}function Rw(e,t){return t+1<e.length?e[t+1]:e[0]}function Qw(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Cu(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 To(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function An(e){return typeof e=="string"?e:e.id}function Gw(e,...t){if(e)return e(...t)}function Su(e){return new Promise((t,r)=>{let n=0;function o(){n+=1,n===100&&r(),e()?t():setTimeout(o,10)}o()})}function _u(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 Tu(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const Ww=Object.freeze(Object.defineProperty({__proto__:null,access:To,bound:La,dfs:Os,focusNextElement:bu,focusPrevElement:wu,getInsertIndex:_u,getInsertParentId:Tu,identify:An,indexOf:vu,isClosed:gu,isDescendant:yu,isItem:pu,isOpenWithEmptyChildren:mu,safeRun:Gw,waitFor:Su,walk:Pa},Symbol.toStringTag,{value:"Module"})),Kw={display:"flex",alignItems:"center",zIndex:1},Yw={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Zw={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Xw=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 c.jsxs("div",{style:Object.assign(Object.assign({},Kw),o),children:[c.jsx("div",{style:Object.assign({},Zw)}),c.jsx("div",{style:Object.assign({},Yw)})]})});function Jw({node:e,attrs:t,innerRef:r,children:n}){return c.jsx("div",Object.assign({},t,{ref:r,onFocus:o=>o.stopPropagation(),onClick:e.handleClick,children:n}))}function eC(e){return c.jsxs("div",{ref:e.dragHandle,style:e.style,children:[c.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?c.jsx(rC,Object.assign({},e)):c.jsx(tC,Object.assign({},e))]})}function tC(e){return c.jsx(c.Fragment,{children:c.jsx("span",{children:e.node.data.name})})}function rC({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()},[]),c.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 Eo="__REACT_ARBORIST_INTERNAL_ROOT__";function Eu(e){var t;function r(a,i,s){const l=e.accessId(a),d=new Io({tree:e,data:a,level:i,parent:s,id:l,children:null,isDraggable:e.isDraggable(a),rowIndex:null}),u=e.accessChildren(a);return u&&(d.children=u.map(f=>r(f,i+1,d))),d}const n=new Io({tree:e,id:Eo,data:{id:Eo},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(a=>r(a,0,n)),n}class Io{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===Eo}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 Io(Object.assign({},this))}edit(){return this.tree.edit(this)}}function As(e){return{type:"EDIT",id:e}}function nC(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function Dn(e){return{type:"FOCUS",id:e}}function oC(){return{type:"TREE_BLUR"}}function aC(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 Ds={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 Iu(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 iC(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:Iu(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:Iu(e.unfiltered,t)}):e}const Nn=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}}},Nr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:An(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(An)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(An)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:An(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:An(e)})};function sC(e=Nn().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 kn={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 lC(e=Nn().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 Nn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const cC={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},dC=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},uC=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function Ou({offset:e,mouse:t,id:r,dragIds:n,isDragging:o}){return c.jsxs(fC,{isDragging:o,children:[c.jsx(hC,{offset:e,children:c.jsx(gC,{id:r,dragIds:n})}),c.jsx(pC,{mouse:t,count:n.length})]})}const fC=h.memo(function(t){return t.isDragging?c.jsx("div",{style:cC,children:t.children}):null});function hC(e){return c.jsx("div",{className:"row preview",style:dC(e.offset),children:e.children})}function pC(e){const{count:t,mouse:r}=e;return t>1?c.jsx("div",{className:"selected-count",style:uC(r),children:t}):null}const gC=h.memo(function(t){const r=Nt(),n=r.get(t.id);return n?c.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function Ns(){return Ns=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},Ns.apply(null,arguments)}function Au(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ks(e,t){return ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ks(e,t)}function mC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ks(e,t)}var Du=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function yC(e,t){return!!(e===t||Du(e)&&Du(t))}function vC(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!yC(e[r],t[r]))return!1;return!0}function xs(e,t){t===void 0&&(t=vC);var r,n=[],o,a=!1;function i(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return a&&r===this&&t(s,n)||(o=e.apply(this,s),a=!0,r=this,n=s),o}return i}var bC=typeof performance=="object"&&typeof performance.now=="function",Nu=bC?function(){return performance.now()}:function(){return Date.now()};function ku(e){cancelAnimationFrame(e.id)}function wC(e,t){var r=Nu();function n(){Nu()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Ls=-1;function xu(e){if(e===void 0&&(e=!1),Ls===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ls=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ls}var xn=null;function Lu(e){if(e===void 0&&(e=!1),xn===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?xn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?xn="negative":xn="positive-ascending"),document.body.removeChild(t),xn}return xn}process.env.NODE_ENV;var CC=150,SC=function(t,r){return t},Fa=null,Ma=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Fa=new WeakSet,Ma=new WeakSet);function Pu(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(f){mC(m,f);function m(C){var p;return p=f.call(this,C)||this,p._instanceProps=l(p.props,Au(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:Au(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=xs(function(y,v,b,w){return p.props.onItemsRendered({overscanStartIndex:y,overscanStopIndex:v,visibleStartIndex:b,visibleStopIndex:w})}),p._callOnScroll=void 0,p._callOnScroll=xs(function(y,v,b){return p.props.onScroll({scrollDirection:y,scrollOffset:v,scrollUpdateWasRequested:b})}),p._getItemStyle=void 0,p._getItemStyle=function(y){var v=p.props,b=v.direction,w=v.itemSize,S=v.layout,T=p._getItemStyleCache(d&&w,d&&S,d&&b),I;if(T.hasOwnProperty(y))I=T[y];else{var N=r(p.props,y,p._instanceProps),x=o(p.props,y,p._instanceProps),B=b==="horizontal"||S==="horizontal",q=b==="rtl",k=B?N:0;T[y]=I={position:"absolute",left:q?void 0:k,right:q?k:void 0,top:B?0:N,height:B?"100%":x,width:B?x:"100%"}}return I},p._getItemStyleCache=void 0,p._getItemStyleCache=xs(function(y,v,b){return{}}),p._onScrollHorizontal=function(y){var v=y.currentTarget,b=v.clientWidth,w=v.scrollLeft,S=v.scrollWidth;p.setState(function(T){if(T.scrollOffset===w)return null;var I=p.props.direction,N=w;if(I==="rtl")switch(Lu()){case"negative":N=-w;break;case"positive-descending":N=S-b-w;break}return N=Math.max(0,Math.min(N,S-b)),{isScrolling:!0,scrollDirection:T.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(y){var v=y.currentTarget,b=v.clientHeight,w=v.scrollHeight,S=v.scrollTop;p.setState(function(T){if(T.scrollOffset===S)return null;var I=Math.max(0,Math.min(S,w-b));return{isScrolling:!0,scrollDirection:T.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(y){var v=p.props.outerRef;p._outerRef=y,typeof v=="function"?v(y):v!=null&&typeof v=="object"&&v.hasOwnProperty("current")&&(v.current=y)},p._resetIsScrollingDebounced=function(){p._resetIsScrollingTimeoutId!==null&&ku(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=wC(p._resetIsScrolling,CC)},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}m.getDerivedStateFromProps=function(p,y){return _C(p,y),u(p),null};var g=m.prototype;return g.scrollTo=function(p){p=Math.max(0,p),this.setState(function(y){return y.scrollOffset===p?null:{scrollDirection:y.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(p,y){y===void 0&&(y="auto");var v=this.props,b=v.itemCount,w=v.layout,S=this.state.scrollOffset;p=Math.max(0,Math.min(p,b-1));var T=0;if(this._outerRef){var I=this._outerRef;w==="vertical"?T=I.scrollWidth>I.clientWidth?xu():0:T=I.scrollHeight>I.clientHeight?xu():0}this.scrollTo(a(this.props,p,y,S,this._instanceProps,T))},g.componentDidMount=function(){var p=this.props,y=p.direction,v=p.initialScrollOffset,b=p.layout;if(typeof v=="number"&&this._outerRef!=null){var w=this._outerRef;y==="horizontal"||b==="horizontal"?w.scrollLeft=v:w.scrollTop=v}this._callPropsCallbacks()},g.componentDidUpdate=function(){var p=this.props,y=p.direction,v=p.layout,b=this.state,w=b.scrollOffset,S=b.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var T=this._outerRef;if(y==="horizontal"||v==="horizontal")if(y==="rtl")switch(Lu()){case"negative":T.scrollLeft=-w;break;case"positive-ascending":T.scrollLeft=w;break;default:var I=T.clientWidth,N=T.scrollWidth;T.scrollLeft=N-I-w;break}else T.scrollLeft=w;else T.scrollTop=w}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ku(this._resetIsScrollingTimeoutId)},g.render=function(){var p=this.props,y=p.children,v=p.className,b=p.direction,w=p.height,S=p.innerRef,T=p.innerElementType,I=p.innerTagName,N=p.itemCount,x=p.itemData,B=p.itemKey,q=B===void 0?SC:B,k=p.layout,P=p.outerElementType,M=p.outerTagName,L=p.style,F=p.useIsScrolling,H=p.width,X=this.state.isScrolling,ve=b==="horizontal"||k==="horizontal",Ee=ve?this._onScrollHorizontal:this._onScrollVertical,Ce=this._getRangeToRender(),ue=Ce[0],Q=Ce[1],ne=[];if(N>0)for(var te=ue;te<=Q;te++)ne.push(h.createElement(y,{data:x,key:q(te,x),index:te,isScrolling:F?X:void 0,style:this._getItemStyle(te)}));var V=n(this.props,this._instanceProps);return h.createElement(P||M||"div",{className:v,onScroll:Ee,ref:this._outerRefSetter,style:Ns({position:"relative",height:w,width:H,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},L)},h.createElement(T||I||"div",{children:ne,ref:S,style:{height:ve?"100%":V,pointerEvents:X?"none":void 0,width:ve?V:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var p=this.props.itemCount;if(p>0){var y=this._getRangeToRender(),v=y[0],b=y[1],w=y[2],S=y[3];this._callOnItemsRendered(v,b,w,S)}}if(typeof this.props.onScroll=="function"){var T=this.state,I=T.scrollDirection,N=T.scrollOffset,x=T.scrollUpdateWasRequested;this._callOnScroll(I,N,x)}},g._getRangeToRender=function(){var p=this.props,y=p.itemCount,v=p.overscanCount,b=this.state,w=b.isScrolling,S=b.scrollDirection,T=b.scrollOffset;if(y===0)return[0,0,0,0];var I=i(this.props,T,this._instanceProps),N=s(this.props,I,T,this._instanceProps),x=!w||S==="backward"?Math.max(1,v):1,B=!w||S==="forward"?Math.max(1,v):1;return[Math.max(0,I-x),Math.max(0,Math.min(y-1,N+B)),I,N]},m}(h.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var _C=function(t,r){var n=t.children,o=t.direction,a=t.height,i=t.layout,s=t.innerTagName,l=t.outerTagName,d=t.width,u=r.instance;if(process.env.NODE_ENV!=="production"){(s!=null||l!=null)&&Ma&&!Ma.has(u)&&(Ma.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=o==="horizontal"||i==="horizontal";switch(o){case"horizontal":case"vertical":Fa&&!Fa.has(u)&&(Fa.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(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+i+'" 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 a!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(a===null?"null":typeof a)+'" was specified.'))}},TC=50,Ln=function(t,r,n){var o=t,a=o.itemSize,i=n.itemMetadataMap,s=n.lastMeasuredIndex;if(r>s){var l=0;if(s>=0){var d=i[s];l=d.offset+d.size}for(var u=s+1;u<=r;u++){var f=a(u);i[u]={offset:l,size:f},l+=f}n.lastMeasuredIndex=r}return i[r]},EC=function(t,r,n){var o=r.itemMetadataMap,a=r.lastMeasuredIndex,i=a>0?o[a].offset:0;return i>=n?Fu(t,r,a,0,n):IC(t,r,Math.max(0,a),n)},Fu=function(t,r,n,o,a){for(;o<=n;){var i=o+Math.floor((n-o)/2),s=Ln(t,i,r).offset;if(s===a)return i;s<a?o=i+1:s>a&&(n=i-1)}return o>0?o-1:0},IC=function(t,r,n,o){for(var a=t.itemCount,i=1;n<a&&Ln(t,n,r).offset<o;)n+=i,i*=2;return Fu(t,r,Math.min(n,a-1),Math.floor(n/2),o)},Mu=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,a=r.estimatedItemSize,i=r.lastMeasuredIndex,s=0;if(i>=n&&(i=n-1),i>=0){var l=o[i];s=l.offset+l.size}var d=n-i-1,u=d*a;return s+u},OC=Pu({getItemOffset:function(t,r,n){return Ln(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Mu,getOffsetForIndexAndAlignment:function(t,r,n,o,a,i){var s=t.direction,l=t.height,d=t.layout,u=t.width,f=s==="horizontal"||d==="horizontal",m=f?u:l,g=Ln(t,r,a),C=Mu(t,a),p=Math.max(0,Math.min(C-m,g.offset)),y=Math.max(0,g.offset-m+g.size+i);switch(n==="smart"&&(o>=y-m&&o<=p+m?n="auto":n="center"),n){case"start":return p;case"end":return y;case"center":return Math.round(y+(p-y)/2);case"auto":default:return o>=y&&o<=p?o:o<y?y:p}},getStartIndexForOffset:function(t,r,n){return EC(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var a=t.direction,i=t.height,s=t.itemCount,l=t.layout,d=t.width,u=a==="horizontal"||l==="horizontal",f=u?d:i,m=Ln(t,r,o),g=n+f,C=m.offset+m.size,p=r;p<s-1&&C<g;)p++,C+=Ln(t,p,o).size;return p},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:o||TC,lastMeasuredIndex:-1};return r.resetAfterIndex=function(i,s){s===void 0&&(s=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,i-1),r._getItemStyleCache(-1),s&&r.forceUpdate()},a},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.'))}}),AC=Pu({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,a,i){var s=t.direction,l=t.height,d=t.itemCount,u=t.itemSize,f=t.layout,m=t.width,g=s==="horizontal"||f==="horizontal",C=g?m:l,p=Math.max(0,d*u-C),y=Math.min(p,r*u),v=Math.max(0,r*u-C+u+i);switch(n==="smart"&&(o>=v-C&&o<=y+C?n="auto":n="center"),n){case"start":return y;case"end":return v;case"center":{var b=Math.round(v+(y-v)/2);return b<Math.ceil(C/2)?0:b>p+Math.floor(C/2)?p:b}case"auto":default:return o>=v&&o<=y?o:o<v?v:y}},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,a=t.height,i=t.itemCount,s=t.itemSize,l=t.layout,d=t.width,u=o==="horizontal"||l==="horizontal",f=r*s,m=u?d:a,g=Math.ceil((m+n-f)/s);return Math.max(0,Math.min(i-1,r+g-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 DC(){var e,t;const r=Nt(),o=Hw().cursor;if(!o||o.type!=="line")return null;const a=r.indent,i=r.rowTopPosition(o.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),s=a*o.level,l=r.renderCursor;return c.jsx(l,{top:i,left:s,indent:a})}var NC=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 kC=h.forwardRef(function(t,r){const{children:n}=t,o=NC(t,["children"]),a=Nt();return c.jsxs("div",Object.assign({ref:r},o,{onClick:i=>{i.currentTarget===i.target&&a.deselectAll()},children:[c.jsx(xC,{}),n]}))}),xC=()=>{const e=Nt();return c.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:c.jsx(DC,{})})};var LC=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 PC=h.forwardRef(function(t,r){var n,o,a,i,{style:s}=t,l=LC(t,["style"]);const d=Nt(),u=(o=(n=d.props.padding)!==null&&n!==void 0?n:d.props.paddingTop)!==null&&o!==void 0?o:0,f=(i=(a=d.props.padding)!==null&&a!==void 0?a:d.props.paddingBottom)!==null&&i!==void 0?i:0;return c.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+u+f}px`})},l))});var $u=h.createContext({dragDropManager:void 0}),Vt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Vt||(Vt={}));function he(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 a;if(t===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;a=new Error(t.replace(/%s/g,function(){return n[i++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}var Ps="dnd-core/INIT_COORDS",$a="dnd-core/BEGIN_DRAG",Fs="dnd-core/PUBLISH_DRAG_SOURCE",Ba="dnd-core/HOVER",ja="dnd-core/DROP",qa="dnd-core/END_DRAG";function Bu(e,t){return{type:Ps,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}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 FC(e,t,r){return t.split(".").reduce(function(n,o){return n&&n[o]?n[o]:r||null},e)}function MC(e,t){return e.filter(function(r){return r!==t})}function ju(e){return Ua(e)==="object"}function $C(e,t){var r=new Map,n=function(i){r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(a,i){a===1&&o.push(i)}),o}function BC(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var jC={type:Ps,payload:{clientOffset:null,sourceClientOffset:null}};function qC(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,a=o===void 0?!0:o,i=n.clientOffset,s=n.getSourceClientOffset,l=e.getMonitor(),d=e.getRegistry();e.dispatch(Bu(i)),UC(r,l,d);var u=HC(r,l);if(u===null){e.dispatch(jC);return}var f=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");VC(s),f=s(u)}e.dispatch(Bu(i,f));var m=d.getSource(u),g=m.beginDrag(l,u);if(g!=null){zC(g),d.pinSource(u);var C=d.getSourceType(u);return{type:$a,payload:{itemType:C,item:g,sourceId:u,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}}function UC(e,t,r){he(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){he(r.getSource(n),"Expected sourceIds to be registered.")})}function VC(e){he(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function zC(e){he(ju(e),"Item must be an object.")}function HC(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 RC(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Fs}}}function Ms(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function QC(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.clientOffset;GC(r);var a=r.slice(0),i=e.getMonitor(),s=e.getRegistry();WC(a,i,s);var l=i.getItemType();return KC(a,s,l),YC(a,i,s),{type:Ba,payload:{targetIds:a,clientOffset:o||null}}}}function GC(e){he(Array.isArray(e),"Expected targetIds to be an array.")}function WC(e,t,r){he(t.isDragging(),"Cannot call hover while not dragging."),he(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];he(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");var a=r.getTarget(o);he(a,"Expected targetIds to be registered.")}}function KC(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n],a=t.getTargetType(o);Ms(a,r)||e.splice(n,1)}}function YC(e,t,r){e.forEach(function(n){var o=r.getTarget(n);o.hover(t,n)})}function qu(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 Uu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qu(Object(r),!0).forEach(function(n){ZC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZC(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XC(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),o=e.getRegistry();JC(n);var a=rS(n);a.forEach(function(i,s){var l=eS(i,s,o,n),d={type:ja,payload:{dropResult:Uu(Uu({},r),l)}};e.dispatch(d)})}}function JC(e){he(e.isDragging(),"Cannot call drop while not dragging."),he(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function eS(e,t,r,n){var o=r.getTarget(e),a=o?o.drop(n,e):void 0;return tS(a),typeof a>"u"&&(a=t===0?{}:n.getDropResult()),a}function tS(e){he(typeof e>"u"||ju(e),"Drop result must either be an object or undefined.")}function rS(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function nS(e){return function(){var r=e.getMonitor(),n=e.getRegistry();oS(r);var o=r.getSourceId();if(o!=null){var a=n.getSource(o,!0);a.endDrag(r,o),n.unpinSource()}return{type:qa}}}function oS(e){he(e.isDragging(),"Cannot call endDrag while not dragging.")}function aS(e){return{beginDrag:qC(e),publishDragSource:RC(e),hover:QC(e),drop:XC(e),endDrag:nS(e)}}function iS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sS(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 lS(e,t,r){return t&&sS(e.prototype,t),e}function Oo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cS=function(){function e(t,r){var n=this;iS(this,e),Oo(this,"store",void 0),Oo(this,"monitor",void 0),Oo(this,"backend",void 0),Oo(this,"isSetUp",!1),Oo(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 lS(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(i){return function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];var u=i.apply(r,l);typeof u<"u"&&n(u)}}var a=aS(this);return Object.keys(a).reduce(function(i,s){var l=a[s];return i[s]=o(l),i},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e}();function zt(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 Vu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),zu=function(){return Math.random().toString(36).substring(7).split("").join(".")},Hu={INIT:"@@redux/INIT"+zu(),REPLACE:"@@redux/REPLACE"+zu()};function dS(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 uS(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(pS(e))return"date";if(hS(e))return"error";var r=fS(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 fS(e){return typeof e.constructor=="function"?e.constructor.name:null}function hS(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function pS(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Pn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=uS(e)),t}function Ru(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"?zt(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"?zt(1):"Expected the enhancer to be a function. Instead, received: '"+Pn(r)+"'");return r(Ru)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?zt(2):"Expected the root reducer to be a function. Instead, received: '"+Pn(e)+"'");var o=e,a=t,i=[],s=i,l=!1;function d(){s===i&&(s=i.slice())}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?zt(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 a}function f(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?zt(4):"Expected the listener to be a function. Instead, received: '"+Pn(p)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?zt(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 y=!0;return d(),s.push(p),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?zt(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();var b=s.indexOf(p);s.splice(b,1),i=null}}}function m(p){if(!dS(p))throw new Error(process.env.NODE_ENV==="production"?zt(7):"Actions must be plain objects. Instead, the actual type was: '"+Pn(p)+"'. 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 p.type>"u")throw new Error(process.env.NODE_ENV==="production"?zt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(l)throw new Error(process.env.NODE_ENV==="production"?zt(9):"Reducers may not dispatch actions.");try{l=!0,a=o(a,p)}finally{l=!1}for(var y=i=s,v=0;v<y.length;v++){var b=y[v];b()}return p}function g(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?zt(10):"Expected the nextReducer to be a function. Instead, received: '"+Pn(p));o=p,m({type:Hu.REPLACE})}function C(){var p,y=f;return p={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?zt(11):"Expected the observer to be an object. Instead, received: '"+Pn(b)+"'");function w(){b.next&&b.next(u())}w();var S=y(w);return{unsubscribe:S}}},p[Vu]=function(){return this},p}return m({type:Hu.INIT}),n={dispatch:m,subscribe:f,getState:u,replaceReducer:g},n[Vu]=C,n}var gS=function(t,r){return t===r};function mS(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function yS(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gS;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 Qu(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 Gu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qu(Object(r),!0).forEach(function(n){vS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wu={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function bS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wu,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ps:case $a:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ba:return mS(e.clientOffset,r.clientOffset)?e:Gu(Gu({},e),{},{clientOffset:r.clientOffset});case qa:case ja:return Wu;default:return e}}var $s="dnd-core/ADD_SOURCE",Bs="dnd-core/ADD_TARGET",js="dnd-core/REMOVE_SOURCE",Va="dnd-core/REMOVE_TARGET";function wS(e){return{type:$s,payload:{sourceId:e}}}function CS(e){return{type:Bs,payload:{targetId:e}}}function SS(e){return{type:js,payload:{sourceId:e}}}function _S(e){return{type:Va,payload:{targetId:e}}}function Ku(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 Ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ku(Object(r),!0).forEach(function(n){TS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ku(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ES={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function IS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ES,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case $a:return Ht(Ht({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Fs:return Ht(Ht({},e),{},{isSourcePublic:!0});case Ba:return Ht(Ht({},e),{},{targetIds:r.targetIds});case Va:return e.targetIds.indexOf(r.targetId)===-1?e:Ht(Ht({},e),{},{targetIds:MC(e.targetIds,r.targetId)});case ja:return Ht(Ht({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case qa:return Ht(Ht({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function OS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case $s:case Bs:return e+1;case js:case Va:return e-1;default:return e}}var za=[],qs=[];za.__IS_NONE__=!0,qs.__IS_ALL__=!0;function AS(e,t){if(e===za)return!1;if(e===qs||typeof t>"u")return!0;var r=BC(t,e);return r.length>0}function DS(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ba:break;case $s:case Bs:case Va:case js:return za;case $a:case Fs:case qa:case ja:default:return qs}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,o=t.prevTargetIds,a=o===void 0?[]:o,i=$C(n,a),s=i.length>0||!yS(n,a);if(!s)return za;var l=a[a.length-1],d=n[n.length-1];return l!==d&&(l&&i.push(l),d&&i.push(d)),i}function NS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Yu(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 Zu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yu(Object(r),!0).forEach(function(n){kS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:DS(e.dirtyHandlerIds,{type:t.type,payload:Zu(Zu({},t.payload),{},{prevTargetIds:FC(e,"dragOperation.targetIds",[])})}),dragOffset:bS(e.dragOffset,t),refCount:OS(e.refCount,t),dragOperation:IS(e.dragOperation,t),stateId:NS(e.stateId)}}function LS(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Xu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function PS(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:Xu(LS(t,n),r)}function FS(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:Xu(t,r)}function MS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $S(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 BS(e,t,r){return t&&$S(e.prototype,t),e}function Ju(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jS=function(){function e(t,r){MS(this,e),Ju(this,"store",void 0),Ju(this,"registry",void 0),this.store=t,this.registry=r}return BS(e,[{key:"subscribeToStateChange",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},a=o.handlerIds;he(typeof r=="function","listener must be a function."),he(typeof a>"u"||Array.isArray(a),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId,s=function(){var d=n.store.getState(),u=d.stateId;try{var f=u===i||u===i+1&&!AS(d.dirtyHandlerIds,a);f||r()}finally{i=u}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;he(typeof r=="function","listener must be a function.");var o=this.store.getState().dragOffset,a=function(){var s=n.store.getState().dragOffset;s!==o&&(o=s,r())};return this.store.subscribe(a)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return he(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(he(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();return Ms(o,a)&&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(he(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var o=this.registry.getSourceType(r),a=this.getItemType();return o!==a?!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 a=this.registry.getTargetType(r),i=this.getItemType();if(i&&!Ms(a,i))return!1;var s=this.getTargetIds();if(!s.length)return!1;var l=s.indexOf(r);return o?l===s.length-1:l>-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 PS(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return FS(this.store.getState().dragOffset)}}]),e}(),qS=0;function US(){return qS++}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 VS(e){he(typeof e.canDrag=="function","Expected canDrag to be a function."),he(typeof e.beginDrag=="function","Expected beginDrag to be a function."),he(typeof e.endDrag=="function","Expected endDrag to be a function.")}function zS(e){he(typeof e.canDrop=="function","Expected canDrop to be a function."),he(typeof e.hover=="function","Expected hover to be a function."),he(typeof e.drop=="function","Expected beginDrag to be a function.")}function Us(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return Us(r,!1)});return}he(typeof e=="string"||Ha(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 ef=typeof global<"u"?global:self,tf=ef.MutationObserver||ef.WebKitMutationObserver;function rf(e){return function(){const r=setTimeout(o,0),n=setInterval(o,50);function o(){clearTimeout(r),clearInterval(n),e()}}}function HS(e){let t=1;const r=new tf(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const RS=typeof tf=="function"?HS:rf;class QS{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=RS(this.flush),this.requestErrorThrow=rf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class GS{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 WS{create(t){const r=this.freeTasks,n=r.length?r.pop():new GS(this.onError,o=>r[r.length]=o);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const nf=new QS,KS=new WS(nf.registerPendingError);function YS(e){nf.enqueueTask(KS.create(e))}function ZS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XS(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 JS(e,t,r){return t&&XS(e.prototype,t),e}function Fn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e_(e,t){return o_(e)||n_(e,t)||r_(e,t)||t_()}function t_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
497
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r_(e,t){if(e){if(typeof e=="string")return of(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 of(e,t)}}function of(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 n_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function o_(e){if(Array.isArray(e))return e}function a_(e){var t=US().toString();switch(e){case Vt.SOURCE:return"S".concat(t);case Vt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function af(e){switch(e[0]){case"S":return Vt.SOURCE;case"T":return Vt.TARGET;default:he(!1,"Cannot parse handler ID: ".concat(e))}}function sf(e,t){var r=e.entries(),n=!1;do{var o=r.next(),a=o.done,i=e_(o.value,2),s=i[1];if(s===t)return!0;n=!!a}while(!n);return!1}var i_=function(){function e(t){ZS(this,e),Fn(this,"types",new Map),Fn(this,"dragSources",new Map),Fn(this,"dropTargets",new Map),Fn(this,"pinnedSourceId",null),Fn(this,"pinnedSource",null),Fn(this,"store",void 0),this.store=t}return JS(e,[{key:"addSource",value:function(r,n){Us(r),VS(n);var o=this.addHandler(Vt.SOURCE,r,n);return this.store.dispatch(wS(o)),o}},{key:"addTarget",value:function(r,n){Us(r,!0),zS(n);var o=this.addHandler(Vt.TARGET,r,n);return this.store.dispatch(CS(o)),o}},{key:"containsHandler",value:function(r){return sf(this.dragSources,r)||sf(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;he(this.isSourceId(r),"Expected a valid source ID.");var o=n&&r===this.pinnedSourceId,a=o?this.pinnedSource:this.dragSources.get(r);return a}},{key:"getTarget",value:function(r){return he(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return he(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return he(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=af(r);return n===Vt.SOURCE}},{key:"isTargetId",value:function(r){var n=af(r);return n===Vt.TARGET}},{key:"removeSource",value:function(r){var n=this;he(this.getSource(r),"Expected an existing source."),this.store.dispatch(SS(r)),YS(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){he(this.getTarget(r),"Expected an existing target."),this.store.dispatch(_S(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);he(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){he(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,o){var a=a_(r);return this.types.set(a,n),r===Vt.SOURCE?this.dragSources.set(a,o):r===Vt.TARGET&&this.dropTargets.set(a,o),a}}]),e}();function s_(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=l_(n),a=new jS(o,new i_(o)),i=new cS(o,a),s=e(i,t,r);return i.receiveBackend(s),i}function l_(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Ru(xS,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var c_=["children"];function d_(e,t){return p_(e)||h_(e,t)||f_(e,t)||u_()}function u_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
498
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f_(e,t){if(e){if(typeof e=="string")return lf(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 lf(e,t)}}function lf(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 h_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function p_(e){if(Array.isArray(e))return e}function g_(e,t){if(e==null)return{};var r=m_(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m_(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var cf=0,Ra=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),y_=h.memo(function(t){var r=t.children,n=g_(t,c_),o=v_(n),a=d_(o,2),i=a[0],s=a[1];return h.useEffect(function(){if(s){var l=df();return++cf,function(){--cf===0&&(l[Ra]=null)}}},[]),c.jsx($u.Provider,Object.assign({value:i},{children:r}),void 0)});function v_(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=b_(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function b_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:df(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[Ra]||(o[Ra]={dragDropManager:s_(e,t,r,n)}),o[Ra]}function df(){return typeof global<"u"?global:window}function w_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C_(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 S_(e,t,r){return t&&C_(e.prototype,t),e}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Vs=!1,zs=!1,__=function(){function e(t){w_(this,e),uf(this,"internalMonitor",void 0),uf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return S_(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){he(!Vs,"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 Vs=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Vs=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;he(!zs,"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 zs=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{zs=!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 T_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E_(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 I_(e,t,r){return t&&E_(e.prototype,t),e}function ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Hs=!1,O_=function(){function e(t){T_(this,e),ff(this,"internalMonitor",void 0),ff(this,"targetId",null),this.internalMonitor=t.getMonitor()}return I_(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;he(!Hs,"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 Hs=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Hs=!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 A_(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 D_(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;A_(o);var a=r?function(i){return e(i,r)}:e;return N_(o,a)}}function hf(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=D_(n);t[r]=function(){return o}}}),t}function pf(e,t){typeof e=="function"?e(t):e.current=t}function N_(e,t){var r=e.ref;return he(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){pf(r,o),pf(t,o)}}):h.cloneElement(e,{ref:t})}function Qa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qa=function(r){return typeof r}:Qa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qa(e)}function Rs(e){return e!==null&&Qa(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Qs(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 a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var d=a[l];if(!s(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 k_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x_(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 L_(e,t,r){return t&&x_(e.prototype,t),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 P_=function(){function e(t){var r=this;k_(this,e),yt(this,"hooks",hf({dragSource:function(o,a){r.clearDragSource(),r.dragSourceOptions=a||null,Rs(o)?r.dragSourceRef=o:r.dragSourceNode=o,r.reconnectDragSource()},dragPreview:function(o,a){r.clearDragPreview(),r.dragPreviewOptions=a||null,Rs(o)?r.dragPreviewRef=o:r.dragPreviewNode=o,r.reconnectDragPreview()}})),yt(this,"handlerId",null),yt(this,"dragSourceRef",null),yt(this,"dragSourceNode",void 0),yt(this,"dragSourceOptionsInternal",null),yt(this,"dragSourceUnsubscribe",void 0),yt(this,"dragPreviewRef",null),yt(this,"dragPreviewNode",void 0),yt(this,"dragPreviewOptionsInternal",null),yt(this,"dragPreviewUnsubscribe",void 0),yt(this,"lastConnectedHandlerId",null),yt(this,"lastConnectedDragSource",null),yt(this,"lastConnectedDragSourceOptions",null),yt(this,"lastConnectedDragPreview",null),yt(this,"lastConnectedDragPreviewOptions",null),yt(this,"backend",void 0),this.backend=t}return L_(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!Qs(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Qs(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 F_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M_(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 $_(e,t,r){return t&&M_(e.prototype,t),e}function ir(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var B_=function(){function e(t){var r=this;F_(this,e),ir(this,"hooks",hf({dropTarget:function(o,a){r.clearDropTarget(),r.dropTargetOptions=a,Rs(o)?r.dropTargetRef=o:r.dropTargetNode=o,r.reconnect()}})),ir(this,"handlerId",null),ir(this,"dropTargetRef",null),ir(this,"dropTargetNode",void 0),ir(this,"dropTargetOptionsInternal",null),ir(this,"unsubscribeDropTarget",void 0),ir(this,"lastConnectedHandlerId",null),ir(this,"lastConnectedDropTarget",null),ir(this,"lastConnectedDropTargetOptions",null),ir(this,"backend",void 0),this.backend=t}return $_(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!Qs(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 j_(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function q_(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}var Yr=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Ga(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ga=function(r){return typeof r}:Ga=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ga(e)}function U_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V_(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 z_(e,t,r){return t&&V_(e.prototype,t),e}function Gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var H_=function(){function e(t,r,n){U_(this,e),Gs(this,"spec",void 0),Gs(this,"monitor",void 0),Gs(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return z_(e,[{key:"beginDrag",value:function(){var r,n=this.spec,o=this.monitor,a=null;return Ga(n.item)==="object"?a=n.item:typeof n.item=="function"?a=n.item(o):a={},(r=a)!==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,a=this.monitor,i=o.isDragging;return i?i(a):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,o=this.connector,a=r.end;a&&a(n.getItem(),n),o.reconnect()}}]),e}();function R_(e,t,r){var n=h.useMemo(function(){return new H_(e,t,r)},[t,r]);return h.useEffect(function(){n.spec=e},[e]),n}function Zr(){var e=h.useContext($u),t=e.dragDropManager;return he(t!=null,"Expected drag drop context"),t}function Q_(e){return h.useMemo(function(){var t=e.type;return he(t!=null,"spec.type must be defined"),t},[e])}function G_(e,t){return Z_(e)||Y_(e,t)||K_(e,t)||W_()}function W_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
499
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K_(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 Y_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function Z_(e){if(Array.isArray(e))return e}function X_(e,t,r){var n=Zr(),o=R_(e,t,r),a=Q_(e);Yr(function(){if(a!=null){var s=q_(a,o,n),l=G_(s,2),d=l[0],u=l[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u}},[n,t,r,o,a])}function J_(e){return n0(e)||r0(e)||t0(e)||e0()}function e0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
500
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t0(e,t){if(e){if(typeof e=="string")return Ws(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 Ws(e,t)}}function r0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function n0(e){if(Array.isArray(e))return Ws(e)}function Ws(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 mf(e,t){var r=J_(t||[]);return t==null&&typeof e!="function"&&r.push(e),h.useMemo(function(){return typeof e=="function"?e():e},r)}function o0(){var e=Zr();return h.useMemo(function(){return new __(e)},[e])}function a0(e,t){var r=Zr(),n=h.useMemo(function(){return new P_(r.getBackend())},[r]);return Yr(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),Yr(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var i0=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,a;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(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;o--!==0;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r};const s0=rd(i0);function l0(e,t){return f0(e)||u0(e,t)||d0(e,t)||c0()}function c0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
501
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d0(e,t){if(e){if(typeof e=="string")return yf(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 yf(e,t)}}function yf(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 u0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function f0(e){if(Array.isArray(e))return e}function vf(e,t,r){var n=h.useState(function(){return t(e)}),o=l0(n,2),a=o[0],i=o[1],s=h.useCallback(function(){var l=t(e);s0(a,l)||(i(l),r&&r())},[a,e,r]);return Yr(s),[a,s]}function h0(e,t){return y0(e)||m0(e,t)||g0(e,t)||p0()}function p0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
502
- 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 bf(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 bf(e,t)}}function bf(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 m0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function y0(e){if(Array.isArray(e))return e}function v0(e,t,r){var n=vf(e,t,r),o=h0(n,2),a=o[0],i=o[1];return Yr(function(){var l=e.getHandlerId();if(l!=null)return e.subscribeToStateChange(i,{handlerIds:[l]})},[e,i]),a}function wf(e,t,r){return v0(t,e||function(){return{}},function(){return r.reconnect()})}function b0(e){return h.useMemo(function(){return e.hooks.dragSource()},[e])}function w0(e){return h.useMemo(function(){return e.hooks.dragPreview()},[e])}function C0(e,t){var r=mf(e,t);he(!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=o0(),o=a0(r.options,r.previewOptions);return X_(r,n,o),[wf(r.collect,n,o),b0(o),w0(o)]}function S0(e){var t=e.accept;return h.useMemo(function(){return he(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function _0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T0(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&&T0(e.prototype,t),e}function Cf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I0=function(){function e(t,r){_0(this,e),Cf(this,"spec",void 0),Cf(this,"monitor",void 0),this.spec=t,this.monitor=r}return E0(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 O0(e,t){var r=h.useMemo(function(){return new I0(e,t)},[t]);return h.useEffect(function(){r.spec=e},[e]),r}function A0(e,t){return x0(e)||k0(e,t)||N0(e,t)||D0()}function D0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
503
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N0(e,t){if(e){if(typeof e=="string")return Sf(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 Sf(e,t)}}function Sf(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,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function x0(e){if(Array.isArray(e))return e}function L0(e,t,r){var n=Zr(),o=O0(e,t),a=S0(e);Yr(function(){var s=j_(a,o,n),l=A0(s,2),d=l[0],u=l[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u},[n,t,o,r,a.map(function(i){return i.toString()}).join("|")])}function P0(){var e=Zr();return h.useMemo(function(){return new O_(e)},[e])}function F0(e){var t=Zr(),r=h.useMemo(function(){return new B_(t.getBackend())},[t]);return Yr(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function M0(e){return h.useMemo(function(){return e.hooks.dropTarget()},[e])}function _f(e,t){var r=mf(e,t),n=P0(),o=F0(r.options);return L0(r,n,o),[wf(r.collect,n,o),M0(o)]}function $0(e,t){return U0(e)||q0(e,t)||j0(e,t)||B0()}function B0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
504
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j0(e,t){if(e){if(typeof e=="string")return Tf(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 Tf(e,t)}}function Tf(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 q0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function U0(e){if(Array.isArray(e))return e}function V0(e){var t=Zr(),r=t.getMonitor(),n=vf(r,e),o=$0(n,2),a=o[0],i=o[1];return h.useEffect(function(){return r.subscribeToOffsetChange(i)}),h.useEffect(function(){return r.subscribeToStateChange(i)}),a}function Ef(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function z0(e,t){return e.filter(function(r){return r!==t})}function H0(e,t){var r=new Set,n=function(i){return r.add(i)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(a){return o.push(a)}),o}function R0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q0(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 G0(e,t,r){return t&&Q0(e.prototype,t),e}function If(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){R0(this,e),If(this,"entered",[]),If(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return G0(e,[{key:"enter",value:function(r){var n=this,o=this.entered.length,a=function(s){return n.isNodeInDocument(s)&&(!s.contains||s.contains(r))};return this.entered=H0(this.entered.filter(a),[r]),o===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=z0(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),K0=Ef(function(){return/firefox/i.test(navigator.userAgent)}),Of=Ef(function(){return!!window.safari});function Y0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z0(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 X0(e,t,r){return t&&Z0(e.prototype,t),e}function Ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Af=function(){function e(t,r){Y0(this,e),Ao(this,"xs",void 0),Ao(this,"ys",void 0),Ao(this,"c1s",void 0),Ao(this,"c2s",void 0),Ao(this,"c3s",void 0);for(var n=t.length,o=[],a=0;a<n;a++)o.push(a);o.sort(function(x,B){return t[x]<t[B]?-1:1});for(var i=[],s=[],l,d,u=0;u<n-1;u++)l=t[u+1]-t[u],d=r[u+1]-r[u],i.push(l),s.push(d/l);for(var f=[s[0]],m=0;m<i.length-1;m++){var g=s[m],C=s[m+1];if(g*C<=0)f.push(0);else{l=i[m];var p=i[m+1],y=l+p;f.push(3*y/((y+p)/g+(y+l)/C))}}f.push(s[s.length-1]);for(var v=[],b=[],w,S=0;S<f.length-1;S++){w=s[S];var T=f[S],I=1/i[S],N=T+f[S+1]-w-w;v.push((w-T-N)*I),b.push(N*I*I)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=v,this.c3s=b}return X0(e,[{key:"interpolate",value:function(r){var n=this.xs,o=this.ys,a=this.c1s,i=this.c2s,s=this.c3s,l=n.length-1;if(r===n[l])return o[l];for(var d=0,u=s.length-1,f;d<=u;){f=Math.floor(.5*(d+u));var m=n[f];if(m<r)d=f+1;else if(m>r)u=f-1;else return o[f]}l=Math.max(0,u);var g=r-n[l],C=g*g;return o[l]+a[l]*g+i[l]*C+s[l]*g*C}}]),e}(),J0=1;function Df(e){var t=e.nodeType===J0?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function Wa(e){return{x:e.clientX,y:e.clientY}}function eT(e){var t;return e.nodeName==="IMG"&&(K0()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function tT(e,t,r,n){var o=e?t.width:r,a=e?t.height:n;return Of()&&e&&(a/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:a}}function rT(e,t,r,n,o){var a=eT(t),i=a?e:t,s=Df(i),l={x:r.x-s.x,y:r.y-s.y},d=e.offsetWidth,u=e.offsetHeight,f=n.anchorX,m=n.anchorY,g=tT(a,t,d,u),C=g.dragPreviewWidth,p=g.dragPreviewHeight,y=function(){var N=new Af([0,.5,1],[l.y,l.y/u*p,l.y+p-u]),x=N.interpolate(m);return Of()&&a&&(x+=(window.devicePixelRatio-1)*p),x},v=function(){var N=new Af([0,.5,1],[l.x,l.x/d*C,l.x+C-d]);return N.interpolate(f)},b=o.offsetX,w=o.offsetY,S=b===0||b,T=w===0||w;return{x:S?b:v(),y:T?w:y()}}var Nf="__NATIVE_FILE__",kf="__NATIVE_URL__",xf="__NATIVE_TEXT__",Lf="__NATIVE_HTML__";const Pf=Object.freeze(Object.defineProperty({__proto__:null,FILE:Nf,HTML:Lf,TEXT:xf,URL:kf},Symbol.toStringTag,{value:"Module"}));function Ks(e,t,r){var n=t.reduce(function(o,a){return o||e.getData(a)},"");return n??r}var Mn;function Ka(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ys=(Mn={},Ka(Mn,Nf,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Ka(Mn,Lf,{exposeProperties:{html:function(t,r){return Ks(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Ka(Mn,kf,{exposeProperties:{urls:function(t,r){return Ks(t,r,"").split(`
505
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Ka(Mn,xf,{exposeProperties:{text:function(t,r){return Ks(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Mn);function nT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oT(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 aT(e,t,r){return t&&oT(e.prototype,t),e}function Ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var iT=function(){function e(t){nT(this,e),Ff(this,"item",void 0),Ff(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return aT(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(a){o[a]={value:n.config.exposeProperties[a](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 sT(e,t){var r=new iT(Ys[e]);return r.loadDataTransfer(t),r}function Zs(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ys).filter(function(r){var n=Ys[r].matchesTypes;return n.some(function(o){return t.indexOf(o)>-1})})[0]||null}function lT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cT(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 dT(e,t,r){return t&&cT(e.prototype,t),e}function Xs(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){lT(this,e),Xs(this,"ownerDocument",null),Xs(this,"globalContext",void 0),Xs(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return dT(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 Mf(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 $f(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){we(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 fT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hT(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 pT(e,t,r){return t&&hT(e.prototype,t),e}function we(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gT=function(){function e(t,r,n){var o=this;fT(this,e),we(this,"options",void 0),we(this,"actions",void 0),we(this,"monitor",void 0),we(this,"registry",void 0),we(this,"enterLeaveCounter",void 0),we(this,"sourcePreviewNodes",new Map),we(this,"sourcePreviewNodeOptions",new Map),we(this,"sourceNodes",new Map),we(this,"sourceNodeOptions",new Map),we(this,"dragStartSourceIds",null),we(this,"dropTargetIds",[]),we(this,"dragEnterTargetIds",[]),we(this,"currentNativeSource",null),we(this,"currentNativeHandle",null),we(this,"currentDragSourceNode",null),we(this,"altKeyPressed",!1),we(this,"mouseMoveTimeoutTimer",null),we(this,"asyncEndDragFrameId",null),we(this,"dragOverTargetIds",null),we(this,"lastClientOffset",null),we(this,"hoverRafId",null),we(this,"getSourceClientOffset",function(a){var i=o.sourceNodes.get(a);return i&&Df(i)||null}),we(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),we(this,"isNodeInDocument",function(a){return!!(a&&o.document&&o.document.body&&o.document.body.contains(a))}),we(this,"endDragIfSourceWasRemovedFromDOM",function(){var a=o.currentDragSourceNode;a==null||o.isNodeInDocument(a)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),we(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),we(this,"handleTopDragStart",function(a){if(!a.defaultPrevented){var i=o.dragStartSourceIds;o.dragStartSourceIds=null;var s=Wa(a);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:s});var l=a.dataTransfer,d=Zs(l);if(o.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var u=o.monitor.getSourceId(),f=o.sourceNodes.get(u),m=o.sourcePreviewNodes.get(u)||f;if(m){var g=o.getCurrentSourcePreviewNodeOptions(),C=g.anchorX,p=g.anchorY,y=g.offsetX,v=g.offsetY,b={anchorX:C,anchorY:p},w={offsetX:y,offsetY:v},S=rT(f,m,s,b,w);l.setDragImage(m,S.x,S.y)}}try{l==null||l.setData("application/json",{})}catch{}o.setCurrentDragSourceNode(a.target);var T=o.getCurrentSourcePreviewNodeOptions(),I=T.captureDraggingState;I?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(d)o.beginDragNativeItem(d);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}}}),we(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),we(this,"handleTopDragEnterCapture",function(a){o.dragEnterTargetIds=[];var i=o.enterLeaveCounter.enter(a.target);if(!(!i||o.monitor.isDragging())){var s=a.dataTransfer,l=Zs(s);l&&o.beginDragNativeItem(l,s)}}),we(this,"handleTopDragEnter",function(a){var i=o.dragEnterTargetIds;if(o.dragEnterTargetIds=[],!!o.monitor.isDragging()){o.altKeyPressed=a.altKey,i.length>0&&o.actions.hover(i,{clientOffset:Wa(a)});var s=i.some(function(l){return o.monitor.canDropOnTarget(l)});s&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=o.getCurrentDropEffect()))}}),we(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),we(this,"handleTopDragOver",function(a){var i=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}o.altKeyPressed=a.altKey,o.lastClientOffset=Wa(a),o.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(i||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}));var s=(i||[]).some(function(l){return o.monitor.canDropOnTarget(l)});s?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))}),we(this,"handleTopDragLeaveCapture",function(a){o.isDraggingNativeItem()&&a.preventDefault();var i=o.enterLeaveCounter.leave(a.target);i&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),we(this,"handleTopDropCapture",function(a){if(o.dropTargetIds=[],o.isDraggingNativeItem()){var i;a.preventDefault(),(i=o.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else Zs(a.dataTransfer)&&a.preventDefault();o.enterLeaveCounter.reset()}),we(this,"handleTopDrop",function(a){var i=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(i,{clientOffset:Wa(a)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),we(this,"handleSelectStart",function(a){var i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))}),this.options=new uT(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new W0(this.isNodeInDocument)}return pT(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 a=this;return this.sourcePreviewNodeOptions.set(r,o),this.sourcePreviewNodes.set(r,n),function(){a.sourcePreviewNodes.delete(r),a.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,o){var a=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,o);var i=function(d){return a.handleDragStart(d,r)},s=function(d){return a.handleSelectStart(d)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),function(){a.sourceNodes.delete(r),a.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var o=this,a=function(d){return o.handleDragEnter(d,r)},i=function(d){return o.handleDragOver(d,r)},s=function(d){return o.handleDrop(d,r)};return n.addEventListener("dragenter",a),n.addEventListener("dragover",i),n.addEventListener("drop",s),function(){n.removeEventListener("dragenter",a),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}},{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 $f({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 $f({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Pf).some(function(n){return Pf[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=sT(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 a;return(a=n.rootElement)===null||a===void 0?void 0:a.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}(),Ya;function mT(){return Ya||(Ya=new Image,Ya.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ya}var yT=function(t,r,n){return new gT(t,r,n)};function vT(e,t){return typeof e=="function"?e(t):e??"NODE"}function bT(e){return e.isDraggable&&!e.isEditing}function wT(e){const t=Nt(),r=t.selectedIds,[n,o,a]=C0(()=>({canDrag:()=>bT(e),type:vT(t.props.dragType,e),item:()=>{const i=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(kn.dragStart(e.id,i)),{id:e.id,dragIds:i,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(kn.dragEnd())}}),[r,e,t.props.dragType]);return h.useEffect(()=>{a(mT())},[a]),o}function CT(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),o=t.y-Math.round(r.y),a=r.height,i=o<a/2,s=!i,l=a/4,d=o>l&&o<a-l;return{x:n,inTopHalf:i,inBottomHalf:s,inMiddle:d,atTop:!d&&i,atBottom:!d&&s}}function ST(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 Za(e,t){return{parentId:e||null,index:t}}function $n(e,t){return{type:"line",index:e,level:t}}function _T(e){return{type:"highlight",id:e}}function Js(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,a=vu(n)+1;return{parentId:o,index:a}}function Bf(e){var t;const r=CT(e.element,e.offset),n=e.indent,o=Math.round(Math.max(0,r.x-n)/n),{node:a,nextNode:i,prevNode:s}=e,[l,d]=ST(a,s,i,r);if(a&&a.isInternal&&r.inMiddle)return{drop:Za(a.id,null),cursor:_T(a.id)};if(!l)return{drop:Za((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:$n(0,0)};if(pu(l)){const u=La(o,(d==null?void 0:d.level)||0,l.level);return{drop:Js(l,u),cursor:$n(l.rowIndex+1,u)}}if(gu(l)){const u=La(o,(d==null?void 0:d.level)||0,l.level);return{drop:Js(l,u),cursor:$n(l.rowIndex+1,u)}}if(mu(l)){const u=La(o,0,l.level+1);return u>l.level?{drop:Za(l.id,0),cursor:$n(l.rowIndex+1,u)}:{drop:Js(l,u),cursor:$n(l.rowIndex+1,u)}}return{drop:Za(l==null?void 0:l.id,0),cursor:$n(l.rowIndex+1,l.level+1)}}function TT(e,t){const r=Nt(),[n,o]=_f(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(a,i)=>{const s=i.getClientOffset();if(!e.current||!s)return;const{cursor:l,drop:d}=Bf({element:e.current,offset:s,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch(kn.hovering(d.parentId,d.index)),i.canDrop()?l&&r.showCursor(l):r.hideCursor()},drop:(a,i)=>{if(!i.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return o}function ET(e){const t=Nt(),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 jf=h.memo(function({index:t,style:r}){hu(),zw();const n=Nt(),o=ET(t),a=h.useRef(null),i=wT(o),s=TT(a,o),l=h.useCallback(p=>{a.current=p,s(p)},[s]),d=n.indent*o.level,u=h.useMemo(()=>({paddingLeft:d}),[d]),f=h.useMemo(()=>{var p,y;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((y=(p=n.props.padding)!==null&&p!==void 0?p:n.props.paddingTop)!==null&&y!==void 0?y:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),m={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 p;!o.isEditing&&o.isFocused&&((p=a.current)===null||p===void 0||p.focus({preventScroll:!0}))},[o.isEditing,o.isFocused,a.current]);const g=n.renderNode,C=n.renderRow;return c.jsx(C,{node:o,innerRef:l,attrs:m,children:c.jsx(g,{node:o,tree:n,style:u,dragHandle:i})})});let el="",qf=null;function Uf(){hu();const e=Nt();return c.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 a=e.mostRecentNode;for(;a&&a.isSelected;)a=a.nextSibling;a||(a=e.lastNode),e.focus(a,{scroll:!1}),e.delete(Array.from(o))}else{const a=e.focusedNode;if(a){const i=a.nextSibling,s=a.parent;e.focus(i||s,{scroll:!1}),e.delete(a)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),bu(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),wu(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 a=e.focusedNode;a?a.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 a=e.focusedNode;a?a.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(qf),el+=t.key,qf=setTimeout(()=>{el=""},600);const n=e.visibleNodes.find(o=>{const a=o.data.name;return typeof a=="string"?a.toLowerCase().startsWith(el):!1});n&&e.focus(n.id)},children:c.jsx(IT,{})})}function IT(){var e,t;const r=Nt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:o=>{var a;return((a=r.visibleNodes[o])===null||a===void 0?void 0:a.id)||o},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:kC,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:PC,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?c.jsx(OC,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:jf})):c.jsx(AC,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:jf}))}function Vf(e){return e.isFiltered?AT(e.root,e.isMatch.bind(e)):OT(e.root)}function OT(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(zf),t}function AT(e,t){const r={},n=[];function o(i){if(!i.isRoot&&t(i)){r[i.id]=!0;let l=i.parent;for(;l;)r[l.id]=!0,l=l.parent}if(i.children)for(let l of i.children)o(l)}function a(i){var s;i.level>=0&&r[i.id]&&n.push(i),i.isOpen&&((s=i.children)===null||s===void 0||s.forEach(a))}return o(e),a(e),n.forEach(zf),n}function zf(e,t){e.rowIndex=t}const Hf=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var tl=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(u){try{d(n.next(u))}catch(f){i(f)}}function l(u){try{d(n.throw(u))}catch(f){i(f)}}function d(u){u.done?a(u.value):o(u.value).then(s,l)}d((n=n.apply(e,t||[])).next())})};const{safeRun:vt}=Ww;class Do{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=a=>{const i=this.props.rowHeight;if(typeof i=="function"){const s=this.at(a);return s?i(s):this.rowHeight}return i??24},this.rowTopPosition=a=>{if(typeof this.props.rowHeight!="function")return a*this.rowHeight;const i=this.getRowOffsets(),s=Math.max(0,Math.min(a,i.length-1));return i[s]},this.redrawList=(a=0)=>{this.rowOffsets=null;const i=this.list.current;i&&"resetAfterIndex"in i&&i.resetAfterIndex(Math.max(0,a))},this.root=Eu(this),this.visibleNodes=Vf(this),this.idToIndex=Hf(this.visibleNodes)}update(t){this.props=t,this.root=Eu(this),this.visibleNodes=Vf(this),this.idToIndex=Hf(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=To(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=To(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 Io)return t.id;const r=this.props.idAccessor||"id";return To(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,a=this.indexOf(r);if(a===null)return[];const i=Math.min(o,a),s=Math.max(o,a);return this.visibleNodes.slice(i,s+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 tl(this,arguments,void 0,function*(t={}){var r,n;const o=t.parentId===void 0?Tu(this):t.parentId,a=(r=t.index)!==null&&r!==void 0?r:_u(this),i=(n=t.type)!==null&&n!==void 0?n:"leaf",s=yield vt(this.props.onCreate,{type:i,parentId:o,index:a,parentNode:this.get(o)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(t){return tl(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(i=>this.identify(i)),o=n.map(i=>this.get(i)).filter(i=>!!i),a=o.length?Math.min(...o.map(i=>{var s;return(s=i.rowIndex)!==null&&s!==void 0?s:0})):0;yield vt(this.props.onDelete,{nodes:o,ids:n}),this.redrawList(a)})}edit(t){var r,n;const o=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(o),this.dispatch(As(o)),this.redrawList((n=(r=this.get(o))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(a=>{Do.editPromise=a})}submit(t,r){return tl(this,void 0,void 0,function*(){var n,o;if(!t)return;const a=this.identify(t);yield vt(this.props.onRename,{id:a,name:r,node:this.get(a)}),this.dispatch(As(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(As(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&vt(this.props.onActivate,r)}resolveEdit(t){const r=Do.editPromise;r&&r(t),Do.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(Dn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&vt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,a=this.visibleStopIndex-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i>n?i=n:i=Math.max(n-a,0),this.focus(this.at(i))}pageDown(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex,a=o-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i<o?i=o:i=Math.min(i+a,this.visibleNodes.length-1),this.focus(this.at(i))}select(t,r={}){var n;if(!t)return;const o=r.focus!==!1,a=this.identify(t);o&&this.dispatch(Dn(a)),!((n=this.get(a))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[a],anchor:a,mostRecent:a}),this.scrollTo(a,r.align),this.focusedNode&&o&&vt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Nr.remove(r)),vt(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(Dn(n.id)),n.isSelectable&&(this.dispatch(Nr.add(n.id)),this.dispatch(Nr.anchor(n.id)),this.dispatch(Nr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&o&&vt(this.props.onFocus,this.focusedNode),vt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(Dn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:o,mostRecent:a}=this.state.nodes.selection,i=this.filterSelectableNodes(this.nodesBetween(o,this.identifyNull(n)));this.dispatch(Nr.remove(this.nodesBetween(o,a))),this.dispatch(Nr.add(i)),this.dispatch(Nr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&vt(this.props.onFocus,this.focusedNode),vt(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(Dn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&vt(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(i=>this.identify(i))),o=this.identifyNull(t.anchor),a=this.identifyNull(t.mostRecent);this.dispatch(Nr.set({ids:n,anchor:o,mostRecent:a})),vt(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 a of n)if(!a||!r||a.isInternal&&yu(r,a))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;vt(this.props.onMove,{dragIds:n,parentId:t===Eo?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(kn.cursor({type:"none"}))}showCursor(t){this.dispatch(kn.cursor(t))}open(t,r=!0){var n,o;const a=this.identifyNull(t);a&&(this.isOpen(a)||(this.dispatch(Ds.open(a,this.isFiltered)),r&&this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),vt(this.props.onToggle,a)))}close(t,r=!0){var n,o;const a=this.identifyNull(t);a&&this.isOpen(a)&&(this.dispatch(Ds.close(a,this.isFiltered)),r&&this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),vt(this.props.onToggle,a))}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=Os(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(){Pa(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){Pa(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),Su(()=>n in this.idToIndex).then(()=>{var o;const a=this.idToIndex[n];a!==void 0&&((o=this.list.current)===null||o===void 0||o.scrollToItem(a,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===Eo)return!0;const a=(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:a}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!To(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(Dn(t.id))}onBlur(){this.dispatch(oC())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Uf}get renderRow(){return this.props.renderRow||Jw}get renderNode(){return this.props.children||eC}get renderDragPreview(){return this.props.renderDragPreview||Ou}get renderCursor(){return this.props.renderCursor||Xw}}function bt(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 DT=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rf=DT,rl=()=>Math.random().toString(36).substring(7).split("").join("."),NT={INIT:`@@redux/INIT${rl()}`,REPLACE:`@@redux/REPLACE${rl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${rl()}`},Xr=NT;function Qf(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 kT(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(PT(e))return"date";if(LT(e))return"error";const r=xT(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 xT(e){return typeof e.constructor=="function"?e.constructor.name:null}function LT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function PT(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=kT(e)),t}function Gf(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?bt(2):`Expected the root reducer to be a function. Instead, received: '${kr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?bt(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"?bt(1):`Expected the enhancer to be a function. Instead, received: '${kr(r)}'`);return r(Gf)(e,t)}let n=e,o=t,a=new Map,i=a,s=0,l=!1;function d(){i===a&&(i=new Map,a.forEach((y,v)=>{i.set(v,y)}))}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?bt(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(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?bt(4):`Expected the listener to be a function. Instead, received: '${kr(y)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?bt(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 v=!0;d();const b=s++;return i.set(b,y),function(){if(v){if(l)throw new Error(process.env.NODE_ENV==="production"?bt(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(),i.delete(b),a=null}}}function m(y){if(!Qf(y))throw new Error(process.env.NODE_ENV==="production"?bt(7):`Actions must be plain objects. Instead, the actual type was: '${kr(y)}'. 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 y.type>"u")throw new Error(process.env.NODE_ENV==="production"?bt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof y.type!="string")throw new Error(process.env.NODE_ENV==="production"?bt(17):`Action "type" property must be a string. Instead, the actual type was: '${kr(y.type)}'. Value was: '${y.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?bt(9):"Reducers may not dispatch actions.");try{l=!0,o=n(o,y)}finally{l=!1}return(a=i).forEach(b=>{b()}),y}function g(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?bt(10):`Expected the nextReducer to be a function. Instead, received: '${kr(y)}`);n=y,m({type:Xr.REPLACE})}function C(){const y=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?bt(11):`Expected the observer to be an object. Instead, received: '${kr(v)}'`);function b(){const S=v;S.next&&S.next(u())}return b(),{unsubscribe:y(b)}},[Rf](){return this}}}return m({type:Xr.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:g,[Rf]:C}}function Wf(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function FT(e,t,r,n){const o=Object.keys(t),a=r&&r.type===Xr.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(!Qf(e))return`The ${a} has unexpected type of "${kr(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const i=Object.keys(e).filter(s=>!t.hasOwnProperty(s)&&!n[s]);if(i.forEach(s=>{n[s]=!0}),!(r&&r.type===Xr.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${a}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function MT(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Xr.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?bt(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:Xr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?bt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Xr.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 Kf(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const s=t[i];process.env.NODE_ENV!=="production"&&typeof e[s]>"u"&&Wf(`No reducer provided for key "${s}"`),typeof e[s]=="function"&&(r[s]=e[s])}const n=Object.keys(r);let o;process.env.NODE_ENV!=="production"&&(o={});let a;try{MT(r)}catch(i){a=i}return function(s={},l){if(a)throw a;if(process.env.NODE_ENV!=="production"){const f=FT(s,r,l,o);f&&Wf(f)}let d=!1;const u={};for(let f=0;f<n.length;f++){const m=n[f],g=r[m],C=s[m],p=g(C,l);if(typeof p>"u"){const y=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?bt(14):`When called with an action of type ${y?`"${String(y)}"`:"(unknown type)"}, the slice reducer for key "${m}" 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[m]=p,d=d||p!==C}return d=d||n.length!==Object.keys(s).length,d?u:s}}function $T(e=Nn().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 BT=Kf({nodes:Kf({focus:aC,edit:nC,open:iC,selection:sC,drag:$T}),dnd:lC}),jT=Nn();function qT({treeProps:e,imperativeHandle:t,children:r}){const n=h.useRef(null),o=h.useRef(null),a=h.useRef(Gf(BT,Nn(e))),i=Vw.useSyncExternalStore(a.current.subscribe,a.current.getState,()=>jT),s=h.useMemo(()=>new Do(a.current,e,n,o),[]),l=h.useRef(0);return h.useMemo(()=>{l.current+=1,s.update(e)},Object.values(e)),h.useMemo(()=>{l.current+=1,s.update(s.props)},[i.nodes.open]),h.useImperativeHandle(t,()=>s),h.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),h.useEffect(()=>{s.props.searchTerm||a.current.dispatch(Ds.clear(!0))},[s.props.searchTerm]),c.jsx(cu.Provider,{value:s,children:c.jsx(fu.Provider,{value:l.current,children:c.jsx(du.Provider,{value:i.nodes,children:c.jsx(uu.Provider,{value:i.dnd,children:c.jsx(y_,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||yT,options:{rootElement:s.props.dndRootElement||void 0}},{children:r}))})})})})}function UT(){const e=Nt(),[,t]=_f(()=>({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:a,drop:i}=Bf({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});i&&e.dispatch(kn.hovering(i.parentId,i.index)),n.canDrop()?a&&e.showCursor(a):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function VT(e){return UT(),e.children}function zT(){const t=Nt().props.renderContainer||Uf;return c.jsx(c.Fragment,{children:c.jsx(t,{})})}function HT(){const e=Nt(),{offset:t,mouse:r,item:n,isDragging:o}=V0(i=>({offset:i.getSourceClientOffset(),mouse:i.getClientOffset(),item:i.getItem(),isDragging:i.isDragging()})),a=e.props.renderDragPreview||Ou;return c.jsx(a,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:o})}function RT(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:a=>a[n],getChildren:typeof o=="function"?o:a=>a[o],childrenKey:typeof o=="string"?o:"children"}}class QT{constructor(t,r={}){this.accessors=RT(r),this.root=GT(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 GT(e,t){const r=new Yf({},null,t,"ROOT");return r.children=e.map(n=>nl(n,r,t)),r}function nl(e,t,r){const n=new Yf(e,t,r),o=r.getChildren(e);return o&&(n.children=o.map(a=>nl(a,n,r))),n}class Yf{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 a=nl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,a);const i=this.accessors.childrenKey,s=this.data;s[i]=(o=s[i])!==null&&o!==void 0?o:[],s[i].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 WT=0;function KT(e,t={}){const[r,n]=h.useState(e),o=t.idAccessor,a=t.childrenAccessor,i=h.useMemo(()=>new QT(r,{idAccessor:o,childrenAccessor:a}),[r,o,a]),s=C=>{for(const p of C.dragIds)i.move({id:p,parentId:C.parentId,index:C.index});n(i.data)},l=({name:C,id:p})=>{i.update({id:p,changes:{name:C}}),n(i.data)},d=typeof o=="string"?o:"id",u=typeof a=="string"?a:"children";return[r,{onMove:s,onRename:l,onCreate:({parentId:C,index:p,type:y})=>{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(y==="internal"&&typeof a=="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 v={[d]:`simple-tree-id-${WT++}`,name:""};return y==="internal"&&(v[u]=[]),i.create({parentId:C,index:p,data:v}),n(i.data),v},onDelete:C=>{C.ids.forEach(p=>i.drop({id:p})),n(i.data)}}]}function YT(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.
506
- Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=KT(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function ZT(e,t){const r=YT(e);return c.jsxs(qT,{treeProps:r,imperativeHandle:t,children:[c.jsx(VT,{children:c.jsx(zT,{})}),c.jsx(HT,{})]})}const XT=h.forwardRef(ZT);function ol(){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 JT(){return Ae(e=>{var o;if(!e.selectedNodeId)return!1;const t=(o=e.treeData[0])==null?void 0:o.id,r=a=>{var i;for(const s of a){if(s.id===e.selectedNodeId)return s;if((i=s.children)!=null&&i.length){const l=r(s.children);if(l)return l}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Zf={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",default:"#6B7280"},Xf={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",default:"File"},Jf=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],e1=[{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 t1(e){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":"default"}function Xa(e){const t=t1(e);return{key:t,color:Zf[t]??Zf.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:Xf[t]??Xf.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const kt={row:"_row_i3qt2_1",grip:"_grip_i3qt2_16",menuBtn:"_menuBtn_i3qt2_19",selected:"_selected_i3qt2_23",title:"_title_i3qt2_28",dropTarget:"_dropTarget_i3qt2_33",toggle:"_toggle_i3qt2_50",ctIcon:"_ctIcon_i3qt2_65",folderIcon:"_folderIcon_i3qt2_77",renameInput:"_renameInput_i3qt2_92",dropHere:"_dropHere_i3qt2_101",menuWrap:"_menuWrap_i3qt2_111",menu:"_menu_i3qt2_19",dangerItem:"_dangerItem_i3qt2_163"},r1={video:Ji,pdf:ba,h5p:Gi,scorm:Ki,audio:Wi,quiz:Ri,default:Sn},n1=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[o,a]=h.useState(!1),[i,s]=h.useState(!1),[l,d]=h.useState(e.data.name),u=h.useRef(null),f=ce(),m=n==="edit",g=ol(),C=Xa(e.data),p=r1[C.key]??Sn,y=e.isSelected,v=e.level===0,b=e.data.isFolder??(e.children&&e.children.length>0),w=v?ky:b?$y:p;h.useEffect(()=>{if(!o)return;const I=N=>{var x;(x=u.current)!=null&&x.contains(N.target)||a(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[o]);const S=h.useCallback(()=>{l.trim()&&e.submit(l.trim()),s(!1)},[l,e]),T=h.useCallback(I=>{I.key==="Enter"&&S(),I.key==="Escape"&&(d(e.data.name),s(!1))},[S,e.data.name]);return c.jsxs("div",{className:[kt.row,y?kt.selected:"",e.state.isOver&&b?kt.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":b?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":b?!e.isClosed:void 0,children:[m&&c.jsx("span",{ref:r,className:kt.grip,"aria-hidden":"true",children:c.jsx(Zc,{size:14})}),c.jsx("button",{className:kt.toggle,onClick:I=>{I.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:b?"visible":"hidden"},children:e.isClosed?c.jsx(Gc,{size:14}):c.jsx(Cn,{size:14})}),c.jsx("span",{className:`${kt.ctIcon} ${v||b?kt.folderIcon:C.bgClass}`,"aria-hidden":"true",children:c.jsx(w,{size:12})}),i?c.jsx("input",{className:kt.renameInput,value:l,autoFocus:!0,onChange:I=>d(I.target.value),onBlur:S,onKeyDown:T,onClick:I=>I.stopPropagation()}):c.jsx("span",{className:kt.title,title:e.data.name,onDoubleClick:()=>m&&s(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&b&&c.jsx("span",{className:kt.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),m&&c.jsxs("div",{className:kt.menuWrap,ref:u,children:[c.jsx("button",{className:kt.menuBtn,onClick:I=>{I.stopPropagation(),a(N=>!N)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:c.jsx(Kc,{size:14})}),o&&c.jsxs("div",{className:kt.menu,role:"menu",children:[c.jsxs("button",{role:"menuitem",onClick:()=>{s(!0),a(!1)},children:[c.jsx(Hy,{size:13})," ",f.treeNode.renameMenuItem]}),b&&g&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),a(!1)},children:[c.jsx(Yc,{size:13})," ",f.treeNode.addSubunitMenuItem]}),e.data.parent&&g&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),a(!1)},children:[c.jsx(mo,{size:13})," ",f.treeNode.addSiblingMenuItem]}),c.jsxs("button",{role:"menuitem",className:kt.dangerItem,onClick:()=>{e.tree.delete(e.id),a(!1)},children:[c.jsx(Zi,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function o1(e,t){var a,i;const n=((a=(await ke.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:a.result)??{},o=((i=n.content)==null?void 0:i.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!o)throw new Error("Could not obtain an upload URL");return o}async function a1(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 i1(e,t){var s;const r=await o1(e,t.name),n=await a1(r,t),o=new FormData;return o.append("fileUrl",n),o.append("mimeType",t.type||"text/csv"),{processId:(((s=(await ke.post(`/action/collection/v1/import/${e}`,o)).data)==null?void 0:s.result)??{}).processId??""}}async function s1(e){var r;return((r=(await ke.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function eh(e){var n,o,a;const r=(a=(o=(n=(await ke.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:o.collection)==null?void 0:a.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function l1(e){return eh(e)}const Le={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"},c1=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const o=ce(),[a,i]=h.useState(null),[s,l]=h.useState(!1),[d,u]=h.useState("idle"),[f,m]=h.useState(""),[g,C]=h.useState([]),[p,y]=h.useState(null),v=h.useRef(null),b=h.useRef(null),w=h.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[]);h.useEffect(()=>()=>w(),[w]);const S=k=>k.name.toLowerCase().endsWith(".csv")?k.size>50*1024*1024?(m(o.csvUpload.fileTooLarge),!1):!0:(m(o.csvUpload.invalidFileType),!1),T=h.useCallback(k=>{m(""),C([]),y(null),u("idle"),S(k)&&i(k)},[]),I=h.useCallback(k=>{k.preventDefault(),l(!1);const P=k.dataTransfer.files[0];P&&T(P)},[T]),N=h.useCallback(k=>{var M;const P=(M=k.target.files)==null?void 0:M[0];P&&T(P),k.target.value=""},[T]),x=h.useCallback(async()=>{try{const k=await l1(e),P=document.createElement("a");P.href=k,P.download="sample_hierarchy.csv",P.target="_blank",P.click()}catch{m(o.csvUpload.downloadSampleFailed)}},[e,o.csvUpload.downloadSampleFailed]),B=h.useCallback(async()=>{if(a){u("uploading"),m(""),C([]);try{const{processId:k}=await i1(e,a);if(!k){u("done"),y(null),setTimeout(t,1500);return}u("processing"),b.current=setInterval(async()=>{try{const P=await s1(k);P.status==="COMPLETED"?(w(),u("done"),y(P.successCount??null),P.failedRecords&&P.failedRecords.length>0?C(P.failedRecords):setTimeout(t,1500)):P.status==="FAILED"&&(w(),u("error"),m(o.csvUpload.processingFailed),P.failedRecords&&C(P.failedRecords))}catch{w(),u("error"),m(o.csvUpload.connectionLost)}},2e3)}catch{u("error"),m(o.csvUpload.uploadFailed)}}},[e,a,t,w,o.csvUpload.processingFailed,o.csvUpload.connectionLost,o.csvUpload.uploadFailed]),q={idle:"",uploading:o.csvUpload.statusUploading,processing:o.csvUpload.statusProcessing,done:o.csvUpload.statusDone,error:o.csvUpload.statusError};return c.jsxs("div",{className:Le.container,children:[c.jsxs("div",{className:Le.header,children:[c.jsx("h2",{className:Le.title,children:n==="update"?o.csvUpload.titleUpdate:o.csvUpload.titleCreate}),c.jsx("button",{className:Le.closeBtn,onClick:r,"aria-label":o.csvUpload.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:Le.body,children:[c.jsxs("div",{className:`${Le.dropZone} ${s?Le.dragOver:""} ${a?Le.hasFile:""}`,onDragEnter:k=>{k.preventDefault(),l(!0)},onDragOver:k=>{k.preventDefault(),l(!0)},onDragLeave:k=>{k.preventDefault(),l(!1)},onDrop:I,onClick:()=>{var k;return(k=v.current)==null?void 0:k.click()},role:"button",tabIndex:0,"aria-label":o.csvUpload.dropZoneAriaLabel,onKeyDown:k=>{var P;return k.key==="Enter"&&((P=v.current)==null?void 0:P.click())},children:[c.jsx("input",{ref:v,type:"file",accept:".csv",className:Le.hiddenInput,onChange:N,"aria-hidden":"true"}),a?c.jsxs("div",{className:Le.fileInfo,children:[c.jsx(ba,{size:24,className:Le.fileIcon}),c.jsx("span",{className:Le.fileName,children:a.name}),c.jsxs("span",{className:Le.fileSize,children:["(",(a.size/1024).toFixed(1)," KB)"]})]}):c.jsxs("div",{className:Le.dropHint,children:[c.jsx(Xi,{size:32,className:Le.dropIcon}),c.jsx("p",{className:Le.dropText,children:o.csvUpload.dropText}),c.jsx("p",{className:Le.dropSubtext,children:o.csvUpload.dropSubtext})]})]}),c.jsx("button",{className:Le.sampleLink,onClick:x,type:"button",children:o.csvUpload.downloadSample}),d!=="idle"&&c.jsxs("div",{className:`${Le.statusBar} ${Le[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&c.jsx("span",{className:Le.spinner,"aria-hidden":"true"}),q[d],d==="done"&&p!==null&&c.jsx("span",{className:Le.successDetail,children:o.csvUpload.itemsImportedSuffix.replace("{count}",String(p))})]}),f&&c.jsx("p",{className:Le.errorMsg,role:"alert",children:f}),g.length>0&&c.jsxs("div",{className:Le.failedSection,children:[c.jsx("h4",{className:Le.failedTitle,children:o.csvUpload.failedRowsTitle.replace("{count}",String(g.length))}),c.jsx("div",{className:Le.tableWrap,children:c.jsxs("table",{className:Le.failedTable,children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:o.csvUpload.rowHeader}),c.jsx("th",{children:o.csvUpload.nameHeader}),c.jsx("th",{children:o.csvUpload.reasonHeader})]})}),c.jsx("tbody",{children:g.map((k,P)=>c.jsxs("tr",{children:[c.jsx("td",{children:k.rowNumber??P+1}),c.jsx("td",{children:k.name??"—"}),c.jsx("td",{className:Le.reasonCell,children:k.reason??o.csvUpload.unknownError})]},P))})]})})]})]}),c.jsxs("div",{className:Le.footer,children:[c.jsx($e,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:o.csvUpload.cancel}),c.jsx($e,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!a||d==="done",onClick:B,children:d==="done"?o.csvUpload.uploaded:o.csvUpload.upload})]})]})},sr={container:"_container_1y30m_1",header:"_header_1y30m_8",headerActions:"_headerActions_1y30m_19",iconBtn:"_iconBtn_1y30m_25",menuWrap:"_menuWrap_1y30m_43",dropdownMenu:"_dropdownMenu_1y30m_47",treeWrapper:"_treeWrapper_1y30m_79",csvModal:"_csvModal_1y30m_95",footer:"_footer_1y30m_105"},d1=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var ue;const n=ce(),o=h.useRef(null),a=h.useRef(null),i=h.useRef(null),[s,l]=h.useState(400),[d,u]=h.useState(!1),[f,m]=h.useState(!1),[g,C]=h.useState("create"),{treeData:p,selectedNodeId:y,selectNode:v,addNode:b,deleteNode:w,reorderChildren:S,moveNode:T,setTreeData:I}=Ae(),N=e==="edit",x=ol(),B=N&&x,q=(((ue=p[0])==null?void 0:ue.children)??[]).some(Q=>Q.isFolder),k=ae(Q=>{var ne,te,V,R;return((te=(ne=Q.editorConfig)==null?void 0:ne.context)==null?void 0:te.contentId)??((R=(V=Q.editorConfig)==null?void 0:V.context)==null?void 0:R.identifier)??""}),P=ae(Q=>{var te,V;const ne=(V=(te=Q.categoryMeta)==null?void 0:te.sourcingSettings)==null?void 0:V.collection;return(ne==null?void 0:ne.enableBulkUpload)!==!1});h.useEffect(()=>{const Q=a.current;if(!Q)return;const ne=new ResizeObserver(()=>{l(Q.clientHeight||400)});return ne.observe(Q),l(Q.clientHeight||400),()=>ne.disconnect()},[]),h.useEffect(()=>{if(!d)return;const Q=ne=>{var te;(te=i.current)!=null&&te.contains(ne.target)||u(!1)};return document.addEventListener("mousedown",Q),()=>document.removeEventListener("mousedown",Q)},[d]);const M=h.useCallback(Q=>{Q.length>0&&v(Q[0].data.id)},[v]),L=h.useCallback(({parentId:Q,index:ne,dragIds:te})=>{if(!Q)return;const V=te[0],R=al(p,V);if(!R)return;const ie=R.parent;if(ie===Q){const fe=al(p,Q);if(!(fe!=null&&fe.children))return;const J=fe.children.findIndex(oe=>oe.id===V);if(J<0)return;S(Q,J,ne>J?ne-1:ne)}else T(V,ie??"",Q)},[p,S,T]),F=h.useCallback(({ids:Q})=>{Q.forEach(ne=>w(ne))},[w]),H=h.useCallback(({parentId:Q})=>{var V;const ne=Q??((V=p[0])==null?void 0:V.id)??"";if(!ne)return{id:crypto.randomUUID()};const te=b(ne,"unit");return te?{id:te}:(Ie.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[b,p,n]),X=h.useCallback(()=>{var ne;const Q=(ne=p[0])==null?void 0:ne.id;Q&&(b(Q,"unit")||Ie.error(n.outlineTree.maxDepthReachedToast))},[p,b,n]),ve=h.useCallback(()=>{y&&(b(y,"subunit")||Ie.error(n.outlineTree.maxDepthReachedToast))},[y,b,n]),Ee=h.useCallback(async()=>{if(u(!1),!!k)try{const Q=await eh(k),ne=await fetch(Q).then(R=>R.blob()),te=URL.createObjectURL(ne),V=document.createElement("a");V.href=te,V.download=`${k}-folders.csv`,V.style.display="none",document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(te)}catch{Ie.error(n.outlineTree.downloadCsvFailedToast)}},[k,n]),Ce=h.useCallback(async()=>{if(m(!1),!!k)try{const{rootNode:Q}=await lu(k);I([Q]),Ie.success(n.outlineTree.outlineRefreshedToast)}catch{Ie.error(n.outlineTree.outlineRefreshFailedToast)}},[k,I,n]);return c.jsxs("div",{className:sr.container,children:[c.jsx("div",{className:sr.header,children:c.jsxs("div",{className:sr.headerActions,children:[N&&c.jsxs("div",{className:sr.menuWrap,ref:i,children:[c.jsx("button",{type:"button",className:sr.iconBtn,onClick:()=>u(Q=>!Q),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:c.jsx(Kc,{size:15})}),d&&c.jsx("div",{className:sr.dropdownMenu,role:"menu",children:P&&c.jsxs(c.Fragment,{children:[c.jsx("button",{role:"menuitem",type:"button",disabled:q,title:q?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{u(!1),C("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!q,title:q?void 0:n.outlineTree.noFoldersYetTitle,onClick:Ee,children:n.outlineTree.downloadFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!q,title:q?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{u(!1),C("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})})]}),r&&c.jsx("button",{type:"button",className:sr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?c.jsx(Vy,{size:15}):c.jsx(Uy,{size:15})})]})}),c.jsx("div",{className:sr.treeWrapper,ref:a,children:c.jsx(XT,{ref:o,data:p,idAccessor:"id",childrenAccessor:"children",onSelect:M,onMove:N?L:void 0,onDelete:N?F:void 0,onCreate:N?H:void 0,disableEdit:!N,disableDrop:!N,selection:y??void 0,rowHeight:40,indent:20,paddingBottom:16,height:s,width:"100%",children:Q=>c.jsx(n1,{...Q,editorMode:e})})}),N&&c.jsxs("div",{className:sr.footer,children:[c.jsxs($e,{variant:"ghost",size:"sm",onClick:X,disabled:!B,children:[c.jsx(mo,{size:14})," ",n.outlineTree.addUnitButton]}),c.jsxs($e,{variant:"ghost",size:"sm",onClick:ve,disabled:!B||!y,children:[c.jsx(Yc,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&c.jsx("div",{className:sr.csvModal,children:c.jsx(c1,{contentId:k,mode:g,onComplete:Ce,onClose:()=>m(!1)})})]})};function al(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=al(r.children,t);if(n)return n}}}const No={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},u1=({crumbs:e})=>{const t=Ae(n=>n.selectNode),r=ce();return e.length?c.jsxs("nav",{className:No.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[c.jsx("button",{className:No.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:c.jsx(jy,{size:13})}),e.map((n,o)=>c.jsxs(h.Fragment,{children:[c.jsx(Gc,{size:13,className:No.sep}),o<e.length-1?c.jsx("button",{className:No.crumb,onClick:()=>t(n.id),children:n.name}):c.jsx("span",{className:No.current,children:n.name})]},n.id))]}):null},ko={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},f1=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const o=ce(),a=[{id:"details",label:o.tabBar.detailsTab},{id:"audience",label:o.tabBar.audienceCurriculumTab},{id:"licensing",label:o.tabBar.licensingTab}],i=n?a.filter(s=>n.includes(s.id)):a;return c.jsx("div",{className:ko.tabBar,role:"tablist","aria-label":o.tabBar.metadataSectionsAriaLabel,children:i.map(s=>c.jsxs("button",{role:"tab","aria-selected":e===s.id,"aria-controls":`panel-${s.id}`,className:[ko.tab,e===s.id?ko.active:"",r.includes(s.id)?ko.error:""].join(" "),onClick:()=>t(s.id),children:[s.label,r.includes(s.id)&&c.jsx("span",{className:ko.errorDot,"aria-label":o.tabBar.hasErrorsAriaLabel})]},s.id))})};var xo=e=>e.type==="checkbox",Jr=e=>e instanceof Date,ht=e=>e==null;const th=e=>typeof e=="object";var Qe=e=>!ht(e)&&!Array.isArray(e)&&th(e)&&!Jr(e),il=e=>Qe(e)&&e.target?xo(e.target)?e.target.checked:e.target.value:e,rh=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),nh=e=>{const t=e.constructor&&e.constructor.prototype;return Qe(t)&&t.hasOwnProperty("isPrototypeOf")},Ja=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ze(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ja&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Qe(e)&&nh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=Ze(e[o]));return n}const xr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Jt={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"},sl="form",oh="root",ah=["__proto__","constructor","prototype"];var Lo=e=>/^\w*$/.test(e),qe=e=>e===void 0,ei=e=>e.split(/[.[\]'"]/g).filter(Boolean),W=(e,t,r)=>{if(!t||!Qe(e))return r;const n=Lo(t)?[t]:ei(t);if(n.some(a=>ah.includes(a)))return r;const o=n.reduce((a,i)=>ht(a)?void 0:a[i],e);return qe(o)||o===e?qe(e[t])?r:e[t]:o},Mt=e=>typeof e=="boolean",wt=e=>typeof e=="function",Be=(e,t,r)=>{let n=-1;const o=Lo(t)?[t]:ei(t),a=o.length,i=a-1;for(;++n<a;){const s=o[n];let l=r;if(n!==i){const d=e[s];l=Qe(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(ah.includes(s))return;e[s]=l,e=e[s]}};const ll=h.createContext(null);ll.displayName="HookFormControlContext";const cl=()=>h.useContext(ll);var ih=(e,t,r,n=!0)=>{const o={};for(const a in e)Object.defineProperty(o,a,{get:()=>{const i=a;return t._proxyFormState[i]!==Jt.all&&(t._proxyFormState[i]=!n||Jt.all),r&&(r[i]=!0),e[i]}});return o};const dl=Ja?h.useLayoutEffect:h.useEffect;function h1(e){const t=cl(),{control:r=t,disabled:n,name:o,exact:a}=e||{},[i,s]=h.useState(()=>({...r._formState,defaultValues:r._defaultValues})),l=h.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return dl(()=>r._subscribe({name:o,formState:l.current,exact:a,callback:d=>{!n&&s({...r._formState,...d,defaultValues:r._defaultValues})}}),[o,n,a]),h.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),h.useMemo(()=>ih(i,r,l.current,!1),[i,r])}var Ct=e=>typeof e=="string",ul=(e,t,r,n,o)=>Ct(e)?(n&&t.watch.add(e),W(r,e,o)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),W(r,a))):(n&&(t.watchAll=!0),r),fl=e=>ht(e)||!th(e);const sh=(e,t)=>t.length===0&&!Array.isArray(e)&&!nh(e);function $t(e,t,r=new WeakMap){if(e===t)return!0;if(fl(e)||fl(t))return Object.is(e,t);if(Jr(e)&&Jr(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(sh(e,n)||sh(t,o))return Object.is(e,t);const a=r.get(e);if(a&&a.has(t))return!0;a?a.add(t):r.set(e,new WeakSet([t]));for(const i of n){const s=e[i];if(!(i in t))return!1;if(i!=="ref"){const l=t[i];if(Jr(s)&&Jr(l)||(Qe(s)||Array.isArray(s))&&(Qe(l)||Array.isArray(l))?!$t(s,l,r):!Object.is(s,l))return!1}}return!0}function p1(e){const t=cl(),{control:r=t,name:n,defaultValue:o,disabled:a,exact:i,compute:s}=e||{},l=h.useRef(o),d=h.useRef(s),u=h.useRef(void 0),f=h.useRef(r),m=h.useRef(n);d.current=s;const[g,C]=h.useState(()=>{const S=r._getWatch(n,l.current);return d.current?d.current(S):S}),p=h.useCallback(S=>{const T=ul(n,r._names,S||r._formValues,!1,l.current);return d.current?d.current(T):T},[r._formValues,r._names,n]),y=h.useCallback(S=>{if(!a){const T=ul(n,r._names,S||r._formValues,!1,l.current);if(d.current){const I=d.current(T);$t(I,u.current)||(C(I),u.current=I)}else C(T)}},[r._formValues,r._names,a,n]);dl(()=>((f.current!==r||!$t(m.current,n))&&(f.current=r,m.current=n,y()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:S=>{y(S.values)}})),[r,i,n,y]),h.useEffect(()=>r._removeUnmounted());const v=f.current!==r,b=m.current,w=h.useMemo(()=>{if(a)return null;const S=!v&&!$t(b,n);return v||S?p():null},[a,v,n,b,p]);return w!==null?w:g}function ti(e){const t=cl(),{name:r,disabled:n,control:o=t,shouldUnregister:a,defaultValue:i,exact:s=!0}=e,l=rh(o._names.array,r),d=h.useMemo(()=>W(o._formValues,r,W(o._defaultValues,r,i)),[o,r,i]),u=p1({control:o,name:r,defaultValue:d,exact:s}),f=h1({control:o,name:r,exact:s}),m=h.useRef(e),g=h.useRef(null),C=h.useRef(o.register(r,{...e.rules,value:u,...Mt(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const p=h.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!W(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!W(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!W(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!W(f.validatingFields,r)},error:{enumerable:!0,get:()=>W(f.errors,r)}}),[f,r]),y=h.useCallback(S=>{const T=il(S);return W(o._fields,r)||(C.current=o.register(r,{...m.current.rules,value:T})),C.current.onChange({target:{value:il(S),name:r},type:xr.CHANGE})},[r,o]),v=h.useCallback(()=>C.current.onBlur({target:{value:W(o._formValues,r),name:r},type:xr.BLUR}),[r,o._formValues]),b=h.useCallback(S=>{S&&(g.current={focus:()=>wt(S.focus)&&S.focus(),select:()=>wt(S.select)&&S.select(),setCustomValidity:I=>wt(S.setCustomValidity)&&S.setCustomValidity(I),reportValidity:()=>wt(S.reportValidity)&&S.reportValidity()});const T=W(o._fields,r);T&&T._f&&S&&(T._f.ref=g.current)},[o._fields,r]),w=h.useMemo(()=>({name:r,value:u,...Mt(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:y,onBlur:v,ref:b}),[r,n,f.disabled,y,v,b,u]);return h.useEffect(()=>{const S=o._options.shouldUnregister||a;o.register(r,{...m.current.rules,...Mt(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(I,N)=>{const x=W(o._fields,I);x&&x._f&&(x._f.mount=N)};if(T(r,!0),S){const I=Ze(W(a?o._defaultValues:o._options.values||o._defaultValues,r,W(o._options.defaultValues,r,m.current.defaultValue)));Be(o._defaultValues,r,I),qe(W(o._formValues,r))&&Be(o._formValues,r,I)}if(!l&&o.register(r),g.current){const I=W(o._fields,r);I&&I._f&&(I._f.ref=g.current)}return()=>{(l?S&&!o._state.action:S)?o.unregister(r):T(r,!1)}},[r,o,l,a]),h.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),h.useMemo(()=>({field:w,formState:f,fieldState:p}),[w,f,p])}const hl=h.createContext(null);hl.displayName="HookFormContext";const tr=()=>h.useContext(hl),g1=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:a,setValue:i,setValues:s,trigger:l,formState:d,resetField:u,reset:f,handleSubmit:m,unregister:g,control:C,register:p,setFocus:y,subscribe:v})=>{const b=h.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:a,setValue:i,setValues:s,trigger:l,formState:d,resetField:u,reset:f,handleSubmit:m,unregister:g,control:C,register:p,setFocus:y,subscribe:v}),[a,C,d,n,r,m,p,f,u,o,y,i,s,v,l,g,t]);return h.createElement(hl.Provider,{value:b},h.createElement(ll.Provider,{value:b.control},e))};var m1=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},lh=e=>Array.isArray(e)?e.filter(Boolean):[],ri=e=>Array.isArray(e)?e:[e],ch=()=>{let e=[];return{get observers(){return e},next:o=>{for(const a of e)a.next&&a.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(a=>a!==o)}}),unsubscribe:()=>{e=[]}}};function dh(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],a=t[n];if(o&&Qe(o)&&a){const i=dh(o,a);Qe(i)&&(r[n]=i)}else e[n]&&(r[n]=a)}return r}var at=e=>Qe(e)&&!Object.keys(e).length,pl=e=>e.type==="file",ni=e=>{if(!Ja)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},uh=e=>e.type==="select-multiple",gl=e=>e.type==="radio",y1=e=>gl(e)||xo(e),ml=e=>ni(e)&&e.isConnected;function v1(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(ht(e)){e=void 0;break}e=e[t[n]],n++}return e}function b1(e){for(const t in e)if(e.hasOwnProperty(t)&&!qe(e[t]))return!1;return!0}function tt(e,t){if(Ct(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Lo(t)?[t]:ei(t),n=r.length===1?e:v1(e,r),o=r.length-1,a=r[o];return n&&delete n[a],o!==0&&(Qe(n)&&at(n)||Array.isArray(n)&&b1(n))&&tt(e,r.slice(0,-1)),e}var w1=e=>{for(const t in e)if(wt(e[t]))return!0;return!1};function fh(e){return Array.isArray(e)||Qe(e)&&!w1(e)}function yl(e,t={}){for(const r in e){const n=e[r];fh(n)?(t[r]=Array.isArray(n)?[]:{},yl(n,t[r])):qe(n)||(t[r]=!0)}return t}function vl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>vl(r));return t.some(r=>r!==void 0)?t:void 0}if(Qe(e)){const t={};for(const r in e){const n=vl(e[r]);qe(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function en(e,t,r){r||(r=yl(t));for(const n in e){const o=e[n];if(fh(o))qe(t)||fl(r[n])?r[n]=yl(o,Array.isArray(o)?[]:{}):en(o,ht(t)?{}:t[n],r[n]);else{const a=t[n];r[n]=!$t(o,a)}}return vl(r)||{}}const hh={value:!1,isValid:!1},ph={value:!0,isValid:!0};var gh=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&&!qe(e[0].attributes.value)?qe(e[0].value)||e[0].value===""?ph:{value:e[0].value,isValid:!0}:ph:hh}return hh},mh=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>qe(e)?e:t?e===""?NaN:e&&+e:r&&Ct(e)?new Date(e):n?n(e):e;const yh={isValid:!1,value:null};var vh=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,yh):yh;function bh(e){const t=e.ref;return pl(t)?t.files:gl(t)?vh(e.refs).value:uh(t)?[...t.selectedOptions].map(({value:r})=>r):xo(t)?gh(e.refs).value:mh(qe(t.value)?e.ref.value:t.value,e)}var C1=(e,t,r,n)=>{const o={};for(const a of e){const i=W(t,a);i&&Be(o,a,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},oi=e=>e instanceof RegExp,Po=e=>qe(e)?e:oi(e)?e.source:Qe(e)?oi(e.value)?e.value.source:e.value:e,wh=e=>({isOnSubmit:!e||e===Jt.onSubmit,isOnBlur:e===Jt.onBlur,isOnChange:e===Jt.onChange,isOnAll:e===Jt.all,isOnTouch:e===Jt.onTouched});const Ch="AsyncFunction";var S1=e=>!!e&&!!e.validate&&!!(wt(e.validate)&&e.validate.constructor.name===Ch||Qe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Ch)),_1=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),bl=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Fo=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const a=W(e,o);if(a){const{_f:i,...s}=a;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Fo(s,t))break}else if(Qe(s)&&Fo(s,t))break}}};function Sh(e,t,r){const n=W(e,r);if(n||Lo(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),i=W(t,a),s=W(e,a);if(i&&!Array.isArray(i)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};o.pop()}return{name:r}}var T1=(e,t,r,n)=>{r(e);const{name:o,...a}=e;return at(a)||n&&Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(i=>t[i]===(!n||Jt.all))},E1=(e,t,r)=>!e||!t||e===t||ri(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),I1=(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,O1=(e,t)=>!lh(W(e,t)).length&&tt(e,t),_h=(e,t,r)=>{const n=W(e,r),o=Array.isArray(n)?n:[];return Be(o,oh,t[r]),Be(e,r,o),e};function Th(e,t,r="validate"){if(Ct(e)||Array.isArray(e)&&e.every(Ct)||Mt(e)&&!e)return{type:r,message:Ct(e)?e:"",ref:t}}var Bn=e=>Qe(e)&&!oi(e)?e:{value:e,message:""},Eh=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:d,minLength:u,min:f,max:m,pattern:g,validate:C,name:p,valueAsNumber:y,mount:v}=e._f,b=W(r,p);if(!v||t.has(p))return{};const w=s?s[0]:i,S=P=>{if(o&&w.reportValidity){const M=Mt(P)?"":P||"";s?s.forEach(L=>L.setCustomValidity(M)):w.setCustomValidity(M),w.reportValidity()}},T={},I=gl(i),N=xo(i),x=I||N,B=(y||pl(i))&&qe(i.value)&&qe(b)||ni(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,q=m1.bind(null,p,n,T),k=(P,M,L,F=er.maxLength,H=er.minLength)=>{const X=P?M:L;T[p]={type:P?F:H,message:X,ref:i,...q(P?F:H,X)}};if(a?!Array.isArray(b)||!b.length:l&&(!x&&(B||ht(b))||Mt(b)&&!b||N&&!gh(s).isValid||I&&!vh(s).isValid)){const{value:P,message:M}=Ct(l)?{value:!!l,message:l}:Bn(l);if(P&&(T[p]={type:er.required,message:M,ref:w,...q(er.required,M)},!n))return S(M),T}if(!B&&(!ht(f)||!ht(m))){let P,M;const L=Bn(m),F=Bn(f);if(!ht(b)&&!isNaN(b)){const H=i.valueAsNumber||b&&+b;ht(L.value)||(P=H>L.value),ht(F.value)||(M=H<F.value)}else{const H=i.valueAsDate||new Date(b),X=Ce=>new Date(new Date().toDateString()+" "+Ce),ve=i.type=="time",Ee=i.type=="week";Ct(L.value)&&b&&(P=ve?X(b)>X(L.value):Ee?b>L.value:H>new Date(L.value)),Ct(F.value)&&b&&(M=ve?X(b)<X(F.value):Ee?b<F.value:H<new Date(F.value))}if((P||M)&&(k(!!P,L.message,F.message,er.max,er.min),!n))return S(T[p].message),T}if((d||u)&&!B&&(Ct(b)||a&&Array.isArray(b))){const P=Bn(d),M=Bn(u),L=!ht(P.value)&&b.length>+P.value,F=!ht(M.value)&&b.length<+M.value;if((L||F)&&(k(L,P.message,M.message),!n))return S(T[p].message),T}if(g&&!B&&Ct(b)){const{value:P,message:M}=Bn(g);if(oi(P)&&!b.match(P)&&(T[p]={type:er.pattern,message:M,ref:i,...q(er.pattern,M)},!n))return S(M),T}if(C){if(wt(C)){const P=await C(b,r),M=Th(P,w);if(M&&(T[p]={...M,...q(er.validate,M.message)},!n))return S(M.message),T}else if(Qe(C)){let P={};for(const M in C){if(!at(P)&&!n)break;const L=Th(await C[M](b,r),w,M);L&&(P={...L,...q(M,L.message)},S(L.message),n&&(T[p]=P))}if(!at(P)&&(T[p]={ref:w,...P},!n))return T}}return S(!0),T};const A1={mode:Jt.onSubmit,reValidateMode:Jt.onChange,shouldFocusError:!0},Ih={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function D1(e={}){let t={...A1,...e},r={...Ze(Ih),isLoading:wt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=Qe(t.defaultValues)||Qe(t.values)?Ze(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ze(o),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...u};let m={...f};const g={array:ch(),state:ch()},C=t.criteriaMode===Jt.all,p=_=>A=>{clearTimeout(d),d=setTimeout(_,A)},y=async _=>{if(!i.keepIsValid&&!t.disabled&&(f.isValid||m.isValid||_)){let A;t.resolver?(A=at((await q()).errors),v()):A=await M({fields:n,onlyCheckValid:!0,eventType:xr.VALID}),A!==r.isValid&&g.state.next({isValid:A})}},v=(_,A)=>{!t.disabled&&(f.isValidating||f.validatingFields||m.isValidating||m.validatingFields)&&((_||Array.from(s.mount)).forEach(D=>{D&&(A?Be(r.validatingFields,D,A):tt(r.validatingFields,D))}),g.state.next({validatingFields:r.validatingFields,isValidating:!at(r.validatingFields)}))},b=()=>{r.dirtyFields=en(o,a)},w=(_,A=[],D,z,j=!0,G=!0)=>{if(z&&D&&!t.disabled){if(i.action=!0,G&&Array.isArray(W(n,_))){const U=D(W(n,_),z.argA,z.argB);j&&Be(n,_,U)}if(G&&Array.isArray(W(r.errors,_))){const U=D(W(r.errors,_),z.argA,z.argB);j&&Be(r.errors,_,U),O1(r.errors,_)}if((f.touchedFields||m.touchedFields)&&G&&Array.isArray(W(r.touchedFields,_))){const U=D(W(r.touchedFields,_),z.argA,z.argB);j&&Be(r.touchedFields,_,U)}(f.dirtyFields||m.dirtyFields)&&b(),g.state.next({name:_,isDirty:F(_,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Be(a,_,A)},S=(_,A)=>{Be(r.errors,_,A),r.errors={...r.errors},g.state.next({errors:r.errors})},T=_=>{r.errors=_,g.state.next({errors:r.errors,isValid:!1})},I=_=>{const A=Lo(_)?[_]:ei(_);let D=a,z=o;for(let j=0;j<A.length-1;j++){const G=A[j];if(D=ht(D)?D:D[G],z=ht(z)?z:z[G],D===null&&z!==null)return!0}return!1},N=(_,A,D,z)=>{const j=W(n,_);if(j){if(I(_))return;const G=qe(W(a,_)),U=W(a,_,qe(D)?W(o,_):D);qe(U)||z&&z.defaultChecked||A?Be(a,_,A?U:bh(j._f)):ve(_,U),i.mount&&!i.action&&(y(),G&&r.isDirty&&(f.isDirty||m.isDirty)&&(F()||(r.isDirty=!1,g.state.next({...r}))),e.shouldUnregister&&G&&!qe(W(a,_))&&bl(_,s)&&(i.watch=!0))}},x=(_,A,D,z,j)=>{let G=!1,U=!1;const ee={name:_};if(!t.disabled){if(!D||z){(f.isDirty||m.isDirty)&&(U=r.isDirty,r.isDirty=ee.isDirty=F(),G=U!==ee.isDirty);const ye=$t(W(o,_),A);U=!!W(r.dirtyFields,_),ye!==r.isDirty?r.dirtyFields=en(o,a):ye?tt(r.dirtyFields,_):Be(r.dirtyFields,_,!0),ee.dirtyFields=r.dirtyFields,G=G||(f.dirtyFields||m.dirtyFields)&&U!==!ye}if(D){const ye=W(r.touchedFields,_);ye||(Be(r.touchedFields,_,D),ee.touchedFields=r.touchedFields,G=G||(f.touchedFields||m.touchedFields)&&ye!==D)}G&&j&&g.state.next(ee)}return G?ee:{}},B=(_,A,D,z)=>{const j=W(r.errors,_),G=(f.isValid||m.isValid)&&Mt(A)&&r.isValid!==A;if(t.delayError&&D?(l=p(()=>S(_,D)),l(t.delayError)):(clearTimeout(d),l=null,D?Be(r.errors,_,D):tt(r.errors,_),r.errors={...r.errors}),(D?!$t(j,D):j)||!at(z)||G){const U={...z,...G&&Mt(A)?{isValid:A}:{},errors:r.errors,name:_};r={...r,...U},g.state.next(U)}},q=async _=>(v(_,!0),await t.resolver(a,t.context,C1(_||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),k=async _=>{const{errors:A}=await q(_);if(v(_),_){for(const D of _){const z=W(A,D);z?s.array.has(D)&&Qe(z)&&!Object.keys(z).some(j=>!Number.isNaN(Number(j)))?_h(r.errors,{[D]:z},D):Be(r.errors,D,z):tt(r.errors,D)}r.errors={...r.errors}}else r.errors=A;return A},P=async({name:_,eventType:A})=>{if(e.validate){const D=await e.validate({formValues:a,formState:r,name:_,eventType:A});if(Qe(D))for(const z in D){const j=D[z];j&&J(`${sl}.${z}`,{message:Ct(j.message)?j.message:"",type:j.type||er.validate})}else Ct(D)||!D?J(sl,{message:D||"",type:er.validate}):fe(sl);return D}return!0},M=async({fields:_,onlyCheckValid:A,name:D,eventType:z,context:j={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(j.runRootValidation=!0,!await P({name:D,eventType:z})&&(j.valid=!1,A)))return j.valid;for(const G in _){const U=_[G];if(U){const{_f:ee,...ye}=U;if(ee){const Ye=s.array.has(ee.name),Lt=U._f&&S1(U._f),Pt=f.validatingFields||f.isValidating||m.validatingFields||m.isValidating;Lt&&Pt&&v([ee.name],!0);const Cr=await Eh(U,s.disabled,a,C,t.shouldUseNativeValidation&&!A,Ye);if(Lt&&Pt&&v([ee.name]),Cr[ee.name]&&(j.valid=!1,A)||(!A&&(W(Cr,ee.name)?Ye?_h(r.errors,Cr,ee.name):Be(r.errors,ee.name,Cr[ee.name]):tt(r.errors,ee.name)),e.shouldUseNativeValidation&&Cr[ee.name]))break}!at(ye)&&await M({context:j,onlyCheckValid:A,fields:ye,name:G,eventType:z})}}return j.valid},L=()=>{for(const _ of s.unMount){const A=W(n,_);A&&(A._f.refs?A._f.refs.every(D=>!ml(D)):!ml(A._f.ref))&&Ve(_)}s.unMount=new Set},F=(_,A)=>!t.disabled&&(_&&A&&Be(a,_,A),!$t(R(),o)),H=(_,A,D)=>ul(_,s,{...i.mount?a:qe(A)?o:Ct(_)?{[_]:A}:A},D,A),X=_=>lh(W(i.mount?a:o,_,t.shouldUnregister?W(o,_,[]):[])),ve=(_,A,D={},z=!1)=>{const j=W(n,_);let G=A;if(j){const U=j._f;U&&(!U.disabled&&Be(a,_,mh(A,U)),G=ni(U.ref)&&ht(A)?"":A,uh(U.ref)?[...U.ref.options].forEach(ee=>ee.selected=G.includes(ee.value)):U.refs?xo(U.ref)?U.refs.forEach(ee=>{(!ee.defaultChecked||!ee.disabled)&&(Array.isArray(G)?ee.checked=!!G.find(ye=>ye===ee.value):ee.checked=G===ee.value||!!G)}):U.refs.forEach(ee=>ee.checked=ee.value===G):pl(U.ref)?U.ref.value="":(U.ref.value=G,U.ref.type||g.state.next({name:_,values:z?a:Ze(a)})))}(D.shouldDirty||D.shouldTouch)&&x(_,G,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&V(_)},Ee=(_,A,D,z=!1)=>{for(const j in A){if(!A.hasOwnProperty(j))return;const G=A[j],U=_+"."+j,ee=W(n,U);(s.array.has(_)||Qe(G)||ee&&!ee._f)&&!Jr(G)?Ee(U,G,D,z):ve(U,G,D,z)}},Ce=(_,A,D,z)=>{const j=W(n,_),G=s.array.has(_),U=z?A:Ze(A),ee=W(a,_),ye=$t(ee,U);if(ye||Be(a,_,U),G)g.array.next({name:_,values:z?a:Ze(a)}),(f.isDirty||f.dirtyFields||m.isDirty||m.dirtyFields)&&D.shouldDirty&&(b(),g.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:F(_,U)}));else{const Ye=Array.isArray(U)&&!U.length||at(U);!j||j._f||ht(U)||Ye?ve(_,U,D,z):Ee(_,U,D,z)}if(!ye){const Ye=bl(_,s),Lt=z?a:Ze(a);g.state.next({...Ye&&r,name:i.mount||Ye?_:void 0,values:Lt})}},ue=(_,A,D={})=>Ce(_,A,D,!1),Q=(_,A={})=>{const D=wt(_)?_(a):_;if(!$t(a,D)){a={...a,...D};for(const z of s.mount)Ce(z,W(D,z),A,!0);g.state.next({...r,name:void 0,type:void 0,values:a}),A.shouldValidate&&y()}},ne=async _=>{i.mount=!0;const A=_.target;let D=A.name,z=!0;const j=W(n,D),G=ye=>{z=Number.isNaN(ye)||Jr(ye)&&isNaN(ye.getTime())||$t(ye,W(a,D,ye))},U=wh(t.mode),ee=wh(t.reValidateMode);if(j){let ye,Ye;const Lt=A.type?bh(j._f):il(_),Pt=_.type===xr.BLUR||_.type===xr.FOCUS_OUT,Cr=!_1(j._f)&&!e.validate&&!t.resolver&&!W(r.errors,D)&&!j._f.deps||I1(Pt,W(r.touchedFields,D),r.isSubmitted,ee,U),Qo=bl(D,s,Pt);Be(a,D,Lt),Pt?(!A||!A.readOnly)&&(j._f.onBlur&&j._f.onBlur(_),l&&l(0)):j._f.onChange&&j._f.onChange(_);const pn=x(D,Lt,Pt),dt=!at(pn)||Qo;if(!Pt&&g.state.next({name:D,type:_.type,values:Ze(a)}),Cr)return(f.isValid||m.isValid)&&(t.mode==="onBlur"?Pt&&y():Pt||y()),dt&&g.state.next({name:D,...Qo?{}:pn});if(!t.resolver&&e.validate&&await P({name:D,eventType:_.type}),!Pt&&Qo&&g.state.next({...r}),t.resolver){const{errors:_t}=await q([D]);if(v([D]),G(Lt),!z){!at(pn)&&g.state.next(pn);return}const Ot=Sh(r.errors,n,D),or=Sh(_t,n,Ot.name||D);ye=or.error,D=or.name,Ye=at(_t)}else v([D],!0),ye=(await Eh(j,s.disabled,a,C,t.shouldUseNativeValidation))[D],v([D]),G(Lt),z&&(ye?Ye=!1:(f.isValid||m.isValid)&&(Ye=await M({fields:n,onlyCheckValid:!0,name:D,eventType:_.type})));z&&(j._f.deps&&(!Array.isArray(j._f.deps)||j._f.deps.length>0)&&V(j._f.deps),B(D,Ye,ye,pn))}},te=(_,A)=>{if(W(r.errors,A)&&_.focus)return _.focus(),1},V=async(_,A={})=>{let D,z;const j=ri(_);if(t.resolver){const G=await k(qe(_)?_:j);D=at(G),z=_?!j.some(U=>W(G,U)):D}else _?(z=(await Promise.all(j.map(async G=>{const U=W(n,G);return await M({fields:U&&U._f?{[G]:U}:U,eventType:xr.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&y()):z=D=await M({fields:n,name:_,eventType:xr.TRIGGER});return g.state.next({...!Ct(_)||(f.isValid||m.isValid)&&D!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:D}:{},errors:r.errors}),A.shouldFocus&&!z&&Fo(n,te,_?j:s.mount),z},R=(_,A)=>{let D={...i.mount?a:o};return A&&(D=dh(A.dirtyFields?r.dirtyFields:r.touchedFields,D)),qe(_)?D:Ct(_)?W(D,_):_.map(z=>W(D,z))},ie=(_,A)=>({invalid:!!W((A||r).errors,_),isDirty:!!W((A||r).dirtyFields,_),error:W((A||r).errors,_),isValidating:!!W(r.validatingFields,_),isTouched:!!W((A||r).touchedFields,_)}),fe=_=>{const A=_?ri(_):void 0;A==null||A.forEach(D=>tt(r.errors,D)),A?A.forEach(D=>{g.state.next({name:D,errors:r.errors})}):g.state.next({errors:{}})},J=(_,A,D)=>{const z=(W(n,_,{_f:{}})._f||{}).ref,j=W(r.errors,_)||{},{ref:G,message:U,type:ee,...ye}=j;Be(r.errors,_,{...ye,...A,ref:z}),g.state.next({name:_,errors:r.errors,isValid:!1}),D&&D.shouldFocus&&z&&z.focus&&z.focus()},oe=(_,A)=>wt(_)?g.state.subscribe({next:D=>"values"in D&&_(D.values||H(void 0,A),D)}):H(_,A,!0),Me=_=>g.state.subscribe({next:A=>{if(E1(_.name,A.name,_.exact)&&T1(A,_.formState||f,K,_.reRenderRoot)){const D={...a};_.callback({values:D,...r,...A,defaultValues:o})}}}).unsubscribe,Oe=_=>(i.mount=!0,m={...m,..._.formState},Me({..._,formState:{...u,..._.formState}})),Ve=(_,A={})=>{for(const D of _?ri(_):s.mount)s.mount.delete(D),s.array.delete(D),A.keepValue||(tt(n,D),tt(a,D)),!A.keepError&&tt(r.errors,D),!A.keepDirty&&tt(r.dirtyFields,D),!A.keepTouched&&tt(r.touchedFields,D),!A.keepIsValidating&&tt(r.validatingFields,D),!t.shouldUnregister&&!A.keepDefaultValue&&tt(o,D);g.state.next({values:Ze(a)}),g.state.next({...r,...A.keepDirty?{isDirty:F()}:{}}),!A.keepIsValid&&y()},We=({disabled:_,name:A})=>{if(Mt(_)&&i.mount||_||s.disabled.has(A)){const j=s.disabled.has(A)!==!!_;_?s.disabled.add(A):s.disabled.delete(A),j&&i.mount&&!i.action&&y()}},ze=(_,A={})=>{let D=W(n,_);const z=Mt(A.disabled)||Mt(t.disabled),j=!s.registerName.has(_)&&D&&D._f&&!D._f.mount;return Be(n,_,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:_}},name:_,mount:!0,...A}}),s.mount.add(_),D&&!j?We({disabled:Mt(A.disabled)?A.disabled:t.disabled,name:_}):N(_,!0,A.value),{...z?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:Po(A.min),max:Po(A.max),minLength:Po(A.minLength),maxLength:Po(A.maxLength),pattern:Po(A.pattern)}:{},name:_,onChange:ne,onBlur:ne,ref:G=>{if(G){s.registerName.add(_),ze(_,A),s.registerName.delete(_),D=W(n,_);const U=qe(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,ee=y1(U),ye=D._f.refs||[];if(ee?ye.find(Ye=>Ye===U):U===D._f.ref)return;Be(n,_,{_f:{...D._f,...ee?{refs:[...ye.filter(ml),U,...Array.isArray(W(o,_))?[{}]:[]],ref:{type:U.type,name:_}}:{ref:U}}}),N(_,!1,void 0,U)}else D=W(n,_,{}),D._f&&(D._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(rh(s.array,_)&&i.action)&&s.unMount.add(_)}}},re=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Fo(n,te,s.mount),Ke=_=>{Mt(_)&&(g.state.next({disabled:_}),Fo(n,(A,D)=>{const z=W(n,D);z&&(A.disabled=z._f.disabled||_,Array.isArray(z._f.refs)&&z._f.refs.forEach(j=>{j.disabled=z._f.disabled||_}))},0,!1))},Re=(_,A)=>async D=>{let z;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let j=Ze(a);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:U}=await q();v(),r.errors=G,j=Ze(U)}else await M({fields:n,eventType:xr.SUBMIT});if(s.disabled.size)for(const G of s.disabled)tt(j,G);if(tt(r.errors,oh),at(r.errors)){g.state.next({errors:{}});try{await _(j,D)}catch(G){z=G}}else A&&await A({...r.errors},D),re(),setTimeout(re);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:at(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},He=(_,A={})=>{W(n,_)&&(qe(A.defaultValue)?ue(_,Ze(W(o,_))):(ue(_,A.defaultValue),Be(o,_,Ze(A.defaultValue))),A.keepTouched||tt(r.touchedFields,_),A.keepDirty||(tt(r.dirtyFields,_),r.isDirty=A.defaultValue?F(_,Ze(W(o,_))):F()),A.keepError||(tt(r.errors,_),f.isValid&&y()),g.state.next({...r}))},et=(_,A={})=>{const D=_?Ze(_):o,z=Ze(D),j=at(_),G=z;if(A.keepDefaultValues||(o=D),!A.keepValues){if(A.keepDirtyValues){const U=new Set([...s.mount,...Object.keys(en(o,a))]);for(const ee of Array.from(U)){const ye=W(r.dirtyFields,ee),Ye=W(a,ee),Lt=W(G,ee);ye&&!qe(Ye)?Be(G,ee,Ye):!ye&&!qe(Lt)&&ue(ee,Lt)}}else{if(Ja&&qe(_))for(const U of s.mount){const ee=W(n,U);if(ee&&ee._f){const ye=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(ni(ye)){const Ye=ye.closest("form");if(Ye){Ye.reset();break}}}}if(A.keepFieldsRef)for(const U of s.mount)ue(U,W(G,U));else n={}}if(t.shouldUnregister){if(a=A.keepDefaultValues?Ze(o):{},A.keepFieldsRef)for(const U of s.mount)Be(a,U,W(G,U))}else a=Ze(G);g.array.next({values:{...G}}),g.state.next({values:{...G}})}s={mount:A.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!at(G),i.watch=!!t.shouldUnregister,i.keepIsValid=!!A.keepIsValid,i.action=!1,A.keepErrors||(r.errors={}),g.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:j?!1:A.keepDirty?r.isDirty:A.keepValues?F():!!(A.keepDefaultValues&&!$t(_,o)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:j?{}:A.keepDirtyValues?A.keepDefaultValues&&a?en(o,a):r.dirtyFields:A.keepDefaultValues&&_?en(o,_):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Gt=(_,A)=>et(wt(_)?_(a):_,{...t.resetOptions,...A}),It=(_,A={})=>{const D=W(n,_),z=D&&D._f;if(z){const j=z.refs?z.refs[0]:z.ref;j.focus&&setTimeout(()=>{j.focus(),A.shouldSelect&&wt(j.select)&&j.select()})}},K=_=>{r={...r,..._}},Wt={control:{register:ze,unregister:Ve,getFieldState:ie,handleSubmit:Re,setError:J,_subscribe:Me,_runSchema:q,_updateIsValidating:v,_focusError:re,_getWatch:H,_getDirty:F,_setValid:y,_setFieldArray:w,_setDisabledField:We,_setErrors:T,_getFieldArray:X,_reset:et,_resetDefaultValues:()=>wt(t.defaultValues)&&t.defaultValues().then(_=>{Gt(_,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:Ke,_subjects:g,_proxyFormState:f,get _fields(){return n},get _formValues(){return a},get _state(){return i},set _state(_){i=_},get _defaultValues(){return o},get _names(){return s},set _names(_){s=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:Oe,trigger:V,register:ze,handleSubmit:Re,watch:oe,setValue:ue,setValues:Q,getValues:R,reset:Gt,resetField:He,resetDefaultValues:(_,A={})=>{if(o=Ze(_),!A.keepDirty){const D=en(o,a);r.dirtyFields=D,r.isDirty=!at(D)}A.keepIsValid||y(),g.state.next({...r,defaultValues:o})},clearErrors:fe,unregister:Ve,setError:J,setFocus:It,getFieldState:ie};return{...Wt,formControl:Wt}}function N1(e={}){const t=h.useRef(void 0),r=h.useRef(void 0),n=h.useRef(e.formControl),[o,a]=h.useState(()=>({...Ze(Ih),isLoading:wt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:wt(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&&!wt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=D1(e);t.current={...l,formState:o}}const i=t.current.control;return i._options=e,dl(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return a(l=>({...l,isReady:!0})),i._formState.isReady=!0,s},[i]),h.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),h.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),h.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),h.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),h.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==o.isDirty&&i._subjects.state.next({isDirty:s})}},[i,o.isDirty]),h.useEffect(()=>{var s;e.values&&!$t(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),r.current=e.values,a(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),h.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=h.useMemo(()=>ih(o,i),[i,o]),t.current}async function Oh(e){var r,n;return(n=(r=(await ke.get(`/api/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function k1(e){var r,n;return((n=(r=(await ke.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 wl(e,t){const r=gn({queryKey:["framework",e],queryFn:()=>Oh(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],o=gn({queryKey:["framework",n],queryFn:()=>Oh(n),enabled:!!n,staleTime:5*60*1e3}),a=o.data?[o.data]:[];return{organisationFramework:r.data,targetFrameworks:a,isLoading:r.isLoading||o.isLoading}}function x1(e,t,r){const n=e??[],o=new Set(n.map(u=>u.type).filter(Boolean)),a=(t??[]).filter(u=>!o.has(u)),{data:i}=gn({queryKey:["framework-search",a.sort().join(","),r],queryFn:()=>k1({type:a,systemDefault:"Yes"}),enabled:a.length>0,staleTime:10*60*1e3}),s=t&&t.length?n.filter(u=>u.type&&t.includes(u.type)):n,l=[...(i??[]).map(u=>({label:u.name,value:u.identifier})),...s.map(u=>({label:u.name,value:u.identifier}))],d=new Set;return l.filter(u=>d.has(u.value)?!1:(d.add(u.value),!0))}async function Ah(e){var r,n;return(n=(r=(await ke.get(`/api/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function L1(e){var r,n,o,a,i,s,l;const t=gn({queryKey:["channel",e],queryFn:()=>Ah(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:(a=t.data)==null?void 0:a.collectionAdditionalCategories,contentAdditionalCategories:(i=t.data)==null?void 0:i.contentAdditionalCategories,defaultLicense:(s=t.data)==null?void 0:s.defaultLicense,defaultFramework:(l=t.data)==null?void 0:l.defaultFramework,isLoading:t.isLoading}}function P1(e){const{data:t}=gn({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>Sw(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const F1={"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."}},M1=new Set(["review","read","sourcingreview","orgreview"]),ai={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},$1={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},B1={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"},ii={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},Dh=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function Nh(e,t,r,n,o={}){if(!(e!=null&&e.length))return Lh(tE(t,n,r),r,t,n);const a=new Map;for(const l of e){const d=l.code;d&&!a.has(d)&&a.set(d,l)}const i=new Set,s=e.filter(l=>{if(n&&(l.code==="dialCode"||l.code==="dialcode")||l.visible===!1)return!1;const d=l.code;return i.has(d)?!1:(i.add(d),!0)}).map(l=>{const d=l.code??"",u=R1(l),f=Q1(l,r,t,a,o),m=t[d],g=q1(d,kh(m,u),u,t,o),C={code:d,label:l.label??d,inputType:u,required:!!(l.required===!0||Array.isArray(l.validations)&&l.validations.some(p=>p.type==="required")),editable:j1(d,l.editable!==!1,o),placeholder:l.placeholder,maxLength:l.maxLength,options:z1(f,g,u,r),depends:l.depends,tab:H1(l),section:l.section,sourceCategory:l.sourceCategory,defaultValue:l.defaultValue??l.default,currentValue:g};if(d==="dialcodes"){const p=t.dialcodeRequired==="Yes";return{...C,required:p,visible:p}}return C});return Lh(s,r,t,n)}function j1(e,t,r){var a;const n=r.editorMode??"edit";if(!M1.has(n))return t!==!1;const o=(a=r.editableFields)==null?void 0:a[n];return!!(o&&o.includes(e))}function q1(e,t,r,n,o){const a=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return a?o.defaultLicense??"":t;case"copyright":return a&&o.channelName?o.channelName:t;case"copyrightYear":return a?String(new Date().getFullYear()):t;case"author":case"creator":return a&&o.userFullName?o.userFullName:t;case"instructions":{const i=n.instructions;return i&&typeof i=="object"&&!Array.isArray(i)?i.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!a)return t;const i=n.timeLimits,s=i==null?void 0:i[e];return s!=null&&s!==""?U1(Number(s)):t}default:return t}}function U1(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=a=>String(a).padStart(2,"0");return n>0?`${o(n)}:${o(r)}:${o(t)}`:`${o(r)}:${o(t)}`}function V1(e){var n,o,a;const t=new Map,r=i=>i==null?void 0:i.forEach(s=>{s.identifier&&t.set(s.identifier,s.name),s.name&&t.set(s.name,s.name)});return(o=(n=e.organisationFramework)==null?void 0:n.categories)==null||o.forEach(i=>r(i.terms)),(a=e.targetFrameworks)==null||a.forEach(i=>{var s;return(s=i.categories)==null?void 0:s.forEach(l=>r(l.terms))}),t}function z1(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 a=e?[...e]:[],i=new Set(a.map(l=>l.value)),s=V1(n);for(const l of o){const d=String(l);i.has(d)||(a.push({label:s.get(d)??d,value:d}),i.add(d))}return a}function H1(e){const t=e.section;if(t){if(ai[t])return ai[t];const n=$1[t];if(n&&ai[n])return ai[n]}const r=e.code??"";return B1[r]??"details"}function kh(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 R1(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 Q1(e,t,r,n,o){const a=e.code??"";if(a==="maxQuestions"){const d=o.childCount??0;if(d>0)return Array.from({length:d},(u,f)=>({label:String(f+1),value:String(f+1)}))}const i=e.range;if(Array.isArray(i)&&i.length)return typeof i[0]=="string"?i.map(d=>({label:d,value:d})):i.map(d=>({label:d.name,value:d.identifier}));const s=e.enum;if(s!=null&&s.length)return s.map(d=>({label:d,value:d}));if(a==="framework")return t.orgFrameworks;if(a==="additionalCategories"){const u=(o.objectType??"")==="QuestionSet"?o.contentAdditionalCategories??o.collectionAdditionalCategories:o.collectionAdditionalCategories??o.contentAdditionalCategories,f=(u&&u.length?u:o.contextAdditionalCategories)??t.channelAdditionalCategories;return f!=null&&f.length?Y1(f).map(m=>({label:m,value:m})):void 0}const l=e.sourceCategory??ii[a];if(l)return xh(a,l,e,t,r,n)}function G1(e,t){return Dh.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function W1(e,t){return Dh.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function Cl(e,t,r){var a,i,s,l,d;const n=(i=(a=e.organisationFramework)==null?void 0:a.categories)==null?void 0:i.find(u=>u.code===t),o=(d=(l=(s=e.targetFrameworks)==null?void 0:s[0])==null?void 0:l.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 K1(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 Y1(e){return Array.from(new Set(e))}function Z1(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function xh(e,t,r,n,o,a){const i=G1(e,r),s=W1(e,r),l=p=>({label:p.name,value:i?p.identifier:p.name}),d=r.depends;if(!(d!=null&&d.length))return Cl(n,t,s).map(l);const u=d.flatMap(p=>Z1(o[p])).map(String);if(!u.length)return[];const f=[];for(const p of d){const y=a.get(p),v=(y==null?void 0:y.sourceCategory)??ii[p]??p;f.push(...Cl(n,v,s))}const g=f.filter(p=>u.includes(String(p.name))||u.includes(String(p.identifier))||u.includes(String(p.code))).flatMap(p=>p.associations??[]).filter(p=>String(p.category??"").toLowerCase()===t.toLowerCase()),C=K1(g);return C.length?C.map(l):Cl(n,t,s).map(l)}function Mo(e,t){const r=ii[e];if(r)return xh(e,r,{},t,{},new Map)}function it(e,t,r){return kh(e[t],r)}const X1=["board","medium","gradeLevel","subject"];function J1(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>X1.includes(n.code)):!0}function eE(e,t){var r,n,o;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(a=>a.code===t)||(o=e.targetFrameworks)!=null&&o.some(a=>{var i;return(i=a.categories)==null?void 0:i.some(s=>s.code===t)}))}function Lh(e,t,r,n){var l;if(!n||J1(t))return e;const o=e.filter(d=>{const u=d.sourceCategory??ii[d.code];return!u||eE(t,u)}),a=new Set(o.map(d=>d.code)),i=[];for(const d of((l=t.organisationFramework)==null?void 0:l.categories)??[])a.has(d.code)||i.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:it(r,d.code,"multiselect")});if(!i.length)return o;const s=o.findIndex(d=>d.code==="framework");return s>=0?[...o.slice(0,s+1),...i,...o.slice(s+1)]:[...o,...i]}function tE(e,t,r){var o;const n=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:it(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:it(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:it(e,"keywords","chips")}];return t&&(n.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:it(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:it(e,"additionalCategories","multiselect"),options:(o=r.channelAdditionalCategories)==null?void 0:o.map(a=>({label:a,value:a}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:it(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Mo("subjectIds",r),currentValue:it(e,"subjectIds","multiselect")}),n.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:it(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Mo("targetBoardIds",r),currentValue:it(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:Mo("targetMediumIds",r),currentValue:it(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:Mo("targetGradeLevelIds",r),currentValue:it(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:Mo("targetSubjectIds",r),currentValue:it(e,"targetSubjectIds","multiselect")}),n.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"license","select")})),n}const rE=["allowECM","levels","setPeriod","instances"];function Ph(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function nE(e,t={}){const r={...e};for(const a of rE)delete r[a];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Ph(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 oE(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?Ph(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function aE(e,t){const{watch:r,setValue:n}=e,o=h.useRef(!1);h.useEffect(()=>{const a=r((i,{name:s})=>{var l;if(!(!s||o.current)){o.current=!0;try{const d=new Set([s]);let u=!0;for(;u;){u=!1;for(const f of t)d.has(f.code)||(l=f.depends)!=null&&l.some(m=>d.has(m))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),d.add(f.code),u=!0)}}finally{o.current=!1}}});return()=>a.unsubscribe()},[r,n,t])}const jn={section:"_section_ylgu8_1",header:"_header_ylgu8_11",title:"_title_ylgu8_17",description:"_description_ylgu8_24",divider:"_divider_ylgu8_30",fields:"_fields_ylgu8_36"},iE=({title:e,description:t,children:r})=>c.jsxs("div",{className:jn.section,children:[c.jsxs("div",{className:jn.header,children:[c.jsx("h3",{className:jn.title,children:e}),t&&c.jsx("p",{className:jn.description,children:t})]}),c.jsx("hr",{className:jn.divider}),c.jsx("div",{className:jn.fields,children:r})]}),$={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"},Fh=({name:e,label:t,required:r,disabled:n,multiline:o,maxLength:a,placeholder:i})=>{const s=ce(),{register:l,formState:{errors:d}}=tr(),u=d[e],f={required:r?s.textField.requiredError.replace("{field}",t):!1,maxLength:a?{value:a,message:s.textField.maxLengthError.replace("{max}",String(a))}:void 0};return c.jsxs("div",{className:[$.field,o?$.fullWidth:""].join(" "),children:[c.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),o?c.jsx("textarea",{id:e,className:[$.input,$.textarea,u?$.inputError:""].join(" "),disabled:n,placeholder:i,rows:3,...l(e,f)}):c.jsx("input",{id:e,type:"text",className:[$.input,u?$.inputError:""].join(" "),disabled:n,placeholder:i,...l(e,f)}),u&&c.jsx("span",{className:$.error,children:String(u.message)})]})},sE=({name:e,label:t,options:r,required:n,disabled:o})=>{var y;const a=ce(),[i,s]=h.useState(!1),l=h.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:m}}=tr(),g=u(e),C=((y=r.find(v=>v.value===g))==null?void 0:y.label)??a.selectField.selectPlaceholder,p=m[e];return h.useEffect(()=>{if(!i)return;const v=b=>{var w;(w=l.current)!=null&&w.contains(b.target)||s(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]),c.jsxs("div",{className:$.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...d(e,{required:n?a.selectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:o,className:[$.selectBtn,p?$.inputError:"",i?$.selectOpen:""].join(" "),onClick:()=>s(v=>!v),children:[c.jsx("span",{className:g?$.selectedVal:$.placeholder,children:C}),c.jsx(Cn,{size:14,className:i?$.chevronUp:""})]}),i&&c.jsxs("div",{className:$.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[$.option,g===v.value?$.optionSelected:""].join(" "),onClick:()=>{f(e,v.value,{shouldDirty:!0,shouldValidate:!0}),s(!1)},children:[c.jsx("span",{children:v.label}),g===v.value&&c.jsx(wn,{size:13})]},v.value)),!r.length&&c.jsx("span",{className:$.noOpts,children:a.selectField.noOptionsMessage})]}),p&&c.jsx("span",{className:$.error,children:String(p.message)})]})},lE=({name:e,label:t,options:r,required:n,disabled:o})=>{const a=ce(),[i,s]=h.useState(!1),l=h.useRef(null),{register:d,watch:u,setValue:f,formState:{errors:m}}=tr(),g=u(e)??[],C=m[e],p=g.length?`${g.length} ${a.multiSelectField.selectedCountSuffix}`:a.multiSelectField.selectPlaceholder;h.useEffect(()=>{if(!i)return;const v=b=>{var w;(w=l.current)!=null&&w.contains(b.target)||s(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]);const y=v=>{const b=g.includes(v)?g.filter(w=>w!==v):[...g,v];f(e,b,{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:$.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...d(e,{required:n?a.multiSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:o,className:[$.selectBtn,C?$.inputError:"",i?$.selectOpen:""].join(" "),onClick:()=>s(v=>!v),children:[c.jsx("span",{className:g.length?$.selectedVal:$.placeholder,children:p}),c.jsx(Cn,{size:14,className:i?$.chevronUp:""})]}),i&&c.jsxs("div",{className:$.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[$.option,g.includes(v.value)?$.optionSelected:""].join(" "),onClick:()=>y(v.value),children:[c.jsx(wn,{size:13,style:{opacity:g.includes(v.value)?1:0}}),c.jsx("span",{children:v.label})]},v.value)),!r.length&&c.jsx("span",{className:$.noOpts,children:a.multiSelectField.noOptionsMessage})]}),C&&c.jsx("span",{className:$.error,children:String(C.message)})]})},cE=({name:e,label:t,required:r,disabled:n,placeholder:o})=>{const a=ce(),i=o??a.chipGroupField.addPlaceholder,[s,l]=h.useState(""),[d,u]=h.useState(!1),f=h.useRef(null),{watch:m,setValue:g,formState:{errors:C}}=tr(),p=m(e)??[],y=C[e],v=()=>{const w=s.trim();w&&!p.includes(w)&&g(e,[...p,w],{shouldDirty:!0}),l(""),u(!1)},b=w=>g(e,p.filter(S=>S!==w),{shouldDirty:!0});return c.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[c.jsxs("label",{className:$.label,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsxs("div",{className:$.chipGroup,children:[p.map(w=>c.jsxs("span",{className:"sbx-chip filled",children:[w,!n&&c.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>b(w),"aria-label":`Remove ${w}`,children:"×"})]},w)),!n&&(d?c.jsx("input",{ref:f,autoFocus:!0,className:$.chipInput,value:s,onChange:w=>l(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),v()),w.key==="Escape"&&(l(""),u(!1))},onBlur:v,placeholder:i}):c.jsxs("button",{type:"button",className:$.addChipBtn,onClick:()=>{u(!0),setTimeout(()=>{var w;return(w=f.current)==null?void 0:w.focus()},50)},children:[c.jsx(mo,{size:12})," ",a.chipGroupField.addButtonLabel]}))]}),y&&c.jsx("span",{className:$.error,children:String(y.message)})]})},dE=({name:e,label:t,options:r,required:n,disabled:o})=>{const a=ce(),{register:i,formState:{errors:s}}=tr(),l=s[e];return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("div",{className:$.radioGroup,children:r.map(d=>c.jsxs("label",{className:$.radioLabel,children:[c.jsx("input",{type:"radio",value:d.value,disabled:o,...i(e,{required:n?a.radioField.requiredError.replace("{field}",t):!1})}),d.label]},d.value))}),l&&c.jsx("span",{className:$.error,children:String(l.message)})]})};async function uE(e,t,r,n){var i,s;const a=(s=(i=(await ke.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:i.result)==null?void 0:s.node_id;if(!a)throw new Error("Asset creation failed: no node_id returned");return a}async function fE(e,t){var o,a;const n=(a=(o=(await ke.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)==null?void 0:a.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function hE(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 pE(e,t,r){var i,s;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const a=(s=(i=(await ke.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:i.result)==null?void 0:s.content_url;if(!a)throw new Error("Asset finalize failed: no content_url returned");return a}const pe={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"},Mh=18,$h=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const o=ce(),[a,i]=h.useState("my"),[s,l]=h.useState(""),[d,u]=h.useState([]),[f,m]=h.useState(0),[g,C]=h.useState(!1),[p,y]=h.useState(null),[v,b]=h.useState(0),[w,S]=h.useState(null),[T,I]=h.useState(""),[N,x]=h.useState(!1),[B,q]=h.useState(""),k=h.useRef(null),P=ae(V=>{var R,ie;return((ie=(R=V.editorConfig)==null?void 0:R.context)==null?void 0:ie.channel)??""}),M=ae(V=>{var R,ie;return((ie=(R=V.editorConfig)==null?void 0:R.context)==null?void 0:ie.uid)??""}),L=ae(V=>{var R,ie,fe;return((fe=(ie=(R=V.editorConfig)==null?void 0:R.context)==null?void 0:ie.cloudStorage)==null?void 0:fe.presigned_headers)??{}}),F=ae(V=>{var R,ie,fe;return((fe=(ie=(R=V.editorConfig)==null?void 0:R.config)==null?void 0:ie.assetConfig)==null?void 0:fe.size)??1*1024*1024}),H=ae(V=>{var R,ie,fe;return((fe=(ie=(R=V.editorConfig)==null?void 0:R.config)==null?void 0:ie.assetConfig)==null?void 0:fe.accepted)??"image/png,image/jpeg"}),X=h.useCallback(async(V,R,ie=!1)=>{var fe;C(!0);try{const J={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};a==="my"&&M&&(J.createdBy=M),P&&(J.channel=P);const Me=((fe=(await ke.post("/action/composite/v3/search",{request:{filters:J,query:V,limit:Mh,offset:R,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:fe.result)??{},Oe=Me.content??[];m(Me.count??0),u(Ve=>ie?[...Ve,...Oe]:Oe)}catch{}finally{C(!1)}},[a,M,P]);h.useEffect(()=>{a!=="upload"&&(u([]),b(0),X(s,0))},[a]);const ve=h.useRef(),Ee=V=>{l(V),clearTimeout(ve.current),ve.current=setTimeout(()=>{u([]),b(0),X(V,0)},400)},Ce=()=>{const V=v+Mh;b(V),X(s,V,!0)},ue=()=>{const V=(p==null?void 0:p.artifactUrl)??(p==null?void 0:p.appIcon)??(p==null?void 0:p.downloadUrl)??"";V&&r(V)};h.useEffect(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);const Q=V=>{var fe;const R=(fe=V.target.files)==null?void 0:fe[0];if(V.target.value="",!R)return;const ie=H.split(",").map(J=>J.trim());if(!ie.includes(R.type)){const J=ie.map(oe=>oe.replace("image/","").toUpperCase()).join(", ");q(o.appIconPickerModal.invalidFileTypeError.replace("{types}",J));return}if(R.size>F){const J=(F/1048576).toFixed(0);q(o.appIconPickerModal.fileTooLargeError.replace("{size}",J));return}T&&URL.revokeObjectURL(T),S(R),I(URL.createObjectURL(R)),q("")},ne=async()=>{if(w){x(!0),q("");try{const V=await uE(w.name.split(".").slice(0,-1).join(".")||w.name,w.type,M,P),R=await fE(V,w.name);await hE(R,w,L);const ie=R.split("?")[0],fe=await pE(V,ie,w.type);r(fe)}catch(V){q(V instanceof Error?V.message:o.appIconPickerModal.uploadFailedError)}finally{x(!1)}}},te=d.length<f;return c.jsx("div",{className:pe.overlay,role:"dialog","aria-modal":"true","aria-label":o.appIconPickerModal.dialogAriaLabel,children:c.jsxs("div",{className:pe.modal,children:[c.jsxs("div",{className:pe.header,children:[c.jsx("span",{className:pe.title,children:o.appIconPickerModal.title}),c.jsx("button",{className:pe.closeBtn,onClick:n,"aria-label":o.appIconPickerModal.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:pe.tabs,role:"tablist",children:[c.jsx("button",{role:"tab","aria-selected":a==="my",className:`${pe.tab} ${a==="my"?pe.activeTab:""}`,onClick:()=>i("my"),children:o.appIconPickerModal.myImagesTab}),c.jsx("button",{role:"tab","aria-selected":a==="all",className:`${pe.tab} ${a==="all"?pe.activeTab:""}`,onClick:()=>i("all"),children:o.appIconPickerModal.allImagesTab}),c.jsxs("button",{role:"tab","aria-selected":a==="upload",className:`${pe.tab} ${a==="upload"?pe.activeTab:""}`,onClick:()=>i("upload"),children:[c.jsx(Xi,{size:13,style:{marginRight:4}}),o.appIconPickerModal.uploadTab]})]}),c.jsx("div",{className:pe.body,children:a!=="upload"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:pe.searchWrap,children:[c.jsx(Yi,{size:14,className:pe.searchIcon}),c.jsx("input",{type:"search",className:pe.searchInput,placeholder:o.appIconPickerModal.searchPlaceholder,value:s,onChange:V=>Ee(V.target.value)})]}),g&&d.length===0?c.jsxs("div",{className:pe.loadingRow,children:[c.jsx(wa,{size:20,className:pe.spinner}),c.jsx("span",{children:o.appIconPickerModal.loadingText})]}):d.length===0?c.jsx("div",{className:pe.empty,children:o.appIconPickerModal.noImagesFound}):c.jsx("div",{className:pe.grid,children:d.map(V=>{const R=V.appIcon??V.artifactUrl??V.downloadUrl??"",ie=(p==null?void 0:p.identifier)===V.identifier;return c.jsxs("button",{type:"button",className:`${pe.imgCell} ${ie?pe.imgCellSelected:""}`,onClick:()=>y(V),title:V.name,children:[R?c.jsx("img",{src:R,alt:V.name,className:pe.thumb}):c.jsx("div",{className:pe.noThumb,children:o.appIconPickerModal.noThumbnailText}),ie&&c.jsx("div",{className:pe.checkBadge,children:c.jsx(wn,{size:12})})]},V.identifier)})}),te&&!g&&c.jsx("button",{className:pe.loadMoreBtn,onClick:Ce,children:o.appIconPickerModal.loadMoreButton}),g&&d.length>0&&c.jsx("div",{className:pe.loadingRow,children:c.jsx(wa,{size:16,className:pe.spinner})})]}):c.jsxs("div",{className:pe.uploadArea,children:[c.jsx("div",{className:pe.dropZone,onClick:()=>{var V;return(V=k.current)==null?void 0:V.click()},onDragOver:V=>V.preventDefault(),onDrop:V=>{V.preventDefault();const R=V.dataTransfer.files[0];R&&Q({target:{files:[R],value:""}})},children:T?c.jsx("img",{src:T,alt:o.appIconPickerModal.previewAlt,className:pe.uploadPreview}):c.jsxs(c.Fragment,{children:[c.jsx(Xi,{size:32,className:pe.uploadIcon}),c.jsx("p",{className:pe.dropText,children:o.appIconPickerModal.dropZoneText}),c.jsx("p",{className:pe.dropSubtext,children:o.appIconPickerModal.acceptedTypesInfo.replace("{types}",H.split(",").map(V=>V.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(F/(1024*1024)).toFixed(0))})]})}),c.jsx("input",{ref:k,type:"file",accept:H,className:pe.hiddenInput,onChange:Q}),w&&c.jsx("p",{className:pe.fileName,children:w.name}),B&&c.jsx("p",{className:pe.errorText,children:B})]})}),c.jsxs("div",{className:pe.footer,children:[c.jsx("button",{className:pe.cancelBtn,onClick:n,children:o.appIconPickerModal.cancelButton}),a==="upload"?c.jsx("button",{className:pe.confirmBtn,disabled:!w||N,onClick:ne,children:N?c.jsxs(c.Fragment,{children:[c.jsx(wa,{size:14,className:pe.spinner})," ",o.appIconPickerModal.uploadingText]}):o.appIconPickerModal.uploadAndUseButton}):c.jsx("button",{className:pe.confirmBtn,disabled:!p,onClick:ue,children:o.appIconPickerModal.useSelectedButton})]})]})})},gE=({name:e,label:t,nodeId:r,required:n,disabled:o})=>{const a=ce(),[i,s]=h.useState(!1),{watch:l,setValue:d,register:u,formState:{errors:f}}=tr(),m=l(e),g=f[e],C=y=>{d(e,y,{shouldDirty:!0,shouldValidate:!0}),s(!1)},p=()=>{d(e,"",{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...u(e,{required:n?a.appIconField.requiredError.replace("{field}",t):!1})}),c.jsx("div",{className:$.iconWrap,role:"button",tabIndex:o?-1:0,"aria-label":a.appIconField.selectIconAriaLabel,onClick:()=>!o&&s(!0),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&!o&&s(!0)},children:m?c.jsx("img",{src:m,alt:a.appIconField.iconAlt,className:$.iconPreview}):c.jsxs("div",{className:$.iconPlaceholder,children:[c.jsx(Xc,{size:20}),c.jsx("span",{children:a.appIconField.selectIconLabel})]})}),m&&!o&&c.jsxs("button",{type:"button",className:$.removeIconBtn,onClick:p,"aria-label":a.appIconField.removeIconAriaLabel,children:[c.jsx(Zi,{size:13}),c.jsx("span",{children:a.appIconField.removeLabel})]}),g&&c.jsx("span",{className:$.error,children:String(g.message)}),i&&c.jsx($h,{nodeId:r,currentValue:m,onSelect:C,onClose:()=>s(!1)})]})},mE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ti({name:e,control:a,rules:{required:r?o.dateTimeField.requiredError.replace("{field}",t):!1}});return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{id:e,type:"datetime-local",className:[$.input,s?$.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:i.onChange,onBlur:i.onBlur,ref:i.ref}),s&&c.jsx("span",{className:$.error,children:String(s.message)})]})},yE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ti({name:e,control:a,rules:{required:r?o.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[l,d]=h.useState(""),u=h.useRef(null),f=i.value??[],m=y=>{const v=y.trim();!v||f.includes(v)||i.onChange([...f,v])},g=y=>{i.onChange(f.filter(v=>v!==y))},C=y=>{y.key==="Enter"||y.key===","?(y.preventDefault(),m(l),d("")):y.key==="Backspace"&&l===""&&f.length>0&&g(f[f.length-1])},p=()=>{l.trim()&&(m(l),d("")),i.onBlur()};return c.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[c.jsxs("label",{className:$.label,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsxs("div",{className:[$.chipGroup,s?$.inputError:""].join(" "),onClick:()=>{var y;return!n&&((y=u.current)==null?void 0:y.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(y=>c.jsxs("span",{className:$.tagChip,children:[y,!n&&c.jsx("button",{type:"button",className:$.tagChipRemove,onClick:v=>{v.stopPropagation(),g(y)},"aria-label":`Remove ${y}`,children:c.jsx(yr,{size:11})})]},y)),!n&&c.jsx("input",{ref:u,className:$.chipInput,value:l,onChange:y=>d(y.target.value),onKeyDown:C,onBlur:p,placeholder:f.length===0?o.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),s&&c.jsx("span",{className:$.error,children:String(s.message)})]})},vE=({name:e,label:t,levels:r,required:n,disabled:o})=>{const a=ce(),{control:i}=tr(),{field:s,fieldState:{error:l}}=ti({name:e,control:i,rules:{required:n?a.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=s.value??{},u=(f,m,g)=>{const C={};for(let p=0;p<m;p++)C[r[p].code]=d[r[p].code]??"";C[f]=g;for(let p=m+1;p<r.length;p++)C[r[p].code]="";s.onChange(C)};return c.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("div",{className:$.nestedSelectRow,children:r.map((f,m)=>{const g=m>0&&!d[r[m-1].code];return c.jsxs("div",{className:$.field,style:{flex:1},children:[c.jsx("label",{className:$.label,htmlFor:`${e}_${f.code}`,children:f.label}),c.jsxs("select",{id:`${e}_${f.code}`,className:[$.input,l?$.inputError:""].join(" "),disabled:o||g,value:d[f.code]??"",onChange:C=>u(f.code,m,C.target.value),onBlur:s.onBlur,children:[c.jsx("option",{value:"",children:a.nestedSelectField.selectPlaceholder}),f.options.map(C=>c.jsx("option",{value:C.value,children:C.label},C.value))]})]},f.code)})}),l&&c.jsx("span",{className:$.error,children:String(l.message)})]})},Bh=[{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"}],bE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),[a,i]=h.useState(!1),s=h.useRef(null),{register:l,watch:d,setValue:u,formState:{errors:f}}=tr(),m=d(e),g=Bh.find(y=>y.value===m),C=(g==null?void 0:g.label)??o.licenseSelectField.selectPlaceholder,p=f[e];return h.useEffect(()=>{if(!a)return;const y=v=>{var b;(b=s.current)!=null&&b.contains(v.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]),c.jsxs("div",{className:$.field,ref:s,style:{position:"relative"},children:[c.jsxs("label",{className:$.label,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...l(e,{required:r?o.licenseSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:n,className:[$.selectBtn,p?$.inputError:"",a?$.selectOpen:""].join(" "),onClick:()=>i(y=>!y),"aria-haspopup":"listbox","aria-expanded":a,children:[c.jsx("span",{className:m?$.selectedVal:$.placeholder,children:C}),c.jsx(Cn,{size:14,className:a?$.chevronUp:""})]}),a&&c.jsx("div",{className:$.dropdown,role:"listbox",children:Bh.map(y=>c.jsxs("button",{type:"button",role:"option","aria-selected":m===y.value,className:[$.option,m===y.value?$.optionSelected:""].join(" "),onClick:()=>{u(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[c.jsx("span",{children:y.label}),m===y.value&&c.jsx(wn,{size:13})]},y.value))}),p&&c.jsx("span",{className:$.error,children:String(p.message)})]})},wE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ti({name:e,control:a,rules:{required:r?o.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[l,d]=h.useState("idle"),[u,f]=h.useState(""),m=async()=>{const C=(i.value??"").trim();if(!C){d("invalid"),f(o.dialcodeInputField.enterCodeMessage);return}d("loading"),f("");try{const p=await xw(C),y=p==null?void 0:p.result,v=y==null?void 0:y.dialcodes;Array.isArray(v)&&v.length>0?(d("valid"),f(o.dialcodeInputField.validMessage)):(d("invalid"),f(o.dialcodeInputField.notFoundMessage))}catch{d("invalid"),f(o.dialcodeInputField.validationFailedMessage)}},g=()=>l==="loading"?c.jsx(wa,{size:16,className:$.dialcodeSpinner}):l==="valid"?c.jsx(Wc,{size:16,color:"var(--sbx-success, #2e7d32)"}):l==="invalid"?c.jsx(Ly,{size:16,color:"var(--sbx-error)"}):null;return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsxs("div",{className:$.dialcodeRow,children:[c.jsx("input",{id:e,type:"text",className:[$.input,s?$.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:C=>{i.onChange(C),d("idle"),f("")},onBlur:i.onBlur,ref:i.ref,placeholder:o.dialcodeInputField.placeholderExample,style:{flex:1}}),c.jsx("button",{type:"button",className:$.validateBtn,onClick:m,disabled:n||l==="loading","aria-label":o.dialcodeInputField.validateAriaLabel,children:l==="loading"?o.dialcodeInputField.validatingLabel:o.dialcodeInputField.validateButtonLabel}),g()]}),s&&c.jsx("span",{className:$.error,children:String(s.message)}),!s&&u&&c.jsx("span",{className:l==="valid"?$.dialcodeValid:$.error,children:u})]})},Sl={form:"_form_szqex_1",ungrouped:"_ungrouped_szqex_7",noFields:"_noFields_szqex_18"},CE=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:o,onFormValueChange:a,onFormStatusChange:i})=>{var We,ze,re,Ke,Re,He,et,Gt,It;const s=ce(),l=ae(K=>K.editorConfig),d=ae(K=>K.rootFormConfig),u=ae(K=>K.unitFormConfig),f=ae(K=>K.categoryMeta),m=ae(K=>K.contentFramework),g=ae(K=>K.contentTargetFWIds),{organisationFramework:C,targetFrameworks:p,isLoading:y}=wl(m??((We=l==null?void 0:l.context)==null?void 0:We.framework),g??((ze=l==null?void 0:l.context)==null?void 0:ze.targetFWIds)),{frameworks:v,collectionAdditionalCategories:b,contentAdditionalCategories:w,defaultLicense:S,name:T}=L1((re=l==null?void 0:l.context)==null?void 0:re.channel),I=P1(((Ke=l==null?void 0:l.context)==null?void 0:Ke.userId)??((Re=l==null?void 0:l.context)==null?void 0:Re.uid)),N=x1(v,(He=f==null?void 0:f.frameworkMetadata)==null?void 0:He.orgFWType,(et=l==null?void 0:l.context)==null?void 0:et.channel),x={organisationFramework:C,targetFrameworks:p,orgFrameworks:N,channelAdditionalCategories:b},B=Ae(K=>K.selectedNodeId),q=Ae(K=>K.treeData),k=Ae(K=>K.treeCache),P=B?k[B]??{}:{},M={...e,...P},L=h.useMemo(()=>{var ge;if(!B)return 0;const K=[...q];for(;K.length;){const be=K.shift();if(be.id===B)return((ge=be.children)==null?void 0:ge.length)??0;be.children&&K.push(...be.children)}return 0},[q,B]),F=(l==null?void 0:l.config)??{},H=(l==null?void 0:l.context)??{},X={editorMode:o,editableFields:F.editableFields,objectType:F.objectType,setDefaultCopyRight:F.setDefaultCopyRight===!0,defaultLicense:H.defaultLicense??S,contextAdditionalCategories:H.additionalCategories,userFullName:((Gt=H.user)==null?void 0:Gt.fullName)??I,channelName:T,collectionAdditionalCategories:b,contentAdditionalCategories:w,childCount:L},ve=r?d:u,Ee=ve||(((It=l==null?void 0:l.config.hierarchy)==null?void 0:It.formConfig)??[]),Ce=Nh(Ee,M,x,r,X),ue=Ce.filter(K=>K.tab===t&&K.inputType!=="appIcon"&&K.visible!==!1),Q=N1({mode:"onChange",defaultValues:Object.fromEntries(Ce.map(K=>{const ge=["multiselect","chips","keywords","tagsinput"],be=["nestedselect"];return ge.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??[]]:be.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??{}]:[K.code,K.currentValue??K.defaultValue??""]}))});aE(Q,Ce);const{updateNode:ne}=Ae(),te=h.useRef(Ce);te.current=Ce;const V=h.useRef(B);V.current=B;const R=h.useRef(a);R.current=a;const ie=h.useRef(i);ie.current=i;const fe=h.useRef(typeof M.shuffle=="boolean"?M.shuffle:void 0),J=h.useRef(M.name??"");J.current=M.name??"";const oe=h.useRef(o);oe.current=o;const Me=["review","read","sourcingreview","orgreview"];h.useEffect(()=>{const K=V.current;if(K){const ge=Object.fromEntries(te.current.filter(be=>be.currentValue!==void 0&&be.currentValue!==null).map(be=>[be.code,be.currentValue]));Object.keys(ge).length>0&&ne(K,ge)}Q.trigger().then(()=>{const ge=Q.formState.errors,be=te.current,Wt=Array.from(new Set(Object.keys(ge).map(_=>{var A;return(A=be.find(D=>D.code===_))==null?void 0:A.tab}).filter(Boolean)));ie.current(Object.keys(ge).length===0,Wt)})},[]),h.useEffect(()=>{const K=Q.watch((ge,{name:be})=>{const Wt=V.current;if(!Wt)return;const _=te.current,A=new Set(_.map(j=>j.code));if(be&&A.has(be)){let j=Q.getValues(be);if(be==="dialcodes"&&(j=Array.isArray(j)?j:j?[j]:[]),be==="shuffle"&&(j===!0&&fe.current===!1&&Ie(s.sparkMetaForm.shuffleEnabledMessage,{icon:c.jsx(Qi,{size:16})}),fe.current=j),be==="framework"&&r&&typeof j=="string"&&j){const U=ae.getState();U.setContentFramework(j,U.contentTargetFWIds)}const G=oE(be,j);G&&(ne(Wt,G),R.current(G))}else if(!be){const j=Q.getValues(),G=Object.fromEntries(Object.entries(j).filter(([ee])=>A.has(ee))),U=nE(G,{isReview:Me.includes(oe.current),nodeTitle:J.current});Object.keys(U).length>0&&(ne(Wt,U),R.current(U))}const D=Q.formState.errors,z=Array.from(new Set(Object.keys(D).map(j=>{var G;return(G=_.find(U=>U.code===j))==null?void 0:G.tab}).filter(Boolean)));ie.current(Object.keys(D).length===0,z)});return()=>K.unsubscribe()},[Q]),h.useEffect(()=>{for(const K of["author","creator","copyright","copyrightYear","license"]){const ge=te.current.find(Wt=>Wt.code===K);if(!ge||ge.currentValue===void 0||ge.currentValue===null||ge.currentValue==="")continue;const be=Q.getValues(K);(be==null||be==="")&&Q.setValue(K,ge.currentValue,{shouldDirty:!1})}},[I,T,Q]);const Oe=ue.reduce((K,ge)=>{const be=K[K.length-1];return be&&be.section===ge.section?be.fields.push(ge):K.push({section:ge.section,fields:[ge]}),K},[]),Ve=K=>{const ge={key:K.code,name:K.code,label:K.label,required:K.required,disabled:K.editable===!1};switch(K.inputType){case"textarea":return c.jsx(Fh,{...ge,multiline:!0,maxLength:K.maxLength});case"select":return c.jsx(sE,{...ge,options:K.options??[]});case"multiselect":return c.jsx(lE,{...ge,options:K.options??[]});case"chips":return c.jsx(cE,{...ge});case"radio":return c.jsx(dE,{...ge,options:K.options??[]});case"appIcon":return c.jsx(gE,{...ge,nodeId:B??""});case"datepicker":case"datetime":return c.jsx(mE,{...ge});case"keywords":case"tagsinput":return c.jsx(yE,{...ge});case"nestedselect":return c.jsx(vE,{...ge,levels:K.levels??[]});case"license":return c.jsx(bE,{...ge});case"dialcode":return c.jsx(wE,{...ge});default:return c.jsx(Fh,{...ge,maxLength:K.maxLength})}};return c.jsx(g1,{...Q,children:c.jsxs("div",{className:Sl.form,children:[Oe.map((K,ge)=>{const be=K.section?F1[K.section]:void 0;return be?c.jsx(iE,{title:be.title,description:be.description,children:K.fields.map(Ve)},K.section??ge):c.jsx("div",{className:Sl.ungrouped,children:K.fields.map(Ve)},ge)}),ue.length===0&&!y&&c.jsx("p",{className:Sl.noFields,children:s.sparkMetaForm.noFieldsMessage})]})})};function jh(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function SE(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function si(e){return e!==null&&e>=0}function _E(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 TE(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const qh=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=jh(t,n,r),i=t[o],s=a[o];return!s||!i?null:{x:s.left-i.left,y:s.top-i.top,scaleX:s.width/i.width,scaleY:s.height/i.height}},li={scaleX:1,scaleY:1},EE=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:a,overIndex:i}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(o===r){const d=a[i];return d?{x:0,y:r<i?d.top+d.height-(s.top+s.height):d.top-s.top,...li}:null}const l=IE(a,o,r);return o>r&&o<=i?{x:0,y:-s.height-l,...li}:o<r&&o>=i?{x:0,y:s.height+l,...li}:{x:0,y:0,...li}};function IE(e,t,r){const n=e[t],o=e[t-1],a=e[t+1];return n?r<t?o?n.top-(o.top+o.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Uh="Sortable",Vh=h.createContext({activeIndex:-1,containerId:Uh,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qh,disabled:{draggable:!1,droppable:!1}});function OE(e){let{children:t,id:r,items:n,strategy:o=qh,disabled:a=!1}=e;const{active:i,dragOverlay:s,droppableRects:l,over:d,measureDroppableContainers:u}=Hc(),f=lo(Uh,r),m=s.rect!==null,g=h.useMemo(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),C=i!=null,p=i?g.indexOf(i.id):-1,y=d?g.indexOf(d.id):-1,v=h.useRef(g),b=!_E(g,v.current),w=y!==-1&&p===-1||b,S=TE(a);Yt(()=>{b&&C&&u(g)},[b,g,C,u]),h.useEffect(()=>{v.current=g},[g]);const T=h.useMemo(()=>({activeIndex:p,containerId:f,disabled:S,disableTransforms:w,items:g,overIndex:y,useDragOverlay:m,sortedRects:SE(g,l),strategy:o}),[p,f,S.draggable,S.droppable,w,g,y,l,m,o]);return h.createElement(Vh.Provider,{value:T},t)}const AE=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return jh(r,n,o).indexOf(t)},DE=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:i,previousItems:s,previousContainerId:l,transition:d}=e;return!d||!n||s!==a&&o===i?!1:r?!0:i!==o&&t===l},NE={duration:200,easing:"ease"},zh="transform",kE=Ar.Transition.toString({property:zh,duration:0,easing:"linear"}),xE={roleDescription:"sortable"};function LE(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,i]=h.useState(null),s=h.useRef(r);return Yt(()=>{if(!t&&r!==s.current&&n.current){const l=o.current;if(l){const d=bn(n.current,{ignoreTransform:!0}),u={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(u.x||u.y)&&i(u)}}r!==s.current&&(s.current=r)},[t,r,n,o]),h.useEffect(()=>{a&&i(null)},[a]),a}function PE(e){let{animateLayoutChanges:t=DE,attributes:r,disabled:n,data:o,getNewIndex:a=AE,id:i,strategy:s,resizeObserverConfig:l,transition:d=NE}=e;const{items:u,containerId:f,activeIndex:m,disabled:g,disableTransforms:C,sortedRects:p,overIndex:y,useDragOverlay:v,strategy:b}=h.useContext(Vh),w=FE(n,g),S=u.indexOf(i),T=h.useMemo(()=>({sortable:{containerId:f,index:S,items:u},...o}),[f,o,S,u]),I=h.useMemo(()=>u.slice(u.indexOf(i)),[u,i]),{rect:N,node:x,isOver:B,setNodeRef:q}=hy({id:i,data:T,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:k,activatorEvent:P,activeNodeRect:M,attributes:L,setNodeRef:F,listeners:H,isDragging:X,over:ve,setActivatorNodeRef:Ee,transform:Ce}=zc({id:i,data:T,attributes:{...xE,...r},disabled:w.draggable}),ue=Xg(q,F),Q=!!k,ne=Q&&!C&&si(m)&&si(y),te=!v&&X,V=te&&ne?Ce:null,ie=ne?V??(s??b)({rects:p,activeNodeRect:M,activeIndex:m,overIndex:y,index:S}):null,fe=si(m)&&si(y)?a({id:i,items:u,activeIndex:m,overIndex:y}):S,J=k==null?void 0:k.id,oe=h.useRef({activeId:J,items:u,newIndex:fe,containerId:f}),Me=u!==oe.current.items,Oe=t({active:k,containerId:f,isDragging:X,isSorting:Q,id:i,index:S,items:u,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:d,wasDragging:oe.current.activeId!=null}),Ve=LE({disabled:!Oe,index:S,node:x,rect:N});return h.useEffect(()=>{Q&&oe.current.newIndex!==fe&&(oe.current.newIndex=fe),f!==oe.current.containerId&&(oe.current.containerId=f),u!==oe.current.items&&(oe.current.items=u)},[Q,fe,f,u]),h.useEffect(()=>{if(J===oe.current.activeId)return;if(J&&!oe.current.activeId){oe.current.activeId=J;return}const ze=setTimeout(()=>{oe.current.activeId=J},50);return()=>clearTimeout(ze)},[J]),{active:k,activeIndex:m,attributes:L,data:T,rect:N,index:S,newIndex:fe,items:u,isOver:B,isSorting:Q,isDragging:X,listeners:H,node:x,overIndex:y,over:ve,setNodeRef:ue,setActivatorNodeRef:Ee,setDroppableNodeRef:q,setDraggableNodeRef:F,transform:Ve??ie,transition:We()};function We(){if(Ve||Me&&oe.current.newIndex===S)return kE;if(!(te&&!da(P)||!d)&&(Q||Oe))return Ar.Transition.toString({...d,property:zh})}}function FE(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 ci(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 ME=[_e.Down,_e.Right,_e.Up,_e.Left],$E=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:s}}=t;if(ME.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=o.get(f.id);if(m)switch(e.code){case _e.Down:n.top<m.top&&l.push(f);break;case _e.Up:n.top>m.top&&l.push(f);break;case _e.Left:n.left>m.left&&l.push(f);break;case _e.Right:n.left<m.left&&l.push(f);break}});const d=gm({collisionRect:n,droppableRects:o,droppableContainers:l});let u=gc(d,"id");if(u===(i==null?void 0:i.id)&&d.length>1&&(u=d[1].id),u!=null){const f=a.get(r.id),m=a.get(u),g=m?o.get(m.id):null,C=m==null?void 0:m.node.current;if(C&&g&&f&&m){const y=ha(C).some((I,N)=>s[N]!==I),v=Hh(f,m),b=BE(f,m),w=y||!v?{x:0,y:0}:{x:b?n.width-g.width:0,y:b?n.height-g.height:0},S={x:g.left,y:g.top};return w.x&&w.y?S:co(S,w)}}}};function Hh(e,t){return!ci(e)||!ci(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function BE(e,t){return!ci(e)||!ci(t)||!Hh(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const tn={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"},jE={video:Ji,pdf:ba,h5p:Gi,scorm:Ki,audio:Wi,quiz:Ri,default:Sn},qE=({item:e,onRemove:t,isEditable:r})=>{const n=ce(),o=Xa(e),a=jE[o.key]??Sn,{attributes:i,listeners:s,setNodeRef:l,transform:d,transition:u,isDragging:f}=PE({id:e.id,disabled:!r}),m={transform:Ar.Transform.toString(d),transition:u,opacity:f?.5:1};return c.jsxs("div",{ref:l,style:m,className:tn.row,role:"listitem",children:[r&&c.jsx("span",{className:tn.grip,...i,...s,"aria-label":n.contentRow.dragToReorderAriaLabel,children:c.jsx(Zc,{size:15})}),c.jsx("span",{className:[`sbx-ct-sq--${o.key}`,tn.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(a,{size:14})}),c.jsxs("div",{className:tn.info,children:[c.jsx("span",{className:tn.name,title:e.name,children:e.name}),c.jsx("span",{className:tn.meta,children:o.label})]}),c.jsx("span",{className:`sbx-ct-badge--${o.key}`,children:o.label}),r&&c.jsx("button",{type:"button",className:tn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:c.jsx(yr,{size:14})})]})},rn={container:"_container_lzvke_1",header:"_header_lzvke_7",heading:"_heading_lzvke_13",count:"_count_lzvke_21",list:"_list_lzvke_30",emptyState:"_emptyState_lzvke_36",addRow:"_addRow_lzvke_52"},UE=({editorMode:e})=>{const t=ce(),{selectedNodeId:r,getChildrenOf:n,reorderChildren:o,deleteNode:a}=Ae(),i=r?n(r):[],s=e==="edit",l=uc(Pi(pa,{activationConstraint:{distance:5}}),Pi(ji,{coordinateGetter:$E})),d=h.useCallback(f=>{const{active:m,over:g}=f;if(!g||m.id===g.id||!r)return;const C=Ae.getState().getChildrenOf(r),p=C.findIndex(v=>v.id===m.id),y=C.findIndex(v=>v.id===g.id);p<0||y<0||o(r,p,y)},[r,o]),u=h.useCallback(f=>{window.confirm(t.unitContentList.removeConfirm)&&a(f)},[a,t.unitContentList.removeConfirm]);return r?c.jsxs("div",{className:rn.container,children:[c.jsxs("div",{className:rn.header,children:[c.jsx("span",{className:rn.heading,children:t.unitContentList.heading}),c.jsx("span",{className:rn.count,children:i.length})]}),i.length>0?c.jsx(Uc,{sensors:l,collisionDetection:pm,onDragEnd:d,children:c.jsx(OE,{items:i.map(f=>f.id),strategy:EE,children:c.jsx("div",{className:rn.list,role:"list",children:i.map(f=>c.jsx(qE,{item:f,onRemove:u,isEditable:s},f.id))})})}):c.jsxs("div",{className:rn.emptyState,children:[c.jsx("p",{children:t.unitContentList.emptyTitle}),c.jsx("span",{children:t.unitContentList.emptyHint})]}),s&&c.jsxs("button",{className:rn.addRow,type:"button","aria-label":t.unitContentList.addContentAriaLabel,children:[c.jsx(mo,{size:14})," ",t.unitContentList.addContent]})]}):null},Rh={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},VE=({isActive:e,label:t,nodeId:r,className:n})=>{const o=ce(),a=t??o.dropZone.dropHere;return c.jsx("div",{className:`${Rh.dropZone} ${e?Rh.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":a,role:"region",children:c.jsx("span",{children:a})})};async function zE(e){var i;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((i=(await ke.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??["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"]}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:i.result)??{},o=new Set(["count","facets"]);return{content:Object.entries(n).filter(([s])=>!o.has(s)).flatMap(([,s])=>Array.isArray(s)?s:[]),count:n.count??0}}async function HE(e){var r,n;return(n=(r=(await ke.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Qh="application/vnd.sunbird.question";function Gh(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Wh(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const o=Wh(n,t,e);if(o)return o}return null}function RE(e,t){const r=Wh(e,t);if(!r)return null;const{question:n,parent:o}=r,a={...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?a.maxScore=1:n.qType==="SA"?delete a.maxScore:n.maxScore!=null&&(a.maxScore=n.maxScore),a}function QE(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return gn({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await su(e),o=u=>{if(!u)return[];const f=u.mimeType===Qh&&u.identifier?[u.identifier]:[],m=(u.children??[]).flatMap(o);return[...f,...m]},a=o(n),i=new Map;a.length&&(await _w(a)).forEach(f=>{const m=f.identifier;m&&i.set(m,f)});const s=u=>{if(!u)return u;if(u.mimeType===Qh&&u.identifier){const f=i.get(u.identifier)??u,m=f.outcomeDeclaration;return m!=null&&m.maxScore||(f.outcomeDeclaration={...m??{},maxScore:Gh(f)}),f}return Array.isArray(u.children)&&(u.children=u.children.map(f=>s(f))),u},l=s(n),d=l.outcomeDeclaration;return d!=null&&d.maxScore||(l.outcomeDeclaration={...d??{},maxScore:Gh(l)}),l}})}const Kh="/assets/quml-player/sunbird-quml-player.js",GE="/assets/quml-player/styles.css",Yh="sunbird-quml-player";function WE(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const ct=class ct{constructor(){Yo(this,"eventHandlers",new WeakMap)}loadScript(){return ct.scriptLoaded||customElements.get(Yh)?(ct.scriptLoaded=!0,Promise.resolve()):(ct.scriptLoading||(ct.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Kh,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{ct.scriptLoaded=!0,ct.scriptLoading=void 0,t()},n.onerror=()=>{ct.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Kh}`))},document.body.appendChild(n)})),ct.scriptLoading)}loadStyles(){if(ct.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){ct.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=GE,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),ct.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),ct.stylesLoaded=!1}async createConfig(t,r,n){var a,i,s;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((a=r==null?void 0:r.pdata)==null?void 0:a.id)??"sunbird.portal",ver:((i=r==null?void 0:r.pdata)==null?void 0:i.ver)??"1.0",pid:((s=r==null?void 0:r.pdata)==null?void 0:s.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:WE(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Yh);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=i=>r==null?void 0:r(i),a=i=>n==null?void 0:n(i.detail);t.addEventListener("playerEvent",o),t.addEventListener("telemetryEvent",a),this.eventHandlers.set(t,{player:o,telemetry:a})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};Yo(ct,"scriptLoaded",!1),Yo(ct,"scriptLoading"),Yo(ct,"stylesLoaded",!1);let di=ct;const ui=new di,je={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"},KE="application/vnd.sunbird.questionset";function YE(e,t){const r=new Map,n=a=>{for(const i of a)r.set(i.id,i),i.children&&n(i.children)};n(e);let o=r.get(t);for(;o;){if(o.mimeType===KE)return o.identifier;o=o.parent?r.get(o.parent):void 0}return null}const ZE=[{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 XE(e){return ZE.find(t=>t.mimes.includes(e))??{key:"other"}}function JE(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 eI={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},tI={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},rI={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},nI="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function _l(e){for(const[t,r]of Object.entries(eI))if(r.includes(e))return t;return"default-player"}function oI(e,t,r){var a;const n=r==null?void 0:r.context,o=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((a=n==null?void 0:n.pdata)==null?void 0:a.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:o==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function aI(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 iI(e,t,r=100){await aI(tI[t]??""),!customElements.get(e)&&await new Promise((n,o)=>{let a=0;const i=setInterval(()=>{a++,customElements.get(e)?(clearInterval(i),n()):a>=r&&(clearInterval(i),o(new Error(`Custom element <${e}> did not register`)))},100)})}const sI=[{key:"author",icon:Jy},{key:"license",icon:Qy},{key:"language",icon:By},{key:"gradeLevel",icon:Gy},{key:"subject",icon:Ny},{key:"contentType",icon:Zy}];function lI(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 cI({node:e}){const t=ce(),r=e.metadata??{},n=sI.flatMap(o=>{const a=r[o.key];if(!a)return[];const i=Array.isArray(a)?a.join(", "):String(a);return i?[{...o,label:lI(o.key,t),val:i}]:[]});return n.length?c.jsx("div",{className:je.infoStrip,children:n.map(o=>c.jsxs("div",{className:je.infoChip,children:[o.icon&&c.jsx(o.icon,{size:13,className:je.infoChipIcon}),c.jsx("span",{className:je.infoChipLabel,children:o.label}),o.val]},o.key))}):null}function Zh({node:e,hidden:t}){var o;const r=ce(),n=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return c.jsx("div",{className:`${je.coverOverlay} ${t?je.coverHidden:""}`,children:n?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:n,alt:e.name,className:je.coverThumb}),c.jsx("div",{className:je.coverPlayRing,children:c.jsx("div",{className:je.coverPlayIcon})}),c.jsx("span",{className:je.coverLabel,children:r.contentPlayer.loadingPreview})]}):c.jsx("div",{className:je.coverSkeleton})})}function Xh({message:e}){return c.jsxs("div",{className:je.playerError,children:[c.jsx(Xy,{size:28,className:je.playerErrorIcon}),c.jsx("span",{className:je.playerErrorMsg,children:e})]})}function dI({mimeType:e}){const t=ce(),r=XE(e);return c.jsxs("span",{className:je.typeBadge,"data-type":r.key,children:[c.jsx("span",{className:je.typeDot}),JE(r.key,t)]})}const Tl=({node:e,editorMode:t,type:r,singleQuestion:n,layout:o="fill"})=>{var i;if(r==="quml")return c.jsx(fI,{node:e,editorMode:t,singleQuestion:!!n});const a=e.appIcon??((i=e.metadata)==null?void 0:i.appIcon);return c.jsxs("div",{className:`${je.contentPlayerRoot} ${o==="flow"?je.flowLayout:""}`,children:[c.jsxs("div",{className:je.stage,children:[c.jsxs("div",{className:je.playerHeader,children:[a&&c.jsx("img",{src:a,alt:"",className:je.playerHeaderThumb}),c.jsx("span",{className:je.playerHeaderTitle,children:e.name}),c.jsx(dI,{mimeType:e.mimeType??""})]}),c.jsx(uI,{node:e})]}),c.jsx(cI,{node:e})]})};function uI({node:e}){var v;const t=ce(),r=ae(b=>b.editorConfig),[n,o]=h.useState(()=>_l(e.mimeType??"")),[a,i]=h.useState(!1),[s,l]=h.useState(null),[d,u]=h.useState(e.metadata??{}),[f,m]=h.useState(!1),g=h.useRef(null),C=h.useRef(null),p=((v=r==null?void 0:r.config)==null?void 0:v.previewCdnUrl)??nI;h.useEffect(()=>{let b=!1;return m(!1),i(!1),l(null),u(e.metadata??{}),o(_l(e.mimeType??"")),HE(e.identifier).then(w=>{if(b)return;const S={...e.metadata??{},...w};u(S);const T=w.mimeType??e.mimeType??"";o(_l(T)),m(!0)}).catch(()=>{b||m(!0)}),()=>{b=!0}},[e.identifier]);const y=oI(e,d,r);return h.useEffect(()=>{if(!f||n!=="default-player")return;const b=g.current;if(!b)return;b.src=p;const w=()=>{try{const T=b.contentWindow;if(typeof(T==null?void 0:T.initializePreview)!="function"){l(t.contentPlayer.previewPlayerUnavailable);return}T.initializePreview(y),setTimeout(()=>i(!0),300)}catch(T){console.error("[ContentPlayer] initializePreview failed",T),l(t.contentPlayer.failedToInitializePlayer)}},S=()=>l(t.contentPlayer.previewPlayerLoadFailed);return b.addEventListener("load",w),b.addEventListener("error",S),()=>{b.removeEventListener("load",w),b.removeEventListener("error",S),b.src=""}},[e.identifier,n,p,f,t]),h.useEffect(()=>{if(!f||n==="default-player")return;const b=C.current;if(!b)return;const w=rI[n];if(!w)return;const S=y;iI(w,n).then(()=>{if(!C.current)return;if(!customElements.get(w)){o("default-player");return}const T=document.createElement(w);T.setAttribute("player-config",JSON.stringify(S)),T.addEventListener("playerEvent",()=>{}),T.addEventListener("telemetryEvent",()=>{}),b.innerHTML="",b.appendChild(T),setTimeout(()=>{try{T.playerConfig=S}catch{}i(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),o("default-player")})},[e.identifier,n,f]),c.jsxs("div",{className:je.aspectRatio,children:[s?c.jsx(Xh,{message:s}):c.jsx(Zh,{node:e,hidden:a}),n==="default-player"?c.jsx("iframe",{ref:g,id:"contentPlayer",title:e.name,className:je.playerFrame,name:"contentPlayer",allowFullScreen:!0}):c.jsx("div",{ref:C,className:je.playerFrame})]})}function fI({node:e,editorMode:t,singleQuestion:r}){const n=ce(),o=ae(g=>g.editorConfig),a=Ae(g=>g.treeData),i=h.useRef(null),s=r?YE(a,e.id):e.identifier,{data:l,isLoading:d,error:u}=QE(s??"",{enabled:!!s}),f=h.useMemo(()=>l?r?RE(l,e.identifier):l:null,[l,r,e.identifier]);h.useEffect(()=>{const g=i.current;if(!g||!f)return;let C=null,p=!1;return(async()=>{try{const y=await ui.createConfig(f,o==null?void 0:o.context,{mode:t==="edit"?"edit":"play"});if(p||!i.current)return;const v=ui.createElement(y);C=v,ui.attachEventListeners(v,b=>console.debug("[QumlPlayer] playerEvent",b.detail),b=>console.debug("[QumlPlayer] telemetryEvent",b)),g.innerHTML="",g.appendChild(v)}catch(y){console.error("[QumlPlayer] failed to initialize",y)}})(),()=>{p=!0,C&&(ui.removeEventListeners(C),C.remove()),di.unloadStyles()}},[f,o,t,r]);const m=u?`${n.contentPlayer.unableToLoadQuestionset} ${u.message}`:r&&!s?n.contentPlayer.parentQuestionsetNotResolved:r&&l&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return c.jsxs("div",{className:je.qumlRoot,children:[m?c.jsx(Xh,{message:m}):d||!f?c.jsx(Zh,{node:e,hidden:!1}):null,c.jsx("div",{ref:i,className:je.playerWrapper})]})}const Rt={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 hI(e,t,r){const n=[],o=a=>{var i;for(const s of a)s.isFolder&&s.id!==r&&s.id!==t&&n.push(s),(i=s.children)!=null&&i.length&&o(s.children)};return o(e),n}const pI=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const o=ce(),{treeData:a,moveNode:i}=Ae(),s=hI(a,((f=a[0])==null?void 0:f.id)??"",r),[l,d]=h.useState(null),u=()=>{l&&(i(e,r,l),n())};return c.jsx("div",{className:Rt.overlay,role:"dialog","aria-label":o.resourceReorderDialog.dialogAriaLabel,children:c.jsxs("div",{className:Rt.modal,children:[c.jsxs("div",{className:Rt.header,children:[c.jsxs("span",{children:[o.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),c.jsx("button",{onClick:n,"aria-label":o.resourceReorderDialog.closeAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsxs("div",{className:Rt.body,children:[c.jsx("p",{className:Rt.hint,children:o.resourceReorderDialog.selectUnitHint}),c.jsxs("ul",{className:Rt.list,children:[s.map(m=>c.jsxs("li",{className:`${Rt.item} ${l===m.id?Rt.selected:""}`,onClick:()=>d(m.id),children:[c.jsx(My,{size:14}),c.jsx("span",{children:m.name})]},m.id)),s.length===0&&c.jsx("li",{className:Rt.empty,children:o.resourceReorderDialog.noUnitsAvailable})]})]}),c.jsxs("div",{className:Rt.footer,children:[c.jsx("button",{className:Rt.cancelBtn,onClick:n,children:o.resourceReorderDialog.cancelButton}),c.jsx("button",{className:Rt.moveBtn,onClick:u,disabled:!l,children:o.resourceReorderDialog.moveButton})]})]})})},lr={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 gI(e){const t=[],r=n=>{var o;for(const a of n)!a.isFolder&&(!a.children||a.children.length===0)?t.push(a):(o=a.children)!=null&&o.length&&r(a.children)};return r(e),t}const mI=({onClose:e})=>{const t=ce(),{treeData:r,updateNode:n}=Ae(),o=gI(r),[a,i]=h.useState(()=>Object.fromEntries(o.map(l=>{var d;return[l.id,String(((d=l.metadata)==null?void 0:d.pageNumber)??"")]}))),s=h.useCallback(()=>{for(const[l,d]of Object.entries(a))d!==""&&n(l,{pageNumber:parseInt(d,10)||void 0});e()},[a,n,e]);return c.jsx("div",{className:lr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:c.jsxs("div",{className:lr.modal,children:[c.jsxs("div",{className:lr.header,children:[c.jsx("span",{children:t.assignPageNumber.title}),c.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsx("div",{className:lr.body,children:o.length===0?c.jsx("p",{className:lr.empty,children:t.assignPageNumber.emptyState}):c.jsxs("table",{className:lr.table,children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),c.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),c.jsx("tbody",{children:o.map(l=>c.jsxs("tr",{children:[c.jsx("td",{children:l.name}),c.jsx("td",{children:c.jsx("input",{type:"number",min:1,value:a[l.id]??"",onChange:d=>i(u=>({...u,[l.id]:d.target.value})),className:lr.pageInput})})]},l.id))})]})}),c.jsxs("div",{className:lr.footer,children:[c.jsx("button",{className:lr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),c.jsxs("button",{className:lr.saveBtn,onClick:s,children:[c.jsx(Ry,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},Ge={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"},yI=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var P,M;const{updateNode:o,markDirty:a}=Ae(),i=t==="edit",s=Xa(e),l=ce(),d=ae(L=>L.relationalFormConfig),u=L=>d==null?void 0:d.find(F=>F.code===L),f=L=>!d||!!u(L),m=(L,F)=>{var H;return((H=u(L))==null?void 0:H.label)||F},[g,C]=h.useState(!0),p=((P=e.metadata)==null?void 0:P.relationalMetadata)??{},[y,v]=h.useState(p.name??e.name??""),[b,w]=h.useState(""),[S,T]=h.useState(Array.isArray(p.keywords)?p.keywords:Array.isArray((M=e.metadata)==null?void 0:M.keywords)?e.metadata.keywords:[]),[I,N]=h.useState(!!p.optional);h.useEffect(()=>{var F,H;const L=((F=e.metadata)==null?void 0:F.relationalMetadata)??{};v(L.name??e.name??""),T(Array.isArray(L.keywords)?L.keywords:Array.isArray((H=e.metadata)==null?void 0:H.keywords)?e.metadata.keywords:[]),N(!!L.optional)},[e.id]);const x=()=>{y.trim()&&y!==e.name&&(o(e.id,{name:y.trim()}),a())},B=()=>{const L=b.trim();if(L&&!S.includes(L)){const F=[...S,L];T(F),o(e.id,{keywords:F}),a()}w("")},q=L=>{const F=S.filter(H=>H!==L);T(F),o(e.id,{keywords:F}),a()},k=L=>{N(L),o(e.id,{optional:L}),a()};return c.jsxs("div",{className:Ge.container,children:[c.jsxs("div",{className:Ge.panelHeader,children:[c.jsxs("div",{className:Ge.panelHeaderLeft,children:[c.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),i&&c.jsx("button",{type:"button",className:Ge.moveBtn,onClick:r,children:l.contentEditForm.moveToAnotherUnitButton})]}),c.jsx("button",{type:"button",className:Ge.panelCollapseBtn,onClick:()=>C(L=>!L),"aria-expanded":g,"aria-label":g?l.contentEditForm.collapseMetadataPanelAriaLabel:l.contentEditForm.expandMetadataPanelAriaLabel,title:g?l.contentEditForm.collapseTitle:l.contentEditForm.expandTitle,children:g?c.jsx(Cn,{size:15}):c.jsx(xy,{size:15})})]}),g&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:Ge.titleRow,children:[e.appIcon&&c.jsx("img",{src:e.appIcon,alt:l.contentEditForm.iconAlt,className:Ge.icon}),c.jsx("input",{type:"text",className:Ge.nameInput,value:y,disabled:!i,onChange:L=>v(L.target.value),onBlur:x,placeholder:l.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&c.jsxs("div",{className:Ge.field,children:[c.jsx("div",{className:Ge.fieldHeader,children:c.jsxs("label",{className:Ge.label,children:[m("keywords",l.contentEditForm.keywordsLabel),S.length>0&&c.jsx("span",{className:Ge.fieldCount,children:S.length})]})}),S.length>0&&c.jsx("div",{className:Ge.chips,children:S.map(L=>c.jsxs("span",{className:Ge.chip,children:[L,i&&c.jsx("button",{type:"button",className:Ge.chipRemove,onClick:()=>q(L),children:"×"})]},L))}),i&&c.jsxs("div",{className:Ge.keywordInput,children:[c.jsx("input",{type:"text",className:Ge.input,value:b,placeholder:l.contentEditForm.addKeywordPlaceholder,onChange:L=>w(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),B())}}),c.jsx("button",{type:"button",className:Ge.addBtn,onClick:B,children:l.contentEditForm.addButton})]})]}),f("optional")&&c.jsxs("div",{className:Ge.field,children:[c.jsx("label",{className:Ge.label,children:m("optional",l.contentEditForm.optionalInCollectionLabel)}),c.jsxs("div",{className:Ge.radioGroup,children:[c.jsxs("label",{className:Ge.radioLabel,children:[c.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:I===!0,onChange:()=>k(!0),disabled:!i}),l.contentEditForm.yesOption]}),c.jsxs("label",{className:Ge.radioLabel,children:[c.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:I===!1,onChange:()=>k(!1),disabled:!i}),l.contentEditForm.noOption]})]})]})]}),n]})},$o={iconBtn:"_iconBtn_vl14u_1",editable:"_editable_vl14u_14",iconImg:"_iconImg_vl14u_26",placeholder:"_placeholder_vl14u_34",removeBtn:"_removeBtn_vl14u_41"},vI=({nodeId:e,value:t,editable:r})=>{const[n,o]=h.useState(!1),{updateNode:a,markDirty:i}=Ae(),s=ce(),l=u=>{a(e,{appIcon:u}),i(),o(!1)},d=u=>{u.stopPropagation(),a(e,{appIcon:""}),i()};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:[$o.iconBtn,r?$o.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?s.titleAppIcon.selectAppIconAriaLabel:s.titleAppIcon.appIconAriaLabel,onClick:()=>r&&o(!0),onKeyDown:u=>{r&&(u.key==="Enter"||u.key===" ")&&o(!0)},children:[t?c.jsx("img",{src:t,alt:s.titleAppIcon.appIconAlt,className:$o.iconImg}):c.jsx("div",{className:$o.placeholder,children:c.jsx(Xc,{size:18})}),t&&r&&c.jsx("button",{type:"button",className:$o.removeBtn,onClick:d,"aria-label":s.titleAppIcon.removeIconAriaLabel,children:c.jsx(Zi,{size:11})})]}),n&&c.jsx($h,{nodeId:e,currentValue:t,onSelect:l,onClose:()=>o(!1)})]})},rr={leafContentLayout:"_leafContentLayout_1lchu_1",container:"_container_1lchu_15",emptyState:"_emptyState_1lchu_24",titleRow:"_titleRow_1lchu_34",nodeTitle:"_nodeTitle_1lchu_50",formArea:"_formArea_1lchu_72",contentListArea:"_contentListArea_1lchu_76",dropZone:"_dropZone_1lchu_81",reviewComment:"_reviewComment_1lchu_88",reviewCommentLabel:"_reviewCommentLabel_1lchu_101",reviewCommentText:"_reviewCommentText_1lchu_107"},bI="application/vnd.sunbird.questionset",Jh="application/vnd.sunbird.question",wI=[bI,Jh];function ep(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 CI=({editorMode:e,onToolbarEvent:t})=>{var M;const r=ce(),[n,o]=h.useState("details"),[a,i]=h.useState([]),[s,l]=h.useState(null),[d,u]=h.useState(!1),f=h.useRef(null),m=h.useRef(),{selectedNodeId:g,breadcrumb:C,activeNodeMeta:p,updateNode:y,treeData:v}=Ae(),b=ae(L=>{var F,H,X,ve;return((H=(F=L.editorConfig)==null?void 0:F.context)==null?void 0:H.contentId)??((ve=(X=L.editorConfig)==null?void 0:X.context)==null?void 0:ve.identifier)??""}),w=g?tp(v,g):null,S=!!w&&!w.parent,T=!!(w!=null&&w.isFolder),I=w&&wI.includes(w.mimeType??""),N=(w==null?void 0:w.mimeType)===Jh,x=w&&!w.isFolder&&!I&&!S,B=ep(w)??(S?ep(v[0]):void 0),q=h.useCallback(()=>{const L=f.current;if(!L||!g)return;const F=L.innerText.trim();clearTimeout(m.current),m.current=setTimeout(()=>{y(g,{name:F})},600)},[g,y]),k=h.useCallback(L=>{t({action:"onFormValueChange",data:L})},[t]),P=h.useCallback((L,F)=>{i(F),t({action:"onFormStatusChange",data:{isValid:L,nodeId:g}})},[t,g]);return w?I?c.jsx(Tl,{node:w,editorMode:e,type:"quml",singleQuestion:N}):x?c.jsxs("div",{className:rr.leafContentLayout,children:[c.jsx(Tl,{node:w,editorMode:e,type:"content",layout:"flow"}),c.jsx(yI,{node:w,editorMode:e,onMoveClick:()=>l(w.identifier),reorderDialog:s?c.jsx(pI,{resourceId:s,resourceName:w.name,currentUnitId:w.parent??"",onClose:()=>l(null)}):null})]}):c.jsxs("div",{className:rr.container,children:[c.jsx(u1,{crumbs:C}),B&&c.jsxs("div",{className:rr.reviewComment,role:"alert",children:[c.jsx("span",{className:rr.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),c.jsx("span",{className:rr.reviewCommentText,children:B})]}),c.jsxs("div",{className:rr.titleRow,children:[S&&g&&c.jsx(vI,{nodeId:g,value:String(w.appIcon??((M=w.metadata)==null?void 0:M.appIcon)??""),editable:e==="edit"}),c.jsx("div",{ref:f,className:rr.nodeTitle,contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:q,onBlur:q,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:w.name})]}),c.jsx(f1,{activeTab:n,onChange:L=>o(L),errorTabs:a,visibleTabs:S?void 0:["details"]}),c.jsx("div",{className:rr.formArea,children:c.jsx(CE,{nodeMetadata:p,activeTab:n,isRoot:S,isFolder:T,editorMode:e,onFormValueChange:k,onFormStatusChange:P},`${g??"none"}:${S?"root":"node"}`)}),(T||S)&&n==="details"&&c.jsx("div",{className:rr.contentListArea,children:c.jsx(UE,{editorMode:e})}),c.jsx(VE,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:g??void 0,className:rr.dropZone}),d&&c.jsx(mI,{contentId:b,onClose:()=>u(!1)})]}):c.jsx("div",{className:rr.emptyState,children:c.jsx("p",{children:r.contextualEditor.emptyStateMessage})})};function tp(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=tp(r.children,t);if(n)return n}}}const rp=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 a=[...t().allContent,...r];e({allContent:a,totalCount:n,offset:a.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 a=r;if(n&&n!=="all"){const i=n.toLowerCase();a=a.filter(s=>[s.mimeType??"",s.primaryCategory??"",s.contentType??""].join(" ").toLowerCase().includes(i))}if(o&&o.trim()!==""){const i=o.toLowerCase().trim();a=a.filter(s=>(s.name??"").toLowerCase().includes(i))}e({filteredContent:a})}})),SI=20;function np(){var d;const e=ae(u=>u.editorConfig),t=Ae(u=>u.selectedNodeId),r=Ae(u=>u.treeData),n=h.useCallback(()=>{if(!t||!r.length)return 0;function u(f,m,g=0){var C;for(const p of f){if(p.id===m)return g;if((C=p.children)!=null&&C.length){const y=u(p.children,m,g+1);if(y>=0)return y}}return-1}return Math.max(0,u(r,t))},[t,r])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...Jf];const a=`level${n}`,i=o[a],s=i==null?void 0:i.children,l=s==null?void 0:s.Content;return l!=null&&l.length?l:[...Jf]}function _I(){const e=rp(),t=ae(f=>{var m,g;return((g=(m=f.editorConfig)==null?void 0:m.context)==null?void 0:g.channel)??""}),r=np(),n=h.useRef(),o=h.useCallback(async(f="",m="all",g={},C=!0,p=!1)=>{var y,v,b,w,S;e.setLoading(!0);try{const T={status:["Live"],primaryCategory:m&&m!=="all"?[m]:r};(y=g==null?void 0:g.board)!=null&&y.length&&(T.board=g.board),(v=g==null?void 0:g.medium)!=null&&v.length&&(T.medium=g.medium),(b=g==null?void 0:g.gradeLevel)!=null&&b.length&&(T.gradeLevel=g.gradeLevel),(w=g==null?void 0:g.subject)!=null&&w.length&&(T.subject=g.subject),(S=g==null?void 0:g.primaryCategory)!=null&&S.length&&(T.primaryCategory=g.primaryCategory);const I=C?0:e.offset,{content:N,count:x}=await zE({filters:T,query:f,limit:f?50:SI,offset:I,channel:t||void 0,sortBy:p?{name:"asc"}:{lastUpdatedOn:"desc"}});C?e.setContent(N,x):e.appendContent(N,x)}catch(T){console.error("[useLibrary] load error:",T)}finally{e.setLoading(!1)}},[r,t]);h.useEffect(()=>{o()},[t]);const a=h.useCallback(f=>{e.setSearch(f),clearTimeout(n.current),n.current=setTimeout(()=>o(f,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,o]),i=h.useCallback(f=>{e.setFilter(f),o(e.searchQuery,f,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,o]),s=h.useCallback(f=>{e.setAdvancedFilters(f),o(e.searchQuery,e.activeFilter,f,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,o]),l=h.useCallback(()=>{const f=!e.sortAZ;e.setSortAZ(f),o(e.searchQuery,e.activeFilter,e.advancedFilters,!0,f)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,o]),d=h.useCallback(()=>{e.isLoading||o(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,o]),u=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:u,search:a,setFilter:i,applyAdvancedFilters:s,toggleSort:l,loadMore:d,refetch:()=>o(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ)}}const cr={card:"_card_jzciw_1",addBtn:"_addBtn_jzciw_17",dragging:"_dragging_jzciw_24",ctIcon:"_ctIcon_jzciw_29",info:"_info_jzciw_33",name:"_name_jzciw_41",meta:"_meta_jzciw_50",addBtnMuted:"_addBtnMuted_jzciw_78",added:"_added_jzciw_87",addedBadge:"_addedBadge_jzciw_96"},TI={video:Ji,pdf:ba,h5p:Gi,scorm:Ki,audio:Wi,quiz:Ri,default:Sn},EI=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:o})=>{var y,v;const a=ce(),i=Xa(e),s=TI[i.key]??Sn,l=ol(),d=JT(),u=l&&!o&&d,{attributes:f,listeners:m,setNodeRef:g,isDragging:C}=zc({id:e.identifier,disabled:!n||!l||!d,data:{type:"library-item",item:e}}),p=()=>{r&&r(e)};return c.jsxs("div",{ref:g,className:[cr.card,C?cr.dragging:"",o?cr.added:""].join(" "),"aria-label":e.name,...n?{...f,...m}:{},role:"listitem",onClick:p,children:[c.jsx("span",{className:[`sbx-ct-sq--${i.key}`,cr.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(s,{size:14})}),c.jsxs("div",{className:cr.info,children:[c.jsx("span",{className:cr.name,title:e.name,children:e.name}),c.jsxs("span",{className:cr.meta,children:[((y=e.organisation)==null?void 0:y[0])??e.channel??"",(v=e.organisation)!=null&&v[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]})]}),o&&c.jsx("span",{className:cr.addedBadge,"aria-label":a.libraryCard.alreadyAddedAriaLabel,title:a.libraryCard.alreadyAddedTitle,children:c.jsx(wn,{size:12})}),!o&&n&&c.jsx("button",{type:"button",className:[cr.addBtn,!u&&l?cr.addBtnMuted:""].join(" "),onClick:b=>{b.stopPropagation(),t(e)},disabled:!l,"aria-disabled":!u,"aria-label":a.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:l?d?a.libraryCard.addToUnitTitle:a.libraryCard.selectUnitToAddTitle:a.libraryCard.draftOnlyTitle,children:c.jsx(mo,{size:14})})]})},op={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},II=({filters:e,active:t,onChange:r})=>{const n=ce();return c.jsx("div",{className:op.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(o=>c.jsx("button",{type:"button",role:"radio","aria-checked":t===o.value,className:["sbx-chip",t===o.value?"filled":"outline",op.chip].join(" "),onClick:()=>r(o.value),children:o.label},o.value))})},st={panel:"_panel_1cl11_1",header:"_header_1cl11_10",headerTitle:"_headerTitle_1cl11_19",closeBtn:"_closeBtn_1cl11_25",body:"_body_1cl11_43",section:"_section_1cl11_59",sectionLabel:"_sectionLabel_1cl11_65",chips:"_chips_1cl11_73",chip:"_chip_1cl11_73",active:"_active_1cl11_96",footer:"_footer_1cl11_102",resetBtn:"_resetBtn_1cl11_112",applyBtn:"_applyBtn_1cl11_129"},OI=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}],AI=new Set(["board","medium","gradeLevel","subject","topic"]),DI=({local:e,toggle:t})=>{const r=ce(),n=np();return n.length?c.jsxs("div",{className:st.section,children:[c.jsx("div",{className:st.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),c.jsx("div",{className:st.chips,children:n.map(o=>c.jsx("button",{type:"button",className:[st.chip,(e.primaryCategory??[]).includes(o)?st.active:""].join(" "),onClick:()=>t("primaryCategory",o),children:o},o))})]}):null},NI=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var y,v;const o=ce(),a=ae(b=>b.editorConfig),i=ae(b=>b.searchFormConfig),s=ae(b=>b.contentFramework),l=ae(b=>b.contentTargetFWIds),{organisationFramework:d}=wl(s??((y=a==null?void 0:a.context)==null?void 0:y.framework),l??((v=a==null?void 0:a.context)==null?void 0:v.targetFWIds)),[u,f]=h.useState(t),m=i!=null&&i.length?i.filter(b=>AI.has(b.code)).map(b=>({key:b.code,label:b.label||b.code})):OI(o);h.useEffect(()=>{f(t)},[t]);const g=(b,w)=>{f(S=>{const T=S[b]??[],I=T.includes(w)?T.filter(N=>N!==w):[...T,w];return{...S,[b]:I}})},C=(d==null?void 0:d.categories)??[],p=b=>{var w;return((w=C.find(S=>S.code===b))==null?void 0:w.terms)??[]};return e?c.jsxs("div",{className:st.panel,role:"dialog","aria-label":o.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[c.jsxs("div",{className:st.header,children:[c.jsx("span",{className:st.headerTitle,children:o.libraryFilterPanel.filtersHeaderTitle}),c.jsx("button",{type:"button",className:st.closeBtn,onClick:n,"aria-label":o.libraryFilterPanel.closeFiltersAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsxs("div",{className:st.body,children:[m.map(({key:b,label:w})=>{const S=p(b);return S.length?c.jsxs("div",{className:st.section,children:[c.jsx("div",{className:st.sectionLabel,children:w}),c.jsx("div",{className:st.chips,children:S.slice(0,20).map(T=>c.jsx("button",{type:"button",className:[st.chip,(u[b]??[]).includes(T.name)?st.active:""].join(" "),onClick:()=>g(b,T.name),children:T.name},T.identifier))})]},b):null}),c.jsx(DI,{local:u,toggle:g})]}),c.jsxs("div",{className:st.footer,children:[c.jsx("button",{type:"button",className:st.resetBtn,onClick:()=>f({}),children:o.libraryFilterPanel.resetButton}),c.jsx("button",{type:"button",className:st.applyBtn,onClick:()=>{r(u),n()},children:o.libraryFilterPanel.applyButton})]})]}):null},vr={header:"_header_6qdpu_10",title:"_title_6qdpu_20",headerActions:"_headerActions_6qdpu_31",iconBtn:"_iconBtn_6qdpu_38",playerArea:"_playerArea_6qdpu_56",footer:"_footer_6qdpu_64",addBtn:"_addBtn_6qdpu_73",modalOverlay:"_modalOverlay_6qdpu_92",modalPanel:"_modalPanel_6qdpu_103"},kI="application/vnd.sunbird.questionset",xI=({content:e,editorMode:t,onAdd:r,onClose:n})=>{const o=ce(),a=t==="edit";if(!e)return null;const i={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 Pe.createPortal(c.jsx("div",{className:vr.modalOverlay,role:"dialog","aria-modal":"true","aria-label":o.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:c.jsxs("div",{className:vr.modalPanel,onClick:s=>s.stopPropagation(),children:[c.jsxs("div",{className:vr.header,children:[c.jsx("span",{className:vr.title,title:e.name,children:e.name}),c.jsx("div",{className:vr.headerActions,children:c.jsx("button",{type:"button",className:vr.iconBtn,onClick:n,"aria-label":o.libraryPreviewPanel.closePreviewAriaLabel,children:c.jsx(yr,{size:16})})})]}),c.jsx("div",{className:vr.playerArea,children:c.jsx(Tl,{node:i,editorMode:"read",type:e.mimeType===kI?"quml":"content"})}),a&&c.jsx("div",{className:vr.footer,children:c.jsx("button",{type:"button",className:vr.addBtn,onClick:()=>r(e),children:o.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},Ue={dock:"_dock_1lpg0_1",header:"_header_1lpg0_8",headerLeft:"_headerLeft_1lpg0_17",headerTitle:"_headerTitle_1lpg0_24",count:"_count_1lpg0_30",searchRow:"_searchRow_1lpg0_39",searchWrap:"_searchWrap_1lpg0_47",searchIcon:"_searchIcon_1lpg0_53",searchInput:"_searchInput_1lpg0_62",filterToggleBtn:"_filterToggleBtn_1lpg0_80",filterToggleBtnActive:"_filterToggleBtnActive_1lpg0_99",filterBadge:"_filterBadge_1lpg0_105",filters:"_filters_1lpg0_124",mainArea:"_mainArea_1lpg0_134",sidePanelOverlay:"_sidePanelOverlay_1lpg0_143",cardList:"_cardList_1lpg0_152",skeleton:"_skeleton_1lpg0_168",skeletonIcon:"_skeletonIcon_1lpg0_178",skeletonText:"_skeletonText_1lpg0_186",skeletonLine:"_skeletonLine_1lpg0_193",skeletonLineSm:"_skeletonLineSm_1lpg0_200",loadMoreBtn:"_loadMoreBtn_1lpg0_215",emptyState:"_emptyState_1lpg0_240",collapseBtn:"_collapseBtn_1lpg0_260"};function LI(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 PI=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ce(),{content:o,isLoading:a,totalCount:i,activeFilter:s,searchQuery:l,sortAZ:d,hasMore:u,search:f,setFilter:m,applyAdvancedFilters:g,toggleSort:C,loadMore:p}=_I(),{addResource:y,selectedNodeId:v,treeData:b}=Ae(),w=e==="edit",[S,T]=h.useState(!1),[I,N]=h.useState({}),[x,B]=h.useState(null),q=h.useMemo(()=>LI(b),[b]),k=h.useCallback(H=>{var Ee;if(!v){Ie.error(n.libraryDock.selectUnitFirstToast);return}const X=(Ee=b[0])==null?void 0:Ee.id;if(v===X){Ie(n.libraryDock.selectUnitFromOutlineToast,{icon:c.jsx(Qi,{size:16}),duration:4e3});return}if(y(H,v)===!1){Ie.error(n.libraryDock.itemAlreadyAddedToast.replace("{name}",H.name));return}Ie.success(n.libraryDock.itemAddedToast.replace("{name}",H.name))},[v,y,b,n]),P=h.useCallback(H=>{N(H),g(H)},[g]),M=h.useCallback(H=>{B(H)},[]),L=h.useCallback(H=>{k(H),B(null)},[k]),F=h.useMemo(()=>Object.values(I).reduce((H,X)=>H+((X==null?void 0:X.length)??0),0),[I]);return c.jsxs("div",{className:Ue.dock,children:[c.jsx("div",{className:Ue.header,children:c.jsxs("div",{className:Ue.headerLeft,children:[c.jsx("button",{type:"button",className:Ue.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:c.jsx(zy,{size:15})}),c.jsx(qy,{size:16}),c.jsx("span",{className:Ue.headerTitle,children:n.libraryDock.headerTitle}),i>0&&c.jsx("span",{className:Ue.count,children:i})]})}),c.jsxs("div",{className:Ue.searchRow,children:[c.jsxs("div",{className:Ue.searchWrap,children:[c.jsx(Yi,{size:14,className:Ue.searchIcon}),c.jsx("input",{type:"search",className:Ue.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:l,onChange:H=>f(H.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),c.jsx("button",{type:"button",className:[Ue.filterToggleBtn,d?Ue.filterToggleBtnActive:""].join(" "),onClick:C,"aria-label":d?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:d?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:d?c.jsx(Dy,{size:15}):c.jsx(Py,{size:15})}),c.jsxs("button",{type:"button",className:[Ue.filterToggleBtn,S?Ue.filterToggleBtnActive:""].join(" "),onClick:()=>T(H=>!H),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":S,title:n.libraryDock.advancedFiltersTitle,children:[c.jsx(Yy,{size:15}),F>0&&c.jsx("span",{className:Ue.filterBadge,children:F})]})]}),c.jsx("div",{className:Ue.filters,children:c.jsx(II,{filters:e1,active:s,onChange:m})}),c.jsxs("div",{className:Ue.mainArea,children:[c.jsx("div",{className:Ue.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:a&&o.length===0?Array.from({length:4}).map((H,X)=>c.jsxs("div",{className:Ue.skeleton,"aria-hidden":"true",children:[c.jsx("div",{className:Ue.skeletonIcon}),c.jsxs("div",{className:Ue.skeletonText,children:[c.jsx("div",{className:Ue.skeletonLine}),c.jsx("div",{className:Ue.skeletonLineSm})]})]},X)):o.length>0?c.jsxs(c.Fragment,{children:[o.map(H=>c.jsx(EI,{item:H,onAdd:k,onPreview:M,isDraggable:w,isAdded:q.has(H.identifier)},H.identifier)),u&&c.jsx("button",{type:"button",className:Ue.loadMoreBtn,onClick:p,disabled:a,"aria-label":n.libraryDock.loadMoreAriaLabel,children:a?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):c.jsxs("div",{className:Ue.emptyState,children:[c.jsx(Yi,{size:24}),c.jsx("p",{children:n.libraryDock.noContentFound}),c.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})}),S&&c.jsx("div",{className:Ue.sidePanelOverlay,children:c.jsx(NI,{isOpen:S,filters:I,onApply:P,onClose:()=>T(!1)})}),x&&c.jsx(xI,{content:x,editorMode:e,onAdd:L,onClose:()=>B(null)})]})]})};function FI(e,t,r){const n={},o={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),s=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","dialcodes"]),l=new Set(["copyrightYear","compatibilityLevel","version"]);function d(m,g=!1){const C={};for(const[p,y]of Object.entries(m))if(!a.has(p)&&!(g&&i.has(p)))if(s.has(p))Array.isArray(y)?C[p]=y:y!=null&&y!==""?C[p]=[y]:C[p]=[];else if(l.has(p)){const v=Number(y);isNaN(v)||(C[p]=v)}else C[p]=y;return C}function u(m){var C;const g={};for(const p of m.children??[]){if(p.isFolder)continue;const y=t[p.identifier];if(!y)continue;const{isNew:v,...b}=y;if(Object.keys(b).length===0)continue;const w=((C=p.metadata)==null?void 0:C.relationalMetadata)??{};g[p.identifier]={name:p.name,...w,...b}}return g}function f(m,g){var w,S;const C=m.identifier,p=t[C],y=C.startsWith("temp-")||!!(p!=null&&p.isNew),v=!m.isFolder&&!g;if(g||y||p&&!v){let T;if(y)T={mimeType:"application/vnd.ekstep.content-collection",code:C,contentType:((w=m.metadata)==null?void 0:w.contentType)??"CourseUnit",primaryCategory:((S=m.metadata)==null?void 0:S.primaryCategory)??"Course Unit",name:m.name,visibility:"Parent",channel:r,...d(m.metadata??{})};else if(g){const{isNew:I,...N}=p??{};T={...d(m.metadata??{},!0),...d(N,!1),name:m.name}}else{const{isNew:I,...N}=p??{};T={name:m.name,visibility:"Parent",...d(N,!0)}}n[C]={metadata:T,objectType:m.objectType||(m.isFolder?"Collection":"Content"),root:g,isNew:y}}const b=m.isFolder?u(m):{};o[C]={name:m.name,children:(m.children??[]).map(T=>T.identifier),...Object.keys(b).length>0?{relationalMetadata:b}:{},root:g},(m.children??[]).forEach(T=>f(T,!1))}return e.forEach((m,g)=>f(m,g===0)),{nodesModified:n,hierarchy:o}}function MI(){const[e,t]=h.useState(!1),r=Ae(u=>u.treeCache),n=Ae(u=>u.treeData),o=ae(u=>u.isDirty),a=ae(u=>u.lastSaved),{setIsDirty:i,setLastSaved:s}=ae(),l=ae(u=>u.editorConfig);return{save:h.useCallback(async()=>{if(!l||e)return;const u=l.context.contentId??l.context.identifier??"";if(!u)return;const f=l.context.channel??"",m=l.context.userId??l.context.uid??"";t(!0);try{const{nodesModified:g,hierarchy:C}=FI(n,r,f),{identifiers:p}=await Ew(u,g,C,m);p&&Object.keys(p).length>0&&Ae.getState().replaceNodeIds(p);const y=new Date().toISOString();s(y),i(!1)}catch(g){console.error("[useSaveHierarchy] save failed:",g),Ie.error("Failed to save. Please try again.")}finally{t(!1)}},[l,e,n,r,i,s]),isSaving:e,isDirty:o,lastSaved:a}}const $I={};function BI(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function jI(e,t,r,n,o,a=$I){const i=[],s=(l,d)=>{var u;for(const f of l){const m=d&&!f.parent,g=m?r:f.isFolder?n:null;if(g&&g.length>0){const C={...f.metadata??{},...t[f.id]??{}},y=Nh(g,C,a,m,o).filter(v=>v.required&&v.visible!==!1&&v.inputType!=="appIcon"&&BI(v.currentValue)).map(v=>v.label);y.length>0&&i.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:y})}(u=f.children)!=null&&u.length&&s(f.children,!1)}};return s(e,!0),i}function qI(e){var p,y;const t=ae(v=>v.editorConfig),r=ae(v=>v.setButtonLoader),n=ae(v=>v.validateAllForms),o=ae(v=>v.rootFormConfig),a=ae(v=>v.unitFormConfig),i=Ae(v=>v.treeData),s=Ae(v=>v.treeCache),l=Ae(v=>v.selectNode),d=ae(v=>v.contentFramework),u=ae(v=>v.contentTargetFWIds),{organisationFramework:f,targetFrameworks:m}=wl(d??((p=t==null?void 0:t.context)==null?void 0:p.framework),u??((y=t==null?void 0:t.context)==null?void 0:y.targetFWIds)),g=h.useCallback(()=>{var T,I,N;const v={editorMode:"edit",objectType:(T=t==null?void 0:t.config)==null?void 0:T.objectType,userFullName:(N=(I=t==null?void 0:t.context)==null?void 0:I.user)==null?void 0:N.fullName},b=jI(i,s,o,a,v,{organisationFramework:f,targetFrameworks:m});if(b.length===0)return!0;const w=b[0];Ie.error(`"${w.nodeName}": please fill required field${w.missing.length>1?"s":""} — ${w.missing.join(", ")}`);const{setFormStatus:S}=ae.getState();return b.forEach(x=>S(x.nodeId,!1)),l(w.nodeId),!1},[i,s,o,a,t,l,f,m]);return{runAction:h.useCallback(async(v,b)=>{var T,I,N,x;const w=((T=t==null?void 0:t.context)==null?void 0:T.contentId)??((I=t==null?void 0:t.context)==null?void 0:I.identifier)??"";if(!w)return Ie.error("No content identifier found."),!1;const S=((N=t==null?void 0:t.context)==null?void 0:N.userId)??((x=t==null?void 0:t.context)==null?void 0:x.uid)??"";try{switch(v){case"sendForReview":return g()?n(i)?(r("saveCollection",!0),await e(),await Aw(w),Ie.success("Content sent for review"),!0):(Ie.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{r("rejectCollection",!0);const B=(b==null?void 0:b.comment)??"";return await Dw(w,B),Ie.success("Content rejected and sent back to the author"),!0}case"publish":return g()?n(i)?(r("publishCollection",!0),await e(),await Iw(w,S),Ie.success("Content published successfully"),!0):(Ie.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(B){console.error(`[useToolbarActions] ${v} failed`,B);const q=v==="sendForReview"?"send for review":v==="reject"?"reject":"publish";return Ie.error(`Failed to ${q}. Please try again.`),!1}finally{r("saveCollection",!1),r("rejectCollection",!1),r("publishCollection",!1)}},[t,e,r,g,n,i]),checkRequiredFields:g}}const Bt={shell:"_shell_90fon_1",workspace:"_workspace_90fon_8",sidebarCollapsed:"_sidebarCollapsed_90fon_16",dockCollapsed:"_dockCollapsed_90fon_19",dock:"_dock_90fon_19",outline:"_outline_90fon_40",reopenTab:"_reopenTab_90fon_45",outlineHidden:"_outlineHidden_90fon_79",editor:"_editor_90fon_86",dockHidden:"_dockHidden_90fon_101",dockReopenTab:"_dockReopenTab_90fon_108",dragChip:"_dragChip_90fon_133",dragChipLabel:"_dragChipLabel_90fon_148"},UI=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const o=ce(),[a,i]=h.useState(null),[s,l]=h.useState(!1),[d,u]=h.useState(!1),[f,m]=h.useState(!1),{addResource:g,treeData:C}=Ae(),p=ae(F=>F.setFormStatus),[y,v]=h.useState(!0),b=Ae(F=>F.selectedNodeId),{save:w,isSaving:S,isDirty:T,lastSaved:I}=MI(),{runAction:N,checkRequiredFields:x}=qI(w);h.useEffect(()=>{if(!T)return;const F=H=>{H.preventDefault(),H.returnValue=""};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[T]);const B=uc(Pi(pa,{activationConstraint:{distance:8}})),q=h.useCallback(F=>{var X;const H=(X=F.active.data.current)==null?void 0:X.item;H&&i(H)},[]),k=h.useCallback(F=>{var ue,Q;i(null);const H=(ue=F.active.data.current)==null?void 0:ue.item;if(!H)return;const X=F.over,ve=(X==null?void 0:X.id)??b??void 0;if(!ve){Ie.error(o.splitBuilderShell.dropOntoUnitError);return}const Ee=(Q=C[0])==null?void 0:Q.id;if(ve===Ee){Ie.error(o.splitBuilderShell.dropOntoCourseError);return}if(!g(H,ve)){Ie.error(o.splitBuilderShell.alreadyInCollectionError.replace("{name}",H.name));return}r==null||r(H,ve),Ie.success(o.splitBuilderShell.addedToUnitSuccess.replace("{name}",H.name))},[b,g,r,o]),P=h.useCallback(async F=>{if(F.action==="onFormStatusChange"){const{isValid:H,nodeId:X}=F.data??{},ve=H!==!1;v(ve),X&&p(X,ve);return}if(F.action==="back"&&T&&e==="edit"){m(!0);return}if(F.action==="saveCollection"){if(!y){Ie.error(o.splitBuilderShell.fillRequiredMetadataError);return}if(!x())return;await w(),n==null||n(C),t==null||t(F);return}if(F.action==="sendForReview"||F.action==="reject"||F.action==="publish"){await N(F.action,F.data)&&(t==null||t(F));return}t==null||t(F)},[w,N,x,t,n,C,T,y,e,o]),M=h.useCallback(async()=>{if(!x()){m(!1);return}await w(),m(!1),n==null||n(C),t==null||t({action:"back"})},[w,x,n,t,C]),L=h.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return c.jsxs(Uc,{sensors:B,onDragStart:q,onDragEnd:k,children:[c.jsxs("div",{className:Bt.shell,children:[c.jsx(qw,{editorMode:e,isSaving:S,isDirty:T,lastSaved:I,isFormValid:y,onToolbarEvent:P}),c.jsxs("div",{className:[Bt.workspace,s?Bt.sidebarCollapsed:"",d?Bt.dockCollapsed:""].filter(Boolean).join(" "),children:[c.jsx("aside",{className:[Bt.outline,s?Bt.outlineHidden:""].join(" "),"aria-label":o.splitBuilderShell.outlineAriaLabel,"aria-hidden":s,children:c.jsx(d1,{editorMode:e,collapsed:s,onToggleCollapse:()=>l(F=>!F)})}),s&&c.jsx("button",{className:Bt.reopenTab,onClick:()=>l(!1),title:o.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),c.jsx("main",{className:Bt.editor,role:"main","aria-label":o.splitBuilderShell.editorAriaLabel,children:c.jsx(CI,{editorMode:e,onToolbarEvent:P})}),c.jsx("aside",{className:[Bt.dock,d?Bt.dockHidden:""].filter(Boolean).join(" "),"aria-label":o.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:c.jsx(PI,{editorMode:e,collapsed:d,onToggleCollapse:()=>u(F=>!F)})}),d&&c.jsx("button",{className:Bt.dockReopenTab,onClick:()=>u(!1),title:o.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),c.jsx(Ty,{dropAnimation:null,children:a?c.jsx("div",{className:Bt.dragChip,children:c.jsx("span",{className:Bt.dragChipLabel,children:a.name})}):null}),f&&c.jsx(Uw,{onSave:M,onDiscard:L,onCancel:()=>m(!1),isSaving:S})]})},VI="v1";function zI(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 ap(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:zI(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 Lr(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,a=n.fields.filter(i=>!!i.code).sort((i,s)=>(i.index??0)-(s.index??0));for(const i of a)r.push(ap(i,o))}else n.code&&r.push(ap(n));return r}function HI(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 RI(e,t,r="Collection",n=VI){var d,u;const a=(u=(d=(await ke.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,i=(a==null?void 0:a.forms)??{},s=(a==null?void 0:a.objectMetadata)??{},l=s.config??{};return{rootForm:Lr(i.create),unitForm:Lr(i.unitMetadata),childForm:Lr(i.childMetadata),searchForm:Lr(i.search??i.searchConfig),relationalForm:Lr(i.relationalMetadata),publishChecklist:Lr(i.publishchecklist),reviewChecklist:Lr(i.review),rfcChecklist:Lr(i.requestforchangeschecklist),schemaDefaults:HI(s.schema),frameworkMetadata:l.frameworkMetadata??{},sourcingSettings:l.sourcingSettings??{}}}function ip(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function QI({config:e,onError:t}){const[r,n]=h.useState(!0),[o,a]=h.useState(null),[i,s]=h.useState(!1),{setEditorConfig:l,setEditorMode:d,setCategoryDefinition:u,setContentFramework:f}=ae(),{setTreeData:m,selectNode:g}=Ae();return h.useEffect(()=>{let C=!1;async function p(){var y,v,b;try{n(!0),a(null),e.apiBaseUrl&&ou(e.apiBaseUrl),l(e),d(e.config.mode);const w=e.context.contentId??e.context.identifier??"",S=e.context.channel??"";let T;if(S)try{T=(y=await Ah(S))==null?void 0:y.defaultFramework}catch{}let I=!1;if(w){const N=e.config.objectType==="QuestionSet",{rootNode:x}=N?await Tw(w):await lu(w);if(!C&&(m(x?[x]:[]),x)){g(x.id);const{framework:M,targetFWIds:L}=ip(x.metadata??{},T,e.context);f(M,L),I=!0}const B=e.config.primaryCategory??"Course",q=e.context.channel??"",k=e.config.categoryDefinitionApiVersion??"v1";try{const P=await RI(B,q,e.config.objectType??"Collection",k);if(!C){u(P);const M=((v=P.sourcingSettings)==null?void 0:v.collection)??{},L={};M.maxDepth&&!e.config.maxDepth&&(L.maxDepth=M.maxDepth),M.children&&!e.config.children&&(L.children=M.children),M.hierarchy&&!((b=e.config.hierarchy)!=null&&b.level1)&&(L.hierarchy={...e.config.hierarchy??{},...M.hierarchy}),Object.keys(L).length>0&&l({...e,config:{...e.config,...L}})}}catch{}}if(!C&&!I){const{framework:N,targetFWIds:x}=ip({},T,e.context);f(N,x)}C||s(!0)}catch(w){if(!C){const S=w instanceof Error?w:new Error(String(w));a(S),t==null||t(S)}}finally{C||n(!1)}}return p(),()=>{C=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:o,isReady:i}}function GI(){const e=yd(t=>t.setLanguage);h.useEffect(()=>{e(localStorage.getItem(ls)||"en",{broadcast:!1});const t=n=>{n.key===ls&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var a;const o=(a=n.detail)==null?void 0:a.lang;o&&e(o,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(cs,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(cs,r)}},[e])}const Bo={root:"_root_qcpw6_1",loadingState:"_loadingState_qcpw6_10",loadingSpinner:"_loadingSpinner_qcpw6_20",errorState:"_errorState_qcpw6_34"},WI=new Yp({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function KI({error:e,onRetry:t}){const r=ce();return c.jsxs("div",{className:Bo.errorState,children:[c.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),c.jsx("p",{children:e.message}),c.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class YI 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?c.jsx(KI,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function ZI(e){GI();const t=ce(),{isLoading:r,error:n}=QI({config:e,onError:e.onError}),o=ae(a=>a.editorMode);return r?c.jsxs("div",{className:Bo.loadingState,children:[c.jsx("div",{className:Bo.loadingSpinner}),c.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?c.jsxs("div",{className:Bo.errorState,children:[c.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),c.jsx("p",{children:n.message})]}):c.jsx("div",{className:`sb-split-builder ${Bo.root}`,children:c.jsx(UI,{editorMode:o,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const sp=e=>c.jsx(YI,{onError:e.onError,children:c.jsxs(Xp,{client:WI,children:[c.jsx(ZI,{...e}),c.jsx(Zg,{position:"top-right",toastOptions:{duration:3e3}})]})}),fi=Symbol.for("r2wc.reactRender"),lp=Symbol.for("r2wc.shouldRender"),hi=Symbol.for("r2wc.root");function XI(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function JI(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var cp={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[fi]()}}),e[fi]()}};function eO(e,t,r,n={}){var o={isConnected:"isConnected"in HTMLElement.prototype},a=!1,i=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},s=Object.create(HTMLElement.prototype);s.constructor=i;var l=new Proxy(s,{has:function(d,u){return u in e.propTypes||u in s},set:function(d,u,f,m){return a&&(o[u]=!0),typeof u=="symbol"||o[u]||u in d?(e.propTypes&&u in e.propTypes&&cp.expando(m,u,f),Reflect.set(d,u,f,m)):(cp.expando(m,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 i.prototype=l,s.connectedCallback=function(){this[lp]=!0,this[fi]()},s.disconnectedCallback=function(){typeof r.createRoot=="function"?this[hi].unmount():r.unmountComponentAtNode(this)},s[fi]=function(){if(this[lp]===!0){var d={};Object.keys(this).forEach(function(m){o[m]!==!1&&(d[m]=this[m])},this),a=!0;const u=n.shadow?this.shadowRoot:this,f=t.createElement(e,d);typeof r.createRoot=="function"?(this[hi]||(this[hi]=r.createRoot(u)),this[hi].render(f)):r.render(f,u),a=!1}},e.propTypes&&(i.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return XI(d)}):Object.keys(e.propTypes),s.attributeChangedCallback=function(d,u,f){var m=n.dashStyleAttributes?JI(d):d;this[m]=f}),i}var jo={},qo=Pe;if(process.env.NODE_ENV==="production")jo.createRoot=qo.createRoot,jo.hydrateRoot=qo.hydrateRoot;else{var pi=qo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;jo.createRoot=function(e,t){pi.usingClientEntryPoint=!0;try{return qo.createRoot(e,t)}finally{pi.usingClientEntryPoint=!1}},jo.hydrateRoot=function(e,t,r){pi.usingClientEntryPoint=!0;try{return qo.hydrateRoot(e,t,r)}finally{pi.usingClientEntryPoint=!1}}}function tO(){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=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function rO(e="sb-collection-editor"){if(tO(),typeof customElements>"u"||customElements.get(e))return;const t=eO(sp,h,jo,{});customElements.define(e,t)}me.CollectionEditor=sp,me.registerCollectionEditor=rO,me.setApiBaseUrl=ou,me.useEditorStore=ae,me.useLibraryStore=rp,me.useTreeStore=Ae,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
528
+ */var kd;function Gy(){return kd||(kd=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=vi(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,o=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;yi.useSyncExternalStoreWithSelector=function(d,u,f,m,g){var b=o(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=i(function(){function y(A){if(!C){if(C=!0,S=A,A=m(A),g!==void 0&&h.hasValue){var L=h.value;if(g(L,A))return w=L}return w=A}if(L=w,n(S,A))return L;var E=m(A);return g!==void 0&&g(L,E)?(S=A,L):(S=A,w=E)}var C=!1,S,w,T=f===void 0?null:f;return[function(){return y(u())},T===null?void 0:function(){return y(T())}]},[u,f,m,g]);var v=s(d,b[0],b[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())})()),yi}var Dd;function Ky(){return Dd||(Dd=1,process.env.NODE_ENV==="production"?qo.exports=Ry():qo.exports=Gy()),qo.exports}var Yy=Ky();const Zy=hi(Yy),Ld={},{useDebugValue:Xy}=p,{useSyncExternalStoreWithSelector:Jy}=Zy;let Od=!1;const eb=e=>e;function tb(e,t=eb,r){(Ld?"production":void 0)!=="production"&&r&&!Od&&(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"),Od=!0);const n=Jy(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Xy(n),n}const Nd=e=>{(Ld?"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"?Hy(e):e,r=(n,s)=>tb(t,n,s);return Object.assign(r,t),r},As=e=>e?Nd(e):Nd,bi={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}},rb={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}};function nb(e){return e.config.primaryCategory==="Learning Path"?rb:bi}const Y=As(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:bi,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=Y.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}})})),sb=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:Y},Symbol.toStringTag,{value:"Module"})),Fr=As(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t})})),Ci={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:{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",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",removeAssessmentSlotButton:"Remove",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?",courseNameUnavailable:"Course details unavailable",notAssessmentCourseToast:`"{name}" isn't a question-set-only course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",assessmentCheckFailedToast:"Could not verify this course. Please try again.",skillsHeading:"Skills",skillsOutOfScopeWarning:"Out of scope, please re-select: {skills}",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:",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 course whose only content is a question set — no other content types belong here.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",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.",coursesRemovedFrameworkChangeToast:"{count} course(s) tagged to a different curriculum were removed from this path."}},ob={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:{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:"طي المكتبة",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} — مقرر يحتوي على بنك أسئلة فقط",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقررًا يحتوي على بنك أسئلة فقط، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",assessmentCheckFailedToast:"تعذر التحقق من هذا المقرر. حاول مرة أخرى.",skillsHeading:"المهارات",skillsOutOfScopeWarning:"خارج النطاق، يرجى إعادة الاختيار: {skills}",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:"حل هذه النقاط قبل النشر:",assessmentsCardHeading:"التقييم المسبق وتقييم النتائج",assessmentsCardDescription:"أضف المقررات التي تحتوي على بنك أسئلة فقط والتي تفتح وتغلق هذا المسار.",assessmentNotAddedYet:"لم تتم إضافته بعد — اختر مقررًا يحتوي على بنك أسئلة فقط من المكتبة.",viewCourseMenuItem:"عرض",priorAssessmentExplainerTitle:"لماذا لا يمكن تخطي هذا",priorAssessmentExplainerBody:"درجة بنك الأسئلة هذا هي ما يعتمد عليه كل مستوى لتحديد التخطي — ولا يوجد حتى الآن ما يُقارن به، لذا يُنفَّذ بالكامل دائمًا.",priorAssessmentPurposeLabel:"يحدد خط أساس المهارة",outcomeAssessmentExplainerTitle:"يُغلق المسار",outcomeAssessmentExplainerBody:"النجاح في بنك الأسئلة هذا هو ما يُصادق على اكتساب المهارة للمسار بأكمله — ودرجته هي ما تظهر في شهادة المتعلم.",outcomeUnlocksHint:"يُفتح بعد المستوى الأخير",assessmentCourseSectionTitle:"المقرر",assessmentCourseSectionDescription:"مقرر واحد يكون محتواه الوحيد بنك أسئلة — لا تنتمي هنا أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج",noCurriculumEmptyHint:"حدد منهجًا لهذا المسار لتصفح المقررات.",noSkillsEmptyTitle:"لم يتم تحديد مهارات",noSkillsEmptyHint:"حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار."}},ab={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:{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",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",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 ?",courseNameUnavailable:"Détails du cours indisponibles",notAssessmentCourseToast:"« {name} » n'est pas un cours composé uniquement d'un questionnaire, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",assessmentCheckFailedToast:"Impossible de vérifier ce cours. Veuillez réessayer.",skillsHeading:"Compétences",skillsOutOfScopeWarning:"Hors du périmètre, veuillez resélectionner : {skills}",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 :",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 dont le seul contenu est un questionnaire — aucun autre type de contenu n'a sa place ici.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",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.",coursesRemovedFrameworkChangeToast:"{count} cours associé(s) à un autre curriculum ont été retirés de ce parcours."}},ib={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:{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",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",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?",courseNameUnavailable:"Detalhes do curso indisponíveis",notAssessmentCourseToast:'"{name}" não é um curso composto somente por um banco de questões, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",assessmentCheckFailedToast:"Não foi possível verificar este curso. Tente novamente.",skillsHeading:"Habilidades",skillsOutOfScopeWarning:"Fora do escopo, selecione novamente: {skills}",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:",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 cujo único conteúdo é um banco de questões — nenhum outro tipo de conteúdo pertence aqui.",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",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.",coursesRemovedFrameworkChangeToast:"{count} curso(s) vinculados a outro currículo foram removidos desta trilha."}},lb=["ar"],cb={en:Ci,ar:ob,fr:ab,pt:ib};function Pd(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]=Pd(s,o):o!==void 0&&(r[n]=o)}return r}function xd(e){const t=cb[e];return!t||e==="en"?Ci:Pd(Ci,t)}function db(e){return lb.includes(e)}const Si="app-language",wi="app-language-change",_i=As(e=>({lang:"en",labelConfig:xd("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:xd(t)}),localStorage.setItem(Si,t),document.documentElement.setAttribute("dir",db(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(wi,{detail:{lang:t}}))}}));function Fd(e,t){return function(){return e.apply(t,arguments)}}const{toString:ub}=Object.prototype,{getPrototypeOf:kn}=Object,{iterator:Is,toStringTag:Md}=Symbol,Uo=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ks=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Uo(r,t))return!0;r=kn(r)}return!1},fb=(e,t)=>e!=null&&ks(e,t)?e[t]:void 0,Ti=(e=>t=>{const r=ub.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),or=e=>(e=e.toLowerCase(),t=>Ti(t)===e),zo=e=>t=>typeof t===e,{isArray:en}=Array,Dn=zo("undefined");function Ln(e){return e!==null&&!Dn(e)&&e.constructor!==null&&!Dn(e.constructor)&&Ft(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $d=or("ArrayBuffer");function hb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$d(e.buffer),t}const pb=zo("string"),Ft=zo("function"),Bd=zo("number"),On=e=>e!==null&&typeof e=="object",gb=e=>e===!0||e===!1,Vo=e=>{if(!On(e))return!1;const t=kn(e);return(t===null||t===Object.prototype||kn(t)===null)&&!ks(e,Md)&&!ks(e,Is)},mb=e=>{if(!On(e)||Ln(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},vb=or("Date"),yb=or("File"),bb=e=>!!(e&&typeof e.uri<"u"),Cb=e=>e&&typeof e.getParts<"u",Sb=or("Blob"),wb=or("FileList"),_b=e=>On(e)&&Ft(e.pipe);function Tb(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const qd=Tb(),jd=typeof qd.FormData<"u"?qd.FormData:void 0,Eb=e=>{if(!e)return!1;if(jd&&e instanceof jd)return!0;const t=kn(e);if(!t||t===Object.prototype||!Ft(e.append))return!1;const r=Ti(e);return r==="formdata"||r==="object"&&Ft(e.toString)&&e.toString()==="[object FormData]"},Ab=or("URLSearchParams"),[Ib,kb,Db,Lb]=["ReadableStream","Request","Response","Headers"].map(or),Ob=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ds(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),en(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Ln(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 Ud(e,t){if(Ln(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 tn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zd=e=>!Dn(e)&&e!==tn;function Ei(...e){const{caseless:t,skipUndefined:r}=zd(this)&&this||{},n={},s=(o,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const i=t&&typeof a=="string"&&Ud(n,a)||a,c=Uo(n,i)?n[i]:void 0;Vo(c)&&Vo(o)?n[i]=Ei(c,o):Vo(o)?n[i]=Ei({},o):en(o)?n[i]=o.slice():(!r||!Dn(o))&&(n[i]=o)};for(let o=0,a=e.length;o<a;o++){const i=e[o];if(!i||Ln(i)||(Ds(i,s),typeof i!="object"||en(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let d=0;d<c.length;d++){const u=c[d];Vb.call(i,u)&&s(i[u],u)}}return n}const Nb=(e,t,r,{allOwnKeys:n}={})=>(Ds(t,(s,o)=>{r&&Ft(s)?Object.defineProperty(e,o,{__proto__:null,value:Fd(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),Pb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xb=(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)},Fb=(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&&kn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Mb=(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},$b=e=>{if(!e)return null;if(en(e))return e;let t=e.length;if(!Bd(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Bb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&kn(Uint8Array)),qb=(e,t)=>{const n=(e&&e[Is]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},jb=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Ub=or("HTMLFormElement"),zb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:Vb}=Object.prototype,Hb=or("RegExp"),Vd=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Ds(r,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(n[o]=a||s)}),Object.defineProperties(e,n)},Qb=e=>{Vd(e,(t,r)=>{if(Ft(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Ft(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+"'")})}})},Wb=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return en(e)?n(e):n(String(e).split(t)),r},Rb=()=>{},Gb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Kb(e){return!!(e&&Ft(e.append)&&e[Md]==="FormData"&&e[Is])}const Yb=e=>{const t=new WeakSet,r=n=>{if(On(n)){if(t.has(n))return;if(Ln(n))return n;if(!("toJSON"in n)){t.add(n);const s=en(n)?[]:{};return Ds(n,(o,a)=>{const i=r(o);!Dn(i)&&(s[a]=i)}),t.delete(n),s}}return n};return r(e)},Zb=or("AsyncFunction"),Xb=e=>e&&(On(e)||Ft(e))&&Ft(e.then)&&Ft(e.catch),Hd=((e,t)=>e?setImmediate:t?((r,n)=>(tn.addEventListener("message",({source:s,data:o})=>{s===tn&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),tn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ft(tn.postMessage)),Jb=typeof queueMicrotask<"u"?queueMicrotask.bind(tn):typeof process<"u"&&process.nextTick||Hd,Qd=e=>e!=null&&Ft(e[Is]),k={isArray:en,isArrayBuffer:$d,isBuffer:Ln,isFormData:Eb,isArrayBufferView:hb,isString:pb,isNumber:Bd,isBoolean:gb,isObject:On,isPlainObject:Vo,isEmptyObject:mb,isReadableStream:Ib,isRequest:kb,isResponse:Db,isHeaders:Lb,isUndefined:Dn,isDate:vb,isFile:yb,isReactNativeBlob:bb,isReactNative:Cb,isBlob:Sb,isRegExp:Hb,isFunction:Ft,isStream:_b,isURLSearchParams:Ab,isTypedArray:Bb,isFileList:wb,forEach:Ds,merge:Ei,extend:Nb,trim:Ob,stripBOM:Pb,inherits:xb,toFlatObject:Fb,kindOf:Ti,kindOfTest:or,endsWith:Mb,toArray:$b,forEachEntry:qb,matchAll:jb,isHTMLForm:Ub,hasOwnProperty:Uo,hasOwnProp:Uo,hasOwnInPrototypeChain:ks,getSafeProp:fb,reduceDescriptors:Vd,freezeMethods:Qb,toObjectSet:Wb,toCamelCase:zb,noop:Rb,toFiniteNumber:Gb,findKey:Ud,global:tn,isContextDefined:zd,isSpecCompliantForm:Kb,toJSONObject:Yb,isAsyncFn:Zb,isThenable:Xb,setImmediate:Hd,asap:Jb,isIterable:Qd,isSafeIterable:e=>e!=null&&ks(e,Is)&&Qd(e)},eC=k.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"]),tC=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]&&eC[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function rC(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 nC=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),sC=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ai(e,t){return k.isArray(e)?e.map(r=>Ai(r,t)):rC(String(e).replace(t,""))}const oC=e=>Ai(e,nC),aC=e=>Ai(e,sC);function Wd(e){const t=Object.create(null);return k.forEach(e.toJSON(),(r,n)=>{t[n]=aC(r)}),t}const Rd=Symbol("internals");function Ls(e){return e&&String(e).trim().toLowerCase()}function Ho(e){return e===!1||e==null?e:k.isArray(e)?e.map(Ho):oC(String(e))}function iC(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 lC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ii(e,t,r,n,s){if(k.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!k.isString(t)){if(k.isString(n))return t.indexOf(n)!==-1;if(k.isRegExp(n))return n.test(t)}}function cC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function dC(e,t){const r=k.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 wt=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(i,c,d){const u=Ls(c);if(!u)return;const f=k.findKey(s,u);(!f||s[f]===void 0||d===!0||d===void 0&&s[f]!==!1)&&(s[f||c]=Ho(i))}const a=(i,c)=>k.forEach(i,(d,u)=>o(d,u,c));if(k.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(k.isString(t)&&(t=t.trim())&&!lC(t))a(tC(t),r);else if(k.isObject(t)&&k.isSafeIterable(t)){let i=Object.create(null),c,d;for(const u of t){if(!k.isArray(u))throw new TypeError("Object iterator must return a key-value pair");d=u[0],k.hasOwnProp(i,d)?(c=i[d],i[d]=k.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=Ls(t),t){const n=k.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return iC(s);if(k.isFunction(r))return r.call(this,s,n);if(k.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ls(t),t){const n=k.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Ii(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(a){if(a=Ls(a),a){const i=k.findKey(n,a);i&&(!r||Ii(n,n[i],i,r))&&(delete n[i],s=!0)}}return k.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||Ii(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return k.forEach(this,(s,o)=>{const a=k.findKey(n,o);if(a){r[a]=Ho(s),delete r[o];return}const i=t?cC(o):String(o).trim();i!==o&&delete r[o],r[i]=Ho(s),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return k.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&k.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[Rd]=this[Rd]={accessors:{}}).accessors,s=this.prototype;function o(a){const i=Ls(a);n[i]||(dC(s,a),n[i]=!0)}return k.isArray(t)?t.forEach(o):o(t),this}};wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(wt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),k.freezeMethods(wt);const uC="[REDACTED ****]";function fC(e){if(k.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(k.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function hC(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],s=o=>{if(o===null||typeof o!="object"||k.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof wt&&(o=o.toJSON()),n.push(o);let a;if(k.isArray(o))a=[],o.forEach((i,c)=>{const d=s(i);k.isUndefined(d)||(a[c]=d)});else{if(!k.isPlainObject(o)&&fC(o))return n.pop(),o;a=Object.create(null);for(const[i,c]of Object.entries(o)){const d=r.has(i.toLowerCase())?uC:s(c);k.isUndefined(d)||(a[i]=d)}}return n.pop(),a};return s(e)}let J=class lg extends Error{static from(t,r,n,s,o,a){const i=new lg(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&&k.hasOwnProp(t,"redact")?t.redact:void 0,n=k.isArray(r)&&r.length>0?hC(t,r):k.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}}};J.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",J.ERR_BAD_OPTION="ERR_BAD_OPTION",J.ECONNABORTED="ECONNABORTED",J.ETIMEDOUT="ETIMEDOUT",J.ECONNREFUSED="ECONNREFUSED",J.ERR_NETWORK="ERR_NETWORK",J.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",J.ERR_DEPRECATED="ERR_DEPRECATED",J.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",J.ERR_BAD_REQUEST="ERR_BAD_REQUEST",J.ERR_CANCELED="ERR_CANCELED",J.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",J.ERR_INVALID_URL="ERR_INVALID_URL",J.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const pC=null,Gd=100;function ki(e){return k.isPlainObject(e)||k.isArray(e)}function Kd(e){return k.endsWith(e,"[]")?e.slice(0,-2):e}function Di(e,t,r){return e?e.concat(t).map(function(s,o){return s=Kd(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function gC(e){return k.isArray(e)&&!e.some(ki)}const mC=k.toFlatObject(k,{},null,function(t){return/^is[A-Z]/.test(t)});function Qo(e,t,r){if(!k.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=k.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!k.isUndefined(S[C])});const n=r.metaTokens,s=r.visitor||b,o=r.dots,a=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?Gd:r.maxDepth,d=i&&k.isSpecCompliantForm(t),u=[];if(!k.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(k.isDate(y))return y.toISOString();if(k.isBoolean(y))return y.toString();if(!d&&k.isBlob(y))throw new J("Blob is not supported. Use a Buffer instead.");return k.isArrayBuffer(y)||k.isTypedArray(y)?d&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function m(y){if(y>c)throw new J("Object is too deeply nested ("+y+" levels). Max depth: "+c,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(y,C){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(T,A){if(!k.isObject(A))return A;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(A),m(C+S.length-1),A})}function b(y,C,S){let w=y;if(k.isReactNative(t)&&k.isReactNativeBlob(y))return t.append(Di(S,C,o),f(y)),!1;if(y&&!S&&typeof y=="object"){if(k.endsWith(C,"{}"))C=n?C:C.slice(0,-2),y=g(y,1);else if(k.isArray(y)&&gC(y)||(k.isFileList(y)||k.endsWith(C,"[]"))&&(w=k.toArray(y)))return C=Kd(C),w.forEach(function(A,L){!(k.isUndefined(A)||A===null)&&t.append(a===!0?Di([C],L,o):a===null?C:C+"[]",f(A))}),!1}return ki(y)?!0:(t.append(Di(S,C,o),f(y)),!1)}const h=Object.assign(mC,{defaultVisitor:b,convertValue:f,isVisitable:ki});function v(y,C,S=0){if(!k.isUndefined(y)){if(m(S),u.indexOf(y)!==-1)throw new Error("Circular reference detected in "+C.join("."));u.push(y),k.forEach(y,function(T,A){(!(k.isUndefined(T)||T===null)&&s.call(t,T,k.isString(A)?A.trim():A,C,h))===!0&&v(T,C?C.concat(A):[A],S+1)}),u.pop()}}if(!k.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Yd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Li(e,t){this._pairs=[],e&&Qo(e,this,t)}const Zd=Li.prototype;Zd.append=function(t,r){this._pairs.push([t,r])},Zd.toString=function(t){const r=t?function(n){return t.call(this,n,Yd)}:Yd;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function vC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xd(e,t,r){if(!t)return e;const n=k.isFunction(r)?{serialize:r}:r,s=k.getSafeProp(n,"encode")||vC,o=k.getSafeProp(n,"serialize");let a;if(o?a=o(t,n):a=k.isURLSearchParams(t)?t.toString():new Li(t,n).toString(s),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Jd{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){k.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Oi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},yC={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Li,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ni=typeof window<"u"&&typeof document<"u",Pi=typeof navigator=="object"&&navigator||void 0,bC=Ni&&(!Pi||["ReactNative","NativeScript","NS"].indexOf(Pi.product)<0),CC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",SC=Ni&&window.location.href||"http://localhost",yt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ni,hasStandardBrowserEnv:bC,hasStandardBrowserWebWorkerEnv:CC,navigator:Pi,origin:SC},Symbol.toStringTag,{value:"Module"})),...yC};function wC(e,t){return Qo(e,new yt.classes.URLSearchParams,{visitor:function(r,n,s,o){return yt.isNode&&k.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const eu=Gd;function tu(e){if(e>eu)throw new J("FormData field is too deeply nested ("+e+" levels). Max depth: "+eu,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function _C(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)tu(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function TC(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 ru(e){function t(r,n,s,o){tu(o);let a=r[o++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=o>=r.length;return a=!a&&k.isArray(s)?s.length:a,c?(k.hasOwnProp(s,a)?s[a]=k.isArray(s[a])?s[a].concat(n):[s[a],n]:s[a]=n,!i):((!k.hasOwnProp(s,a)||!k.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],o)&&k.isArray(s[a])&&(s[a]=TC(s[a])),!i)}if(k.isFormData(e)&&k.isFunction(e.entries)){const r={};return k.forEachEntry(e,(n,s)=>{t(_C(n),s,r,0)}),r}return null}const Nn=(e,t)=>e!=null&&k.hasOwnProp(e,t)?e[t]:void 0;function EC(e,t,r){if(k.isString(e))try{return(t||JSON.parse)(e),k.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Os={transitional:Oi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=k.isObject(t);if(o&&k.isHTMLForm(t)&&(t=new FormData(t)),k.isFormData(t))return s?JSON.stringify(ru(t)):t;if(k.isArrayBuffer(t)||k.isBuffer(t)||k.isStream(t)||k.isFile(t)||k.isBlob(t)||k.isReadableStream(t))return t;if(k.isArrayBufferView(t))return t.buffer;if(k.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=Nn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return wC(t,c).toString();if((i=k.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=Nn(this,"env"),u=d&&d.FormData;return Qo(i?{"files[]":t}:t,u&&new u,c)}}return o||s?(r.setContentType("application/json",!1),EC(t)):t}],transformResponse:[function(t){const r=Nn(this,"transitional")||Os.transitional,n=r&&r.forcedJSONParsing,s=Nn(this,"responseType"),o=s==="json";if(k.isResponse(t)||k.isReadableStream(t))return t;if(t&&k.isString(t)&&(n&&!s||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Nn(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?J.from(c,J.ERR_BAD_RESPONSE,this,null,Nn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};k.forEach(["delete","get","head","post","put","patch","query"],e=>{Os.headers[e]={}});function xi(e,t){const r=this||Os,n=t||r,s=wt.from(n.headers);let o=n.data;return k.forEach(e,function(i){o=i.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function nu(e){return!!(e&&e.__CANCEL__)}let Ns=class extends J{constructor(t,r,n){super(t??"canceled",J.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function su(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new J("Request failed with status code "+r.status,r.status>=400&&r.status<500?J.ERR_BAD_REQUEST:J.ERR_BAD_RESPONSE,r.config,r.request,r))}function AC(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function IC(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,m=0;for(;f!==s;)m+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-a<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function kC(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 Wo=(e,t,r=3)=>{let n=0;const s=IC(50,250);return kC(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)},ou=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},au=e=>(...t)=>k.asap(()=>e(...t)),DC=yt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,yt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,LC=yt.hasStandardBrowserEnv?{write(e,t,r,n,s,o,a){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];k.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),k.isString(n)&&i.push(`path=${n}`),k.isString(s)&&i.push(`domain=${s}`),o===!0&&i.push("secure"),k.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 OC(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function NC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const PC=/^https?:(?!\/\/)/i,xC=/[\t\n\r]/g;function FC(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function MC(e){return FC(e).replace(xC,"")}function iu(e,t){if(typeof e=="string"&&PC.test(MC(e)))throw new J('Invalid URL: missing "//" after protocol',J.ERR_INVALID_URL,t)}function lu(e,t,r,n){iu(t,n);let s=!OC(t);return e&&(s||r===!1)?(iu(e,n),NC(e,t)):t}const cu=e=>e instanceof wt?{...e}:e;function rn(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,m,g){return k.isPlainObject(u)&&k.isPlainObject(f)?k.merge.call({caseless:g},u,f):k.isPlainObject(f)?k.merge({},f):k.isArray(f)?f.slice():f}function s(u,f,m,g){if(k.isUndefined(f)){if(!k.isUndefined(u))return n(void 0,u,m,g)}else return n(u,f,m,g)}function o(u,f){if(!k.isUndefined(f))return n(void 0,f)}function a(u,f){if(k.isUndefined(f)){if(!k.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function i(u){const f=k.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!k.isUndefined(f))if(k.isPlainObject(f)){if(k.hasOwnProp(f,u))return f[u]}else return;const m=k.hasOwnProp(e,"transitional")?e.transitional:void 0;if(k.isPlainObject(m)&&k.hasOwnProp(m,u))return m[u]}function c(u,f,m){if(k.hasOwnProp(t,m))return n(u,f);if(k.hasOwnProp(e,m))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,m)=>s(cu(u),cu(f),m,!0)};return k.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const m=k.hasOwnProp(d,f)?d[f]:s,g=k.hasOwnProp(e,f)?e[f]:void 0,b=k.hasOwnProp(t,f)?t[f]:void 0,h=m(g,b,f);k.isUndefined(h)&&m!==c||(r[f]=h)}),k.hasOwnProp(t,"validateStatus")&&k.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(k.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const $C=["content-type","content-length"];function BC(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{$C.includes(n.toLowerCase())&&e.set(n,s)})}const qC=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function du(e){const t=rn({},e),r=m=>k.hasOwnProp(t,m)?t[m]: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=wt.from(i),t.url=Xd(lu(d,f,u,t),r("params"),r("paramsSerializer")),c){const m=k.getSafeProp(c,"username")||"",g=k.getSafeProp(c,"password")||"";i.set("Authorization","Basic "+btoa(m+":"+(g?qC(g):"")))}if(k.isFormData(n)&&(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv||k.isReactNative(n)?i.setContentType(void 0):k.isFunction(n.getHeaders)&&BC(i,n.getHeaders(),r("formDataHeaderPolicy"))),yt.hasStandardBrowserEnv&&(k.isFunction(s)&&(s=s(t)),s===!0||s==null&&DC(t.url))){const g=o&&a&&LC.read(a);g&&i.set(o,g)}return t}const jC=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=du(e);let o=s.data;const a=wt.from(s.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:d}=s,u,f,m,g,b;function h(){g&&g(),b&&b(),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=wt.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};su(function(L){r(L),h()},function(L){n(L),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 J("Request aborted",J.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(w){const T=w&&w.message?w.message:"Network Error",A=new J(T,J.ERR_NETWORK,e,v);A.event=w||null,n(A),h(),v=null},v.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const T=s.transitional||Oi;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),n(new J(w,T.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,v)),h(),v=null},o===void 0&&a.setContentType(null),"setRequestHeader"in v&&k.forEach(Wd(a),function(w,T){v.setRequestHeader(T,w)}),k.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),i&&i!=="json"&&(v.responseType=s.responseType),d&&([m,b]=Wo(d,!0),v.addEventListener("progress",m)),c&&v.upload&&([f,g]=Wo(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(u=S=>{v&&(n(!S||S.type?new Ns(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 C=AC(s.url);if(C&&!yt.protocols.includes(C)){n(new J("Unsupported protocol "+C+":",J.ERR_BAD_REQUEST,e));return}v.send(o||null)})},UC=(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 J?d:new Ns(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,s(new J(`timeout of ${t}ms exceeded`,J.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=()=>k.asap(a),i},zC=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},VC=async function*(e,t){for await(const r of HC(e))yield*zC(r,t)},HC=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()}},uu=(e,t,r,n)=>{const s=VC(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 m=o+=f;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(c){return i(c),s.return()}},{highWaterMark:2})},Ro=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,QC=(e,t,r)=>t+2<r&&Ro(e.charCodeAt(t+1))&&Ro(e.charCodeAt(t+2));function WC(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 g=0;g<i;g++)if(n.charCodeAt(g)===37&&g+2<i){const b=n.charCodeAt(g+1),h=n.charCodeAt(g+2);Ro(b)&&Ro(h)&&(a-=2,g+=2)}let c=0,d=i-1;const u=g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===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 m=Math.floor(a/4)*3-(c||0);return m>0?m:0}let o=0;for(let a=0,i=n.length;a<i;a++){const c=n.charCodeAt(a);if(c===37&&QC(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 Fi="1.18.0",fu=64*1024,{isFunction:Go}=k,RC=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),hu=e=>{if(!k.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},pu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},GC=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},KC=e=>{const t=k.global!==void 0&&k.global!==null?k.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=k.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:o,Response:a}=e,i=s?Go(s):typeof fetch=="function",c=Go(o),d=Go(a);if(!i)return!1;const u=i&&Go(r),f=i&&(typeof n=="function"?(y=>C=>y.encode(C))(new n):async y=>new Uint8Array(await new o(y).arrayBuffer())),m=c&&u&&pu(()=>{let y=!1;const C=new o(yt.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}),g=d&&u&&pu(()=>k.isReadableStream(new a("").body)),b={stream:g&&(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 J(`Response type '${y}' is not supported`,J.ERR_NOT_SUPPORT,S)})});const h=async y=>{if(y==null)return 0;if(k.isBlob(y))return y.size;if(k.isSpecCompliantForm(y))return(await new o(yt.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(k.isArrayBufferView(y)||k.isArrayBuffer(y))return y.byteLength;if(k.isURLSearchParams(y)&&(y=y+""),k.isString(y))return(await f(y)).byteLength},v=async(y,C)=>{const S=k.toFiniteNumber(y.getContentLength());return S??h(C)};return async y=>{let{url:C,method:S,data:w,signal:T,cancelToken:A,timeout:L,onDownloadProgress:E,onUploadProgress:x,responseType:$,headers:N,withCredentials:P="same-origin",fetchOptions:q,maxContentLength:F,maxBodyLength:z}=du(y);const ne=k.isNumber(F)&&F>-1,Q=k.isNumber(z)&&z>-1,te=B=>k.hasOwnProp(y,B)?y[B]:void 0;let pe=s||fetch;$=$?($+"").toLowerCase():"text";let ie=UC([T,A&&A.toAbortSignal()],L),me=null;const ve=ie&&ie.unsubscribe&&(()=>{ie.unsubscribe()});let Ee,ye=null;const M=()=>new J("Request body larger than maxBodyLength limit",J.ERR_BAD_REQUEST,y,me);try{let B;const Z=te("auth");if(Z){const ee=k.getSafeProp(Z,"username")||"",Ge=k.getSafeProp(Z,"password")||"";B={username:ee,password:Ge}}if(GC(C)){const ee=new URL(C,yt.origin);if(!B&&(ee.username||ee.password)){const Ge=hu(ee.username),Ye=hu(ee.password);B={username:Ge,password:Ye}}(ee.username||ee.password)&&(ee.username="",ee.password="",C=ee.href)}if(B&&(N.delete("authorization"),N.set("Authorization","Basic "+btoa(RC((B.username||"")+":"+(B.password||""))))),ne&&typeof C=="string"&&C.startsWith("data:")&&WC(C)>F)throw new J("maxContentLength size of "+F+" exceeded",J.ERR_BAD_RESPONSE,y,me);if(Q&&S!=="get"&&S!=="head"){const ee=await h(w);if(typeof ee=="number"&&isFinite(ee)&&(Ee=ee,ee>z))throw M()}const ce=Q&&(k.isReadableStream(w)||k.isStream(w)),Ce=(ee,Ge,Ye)=>uu(ee,fu,rt=>{if(Q&&rt>z)throw ye=M();Ge&&Ge(rt)},Ye);if(m&&S!=="get"&&S!=="head"&&(x||ce)){if(Ee=Ee??await v(N,w),Ee!==0||ce){let ee=new o(C,{method:"POST",body:w,duplex:"half"}),Ge;if(k.isFormData(w)&&(Ge=ee.headers.get("content-type"))&&N.setContentType(Ge),ee.body){const[Ye,rt]=x&&ou(Ee,Wo(au(x)))||[];w=Ce(ee.body,Ye,rt)}}}else if(ce&&!c&&u&&S!=="get"&&S!=="head")w=Ce(w);else if(ce&&c&&!m&&S!=="get"&&S!=="head")throw new J("Stream request bodies are not supported by the current fetch implementation",J.ERR_NOT_SUPPORT,y,me);k.isString(P)||(P=P?"include":"omit");const ue=c&&"credentials"in o.prototype;if(k.isFormData(w)){const ee=N.getContentType();ee&&/^multipart\/form-data/i.test(ee)&&!/boundary=/i.test(ee)&&N.delete("content-type")}N.set("User-Agent","axios/"+Fi,!1);const de={...q,signal:ie,method:S.toUpperCase(),headers:Wd(N.normalize()),body:w,duplex:"half",credentials:ue?P:void 0};me=c&&new o(C,de);let W=await(c?pe(me,q):pe(C,de));const se=wt.from(W.headers);if(ne){const ee=k.toFiniteNumber(se.getContentLength());if(ee!=null&&ee>F)throw new J("maxContentLength size of "+F+" exceeded",J.ERR_BAD_RESPONSE,y,me)}const Ae=g&&($==="stream"||$==="response");if(g&&W.body&&(E||ne||Ae&&ve)){const ee={};["status","statusText","headers"].forEach(dt=>{ee[dt]=W[dt]});const Ge=k.toFiniteNumber(se.getContentLength()),[Ye,rt]=E&&ou(Ge,Wo(au(E),!0))||[];let Ke=0;const st=dt=>{if(ne&&(Ke=dt,Ke>F))throw new J("maxContentLength size of "+F+" exceeded",J.ERR_BAD_RESPONSE,y,me);Ye&&Ye(dt)};W=new a(uu(W.body,fu,st,()=>{rt&&rt(),ve&&ve()}),ee)}$=$||"text";let ge=await b[k.findKey(b,$)||"text"](W,y);if(ne&&!g&&!Ae){let ee;if(ge!=null&&(typeof ge.byteLength=="number"?ee=ge.byteLength:typeof ge.size=="number"?ee=ge.size:typeof ge=="string"&&(ee=typeof n=="function"?new n().encode(ge).byteLength:ge.length)),typeof ee=="number"&&ee>F)throw new J("maxContentLength size of "+F+" exceeded",J.ERR_BAD_RESPONSE,y,me)}return!Ae&&ve&&ve(),await new Promise((ee,Ge)=>{su(ee,Ge,{data:ge,headers:wt.from(W.headers),status:W.status,statusText:W.statusText,config:y,request:me})})}catch(B){if(ve&&ve(),ie&&ie.aborted&&ie.reason instanceof J){const Z=ie.reason;throw Z.config=y,me&&(Z.request=me),B!==Z&&(Z.cause=B),Z}throw ye?(me&&!ye.request&&(ye.request=me),ye):B instanceof J?(me&&!B.request&&(B.request=me),B):B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,y,me,B&&B.response),{cause:B.cause||B}):J.from(B,B&&B.code,y,me,B&&B.response)}}},YC=new Map,gu=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=YC;for(;i--;)c=o[i],d=u.get(c),d===void 0&&u.set(c,d=i?new Map:KC(t)),u=d;return d};gu();const Mi={http:pC,xhr:jC,fetch:{get:gu}};k.forEach(Mi,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const mu=e=>`- ${e}`,ZC=e=>k.isFunction(e)||e===null||e===!1;function XC(e,t){e=k.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,!ZC(n)&&(s=Mi[(i=String(n)).toLowerCase()],s===void 0))throw new J(`Unknown adapter '${i}'`);if(s&&(k.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(mu).join(`
532
+ `):" "+mu(a[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s}const vu={getAdapter:XC,adapters:Mi};function $i(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ns(null,e)}function yu(e){return $i(e),e.headers=wt.from(e.headers),e.data=xi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vu.getAdapter(e.adapter||Os.adapter,e)(e).then(function(n){$i(e),e.response=n;try{n.data=xi.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=wt.from(n.headers),n},function(n){if(!nu(n)&&($i(e),n&&n.response)){e.response=n.response;try{n.response.data=xi.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=wt.from(n.response.headers)}return Promise.reject(n)})}const Ko={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ko[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const bu={};Ko.transitional=function(t,r,n){function s(o,a){return"[Axios v"+Fi+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,i)=>{if(t===!1)throw new J(s(a," has been removed"+(r?" in "+r:"")),J.ERR_DEPRECATED);return r&&!bu[a]&&(bu[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}},Ko.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function JC(e,t,r){if(typeof e!="object")throw new J("options must be an object",J.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 J("option "+o+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new J("Unknown option "+o,J.ERR_BAD_OPTION)}}const Yo={assertOptions:JC,validators:Ko},_t=Yo.validators;let nn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Jd,response:new Jd}}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=rn(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Yo.assertOptions(n,{silentJSONParsing:_t.transitional(_t.boolean),forcedJSONParsing:_t.transitional(_t.boolean),clarifyTimeoutError:_t.transitional(_t.boolean),legacyInterceptorReqResOrdering:_t.transitional(_t.boolean),advertiseZstdAcceptEncoding:_t.transitional(_t.boolean),validateStatusUndefinedResolves:_t.transitional(_t.boolean)},!1),s!=null&&(k.isFunction(s)?r.paramsSerializer={serialize:s}:Yo.assertOptions(s,{encode:_t.function,serialize:_t.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Yo.assertOptions(r,{baseUrl:_t.spelling("baseURL"),withXsrfToken:_t.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&k.merge(o.common,o[r.method]);o&&k.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete o[b]}),r.headers=wt.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||Oi;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,m;if(!c){const b=[yu.bind(this),void 0];for(b.unshift(...i),b.push(...d),m=b.length,u=Promise.resolve(r);f<m;)u=u.then(b[f++],b[f++]);return u}m=i.length;let g=r;for(;f<m;){const b=i[f++],h=i[f++];try{g=b(g)}catch(v){h.call(this,v);break}}try{u=yu.call(this,g)}catch(b){return Promise.reject(b)}for(f=0,m=d.length;f<m;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=rn(this.defaults,t);const r=lu(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Xd(r,t.params,t.paramsSerializer)}};k.forEach(["delete","get","head","options"],function(t){nn.prototype[t]=function(r,n){return this.request(rn(n||{},{method:t,url:r,data:n&&k.hasOwnProp(n,"data")?n.data:void 0}))}}),k.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,a,i){return this.request(rn(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}nn.prototype[t]=r(),t!=="query"&&(nn.prototype[t+"Form"]=r(!0))});let eS=class cg{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 Ns(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 cg(function(s){t=s}),cancel:t}}};function tS(e){return function(r){return e.apply(null,r)}}function rS(e){return k.isObject(e)&&e.isAxiosError===!0}const Bi={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(Bi).forEach(([e,t])=>{Bi[t]=e});function Cu(e){const t=new nn(e),r=Fd(nn.prototype.request,t);return k.extend(r,nn.prototype,t,{allOwnKeys:!0}),k.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Cu(rn(e,s))},r}const nt=Cu(Os);nt.Axios=nn,nt.CanceledError=Ns,nt.CancelToken=eS,nt.isCancel=nu,nt.VERSION=Fi,nt.toFormData=Qo,nt.AxiosError=J,nt.Cancel=nt.CanceledError,nt.all=function(t){return Promise.all(t)},nt.spread=tS,nt.isAxiosError=rS,nt.mergeConfig=rn,nt.AxiosHeaders=wt,nt.formToJSON=e=>ru(k.isHTMLForm(e)?new FormData(e):e),nt.getAdapter=vu.getAdapter,nt.HttpStatusCode=Bi,nt.default=nt;const{Axios:pN,AxiosError:gN,CanceledError:mN,isCancel:vN,CancelToken:yN,VERSION:bN,all:CN,Cancel:SN,isAxiosError:wN,spread:_N,toFormData:TN,AxiosHeaders:EN,HttpStatusCode:AN,formToJSON:IN,getAdapter:kN,mergeConfig:DN,create:LN}=nt;let qi="";function Su(e){qi=e}const Me=nt.create({timeout:3e4});Me.interceptors.request.use(async e=>{var s;const{useEditorStore:t}=await Promise.resolve().then(()=>sb),n=(s=t.getState().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),qi&&(e.baseURL=qi),e});const wu="/portal";async function _u(e){var n,s,o,a,i,c,d;const t=await Me.get(`${wu}/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 nS(e){var r,n;return e.length?((n=(r=(await Me.post(`${wu}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Zo(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",o=r.mimeType??"",a=r.children,i=Array.isArray(a)?a.map(d=>Zo(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 Tu(e){var s,o,a,i,c,d,u;const t=await Me.get(`/action/content/v3/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=Zo(r);return{content:r,rootNode:n}}async function sS(e){const t=await _u(e),r=Zo(t);return{content:t,rootNode:r}}async function oS(e,t,r,n){var o;return((o=(await Me.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:o.result)??{}}async function aS(e,t=""){await Me.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function Eu(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 iS(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}async function lS(e){await Me.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function cS(e,t){await Me.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function dS(e,t){await Me.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const uS="application/vnd.sunbird.questionset";function Au(e){let t=!1,r=!0;function n(s){for(const o of s){const a=o.children??[];if(a.length>0){n(a);continue}t=!0,o.objectType==="QuestionSet"&&o.mimeType===uS||(r=!1)}}return n(e.children??[]),t&&r}const Iu=new Map;async function ku(e){const t=Iu.get(e);if(t)return t;const r=await Eu(e),{children:n,...s}=r??{},o={qualifies:Au(r),meta:s};return Iu.set(e,o),o}async function Du(e){return(await ku(e)).qualifies}async function fS(e){var n;const t=e.children??[],r=[];for(let s=0;s<t.length;s++){const o=t[s],a=o.children??[],i=[];for(const c of a){let d=!!((n=c.metadata)!=null&&n.isAssessmentCourse);if(!d){if((c.children??[]).length>0)d=Au(c);else if(a.length===1&&(s===0||s===t.length-1))try{d=await Du(c.identifier)}catch(u){console.error("[lpStructure] assessment-course check failed on load:",u)}}i.push({...c,isFolder:!1,children:[],metadata:{...c.metadata??{},...d?{isAssessmentCourse:!0}:{}}})}r.push({...o,children:i})}return{...e,children:r}}function lt(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 hS(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function pS(e,t){const r=e.findIndex(s=>s.id===t);return r===-1?null:Xo(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((s,o)=>!Xo(e,o)).length}}function Ps(e,t){return t==="pre"?e.length>0&&lt(e[0]):e.length>1&&lt(e[e.length-1])}function Xo(e,t){const r=hS(t,e.length,lt(e[t]));return r==="pre"||r==="post"}function ji(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&Xo(e,r)}function gS(e){return Ps(e,"pre")?Ps(e,"post")?null:"post":"pre"}function mS(e,t,r){if(t<0||t>=e.length)return!1;const n=lt(e[0])?e[0]:null,s=e.length>1&&lt(e[e.length-1])?e[e.length-1]:null;if(!n&&!s)return!0;const o=[...e],[a]=o.splice(t,1);return o.splice(r,0,a),!(n&&o[0]!==n||s&&o[o.length-1]!==s)}function Lu(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 Jo(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function Ou(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 Nu(e,t){return!!Ou(e,t)}function vS(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((s,o)=>{var a,i;Xo(n,o)?Jo((a=s.children[0].metadata)==null?void 0:a[t]).forEach(c=>r.add(c)):Jo((i=s.metadata)==null?void 0:i[t]).forEach(c=>r.add(c))}),Array.from(r)}const Pu=new Set(["Diagnostic","PriorLearning"]);function yS(e,t,r){var g,b,h;const n=[];if(!e)return n;const s=(g=e.metadata)==null?void 0:g.policy;s||n.push({code:"policyMissing",message:"Set a consumption policy for this path."});const o=e.children??[],a=o[0],i=o.length>1?o[o.length-1]:void 0,c=lt(a),d=lt(i);!c&&s&&Pu.has(s)&&n.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive/Prior learning policy."}),d||n.push({code:"outcomeAssessmentMissing",message:"Add an Outcome Assessment to close the path."}),[[a,"Prior Assessment"],[i,"Outcome Assessment"]].forEach(([v,y])=>{var S,w;if(!v)return;const C=v.children??[];(C.length!==1||!((w=(S=C[0])==null?void 0:S.metadata)!=null&&w.isAssessmentCourse))&&n.push({code:"slotNotPure",nodeId:v.id,message:`${y} must contain exactly one question-set-only course.`})});const u=new Set,f=(v,y)=>{u.has(v)&&n.push({code:"duplicateCourse",nodeId:y,message:"A course appears more than once in this path."}),u.add(v)},m=o.slice(c?1:0,o.length-(d?1:0));c&&f(a.children[0].id,a.id),d&&f(i.children[0].id,i.id);for(const v of m){const y=v.children??[];if(y.length===0){n.push({code:"emptyLevel",nodeId:v.id,message:`"${v.name}" has no courses yet.`});continue}const C=t?Jo((b=v.metadata)==null?void 0:b[t]):[];if(C.length===0)n.push({code:"levelMissingSkills",nodeId:v.id,message:`"${v.name}" needs at least one skill selected.`});else if(r.length>0){const S=C.filter(w=>!r.includes(w));S.length>0&&n.push({code:"levelSkillsOutOfScope",nodeId:v.id,message:`"${v.name}" has skills outside the current scope: ${S.join(", ")}.`})}for(const S of y)f(S.id,v.id),(t?Jo((h=S.metadata)==null?void 0:h[t]):[]).length===0&&n.push({code:"courseMissingSkillTag",nodeId:S.id,message:`"${S.name}" has no skill tag.`})}return n}async function bS(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||!lt(o))continue;const i=o.children[0].id;await Du(i)||t.push({code:"slotCourseChanged",nodeId:o.id,message:`${a}'s course is no longer question-set-only — pick a different course.`})}return t}function Mt(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 xu(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=xu(s.children,t,r+1);if(o>=0)return o}}return-1}const Fu=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function Mu(e,t,r,n){return e.map(s=>{if(s.id===t){const o=r.metadata??{},a=n!=null&&n.length?new Set([...Fu,...n]):Fu,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:Mu(s.children,t,r,n)}:s})}function ea(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:ea(n.children,t,r)}:n)}function $u(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:$u(s.children,t,r,n)}:s})}function Ui(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Ui(r.children,t):[]}))}function zi(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:zi(s.children,t,r,n)}:s})}function Bu(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?Bu(r.children,t):[]}})}function CS(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 SS(e,t){const r=Mt(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Mt(e,s.parent):void 0;return n}const le=As((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=Mt(n,r),i=o(r),c={...(a==null?void 0:a.metadata)??{},...s[r]??{}};Y.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),Fr.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:i,activeNodeMeta:c})},updateNode:(r,n,s)=>{if(e(o=>({treeData:Mu(o.treeData,r,n,s),treeCache:{...o.treeCache,[r]:{...o.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const o=Mt(t().treeData,r);e(a=>({activeNodeMeta:{...(o==null?void 0:o.metadata)??{},...a.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var m,g,b;const s=t(),o=Y.getState().editorProfile,a=((g=(m=Y.getState().editorConfig)==null?void 0:m.config)==null?void 0:g.maxDepth)??o.maxDepth,i=xu(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:c,name:o.defaultUnitName,contentType:o.unitContentType,primaryCategory:o.unitPrimaryCategory,visibility:"Parent"}},u=((b=Mt(s.treeData,r))==null?void 0:b.children)??[],f=o.derivedRoles&&Ps(u,"post");return e(h=>({treeData:f?$u(h.treeData,r,d,u.length-1):ea(h.treeData,r,d),treeCache:{...h.treeCache,[c]:{...d.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var s;const n=(s=t().treeData[0])==null?void 0:s.id;r!==n&&e(o=>({treeData:Ui(o.treeData,r),selectedNodeId:o.selectedNodeId===r?null:o.selectedNodeId}))},reorderChildren:(r,n,s)=>{var i;const o=Y.getState().editorProfile,a=(i=t().treeData[0])==null?void 0:i.id;if(o.derivedRoles&&r===a){const c=Mt(t().treeData,r);if(c!=null&&c.children&&!mS(c.children,n,s))return}e(c=>({treeData:zi(c.treeData,r,n,s)}))},moveNode:(r,n,s)=>{var d,u,f;const o=Y.getState().editorProfile,a=Mt(t().treeData,r),i=Mt(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 m=!!((u=a.metadata)!=null&&u.isAssessmentCourse),g=((f=t().treeData[0])==null?void 0:f.children)??[];if(!Lu(i,m,ji(g,i)))return}e(m=>{const g=Mt(m.treeData,r);if(!g)return m;let b=Ui(m.treeData,r);return b=ea(b,s,{...g,parent:s}),{treeData:b}}),t().markDirty()}},addResource:(r,n,s)=>{var b,h,v,y,C,S;const o=Y.getState().editorConfig,a=Y.getState().editorProfile,i=(b=t().treeData[0])==null?void 0:b.id,c=!!(s!=null&&s.isAssessmentCourse);if(a.derivedRoles&&n===i){if(!c||Mt(t().treeData,r.identifier))return!1;const w=t().treeData[0],T=(w==null?void 0:w.children)??[],A=(s==null?void 0:s.slot)??gS(T);if(!A||Ps(T,A))return!1;const L=t().addNode(i,"unit");if(!L)return!1;const{learningPath:E}=_i.getState().labelConfig;if(t().updateNode(L,{name:A==="pre"?E.priorAssessmentLabel:E.outcomeAssessmentLabel}),A==="pre"){const x=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e($=>({treeData:zi($.treeData,i,x,0)}))}return t().addResource(r,L,s)}if(!(((y=o==null?void 0:o.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===i||Mt(t().treeData,r.identifier))return!1;const u=Mt(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(!Lu(u,c,ji(w,u)))return!1}const f=((S=o==null?void 0:o.config)==null?void 0:S.maxContentsLimit)??1200;if(CS(t().treeData)>=f)return!1;const g={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:ea(w.treeData,n,g)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=Y.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=lt(i),d=(i.children??[]).filter(u=>{var g;if(u.isFolder)return!0;const f=(g=u.metadata)==null?void 0:g.framework,m=!f||(Array.isArray(f)?f.includes(r):f===r);return m||n++,m});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},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=Bu(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=>Mt(t().treeData,r),getChildrenOf:r=>{const n=Mt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>SS(t().treeData,r)})),wS={spin:"_spin_1ah4d_9"};function ae(){return _i(e=>e.labelConfig)}const _S=({size:e=16,color:t="currentColor"})=>{const r=ae();return l.jsx("svg",{className:wS.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"})})},je=({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(_S,{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 ju(e){var r,n;return(n=(r=(await Me.get(`/api/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function TS(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 ta(e,t){const r=_n({queryKey:["framework",e],queryFn:()=>ju(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=_n({queryKey:["framework",n],queryFn:()=>ju(n),enabled:!!n,staleTime:300*1e3}),o=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:o,isLoading:r.isLoading||s.isLoading}}function Uu(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 ES(e){var n,s,o,a;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!lt(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 Pn(){var o;const e=Y(a=>a.editorConfig),t=Y(a=>a.contentFramework),r=le(a=>a.treeData),n=ES(r[0])??t??((o=e==null?void 0:e.context)==null?void 0:o.framework),{organisationFramework:s}=ta(n);return Uu(s==null?void 0:s.categories)}function AS(e,t,r){var d,u,f,m;const n={scope:((t==null?void 0:t.terms)??[]).map(g=>g.name),source:"manual"};if(!t)return n;const s=(d=e==null?void 0:e.children)==null?void 0:d[0];if(!lt(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])??((m=o.metadata)==null?void 0:m[t.code]);return{scope:Array.isArray(i)?i:i?[i]:[],source:"prior"}}function zu(){const e=Pn(),t=le(n=>n.treeData),r=le(n=>n.treeCache);return p.useMemo(()=>AS(t[0],e,r),[t,e,r])}const Pe={overlay:"_overlay_kdzmi_1",modal:"_modal_kdzmi_15",modalHeader:"_modalHeader_kdzmi_27",modalHeaderClose:"_modalHeaderClose_kdzmi_37",modalBody:"_modalBody_kdzmi_55",modalFooter:"_modalFooter_kdzmi_62",checkRow:"_checkRow_kdzmi_69",formGroup:"_formGroup_kdzmi_112",textarea:"_textarea_kdzmi_123",sliderGroup:"_sliderGroup_kdzmi_144",sliderValue:"_sliderValue_kdzmi_156",sliderLabels:"_sliderLabels_kdzmi_164",sectionTitle:"_sectionTitle_kdzmi_172"},IS=({objectType:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=le(g=>g.treeData[0]),o=Pn(),{scope:a}=zu(),[i,c]=p.useState(null),d=yS(s,o==null?void 0:o.code,a);p.useEffect(()=>{let g=!1;return c(null),bS(s).then(b=>{g||c(b)}),()=>{g=!0}},[s]);const u=i===null,f=[...d,...i??[]],m=!u&&f.length===0;return l.jsx("div",{className:Pe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Pe.modal,children:[l.jsxs("div",{className:Pe.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Pe.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Pe.modalBody,children:f.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:u?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Pe.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:f.map((g,b)=>l.jsx("li",{children:g.message},`${g.code}-${g.nodeId??b}`))})]})}),l.jsxs("div",{className:Pe.modalFooter,children:[l.jsx(je,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(je,{variant:"primary",onClick:t,disabled:!m,children:n.publishChecklist.yesButton})]})]})})},kS=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=Y(m=>{var g,b;return(b=(g=m.editorConfig)==null?void 0:g.config)==null?void 0:b.objectType})||"Content",o=Y(m=>m.editorProfile.key==="learningPath"),a=Y(m=>m.publishChecklist)??[],[i,c]=p.useState({}),d=a.every(m=>i[m.code]),u=a.length===0||d,f=()=>{t()};return o?l.jsx(IS,{objectType:s,onConfirm:t,onCancel:r}):l.jsx("div",{className:Pe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Pe.modal,children:[l.jsxs("div",{className:Pe.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),l.jsx("button",{className:Pe.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Pe.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:Pe.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(m=>l.jsxs("label",{className:Pe.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!i[m.code],onChange:g=>c(b=>({...b,[m.code]:g.target.checked}))}),l.jsx("span",{children:m.label})]},m.code))]})}),l.jsxs("div",{className:Pe.modalFooter,children:[l.jsx(je,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(je,{variant:"primary",onClick:f,disabled:!u,children:n.publishChecklist.yesButton})]})]})})},DS=({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,m=()=>{d?r(o.trim(),i):r(o.trim())};return l.jsx("div",{className:Pe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Pe.modal,children:[l.jsxs("div",{className:Pe.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:u}),l.jsx("button",{className:Pe.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Pe.modalBody,children:d?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Pe.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Pe.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:i,onChange:g=>c(Number(g.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":i}),l.jsx("span",{className:Pe.sliderValue,children:i})]}),l.jsxs("div",{className:Pe.sliderLabels,children:[l.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Pe.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:Pe.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:o,onChange:g=>a(g.target.value),rows:4})]})]}):l.jsxs("div",{className:Pe.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:Pe.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:o,onChange:g=>a(g.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:Pe.modalFooter,children:[l.jsx(je,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),l.jsx(je,{variant:d?"primary":"danger",onClick:m,disabled:f,children:d?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})},Vu=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function LS(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:Vu,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 OS(e){var r,n,s;return e.length?((s=(n=(r=(await Me.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Vu,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 NS(e){var r,n;return((n=(r=(await Me.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const $e={container:"_container_1hnn8_1",header:"_header_1hnn8_13",title:"_title_1hnn8_22",closeBtn:"_closeBtn_1hnn8_29",body:"_body_1hnn8_45",label:"_label_1hnn8_54",searchSection:"_searchSection_1hnn8_62",searchRow:"_searchRow_1hnn8_68",searchInput:"_searchInput_1hnn8_74",searchSpinner:"_searchSpinner_1hnn8_89",resultsList:"_resultsList_1hnn8_105",resultItem:"_resultItem_1hnn8_118",userInfo:"_userInfo_1hnn8_133",userName:"_userName_1hnn8_141",userEmail:"_userEmail_1hnn8_150",userOrg:"_userOrg_1hnn8_158",noResults:"_noResults_1hnn8_167",collabSection:"_collabSection_1hnn8_174",sectionTitle:"_sectionTitle_1hnn8_179",badge:"_badge_1hnn8_189",emptyCollab:"_emptyCollab_1hnn8_203",collabList:"_collabList_1hnn8_214",collabItem:"_collabItem_1hnn8_223",userAvatar:"_userAvatar_1hnn8_237",error:"_error_1hnn8_251",success:"_success_1hnn8_257",footer:"_footer_1hnn8_263"},PS=({contentId:e,onClose:t})=>{var x,$;const r=ae(),n=Y(N=>N.editorConfig),s=(x=n==null?void 0:n.context)==null?void 0:x.channel,o=($=n==null?void 0:n.config)==null?void 0:$.objectType,[a,i]=p.useState(""),[c,d]=p.useState([]),[u,f]=p.useState(!1),[m,g]=p.useState([]),[b,h]=p.useState(!1),[v,y]=p.useState(""),[C,S]=p.useState(!1),w=p.useRef(null);p.useEffect(()=>{let N=!1;return(async()=>{try{const P=await iS(e),q=(P==null?void 0:P.collaborators)??[];if(!q.length)return;const F=await OS(q);if(N)return;const z=q.map(ne=>F.find(Q=>Q.identifier===ne)??{identifier:ne,firstName:ne});g(z)}catch{}})(),()=>{N=!0}},[e]),p.useEffect(()=>{w.current&&clearTimeout(w.current);const N=a.trim();if(N.length<2){d([]);return}return w.current=setTimeout(async()=>{f(!0);try{const P=await LS(N,{rootOrgId:s,objectType:o}),q=new Set(m.map(F=>F.identifier));d(P.filter(F=>!q.has(F.identifier)))}catch{d([])}finally{f(!1)}},300),()=>{w.current&&clearTimeout(w.current)}},[a,m,s,o]);const T=p.useCallback(N=>{g(P=>P.find(q=>q.identifier===N.identifier)?P:[...P,N]),d(P=>P.filter(q=>q.identifier!==N.identifier)),S(!1)},[]),A=p.useCallback(N=>{g(P=>P.filter(q=>q.identifier!==N)),S(!1)},[]),L=p.useCallback(async()=>{h(!0),y(""),S(!1);try{await dS(e,m.map(N=>N.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,m,r.manageCollaborators.saveFailed]),E=N=>`${N.firstName}${N.lastName?` ${N.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(fr,{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:N=>i(N.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(N=>{var P,q,F,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:E(N)}),N.email&&l.jsx("span",{className:$e.userEmail,children:N.email}),(((q=(P=N.organisations)==null?void 0:P[0])==null?void 0:q.orgName)??N.rootOrgName)&&l.jsx("span",{className:$e.userOrg,children:((z=(F=N.organisations)==null?void 0:F[0])==null?void 0:z.orgName)??N.rootOrgName})]}),l.jsx(je,{variant:"primary",size:"sm",onClick:()=>T(N),children:r.manageCollaborators.add})]},N.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,m.length>0&&l.jsx("span",{className:$e.badge,children:m.length})]}),m.length===0?l.jsx("p",{className:$e.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:$e.collabList,children:m.map(N=>{var P,q,F,z;return l.jsxs("li",{className:$e.collabItem,children:[l.jsx("div",{className:$e.userAvatar,"aria-hidden":"true",children:E(N).charAt(0).toUpperCase()}),l.jsxs("div",{className:$e.userInfo,children:[l.jsx("span",{className:$e.userName,children:E(N)}),N.email&&l.jsx("span",{className:$e.userEmail,children:N.email}),(((q=(P=N.organisations)==null?void 0:P[0])==null?void 0:q.orgName)??N.rootOrgName)&&l.jsx("span",{className:$e.userOrg,children:((z=(F=N.organisations)==null?void 0:F[0])==null?void 0:z.orgName)??N.rootOrgName})]}),l.jsx(je,{variant:"danger",size:"sm",onClick:()=>A(N.identifier),children:r.manageCollaborators.remove})]},N.identifier)})})]}),v&&l.jsx("p",{className:$e.error,role:"alert",children:v}),C&&l.jsx("p",{className:$e.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:$e.footer,children:[l.jsx(je,{variant:"ghost",onClick:t,disabled:b,children:r.manageCollaborators.cancel}),l.jsx(je,{variant:"primary",isLoading:b,onClick:L,children:r.manageCollaborators.save})]})]})};async function xS(e){return(await Me.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function FS(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 MS(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 Se={topbar:"_topbar_c3y0z_1",left:"_left_c3y0z_15",right:"_right_c3y0z_23",backBtn:"_backBtn_c3y0z_30",title:"_title_c3y0z_49",profileBadge:"_profileBadge_c3y0z_61",statusChip:"_statusChip_c3y0z_76",savedIndicator:"_savedIndicator_c3y0z_88",unsaved:"_unsaved_c3y0z_98",iconBtn:"_iconBtn_c3y0z_103",iconBtnLabel:"_iconBtnLabel_c3y0z_130",qrDropdown:"_qrDropdown_c3y0z_134",qrMenu:"_qrMenu_c3y0z_138",reviewBtns:"_reviewBtns_c3y0z_173",sourcingBtns:"_sourcingBtns_c3y0z_182",modalOverlay:"_modalOverlay_c3y0z_191",sbOverlay:"_sbOverlay_c3y0z_201",sbModal:"_sbModal_c3y0z_211",sbModalHeader:"_sbModalHeader_c3y0z_222",sbModalTitle:"_sbModalTitle_c3y0z_230",sbModalClose:"_sbModalClose_c3y0z_237",sbModalBody:"_sbModalBody_c3y0z_250",sbLabel:"_sbLabel_c3y0z_257",sbTextarea:"_sbTextarea_c3y0z_264",sbError:"_sbError_c3y0z_281",sbModalFooter:"_sbModalFooter_c3y0z_288"};function $S(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function BS(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const qS=({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:Se.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${u}-title`,children:l.jsxs("div",{className:Se.sbModal,children:[l.jsxs("div",{className:Se.sbModalHeader,children:[l.jsx("span",{id:`${u}-title`,className:Se.sbModalTitle,children:e}),l.jsx("button",{className:Se.sbModalClose,onClick:a,"aria-label":i.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:Se.sbModalBody,children:[l.jsxs("label",{className:Se.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:Se.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:Se.sbError,children:i.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:Se.sbModalFooter,children:[l.jsx(je,{variant:"ghost",onClick:a,children:i.reviewCommentModal.cancelButton}),l.jsx(je,{variant:s,onClick:()=>o(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},jS=({onConfirm:e,onCancel:t})=>{const r=ae(),[n,s]=p.useState(!1);return l.jsx("div",{className:Se.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:Se.sbModal,children:[l.jsxs("div",{className:Se.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:Se.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:Se.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:Se.sbModalBody,children: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:o=>s(o.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:Se.sbModalFooter,children:[l.jsx(je,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),l.jsx(je,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},US=({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:Se.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:Se.sbModal,children:[l.jsxs("div",{className:Se.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:Se.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:Se.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:Se.sbModalBody,children:[l.jsxs("label",{className:Se.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:Se.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:i=>s(i.target.value)}),n&&!a&&l.jsx("p",{className:Se.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:Se.sbModalFooter,children:[l.jsx(je,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(je,{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 Ce,ue;const a=ae(),c=le(de=>de.treeData)[0],d=(c==null?void 0:c.name)??a.contextualEditor.untitledPlaceholder,u=BS(((Ce=c==null?void 0:c.metadata)==null?void 0:Ce.status)??(c==null?void 0:c.status),a.topbar.draftStatusFallback),f=Y(de=>{var W,se,Ae,ge;return((se=(W=de.editorConfig)==null?void 0:W.context)==null?void 0:se.contentId)??((ge=(Ae=de.editorConfig)==null?void 0:Ae.context)==null?void 0:ge.identifier)??""}),{activeModal:m,modalData:g,closeModal:b,openModal:h}=Fr(),v=Y(de=>de.buttonLoaders),y=Y(de=>de.categoryMeta),C=Y(de=>de.editorProfile),S=C.key==="learningPath",w=C.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[T,A]=p.useState(!1),[L,E]=p.useState(!1),[x,$]=p.useState(!1),N=p.useRef(null),[P,q]=p.useState(!1);p.useEffect(()=>{if(!x)return;const de=W=>{var se;(se=N.current)!=null&&se.contains(W.target)||$(!1)};return document.addEventListener("mousedown",de),()=>document.removeEventListener("mousedown",de)},[x]);const[F,z]=p.useState(!1),[ne,Q]=p.useState(!1),{updateNode:te}=le(),pe=(ue=c==null?void 0:c.metadata)==null?void 0:ue.qrCodeProcessId,ie=p.useCallback(async de=>{if(f){q(!1),z(!0);try{const{processId:W,reservedDialcodes:se}=await FS(f,de);W&&c&&te(c.id,{qrCodeProcessId:W,reservedDialcodes:se}),we.success(a.topbar.qrGenerationStartedToast)}catch{we.error(a.topbar.qrGenerationFailedToast)}finally{z(!1)}}},[f,c,te,a]),me=p.useCallback(async()=>{if(!pe){we.error(a.topbar.qrCodesNotGeneratedToast);return}Q(!0);try{const de=await MS(pe);if(de.status==="in-process"){we(a.topbar.qrGenerationInProgressToast,{icon:l.jsx(Es,{size:16})});return}const W=de.url;if(!W){we.error(a.topbar.qrCodesNotReadyToast);return}const se=await fetch(W).then(st=>st.blob()),Ae=await new Promise(st=>{const dt=new FileReader;dt.onloadend=()=>st(dt.result),dt.readAsDataURL(se)}),ge=(c==null?void 0:c.metadata)??{},ee=st=>Array.isArray(st)?st.join("_"):typeof st=="string"?st:"",Ge=[f,ee(ge.medium),ee(ge.gradeLevel),ee(ge.subject)].filter(Boolean),Ye=new Date().toISOString().replace(/[:.]/g,"-"),rt=`${Ge.join("_")}_${Ye}.zip`,Ke=document.createElement("a");Ke.href=Ae,Ke.download=rt,Ke.style.display="none",document.body.appendChild(Ke),Ke.click(),document.body.removeChild(Ke),we.success(a.topbar.qrCodesDownloadedToast)}catch{we.error(a.topbar.qrCodesDownloadFailedToast)}finally{Q(!1)}},[pe,c,f,a]),ve=e==="edit",Ee=e==="review",ye=e==="sourcingreview",M=e==="read",B=p.useCallback((de,W)=>{o({action:de,data:W})},[o]),Z=p.useCallback(()=>{b(),B("publish")},[b,B]),ce=p.useCallback((de,W)=>{const se=g==null?void 0:g.action;b(),se==="approve"?B("sourcingApprove",{comment:de,score:W}):B("reject",{comment:de})},[b,B,g]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:Se.topbar,role:"banner",children:[l.jsxs("div",{className:Se.left,children:[l.jsx("button",{className:Se.backBtn,onClick:()=>B("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:l.jsx(di,{size:18})}),l.jsx("h1",{className:Se.title,title:d,children:d}),S&&l.jsxs("span",{className:Se.profileBadge,children:[l.jsx(qu,{size:13,"aria-hidden":"true"}),a.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${Se.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${u}`,children:u})]}),l.jsxs("div",{className:Se.right,children:[t?l.jsx("span",{className:Se.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&ve?l.jsx("span",{className:`${Se.savedIndicator} ${Se.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?l.jsxs("span",{className:Se.savedIndicator,"aria-live":"polite",children:[l.jsx(Zr,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",$S(n)]}):null,!M&&!Ee&&!ye&&u!=="Review"&&l.jsx("span",{title:s?void 0:a.topbar.fillRequiredFieldsTooltip,children:l.jsx(je,{variant:"ghost",size:"sm",onClick:()=>B("saveCollection"),disabled:!s,children:a.topbar.saveAsDraftButton})}),ve&&l.jsxs(l.Fragment,{children:[l.jsxs(je,{variant:"primary",size:"sm",onClick:()=>E(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(xy,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),C.features.collaborators&&l.jsx("button",{className:Se.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:l.jsx(Uy,{size:16,"aria-hidden":"true"})}),w&&l.jsxs("div",{className:Se.qrDropdown,ref:N,children:[l.jsxs("button",{className:Se.iconBtn,onClick:()=>$(de=>!de),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":x,children:[l.jsx(Sd,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:Se.iconBtnLabel,children:a.topbar.qrCodesLabel}),l.jsx(Xr,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),x&&l.jsxs("div",{className:Se.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{$(!1),q(!0)},disabled:F,children:[l.jsx(Sd,{size:14}),F?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{$(!1),me()},disabled:ne||!pe,children:[l.jsx(Cy,{size:14}),ne?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),Ee&&l.jsxs("div",{className:Se.reviewBtns,children:[l.jsxs(je,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(hd,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),l.jsxs(je,{variant:"primary",size:"sm",onClick:()=>A(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(wd,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),ye&&l.jsxs("div",{className:Se.sourcingBtns,children:[l.jsxs(je,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(My,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),l.jsxs(je,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(wd,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&l.jsx(kS,{contentId:f,onConfirm:Z,onCancel:b}),m==="qualityParams"&&l.jsx(DS,{contentId:f,action:(g==null?void 0:g.action)??"reject",onConfirm:ce,onCancel:b}),m==="manageCollaborators"&&l.jsx("div",{className:Se.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(PS,{contentId:f,onClose:b})}),L&&l.jsx(jS,{onConfirm:()=>{E(!1),B("sendForReview")},onCancel:()=>E(!1)}),T&&l.jsx(qS,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:de=>{A(!1),B("reject",{comment:de})},onCancel:()=>A(!1)}),P&&l.jsx(US,{onConfirm:ie,onCancel:()=>q(!1)})]})},VS=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=ae();return ze.createPortal(l.jsx("div",{className:Pe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Pe.modal,children:[l.jsxs("div",{className:Pe.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),l.jsx("button",{className:Pe.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Pe.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Pe.modalFooter,children:[l.jsx(je,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),l.jsx(je,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),l.jsx(je,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var HS=vi();const Hu=p.createContext(null);function $t(){const e=p.useContext(Hu);if(e===null)throw new Error("No Tree Api Provided");return e}const Qu=p.createContext(null);function QS(){const e=p.useContext(Qu);if(e===null)throw new Error("Provide a NodesContext");return e}const Wu=p.createContext(null);function WS(){const e=p.useContext(Wu);if(e===null)throw new Error("Provide a DnDContext");return e}const Ru=p.createContext(0);function Gu(){p.useContext(Ru)}function ra(e,t,r){return Math.max(Math.min(e,r),t)}function Ku(e){return e&&e.isLeaf}function Yu(e){return e&&e.isInternal&&!e.isOpen}function Zu(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const Xu=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Ju=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Vi(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Vi(r,t);if(n)return n}return null}function na(e,t){if(t(e),e.children)for(let r of e.children)na(r,t)}function ef(e){const t=rf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=RS(t,n);break}r==null||r.focus()}function tf(e){const t=rf(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=GS(t,n);break}r==null||r.focus()}function RS(e,t){return t+1<e.length?e[t+1]:e[0]}function GS(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function rf(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 xs(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function xn(e){return typeof e=="string"?e:e.id}function KS(e,...t){if(e)return e(...t)}function nf(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function sf(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 of(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const YS=Object.freeze(Object.defineProperty({__proto__:null,access:xs,bound:ra,dfs:Vi,focusNextElement:ef,focusPrevElement:tf,getInsertIndex:sf,getInsertParentId:of,identify:xn,indexOf:Ju,isClosed:Yu,isDescendant:Xu,isItem:Ku,isOpenWithEmptyChildren:Zu,safeRun:KS,waitFor:nf,walk:na},Symbol.toStringTag,{value:"Module"})),ZS={display:"flex",alignItems:"center",zIndex:1},XS={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},JS={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},ew=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({},ZS),s),children:[l.jsx("div",{style:Object.assign({},JS)}),l.jsx("div",{style:Object.assign({},XS)})]})});function tw({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 rw(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(sw,Object.assign({},e)):l.jsx(nw,Object.assign({},e))]})}function nw(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function sw({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 Fs="__REACT_ARBORIST_INTERNAL_ROOT__";function af(e){var t;function r(o,a,i){const c=e.accessId(o),d=new Ms({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 Ms({tree:e,id:Fs,data:{id:Fs},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 Ms{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===Fs}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 Ms(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Hi(e){return{type:"EDIT",id:e}}function ow(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function Fn(e){return{type:"FOCUS",id:e}}function aw(){return{type:"TREE_BLUR"}}function iw(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 Qi={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 lf(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 lw(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:lf(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:lf(e.unfiltered,t)}):e}const Mn=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:xn(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(xn)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(xn)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:xn(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:xn(e)})};function cw(e=Mn().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 $n={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 dw(e=Mn().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 Mn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const uw={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},fw=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},hw=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function cf({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(pw,{isDragging:s,children:[l.jsx(gw,{offset:e,children:l.jsx(vw,{id:r,dragIds:n})}),l.jsx(mw,{mouse:t,count:n.length})]})}const pw=p.memo(function(t){return t.isDragging?l.jsx("div",{style:uw,children:t.children}):null});function gw(e){return l.jsx("div",{className:"row preview",style:fw(e.offset),children:e.children})}function mw(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:hw(r),children:t}):null}const vw=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 Wi(){return Wi=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},Wi.apply(null,arguments)}function df(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ri(e,t){return Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ri(e,t)}function yw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ri(e,t)}var uf=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function bw(e,t){return!!(e===t||uf(e)&&uf(t))}function Cw(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!bw(e[r],t[r]))return!1;return!0}function Gi(e,t){t===void 0&&(t=Cw);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 Sw=typeof performance=="object"&&typeof performance.now=="function",ff=Sw?function(){return performance.now()}:function(){return Date.now()};function hf(e){cancelAnimationFrame(e.id)}function ww(e,t){var r=ff();function n(){ff()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Ki=-1;function pf(e){if(e===void 0&&(e=!1),Ki===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ki=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ki}var Bn=null;function gf(e){if(e===void 0&&(e=!1),Bn===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?Bn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Bn="negative":Bn="positive-ascending"),document.body.removeChild(t),Bn}return Bn}process.env.NODE_ENV;var _w=150,Tw=function(t,r){return t},sa=null,oa=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(sa=new WeakSet,oa=new WeakSet);function mf(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){yw(m,f);function m(b){var h;return h=f.call(this,b)||this,h._instanceProps=c(h.props,df(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:df(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Gi(function(v,y,C,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Gi(function(v,y,C){return h.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:C})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var y=h.props,C=y.direction,S=y.itemSize,w=y.layout,T=h._getItemStyleCache(d&&S,d&&w,d&&C),A;if(T.hasOwnProperty(v))A=T[v];else{var L=r(h.props,v,h._instanceProps),E=s(h.props,v,h._instanceProps),x=C==="horizontal"||w==="horizontal",$=C==="rtl",N=x?L:0;T[v]=A={position:"absolute",left:$?void 0:N,right:$?N:void 0,top:x?0:L,height:x?"100%":E,width:x?E:"100%"}}return A},h._getItemStyleCache=void 0,h._getItemStyleCache=Gi(function(v,y,C){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,S=y.scrollLeft,w=y.scrollWidth;h.setState(function(T){if(T.scrollOffset===S)return null;var A=h.props.direction,L=S;if(A==="rtl")switch(gf()){case"negative":L=-S;break;case"positive-descending":L=w-C-S;break}return L=Math.max(0,Math.min(L,w-C)),{isScrolling:!0,scrollDirection:T.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,S=y.scrollHeight,w=y.scrollTop;h.setState(function(T){if(T.scrollOffset===w)return null;var A=Math.max(0,Math.min(w,S-C));return{isScrolling:!0,scrollDirection:T.scrollOffset<A?"forward":"backward",scrollOffset:A,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&&hf(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=ww(h._resetIsScrolling,_w)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}m.getDerivedStateFromProps=function(h,v){return Ew(h,v),u(h),null};var g=m.prototype;return g.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)},g.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,S=y.layout,w=this.state.scrollOffset;h=Math.max(0,Math.min(h,C-1));var T=0;if(this._outerRef){var A=this._outerRef;S==="vertical"?T=A.scrollWidth>A.clientWidth?pf():0:T=A.scrollHeight>A.clientHeight?pf():0}this.scrollTo(o(this.props,h,v,w,this._instanceProps,T))},g.componentDidMount=function(){var h=this.props,v=h.direction,y=h.initialScrollOffset,C=h.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||C==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},g.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,C=this.state,S=C.scrollOffset,w=C.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var T=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(gf()){case"negative":T.scrollLeft=-S;break;case"positive-ascending":T.scrollLeft=S;break;default:var A=T.clientWidth,L=T.scrollWidth;T.scrollLeft=L-A-S;break}else T.scrollLeft=S;else T.scrollTop=S}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&hf(this._resetIsScrollingTimeoutId)},g.render=function(){var h=this.props,v=h.children,y=h.className,C=h.direction,S=h.height,w=h.innerRef,T=h.innerElementType,A=h.innerTagName,L=h.itemCount,E=h.itemData,x=h.itemKey,$=x===void 0?Tw:x,N=h.layout,P=h.outerElementType,q=h.outerTagName,F=h.style,z=h.useIsScrolling,ne=h.width,Q=this.state.isScrolling,te=C==="horizontal"||N==="horizontal",pe=te?this._onScrollHorizontal:this._onScrollVertical,ie=this._getRangeToRender(),me=ie[0],ve=ie[1],Ee=[];if(L>0)for(var ye=me;ye<=ve;ye++)Ee.push(p.createElement(v,{data:E,key:$(ye,E),index:ye,isScrolling:z?Q:void 0,style:this._getItemStyle(ye)}));var M=n(this.props,this._instanceProps);return p.createElement(P||q||"div",{className:y,onScroll:pe,ref:this._outerRefSetter,style:Wi({position:"relative",height:S,width:ne,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},F)},p.createElement(T||A||"div",{children:Ee,ref:w,style:{height:te?"100%":M,pointerEvents:Q?"none":void 0,width:te?M:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>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 T=this.state,A=T.scrollDirection,L=T.scrollOffset,E=T.scrollUpdateWasRequested;this._callOnScroll(A,L,E)}},g._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,C=this.state,S=C.isScrolling,w=C.scrollDirection,T=C.scrollOffset;if(v===0)return[0,0,0,0];var A=a(this.props,T,this._instanceProps),L=i(this.props,A,T,this._instanceProps),E=!S||w==="backward"?Math.max(1,y):1,x=!S||w==="forward"?Math.max(1,y):1;return[Math.max(0,A-E),Math.max(0,Math.min(v-1,L+x)),A,L]},m})(p.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ew=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)&&oa&&!oa.has(u)&&(oa.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":sa&&!sa.has(u)&&(sa.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.'))}},Aw=50,qn=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]},Iw=function(t,r,n){var s=r.itemMetadataMap,o=r.lastMeasuredIndex,a=o>0?s[o].offset:0;return a>=n?vf(t,r,o,0,n):kw(t,r,Math.max(0,o),n)},vf=function(t,r,n,s,o){for(;s<=n;){var a=s+Math.floor((n-s)/2),i=qn(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},kw=function(t,r,n,s){for(var o=t.itemCount,a=1;n<o&&qn(t,n,r).offset<s;)n+=a,a*=2;return vf(t,r,Math.min(n,o-1),Math.floor(n/2),s)},yf=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},Dw=mf({getItemOffset:function(t,r,n){return qn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:yf,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",m=f?u:c,g=qn(t,r,o),b=yf(t,o),h=Math.max(0,Math.min(b-m,g.offset)),v=Math.max(0,g.offset-m+g.size+a);switch(n==="smart"&&(s>=v-m&&s<=h+m?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 Iw(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,m=qn(t,r,s),g=n+f,b=m.offset+m.size,h=r;h<i-1&&b<g;)h++,b+=qn(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,o={itemMetadataMap:{},estimatedItemSize:s||Aw,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.'))}}),Lw=mf({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,m=t.width,g=i==="horizontal"||f==="horizontal",b=g?m:c,h=Math.max(0,d*u-b),v=Math.min(h,r*u),y=Math.max(0,r*u-b+u+a);switch(n==="smart"&&(s>=y-b&&s<=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>h+Math.floor(b/2)?h:C}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,m=u?d:o,g=Math.ceil((m+n-f)/i);return Math.max(0,Math.min(a-1,r+g-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 Ow(){var e,t;const r=$t(),s=WS().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 Nw=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 Pw=p.forwardRef(function(t,r){const{children:n}=t,s=Nw(t,["children"]),o=$t();return l.jsxs("div",Object.assign({ref:r},s,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[l.jsx(xw,{}),n]}))}),xw=()=>{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(Ow,{})})};var Fw=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 Mw=p.forwardRef(function(t,r){var n,s,o,a,{style:i}=t,c=Fw(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 bf=p.createContext({dragDropManager:void 0}),Kt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Kt||(Kt={}));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 Yi="dnd-core/INIT_COORDS",aa="dnd-core/BEGIN_DRAG",Zi="dnd-core/PUBLISH_DRAG_SOURCE",ia="dnd-core/HOVER",la="dnd-core/DROP",ca="dnd-core/END_DRAG";function Cf(e,t){return{type:Yi,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function da(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?da=function(r){return typeof r}:da=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},da(e)}function $w(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function Bw(e,t){return e.filter(function(r){return r!==t})}function Sf(e){return da(e)==="object"}function qw(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 jw(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var Uw={type:Yi,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(Cf(a)),Vw(r,c,d);var u=Ww(r,c);if(u===null){e.dispatch(Uw);return}var f=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");Hw(i),f=i(u)}e.dispatch(Cf(a,f));var m=d.getSource(u),g=m.beginDrag(c,u);if(g!=null){Qw(g),d.pinSource(u);var b=d.getSourceType(u);return{type:aa,payload:{itemType:b,item:g,sourceId:u,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}}function Vw(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 Hw(e){Te(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Qw(e){Te(Sf(e),"Item must be an object.")}function Ww(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 Rw(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Zi}}}function Xi(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function Gw(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;Kw(r);var o=r.slice(0),a=e.getMonitor(),i=e.getRegistry();Yw(o,a,i);var c=a.getItemType();return Zw(o,i,c),Xw(o,a,i),{type:ia,payload:{targetIds:o,clientOffset:s||null}}}}function Kw(e){Te(Array.isArray(e),"Expected targetIds to be an array.")}function Yw(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 Zw(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],o=t.getTargetType(s);Xi(o,r)||e.splice(n,1)}}function Xw(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function wf(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?wf(Object(r),!0).forEach(function(n){Jw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e_(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();t_(n);var o=s_(n);o.forEach(function(a,i){var c=r_(a,i,s,n),d={type:la,payload:{dropResult:_f(_f({},r),c)}};e.dispatch(d)})}}function t_(e){Te(e.isDragging(),"Cannot call drop while not dragging."),Te(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function r_(e,t,r,n){var s=r.getTarget(e),o=s?s.drop(n,e):void 0;return n_(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function n_(e){Te(typeof e>"u"||Sf(e),"Drop result must either be an object or undefined.")}function s_(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function o_(e){return function(){var r=e.getMonitor(),n=e.getRegistry();a_(r);var s=r.getSourceId();if(s!=null){var o=n.getSource(s,!0);o.endDrag(r,s),n.unpinSource()}return{type:ca}}}function a_(e){Te(e.isDragging(),"Cannot call endDrag while not dragging.")}function i_(e){return{beginDrag:zw(e),publishDragSource:Rw(e),hover:Gw(e),drop:e_(e),endDrag:o_(e)}}function l_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c_(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 d_(e,t,r){return t&&c_(e.prototype,t),e}function $s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u_=(function(){function e(t,r){var n=this;l_(this,e),$s(this,"store",void 0),$s(this,"monitor",void 0),$s(this,"backend",void 0),$s(this,"isSetUp",!1),$s(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 d_(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=i_(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 Yt(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 Tf=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Ef=function(){return Math.random().toString(36).substring(7).split("").join(".")},Af={INIT:"@@redux/INIT"+Ef(),REPLACE:"@@redux/REPLACE"+Ef()};function f_(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 h_(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(m_(e))return"date";if(g_(e))return"error";var r=p_(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 p_(e){return typeof e.constructor=="function"?e.constructor.name:null}function g_(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function m_(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function jn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=h_(e)),t}function If(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"?Yt(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"?Yt(1):"Expected the enhancer to be a function. Instead, received: '"+jn(r)+"'");return r(If)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Yt(2):"Expected the root reducer to be a function. Instead, received: '"+jn(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"?Yt(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"?Yt(4):"Expected the listener to be a function. Instead, received: '"+jn(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Yt(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"?Yt(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(h);i.splice(C,1),a=null}}}function m(h){if(!f_(h))throw new Error(process.env.NODE_ENV==="production"?Yt(7):"Actions must be plain objects. Instead, the actual type was: '"+jn(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"?Yt(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"?Yt(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 C=v[y];C()}return h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Yt(10):"Expected the nextReducer to be a function. Instead, received: '"+jn(h));s=h,m({type:Af.REPLACE})}function b(){var h,v=f;return h={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Yt(11):"Expected the observer to be an object. Instead, received: '"+jn(C)+"'");function S(){C.next&&C.next(u())}S();var w=v(S);return{unsubscribe:w}}},h[Tf]=function(){return this},h}return m({type:Af.INIT}),n={dispatch:m,subscribe:f,getState:u,replaceReducer:g},n[Tf]=b,n}var v_=function(t,r){return t===r};function y_(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function b_(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v_;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 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 Df(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){C_(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 C_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Lf={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function S_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lf,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Yi:case aa:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case ia:return y_(e.clientOffset,r.clientOffset)?e:Df(Df({},e),{},{clientOffset:r.clientOffset});case ca:case la:return Lf;default:return e}}var Ji="dnd-core/ADD_SOURCE",el="dnd-core/ADD_TARGET",tl="dnd-core/REMOVE_SOURCE",ua="dnd-core/REMOVE_TARGET";function w_(e){return{type:Ji,payload:{sourceId:e}}}function __(e){return{type:el,payload:{targetId:e}}}function T_(e){return{type:tl,payload:{sourceId:e}}}function E_(e){return{type:ua,payload:{targetId:e}}}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 Zt(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){A_(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 A_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I_={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function k_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I_,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case aa:return Zt(Zt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Zi:return Zt(Zt({},e),{},{isSourcePublic:!0});case ia:return Zt(Zt({},e),{},{targetIds:r.targetIds});case ua:return e.targetIds.indexOf(r.targetId)===-1?e:Zt(Zt({},e),{},{targetIds:Bw(e.targetIds,r.targetId)});case la:return Zt(Zt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case ca:return Zt(Zt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function D_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ji:case el:return e+1;case tl:case ua:return e-1;default:return e}}var fa=[],rl=[];fa.__IS_NONE__=!0,rl.__IS_ALL__=!0;function L_(e,t){if(e===fa)return!1;if(e===rl||typeof t>"u")return!0;var r=jw(t,e);return r.length>0}function O_(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case ia:break;case Ji:case el:case ua:case tl:return fa;case aa:case Zi:case ca:case la:default:return rl}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,o=s===void 0?[]:s,a=qw(n,o),i=a.length>0||!b_(n,o);if(!i)return fa;var c=o[o.length-1],d=n[n.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function N_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Nf(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 Pf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nf(Object(r),!0).forEach(function(n){P_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function P_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:O_(e.dirtyHandlerIds,{type:t.type,payload:Pf(Pf({},t.payload),{},{prevTargetIds:$w(e,"dragOperation.targetIds",[])})}),dragOffset:S_(e.dragOffset,t),refCount:D_(e.refCount,t),dragOperation:k_(e.dragOperation,t),stateId:N_(e.stateId)}}function F_(e,t){return{x:e.x+t.x,y:e.y+t.y}}function xf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function M_(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:xf(F_(t,n),r)}function $_(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:xf(t,r)}function B_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q_(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 j_(e,t,r){return t&&q_(e.prototype,t),e}function Ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var U_=(function(){function e(t,r){B_(this,e),Ff(this,"store",void 0),Ff(this,"registry",void 0),this.store=t,this.registry=r}return j_(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&&!L_(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 Xi(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&&!Xi(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 M_(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return $_(this.store.getState().dragOffset)}}]),e})(),z_=0;function V_(){return z_++}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 H_(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 Q_(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 nl(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return nl(r,!1)});return}Te(typeof e=="string"||ha(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 Mf=typeof global<"u"?global:self,$f=Mf.MutationObserver||Mf.WebKitMutationObserver;function Bf(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function W_(e){let t=1;const r=new $f(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const R_=typeof $f=="function"?W_:Bf;class G_{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=R_(this.flush),this.requestErrorThrow=Bf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class K_{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 Y_{create(t){const r=this.freeTasks,n=r.length?r.pop():new K_(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const qf=new G_,Z_=new Y_(qf.registerPendingError);function X_(e){qf.enqueueTask(Z_.create(e))}function J_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e1(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 t1(e,t,r){return t&&e1(e.prototype,t),e}function Un(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r1(e,t){return a1(e)||o1(e,t)||s1(e,t)||n1()}function n1(){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 s1(e,t){if(e){if(typeof e=="string")return jf(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 jf(e,t)}}function jf(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 o1(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 a1(e){if(Array.isArray(e))return e}function i1(e){var t=V_().toString();switch(e){case Kt.SOURCE:return"S".concat(t);case Kt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Uf(e){switch(e[0]){case"S":return Kt.SOURCE;case"T":return Kt.TARGET;default:Te(!1,"Cannot parse handler ID: ".concat(e))}}function zf(e,t){var r=e.entries(),n=!1;do{var s=r.next(),o=s.done,a=r1(s.value,2),i=a[1];if(i===t)return!0;n=!!o}while(!n);return!1}var l1=(function(){function e(t){J_(this,e),Un(this,"types",new Map),Un(this,"dragSources",new Map),Un(this,"dropTargets",new Map),Un(this,"pinnedSourceId",null),Un(this,"pinnedSource",null),Un(this,"store",void 0),this.store=t}return t1(e,[{key:"addSource",value:function(r,n){nl(r),H_(n);var s=this.addHandler(Kt.SOURCE,r,n);return this.store.dispatch(w_(s)),s}},{key:"addTarget",value:function(r,n){nl(r,!0),Q_(n);var s=this.addHandler(Kt.TARGET,r,n);return this.store.dispatch(__(s)),s}},{key:"containsHandler",value:function(r){return zf(this.dragSources,r)||zf(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=Uf(r);return n===Kt.SOURCE}},{key:"isTargetId",value:function(r){var n=Uf(r);return n===Kt.TARGET}},{key:"removeSource",value:function(r){var n=this;Te(this.getSource(r),"Expected an existing source."),this.store.dispatch(T_(r)),X_(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(E_(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=i1(r);return this.types.set(o,n),r===Kt.SOURCE?this.dragSources.set(o,s):r===Kt.TARGET&&this.dropTargets.set(o,s),o}}]),e})();function c1(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=d1(n),o=new U_(s,new l1(s)),a=new u_(s,o),i=e(a,t,r);return a.receiveBackend(i),a}function d1(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return If(x_,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var u1=["children"];function f1(e,t){return m1(e)||g1(e,t)||p1(e,t)||h1()}function h1(){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 p1(e,t){if(e){if(typeof e=="string")return Vf(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 Vf(e,t)}}function Vf(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 g1(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 m1(e){if(Array.isArray(e))return e}function v1(e,t){if(e==null)return{};var r=y1(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 y1(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 Hf=0,pa=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),b1=p.memo(function(t){var r=t.children,n=v1(t,u1),s=C1(n),o=f1(s,2),a=o[0],i=o[1];return p.useEffect(function(){if(i){var c=Qf();return++Hf,function(){--Hf===0&&(c[pa]=null)}}},[]),l.jsx(bf.Provider,Object.assign({value:a},{children:r}),void 0)});function C1(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=S1(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function S1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qf(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[pa]||(s[pa]={dragDropManager:c1(e,t,r,n)}),s[pa]}function Qf(){return typeof global<"u"?global:window}function w1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _1(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 T1(e,t,r){return t&&_1(e.prototype,t),e}function Wf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sl=!1,ol=!1,E1=(function(){function e(t){w1(this,e),Wf(this,"internalMonitor",void 0),Wf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return T1(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Te(!sl,"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 sl=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{sl=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Te(!ol,"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 ol=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ol=!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 A1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I1(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 k1(e,t,r){return t&&I1(e.prototype,t),e}function Rf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var al=!1,D1=(function(){function e(t){A1(this,e),Rf(this,"internalMonitor",void 0),Rf(this,"targetId",null),this.internalMonitor=t.getMonitor()}return k1(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(!al,"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 al=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{al=!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 L1(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 O1(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;L1(s);var o=r?function(a){return e(a,r)}:e;return N1(s,o)}}function Gf(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=O1(n);t[r]=function(){return s}}}),t}function Kf(e,t){typeof e=="function"?e(t):e.current=t}function N1(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){Kf(r,s),Kf(t,s)}}):p.cloneElement(e,{ref:t})}function ga(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ga=function(r){return typeof r}:ga=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ga(e)}function il(e){return e!==null&&ga(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ll(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 P1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x1(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 F1(e,t,r){return t&&x1(e.prototype,t),e}function Tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M1=(function(){function e(t){var r=this;P1(this,e),Tt(this,"hooks",Gf({dragSource:function(s,o){r.clearDragSource(),r.dragSourceOptions=o||null,il(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,il(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),Tt(this,"handlerId",null),Tt(this,"dragSourceRef",null),Tt(this,"dragSourceNode",void 0),Tt(this,"dragSourceOptionsInternal",null),Tt(this,"dragSourceUnsubscribe",void 0),Tt(this,"dragPreviewRef",null),Tt(this,"dragPreviewNode",void 0),Tt(this,"dragPreviewOptionsInternal",null),Tt(this,"dragPreviewUnsubscribe",void 0),Tt(this,"lastConnectedHandlerId",null),Tt(this,"lastConnectedDragSource",null),Tt(this,"lastConnectedDragSourceOptions",null),Tt(this,"lastConnectedDragPreview",null),Tt(this,"lastConnectedDragPreviewOptions",null),Tt(this,"backend",void 0),this.backend=t}return F1(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!ll(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ll(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 $1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B1(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 q1(e,t,r){return t&&B1(e.prototype,t),e}function hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j1=(function(){function e(t){var r=this;$1(this,e),hr(this,"hooks",Gf({dropTarget:function(s,o){r.clearDropTarget(),r.dropTargetOptions=o,il(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),hr(this,"handlerId",null),hr(this,"dropTargetRef",null),hr(this,"dropTargetNode",void 0),hr(this,"dropTargetOptionsInternal",null),hr(this,"unsubscribeDropTarget",void 0),hr(this,"lastConnectedHandlerId",null),hr(this,"lastConnectedDropTarget",null),hr(this,"lastConnectedDropTargetOptions",null),hr(this,"backend",void 0),this.backend=t}return q1(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!ll(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 U1(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 sn=typeof window<"u"?p.useLayoutEffect:p.useEffect;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 V1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H1(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 Q1(e,t,r){return t&&H1(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 W1=(function(){function e(t,r,n){V1(this,e),cl(this,"spec",void 0),cl(this,"monitor",void 0),cl(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return Q1(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,o=null;return ma(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 R1(e,t,r){var n=p.useMemo(function(){return new W1(e,t,r)},[t,r]);return p.useEffect(function(){n.spec=e},[e]),n}function on(){var e=p.useContext(bf),t=e.dragDropManager;return Te(t!=null,"Expected drag drop context"),t}function G1(e){return p.useMemo(function(){var t=e.type;return Te(t!=null,"spec.type must be defined"),t},[e])}function K1(e,t){return J1(e)||X1(e,t)||Z1(e,t)||Y1()}function Y1(){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 Z1(e,t){if(e){if(typeof e=="string")return Yf(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 Yf(e,t)}}function Yf(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 X1(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 J1(e){if(Array.isArray(e))return e}function e0(e,t,r){var n=on(),s=R1(e,t,r),o=G1(e);sn(function(){if(o!=null){var i=z1(o,s,n),c=K1(i,2),d=c[0],u=c[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),u}},[n,t,r,s,o])}function t0(e){return o0(e)||s0(e)||n0(e)||r0()}function r0(){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 n0(e,t){if(e){if(typeof e=="string")return dl(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 dl(e,t)}}function s0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o0(e){if(Array.isArray(e))return dl(e)}function dl(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 Zf(e,t){var r=t0(t||[]);return t==null&&typeof e!="function"&&r.push(e),p.useMemo(function(){return typeof e=="function"?e():e},r)}function a0(){var e=on();return p.useMemo(function(){return new E1(e)},[e])}function i0(e,t){var r=on(),n=p.useMemo(function(){return new M1(r.getBackend())},[r]);return sn(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),sn(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var ul,Xf;function l0(){return Xf||(Xf=1,ul=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}),ul}var c0=l0();const d0=hi(c0);function u0(e,t){return g0(e)||p0(e,t)||h0(e,t)||f0()}function f0(){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 h0(e,t){if(e){if(typeof e=="string")return Jf(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 Jf(e,t)}}function Jf(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 p0(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 g0(e){if(Array.isArray(e))return e}function eh(e,t,r){var n=p.useState(function(){return t(e)}),s=u0(n,2),o=s[0],a=s[1],i=p.useCallback(function(){var c=t(e);d0(o,c)||(a(c),r&&r())},[o,e,r]);return sn(i),[o,i]}function m0(e,t){return C0(e)||b0(e,t)||y0(e,t)||v0()}function v0(){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 y0(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 b0(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 C0(e){if(Array.isArray(e))return e}function S0(e,t,r){var n=eh(e,t,r),s=m0(n,2),o=s[0],a=s[1];return sn(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(a,{handlerIds:[c]})},[e,a]),o}function rh(e,t,r){return S0(t,e||function(){return{}},function(){return r.reconnect()})}function w0(e){return p.useMemo(function(){return e.hooks.dragSource()},[e])}function _0(e){return p.useMemo(function(){return e.hooks.dragPreview()},[e])}function T0(e,t){var r=Zf(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=a0(),s=i0(r.options,r.previewOptions);return e0(r,n,s),[rh(r.collect,n,s),w0(s),_0(s)]}function E0(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 A0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I0(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 k0(e,t,r){return t&&I0(e.prototype,t),e}function nh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var D0=(function(){function e(t,r){A0(this,e),nh(this,"spec",void 0),nh(this,"monitor",void 0),this.spec=t,this.monitor=r}return k0(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 L0(e,t){var r=p.useMemo(function(){return new D0(e,t)},[t]);return p.useEffect(function(){r.spec=e},[e]),r}function O0(e,t){return F0(e)||x0(e,t)||P0(e,t)||N0()}function N0(){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 P0(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 x0(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 F0(e){if(Array.isArray(e))return e}function M0(e,t,r){var n=on(),s=L0(e,t),o=E0(e);sn(function(){var i=U1(o,s,n),c=O0(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 $0(){var e=on();return p.useMemo(function(){return new D1(e)},[e])}function B0(e){var t=on(),r=p.useMemo(function(){return new j1(t.getBackend())},[t]);return sn(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function q0(e){return p.useMemo(function(){return e.hooks.dropTarget()},[e])}function oh(e,t){var r=Zf(e,t),n=$0(),s=B0(r.options);return M0(r,n,s),[rh(r.collect,n,s),q0(s)]}function j0(e,t){return H0(e)||V0(e,t)||z0(e,t)||U0()}function U0(){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 z0(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 V0(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 H0(e){if(Array.isArray(e))return e}function Q0(e){var t=on(),r=t.getMonitor(),n=eh(r,e),s=j0(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 ih(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function W0(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 G0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K0(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 Y0(e,t,r){return t&&K0(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 Z0=(function(){function e(t){G0(this,e),lh(this,"entered",[]),lh(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return Y0(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=W0(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),X0=ih(function(){return/firefox/i.test(navigator.userAgent)}),ch=ih(function(){return!!window.safari});function J0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eT(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 tT(e,t,r){return t&&eT(e.prototype,t),e}function Bs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var dh=(function(){function e(t,r){J0(this,e),Bs(this,"xs",void 0),Bs(this,"ys",void 0),Bs(this,"c1s",void 0),Bs(this,"c2s",void 0),Bs(this,"c3s",void 0);for(var n=t.length,s=[],o=0;o<n;o++)s.push(o);s.sort(function(E,x){return t[E]<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]],m=0;m<a.length-1;m++){var g=i[m],b=i[m+1];if(g*b<=0)f.push(0);else{c=a[m];var h=a[m+1],v=c+h;f.push(3*v/((v+h)/g+(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 T=f[w],A=1/a[w],L=T+f[w+1]-S-S;y.push((S-T-L)*A),C.push(L*A*A)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=C}return tT(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 m=n[f];if(m<r)d=f+1;else if(m>r)u=f-1;else return s[f]}c=Math.max(0,u);var g=r-n[c],b=g*g;return s[c]+o[c]*g+a[c]*b+i[c]*g*b}}]),e})(),rT=1;function uh(e){var t=e.nodeType===rT?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function va(e){return{x:e.clientX,y:e.clientY}}function nT(e){var t;return e.nodeName==="IMG"&&(X0()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function sT(e,t,r,n){var s=e?t.width:r,o=e?t.height:n;return ch()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function oT(e,t,r,n,s){var o=nT(t),a=o?e:t,i=uh(a),c={x:r.x-i.x,y:r.y-i.y},d=e.offsetWidth,u=e.offsetHeight,f=n.anchorX,m=n.anchorY,g=sT(o,t,d,u),b=g.dragPreviewWidth,h=g.dragPreviewHeight,v=function(){var L=new dh([0,.5,1],[c.y,c.y/u*h,c.y+h-u]),E=L.interpolate(m);return ch()&&o&&(E+=(window.devicePixelRatio-1)*h),E},y=function(){var L=new dh([0,.5,1],[c.x,c.x/d*b,c.x+b-d]);return L.interpolate(f)},C=s.offsetX,S=s.offsetY,w=C===0||C,T=S===0||S;return{x:w?C:y(),y:T?S:v()}}var fh="__NATIVE_FILE__",hh="__NATIVE_URL__",ph="__NATIVE_TEXT__",gh="__NATIVE_HTML__";const mh=Object.freeze(Object.defineProperty({__proto__:null,FILE:fh,HTML:gh,TEXT:ph,URL:hh},Symbol.toStringTag,{value:"Module"}));function fl(e,t,r){var n=t.reduce(function(s,o){return s||e.getData(o)},"");return n??r}var zn;function ya(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var hl=(zn={},ya(zn,fh,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),ya(zn,gh,{exposeProperties:{html:function(t,r){return fl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),ya(zn,hh,{exposeProperties:{urls:function(t,r){return fl(t,r,"").split(`
545
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),ya(zn,ph,{exposeProperties:{text:function(t,r){return fl(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),zn);function aT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iT(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 lT(e,t,r){return t&&iT(e.prototype,t),e}function vh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cT=(function(){function e(t){aT(this,e),vh(this,"item",void 0),vh(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return lT(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 dT(e,t){var r=new cT(hl[e]);return r.loadDataTransfer(t),r}function pl(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(hl).filter(function(r){var n=hl[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function uT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fT(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 hT(e,t,r){return t&&fT(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 pT=(function(){function e(t,r){uT(this,e),gl(this,"ownerDocument",null),gl(this,"globalContext",void 0),gl(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return hT(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 yh(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 bh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yh(Object(r),!0).forEach(function(n){Le(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gT(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 vT(e,t,r){return t&&mT(e.prototype,t),e}function Le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yT=(function(){function e(t,r,n){var s=this;gT(this,e),Le(this,"options",void 0),Le(this,"actions",void 0),Le(this,"monitor",void 0),Le(this,"registry",void 0),Le(this,"enterLeaveCounter",void 0),Le(this,"sourcePreviewNodes",new Map),Le(this,"sourcePreviewNodeOptions",new Map),Le(this,"sourceNodes",new Map),Le(this,"sourceNodeOptions",new Map),Le(this,"dragStartSourceIds",null),Le(this,"dropTargetIds",[]),Le(this,"dragEnterTargetIds",[]),Le(this,"currentNativeSource",null),Le(this,"currentNativeHandle",null),Le(this,"currentDragSourceNode",null),Le(this,"altKeyPressed",!1),Le(this,"mouseMoveTimeoutTimer",null),Le(this,"asyncEndDragFrameId",null),Le(this,"dragOverTargetIds",null),Le(this,"lastClientOffset",null),Le(this,"hoverRafId",null),Le(this,"getSourceClientOffset",function(o){var a=s.sourceNodes.get(o);return a&&uh(a)||null}),Le(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),Le(this,"isNodeInDocument",function(o){return!!(o&&s.document&&s.document.body&&s.document.body.contains(o))}),Le(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=s.currentDragSourceNode;o==null||s.isNodeInDocument(o)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Le(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),Le(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=s.dragStartSourceIds;s.dragStartSourceIds=null;var i=va(o);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:i});var c=o.dataTransfer,d=pl(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=s.monitor.getSourceId(),f=s.sourceNodes.get(u),m=s.sourcePreviewNodes.get(u)||f;if(m){var g=s.getCurrentSourcePreviewNodeOptions(),b=g.anchorX,h=g.anchorY,v=g.offsetX,y=g.offsetY,C={anchorX:b,anchorY:h},S={offsetX:v,offsetY:y},w=oT(f,m,i,C,S);c.setDragImage(m,w.x,w.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(o.target);var T=s.getCurrentSourcePreviewNodeOptions(),A=T.captureDraggingState;A?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()}}}),Le(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Le(this,"handleTopDragEnterCapture",function(o){s.dragEnterTargetIds=[];var a=s.enterLeaveCounter.enter(o.target);if(!(!a||s.monitor.isDragging())){var i=o.dataTransfer,c=pl(i);c&&s.beginDragNativeItem(c,i)}}),Le(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:va(o)});var i=a.some(function(c){return s.monitor.canDropOnTarget(c)});i&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),Le(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),Le(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=va(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"))}),Le(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var a=s.enterLeaveCounter.leave(o.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),Le(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 pl(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),Le(this,"handleTopDrop",function(o){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:va(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),Le(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 pT(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Z0(this.isNodeInDocument)}return vT(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 bh({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 bh({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(mh).some(function(n){return mh[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=dT(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})(),ba;function bT(){return ba||(ba=new Image,ba.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ba}var CT=function(t,r,n){return new yT(t,r,n)};function ST(e,t){return typeof e=="function"?e(t):e??"NODE"}function wT(e){return e.isDraggable&&!e.isEditing}function _T(e){const t=$t(),r=t.selectedIds,[n,s,o]=T0(()=>({canDrag:()=>wT(e),type:ST(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch($n.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch($n.dragEnd())}}),[r,e,t.props.dragType]);return p.useEffect(()=>{o(bT())},[o]),s}function TT(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 ET(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 Ca(e,t){return{parentId:e||null,index:t}}function Vn(e,t){return{type:"line",index:e,level:t}}function AT(e){return{type:"highlight",id:e}}function ml(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=Ju(n)+1;return{parentId:s,index:o}}function Ch(e){var t;const r=TT(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]=ET(o,i,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:Ca(o.id,null),cursor:AT(o.id)};if(!c)return{drop:Ca((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:Vn(0,0)};if(Ku(c)){const u=ra(s,(d==null?void 0:d.level)||0,c.level);return{drop:ml(c,u),cursor:Vn(c.rowIndex+1,u)}}if(Yu(c)){const u=ra(s,(d==null?void 0:d.level)||0,c.level);return{drop:ml(c,u),cursor:Vn(c.rowIndex+1,u)}}if(Zu(c)){const u=ra(s,0,c.level+1);return u>c.level?{drop:Ca(c.id,0),cursor:Vn(c.rowIndex+1,u)}:{drop:ml(c,u),cursor:Vn(c.rowIndex+1,u)}}return{drop:Ca(c==null?void 0:c.id,0),cursor:Vn(c.rowIndex+1,c.level+1)}}function IT(e,t){const r=$t(),[n,s]=oh(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const i=a.getClientOffset();if(!e.current||!i)return;const{cursor:c,drop:d}=Ch({element:e.current,offset:i,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch($n.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 kT(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 Sh=p.memo(function({index:t,style:r}){Gu(),QS();const n=$t(),s=kT(t),o=p.useRef(null),a=_T(s),i=IT(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]),m={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 g=n.renderNode,b=n.renderRow;return l.jsx(b,{node:s,innerRef:c,attrs:m,children:l.jsx(g,{node:s,tree:n,style:u,dragHandle:a})})});let vl="",wh=null;function _h(){Gu();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(),ef(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),tf(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(wh),vl+=t.key,wh=setTimeout(()=>{vl=""},600);const n=e.visibleNodes.find(s=>{const o=s.data.name;return typeof o=="string"?o.toLowerCase().startsWith(vl):!1});n&&e.focus(n.id)},children:l.jsx(DT,{})})}function DT(){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:Pw,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:Mw,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(Dw,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Sh})):l.jsx(Lw,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Sh}))}function Th(e){return e.isFiltered?OT(e.root,e.isMatch.bind(e)):LT(e.root)}function LT(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(Eh),t}function OT(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(Eh),n}function Eh(e,t){e.rowIndex=t}const Ah=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var yl=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:Et}=YS;class qs{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=af(this),this.visibleNodes=Th(this),this.idToIndex=Ah(this.visibleNodes)}update(t){this.props=t,this.root=af(this),this.visibleNodes=Th(this),this.idToIndex=Ah(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=xs(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=xs(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 Ms)return t.id;const r=this.props.idAccessor||"id";return xs(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 yl(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?of(this):t.parentId,o=(r=t.index)!==null&&r!==void 0?r:sf(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",i=yield Et(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 yl(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 Et(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(Hi(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=>{qs.editPromise=o})}submit(t,r){return yl(this,void 0,void 0,function*(){var n,s;if(!t)return;const o=this.identify(t);yield Et(this.props.onRename,{id:o,name:r,node:this.get(o)}),this.dispatch(Hi(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(Hi(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&Et(this.props.onActivate,r)}resolveEdit(t){const r=qs.editPromise;r&&r(t),qs.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(Fn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&Et(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(Fn(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&&Et(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Mr.remove(r)),Et(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(Fn(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&&Et(this.props.onFocus,this.focusedNode),Et(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(Fn(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&&Et(this.props.onFocus,this.focusedNode),Et(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(Fn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&Et(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})),Et(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&&Xu(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;Et(this.props.onMove,{dragIds:n,parentId:t===Fs?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch($n.cursor({type:"none"}))}showCursor(t){this.dispatch($n.cursor(t))}open(t,r=!0){var n,s;const o=this.identifyNull(t);o&&(this.isOpen(o)||(this.dispatch(Qi.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),Et(this.props.onToggle,o)))}close(t,r=!0){var n,s;const o=this.identifyNull(t);o&&this.isOpen(o)&&(this.dispatch(Qi.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),Et(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=Vi(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(){na(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){na(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),nf(()=>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===Fs)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!xs(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(Fn(t.id))}onBlur(){this.dispatch(aw())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||_h}get renderRow(){return this.props.renderRow||tw}get renderNode(){return this.props.children||rw}get renderDragPreview(){return this.props.renderDragPreview||cf}get renderCursor(){return this.props.renderCursor||ew}}function At(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 NT=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ih=NT,bl=()=>Math.random().toString(36).substring(7).split("").join("."),PT={INIT:`@@redux/INIT${bl()}`,REPLACE:`@@redux/REPLACE${bl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${bl()}`},an=PT;function kh(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 xT(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($T(e))return"date";if(MT(e))return"error";const r=FT(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 FT(e){return typeof e.constructor=="function"?e.constructor.name:null}function MT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $T(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function $r(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=xT(e)),t}function Dh(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?At(2):`Expected the root reducer to be a function. Instead, received: '${$r(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?At(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"?At(1):`Expected the enhancer to be a function. Instead, received: '${$r(r)}'`);return r(Dh)(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"?At(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"?At(4):`Expected the listener to be a function. Instead, received: '${$r(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?At(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"?At(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),o=null}}}function m(v){if(!kh(v))throw new Error(process.env.NODE_ENV==="production"?At(7):`Actions must be plain objects. Instead, the actual type was: '${$r(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"?At(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"?At(17):`Action "type" property must be a string. Instead, the actual type was: '${$r(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?At(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(o=a).forEach(C=>{C()}),v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?At(10):`Expected the nextReducer to be a function. Instead, received: '${$r(v)}`);n=v,m({type:an.REPLACE})}function b(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?At(11):`Expected the observer to be an object. Instead, received: '${$r(y)}'`);function C(){const w=y;w.next&&w.next(u())}return C(),{unsubscribe:v(C)}},[Ih](){return this}}}return m({type:an.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:g,[Ih]:b}}function Lh(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function BT(e,t,r,n){const s=Object.keys(t),o=r&&r.type===an.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(!kh(e))return`The ${o} has unexpected type of "${$r(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===an.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 qT(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:an.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?At(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:an.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?At(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${an.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 Oh(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"&&Lh(`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{qT(r)}catch(a){o=a}return function(i={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const f=BT(i,r,c,s);f&&Lh(f)}let d=!1;const u={};for(let f=0;f<n.length;f++){const m=n[f],g=r[m],b=i[m],h=g(b,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?At(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${m}" 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[m]=h,d=d||h!==b}return d=d||n.length!==Object.keys(i).length,d?u:i}}function jT(e=Mn().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 UT=Oh({nodes:Oh({focus:iw,edit:ow,open:lw,selection:cw,drag:jT}),dnd:dw}),zT=Mn();function VT({treeProps:e,imperativeHandle:t,children:r}){const n=p.useRef(null),s=p.useRef(null),o=p.useRef(Dh(UT,Mn(e))),a=HS.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>zT),i=p.useMemo(()=>new qs(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(Qi.clear(!0))},[i.props.searchTerm]),l.jsx(Hu.Provider,{value:i,children:l.jsx(Ru.Provider,{value:c.current,children:l.jsx(Qu.Provider,{value:a.nodes,children:l.jsx(Wu.Provider,{value:a.dnd,children:l.jsx(b1,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||CT,options:{rootElement:i.props.dndRootElement||void 0}},{children:r}))})})})})}function HT(){const e=$t(),[,t]=oh(()=>({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}=Ch({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch($n.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 QT(e){return HT(),e.children}function WT(){const t=$t().props.renderContainer||_h;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function RT(){const e=$t(),{offset:t,mouse:r,item:n,isDragging:s}=Q0(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=e.props.renderDragPreview||cf;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 GT(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 KT{constructor(t,r={}){this.accessors=GT(r),this.root=YT(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 YT(e,t){const r=new Nh({},null,t,"ROOT");return r.children=e.map(n=>Cl(n,r,t)),r}function Cl(e,t,r){const n=new Nh(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(o=>Cl(o,n,r))),n}class Nh{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=Cl(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 ZT=0;function XT(e,t={}){const[r,n]=p.useState(e),s=t.idAccessor,o=t.childrenAccessor,a=p.useMemo(()=>new KT(r,{idAccessor:s,childrenAccessor:o}),[r,s,o]),i=b=>{for(const h of b.dragIds)a.move({id:h,parentId:b.parentId,index:b.index});n(a.data)},c=({name:b,id:h})=>{a.update({id:h,changes:{name:b}}),n(a.data)},d=typeof s=="string"?s:"id",u=typeof o=="string"?o:"children";return[r,{onMove:i,onRename:c,onCreate:({parentId:b,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-${ZT++}`,name:""};return v==="internal"&&(y[u]=[]),a.create({parentId:b,index:h,data:y}),n(a.data),y},onDelete:b=>{b.ids.forEach(h=>a.drop({id:h})),n(a.data)}}]}function JT(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]=XT(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function eE(e,t){const r=JT(e);return l.jsxs(VT,{treeProps:r,imperativeHandle:t,children:[l.jsx(QT,{children:l.jsx(WT,{})}),l.jsx(RT,{})]})}const tE=p.forwardRef(eE);function Sl(){return le(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 rE(){return le(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 Ph={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},xh={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},Fh=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],nE=[{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 sE(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 js(e){const t=sE(e);return{key:t,color:Ph[t]??Ph.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:xh[t]??xh.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const ct={row:"_row_nm332_1",grip:"_grip_nm332_16",menuBtn:"_menuBtn_nm332_19",rowLp:"_rowLp_nm332_23",selected:"_selected_nm332_27",title:"_title_nm332_32",dropTarget:"_dropTarget_nm332_41",toggle:"_toggle_nm332_58",ctIcon:"_ctIcon_nm332_73",ctIconLp:"_ctIconLp_nm332_85",folderIcon:"_folderIcon_nm332_89",rootIcon:"_rootIcon_nm332_94",titleLp:"_titleLp_nm332_110",levelTitle:"_levelTitle_nm332_114",renameInput:"_renameInput_nm332_119",dropHere:"_dropHere_nm332_128",menuWrap:"_menuWrap_nm332_138",menu:"_menu_nm332_19",dangerItem:"_dangerItem_nm332_190"},oE={video:Bo,pdf:Ts,h5p:No,scorm:Fo,audio:xo,quiz:Oo,course:Pr,default:xr},aE=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[s,o]=p.useState(!1),[a,i]=p.useState(!1),[c,d]=p.useState(e.data.name),u=p.useRef(null),f=ae(),m=Y(P=>P.editorProfile),g=n==="edit",b=Sl(),h=js(e.data),v=oE[h.key]??xr,y=e.isSelected,C=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),w=m.key==="learningPath",T=C?w?qu:my:S?w?Ay:vd:v,A=w&&S&&!C&&!lt(e.data),L=e.level+1<=m.maxDepth,E=w?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,x=w?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;p.useEffect(()=>{if(!s)return;const P=q=>{var F;(F=u.current)!=null&&F.contains(q.target)||o(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[s]);const $=p.useCallback(()=>{c.trim()&&e.submit(c.trim()),i(!1)},[c,e]),N=p.useCallback(P=>{P.key==="Enter"&&$(),P.key==="Escape"&&(d(e.data.name),i(!1))},[$,e.data.name]);return l.jsxs("div",{className:[ct.row,w?ct.rowLp:"",y?ct.selected:"",e.state.isOver&&S?ct.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:[g&&l.jsx("span",{ref:r,className:ct.grip,"aria-hidden":"true",children:l.jsx(yd,{size:14})}),l.jsx("button",{className:ct.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(ui,{size:14}):l.jsx(Xr,{size:14})}),l.jsx("span",{className:[ct.ctIcon,C||S?ct.folderIcon:h.bgClass,w?ct.ctIconLp:"",C&&w?ct.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(T,{size:C&&w?15:12})}),a?l.jsx("input",{className:ct.renameInput,value:c,autoFocus:!0,onChange:P=>d(P.target.value),onBlur:$,onKeyDown:N,onClick:P=>P.stopPropagation()}):l.jsx("span",{className:[ct.title,w?ct.titleLp:"",A?ct.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>g&&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:ct.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),g&&l.jsxs("div",{className:ct.menuWrap,ref:u,children:[l.jsx("button",{className:ct.menuBtn,onClick:P=>{P.stopPropagation(),o(q=>!q)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(pd,{size:14})}),s&&l.jsxs("div",{className:ct.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{i(!0),o(!1)},children:[l.jsx(Ly,{size:13})," ",f.treeNode.renameMenuItem]}),S&&b&&L&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),o(!1)},children:[l.jsx(md,{size:13})," ",E]}),e.data.parent&&b&&!w&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),o(!1)},children:[l.jsx(Jr,{size:13})," ",x]}),!C&&l.jsxs("button",{role:"menuitem",className:ct.dangerItem,onClick:()=>{e.tree.delete(e.id),o(!1)},children:[l.jsx($o,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function iE(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 lE(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 cE(e,t){var i;const r=await iE(e,t.name),n=await lE(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 dE(e){var r;return((r=(await Me.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Mh(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 uE(e){return Mh(e)}const Ue={container:"_container_jw2be_1",header:"_header_jw2be_13",title:"_title_jw2be_22",closeBtn:"_closeBtn_jw2be_29",body:"_body_jw2be_45",dropZone:"_dropZone_jw2be_54",dragOver:"_dragOver_jw2be_67",hasFile:"_hasFile_jw2be_72",hiddenInput:"_hiddenInput_jw2be_78",fileInfo:"_fileInfo_jw2be_82",fileIcon:"_fileIcon_jw2be_89",fileName:"_fileName_jw2be_93",fileSize:"_fileSize_jw2be_100",dropHint:"_dropHint_jw2be_105",dropIcon:"_dropIcon_jw2be_112",dropText:"_dropText_jw2be_117",dropSubtext:"_dropSubtext_jw2be_124",sampleLink:"_sampleLink_jw2be_130",statusBar:"_statusBar_jw2be_145",status_uploading:"_status_uploading_jw2be_154",status_processing:"_status_processing_jw2be_154",status_done:"_status_done_jw2be_159",status_error:"_status_error_jw2be_164",successDetail:"_successDetail_jw2be_170",spinner:"_spinner_jw2be_175",spin:"_spin_jw2be_175",errorMsg:"_errorMsg_jw2be_191",failedSection:"_failedSection_jw2be_197",failedTitle:"_failedTitle_jw2be_203",tableWrap:"_tableWrap_jw2be_213",failedTable:"_failedTable_jw2be_219",reasonCell:"_reasonCell_jw2be_244",footer:"_footer_jw2be_248"},fE=({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,m]=p.useState(""),[g,b]=p.useState([]),[h,v]=p.useState(null),y=p.useRef(null),C=p.useRef(null),S=p.useCallback(()=>{C.current!==null&&(clearInterval(C.current),C.current=null)},[]);p.useEffect(()=>()=>S(),[S]);const w=N=>N.name.toLowerCase().endsWith(".csv")?N.size>50*1024*1024?(m(s.csvUpload.fileTooLarge),!1):!0:(m(s.csvUpload.invalidFileType),!1),T=p.useCallback(N=>{m(""),b([]),v(null),u("idle"),w(N)&&a(N)},[]),A=p.useCallback(N=>{N.preventDefault(),c(!1);const P=N.dataTransfer.files[0];P&&T(P)},[T]),L=p.useCallback(N=>{var q;const P=(q=N.target.files)==null?void 0:q[0];P&&T(P),N.target.value=""},[T]),E=p.useCallback(async()=>{try{const N=await uE(e),P=document.createElement("a");P.href=N,P.download="sample_hierarchy.csv",P.target="_blank",P.click()}catch{m(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),x=p.useCallback(async()=>{if(o){u("uploading"),m(""),b([]);try{const{processId:N}=await cE(e,o);if(!N){u("done"),v(null),setTimeout(t,1500);return}u("processing"),C.current=setInterval(async()=>{try{const P=await dE(N);P.status==="COMPLETED"?(S(),u("done"),v(P.successCount??null),P.failedRecords&&P.failedRecords.length>0?b(P.failedRecords):setTimeout(t,1500)):P.status==="FAILED"&&(S(),u("error"),m(s.csvUpload.processingFailed),P.failedRecords&&b(P.failedRecords))}catch{S(),u("error"),m(s.csvUpload.connectionLost)}},2e3)}catch{u("error"),m(s.csvUpload.uploadFailed)}}},[e,o,t,S,s.csvUpload.processingFailed,s.csvUpload.connectionLost,s.csvUpload.uploadFailed]),$={idle:"",uploading:s.csvUpload.statusUploading,processing:s.csvUpload.statusProcessing,done:s.csvUpload.statusDone,error:s.csvUpload.statusError};return l.jsxs("div",{className:Ue.container,children:[l.jsxs("div",{className:Ue.header,children:[l.jsx("h2",{className:Ue.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),l.jsx("button",{className:Ue.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:l.jsx(fr,{size:18})})]}),l.jsxs("div",{className:Ue.body,children:[l.jsxs("div",{className:`${Ue.dropZone} ${i?Ue.dragOver:""} ${o?Ue.hasFile:""}`,onDragEnter:N=>{N.preventDefault(),c(!0)},onDragOver:N=>{N.preventDefault(),c(!0)},onDragLeave:N=>{N.preventDefault(),c(!1)},onDrop:A,onClick:()=>{var N;return(N=y.current)==null?void 0:N.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:N=>{var P;return N.key==="Enter"&&((P=y.current)==null?void 0:P.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:Ue.hiddenInput,onChange:L,"aria-hidden":"true"}),o?l.jsxs("div",{className:Ue.fileInfo,children:[l.jsx(Ts,{size:24,className:Ue.fileIcon}),l.jsx("span",{className:Ue.fileName,children:o.name}),l.jsxs("span",{className:Ue.fileSize,children:["(",(o.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Ue.dropHint,children:[l.jsx(fi,{size:32,className:Ue.dropIcon}),l.jsx("p",{className:Ue.dropText,children:s.csvUpload.dropText}),l.jsx("p",{className:Ue.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:Ue.sampleLink,onClick:E,type:"button",children:s.csvUpload.downloadSample}),d!=="idle"&&l.jsxs("div",{className:`${Ue.statusBar} ${Ue[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&l.jsx("span",{className:Ue.spinner,"aria-hidden":"true"}),$[d],d==="done"&&h!==null&&l.jsx("span",{className:Ue.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:Ue.errorMsg,role:"alert",children:f}),g.length>0&&l.jsxs("div",{className:Ue.failedSection,children:[l.jsx("h4",{className:Ue.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(g.length))}),l.jsx("div",{className:Ue.tableWrap,children:l.jsxs("table",{className:Ue.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:g.map((N,P)=>l.jsxs("tr",{children:[l.jsx("td",{children:N.rowNumber??P+1}),l.jsx("td",{children:N.name??"—"}),l.jsx("td",{className:Ue.reasonCell,children:N.reason??s.csvUpload.unknownError})]},P))})]})})]})]}),l.jsxs("div",{className:Ue.footer,children:[l.jsx(je,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:s.csvUpload.cancel}),l.jsx(je,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!o||d==="done",onClick:x,children:d==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})};function wl(){var m,g,b,h,v;const e=ae(),t=le(y=>y.treeData),r=le(y=>y.treeCache),n=le(y=>y.deleteNode),s=Fr(y=>y.activeAssessmentSlot),o=Fr(y=>y.setActiveAssessmentSlot),a=((m=t[0])==null?void 0:m.children)??[],i=a[0],c=a.length>1?a[a.length-1]:void 0,d=lt(i),u=lt(c),f=y=>{var L,E;const C=y==="pre"?i:c;if(!C)return;const S=t[0],w=S?((L=r[S.id])==null?void 0:L.policy)??((E=S.metadata)==null?void 0:E.policy):void 0,A=y==="pre"&&!!w&&Pu.has(w)?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;window.confirm(A)&&n(C.id)};return{pre:{level:i,filled:d,courseName:d?(b=(g=i==null?void 0:i.children)==null?void 0:g[0])==null?void 0:b.name:void 0},post:{level:c,filled:u,courseName:u?(v=(h=c==null?void 0:c.children)==null?void 0:h[0])==null?void 0:v.name:void 0},activeAssessmentSlot:s,setActiveAssessmentSlot:o,deleteSlot:f}}const ar={container:"_container_2qylm_1",header:"_header_2qylm_8",sectionLabel:"_sectionLabel_2qylm_18",headerActions:"_headerActions_2qylm_26",iconBtn:"_iconBtn_2qylm_33",menuWrap:"_menuWrap_2qylm_51",dropdownMenu:"_dropdownMenu_2qylm_55",treeWrapper:"_treeWrapper_2qylm_87",csvModal:"_csvModal_2qylm_103",footer:"_footer_2qylm_113"},hE=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var de;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,m]=p.useState(!1),[g,b]=p.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:C,deleteNode:S,reorderChildren:w,moveNode:T,setTreeData:A}=le(),L=Y(W=>W.editorProfile),E=L.key==="learningPath",x=e==="edit",$=Sl(),N=x&&$,P=E?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,q=L.maxDepth>1,F=(((de=h[0])==null?void 0:de.children)??[]).some(W=>W.isFolder),{pre:z,post:ne,deleteSlot:Q}=wl(),{level:te}=z,{level:pe}=ne,ie=Y(W=>{var se,Ae,ge,ee;return((Ae=(se=W.editorConfig)==null?void 0:se.context)==null?void 0:Ae.contentId)??((ee=(ge=W.editorConfig)==null?void 0:ge.context)==null?void 0:ee.identifier)??""}),me=Y(W=>{var Ae,ge;const se=(ge=(Ae=W.categoryMeta)==null?void 0:Ae.sourcingSettings)==null?void 0:ge.collection;return(se==null?void 0:se.enableBulkUpload)!==!1}),ve=L.features.csvUpload&&me;p.useEffect(()=>{const W=o.current;if(!W)return;const se=new ResizeObserver(()=>{c(W.clientHeight||400)});return se.observe(W),c(W.clientHeight||400),()=>se.disconnect()},[]),p.useEffect(()=>{if(!d)return;const W=se=>{var Ae;(Ae=a.current)!=null&&Ae.contains(se.target)||u(!1)};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[d]);const Ee=p.useCallback(W=>{W.length>0&&y(W[0].data.id)},[y]),ye=p.useCallback(({parentId:W,index:se,dragIds:Ae})=>{if(!W)return;const ge=Ae[0],ee=_l(h,ge);if(!ee)return;const Ge=ee.parent;if(Ge===W){const Ye=_l(h,W);if(!(Ye!=null&&Ye.children))return;const rt=Ye.children.findIndex(Ke=>Ke.id===ge);if(rt<0)return;w(W,rt,se>rt?se-1:se)}else T(ge,Ge??"",W)},[h,w,T]),M=p.useCallback(({ids:W})=>{for(const se of W){if(E&&(te==null?void 0:te.id)===se){Q("pre");continue}if(E&&(pe==null?void 0:pe.id)===se){Q("post");continue}S(se)}},[S,Q,E,te,pe]),B=p.useCallback(({parentId:W})=>{var ge;const se=W??((ge=h[0])==null?void 0:ge.id)??"";if(!se)return{id:crypto.randomUUID()};const Ae=C(se,"unit");return Ae?{id:Ae}:(we.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[C,h,n]),Z=p.useCallback(()=>{var se;const W=(se=h[0])==null?void 0:se.id;W&&(C(W,"unit")||we.error(n.outlineTree.maxDepthReachedToast))},[h,C,n]),ce=p.useCallback(()=>{v&&(C(v,"subunit")||we.error(n.outlineTree.maxDepthReachedToast))},[v,C,n]),Ce=p.useCallback(async()=>{if(u(!1),!!ie)try{const W=await Mh(ie),se=await fetch(W).then(ee=>ee.blob()),Ae=URL.createObjectURL(se),ge=document.createElement("a");ge.href=Ae,ge.download=`${ie}-folders.csv`,ge.style.display="none",document.body.appendChild(ge),ge.click(),document.body.removeChild(ge),URL.revokeObjectURL(Ae)}catch{we.error(n.outlineTree.downloadCsvFailedToast)}},[ie,n]),ue=p.useCallback(async()=>{if(m(!1),!!ie)try{const{rootNode:W}=await Tu(ie);A([W]),we.success(n.outlineTree.outlineRefreshedToast)}catch{we.error(n.outlineTree.outlineRefreshFailedToast)}},[ie,A,n]);return l.jsxs("div",{className:ar.container,children:[l.jsxs("div",{className:ar.header,children:[E&&l.jsx("span",{className:ar.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:ar.headerActions,children:[x&&ve&&l.jsxs("div",{className:ar.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:ar.iconBtn,onClick:()=>u(W=>!W),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:l.jsx(pd,{size:15})}),d&&l.jsxs("div",{className:ar.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:F,title:F?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{u(!1),b("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!F,title:F?void 0:n.outlineTree.noFoldersYetTitle,onClick:Ce,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!F,title:F?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{u(!1),b("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:ar.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(ky,{size:15}):l.jsx(Iy,{size:15})})]})]}),l.jsx("div",{className:ar.treeWrapper,ref:o,children:l.jsx(tE,{ref:s,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:Ee,onMove:x?ye:void 0,onDelete:x?M:void 0,onCreate:x?B:void 0,disableEdit:!x,disableDrop:!x,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:i,width:"100%",children:W=>l.jsx(aE,{...W,editorMode:e})})}),x&&l.jsxs("div",{className:ar.footer,children:[l.jsxs(je,{variant:"ghost",size:"sm",onClick:Z,disabled:!N,children:[l.jsx(Jr,{size:14})," ",P]}),q&&l.jsxs(je,{variant:"ghost",size:"sm",onClick:ce,disabled:!N||!v,children:[l.jsx(md,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:ar.csvModal,children:l.jsx(fE,{contentId:ie,mode:g,onComplete:ue,onClose:()=>m(!1)})})]})};function _l(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=_l(r.children,t);if(n)return n}}}const Us={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},pE=({crumbs:e})=>{const t=le(n=>n.selectNode),r=ae();return e.length?l.jsxs("nav",{className:Us.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:Us.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Ty,{size:13})}),e.map((n,s)=>l.jsxs(p.Fragment,{children:[l.jsx(ui,{size:13,className:Us.sep}),s<e.length-1?l.jsx("button",{className:Us.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:Us.current,children:n.name})]},n.id))]}):null},zs={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},gE=({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:zs.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:[zs.tab,e===i.id?zs.active:"",r.includes(i.id)?zs.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:zs.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},i.id))})};var Vs=e=>e.type==="checkbox",ln=e=>e instanceof Date,bt=e=>e==null;const $h=e=>typeof e=="object";var Ze=e=>!bt(e)&&!Array.isArray(e)&&$h(e)&&!ln(e),Tl=e=>Ze(e)&&e.target?Vs(e.target)?e.target.checked:e.target.value:e,Bh=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),qh=e=>{const t=e.constructor&&e.constructor.prototype;return Ze(t)&&t.hasOwnProperty("isPrototypeOf")},Sa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Je(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Sa&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ze(e)&&qh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Je(e[s]));return n}const Br={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ir={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},lr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},El="form",jh="root",Uh=["__proto__","constructor","prototype"];var Hs=e=>/^\w*$/.test(e),Re=e=>e===void 0,wa=e=>e.split(/[.[\]'"]/g).filter(Boolean),R=(e,t,r)=>{if(!t||!Ze(e))return r;const n=Hs(t)?[t]:wa(t);if(n.some(o=>Uh.includes(o)))return r;const s=n.reduce((o,a)=>bt(o)?void 0:o[a],e);return Re(s)||s===e?Re(e[t])?r:e[t]:s},Vt=e=>typeof e=="boolean",It=e=>typeof e=="function",He=(e,t,r)=>{let n=-1;const s=Hs(t)?[t]:wa(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(Uh.includes(i))return;e[i]=c,e=e[i]}};const Al=p.createContext(null);Al.displayName="HookFormControlContext";const Il=()=>p.useContext(Al);var zh=(e,t,r,n=!0)=>{const s={};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==ir.all&&(t._proxyFormState[a]=!n||ir.all),r&&(r[a]=!0),e[a]}});return s};const kl=Sa?p.useLayoutEffect:p.useEffect;function mE(e){const t=Il(),{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 kl(()=>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(()=>zh(a,r,c.current,!1),[a,r])}var kt=e=>typeof e=="string",Dl=(e,t,r,n,s)=>kt(e)?(n&&t.watch.add(e),R(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),R(r,o))):(n&&(t.watchAll=!0),r),Ll=e=>bt(e)||!$h(e);const Vh=(e,t)=>t.length===0&&!Array.isArray(e)&&!qh(e);function Ht(e,t,r=new WeakMap){if(e===t)return!0;if(Ll(e)||Ll(t))return Object.is(e,t);if(ln(e)&&ln(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(Vh(e,n)||Vh(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(ln(i)&&ln(c)||(Ze(i)||Array.isArray(i))&&(Ze(c)||Array.isArray(c))?!Ht(i,c,r):!Object.is(i,c))return!1}}return!0}function vE(e){const t=Il(),{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),m=p.useRef(n);d.current=i;const[g,b]=p.useState(()=>{const w=r._getWatch(n,c.current);return d.current?d.current(w):w}),h=p.useCallback(w=>{const T=Dl(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=Dl(n,r._names,w||r._formValues,!1,c.current);if(d.current){const A=d.current(T);Ht(A,u.current)||(b(A),u.current=A)}else b(T)}},[r._formValues,r._names,o,n]);kl(()=>((f.current!==r||!Ht(m.current,n))&&(f.current=r,m.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,C=m.current,S=p.useMemo(()=>{if(o)return null;const w=!y&&!Ht(C,n);return y||w?h():null},[o,y,n,C,h]);return S!==null?S:g}function Qs(e){const t=Il(),{name:r,disabled:n,control:s=t,shouldUnregister:o,defaultValue:a,exact:i=!0}=e,c=Bh(s._names.array,r),d=p.useMemo(()=>R(s._formValues,r,R(s._defaultValues,r,a)),[s,r,a]),u=vE({control:s,name:r,defaultValue:d,exact:i}),f=mE({control:s,name:r,exact:i}),m=p.useRef(e),g=p.useRef(null),b=p.useRef(s.register(r,{...e.rules,value:u,...Vt(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const h=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!R(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!R(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!R(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!R(f.validatingFields,r)},error:{enumerable:!0,get:()=>R(f.errors,r)}}),[f,r]),v=p.useCallback(w=>{const T=Tl(w);return R(s._fields,r)||(b.current=s.register(r,{...m.current.rules,value:T})),b.current.onChange({target:{value:Tl(w),name:r},type:Br.CHANGE})},[r,s]),y=p.useCallback(()=>b.current.onBlur({target:{value:R(s._formValues,r),name:r},type:Br.BLUR}),[r,s._formValues]),C=p.useCallback(w=>{w&&(g.current={focus:()=>It(w.focus)&&w.focus(),select:()=>It(w.select)&&w.select(),setCustomValidity:A=>It(w.setCustomValidity)&&w.setCustomValidity(A),reportValidity:()=>It(w.reportValidity)&&w.reportValidity()});const T=R(s._fields,r);T&&T._f&&w&&(T._f.ref=g.current)},[s._fields,r]),S=p.useMemo(()=>({name:r,value:u,...Vt(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:C}),[r,n,f.disabled,v,y,C,u]);return p.useEffect(()=>{const w=s._options.shouldUnregister||o;s.register(r,{...m.current.rules,...Vt(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(A,L)=>{const E=R(s._fields,A);E&&E._f&&(E._f.mount=L)};if(T(r,!0),w){const A=Je(R(o?s._defaultValues:s._options.values||s._defaultValues,r,R(s._options.defaultValues,r,m.current.defaultValue)));He(s._defaultValues,r,A),Re(R(s._formValues,r))&&He(s._formValues,r,A)}if(!c&&s.register(r),g.current){const A=R(s._fields,r);A&&A._f&&(A._f.ref=g.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 yE=e=>e.render(Qs(e)),Ol=p.createContext(null);Ol.displayName="HookFormContext";const Xt=()=>p.useContext(Ol),bE=({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:m,unregister:g,control:b,register:h,setFocus:v,subscribe:y})=>{const C=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:m,unregister:g,control:b,register:h,setFocus:v,subscribe:y}),[o,b,d,n,r,m,h,f,u,s,v,a,i,y,c,g,t]);return p.createElement(Ol.Provider,{value:C},p.createElement(Al.Provider,{value:C.control},e))};var CE=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Hh=e=>Array.isArray(e)?e.filter(Boolean):[],_a=e=>Array.isArray(e)?e:[e],Qh=()=>{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 Wh(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=Wh(s,o);Ze(a)&&(r[n]=a)}else e[n]&&(r[n]=o)}return r}var ft=e=>Ze(e)&&!Object.keys(e).length,Nl=e=>e.type==="file",Ta=e=>{if(!Sa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Rh=e=>e.type==="select-multiple",Pl=e=>e.type==="radio",SE=e=>Pl(e)||Vs(e),xl=e=>Ta(e)&&e.isConnected;function wE(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(bt(e)){e=void 0;break}e=e[t[n]],n++}return e}function _E(e){for(const t in e)if(e.hasOwnProperty(t)&&!Re(e[t]))return!1;return!0}function ot(e,t){if(kt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Hs(t)?[t]:wa(t),n=r.length===1?e:wE(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Ze(n)&&ft(n)||Array.isArray(n)&&_E(n))&&ot(e,r.slice(0,-1)),e}var TE=e=>{for(const t in e)if(It(e[t]))return!0;return!1};function Gh(e){return Array.isArray(e)||Ze(e)&&!TE(e)}function Fl(e,t={}){for(const r in e){const n=e[r];Gh(n)?(t[r]=Array.isArray(n)?[]:{},Fl(n,t[r])):Re(n)||(t[r]=!0)}return t}function Ml(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>Ml(r));return t.some(r=>r!==void 0)?t:void 0}if(Ze(e)){const t={};for(const r in e){const n=Ml(e[r]);Re(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function cn(e,t,r){r||(r=Fl(t));for(const n in e){const s=e[n];if(Gh(s))Re(t)||Ll(r[n])?r[n]=Fl(s,Array.isArray(s)?[]:{}):cn(s,bt(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!Ht(s,o)}}return Ml(r)||{}}const Kh={value:!1,isValid:!1},Yh={value:!0,isValid:!0};var Zh=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&&!Re(e[0].attributes.value)?Re(e[0].value)||e[0].value===""?Yh:{value:e[0].value,isValid:!0}:Yh:Kh}return Kh},Xh=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Re(e)?e:t?e===""?NaN:e&&+e:r&&kt(e)?new Date(e):n?n(e):e;const Jh={isValid:!1,value:null};var ep=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Jh):Jh;function tp(e){const t=e.ref;return Nl(t)?t.files:Pl(t)?ep(e.refs).value:Rh(t)?[...t.selectedOptions].map(({value:r})=>r):Vs(t)?Zh(e.refs).value:Xh(Re(t.value)?e.ref.value:t.value,e)}var EE=(e,t,r,n)=>{const s={};for(const o of e){const a=R(t,o);a&&He(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ea=e=>e instanceof RegExp,Ws=e=>Re(e)?e:Ea(e)?e.source:Ze(e)?Ea(e.value)?e.value.source:e.value:e,rp=e=>({isOnSubmit:!e||e===ir.onSubmit,isOnBlur:e===ir.onBlur,isOnChange:e===ir.onChange,isOnAll:e===ir.all,isOnTouch:e===ir.onTouched});const np="AsyncFunction";var AE=e=>!!e&&!!e.validate&&!!(It(e.validate)&&e.validate.constructor.name===np||Ze(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===np)),IE=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),$l=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Rs=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=R(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(Rs(i,t))break}else if(Ze(i)&&Rs(i,t))break}}};function sp(e,t,r){const n=R(e,r);if(n||Hs(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=R(t,o),i=R(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 kE=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ft(o)||n&&Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||ir.all))},DE=(e,t,r)=>!e||!t||e===t||_a(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),LE=(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,OE=(e,t)=>!Hh(R(e,t)).length&&ot(e,t),op=(e,t,r)=>{const n=R(e,r),s=Array.isArray(n)?n:[];return He(s,jh,t[r]),He(e,r,s),e};function ap(e,t,r="validate"){if(kt(e)||Array.isArray(e)&&e.every(kt)||Vt(e)&&!e)return{type:r,message:kt(e)?e:"",ref:t}}var Hn=e=>Ze(e)&&!Ea(e)?e:{value:e,message:""},ip=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:f,max:m,pattern:g,validate:b,name:h,valueAsNumber:v,mount:y}=e._f,C=R(r,h);if(!y||t.has(h))return{};const S=i?i[0]:a,w=P=>{if(s&&S.reportValidity){const q=Vt(P)?"":P||"";i?i.forEach(F=>F.setCustomValidity(q)):S.setCustomValidity(q),S.reportValidity()}},T={},A=Pl(a),L=Vs(a),E=A||L,x=(v||Nl(a))&&Re(a.value)&&Re(C)||Ta(a)&&a.value===""||C===""||Array.isArray(C)&&!C.length,$=CE.bind(null,h,n,T),N=(P,q,F,z=lr.maxLength,ne=lr.minLength)=>{const Q=P?q:F;T[h]={type:P?z:ne,message:Q,ref:a,...$(P?z:ne,Q)}};if(o?!Array.isArray(C)||!C.length:c&&(!E&&(x||bt(C))||Vt(C)&&!C||L&&!Zh(i).isValid||A&&!ep(i).isValid)){const{value:P,message:q}=kt(c)?{value:!!c,message:c}:Hn(c);if(P&&(T[h]={type:lr.required,message:q,ref:S,...$(lr.required,q)},!n))return w(q),T}if(!x&&(!bt(f)||!bt(m))){let P,q;const F=Hn(m),z=Hn(f);if(!bt(C)&&!isNaN(C)){const ne=a.valueAsNumber||C&&+C;bt(F.value)||(P=ne>F.value),bt(z.value)||(q=ne<z.value)}else{const ne=a.valueAsDate||new Date(C),Q=ie=>new Date(new Date().toDateString()+" "+ie),te=a.type=="time",pe=a.type=="week";kt(F.value)&&C&&(P=te?Q(C)>Q(F.value):pe?C>F.value:ne>new Date(F.value)),kt(z.value)&&C&&(q=te?Q(C)<Q(z.value):pe?C<z.value:ne<new Date(z.value))}if((P||q)&&(N(!!P,F.message,z.message,lr.max,lr.min),!n))return w(T[h].message),T}if((d||u)&&!x&&(kt(C)||o&&Array.isArray(C))){const P=Hn(d),q=Hn(u),F=!bt(P.value)&&C.length>+P.value,z=!bt(q.value)&&C.length<+q.value;if((F||z)&&(N(F,P.message,q.message),!n))return w(T[h].message),T}if(g&&!x&&kt(C)){const{value:P,message:q}=Hn(g);if(Ea(P)&&!C.match(P)&&(T[h]={type:lr.pattern,message:q,ref:a,...$(lr.pattern,q)},!n))return w(q),T}if(b){if(It(b)){const P=await b(C,r),q=ap(P,S);if(q&&(T[h]={...q,...$(lr.validate,q.message)},!n))return w(q.message),T}else if(Ze(b)){let P={};for(const q in b){if(!ft(P)&&!n)break;const F=ap(await b[q](C,r),S,q);F&&(P={...F,...$(q,F.message)},w(F.message),n&&(T[h]=P))}if(!ft(P)&&(T[h]={ref:S,...P},!n))return T}}return w(!0),T};const NE={mode:ir.onSubmit,reValidateMode:ir.onChange,shouldFocusError:!0},lp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function PE(e={}){let t={...NE,...e},r={...Je(lp),isLoading:It(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=Ze(t.defaultValues)||Ze(t.values)?Je(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Je(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 m={...f};const g={array:Qh(),state:Qh()},b=t.criteriaMode===ir.all,h=_=>D=>{clearTimeout(d),d=setTimeout(_,D)},v=async _=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||m.isValid||_)){let D;t.resolver?(D=ft((await $()).errors),y()):D=await q({fields:n,onlyCheckValid:!0,eventType:Br.VALID}),D!==r.isValid&&g.state.next({isValid:D})}},y=(_,D)=>{!t.disabled&&(f.isValidating||f.validatingFields||m.isValidating||m.validatingFields)&&((_||Array.from(i.mount)).forEach(O=>{O&&(D?He(r.validatingFields,O,D):ot(r.validatingFields,O))}),g.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},C=()=>{r.dirtyFields=cn(s,o)},S=(_,D=[],O,V,H=!0,G=!0)=>{if(V&&O&&!t.disabled){if(a.action=!0,G&&Array.isArray(R(n,_))){const U=O(R(n,_),V.argA,V.argB);H&&He(n,_,U)}if(G&&Array.isArray(R(r.errors,_))){const U=O(R(r.errors,_),V.argA,V.argB);H&&He(r.errors,_,U),OE(r.errors,_)}if((f.touchedFields||m.touchedFields)&&G&&Array.isArray(R(r.touchedFields,_))){const U=O(R(r.touchedFields,_),V.argA,V.argB);H&&He(r.touchedFields,_,U)}(f.dirtyFields||m.dirtyFields)&&C(),g.state.next({name:_,isDirty:z(_,D),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else He(o,_,D)},w=(_,D)=>{He(r.errors,_,D),r.errors={...r.errors},g.state.next({errors:r.errors})},T=_=>{r.errors=_,g.state.next({errors:r.errors,isValid:!1})},A=_=>{const D=Hs(_)?[_]:wa(_);let O=o,V=s;for(let H=0;H<D.length-1;H++){const G=D[H];if(O=bt(O)?O:O[G],V=bt(V)?V:V[G],O===null&&V!==null)return!0}return!1},L=(_,D,O,V)=>{const H=R(n,_);if(H){if(A(_))return;const G=Re(R(o,_)),U=R(o,_,Re(O)?R(s,_):O);Re(U)||V&&V.defaultChecked||D?He(o,_,D?U:tp(H._f)):te(_,U),a.mount&&!a.action&&(v(),G&&r.isDirty&&(f.isDirty||m.isDirty)&&(z()||(r.isDirty=!1,g.state.next({...r}))),e.shouldUnregister&&G&&!Re(R(o,_))&&$l(_,i)&&(a.watch=!0))}},E=(_,D,O,V,H)=>{let G=!1,U=!1;const re={name:_};if(!t.disabled){if(!O||V){(f.isDirty||m.isDirty)&&(U=r.isDirty,r.isDirty=re.isDirty=z(),G=U!==re.isDirty);const be=Ht(R(s,_),D);U=!!R(r.dirtyFields,_),be!==r.isDirty?r.dirtyFields=cn(s,o):be?ot(r.dirtyFields,_):He(r.dirtyFields,_,!0),re.dirtyFields=r.dirtyFields,G=G||(f.dirtyFields||m.dirtyFields)&&U!==!be}if(O){const be=R(r.touchedFields,_);be||(He(r.touchedFields,_,O),re.touchedFields=r.touchedFields,G=G||(f.touchedFields||m.touchedFields)&&be!==O)}G&&H&&g.state.next(re)}return G?re:{}},x=(_,D,O,V)=>{const H=R(r.errors,_),G=(f.isValid||m.isValid)&&Vt(D)&&r.isValid!==D;if(t.delayError&&O?(c=h(()=>w(_,O)),c(t.delayError)):(clearTimeout(d),c=null,O?He(r.errors,_,O):ot(r.errors,_),r.errors={...r.errors}),(O?!Ht(H,O):H)||!ft(V)||G){const U={...V,...G&&Vt(D)?{isValid:D}:{},errors:r.errors,name:_};r={...r,...U},g.state.next(U)}},$=async _=>(y(_,!0),await t.resolver(o,t.context,EE(_||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),N=async _=>{const{errors:D}=await $(_);if(y(_),_){for(const O of _){const V=R(D,O);V?i.array.has(O)&&Ze(V)&&!Object.keys(V).some(H=>!Number.isNaN(Number(H)))?op(r.errors,{[O]:V},O):He(r.errors,O,V):ot(r.errors,O)}r.errors={...r.errors}}else r.errors=D;return D},P=async({name:_,eventType:D})=>{if(e.validate){const O=await e.validate({formValues:o,formState:r,name:_,eventType:D});if(Ze(O))for(const V in O){const H=O[V];H&&Ce(`${El}.${V}`,{message:kt(H.message)?H.message:"",type:H.type||lr.validate})}else kt(O)||!O?Ce(El,{message:O||"",type:lr.validate}):ce(El);return O}return!0},q=async({fields:_,onlyCheckValid:D,name:O,eventType:V,context:H={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(H.runRootValidation=!0,!await P({name:O,eventType:V})&&(H.valid=!1,D)))return H.valid;for(const G in _){const U=_[G];if(U){const{_f:re,...be}=U;if(re){const Ve=i.array.has(re.name),jt=U._f&&AE(U._f),Ut=f.validatingFields||f.isValidating||m.validatingFields||m.isValidating;jt&&Ut&&y([re.name],!0);const Tr=await ip(U,i.disabled,o,b,t.shouldUseNativeValidation&&!D,Ve);if(jt&&Ut&&y([re.name]),Tr[re.name]&&(H.valid=!1,D)||(!D&&(R(Tr,re.name)?Ve?op(r.errors,Tr,re.name):He(r.errors,re.name,Tr[re.name]):ot(r.errors,re.name)),e.shouldUseNativeValidation&&Tr[re.name]))break}!ft(be)&&await q({context:H,onlyCheckValid:D,fields:be,name:G,eventType:V})}}return H.valid},F=()=>{for(const _ of i.unMount){const D=R(n,_);D&&(D._f.refs?D._f.refs.every(O=>!xl(O)):!xl(D._f.ref))&&se(_)}i.unMount=new Set},z=(_,D)=>!t.disabled&&(_&&D&&He(o,_,D),!Ht(B(),s)),ne=(_,D,O)=>Dl(_,i,{...a.mount?o:Re(D)?s:kt(_)?{[_]:D}:D},O,D),Q=_=>Hh(R(a.mount?o:s,_,t.shouldUnregister?R(s,_,[]):[])),te=(_,D,O={},V=!1)=>{const H=R(n,_);let G=D;if(H){const U=H._f;U&&(!U.disabled&&He(o,_,Xh(D,U)),G=Ta(U.ref)&&bt(D)?"":D,Rh(U.ref)?[...U.ref.options].forEach(re=>re.selected=G.includes(re.value)):U.refs?Vs(U.ref)?U.refs.forEach(re=>{(!re.defaultChecked||!re.disabled)&&(Array.isArray(G)?re.checked=!!G.find(be=>be===re.value):re.checked=G===re.value||!!G)}):U.refs.forEach(re=>re.checked=re.value===G):Nl(U.ref)?U.ref.value="":(U.ref.value=G,U.ref.type||g.state.next({name:_,values:V?o:Je(o)})))}(O.shouldDirty||O.shouldTouch)&&E(_,G,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&M(_)},pe=(_,D,O,V=!1)=>{for(const H in D){if(!D.hasOwnProperty(H))return;const G=D[H],U=_+"."+H,re=R(n,U);(i.array.has(_)||Ze(G)||re&&!re._f)&&!ln(G)?pe(U,G,O,V):te(U,G,O,V)}},ie=(_,D,O,V)=>{const H=R(n,_),G=i.array.has(_),U=V?D:Je(D),re=R(o,_),be=Ht(re,U);if(be||He(o,_,U),G)g.array.next({name:_,values:V?o:Je(o)}),(f.isDirty||f.dirtyFields||m.isDirty||m.dirtyFields)&&O.shouldDirty&&(C(),g.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:z(_,U)}));else{const Ve=Array.isArray(U)&&!U.length||ft(U);!H||H._f||bt(U)||Ve?te(_,U,O,V):pe(_,U,O,V)}if(!be){const Ve=$l(_,i),jt=V?o:Je(o);g.state.next({...Ve&&r,name:a.mount||Ve?_:void 0,values:jt})}},me=(_,D,O={})=>ie(_,D,O,!1),ve=(_,D={})=>{const O=It(_)?_(o):_;if(!Ht(o,O)){o={...o,...O};for(const V of i.mount)ie(V,R(O,V),D,!0);g.state.next({...r,name:void 0,type:void 0,values:o}),D.shouldValidate&&v()}},Ee=async _=>{a.mount=!0;const D=_.target;let O=D.name,V=!0;const H=R(n,O),G=be=>{V=Number.isNaN(be)||ln(be)&&isNaN(be.getTime())||Ht(be,R(o,O,be))},U=rp(t.mode),re=rp(t.reValidateMode);if(H){let be,Ve;const jt=D.type?tp(H._f):Tl(_),Ut=_.type===Br.BLUR||_.type===Br.FOCUS_OUT,Tr=!IE(H._f)&&!e.validate&&!t.resolver&&!R(r.errors,O)&&!H._f.deps||LE(Ut,R(r.touchedFields,O),r.isSubmitted,re,U),no=$l(O,i,Ut);He(o,O,jt),Ut?(!D||!D.readOnly)&&(H._f.onBlur&&H._f.onBlur(_),c&&c(0)):H._f.onChange&&H._f.onChange(_);const wn=E(O,jt,Ut),mt=!ft(wn)||no;if(!Ut&&g.state.next({name:O,type:_.type,values:Je(o)}),Tr)return(f.isValid||m.isValid)&&(t.mode==="onBlur"?Ut&&v():Ut||v()),mt&&g.state.next({name:O,...no?{}:wn});if(!t.resolver&&e.validate&&await P({name:O,eventType:_.type}),!Ut&&no&&g.state.next({...r}),t.resolver){const{errors:Lt}=await $([O]);if(y([O]),G(jt),!V){!ft(wn)&&g.state.next(wn);return}const Pt=sp(r.errors,n,O),dr=sp(Lt,n,Pt.name||O);be=dr.error,O=dr.name,Ve=ft(Lt)}else y([O],!0),be=(await ip(H,i.disabled,o,b,t.shouldUseNativeValidation))[O],y([O]),G(jt),V&&(be?Ve=!1:(f.isValid||m.isValid)&&(Ve=await q({fields:n,onlyCheckValid:!0,name:O,eventType:_.type})));V&&(H._f.deps&&(!Array.isArray(H._f.deps)||H._f.deps.length>0)&&M(H._f.deps),x(O,Ve,be,wn))}},ye=(_,D)=>{if(R(r.errors,D)&&_.focus)return _.focus(),1},M=async(_,D={})=>{let O,V;const H=_a(_);if(t.resolver){const G=await N(Re(_)?_:H);O=ft(G),V=_?!H.some(U=>R(G,U)):O}else _?(V=(await Promise.all(H.map(async G=>{const U=R(n,G);return await q({fields:U&&U._f?{[G]:U}:U,eventType:Br.TRIGGER})}))).every(Boolean),!(!V&&!r.isValid)&&v()):V=O=await q({fields:n,name:_,eventType:Br.TRIGGER});return g.state.next({...!kt(_)||(f.isValid||m.isValid)&&O!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:O}:{},errors:r.errors}),D.shouldFocus&&!V&&Rs(n,ye,_?H:i.mount),V},B=(_,D)=>{let O={...a.mount?o:s};return D&&(O=Wh(D.dirtyFields?r.dirtyFields:r.touchedFields,O)),Re(_)?O:kt(_)?R(O,_):_.map(V=>R(O,V))},Z=(_,D)=>({invalid:!!R((D||r).errors,_),isDirty:!!R((D||r).dirtyFields,_),error:R((D||r).errors,_),isValidating:!!R(r.validatingFields,_),isTouched:!!R((D||r).touchedFields,_)}),ce=_=>{const D=_?_a(_):void 0;D==null||D.forEach(O=>ot(r.errors,O)),D?D.forEach(O=>{g.state.next({name:O,errors:r.errors})}):g.state.next({errors:{}})},Ce=(_,D,O)=>{const V=(R(n,_,{_f:{}})._f||{}).ref,H=R(r.errors,_)||{},{ref:G,message:U,type:re,...be}=H;He(r.errors,_,{...be,...D,ref:V}),g.state.next({name:_,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&V&&V.focus&&V.focus()},ue=(_,D)=>It(_)?g.state.subscribe({next:O=>"values"in O&&_(O.values||ne(void 0,D),O)}):ne(_,D,!0),de=_=>g.state.subscribe({next:D=>{if(DE(_.name,D.name,_.exact)&&kE(D,_.formState||f,Sn,_.reRenderRoot)){const O={...o};_.callback({values:O,...r,...D,defaultValues:s})}}}).unsubscribe,W=_=>(a.mount=!0,m={...m,..._.formState},de({..._,formState:{...u,..._.formState}})),se=(_,D={})=>{for(const O of _?_a(_):i.mount)i.mount.delete(O),i.array.delete(O),D.keepValue||(ot(n,O),ot(o,O)),!D.keepError&&ot(r.errors,O),!D.keepDirty&&ot(r.dirtyFields,O),!D.keepTouched&&ot(r.touchedFields,O),!D.keepIsValidating&&ot(r.validatingFields,O),!t.shouldUnregister&&!D.keepDefaultValue&&ot(s,O);g.state.next({values:Je(o)}),g.state.next({...r,...D.keepDirty?{isDirty:z()}:{}}),!D.keepIsValid&&v()},Ae=({disabled:_,name:D})=>{if(Vt(_)&&a.mount||_||i.disabled.has(D)){const H=i.disabled.has(D)!==!!_;_?i.disabled.add(D):i.disabled.delete(D),H&&a.mount&&!a.action&&v()}},ge=(_,D={})=>{let O=R(n,_);const V=Vt(D.disabled)||Vt(t.disabled),H=!i.registerName.has(_)&&O&&O._f&&!O._f.mount;return He(n,_,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:_}},name:_,mount:!0,...D}}),i.mount.add(_),O&&!H?Ae({disabled:Vt(D.disabled)?D.disabled:t.disabled,name:_}):L(_,!0,D.value),{...V?{disabled:D.disabled||t.disabled}:{},...t.progressive?{required:!!D.required,min:Ws(D.min),max:Ws(D.max),minLength:Ws(D.minLength),maxLength:Ws(D.maxLength),pattern:Ws(D.pattern)}:{},name:_,onChange:Ee,onBlur:Ee,ref:G=>{if(G){i.registerName.add(_),ge(_,D),i.registerName.delete(_),O=R(n,_);const U=Re(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,re=SE(U),be=O._f.refs||[];if(re?be.find(Ve=>Ve===U):U===O._f.ref)return;He(n,_,{_f:{...O._f,...re?{refs:[...be.filter(xl),U,...Array.isArray(R(s,_))?[{}]:[]],ref:{type:U.type,name:_}}:{ref:U}}}),L(_,!1,void 0,U)}else O=R(n,_,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||D.shouldUnregister)&&!(Bh(i.array,_)&&a.action)&&i.unMount.add(_)}}},ee=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Rs(n,ye,i.mount),Ge=_=>{Vt(_)&&(g.state.next({disabled:_}),Rs(n,(D,O)=>{const V=R(n,O);V&&(D.disabled=V._f.disabled||_,Array.isArray(V._f.refs)&&V._f.refs.forEach(H=>{H.disabled=V._f.disabled||_}))},0,!1))},Ye=(_,D)=>async O=>{let V;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let H=Je(o);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:U}=await $();y(),r.errors=G,H=Je(U)}else await q({fields:n,eventType:Br.SUBMIT});if(i.disabled.size)for(const G of i.disabled)ot(H,G);if(ot(r.errors,jh),ft(r.errors)){g.state.next({errors:{}});try{await _(H,O)}catch(G){V=G}}else D&&await D({...r.errors},O),ee(),setTimeout(ee);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ft(r.errors)&&!V,submitCount:r.submitCount+1,errors:r.errors}),V)throw V},rt=(_,D={})=>{R(n,_)&&(Re(D.defaultValue)?me(_,Je(R(s,_))):(me(_,D.defaultValue),He(s,_,Je(D.defaultValue))),D.keepTouched||ot(r.touchedFields,_),D.keepDirty||(ot(r.dirtyFields,_),r.isDirty=D.defaultValue?z(_,Je(R(s,_))):z()),D.keepError||(ot(r.errors,_),f.isValid&&v()),g.state.next({...r}))},Ke=(_,D={})=>{const O=_?Je(_):s,V=Je(O),H=ft(_),G=V;if(D.keepDefaultValues||(s=O),!D.keepValues){if(D.keepDirtyValues){const U=new Set([...i.mount,...Object.keys(cn(s,o))]);for(const re of Array.from(U)){const be=R(r.dirtyFields,re),Ve=R(o,re),jt=R(G,re);be&&!Re(Ve)?He(G,re,Ve):!be&&!Re(jt)&&me(re,jt)}}else{if(Sa&&Re(_))for(const U of i.mount){const re=R(n,U);if(re&&re._f){const be=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(Ta(be)){const Ve=be.closest("form");if(Ve){Ve.reset();break}}}}if(D.keepFieldsRef)for(const U of i.mount)me(U,R(G,U));else n={}}if(t.shouldUnregister){if(o=D.keepDefaultValues?Je(s):{},D.keepFieldsRef)for(const U of i.mount)He(o,U,R(G,U))}else o=Je(G);g.array.next({values:{...G}}),g.state.next({values:{...G}})}i={mount:D.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||!!D.keepIsValid||!!D.keepDirtyValues||!t.shouldUnregister&&!ft(G),a.watch=!!t.shouldUnregister,a.keepIsValid=!!D.keepIsValid,a.action=!1,D.keepErrors||(r.errors={}),g.state.next({submitCount:D.keepSubmitCount?r.submitCount:0,isDirty:H?!1:D.keepDirty?r.isDirty:D.keepValues?z():!!(D.keepDefaultValues&&!Ht(_,s)),isSubmitted:D.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:H?{}:D.keepDirtyValues?D.keepDefaultValues&&o?cn(s,o):r.dirtyFields:D.keepDefaultValues&&_?cn(s,_):D.keepDirty?r.dirtyFields:{},touchedFields:D.keepTouched?r.touchedFields:{},errors:D.keepErrors?r.errors:{},isSubmitSuccessful:D.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},st=(_,D)=>Ke(It(_)?_(o):_,{...t.resetOptions,...D}),dt=(_,D={})=>{const O=R(n,_),V=O&&O._f;if(V){const H=V.refs?V.refs[0]:V.ref;H.focus&&setTimeout(()=>{H.focus(),D.shouldSelect&&It(H.select)&&H.select()})}},Sn=_=>{r={...r,..._}},_e={control:{register:ge,unregister:se,getFieldState:Z,handleSubmit:Ye,setError:Ce,_subscribe:de,_runSchema:$,_updateIsValidating:y,_focusError:ee,_getWatch:ne,_getDirty:z,_setValid:v,_setFieldArray:S,_setDisabledField:Ae,_setErrors:T,_getFieldArray:Q,_reset:Ke,_resetDefaultValues:()=>It(t.defaultValues)&&t.defaultValues().then(_=>{st(_,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:Ge,_subjects:g,_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:W,trigger:M,register:ge,handleSubmit:Ye,watch:ue,setValue:me,setValues:ve,getValues:B,reset:st,resetField:rt,resetDefaultValues:(_,D={})=>{if(s=Je(_),!D.keepDirty){const O=cn(s,o);r.dirtyFields=O,r.isDirty=!ft(O)}D.keepIsValid||v(),g.state.next({...r,defaultValues:s})},clearErrors:ce,unregister:se,setError:Ce,setFocus:dt,getFieldState:Z};return{..._e,formControl:_e}}function xE(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),n=p.useRef(e.formControl),[s,o]=p.useState(()=>({...Je(lp),isLoading:It(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:It(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&&!It(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...c}=PE(e);t.current={...c,formState:s}}const a=t.current.control;return a._options=e,kl(()=>{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&&!Ht(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(()=>zh(s,a),[a,s]),t.current}function FE(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}=_n({queryKey:["framework-search",o.sort().join(","),r],queryFn:()=>TS({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 cp(e){var r,n;return(n=(r=(await Me.get(`/api/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function ME(e){var r,n,s,o,a,i,c;const t=_n({queryKey:["channel",e],queryFn:()=>cp(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 $E(e){const{data:t}=_n({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>NS(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const dp=[{label:"Strict",value:"Fixed"},{label:"Adaptive",value:"Diagnostic"},{label:"Prior learning",value:"PriorLearning"}],BE={"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."}},qE=new Set(["review","read","sourcingreview","orgreview"]),Aa={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},jE={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},UE={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"},Gs={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},Bl=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function up(e,t,r,n,s={}){if(!(e!=null&&e.length))return fp(aA(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"&&Bl.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=GE(c),f=KE(c,r,t,o,s),m=t[d],g=VE(d,hp(m,u),u,t,s),b={code:d,label:c.label??d,inputType:u,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:zE(d,c.editable!==!1,s),placeholder:c.placeholder,maxLength:c.maxLength,options:WE(f,g,u,r),depends:c.depends,tab:RE(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:g};if(d==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...b,required:h,visible:h}}return b});return fp(i,r,t,n,s)}function fp(e,t,r,n,s){var o;return((o=s.profile)==null?void 0:o.key)==="learningPath"?oA(e,t,r,n):sA(e,t,r,n)}function zE(e,t,r){var o;const n=r.editorMode??"edit";if(!qE.has(n))return t!==!1;const s=(o=r.editableFields)==null?void 0:o[n];return!!(s&&s.includes(e))}function VE(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!==""?HE(Number(i)):t}default:return t}}function HE(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 QE(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 WE(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=QE(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 RE(e){const t=e.section;if(t){if(Aa[t])return Aa[t];const n=jE[t];if(n&&Aa[n])return Aa[n]}const r=e.code??"";return UE[r]??"details"}function hp(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 GE(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 KE(e,t,r,n,s){var d;const o=e.code??"";if(((d=s.profile)==null?void 0:d.key)==="learningPath"&&o==="policy")return dp;if(o==="maxQuestions"){const u=s.childCount??0;if(u>0)return Array.from({length:u},(f,m)=>({label:String(m+1),value:String(m+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,m=(f&&f.length?f:s.contextAdditionalCategories)??t.channelAdditionalCategories;return m!=null&&m.length?JE(m).map(g=>({label:g,value:g})):void 0}const c=e.sourceCategory??Gs[o];if(c)return pp(o,c,e,t,r,n)}function YE(e,t){return Bl.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function ZE(e,t){return Bl.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 XE(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 JE(e){return Array.from(new Set(e))}function eA(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function pp(e,t,r,n,s,o){const a=YE(e,r),i=ZE(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=>eA(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)??Gs[h]??h;f.push(...ql(n,y,i))}const g=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()),b=XE(g);return b.length?b.map(c):ql(n,t,i).map(c)}function Ks(e,t){const r=Gs[e];if(r)return pp(e,r,{},t,{},new Map)}function et(e,t,r){return hp(e[t],r)}const tA=["board","medium","gradeLevel","subject"];function rA(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>tA.includes(n.code)):!0}function nA(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 sA(e,t,r,n){var c;if(!n||rA(t))return e;const s=e.filter(d=>{const u=d.sourceCategory??Gs[d.code];return!u||nA(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:et(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 jl="Organisation Framework Terms";function oA(e,t,r,n){var m,g;if(!n)return e;const s=[...((m=t.organisationFramework)==null?void 0:m.categories)??[]].sort((b,h)=>(b.index??1/0)-(h.index??1/0));if(!s.length)return e;const o=(g=Uu(s))==null?void 0:g.code,a=b=>b.sourceCategory??Gs[b.code];let c=e.filter(b=>{const h=a(b);return h?h!==o&&s.some(v=>v.code===h):!0}).map(b=>a(b)?{...b,section:jl}:b),d=c.findIndex(b=>b.code==="framework");if(d===-1){const b={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:jl,options:t.orgFrameworks,currentValue:et(r,"framework","select")},h=c.findIndex(v=>!!a(v));d=h>=0?h:c.length,c=[...c.slice(0,d),b,...c.slice(d)]}const u=new Set(c.map(b=>b.code)),f=s.filter(b=>b.code!==o&&!u.has(b.code)).map(b=>({code:b.code,label:b.name,inputType:"multiselect",editable:!0,tab:"details",section:jl,options:(b.terms??[]).map(h=>({label:h.name,value:h.name})),currentValue:et(r,b.code,"multiselect")}));return f.length?[...c.slice(0,d+1),...f,...c.slice(d+1)]:c}function aA(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:et(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:et(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:et(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:et(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:dp,currentValue:et(e,"policy","select")||"Fixed"}),s):(s.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:et(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:et(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:et(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Ks("subjectIds",r),currentValue:et(e,"subjectIds","multiselect")}),s.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:et(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Ks("targetBoardIds",r),currentValue:et(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:Ks("targetMediumIds",r),currentValue:et(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:Ks("targetGradeLevelIds",r),currentValue:et(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:Ks("targetSubjectIds",r),currentValue:et(e,"targetSubjectIds","multiselect")}),s.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"license","select")}),s):s}const iA=["allowECM","levels","setPeriod","instances"];function gp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function lA(e,t={}){const r={...e};for(const o of iA)delete r[o];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:gp(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 cA(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?gp(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function dA(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(m=>d.has(m))&&(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 Qn={section:"_section_qa0tm_1",header:"_header_qa0tm_11",title:"_title_qa0tm_17",description:"_description_qa0tm_24",divider:"_divider_qa0tm_30",fields:"_fields_qa0tm_36"},uA=({title:e,description:t,children:r})=>l.jsxs("div",{className:Qn.section,children:[l.jsxs("div",{className:Qn.header,children:[l.jsx("h3",{className:Qn.title,children:e}),t&&l.jsx("p",{className:Qn.description,children:t})]}),l.jsx("hr",{className:Qn.divider}),l.jsx("div",{className:Qn.fields,children:r})]}),j={field:"_field_93co8_1",fullWidth:"_fullWidth_93co8_7",label:"_label_93co8_11",required:"_required_93co8_19",input:"_input_93co8_24",textarea:"_textarea_93co8_45",inputError:"_inputError_93co8_50",error:"_error_93co8_54",selectBtn:"_selectBtn_93co8_59",selectOpen:"_selectOpen_93co8_83",placeholder:"_placeholder_93co8_87",selectedVal:"_selectedVal_93co8_91",chevronUp:"_chevronUp_93co8_95",dropdown:"_dropdown_93co8_100",option:"_option_93co8_116",optionSelected:"_optionSelected_93co8_134",noOpts:"_noOpts_93co8_139",chipGroup:"_chipGroup_93co8_146",chipInput:"_chipInput_93co8_158",addChipBtn:"_addChipBtn_93co8_167",radioGroup:"_radioGroup_93co8_184",radioLabel:"_radioLabel_93co8_191",iconWrap:"_iconWrap_93co8_199",iconPreview:"_iconPreview_93co8_214",iconPlaceholder:"_iconPlaceholder_93co8_220",removeIconBtn:"_removeIconBtn_93co8_233",tagChip:"_tagChip_93co8_252",tagChipRemove:"_tagChipRemove_93co8_264",nestedSelectRow:"_nestedSelectRow_93co8_278",dialcodeRow:"_dialcodeRow_93co8_287",validateBtn:"_validateBtn_93co8_293",dialcodeValid:"_dialcodeValid_93co8_315",dialcodeSpinner:"_dialcodeSpinner_93co8_325"},mp=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:o,placeholder:a})=>{const i=ae(),{register:c,formState:{errors:d}}=Xt(),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)})]})},fA=({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:m}}=Xt(),g=u(e),b=((v=r.find(y=>y.value===g))==null?void 0:v.label)??o.selectField.selectPlaceholder,h=m[e];return p.useEffect(()=>{if(!a)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.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:g?j.selectedVal:j.placeholder,children:b}),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,g===y.value?j.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:y.label}),g===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)})]})},hA=({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:m}}=Xt(),g=u(e)??[],b=m[e],h=g.length?`${g.length} ${o.multiSelectField.selectedCountSuffix}`:o.multiSelectField.selectPlaceholder;p.useEffect(()=>{if(!a)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]);const v=y=>{const C=g.includes(y)?g.filter(S=>S!==y):[...g,y];f(e,C,{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,b?j.inputError:"",a?j.selectOpen:""].join(" "),onClick:()=>i(y=>!y),children:[l.jsx("span",{className:g.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,g.includes(y.value)?j.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(Zr,{size:13,style:{opacity:g.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})]}),b&&l.jsx("span",{className:j.error,children:String(b.message)})]})},pA=({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:m,setValue:g,formState:{errors:b}}=Xt(),h=m(e)??[],v=b[e],y=()=>{const S=i.trim();S&&!h.includes(S)&&g(e,[...h,S],{shouldDirty:!0}),c(""),u(!1)},C=S=>g(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:()=>C(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(Jr,{size:12})," ",o.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:j.error,children:String(v.message)})]})},gA=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=ae(),{register:a,formState:{errors:i}}=Xt(),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 mA(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 vA(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 yA(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 bA(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 Ie={overlay:"_overlay_1bq5u_1",modal:"_modal_1bq5u_12",header:"_header_1bq5u_24",title:"_title_1bq5u_33",closeBtn:"_closeBtn_1bq5u_39",tabs:"_tabs_1bq5u_57",tab:"_tab_1bq5u_57",activeTab:"_activeTab_1bq5u_83",body:"_body_1bq5u_88",searchWrap:"_searchWrap_1bq5u_99",searchIcon:"_searchIcon_1bq5u_104",searchInput:"_searchInput_1bq5u_113",grid:"_grid_1bq5u_132",imgCell:"_imgCell_1bq5u_148",imgCellSelected:"_imgCellSelected_1bq5u_166",thumb:"_thumb_1bq5u_171",noThumb:"_noThumb_1bq5u_177",checkBadge:"_checkBadge_1bq5u_183",loadMoreBtn:"_loadMoreBtn_1bq5u_198",loadingRow:"_loadingRow_1bq5u_220",empty:"_empty_1bq5u_230",spinner:"_spinner_1bq5u_237",uploadArea:"_uploadArea_1bq5u_247",dropZone:"_dropZone_1bq5u_256",uploadIcon:"_uploadIcon_1bq5u_277",dropText:"_dropText_1bq5u_281",dropSubtext:"_dropSubtext_1bq5u_288",uploadPreview:"_uploadPreview_1bq5u_294",hiddenInput:"_hiddenInput_1bq5u_301",fileName:"_fileName_1bq5u_305",errorText:"_errorText_1bq5u_311",footer:"_footer_1bq5u_318",cancelBtn:"_cancelBtn_1bq5u_328",confirmBtn:"_confirmBtn_1bq5u_345"},vp=18,yp=({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,m]=p.useState(0),[g,b]=p.useState(!1),[h,v]=p.useState(null),[y,C]=p.useState(0),[S,w]=p.useState(null),[T,A]=p.useState(""),[L,E]=p.useState(!1),[x,$]=p.useState(""),N=p.useRef(null),P=Y(M=>{var B,Z;return((Z=(B=M.editorConfig)==null?void 0:B.context)==null?void 0:Z.channel)??""}),q=Y(M=>{var B,Z;return((Z=(B=M.editorConfig)==null?void 0:B.context)==null?void 0:Z.uid)??""}),F=Y(M=>{var B,Z,ce;return((ce=(Z=(B=M.editorConfig)==null?void 0:B.context)==null?void 0:Z.cloudStorage)==null?void 0:ce.presigned_headers)??{}}),z=Y(M=>{var B,Z,ce;return((ce=(Z=(B=M.editorConfig)==null?void 0:B.config)==null?void 0:Z.assetConfig)==null?void 0:ce.size)??1*1024*1024}),ne=Y(M=>{var B,Z,ce;return((ce=(Z=(B=M.editorConfig)==null?void 0:B.config)==null?void 0:Z.assetConfig)==null?void 0:ce.accepted)??"image/png,image/jpeg"}),Q=p.useCallback(async(M,B,Z=!1)=>{var ce;b(!0);try{const Ce={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};o==="my"&&q&&(Ce.createdBy=q),P&&(Ce.channel=P);const de=((ce=(await Me.post("/action/composite/v3/search",{request:{filters:Ce,query:M,limit:vp,offset:B,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:ce.result)??{},W=de.content??[];m(de.count??0),u(se=>Z?[...se,...W]:W)}catch{}finally{b(!1)}},[o,q,P]);p.useEffect(()=>{o!=="upload"&&(u([]),C(0),Q(i,0))},[o]);const te=p.useRef(),pe=M=>{c(M),clearTimeout(te.current),te.current=setTimeout(()=>{u([]),C(0),Q(M,0)},400)},ie=()=>{const M=y+vp;C(M),Q(i,M,!0)},me=()=>{const M=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";M&&r(M)};p.useEffect(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);const ve=M=>{var ce;const B=(ce=M.target.files)==null?void 0:ce[0];if(M.target.value="",!B)return;const Z=ne.split(",").map(Ce=>Ce.trim());if(!Z.includes(B.type)){const Ce=Z.map(ue=>ue.replace("image/","").toUpperCase()).join(", ");$(s.appIconPickerModal.invalidFileTypeError.replace("{types}",Ce));return}if(B.size>z){const Ce=(z/1048576).toFixed(0);$(s.appIconPickerModal.fileTooLargeError.replace("{size}",Ce));return}T&&URL.revokeObjectURL(T),w(B),A(URL.createObjectURL(B)),$("")},Ee=async()=>{if(S){E(!0),$("");try{const M=await mA(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,q,P),B=await vA(M,S.name);await yA(B,S,F);const Z=B.split("?")[0],ce=await bA(M,Z,S.type);r(ce)}catch(M){$(M instanceof Error?M.message:s.appIconPickerModal.uploadFailedError)}finally{E(!1)}}},ye=d.length<f;return l.jsx("div",{className:Ie.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Ie.modal,children:[l.jsxs("div",{className:Ie.header,children:[l.jsx("span",{className:Ie.title,children:s.appIconPickerModal.title}),l.jsx("button",{className:Ie.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:l.jsx(fr,{size:18})})]}),l.jsxs("div",{className:Ie.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":o==="my",className:`${Ie.tab} ${o==="my"?Ie.activeTab:""}`,onClick:()=>a("my"),children:s.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":o==="all",className:`${Ie.tab} ${o==="all"?Ie.activeTab:""}`,onClick:()=>a("all"),children:s.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":o==="upload",className:`${Ie.tab} ${o==="upload"?Ie.activeTab:""}`,onClick:()=>a("upload"),children:[l.jsx(fi,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Ie.body,children:o!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ie.searchWrap,children:[l.jsx(Mo,{size:14,className:Ie.searchIcon}),l.jsx("input",{type:"search",className:Ie.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:i,onChange:M=>pe(M.target.value)})]}),g&&d.length===0?l.jsxs("div",{className:Ie.loadingRow,children:[l.jsx(Po,{size:20,className:Ie.spinner}),l.jsx("span",{children:s.appIconPickerModal.loadingText})]}):d.length===0?l.jsx("div",{className:Ie.empty,children:s.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Ie.grid,children:d.map(M=>{const B=M.appIcon??M.artifactUrl??M.downloadUrl??"",Z=(h==null?void 0:h.identifier)===M.identifier;return l.jsxs("button",{type:"button",className:`${Ie.imgCell} ${Z?Ie.imgCellSelected:""}`,onClick:()=>v(M),title:M.name,children:[B?l.jsx("img",{src:B,alt:M.name,className:Ie.thumb}):l.jsx("div",{className:Ie.noThumb,children:s.appIconPickerModal.noThumbnailText}),Z&&l.jsx("div",{className:Ie.checkBadge,children:l.jsx(Zr,{size:12})})]},M.identifier)})}),ye&&!g&&l.jsx("button",{className:Ie.loadMoreBtn,onClick:ie,children:s.appIconPickerModal.loadMoreButton}),g&&d.length>0&&l.jsx("div",{className:Ie.loadingRow,children:l.jsx(Po,{size:16,className:Ie.spinner})})]}):l.jsxs("div",{className:Ie.uploadArea,children:[l.jsx("div",{className:Ie.dropZone,onClick:()=>{var M;return(M=N.current)==null?void 0:M.click()},onDragOver:M=>M.preventDefault(),onDrop:M=>{M.preventDefault();const B=M.dataTransfer.files[0];B&&ve({target:{files:[B],value:""}})},children:T?l.jsx("img",{src:T,alt:s.appIconPickerModal.previewAlt,className:Ie.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(fi,{size:32,className:Ie.uploadIcon}),l.jsx("p",{className:Ie.dropText,children:s.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Ie.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",ne.split(",").map(M=>M.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(z/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:N,type:"file",accept:ne,className:Ie.hiddenInput,onChange:ve}),S&&l.jsx("p",{className:Ie.fileName,children:S.name}),x&&l.jsx("p",{className:Ie.errorText,children:x})]})}),l.jsxs("div",{className:Ie.footer,children:[l.jsx("button",{className:Ie.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),o==="upload"?l.jsx("button",{className:Ie.confirmBtn,disabled:!S||L,onClick:Ee,children:L?l.jsxs(l.Fragment,{children:[l.jsx(Po,{size:14,className:Ie.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Ie.confirmBtn,disabled:!h,onClick:me,children:s.appIconPickerModal.useSelectedButton})]})]})})},CA=({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}}=Xt(),m=c(e),g=f[e],b=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:m?l.jsx("img",{src:m,alt:o.appIconField.iconAlt,className:j.iconPreview}):l.jsxs("div",{className:j.iconPlaceholder,children:[l.jsx(bd,{size:20}),l.jsx("span",{children:o.appIconField.selectIconLabel})]})}),m&&!s&&l.jsxs("button",{type:"button",className:j.removeIconBtn,onClick:h,"aria-label":o.appIconField.removeIconAriaLabel,children:[l.jsx($o,{size:13}),l.jsx("span",{children:o.appIconField.removeLabel})]}),g&&l.jsx("span",{className:j.error,children:String(g.message)}),a&&l.jsx(yp,{nodeId:r,currentValue:m,onSelect:b,onClose:()=>i(!1)})]})},SA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Xt(),{field:a,fieldState:{error:i}}=Qs({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)})]})},wA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Xt(),{field:a,fieldState:{error:i}}=Qs({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??[],m=v=>{const y=v.trim();!y||f.includes(y)||a.onChange([...f,y])},g=v=>{a.onChange(f.filter(y=>y!==v))},b=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m(c),d("")):v.key==="Backspace"&&c===""&&f.length>0&&g(f[f.length-1])},h=()=>{c.trim()&&(m(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(),g(v)},"aria-label":`Remove ${v}`,children:l.jsx(fr,{size:11})})]},v)),!n&&l.jsx("input",{ref:u,className:j.chipInput,value:c,onChange:v=>d(v.target.value),onKeyDown:b,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)})]})},_A=({name:e,label:t,levels:r,required:n,disabled:s})=>{const o=ae(),{control:a}=Xt(),{field:i,fieldState:{error:c}}=Qs({name:e,control:a,rules:{required:n?o.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=i.value??{},u=(f,m,g)=>{const b={};for(let h=0;h<m;h++)b[r[h].code]=d[r[h].code]??"";b[f]=g;for(let h=m+1;h<r.length;h++)b[r[h].code]="";i.onChange(b)};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,m)=>{const g=m>0&&!d[r[m-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||g,value:d[f.code]??"",onChange:b=>u(f.code,m,b.target.value),onBlur:i.onBlur,children:[l.jsx("option",{value:"",children:o.nestedSelectField.selectPlaceholder}),f.options.map(b=>l.jsx("option",{value:b.value,children:b.label},b.value))]})]},f.code)})}),c&&l.jsx("span",{className:j.error,children:String(c.message)})]})},bp=[{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"}],TA=({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}}=Xt(),m=d(e),g=bp.find(v=>v.value===m),b=(g==null?void 0:g.label)??s.licenseSelectField.selectPlaceholder,h=f[e];return p.useEffect(()=>{if(!o)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)},[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:m?j.selectedVal:j.placeholder,children:b}),l.jsx(Xr,{size:14,className:o?j.chevronUp:""})]}),o&&l.jsx("div",{className:j.dropdown,role:"listbox",children:bp.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":m===v.value,className:[j.option,m===v.value?j.optionSelected:""].join(" "),onClick:()=>{u(e,v.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:v.label}),m===v.value&&l.jsx(Zr,{size:13})]},v.value))}),h&&l.jsx("span",{className:j.error,children:String(h.message)})]})},EA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Xt(),{field:a,fieldState:{error:i}}=Qs({name:e,control:o,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,d]=p.useState("idle"),[u,f]=p.useState(""),m=async()=>{const b=(a.value??"").trim();if(!b){d("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}d("loading"),f("");try{const h=await xS(b),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)}},g=()=>c==="loading"?l.jsx(Po,{size:16,className:j.dialcodeSpinner}):c==="valid"?l.jsx(hd,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(yy,{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:b=>{a.onChange(b),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:m,disabled:n||c==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:c==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),g()]}),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})]})},Qt={cards:"_cards_1oc2m_1",card:"_card_1oc2m_1",cardActive:"_cardActive_1oc2m_30",cardIcon:"_cardIcon_1oc2m_35",cardIconPrimary:"_cardIconPrimary_1oc2m_46",cardIconHover:"_cardIconHover_1oc2m_50",radioDot:"_radioDot_1oc2m_54",radioDotActive:"_radioDotActive_1oc2m_65",cardTitle:"_cardTitle_1oc2m_70",cardTitleInk:"_cardTitleInk_1oc2m_76",cardDescription:"_cardDescription_1oc2m_80",cardDescriptionCharcoal:"_cardDescriptionCharcoal_1oc2m_86"},AA=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:o}=Xt(),a=[{value:"Fixed",Icon:Cd,iconVariant:Qt.cardIconPrimary,title:s.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"Diagnostic",Icon:zy,iconVariant:Qt.cardIconPrimary,title:s.learningPath.policyAdaptiveLabel,titleVariant:Qt.cardTitleInk,description:l.jsxs(l.Fragment,{children:[s.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:j.required,children:"*"}),s.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:Qt.cardDescriptionCharcoal},{value:"PriorLearning",Icon:Fy,iconVariant:Qt.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(yE,{name:e,control:o,rules:{required:r?s.selectField.requiredError.replace("{field}",t):!1},render:({field:i})=>l.jsx("div",{className:Qt.cards,children:a.map(({value:c,Icon:d,iconVariant:u,title:f,titleVariant:m,description:g,descriptionVariant:b})=>{const h=i.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[Qt.card,h?Qt.cardActive:""].join(" "),onClick:()=>i.onChange(c),children:[l.jsx("span",{className:[Qt.cardIcon,u].join(" "),children:l.jsx(d,{size:16})}),l.jsx("span",{className:[Qt.radioDot,h?Qt.radioDotActive:""].join(" ")}),l.jsx("span",{className:[Qt.cardTitle,m].join(" "),children:f}),l.jsx("span",{className:[Qt.cardDescription,b].join(" "),children:g})]},c)})})})]})},Wn={form:"_form_lktqh_1",formLp:"_formLp_lktqh_7",ungrouped:"_ungrouped_lktqh_12",ungroupedLp:"_ungroupedLp_lktqh_23",fullWidthField:"_fullWidthField_lktqh_27",noFields:"_noFields_lktqh_31"},IA=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:o,onFormStatusChange:a})=>{var ee,Ge,Ye,rt,Ke,st,dt,Sn,is;const i=ae(),c=Y(K=>K.editorConfig),d=Y(K=>K.editorProfile),u=d.key==="learningPath",f=Y(K=>K.rootFormConfig),m=Y(K=>K.unitFormConfig),g=Y(K=>K.categoryMeta),b=Y(K=>K.contentFramework),h=Y(K=>K.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:C}=ta(b??((ee=c==null?void 0:c.context)==null?void 0:ee.framework),h??((Ge=c==null?void 0:c.context)==null?void 0:Ge.targetFWIds)),{frameworks:S,collectionAdditionalCategories:w,contentAdditionalCategories:T,defaultLicense:A,name:L}=ME((Ye=c==null?void 0:c.context)==null?void 0:Ye.channel),E=$E(((rt=c==null?void 0:c.context)==null?void 0:rt.userId)??((Ke=c==null?void 0:c.context)==null?void 0:Ke.uid)),x=FE(S,(st=g==null?void 0:g.frameworkMetadata)==null?void 0:st.orgFWType,(dt=c==null?void 0:c.context)==null?void 0:dt.channel),$={organisationFramework:v,targetFrameworks:y,orgFrameworks:x,channelAdditionalCategories:w},N=le(K=>K.selectedNodeId),P=le(K=>K.treeData),q=le(K=>K.treeCache),F=N?q[N]??{}:{},z={...e,...F},ne=p.useMemo(()=>{var _e;if(!N)return 0;const K=[...P];for(;K.length;){const _=K.shift();if(_.id===N)return((_e=_.children)==null?void 0:_e.length)??0;_.children&&K.push(..._.children)}return 0},[P,N]),Q=(c==null?void 0:c.config)??{},te=(c==null?void 0:c.context)??{},pe={editorMode:s,editableFields:Q.editableFields,objectType:Q.objectType,setDefaultCopyRight:Q.setDefaultCopyRight===!0,defaultLicense:te.defaultLicense??A,contextAdditionalCategories:te.additionalCategories,userFullName:((Sn=te.user)==null?void 0:Sn.fullName)??E,channelName:L,collectionAdditionalCategories:w,contentAdditionalCategories:T,childCount:ne,profile:d},ie=r?f:m,me=ie||(((is=c==null?void 0:c.config.hierarchy)==null?void 0:is.formConfig)??[]),ve=up(me,z,$,r,pe),Ee=ve.filter(K=>K.tab===t&&K.inputType!=="appIcon"&&K.visible!==!1),ye=xE({mode:"onChange",defaultValues:Object.fromEntries(ve.map(K=>{const _e=["multiselect","chips","keywords","tagsinput"],_=["nestedselect"];return _e.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??[]]:_.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??{}]:[K.code,K.currentValue??K.defaultValue??""]}))});dA(ye,ve);const{updateNode:M}=le(),B=p.useRef(ve);B.current=ve;const Z=p.useRef(N);Z.current=N;const ce=p.useRef(o);ce.current=o;const Ce=p.useRef(a);Ce.current=a;const ue=p.useRef(typeof z.shuffle=="boolean"?z.shuffle:void 0),de=p.useRef(z.name??"");de.current=z.name??"";const W=p.useRef(s);W.current=s;const se=["review","read","sourcingreview","orgreview"];p.useEffect(()=>{const K=Z.current;if(K){const _e=Object.fromEntries(B.current.filter(_=>_.currentValue!==void 0&&_.currentValue!==null).map(_=>[_.code,_.currentValue]));Object.keys(_e).length>0&&M(K,_e)}ye.trigger().then(()=>{const _e=ye.formState.errors,_=B.current,D=Array.from(new Set(Object.keys(_e).map(O=>{var V;return(V=_.find(H=>H.code===O))==null?void 0:V.tab}).filter(Boolean)));Ce.current(Object.keys(_e).length===0,D)})},[]),p.useEffect(()=>{const K=ye.watch((_e,{name:_})=>{const D=Z.current;if(!D)return;const O=B.current,V=new Set(O.map(U=>U.code));if(_&&V.has(_)){let U=ye.getValues(_);if(_==="dialcodes"&&(U=Array.isArray(U)?U:U?[U]:[]),_==="shuffle"&&(U===!0&&ue.current===!1&&we(i.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(Es,{size:16})}),ue.current=U),_==="framework"&&r&&typeof U=="string"&&U){const be=Y.getState();if(be.setContentFramework(U,be.contentTargetFWIds),u){const Ve=le.getState().pruneCoursesByFramework(U);Ve>0&&we(i.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(Ve)),{icon:l.jsx(Es,{size:16}),duration:5e3})}}const re=cA(_,U);re&&(M(D,re),ce.current(re))}else if(!_){const U=ye.getValues(),re=Object.fromEntries(Object.entries(U).filter(([Ve])=>V.has(Ve))),be=lA(re,{isReview:se.includes(W.current),nodeTitle:de.current});Object.keys(be).length>0&&(M(D,be),ce.current(be))}const H=ye.formState.errors,G=Array.from(new Set(Object.keys(H).map(U=>{var re;return(re=O.find(be=>be.code===U))==null?void 0:re.tab}).filter(Boolean)));Ce.current(Object.keys(H).length===0,G)});return()=>K.unsubscribe()},[ye]),p.useEffect(()=>{for(const K of["author","creator","copyright","copyrightYear","license"]){const _e=B.current.find(D=>D.code===K);if(!_e||_e.currentValue===void 0||_e.currentValue===null||_e.currentValue==="")continue;const _=ye.getValues(K);(_==null||_==="")&&ye.setValue(K,_e.currentValue,{shouldDirty:!1})}},[E,L,ye]);const Ae=Ee.reduce((K,_e)=>{const _=K[K.length-1];return _&&_.section===_e.section?_.fields.push(_e):K.push({section:_e.section,fields:[_e]}),K},[]),ge=K=>{const _e={key:K.code,name:K.code,label:K.label,required:K.required,disabled:K.editable===!1};if(u&&K.code==="policy")return l.jsx("div",{className:Wn.fullWidthField,children:l.jsx(AA,{..._e})},K.code);switch(K.inputType){case"textarea":return l.jsx(mp,{..._e,multiline:!0,maxLength:K.maxLength});case"select":return l.jsx(fA,{..._e,options:K.options??[]});case"multiselect":return l.jsx(hA,{..._e,options:K.options??[]});case"chips":return l.jsx(pA,{..._e});case"radio":return l.jsx(gA,{..._e,options:K.options??[]});case"appIcon":return l.jsx(CA,{..._e,nodeId:N??""});case"datepicker":case"datetime":return l.jsx(SA,{..._e});case"keywords":case"tagsinput":return l.jsx(wA,{..._e});case"nestedselect":return l.jsx(_A,{..._e,levels:K.levels??[]});case"license":return l.jsx(TA,{..._e});case"dialcode":return l.jsx(EA,{..._e});default:return l.jsx(mp,{..._e,maxLength:K.maxLength})}};return l.jsx(bE,{...ye,children:l.jsxs("div",{className:[Wn.form,u?Wn.formLp:""].filter(Boolean).join(" "),children:[Ae.map((K,_e)=>{const _=K.section?BE[K.section]:void 0;return _?l.jsx(uA,{title:_.title,description:_.description,children:K.fields.map(ge)},K.section??_e):l.jsx("div",{className:[Wn.ungrouped,u?Wn.ungroupedLp:""].filter(Boolean).join(" "),children:K.fields.map(ge)},_e)}),Ee.length===0&&!C&&l.jsx("p",{className:Wn.noFields,children:i.sparkMetaForm.noFieldsMessage})]})})};function Cp(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function kA(e,t){return e.reduce((r,n,s)=>{const o=t.get(n);return o&&(r[s]=o),r},Array(e.length))}function Ia(e){return e!==null&&e>=0}function DA(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 LA(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Sp=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const o=Cp(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}},ka={scaleX:1,scaleY:1},OA=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,...ka}:null}const c=NA(o,s,r);return s>r&&s<=a?{x:0,y:-i.height-c,...ka}:s<r&&s>=a?{x:0,y:i.height+c,...ka}:{x:0,y:0,...ka}};function NA(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 wp="Sortable",_p=p.createContext({activeIndex:-1,containerId:wp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Sp,disabled:{draggable:!1,droppable:!1}});function PA(e){let{children:t,id:r,items:n,strategy:s=Sp,disabled:o=!1}=e;const{active:a,dragOverlay:i,droppableRects:c,over:d,measureDroppableContainers:u}=dd(),f=vs(wp,r),m=i.rect!==null,g=p.useMemo(()=>n.map(A=>typeof A=="object"&&"id"in A?A.id:A),[n]),b=a!=null,h=a?g.indexOf(a.id):-1,v=d?g.indexOf(d.id):-1,y=p.useRef(g),C=!DA(g,y.current),S=v!==-1&&h===-1||C,w=LA(o);nr(()=>{C&&b&&u(g)},[C,g,b,u]),p.useEffect(()=>{y.current=g},[g]);const T=p.useMemo(()=>({activeIndex:h,containerId:f,disabled:w,disableTransforms:S,items:g,overIndex:v,useDragOverlay:m,sortedRects:kA(g,c),strategy:s}),[h,f,w.draggable,w.droppable,S,g,v,c,m,s]);return p.createElement(_p.Provider,{value:T},t)}const xA=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return Cp(r,n,s).indexOf(t)},FA=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},MA={duration:200,easing:"ease"},Tp="transform",$A=Or.Transition.toString({property:Tp,duration:0,easing:"linear"}),BA={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=In(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 jA(e){let{animateLayoutChanges:t=FA,attributes:r,disabled:n,data:s,getNewIndex:o=xA,id:a,strategy:i,resizeObserverConfig:c,transition:d=MA}=e;const{items:u,containerId:f,activeIndex:m,disabled:g,disableTransforms:b,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:C}=p.useContext(_p),S=UA(n,g),w=u.indexOf(a),T=p.useMemo(()=>({sortable:{containerId:f,index:w,items:u},...s}),[f,s,w,u]),A=p.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:L,node:E,isOver:x,setNodeRef:$}=Xv({id:a,data:T,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...c}}),{active:N,activatorEvent:P,activeNodeRect:q,attributes:F,setNodeRef:z,listeners:ne,isDragging:Q,over:te,setActivatorNodeRef:pe,transform:ie}=cd({id:a,data:T,attributes:{...BA,...r},disabled:S.draggable}),me=$m($,z),ve=!!N,Ee=ve&&!b&&Ia(m)&&Ia(v),ye=!y&&Q,M=ye&&Ee?ie:null,Z=Ee?M??(i??C)({rects:h,activeNodeRect:q,activeIndex:m,overIndex:v,index:w}):null,ce=Ia(m)&&Ia(v)?o({id:a,items:u,activeIndex:m,overIndex:v}):w,Ce=N==null?void 0:N.id,ue=p.useRef({activeId:Ce,items:u,newIndex:ce,containerId:f}),de=u!==ue.current.items,W=t({active:N,containerId:f,isDragging:Q,isSorting:ve,id:a,index:w,items:u,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:d,wasDragging:ue.current.activeId!=null}),se=qA({disabled:!W,index:w,node:E,rect:L});return p.useEffect(()=>{ve&&ue.current.newIndex!==ce&&(ue.current.newIndex=ce),f!==ue.current.containerId&&(ue.current.containerId=f),u!==ue.current.items&&(ue.current.items=u)},[ve,ce,f,u]),p.useEffect(()=>{if(Ce===ue.current.activeId)return;if(Ce&&!ue.current.activeId){ue.current.activeId=Ce;return}const ge=setTimeout(()=>{ue.current.activeId=Ce},50);return()=>clearTimeout(ge)},[Ce]),{active:N,activeIndex:m,attributes:F,data:T,rect:L,index:w,newIndex:ce,items:u,isOver:x,isSorting:ve,isDragging:Q,listeners:ne,node:E,overIndex:v,over:te,setNodeRef:me,setActivatorNodeRef:pe,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:se??Z,transition:Ae()};function Ae(){if(se||de&&ue.current.newIndex===w)return $A;if(!(ye&&!wo(P)||!d)&&(ve||W))return Or.Transition.toString({...d,property:Tp})}}function UA(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 Da(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 zA=[Ne.Down,Ne.Right,Ne.Up,Ne.Left],VA=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:o,over:a,scrollableAncestors:i}}=t;if(zA.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=s.get(f.id);if(m)switch(e.code){case Ne.Down:n.top<m.top&&c.push(f);break;case Ne.Up:n.top>m.top&&c.push(f);break;case Ne.Left:n.left>m.left&&c.push(f);break;case Ne.Right:n.left<m.left&&c.push(f);break}});const d=ev({collisionRect:n,droppableRects:s,droppableContainers:c});let u=Fc(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),m=o.get(u),g=m?s.get(m.id):null,b=m==null?void 0:m.node.current;if(b&&g&&f&&m){const v=Eo(b).some((A,L)=>i[L]!==A),y=Ep(f,m),C=HA(f,m),S=v||!y?{x:0,y:0}:{x:C?n.width-g.width:0,y:C?n.height-g.height:0},w={x:g.left,y:g.top};return S.x&&S.y?w:ys(w,S)}}}};function Ep(e,t){return!Da(e)||!Da(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function HA(e,t){return!Da(e)||!Da(t)||!Ep(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const dn={row:"_row_1m6cn_1",removeBtn:"_removeBtn_1m6cn_14",grip:"_grip_1m6cn_17",ctIcon:"_ctIcon_1m6cn_34",info:"_info_1m6cn_38",name:"_name_1m6cn_46",meta:"_meta_1m6cn_55"},QA={video:Bo,pdf:Ts,h5p:No,scorm:Fo,audio:xo,quiz:Oo,course:Pr,default:xr},WA=({item:e,onRemove:t,isEditable:r})=>{const n=ae(),s=js(e),o=QA[s.key]??xr,{attributes:a,listeners:i,setNodeRef:c,transform:d,transition:u,isDragging:f}=jA({id:e.id,disabled:!r}),m={transform:Or.Transform.toString(d),transition:u,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:m,className:dn.row,role:"listitem",children:[r&&l.jsx("span",{className:dn.grip,...a,...i,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(yd,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${s.key}`,dn.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(o,{size:14})}),l.jsxs("div",{className:dn.info,children:[l.jsx("span",{className:dn.name,title:e.name,children:e.name}),l.jsx("span",{className:dn.meta,children:s.label})]}),l.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&l.jsx("button",{type:"button",className:dn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(fr,{size:14})})]})},he={container:"_container_1ls1w_1",header:"_header_1ls1w_7",heading:"_heading_1ls1w_13",count:"_count_1ls1w_21",list:"_list_1ls1w_30",emptyState:"_emptyState_1ls1w_36",skillPicker:"_skillPicker_1ls1w_52",skillsCovered:"_skillsCovered_1ls1w_52",chips:"_chips_1ls1w_64",chip:"_chip_1ls1w_64",skillWarning:"_skillWarning_1ls1w_80",selectedSkills:"_selectedSkills_1ls1w_85",skillPill:"_skillPill_1ls1w_91",skillPillFlagged:"_skillPillFlagged_1ls1w_103",skillPillRemove:"_skillPillRemove_1ls1w_107",skillSearchBox:"_skillSearchBox_1ls1w_122",skillSearchWrap:"_skillSearchWrap_1ls1w_127",searchIcon:"_searchIcon_1ls1w_142",skillSearchInput:"_skillSearchInput_1ls1w_147",skillDropdown:"_skillDropdown_1ls1w_160",skillOption:"_skillOption_1ls1w_174",skillCheckbox:"_skillCheckbox_1ls1w_196",skillCheckboxChecked:"_skillCheckboxChecked_1ls1w_208",skillDropdownEmpty:"_skillDropdownEmpty_1ls1w_213",skillPickerNote:"_skillPickerNote_1ls1w_219",emptyHint:"_emptyHint_1ls1w_224",assessmentsCard:"_assessmentsCard_1ls1w_237",assessmentSlots:"_assessmentSlots_1ls1w_249",assessmentItemRow:"_assessmentItemRow_1ls1w_255",assessmentItemIcon:"_assessmentItemIcon_1ls1w_266",assessmentItemInfo:"_assessmentItemInfo_1ls1w_278",assessmentItemTitle:"_assessmentItemTitle_1ls1w_285",assessmentItemMeta:"_assessmentItemMeta_1ls1w_294",addRowIcon:"_addRowIcon_1ls1w_299",assessmentItemBadge:"_assessmentItemBadge_1ls1w_311",menuWrap:"_menuWrap_1ls1w_322",menuBtn:"_menuBtn_1ls1w_327",dropmenu:"_dropmenu_1ls1w_340",dangerItem:"_dangerItem_1ls1w_370",addRow:"_addRow_1ls1w_299",addRowAssessment:"_addRowAssessment_1ls1w_394"},RA=({options:e,selected:t,outOfScope:r,onChange:n,isEditable:s,description:o})=>{const a=ae(),[i,c]=p.useState(""),[d,u]=p.useState(!1),f=p.useRef(null);p.useEffect(()=>{if(!d)return;const h=v=>{var y;(y=f.current)!=null&&y.contains(v.target)||u(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[d]);const m=i?e.filter(h=>h.toLowerCase().includes(i.toLowerCase())):e,g=h=>{s&&n(t.includes(h)?t.filter(v=>v!==h):[...t,h])},b=h=>{s&&n(t.filter(v=>v!==h))};return l.jsxs("div",{className:he.skillPicker,children:[l.jsxs("div",{className:he.header,children:[l.jsx("span",{className:he.heading,children:a.learningPath.skillsHeading}),l.jsx("span",{className:he.count,children:t.length})]}),l.jsx("span",{className:he.skillPickerNote,children:o}),r.length>0&&l.jsx("div",{className:he.skillWarning,role:"alert",children:a.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),t.length>0&&l.jsx("div",{className:he.selectedSkills,children:t.map(h=>{const v=r.includes(h);return l.jsxs("span",{className:[he.skillPill,v?he.skillPillFlagged:""].join(" "),children:[h,s&&l.jsx("button",{type:"button",className:he.skillPillRemove,onClick:()=>b(h),"aria-label":a.learningPath.removeSkillAriaLabel.replace("{skill}",h),children:l.jsx(fr,{size:11})})]},h)})}),s?l.jsxs("div",{className:he.skillSearchBox,ref:f,children:[l.jsxs("div",{className:he.skillSearchWrap,onClick:()=>u(!0),children:[l.jsx("input",{type:"search",className:he.skillSearchInput,placeholder:a.learningPath.searchSkillsPlaceholder,value:i,onChange:h=>c(h.target.value),onFocus:()=>u(!0),"aria-label":a.learningPath.searchSkillsPlaceholder}),l.jsx(Mo,{size:14,className:he.searchIcon})]}),d&&l.jsx("div",{className:he.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:he.skillDropdownEmpty,children:a.learningPath.noSkillsAvailable}):m.length===0?l.jsx("div",{className:he.skillDropdownEmpty,children:a.learningPath.noMatchingSkills}):m.map(h=>{const v=t.includes(h);return l.jsxs("button",{type:"button",role:"option","aria-selected":v,className:he.skillOption,onClick:()=>g(h),children:[l.jsx("span",{className:[he.skillCheckbox,v?he.skillCheckboxChecked:""].join(" "),children:v&&l.jsx(Zr,{size:12})}),h]},h)})})]}):t.length===0&&l.jsx("span",{className:he.emptyHint,children:a.learningPath.noSkillsSelectedYet})]})},Ul=({slot:e,isEditable:t})=>{const r=ae(),{pre:n,post:s,setActiveAssessmentSlot:o,deleteSlot:a}=wl(),i=le(h=>h.selectNode),[c,d]=p.useState(!1),u=p.useRef(null),f=e==="pre"?n:s,m=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(p.useEffect(()=>{if(!c)return;const h=v=>{var y;(y=u.current)!=null&&y.contains(v.target)||d(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!f.filled)return l.jsxs("button",{type:"button",className:[he.addRow,he.addRowAssessment].join(" "),disabled:!t,onClick:()=>o(e),children:[l.jsx("span",{className:he.addRowIcon,children:l.jsx(Jr,{size:16})}),r.learningPath.addAssessmentSlotButton.replace("{label}",m)]});const g=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,b=()=>f.level&&i(f.level.id);return l.jsxs("div",{className:he.assessmentItemRow,role:"button",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[l.jsx("span",{className:he.assessmentItemIcon,children:l.jsx(Pr,{size:16})}),l.jsxs("div",{className:he.assessmentItemInfo,children:[l.jsx("span",{className:he.assessmentItemTitle,children:f.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:he.assessmentItemMeta,children:[m," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:he.assessmentItemBadge,children:g}),t&&l.jsxs("div",{className:he.menuWrap,ref:u,children:[l.jsx("button",{type:"button",className:he.menuBtn,onClick:h=>{h.stopPropagation(),d(v=>!v)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),c&&l.jsxs("div",{className:he.dropmenu,onClick:h=>h.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{d(!1),f.level&&i(f.level.id)},children:[l.jsx(Sy,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:he.dangerItem,onClick:()=>{d(!1),a(e)},children:[l.jsx($o,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})},GA=({editorMode:e,isRoot:t=!1})=>{const r=ae(),{selectedNodeId:n,getChildrenOf:s,getNodeById:o,reorderChildren:a,deleteNode:i,activeNodeMeta:c,updateNode:d,treeData:u}=le(),f=Y(P=>P.editorProfile),m=n?s(n):[],g=e==="edit",b=n?o(n):void 0,h=f.competencyScoped,v=h&&!t&&!lt(b),y=h&&t,{scope:C,source:S}=zu(),w=Pn(),T=w&&Array.isArray(c[w.code])?c[w.code]:[],A=S==="prior"?T.filter(P=>!C.includes(P)):[],L=y?vS(u[0],w==null?void 0:w.code):[],E=p.useCallback(P=>{!n||!(w!=null&&w.code)||d(n,{[w.code]:P},[w.code])},[n,w==null?void 0:w.code,d]),x=Oc(Ja(Ao,{activationConstraint:{distance:5}}),Ja(si,{coordinateGetter:VA})),$=p.useCallback(P=>{const{active:q,over:F}=P;if(!F||q.id===F.id||!n)return;const z=le.getState().getChildrenOf(n),ne=z.findIndex(te=>te.id===q.id),Q=z.findIndex(te=>te.id===F.id);ne<0||Q<0||a(n,ne,Q)},[n,a]),N=p.useCallback(P=>{window.confirm(r.unitContentList.removeConfirm)&&i(P)},[i,r.unitContentList.removeConfirm]);return n?l.jsxs("div",{className:he.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:he.skillsCovered,children:[l.jsx("span",{className:he.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:he.emptyHint,children:r.learningPath.skillsCoveredDescription}),L.length>0&&l.jsx("div",{className:he.chips,children:L.map(P=>l.jsx("span",{className:he.chip,children:P},P))}),L.length===0&&l.jsx("span",{className:he.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:he.assessmentsCard,children:[l.jsx("span",{className:he.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:he.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:he.assessmentSlots,children:[l.jsx(Ul,{slot:"pre",isEditable:g}),l.jsx(Ul,{slot:"post",isEditable:g})]})]})]}),v&&l.jsx(RA,{options:C,selected:T,outOfScope:A,onChange:E,isEditable:g,description:S==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:he.header,children:[l.jsx("span",{className:he.heading,children:r.unitContentList.heading}),l.jsx("span",{className:he.count,children:m.length})]}),m.length>0?l.jsx(id,{sensors:x,collisionDetection:Jm,onDragEnd:$,children:l.jsx(PA,{items:m.map(P=>P.id),strategy:OA,children:l.jsx("div",{className:he.list,role:"list",children:m.map(P=>l.jsx(WA,{item:P,onRemove:N,isEditable:g},P.id))})})}):l.jsxs("div",{className:he.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),g&&!lt(b)&&l.jsxs("button",{className:he.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Jr,{size:14})," ",r.unitContentList.addContent]})]})]}):null},Ap={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},KA=({isActive:e,label:t,nodeId:r,className:n})=>{const s=ae(),o=t??s.dropZone.dropHere;return l.jsx("div",{className:`${Ap.dropZone} ${e?Ap.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":o,role:"region",children:l.jsx("span",{children:o})})},Ip=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function YA(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??Ip}},{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 ZA(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 kp="application/vnd.sunbird.question";function Dp(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Lp(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=Lp(n,t,e);if(s)return s}return null}function XA(e,t){const r=Lp(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 JA(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return _n({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await _u(e),s=u=>{if(!u)return[];const f=u.mimeType===kp&&u.identifier?[u.identifier]:[],m=(u.children??[]).flatMap(s);return[...f,...m]},o=s(n),a=new Map;o.length&&(await nS(o)).forEach(f=>{const m=f.identifier;m&&a.set(m,f)});const i=u=>{if(!u)return u;if(u.mimeType===kp&&u.identifier){const f=a.get(u.identifier)??u,m=f.outcomeDeclaration;return m!=null&&m.maxScore||(f.outcomeDeclaration={...m??{},maxScore:Dp(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:Dp(c)}),c}})}const Op="/assets/quml-player/sunbird-quml-player.js",eI="/assets/quml-player/styles.css",Np="sunbird-quml-player";function tI(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const gt=class gt{constructor(){io(this,"eventHandlers",new WeakMap)}loadScript(){return gt.scriptLoaded||customElements.get(Np)?(gt.scriptLoaded=!0,Promise.resolve()):(gt.scriptLoading||(gt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Op,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{gt.scriptLoaded=!0,gt.scriptLoading=void 0,t()},n.onerror=()=>{gt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Op}`))},document.body.appendChild(n)})),gt.scriptLoading)}loadStyles(){if(gt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){gt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=eI,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),gt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),gt.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:tI(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Np);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))}};io(gt,"scriptLoaded",!1),io(gt,"scriptLoading"),io(gt,"stylesLoaded",!1);let La=gt;const Oa=new La,Qe={contentPlayerRoot:"_contentPlayerRoot_1rdfn_1",flowLayout:"_flowLayout_1rdfn_9",stage:"_stage_1rdfn_13",aspectRatio:"_aspectRatio_1rdfn_16",playerHeader:"_playerHeader_1rdfn_32",playerHeaderThumb:"_playerHeaderThumb_1rdfn_46",playerHeaderTitle:"_playerHeaderTitle_1rdfn_56",typeBadge:"_typeBadge_1rdfn_66",typeDot:"_typeDot_1rdfn_105",playerFrame:"_playerFrame_1rdfn_125",coverOverlay:"_coverOverlay_1rdfn_133",coverHidden:"_coverHidden_1rdfn_145",coverThumb:"_coverThumb_1rdfn_150",coverPlayRing:"_coverPlayRing_1rdfn_159",coverPlayIcon:"_coverPlayIcon_1rdfn_172",coverLabel:"_coverLabel_1rdfn_181",coverSkeleton:"_coverSkeleton_1rdfn_187",playerWrapper:"_playerWrapper_1rdfn_213",infoStrip:"_infoStrip_1rdfn_223",infoChip:"_infoChip_1rdfn_239",infoChipLabel:"_infoChipLabel_1rdfn_258",infoChipIcon:"_infoChipIcon_1rdfn_267",playerError:"_playerError_1rdfn_273",playerErrorIcon:"_playerErrorIcon_1rdfn_287",playerErrorMsg:"_playerErrorMsg_1rdfn_292",qumlRoot:"_qumlRoot_1rdfn_299"},rI="application/vnd.sunbird.questionset";function nI(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===rI)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const sI=[{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 oI(e){return sI.find(t=>t.mimes.includes(e))??{key:"other"}}function aI(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 iI={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},lI={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},cI={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},dI="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function zl(e){for(const[t,r]of Object.entries(iI))if(r.includes(e))return t;return"default-player"}function uI(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 fI(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 hI(e,t,r=100){await fI(lI[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 pI=[{key:"author",icon:jy},{key:"license",icon:Ny},{key:"language",icon:_y},{key:"gradeLevel",icon:Py},{key:"subject",icon:Pr},{key:"contentType",icon:By}];function gI(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 mI({node:e}){const t=ae(),r=e.metadata??{},n=pI.flatMap(s=>{const o=r[s.key];if(!o)return[];const a=Array.isArray(o)?o.join(", "):String(o);return a?[{...s,label:gI(s.key,t),val:a}]:[]});return n.length?l.jsx("div",{className:Qe.infoStrip,children:n.map(s=>l.jsxs("div",{className:Qe.infoChip,children:[s.icon&&l.jsx(s.icon,{size:13,className:Qe.infoChipIcon}),l.jsx("span",{className:Qe.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function Pp({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:`${Qe.coverOverlay} ${t?Qe.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:Qe.coverThumb}),l.jsx("div",{className:Qe.coverPlayRing,children:l.jsx("div",{className:Qe.coverPlayIcon})}),l.jsx("span",{className:Qe.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:Qe.coverSkeleton})})}function xp({message:e}){return l.jsxs("div",{className:Qe.playerError,children:[l.jsx(qy,{size:28,className:Qe.playerErrorIcon}),l.jsx("span",{className:Qe.playerErrorMsg,children:e})]})}function vI({mimeType:e}){const t=ae(),r=oI(e);return l.jsxs("span",{className:Qe.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:Qe.typeDot}),aI(r.key,t)]})}const Vl=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var a;if(r==="quml")return l.jsx(bI,{node:e,editorMode:t,singleQuestion:!!n});const o=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return l.jsxs("div",{className:`${Qe.contentPlayerRoot} ${s==="flow"?Qe.flowLayout:""}`,children:[l.jsxs("div",{className:Qe.stage,children:[l.jsxs("div",{className:Qe.playerHeader,children:[o&&l.jsx("img",{src:o,alt:"",className:Qe.playerHeaderThumb}),l.jsx("span",{className:Qe.playerHeaderTitle,children:e.name}),l.jsx(vI,{mimeType:e.mimeType??""})]}),l.jsx(yI,{node:e})]}),l.jsx(mI,{node:e})]})};function yI({node:e}){var y;const t=ae(),r=Y(C=>C.editorConfig),[n,s]=p.useState(()=>zl(e.mimeType??"")),[o,a]=p.useState(!1),[i,c]=p.useState(null),[d,u]=p.useState(e.metadata??{}),[f,m]=p.useState(!1),g=p.useRef(null),b=p.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??dI;p.useEffect(()=>{let C=!1;return m(!1),a(!1),c(null),u(e.metadata??{}),s(zl(e.mimeType??"")),ZA(e.identifier).then(S=>{if(C)return;const w={...e.metadata??{},...S};u(w);const T=S.mimeType??e.mimeType??"";s(zl(T)),m(!0)}).catch(()=>{C||m(!0)}),()=>{C=!0}},[e.identifier]);const v=uI(e,d,r);return p.useEffect(()=>{if(!f||n!=="default-player")return;const C=g.current;if(!C)return;C.src=h;const S=()=>{try{const T=C.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 C.addEventListener("load",S),C.addEventListener("error",w),()=>{C.removeEventListener("load",S),C.removeEventListener("error",w),C.src=""}},[e.identifier,n,h,f,t]),p.useEffect(()=>{if(!f||n==="default-player")return;const C=b.current;if(!C)return;const S=cI[n];if(!S)return;const w=v;hI(S,n).then(()=>{if(!b.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",()=>{}),C.innerHTML="",C.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:Qe.aspectRatio,children:[i?l.jsx(xp,{message:i}):l.jsx(Pp,{node:e,hidden:o}),n==="default-player"?l.jsx("iframe",{ref:g,id:"contentPlayer",title:e.name,className:Qe.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:b,className:Qe.playerFrame})]})}function bI({node:e,editorMode:t,singleQuestion:r}){const n=ae(),s=Y(g=>g.editorConfig),o=le(g=>g.treeData),a=p.useRef(null),i=r?nI(o,e.id):e.identifier,{data:c,isLoading:d,error:u}=JA(i??"",{enabled:!!i}),f=p.useMemo(()=>c?r?XA(c,e.identifier):c:null,[c,r,e.identifier]);p.useEffect(()=>{const g=a.current;if(!g||!f)return;let b=null,h=!1;return(async()=>{try{const v=await Oa.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(h||!a.current)return;const y=Oa.createElement(v);b=y,Oa.attachEventListeners(y,C=>console.debug("[QumlPlayer] playerEvent",C.detail),C=>console.debug("[QumlPlayer] telemetryEvent",C)),g.innerHTML="",g.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,b&&(Oa.removeEventListeners(b),b.remove()),La.unloadStyles()}},[f,s,t,r]);const m=u?`${n.contentPlayer.unableToLoadQuestionset} ${u.message}`:r&&!i?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:Qe.qumlRoot,children:[m?l.jsx(xp,{message:m}):d||!f?l.jsx(Pp,{node:e,hidden:!1}):null,l.jsx("div",{ref:a,className:Qe.playerWrapper})]})}const Jt={overlay:"_overlay_1b1xq_1",modal:"_modal_1b1xq_11",header:"_header_1b1xq_21",body:"_body_1b1xq_37",hint:"_hint_1b1xq_43",list:"_list_1b1xq_49",item:"_item_1b1xq_55",selected:"_selected_1b1xq_68",empty:"_empty_1b1xq_73",footer:"_footer_1b1xq_79",cancelBtn:"_cancelBtn_1b1xq_87",moveBtn:"_moveBtn_1b1xq_95"};function CI(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 SI=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=ae(),{treeData:o,moveNode:a}=le(),i=CI(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:Jt.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Jt.modal,children:[l.jsxs("div",{className:Jt.header,children:[l.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:l.jsx(fr,{size:16})})]}),l.jsxs("div",{className:Jt.body,children:[l.jsx("p",{className:Jt.hint,children:s.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Jt.list,children:[i.map(m=>l.jsxs("li",{className:`${Jt.item} ${c===m.id?Jt.selected:""}`,onClick:()=>d(m.id),children:[l.jsx(wy,{size:14}),l.jsx("span",{children:m.name})]},m.id)),i.length===0&&l.jsx("li",{className:Jt.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Jt.footer,children:[l.jsx("button",{className:Jt.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Jt.moveBtn,onClick:u,disabled:!c,children:s.resourceReorderDialog.moveButton})]})]})})},pr={overlay:"_overlay_1d56g_1",modal:"_modal_1d56g_11",header:"_header_1d56g_21",body:"_body_1d56g_37",table:"_table_1d56g_43",pageInput:"_pageInput_1d56g_61",empty:"_empty_1d56g_68",footer:"_footer_1d56g_74",cancelBtn:"_cancelBtn_1d56g_82",saveBtn:"_saveBtn_1d56g_90"};function wI(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 _I=({onClose:e})=>{const t=ae(),{treeData:r,updateNode:n}=le(),s=wI(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:pr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:pr.modal,children:[l.jsxs("div",{className:pr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(fr,{size:16})})]}),l.jsx("div",{className:pr.body,children:s.length===0?l.jsx("p",{className:pr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:pr.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:pr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:pr.footer,children:[l.jsx("button",{className:pr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:pr.saveBtn,onClick:i,children:[l.jsx(Oy,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},Xe={container:"_container_p2feh_1",panelHeader:"_panelHeader_p2feh_10",panelHeaderLeft:"_panelHeaderLeft_p2feh_19",panelCollapseBtn:"_panelCollapseBtn_p2feh_27",titleRow:"_titleRow_p2feh_46",field:"_field_p2feh_47",moveBtn:"_moveBtn_p2feh_64",icon:"_icon_p2feh_84",nameInput:"_nameInput_p2feh_93",fieldHeader:"_fieldHeader_p2feh_118",label:"_label_p2feh_124",fieldCount:"_fieldCount_p2feh_133",chips:"_chips_p2feh_170",chip:"_chip_p2feh_170",chipRemove:"_chipRemove_p2feh_188",keywordInput:"_keywordInput_p2feh_202",input:"_input_p2feh_207",addBtn:"_addBtn_p2feh_220",radioGroup:"_radioGroup_p2feh_234",radioLabel:"_radioLabel_p2feh_239"},TI=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var P,q;const{updateNode:s,markDirty:o}=le(),a=t==="edit",i=js(e),c=ae(),d=Y(F=>F.relationalFormConfig),u=F=>d==null?void 0:d.find(z=>z.code===F),f=F=>!d||!!u(F),m=(F,z)=>{var ne;return((ne=u(F))==null?void 0:ne.label)||z},[g,b]=p.useState(!0),h=((P=e.metadata)==null?void 0:P.relationalMetadata)??{},[v,y]=p.useState(h.name??e.name??""),[C,S]=p.useState(""),[w,T]=p.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((q=e.metadata)==null?void 0:q.keywords)?e.metadata.keywords:[]),[A,L]=p.useState(!!h.optional);p.useEffect(()=>{var z,ne;const F=((z=e.metadata)==null?void 0:z.relationalMetadata)??{};y(F.name??e.name??""),T(Array.isArray(F.keywords)?F.keywords:Array.isArray((ne=e.metadata)==null?void 0:ne.keywords)?e.metadata.keywords:[]),L(!!F.optional)},[e.id]);const E=()=>{v.trim()&&v!==e.name&&(s(e.id,{name:v.trim()}),o())},x=()=>{const F=C.trim();if(F&&!w.includes(F)){const z=[...w,F];T(z),s(e.id,{keywords:z}),o()}S("")},$=F=>{const z=w.filter(ne=>ne!==F);T(z),s(e.id,{keywords:z}),o()},N=F=>{L(F),s(e.id,{optional:F}),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:()=>b(F=>!F),"aria-expanded":g,"aria-label":g?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:g?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:g?l.jsx(Xr,{size:15}):l.jsx(vy,{size:15})})]}),g&&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:F=>y(F.target.value),onBlur:E,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:[m("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(F=>l.jsxs("span",{className:Xe.chip,children:[F,a&&l.jsx("button",{type:"button",className:Xe.chipRemove,onClick:()=>$(F),children:"×"})]},F))}),a&&l.jsxs("div",{className:Xe.keywordInput,children:[l.jsx("input",{type:"text",className:Xe.input,value:C,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:F=>S(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),x())}}),l.jsx("button",{type:"button",className:Xe.addBtn,onClick:x,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Xe.field,children:[l.jsx("label",{className:Xe.label,children:m("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:A===!0,onChange:()=>N(!0),disabled:!a}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Xe.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:A===!1,onChange:()=>N(!1),disabled:!a}),c.contentEditForm.noOption]})]})]})]}),n]})},Ys={iconBtn:"_iconBtn_gliz0_1",editable:"_editable_gliz0_14",iconImg:"_iconImg_gliz0_26",placeholder:"_placeholder_gliz0_34",removeBtn:"_removeBtn_gliz0_41"},EI=({nodeId:e,value:t,editable:r})=>{const[n,s]=p.useState(!1),{updateNode:o,markDirty:a}=le(),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:[Ys.iconBtn,r?Ys.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:Ys.iconImg}):l.jsx("div",{className:Ys.placeholder,children:l.jsx(bd,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:Ys.removeBtn,onClick:d,"aria-label":i.titleAppIcon.removeIconAriaLabel,children:l.jsx($o,{size:11})})]}),n&&l.jsx(yp,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>s(!1)})]})},Fe={courseDetails:"_courseDetails_1eby7_1",courseDetailsLoading:"_courseDetailsLoading_1eby7_7",courseDetailsError:"_courseDetailsError_1eby7_7",detailsCard:"_detailsCard_1eby7_12",unitsCard:"_unitsCard_1eby7_12",cardTitle:"_cardTitle_1eby7_22",fieldGroup:"_fieldGroup_1eby7_29",fieldGroupLast:"_fieldGroupLast_1eby7_33",fieldLabel:"_fieldLabel_1eby7_37",fieldValue:"_fieldValue_1eby7_47",fieldValueMultiline:"_fieldValueMultiline_1eby7_52",unitsLabel:"_unitsLabel_1eby7_58",unitsDescription:"_unitsDescription_1eby7_68",unitList:"_unitList_1eby7_74",unitCard:"_unitCard_1eby7_80",unitHeader:"_unitHeader_1eby7_86",unitIcon:"_unitIcon_1eby7_99",unitTitle:"_unitTitle_1eby7_111",unitCount:"_unitCount_1eby7_120",unitBody:"_unitBody_1eby7_126",unitDescription:"_unitDescription_1eby7_131",unitKeywords:"_unitKeywords_1eby7_138",keywordPill:"_keywordPill_1eby7_145",unitTopicsRow:"_unitTopicsRow_1eby7_155",unitContents:"_unitContents_1eby7_167",contentRow:"_contentRow_1eby7_174",contentIcon:"_contentIcon_1eby7_180",contentTitle:"_contentTitle_1eby7_185",contentSkills:"_contentSkills_1eby7_193",skillPill:"_skillPill_1eby7_200"},AI={video:Bo,pdf:Ts,h5p:No,scorm:Fo,audio:xo,quiz:Oo,course:Pr,default:xr};function Hl(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const Fp=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const s=ae(),o=Pn(),[a,i]=p.useState(null),[c,d]=p.useState(""),[u,f]=p.useState(null),[m,g]=p.useState({}),b=t==="full";p.useEffect(()=>{let C=!1;return i(null),d(""),f(null),Eu(e).then(S=>{if(C)return;const T=(S.children??[]).map(A=>Zo(A));i(T),d(S.description??""),g(Object.fromEntries(T.map(A=>[A.id,!0]))),n==null||n({totalContents:T.reduce((A,L)=>{var E;return A+(((E=L.children)==null?void 0:E.length)??0)},0)})}).catch(()=>{C||f(s.learningPath.courseDetailsError)}),()=>{C=!0}},[e,s.learningPath.courseDetailsError]);const h=C=>g(S=>({...S,[C]:!S[C]})),v=C=>{var S;return o?Hl((S=C.metadata)==null?void 0:S[o.code]):[]},y=C=>(C===1?s.learningPath.contentCountLabel:s.learningPath.contentCountLabelPlural).replace("{count}",String(C));return l.jsx("div",{className:Fe.courseDetails,children:u?l.jsx("p",{className:Fe.courseDetailsError,children:u}):a===null?l.jsx("p",{className:Fe.courseDetailsLoading,children:s.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[b&&l.jsxs("div",{className:Fe.detailsCard,children:[l.jsx("h3",{className:Fe.cardTitle,children:s.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:Fe.fieldGroup,children:[l.jsx("span",{className:Fe.fieldLabel,children:s.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:Fe.fieldValue,children:r})]}),l.jsxs("div",{className:Fe.fieldGroupLast,children:[l.jsx("span",{className:Fe.fieldLabel,children:s.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:Fe.fieldValueMultiline,children:c||s.learningPath.noCourseDescriptionPlaceholder})]})]}),a.length===0?l.jsx("p",{className:Fe.courseDetailsLoading,children:s.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:b?Fe.unitsCard:void 0,children:[l.jsx("span",{className:Fe.unitsLabel,children:s.learningPath.unitsSectionLabel}),b&&l.jsx("p",{className:Fe.unitsDescription,children:s.learningPath.unitsSectionDescription}),l.jsx("div",{className:Fe.unitList,children:a.map(C=>{var L,E;const S=!!m[C.id],w=(C.children??[]).length,T=Hl((L=C.metadata)==null?void 0:L.keywords),A=Hl((E=C.metadata)==null?void 0:E.topic);return l.jsxs("div",{className:Fe.unitCard,children:[l.jsxs("button",{type:"button",className:Fe.unitHeader,onClick:()=>h(C.id),"aria-expanded":S,children:[S?l.jsx(Xr,{size:17}):l.jsx(ui,{size:17}),l.jsx("span",{className:Fe.unitIcon,children:l.jsx(vd,{size:16})}),l.jsx("span",{className:Fe.unitTitle,children:C.name}),b&&l.jsx("span",{className:Fe.unitCount,children:y(w)})]}),S&&l.jsxs("div",{className:Fe.unitBody,children:[b&&C.description&&l.jsx("p",{className:Fe.unitDescription,children:C.description}),b&&T.length>0&&l.jsx("div",{className:Fe.unitKeywords,children:T.map(x=>l.jsx("span",{className:Fe.keywordPill,children:x},x))}),b&&A.length>0&&l.jsxs("div",{className:Fe.unitTopicsRow,children:[l.jsx("span",{className:Fe.fieldLabel,children:s.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:A.join(", ")})]}),l.jsx("div",{className:Fe.unitContents,children:(C.children??[]).map(x=>{const $=js(x),N=AI[$.key]??xr,P=v(x);return l.jsxs("div",{className:Fe.contentRow,children:[l.jsx(N,{size:16,className:Fe.contentIcon}),l.jsx("span",{className:Fe.contentTitle,children:x.name}),P.length>0&&l.jsx("div",{className:Fe.contentSkills,children:P.map(q=>l.jsx("span",{className:Fe.skillPill,children:q},q))})]},x.id)})})]})]},C.id)})})]})]})})},De={backToPathButton:"_backToPathButton_42cuj_1",assessmentTitle:"_assessmentTitle_42cuj_15",slotPills:"_slotPills_42cuj_22",slotPill:"_slotPill_42cuj_22",slotPillHint:"_slotPillHint_42cuj_40",slotPillPurpose:"_slotPillPurpose_42cuj_45",slotPillWarning:"_slotPillWarning_42cuj_51",slotPillPrimary:"_slotPillPrimary_42cuj_56",courseCard:"_courseCard_42cuj_62",courseCardHeading:"_courseCardHeading_42cuj_72",courseCardDescription:"_courseCardDescription_42cuj_79",courseNotAdded:"_courseNotAdded_42cuj_85",assessmentExplainer:"_assessmentExplainer_42cuj_93",assessmentExplainerHeading:"_assessmentExplainerHeading_42cuj_107",leafContentLayout:"_leafContentLayout_42cuj_117",container:"_container_42cuj_131",emptyState:"_emptyState_42cuj_140",titleRow:"_titleRow_42cuj_150",titleRowLp:"_titleRowLp_42cuj_157",nodeTitle:"_nodeTitle_42cuj_171",nodeTitleLpRoot:"_nodeTitleLpRoot_42cuj_193",nodeTitleSub:"_nodeTitleSub_42cuj_198",courseDetailHeader:"_courseDetailHeader_42cuj_203",courseDetailIcon:"_courseDetailIcon_42cuj_210",courseDetailTitle:"_courseDetailTitle_42cuj_222",courseDetailMeta:"_courseDetailMeta_42cuj_229",formArea:"_formArea_42cuj_234",contentListArea:"_contentListArea_42cuj_238",contentListAreaLp:"_contentListAreaLp_42cuj_242",dropZone:"_dropZone_42cuj_246",reviewComment:"_reviewComment_42cuj_253",reviewCommentLabel:"_reviewCommentLabel_42cuj_266",reviewCommentText:"_reviewCommentText_42cuj_272"},II=({slot:e,isEditable:t})=>{var g;const r=ae(),n=le(b=>b.treeData),s=le(b=>b.selectNode),o=(g=n[0])==null?void 0:g.id,{pre:a,post:i}=wl(),c=(e==="pre"?a:i).filled,d=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,u=e==="pre"?Es:gy,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,m=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:De.container,children:[l.jsxs("button",{type:"button",className:De.backToPathButton,onClick:()=>o&&s(o),children:[l.jsx(di,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:De.assessmentTitle,children:d}),l.jsx("div",{className:De.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${De.slotPill} ${De.slotPillHint}`,children:[l.jsx(gd,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${De.slotPill} ${De.slotPillPurpose}`,children:[l.jsx(hy,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${De.slotPill} ${De.slotPillWarning}`,children:[l.jsx(Cd,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${De.slotPill} ${De.slotPillPrimary}`,children:[l.jsx(gd,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:De.formArea,children:[l.jsxs("div",{className:De.courseCard,children:[l.jsx("div",{className:De.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:De.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(Ul,{slot:e,isEditable:t}):l.jsx("div",{className:De.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:De.assessmentExplainer,children:[l.jsxs("div",{className:De.assessmentExplainerHeading,children:[l.jsx(u,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:m})]})]})]})},kI="application/vnd.sunbird.questionset",Mp="application/vnd.sunbird.question",DI=[kI,Mp];function $p(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 LI=({editorMode:e,onToolbarEvent:t})=>{var ie,me,ve,Ee,ye;const r=ae(),[n,s]=p.useState("details"),[o,a]=p.useState([]),[i,c]=p.useState(null),[d,u]=p.useState(!1),[f,m]=p.useState(null),g=p.useRef(null),b=p.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:C,treeData:S,selectNode:w}=le(),T=Fr(M=>M.activeAssessmentSlot),A=Y(M=>{var B,Z,ce,Ce;return((Z=(B=M.editorConfig)==null?void 0:B.context)==null?void 0:Z.contentId)??((Ce=(ce=M.editorConfig)==null?void 0:ce.context)==null?void 0:Ce.identifier)??""}),L=Y(M=>M.editorProfile.competencyScoped),E=h?Bp(S,h):null;p.useEffect(()=>{m(null)},[E==null?void 0:E.identifier]);const x=!!E&&!E.parent,$=!!(E!=null&&E.isFolder),N=E&&DI.includes(E.mimeType??""),P=(E==null?void 0:E.mimeType)===Mp,q=E&&!E.isFolder&&!N&&!x,z=L&&$&&lt(E??void 0)?((ve=(me=(ie=S[0])==null?void 0:ie.children)==null?void 0:me[0])==null?void 0:ve.id)===(E==null?void 0:E.id)?"pre":"post":L?T:null,ne=$p(E)??(x?$p(S[0]):void 0),Q=p.useCallback(()=>{const M=g.current;if(!M||!h)return;const B=M.innerText.trim();clearTimeout(b.current),b.current=setTimeout(()=>{C(h,{name:B})},600)},[h,C]),te=p.useCallback(M=>{t({action:"onFormValueChange",data:M})},[t]),pe=p.useCallback((M,B)=>{a(B),t({action:"onFormStatusChange",data:{isValid:M,nodeId:h}})},[t,h]);if(!E)return l.jsx("div",{className:De.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(N)return l.jsx(Vl,{node:E,editorMode:e,type:"quml",singleQuestion:P});if(L&&q&&E.primaryCategory==="Course"){const M=E.parent?pS(((Ee=S[0])==null?void 0:Ee.children)??[],E.parent):null,B=(M==null?void 0:M.role)==="pre"?r.learningPath.priorAssessmentLabel:(M==null?void 0:M.role)==="post"?r.learningPath.outcomeAssessmentLabel:(M==null?void 0:M.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String(M.levelNumber)):null,Z=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:De.container,children:[l.jsxs("button",{type:"button",className:De.backToPathButton,onClick:()=>E.parent&&w(E.parent),children:[l.jsx(di,{size:14}),B?r.learningPath.backToLevelButton.replace("{label}",B):r.learningPath.backToPathButton]}),l.jsxs("div",{className:De.courseDetailHeader,children:[l.jsx("span",{className:De.courseDetailIcon,children:l.jsx(Pr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:De.courseDetailTitle,children:E.name}),l.jsxs("span",{className:De.courseDetailMeta,children:[E.primaryCategory,Z]})]})]}),l.jsx(Fp,{courseId:E.identifier,variant:"full",title:E.name,onLoaded:({totalContents:ce})=>m(ce)},E.identifier)]})}return z?l.jsx(II,{slot:z,isEditable:e==="edit"}):q?l.jsxs("div",{className:De.leafContentLayout,children:[l.jsx(Vl,{node:E,editorMode:e,type:"content",layout:"flow"}),l.jsx(TI,{node:E,editorMode:e,onMoveClick:()=>c(E.identifier),reorderDialog:i?l.jsx(SI,{resourceId:i,resourceName:E.name,currentUnitId:E.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:De.container,children:[l.jsx(pE,{crumbs:v}),ne&&l.jsxs("div",{className:De.reviewComment,role:"alert",children:[l.jsx("span",{className:De.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:De.reviewCommentText,children:ne})]}),l.jsxs("div",{className:[De.titleRow,L?De.titleRowLp:""].filter(Boolean).join(" "),children:[x&&h&&l.jsx(EI,{nodeId:h,value:String(E.appIcon??((ye=E.metadata)==null?void 0:ye.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:g,className:[De.nodeTitle,L&&x?De.nodeTitleLpRoot:"",L&&!x?De.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:Q,onBlur:Q,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:E.name})]}),l.jsx(gE,{activeTab:n,onChange:M=>s(M),errorTabs:o,visibleTabs:x&&!L?void 0:["details"]}),l.jsx("div",{className:De.formArea,children:l.jsx(IA,{nodeMetadata:y,activeTab:n,isRoot:x,isFolder:$,editorMode:e,onFormValueChange:te,onFormStatusChange:pe},`${h??"none"}:${x?"root":"node"}`)}),($||x)&&n==="details"&&l.jsx("div",{className:[De.contentListArea,L?De.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(GA,{editorMode:e,isRoot:x})}),l.jsx(KA,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:De.dropZone}),d&&l.jsx(_I,{contentId:A,onClose:()=>u(!1)})]})};function Bp(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=Bp(r.children,t);if(n)return n}}}const qp=As((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 OI(e,t,r,n){const s={primaryCategory:["Course"]};return n&&(s.framework=[n]),!e&&t.length&&r&&(s[r]=t),s}function NI(e,t){if(!(!e||!t))return[...Ip,t,"framework"]}function PI(e,t,r,n,s){return e?t?r&&!n&&s.length===0?"noSkills":null:"noCurriculum":null}const xI=20,FI=[];function jp(){var d;const e=Y(u=>u.editorConfig),t=le(u=>u.selectedNodeId),r=le(u=>u.treeData),n=p.useCallback(()=>{if(!t||!r.length)return 0;function u(f,m,g=0){var b;for(const h of f){if(h.id===m)return g;if((b=h.children)!=null&&b.length){const v=u(h.children,m,g+1);if(v>=0)return v}}return-1}return Math.max(0,u(r,t))},[t,r])(),s=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!s)return[...Fh];const o=`level${n}`,a=s[o],i=a==null?void 0:a.children,c=i==null?void 0:i.Content;return c!=null&&c.length?c:[...Fh]}function MI(){const e=qp(),t=Y(E=>{var x,$;return(($=(x=E.editorConfig)==null?void 0:x.context)==null?void 0:$.channel)??""}),r=jp(),n=Y(E=>E.editorProfile),s=Fr(E=>E.activeAssessmentSlot),o=le(E=>E.activeNodeMeta),a=le(E=>E.treeData),i=le(E=>E.treeCache),c=le(E=>E.selectedNodeId),d=le(E=>E.getNodeById),u=Pn(),f=n.competencyScoped?Ou(a[0],i):void 0,m=p.useRef(),g=u&&Array.isArray(o[u.code])?o[u.code]:FI,b=c?d(c):void 0,h=n.competencyScoped&&!!(b!=null&&b.isFolder)&&!!b.parent&&!lt(b),v=PI(n.competencyScoped,f,h,s,g),y=p.useCallback(async(E="",x="all",$={},N=!0,P=!1)=>{var q,F,z,ne,Q;e.setLoading(!0);try{if(v){e.setContent([],0);return}let te;if(n.competencyScoped){const ve=OI(s,g,u==null?void 0:u.code,f);te={status:["Live"],...ve}}else te={status:["Live"],primaryCategory:x&&x!=="all"?[x]:r},(q=$==null?void 0:$.board)!=null&&q.length&&(te.board=$.board),(F=$==null?void 0:$.medium)!=null&&F.length&&(te.medium=$.medium),(z=$==null?void 0:$.gradeLevel)!=null&&z.length&&(te.gradeLevel=$.gradeLevel),(ne=$==null?void 0:$.subject)!=null&&ne.length&&(te.subject=$.subject),(Q=$==null?void 0:$.primaryCategory)!=null&&Q.length&&(te.primaryCategory=$.primaryCategory);const pe=N?0:e.offset,{content:ie,count:me}=await YA({filters:te,query:E,limit:E?50:xI,offset:pe,channel:t||void 0,sortBy:P?{name:"asc"}:{lastUpdatedOn:"desc"},fields:NI(n.competencyScoped,u==null?void 0:u.code)});N?e.setContent(ie,me):e.appendContent(ie,me)}catch(te){console.error("[useLibrary] load error:",te)}finally{e.setLoading(!1)}},[r,t,n,s,g,u,f,v]);p.useEffect(()=>{clearTimeout(m.current),e.setSearch("")},[f]),p.useEffect(()=>{y()},[t]),p.useEffect(()=>{n.competencyScoped&&y()},[n.competencyScoped,s,g.join("|"),f,c]);const C=p.useCallback(E=>{e.setSearch(E),clearTimeout(m.current),m.current=setTimeout(()=>y(E,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,y]),S=p.useCallback(E=>{e.setFilter(E),y(e.searchQuery,E,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,y]),w=p.useCallback(E=>{e.setAdvancedFilters(E),y(e.searchQuery,e.activeFilter,E,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,y]),T=p.useCallback(()=>{const E=!e.sortAZ;e.setSortAZ(E),y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,E)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,y]),A=p.useCallback(()=>{e.isLoading||y(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,y]),L=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:L,search:C,setFilter:S,applyAdvancedFilters:w,toggleSort:T,loadMore:A,refetch:()=>y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:s,emptyReason:v}}function Up(){var i;const e=ae(),t=Y(c=>c.editorProfile.competencyScoped),r=Fr(c=>c.activeAssessmentSlot),n=le(c=>c.selectedNodeId),s=le(c=>c.treeData),o=le(c=>c.getNodeById),a=(i=s[0])==null?void 0:i.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n&&n!==a){const c=o(n);if(c!=null&&c.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",c.name??"")}return e.learningPath.libraryOpenLevelToAdd}const er={card:"_card_1cmpg_1",addBtn:"_addBtn_1cmpg_17",dragging:"_dragging_1cmpg_24",ctIcon:"_ctIcon_1cmpg_29",info:"_info_1cmpg_33",name:"_name_1cmpg_41",meta:"_meta_1cmpg_50",skillTags:"_skillTags_1cmpg_58",skillTag:"_skillTag_1cmpg_58",addBtnMuted:"_addBtnMuted_1cmpg_93",added:"_added_1cmpg_102",addedBadge:"_addedBadge_1cmpg_111"},$I={video:Bo,pdf:Ts,h5p:No,scorm:Fo,audio:xo,quiz:Oo,course:Pr,default:xr},BI=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var S,w;const o=ae(),a=js(e),i=$I[a.key]??xr,c=Sl(),d=rE(),u=c&&!s&&d,f=Y(T=>T.editorProfile.competencyScoped),m=Pn(),g=f&&m?(()=>{const T=e[m.code];return Array.isArray(T)?T:T?[String(T)]:[]})():[],{attributes:b,listeners:h,setNodeRef:v,isDragging:y}=cd({id:e.identifier,disabled:!n||!c||!d,data:{type:"library-item",item:e}}),C=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[er.card,y?er.dragging:"",s?er.added:""].join(" "),"aria-label":e.name,...n?{...b,...h}:{},role:"listitem",onClick:C,children:[l.jsx("span",{className:[`sbx-ct-sq--${a.key}`,er.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:er.info,children:[l.jsx("span",{className:er.name,title:e.name,children:e.name}),l.jsxs("span",{className:er.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(w=e.organisation)!=null&&w[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),g.length>0&&l.jsx("span",{className:er.skillTags,children:g.slice(0,3).map(T=>l.jsx("span",{className:er.skillTag,children:T},T))})]}),s&&l.jsx("span",{className:er.addedBadge,"aria-label":o.libraryCard.alreadyAddedAriaLabel,title:o.libraryCard.alreadyAddedTitle,children:l.jsx(Zr,{size:12})}),!s&&n&&l.jsx("button",{type:"button",className:[er.addBtn,!u&&c?er.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(Jr,{size:14})})]})},zp={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},qI=({filters:e,active:t,onChange:r})=>{const n=ae();return l.jsx("div",{className:zp.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",zp.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},ht={panel:"_panel_uame3_1",header:"_header_uame3_10",headerTitle:"_headerTitle_uame3_19",closeBtn:"_closeBtn_uame3_25",body:"_body_uame3_43",section:"_section_uame3_59",sectionLabel:"_sectionLabel_uame3_65",chips:"_chips_uame3_73",chip:"_chip_uame3_73",active:"_active_uame3_96",footer:"_footer_uame3_102",resetBtn:"_resetBtn_uame3_112",applyBtn:"_applyBtn_uame3_129"},jI=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}],UI=new Set(["board","medium","gradeLevel","subject","topic"]),zI=({local:e,toggle:t})=>{const r=ae(),n=jp();return n.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:ht.chips,children:n.map(s=>l.jsx("button",{type:"button",className:[ht.chip,(e.primaryCategory??[]).includes(s)?ht.active:""].join(" "),onClick:()=>t("primaryCategory",s),children:s},s))})]}):null},VI=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const s=ae(),o=Y(C=>C.editorConfig),a=Y(C=>C.searchFormConfig),i=Y(C=>C.contentFramework),c=Y(C=>C.contentTargetFWIds),{organisationFramework:d}=ta(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),m=a!=null&&a.length?a.filter(C=>UI.has(C.code)).map(C=>({key:C.code,label:C.label||C.code})):jI(s);p.useEffect(()=>{f(t)},[t]);const g=(C,S)=>{f(w=>{const T=w[C]??[],A=T.includes(S)?T.filter(L=>L!==S):[...T,S];return{...w,[C]:A}})},b=(d==null?void 0:d.categories)??[],h=C=>{var S;return((S=b.find(w=>w.code===C))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:ht.panel,role:"dialog","aria-label":s.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:ht.header,children:[l.jsx("span",{className:ht.headerTitle,children:s.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:ht.closeBtn,onClick:n,"aria-label":s.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(fr,{size:16})})]}),l.jsxs("div",{className:ht.body,children:[m.map(({key:C,label:S})=>{const w=h(C);return w.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:S}),l.jsx("div",{className:ht.chips,children:w.slice(0,20).map(T=>l.jsx("button",{type:"button",className:[ht.chip,(u[C]??[]).includes(T.name)?ht.active:""].join(" "),onClick:()=>g(C,T.name),children:T.name},T.identifier))})]},C):null}),l.jsx(zI,{local:u,toggle:g})]}),l.jsxs("div",{className:ht.footer,children:[l.jsx("button",{type:"button",className:ht.resetBtn,onClick:()=>f({}),children:s.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:ht.applyBtn,onClick:()=>{r(u),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},Ct={header:"_header_1tvk1_10",headerCourse:"_headerCourse_1tvk1_20",courseIcon:"_courseIcon_1tvk1_25",titleGroup:"_titleGroup_1tvk1_37",courseMeta:"_courseMeta_1tvk1_45",title:"_title_1tvk1_37",headerActions:"_headerActions_1tvk1_67",iconBtn:"_iconBtn_1tvk1_74",playerArea:"_playerArea_1tvk1_92",footer:"_footer_1tvk1_100",footerCourse:"_footerCourse_1tvk1_109",addBtn:"_addBtn_1tvk1_115",addBtnCourse:"_addBtnCourse_1tvk1_134",modalOverlay:"_modalOverlay_1tvk1_159",modalOverlayCourse:"_modalOverlayCourse_1tvk1_174",modalPanel:"_modalPanel_1tvk1_178",modalPanelCourse:"_modalPanelCourse_1tvk1_190"},HI="application/vnd.sunbird.questionset",QI=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const s=ae(),o=t==="edit",a=Y(m=>m.editorProfile.competencyScoped),i=Up();if(!e)return null;const c=a&&e.primaryCategory==="Course",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 ze.createPortal(l.jsx("div",{className:[Ct.modalOverlay,c?Ct.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[Ct.modalPanel,c?Ct.modalPanelCourse:""].filter(Boolean).join(" "),onClick:m=>m.stopPropagation(),children:[l.jsxs("div",{className:[Ct.header,c?Ct.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:Ct.courseIcon,children:l.jsx(Pr,{size:20})}),l.jsxs("div",{className:Ct.titleGroup,children:[l.jsx("span",{className:Ct.title,title:e.name,children:e.name}),c&&d&&l.jsx("span",{className:Ct.courseMeta,children:d})]}),l.jsx("div",{className:Ct.headerActions,children:l.jsx("button",{type:"button",className:Ct.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(fr,{size:16})})})]}),l.jsx("div",{className:Ct.playerArea,children:c?l.jsx(Fp,{courseId:e.identifier}):l.jsx(Vl,{node:u,editorMode:"read",type:e.mimeType===HI?"quml":"content"})}),o&&l.jsx("div",{className:[Ct.footer,c?Ct.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:Ct.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Jr,{size:15})," ",i??s.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:Ct.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},We={dock:"_dock_2k0x7_1",header:"_header_2k0x7_8",libraryTargetLabel:"_libraryTargetLabel_2k0x7_18",headerLeft:"_headerLeft_2k0x7_28",headerTitle:"_headerTitle_2k0x7_36",count:"_count_2k0x7_42",searchRow:"_searchRow_2k0x7_51",searchWrap:"_searchWrap_2k0x7_59",searchIcon:"_searchIcon_2k0x7_65",searchInput:"_searchInput_2k0x7_74",filterToggleBtn:"_filterToggleBtn_2k0x7_92",filterToggleBtnActive:"_filterToggleBtnActive_2k0x7_111",filterBadge:"_filterBadge_2k0x7_117",filters:"_filters_2k0x7_136",mainArea:"_mainArea_2k0x7_146",sidePanelOverlay:"_sidePanelOverlay_2k0x7_155",cardList:"_cardList_2k0x7_164",skeleton:"_skeleton_2k0x7_180",skeletonIcon:"_skeletonIcon_2k0x7_190",skeletonText:"_skeletonText_2k0x7_198",skeletonLine:"_skeletonLine_2k0x7_205",skeletonLineSm:"_skeletonLineSm_2k0x7_212",loadMoreBtn:"_loadMoreBtn_2k0x7_227",emptyState:"_emptyState_2k0x7_252",collapseBtn:"_collapseBtn_2k0x7_272"},WI=[{label:"Courses",value:"all"}];function RI(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 GI=({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:m,applyAdvancedFilters:g,toggleSort:b,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=MI(),{addResource:C,selectedNodeId:S,treeData:w,treeCache:T}=le(),A=Fr(M=>M.setActiveAssessmentSlot),L=Y(M=>M.editorProfile.competencyScoped),E=e==="edit",x=Up(),[$,N]=p.useState(!1),[P,q]=p.useState({}),[F,z]=p.useState(null),[ne,Q]=p.useState(null),te=p.useMemo(()=>RI(w),[w]),pe=p.useCallback(async(M,B)=>{var ce,Ce;const Z=(ce=w[0])==null?void 0:ce.id;if(!(!Z||ne)){if(Ps(((Ce=w[0])==null?void 0:Ce.children)??[],B)){we.error(B==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}Q(M.identifier);try{const{qualifies:ue,meta:de}=await ku(M.identifier);if(!ue){we.error(n.learningPath.notAssessmentCourseToast.replace("{name}",M.name));return}const W={...M,...de};if(C(W,Z,{isAssessmentCourse:!0,slot:B})===!1){we.error(n.learningPath.bothSlotsFilledToast);return}we.success(n.libraryDock.itemAddedToast.replace("{name}",M.name)),A(null)}catch(ue){console.error("[LibraryDock] assessment-course check failed:",ue),we.error(n.learningPath.assessmentCheckFailedToast)}finally{Q(null)}}},[w,C,A,ne,n]),ie=p.useCallback(M=>{var Ce,ue,de;if(L&&!Nu(w[0],T)){we.error(n.learningPath.selectCurriculumFirstToast);return}if(v){pe(M,v);return}if(!S){we.error(L?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const B=(Ce=w[0])==null?void 0:Ce.id,Z=le.getState().getNodeById(S);if(L){const W=((ue=w[0])==null?void 0:ue.children)??[],se=Z!=null&&Z.isFolder?Z:Z!=null&&Z.parent?le.getState().getNodeById(Z.parent):void 0;if(se&&ji(W,se)){const Ae=(de=W[0])==null?void 0:de.id;we.error(se.id===Ae?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===B||!(Z!=null&&Z.isFolder)){we(L?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(Es,{size:16}),duration:4e3});return}if(C(M,S)===!1){we.error((L?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",M.name));return}we.success(n.libraryDock.itemAddedToast.replace("{name}",M.name))},[v,pe,S,C,w,T,n,L]),me=p.useCallback(M=>{q(M),g(M)},[g]),ve=p.useCallback(M=>{z(M)},[]),Ee=p.useCallback(M=>{ie(M),z(null)},[ie]),ye=p.useMemo(()=>Object.values(P).reduce((M,B)=>M+((B==null?void 0:B.length)??0),0),[P]);return l.jsxs("div",{className:We.dock,children:[l.jsxs("div",{className:We.header,children:[l.jsxs("div",{className:We.headerLeft,children:[l.jsx("button",{type:"button",className:We.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(Dy,{size:15})}),l.jsx(Ey,{size:16}),l.jsx("span",{className:We.headerTitle,children:n.libraryDock.headerTitle}),a>0&&l.jsx("span",{className:We.count,children:a})]}),x&&l.jsx("span",{className:We.libraryTargetLabel,children:x})]}),l.jsxs("div",{className:We.searchRow,children:[l.jsxs("div",{className:We.searchWrap,children:[l.jsx(Mo,{size:14,className:We.searchIcon}),l.jsx("input",{type:"search",className:We.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:M=>f(M.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[We.filterToggleBtn,d?We.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(py,{size:15}):l.jsx(by,{size:15})}),l.jsxs("button",{type:"button",className:[We.filterToggleBtn,$?We.filterToggleBtnActive:""].join(" "),onClick:()=>N(M=>!M),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":$,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx($y,{size:15}),ye>0&&l.jsx("span",{className:We.filterBadge,children:ye})]})]}),l.jsx("div",{className:We.filters,children:l.jsx(qI,{filters:L?WI:nE,active:i,onChange:m})}),l.jsxs("div",{className:We.mainArea,children:[l.jsx("div",{className:We.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:o&&s.length===0?Array.from({length:4}).map((M,B)=>l.jsxs("div",{className:We.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:We.skeletonIcon}),l.jsxs("div",{className:We.skeletonText,children:[l.jsx("div",{className:We.skeletonLine}),l.jsx("div",{className:We.skeletonLineSm})]})]},B)):s.length>0?l.jsxs(l.Fragment,{children:[s.map(M=>l.jsx(BI,{item:M,onAdd:ie,onPreview:ve,isDraggable:E,isAdded:te.has(M.identifier)},M.identifier)),u&&l.jsx("button",{type:"button",className:We.loadMoreBtn,onClick:h,disabled:o,"aria-label":n.libraryDock.loadMoreAriaLabel,children:o?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:We.emptyState,children:[l.jsx(Mo,{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})]})]})}),$&&l.jsx("div",{className:We.sidePanelOverlay,children:l.jsx(VI,{isOpen:$,filters:P,onApply:me,onClose:()=>N(!1)})}),F&&l.jsx(QI,{content:F,editorMode:e,onAdd:Ee,onClose:()=>z(null)})]})]})};function KI(e,t,r,n=bi){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","dialcodes"]),d=new Set(["copyrightYear","compatibilityLevel","version"]);function u(g,b=!1){const h={};for(const[v,y]of Object.entries(g))if(!a.has(v)&&!(b&&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 C=Number(y);isNaN(C)||(h[v]=C)}else h[v]=y;return h}function f(g){var h;const b={};for(const v of g.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=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};b[v.identifier]={name:v.name,...w,...S}}return b}function m(g,b){var w,T;const h=g.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),C=!g.isFolder&&!b;if(b||y||v&&!C){let A;if(y)A={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((w=g.metadata)==null?void 0:w.contentType)??n.unitContentType,primaryCategory:((T=g.metadata)==null?void 0:T.primaryCategory)??n.unitPrimaryCategory,name:g.name,visibility:"Parent",channel:r,...u(g.metadata??{})};else if(b){const{isNew:L,...E}=v??{};A={...u(g.metadata??{},!0),...u(E,!1),name:g.name}}else{const{isNew:L,...E}=v??{};A={name:g.name,visibility:"Parent",...u(E,!0)}}s[h]={metadata:A,objectType:g.objectType||(g.isFolder?"Collection":"Content"),root:b,isNew:y}}const S=g.isFolder?f(g):{};o[h]={name:g.name,children:(g.children??[]).map(A=>A.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:b},(g.children??[]).forEach(A=>m(A,!1))}return e.forEach((g,b)=>m(g,b===0)),{nodesModified:s,hierarchy:o}}function YI(){const[e,t]=p.useState(!1),r=le(u=>u.treeCache),n=le(u=>u.treeData),s=Y(u=>u.isDirty),o=Y(u=>u.lastSaved),{setIsDirty:a,setLastSaved:i}=Y(),c=Y(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){we.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",m=c.context.userId??c.context.uid??"";t(!0);try{const g=Y.getState().editorProfile,{nodesModified:b,hierarchy:h}=KI(n,r,f,g),{identifiers:v}=await oS(u,b,h,m);v&&Object.keys(v).length>0&&le.getState().replaceNodeIds(v);const y=new Date().toISOString();i(y),a(!1)}catch(g){console.error("[useSaveHierarchy] save failed:",g),we.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,a,i]),isSaving:e,isDirty:s,lastSaved:o}}const ZI={};function XI(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function JI(e,t,r,n,s,o=ZI){const a=[],i=(c,d)=>{var u;for(const f of c){const m=d&&!f.parent,g=m?r:f.isFolder?n:null;if(g&&g.length>0){const b={...f.metadata??{},...t[f.id]??{}},v=up(g,b,o,m,s).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&XI(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 ek(e){var h,v;const t=Y(y=>y.editorConfig),r=Y(y=>y.setButtonLoader),n=Y(y=>y.validateAllForms),s=Y(y=>y.rootFormConfig),o=Y(y=>y.unitFormConfig),a=le(y=>y.treeData),i=le(y=>y.treeCache),c=le(y=>y.selectNode),d=Y(y=>y.contentFramework),u=Y(y=>y.contentTargetFWIds),{organisationFramework:f,targetFrameworks:m}=ta(d??((h=t==null?void 0:t.context)==null?void 0:h.framework),u??((v=t==null?void 0:t.context)==null?void 0:v.targetFWIds)),g=p.useCallback(()=>{var T,A,L;const y={editorMode:"edit",objectType:(T=t==null?void 0:t.config)==null?void 0:T.objectType,userFullName:(L=(A=t==null?void 0:t.context)==null?void 0:A.user)==null?void 0:L.fullName},C=JI(a,i,s,o,y,{organisationFramework:f,targetFrameworks:m});if(C.length===0)return!0;const S=C[0];we.error(`"${S.nodeName}": please fill required field${S.missing.length>1?"s":""} — ${S.missing.join(", ")}`);const{setFormStatus:w}=Y.getState();return C.forEach(E=>w(E.nodeId,!1)),c(S.nodeId),!1},[a,i,s,o,t,c,f,m]);return{runAction:p.useCallback(async(y,C)=>{var T,A,L,E;const S=((T=t==null?void 0:t.context)==null?void 0:T.contentId)??((A=t==null?void 0:t.context)==null?void 0:A.identifier)??"";if(!S)return we.error("No content identifier found."),!1;const w=((L=t==null?void 0:t.context)==null?void 0:L.userId)??((E=t==null?void 0:t.context)==null?void 0:E.uid)??"";try{switch(y){case"sendForReview":return g()?n(a)?(r("saveCollection",!0),await e(),await lS(S),we.success("Content sent for review"),!0):(we.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{r("rejectCollection",!0);const x=(C==null?void 0:C.comment)??"";return await cS(S,x),we.success("Content rejected and sent back to the author"),!0}case"publish":return g()?n(a)?(r("publishCollection",!0),await e(),await aS(S,w),we.success("Content published successfully"),!0):(we.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(x){console.error(`[useToolbarActions] ${y} failed`,x);const $=y==="sendForReview"?"send for review":y==="reject"?"reject":"publish";return we.error(`Failed to ${$}. Please try again.`),!1}finally{r("saveCollection",!1),r("rejectCollection",!1),r("publishCollection",!1)}},[t,e,r,g,n,a]),checkRequiredFields:g}}const Bt={shell:"_shell_fu72l_1",workspace:"_workspace_fu72l_8",sidebarCollapsed:"_sidebarCollapsed_fu72l_16",dockCollapsed:"_dockCollapsed_fu72l_19",dock:"_dock_fu72l_19",outline:"_outline_fu72l_40",reopenTab:"_reopenTab_fu72l_45",outlineHidden:"_outlineHidden_fu72l_79",editor:"_editor_fu72l_86",editorLp:"_editorLp_fu72l_92",dockHidden:"_dockHidden_fu72l_105",dockReopenTab:"_dockReopenTab_fu72l_112",dragChip:"_dragChip_fu72l_137",dragChipLabel:"_dragChipLabel_fu72l_152"},tk=({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,m]=p.useState(!1),{addResource:g,treeData:b,treeCache:h}=le(),v=Y(Q=>Q.setFormStatus),y=Y(Q=>Q.editorProfile.key==="learningPath"),[C,S]=p.useState(!0),w=le(Q=>Q.selectedNodeId),{save:T,isSaving:A,isDirty:L,lastSaved:E}=YI(),{runAction:x,checkRequiredFields:$}=ek(T);p.useEffect(()=>{if(!L)return;const Q=te=>{te.preventDefault(),te.returnValue=""};return window.addEventListener("beforeunload",Q),()=>window.removeEventListener("beforeunload",Q)},[L]);const N=Oc(Ja(Ao,{activationConstraint:{distance:8}})),P=p.useCallback(Q=>{var pe;const te=(pe=Q.active.data.current)==null?void 0:pe.item;te&&a(te)},[]),q=p.useCallback(Q=>{var M,B,Z,ce,Ce;a(null);const te=(M=Q.active.data.current)==null?void 0:M.item;if(!te)return;if(y&&!Nu(b[0],h)){we.error(s.learningPath.selectCurriculumFirstToast);return}const pe=Q.over,ie=(pe==null?void 0:pe.id)??w??void 0,me=y?s.learningPath.dropOntoLevelError:s.splitBuilderShell.dropOntoUnitError;if(!ie){we.error(me);return}const ve=(B=b[0])==null?void 0:B.id;if(ie===ve){we.error(y?s.learningPath.dropOntoPathError:s.splitBuilderShell.dropOntoCourseError);return}const Ee=le.getState().getNodeById(ie);if(!(Ee!=null&&Ee.isFolder)){we.error(me);return}if(y&&lt(Ee)){const ue=(Ce=(ce=(Z=b[0])==null?void 0:Z.children)==null?void 0:ce[0])==null?void 0:Ce.id;we.error(Ee.id===ue?s.learningPath.priorSlotFilledToast:s.learningPath.outcomeSlotFilledToast);return}if(!g(te,ie)){we.error((y?s.learningPath.itemAlreadyInPathToast:s.splitBuilderShell.alreadyInCollectionError).replace("{name}",te.name));return}r==null||r(te,ie),we.success((y?s.learningPath.addedToLevelSuccess:s.splitBuilderShell.addedToUnitSuccess).replace("{name}",te.name))},[w,g,b,h,r,s,y]),F=p.useCallback(async Q=>{if(Q.action==="onFormStatusChange"){const{isValid:te,nodeId:pe}=Q.data??{},ie=te!==!1;S(ie),pe&&v(pe,ie);return}if(Q.action==="back"&&L&&e==="edit"){m(!0);return}if(Q.action==="saveCollection"){if(!C){we.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!$())return;await T(),n==null||n(b),t==null||t(Q);return}if(Q.action==="sendForReview"||Q.action==="reject"||Q.action==="publish"){await x(Q.action,Q.data)&&(t==null||t(Q));return}t==null||t(Q)},[T,x,$,t,n,b,L,C,e,s]),z=p.useCallback(async()=>{if(!$()){m(!1);return}await T(),m(!1),n==null||n(b),t==null||t({action:"back"})},[T,$,n,t,b]),ne=p.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return l.jsxs(id,{sensors:N,onDragStart:P,onDragEnd:q,children:[l.jsxs("div",{className:Bt.shell,children:[l.jsx(zS,{editorMode:e,isSaving:A,isDirty:L,lastSaved:E,isFormValid:C,onToolbarEvent:F}),l.jsxs("div",{className:[Bt.workspace,i?Bt.sidebarCollapsed:"",d?Bt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Bt.outline,i?Bt.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":i,children:l.jsx(hE,{editorMode:e,collapsed:i,onToggleCollapse:()=>c(Q=>!Q)})}),i&&l.jsx("button",{className:Bt.reopenTab,onClick:()=>c(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Bt.editor,y?Bt.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:l.jsx(LI,{editorMode:e,onToolbarEvent:F})}),l.jsx("aside",{className:[Bt.dock,d?Bt.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:l.jsx(GI,{editorMode:e,collapsed:d,onToggleCollapse:()=>u(Q=>!Q)})}),d&&l.jsx("button",{className:Bt.dockReopenTab,onClick:()=>u(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(cy,{dropAnimation:null,children:o?l.jsx("div",{className:Bt.dragChip,children:l.jsx("span",{className:Bt.dragChipLabel,children:o.name})}):null}),f&&l.jsx(VS,{onSave:z,onDiscard:ne,onCancel:()=>m(!1),isSaving:A})]})},rk="v1";function nk(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 Vp(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:nk(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 qr(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(Vp(a,s))}else n.code&&r.push(Vp(n));return r}function sk(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 ok(e,t,r="Collection",n=rk){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:qr(a.create),unitForm:qr(a.unitMetadata),childForm:qr(a.childMetadata),searchForm:qr(a.search??a.searchConfig),relationalForm:qr(a.relationalMetadata),publishChecklist:qr(a.publishchecklist),reviewChecklist:qr(a.review),rfcChecklist:qr(a.requestforchangeschecklist),schemaDefaults:sk(i.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Hp(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function ak({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:m}=Y(),{setTreeData:g,selectNode:b}=le();return p.useEffect(()=>{let h=!1;async function v(){var y,C,S;try{n(!0),o(null),e.apiBaseUrl&&Su(e.apiBaseUrl),c(e),d(e.config.mode),m(nb(e));const w=e.context.contentId??e.context.identifier??"",T=e.context.channel??"";let A;if(T)try{A=(y=await cp(T))==null?void 0:y.defaultFramework}catch{}let L=!1;if(w){const E=e.config.objectType==="QuestionSet";let{rootNode:x}=E?await sS(w):await Tu(w);if(x&&e.config.primaryCategory==="Learning Path"&&(x=await fS(x)),!h&&(g(x?[x]:[]),x)){b(x.id);const{framework:F,targetFWIds:z}=Hp(x.metadata??{},A,e.context);f(F,z),L=!0}const $=e.config.primaryCategory??"Course",N=e.context.channel??"",P=e.config.categoryDefinitionApiVersion??"v1";try{const q=await ok($,N,e.config.objectType??"Collection",P);if(!h){u(q);const F=((C=q.sourcingSettings)==null?void 0:C.collection)??{},z={};F.maxDepth&&!e.config.maxDepth&&(z.maxDepth=F.maxDepth),F.children&&!e.config.children&&(z.children=F.children),F.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(z.hierarchy={...e.config.hierarchy??{},...F.hierarchy}),Object.keys(z).length>0&&c({...e,config:{...e.config,...z}})}}catch{}}if(!h&&!L){const{framework:E,targetFWIds:x}=Hp({},A,e.context);f(E,x)}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 ik(){const e=_i(t=>t.setLanguage);p.useEffect(()=>{e(localStorage.getItem(Si)||"en",{broadcast:!1});const t=n=>{n.key===Si&&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(wi,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(wi,r)}},[e])}const Zs={root:"_root_1itrv_1",loadingState:"_loadingState_1itrv_10",loadingSpinner:"_loadingSpinner_1itrv_20",errorState:"_errorState_1itrv_34"},lk=new Fg({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function ck({error:e,onRetry:t}){const r=ae();return l.jsxs("div",{className:Zs.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 dk 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(ck,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function uk(e){ik();const t=ae(),{isLoading:r,error:n}=ak({config:e,onError:e.onError}),s=Y(a=>a.editorMode),o=Y(a=>a.editorProfile);return r?l.jsxs("div",{className:Zs.loadingState,children:[l.jsx("div",{className:Zs.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:Zs.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",Zs.root,o.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(tk,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const Qp=e=>l.jsx(dk,{onError:e.onError,children:l.jsxs($g,{client:lk,children:[l.jsx(uk,{...e}),l.jsx(Mm,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),Na=Symbol.for("r2wc.reactRender"),Wp=Symbol.for("r2wc.shouldRender"),Pa=Symbol.for("r2wc.root");function fk(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function hk(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Rp={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[Na]()}}),e[Na]()}};function pk(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,m){return o&&(s[u]=!0),typeof u=="symbol"||s[u]||u in d?(e.propTypes&&u in e.propTypes&&Rp.expando(m,u,f),Reflect.set(d,u,f,m)):(Rp.expando(m,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[Wp]=!0,this[Na]()},i.disconnectedCallback=function(){typeof r.createRoot=="function"?this[Pa].unmount():r.unmountComponentAtNode(this)},i[Na]=function(){if(this[Wp]===!0){var d={};Object.keys(this).forEach(function(m){s[m]!==!1&&(d[m]=this[m])},this),o=!0;const u=n.shadow?this.shadowRoot:this,f=t.createElement(e,d);typeof r.createRoot=="function"?(this[Pa]||(this[Pa]=r.createRoot(u)),this[Pa].render(f)):r.render(f,u),o=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return fk(d)}):Object.keys(e.propTypes),i.attributeChangedCallback=function(d,u,f){var m=n.dashStyleAttributes?hk(d):d;this[m]=f}),a}var Rn={},Gp;function gk(){if(Gp)return Rn;Gp=1;var e=ze;if(process.env.NODE_ENV==="production")Rn.createRoot=e.createRoot,Rn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Rn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Rn.hydrateRoot=function(r,n,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,s)}finally{t.usingClientEntryPoint=!1}}}return Rn}var mk=gk();const vk=hi(mk);function yk(){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 bk(e="sb-collection-editor"){if(yk(),typeof customElements>"u"||customElements.get(e))return;const t=pk(Qp,p,vk,{});customElements.define(e,t)}ke.CollectionEditor=Qp,ke.registerCollectionEditor=bk,ke.setApiBaseUrl=Su,ke.useEditorStore=Y,ke.useLibraryStore=qp,ke.useTreeStore=le,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})}));