@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
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var xp=Object.defineProperty;var Rl=e=>{throw TypeError(e)};var _p=(e,t,r)=>t in e?xp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ns=(e,t,r)=>_p(e,typeof t!="symbol"?t+"":t,r),ma=(e,t,r)=>t.has(e)||Rl("Cannot "+r);var T=(e,t,r)=>(ma(e,t,"read from private field"),r?r.call(e):t.get(e)),ae=(e,t,r)=>t.has(e)?Rl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,n)=>(ma(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ce=(e,t,r)=>(ma(e,t,"access private method"),r);var Ys=(e,t,r,n)=>({set _(s){Y(e,t,s,r)},get _(){return T(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),Br=require("react-dom"),c=require("react/jsx-runtime");function Tp(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 Ae=Tp(m);var Ps=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(){}},Zr,Rr,In,id,Ep=(id=class extends Ps{constructor(){super();ae(this,Zr);ae(this,Rr);ae(this,In);Y(this,In,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){T(this,Rr)||this.setEventListener(T(this,In))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Rr))==null||t.call(this),Y(this,Rr,void 0))}setEventListener(t){var r;Y(this,In,t),(r=T(this,Rr))==null||r.call(this),Y(this,Rr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){T(this,Zr)!==t&&(Y(this,Zr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof T(this,Zr)=="boolean"?T(this,Zr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Zr=new WeakMap,Rr=new WeakMap,In=new WeakMap,id),Vo=new Ep,Ip={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},cr,Xr,ad,Op=(ad=class{constructor(){ae(this,cr,Ip);ae(this,Xr,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&T(this,Xr)&&e!==T(this,cr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:T(this,cr),provider:e}),Y(this,cr,e),process.env.NODE_ENV!=="production"&&Y(this,Xr,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&Y(this,Xr,!0),T(this,cr).setTimeout(e,t)}clearTimeout(e){T(this,cr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&Y(this,Xr,!0),T(this,cr).setInterval(e,t)}clearInterval(e){T(this,cr).clearInterval(e)}},cr=new WeakMap,Xr=new WeakMap,ad),Wr=new Op;function Ap(e){setTimeout(e,0)}var Dp=typeof window>"u"||"Deno"in globalThis;function Dt(){}function Np(e,t){return typeof e=="function"?e(t):e}function Wa(e){return typeof e=="number"&&e>=0&&e!==1/0}function md(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $r(e,t){return typeof e=="function"?e(t):e}function Pt(e,t){return typeof e=="function"?e(t):e}function kl(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(n){if(t.queryHash!==Ho(a,t.options))return!1}else if(!xs(t.queryKey,a))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||i&&!i(t))}function jl(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Ss(t.options.mutationKey)!==Ss(i))return!1}else if(!xs(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Ho(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ss)(e)}function Ss(e){return JSON.stringify(e,(t,r)=>Za(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function xs(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>xs(e[r],t[r])):!1}var Rp=Object.prototype.hasOwnProperty;function Ka(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Ll(e)&&Ll(t);if(!n&&!(Za(e)&&Za(t)))return t;const i=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,l=n?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=n?d:a[d],g=e[f],p=t[f];if(g===p){l[f]=g,(n?d<i:Rp.call(e,f))&&u++;continue}if(g===null||p===null||typeof g!="object"||typeof p!="object"){l[f]=p;continue}const C=Ka(g,p,r+1);l[f]=C,C===g&&u++}return i===o&&u===i?e:l}function Ya(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 Ll(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Za(e){if(!Pl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Pl(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Pl(e){return Object.prototype.toString.call(e)==="[object Object]"}function kp(e){return new Promise(t=>{Wr.setTimeout(t,e)})}function Xa(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 Ka(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 Ka(e,t)}return t}function jp(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Lp(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ii=Symbol();function gd(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ii&&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===Ii?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function yd(e,t){return typeof e=="function"?e(...t):!!e}function Pp(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 _s=(()=>{let e=()=>Dp;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ja(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});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 Fp=Ap;function Mp(){let e=[],t=0,r=o=>{o()},n=o=>{o()},s=Fp;const i=o=>{t?e.push(o):s(()=>{r(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{n(()=>{o.forEach(l=>{r(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{s=o}}}var dt=Mp(),On,kr,An,od,Bp=(od=class extends Ps{constructor(){super();ae(this,On,!0);ae(this,kr);ae(this,An);Y(this,An,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(){T(this,kr)||this.setEventListener(T(this,An))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,kr))==null||t.call(this),Y(this,kr,void 0))}setEventListener(t){var r;Y(this,An,t),(r=T(this,kr))==null||r.call(this),Y(this,kr,t(this.setOnline.bind(this)))}setOnline(t){T(this,On)!==t&&(Y(this,On,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return T(this,On)}},On=new WeakMap,kr=new WeakMap,An=new WeakMap,od),Oi=new Bp;function $p(e){return Math.min(1e3*2**e,3e4)}function vd(e){return(e??"online")==="online"?Oi.isOnline():!0}var eo=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bd(e){let t=!1,r=0,n;const s=Ja(),i=()=>s.status!=="pending",a=h=>{var y;if(!i()){const v=new eo(h);g(v),(y=e.onCancel)==null||y.call(e,v)}},o=()=>{t=!0},l=()=>{t=!1},u=()=>Vo.isFocused()&&(e.networkMode==="always"||Oi.isOnline())&&e.canRun(),d=()=>vd(e.networkMode)&&e.canRun(),f=h=>{i()||(n==null||n(),s.resolve(h))},g=h=>{i()||(n==null||n(),s.reject(h))},p=()=>new Promise(h=>{var y;n=v=>{(i()||u())&&h(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var h;n=void 0,i()||(h=e.onContinue)==null||h.call(e)}),C=()=>{if(i())return;let h;const y=r===0?e.initialPromise:void 0;try{h=y??e.fn()}catch(v){h=Promise.reject(v)}Promise.resolve(h).then(f).catch(v=>{var E;if(i())return;const b=e.retry??(_s.isServer()?0:3),w=e.retryDelay??$p,S=typeof w=="function"?w(r,v):w,_=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,v);if(t||!_){g(v);return}r++,(E=e.onFail)==null||E.call(e,r,v),kp(S).then(()=>u()?void 0:p()).then(()=>{t?g(v):C()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?C():p().then(C),s)}}var Jr,ld,wd=(ld=class{constructor(){ae(this,Jr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wa(this.gcTime)&&Y(this,Jr,Wr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_s.isServer()?1/0:5*60*1e3))}clearGcTimeout(){T(this,Jr)!==void 0&&(Wr.clearTimeout(T(this,Jr)),Y(this,Jr,void 0))}},Jr=new WeakMap,ld);function qp(e){return{onFetch:(t,r)=>{var d,f,g,p,C;const n=t.options,s=(g=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let h=!1;const y=w=>{Pp(w,()=>t.signal,()=>h=!0)},v=gd(t.options,t.fetchOptions),b=async(w,S,_)=>{if(h)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const D=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};return y(N),N})(),R=await v(D),{maxPages:M}=t.options,$=_?Lp:jp;return{pages:$(w.pages,R,M),pageParams:$(w.pageParams,S,M)}};if(s&&i.length){const w=s==="backward",S=w?Up:Fl,_={pages:i,pageParams:a},E=S(n,_);o=await b(_,E,w)}else{const w=e??i.length;do{const S=l===0?a[0]??n.initialPageParam:Fl(n,o);if(l>0&&S==null)break;o=await b(o,S),l++}while(l<w)}return o};t.options.persister?t.fetchFn=()=>{var h,y;return(y=(h=t.options).persister)==null?void 0:y.call(h,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Fl(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 Dn,en,Nn,Ht,tn,it,Ns,rn,Lt,Cd,yr,cd,zp=(cd=class extends wd{constructor(t){super();ae(this,Lt);ae(this,Dn);ae(this,en);ae(this,Nn);ae(this,Ht);ae(this,tn);ae(this,it);ae(this,Ns);ae(this,rn);Y(this,rn,!1),Y(this,Ns,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,tn,t.client),Y(this,Ht,T(this,tn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,en,Bl(this.options)),this.state=t.state??T(this,en),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return T(this,Dn)}get promise(){var t;return(t=T(this,it))==null?void 0:t.promise}setOptions(t){if(this.options={...T(this,Ns),...t},t!=null&&t._type&&Y(this,Dn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Bl(this.options);r.data!==void 0&&(this.setState(Ml(r.data,r.dataUpdatedAt)),Y(this,en,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,Ht).remove(this)}setData(t,r){const n=Xa(this.state.data,t,this.options);return Ce(this,Lt,yr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Ce(this,Lt,yr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=T(this,it))==null?void 0:n.promise;return(s=T(this,it))==null||s.cancel(t),r?r.then(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return T(this,en)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Pt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ii||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>$r(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:!md(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=T(this,it))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=T(this,it))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,Ht).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(T(this,it)&&(T(this,rn)||Ce(this,Lt,Cd).call(this)?T(this,it).cancel({revert:!0}):T(this,it).cancelRetry()),this.scheduleGc()),T(this,Ht).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ce(this,Lt,yr).call(this,{type:"invalidate"})}async fetch(t,r){var u,d,f,g,p,C,h,y,v,b,w;if(this.state.fetchStatus!=="idle"&&((u=T(this,it))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(T(this,it))return T(this,it).continueRetry(),T(this,it).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(_=>_.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,s=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,rn,!0),n.signal)})},i=()=>{const S=gd(this.options,r),E=(()=>{const D={client:T(this,tn),queryKey:this.queryKey,meta:this.meta};return s(D),D})();return Y(this,rn,!1),this.options.persister?this.options.persister(S,E,this):S(E)},o=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:T(this,tn),state:this.state,fetchFn:i};return s(S),S})(),l=T(this,Dn)==="infinite"?qp(this.options.pages):this.options.behavior;l==null||l.onFetch(o,this),Y(this,Nn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ce(this,Lt,yr).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta}),Y(this,it,bd({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:S=>{S instanceof eo&&S.revert&&this.setState({...T(this,Nn),fetchStatus:"idle"}),n.abort()},onFail:(S,_)=>{Ce(this,Lt,yr).call(this,{type:"failed",failureCount:S,error:_})},onPause:()=>{Ce(this,Lt,yr).call(this,{type:"pause"})},onContinue:()=>{Ce(this,Lt,yr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await T(this,it).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),(p=(g=T(this,Ht).config).onSuccess)==null||p.call(g,S,this),(h=(C=T(this,Ht).config).onSettled)==null||h.call(C,S,this.state.error,this),S}catch(S){if(S instanceof eo){if(S.silent)return T(this,it).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Ce(this,Lt,yr).call(this,{type:"error",error:S}),(v=(y=T(this,Ht).config).onError)==null||v.call(y,S,this),(w=(b=T(this,Ht).config).onSettled)==null||w.call(b,this.state.data,S,this),S}finally{this.scheduleGc()}}},Dn=new WeakMap,en=new WeakMap,Nn=new WeakMap,Ht=new WeakMap,tn=new WeakMap,it=new WeakMap,Ns=new WeakMap,rn=new WeakMap,Lt=new WeakSet,Cd=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},yr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Sd(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Ml(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Nn,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),dt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),T(this,Ht).notify({query:this,type:"updated",action:t})})},cd);function Sd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ml(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bl(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 At,Se,Rs,_t,nn,Rn,vr,jr,ks,kn,jn,sn,an,Lr,Ln,De,hs,to,ro,no,so,io,ao,oo,xd,ud,Vp=(ud=class extends Ps{constructor(t,r){super();ae(this,De);ae(this,At);ae(this,Se);ae(this,Rs);ae(this,_t);ae(this,nn);ae(this,Rn);ae(this,vr);ae(this,jr);ae(this,ks);ae(this,kn);ae(this,jn);ae(this,sn);ae(this,an);ae(this,Lr);ae(this,Ln,new Set);this.options=r,Y(this,At,t),Y(this,jr,null),Y(this,vr,Ja()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Se).addObserver(this),$l(T(this,Se),this.options)?Ce(this,De,hs).call(this):this.updateResult(),Ce(this,De,so).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lo(T(this,Se),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lo(T(this,Se),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ce(this,De,io).call(this),Ce(this,De,ao).call(this),T(this,Se).removeObserver(this)}setOptions(t){const r=this.options,n=T(this,Se);if(this.options=T(this,At).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pt(this.options.enabled,T(this,Se))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ce(this,De,oo).call(this),T(this,Se).setOptions(this.options),r._defaulted&&!Ya(this.options,r)&&T(this,At).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Se),observer:this});const s=this.hasListeners();s&&ql(T(this,Se),n,this.options,r)&&Ce(this,De,hs).call(this),this.updateResult(),s&&(T(this,Se)!==n||Pt(this.options.enabled,T(this,Se))!==Pt(r.enabled,T(this,Se))||$r(this.options.staleTime,T(this,Se))!==$r(r.staleTime,T(this,Se)))&&Ce(this,De,to).call(this);const i=Ce(this,De,ro).call(this);s&&(T(this,Se)!==n||Pt(this.options.enabled,T(this,Se))!==Pt(r.enabled,T(this,Se))||i!==T(this,Lr))&&Ce(this,De,no).call(this,i)}getOptimisticResult(t){const r=T(this,At).getQueryCache().build(T(this,At),t),n=this.createResult(r,t);return Qp(this,n)&&(Y(this,_t,n),Y(this,Rn,this.options),Y(this,nn,T(this,Se).state)),n}getCurrentResult(){return T(this,_t)}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&&T(this,vr).status==="pending"&&T(this,vr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){T(this,Ln).add(t)}getCurrentQuery(){return T(this,Se)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=T(this,At).defaultQueryOptions(t),n=T(this,At).getQueryCache().build(T(this,At),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ce(this,De,hs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,_t)))}createResult(t,r){var M;const n=T(this,Se),s=this.options,i=T(this,_t),a=T(this,nn),o=T(this,Rn),u=t!==n?t.state:T(this,Rs),{state:d}=t;let f={...d},g=!1,p;if(r._optimisticResults){const $=this.hasListeners(),N=!$&&$l(t,r),j=$&&ql(t,n,r,s);(N||j)&&(f={...f,...Sd(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:C,errorUpdatedAt:h,status:y}=f;p=f.data;let v=!1;if(r.placeholderData!==void 0&&p===void 0&&y==="pending"){let $;i!=null&&i.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?($=i.data,v=!0):$=typeof r.placeholderData=="function"?r.placeholderData((M=T(this,jn))==null?void 0:M.state.data,T(this,jn)):r.placeholderData,$!==void 0&&(y="success",p=Xa(i==null?void 0:i.data,$,r),g=!0)}if(r.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&r.select===T(this,ks))p=T(this,kn);else try{Y(this,ks,r.select),p=r.select(p),p=Xa(i==null?void 0:i.data,p,r),Y(this,kn,p),Y(this,jr,null)}catch($){Y(this,jr,$)}T(this,jr)&&(C=T(this,jr),p=T(this,kn),h=Date.now(),y="error");const b=f.fetchStatus==="fetching",w=y==="pending",S=y==="error",_=w&&b,E=p!==void 0,R={status:y,fetchStatus:f.fetchStatus,isPending:w,isSuccess:y==="success",isError:S,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:f.dataUpdatedAt,error:C,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:S&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:S&&E,isStale:Qo(t,r),refetch:this.refetch,promise:T(this,vr),isEnabled:Pt(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=R.data!==void 0,N=R.status==="error"&&!$,j=L=>{N?L.reject(R.error):$&&L.resolve(R.data)},P=()=>{const L=Y(this,vr,R.promise=Ja());j(L)},k=T(this,vr);switch(k.status){case"pending":t.queryHash===n.queryHash&&j(k);break;case"fulfilled":(N||R.data!==k.value)&&P();break;case"rejected":(!N||R.error!==k.reason)&&P();break}}return R}updateResult(){const t=T(this,_t),r=this.createResult(T(this,Se),this.options);if(Y(this,nn,T(this,Se).state),Y(this,Rn,this.options),T(this,nn).data!==void 0&&Y(this,jn,T(this,Se)),Ya(r,t))return;Y(this,_t,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!T(this,Ln).size)return!0;const a=new Set(i??T(this,Ln));return this.options.throwOnError&&a.add("error"),Object.keys(T(this,_t)).some(o=>{const l=o;return T(this,_t)[l]!==t[l]&&a.has(l)})};Ce(this,De,xd).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ce(this,De,so).call(this)}},At=new WeakMap,Se=new WeakMap,Rs=new WeakMap,_t=new WeakMap,nn=new WeakMap,Rn=new WeakMap,vr=new WeakMap,jr=new WeakMap,ks=new WeakMap,kn=new WeakMap,jn=new WeakMap,sn=new WeakMap,an=new WeakMap,Lr=new WeakMap,Ln=new WeakMap,De=new WeakSet,hs=function(t){Ce(this,De,oo).call(this);let r=T(this,Se).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Dt)),r},to=function(){Ce(this,De,io).call(this);const t=$r(this.options.staleTime,T(this,Se));if(_s.isServer()||T(this,_t).isStale||!Wa(t))return;const n=md(T(this,_t).dataUpdatedAt,t)+1;Y(this,sn,Wr.setTimeout(()=>{T(this,_t).isStale||this.updateResult()},n))},ro=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Se)):this.options.refetchInterval)??!1},no=function(t){Ce(this,De,ao).call(this),Y(this,Lr,t),!(_s.isServer()||Pt(this.options.enabled,T(this,Se))===!1||!Wa(T(this,Lr))||T(this,Lr)===0)&&Y(this,an,Wr.setInterval(()=>{(this.options.refetchIntervalInBackground||Vo.isFocused())&&Ce(this,De,hs).call(this)},T(this,Lr)))},so=function(){Ce(this,De,to).call(this),Ce(this,De,no).call(this,Ce(this,De,ro).call(this))},io=function(){T(this,sn)!==void 0&&(Wr.clearTimeout(T(this,sn)),Y(this,sn,void 0))},ao=function(){T(this,an)!==void 0&&(Wr.clearInterval(T(this,an)),Y(this,an,void 0))},oo=function(){const t=T(this,At).getQueryCache().build(T(this,At),this.options);if(t===T(this,Se))return;const r=T(this,Se);Y(this,Se,t),Y(this,Rs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},xd=function(t){dt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(T(this,_t))}),T(this,At).getQueryCache().notify({query:T(this,Se),type:"observerResultsUpdated"})})},ud);function Hp(e,t){return Pt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pt(t.retryOnMount,e)===!1)}function $l(e,t){return Hp(e,t)||e.state.data!==void 0&&lo(e,t,t.refetchOnMount)}function lo(e,t,r){if(Pt(t.enabled,e)!==!1&&$r(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Qo(e,t)}return!1}function ql(e,t,r,n){return(e!==t||Pt(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Qo(e,r)}function Qo(e,t){return Pt(t.enabled,e)!==!1&&e.isStaleByTime($r(t.staleTime,e))}function Qp(e,t){return!Ya(e.getCurrentResult(),t)}var js,ur,vt,on,dr,Ir,dd,Gp=(dd=class extends wd{constructor(t){super();ae(this,dr);ae(this,js);ae(this,ur);ae(this,vt);ae(this,on);Y(this,js,t.client),this.mutationId=t.mutationId,Y(this,vt,t.mutationCache),Y(this,ur,[]),this.state=t.state||Wp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,ur).includes(t)||(T(this,ur).push(t),this.clearGcTimeout(),T(this,vt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,ur,T(this,ur).filter(r=>r!==t)),this.scheduleGc(),T(this,vt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,ur).length||(this.state.status==="pending"?this.scheduleGc():T(this,vt).remove(this))}continue(){var t;return((t=T(this,on))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,u,d,f,g,p,C,h,y,v,b,w,S,_,E,D;const r=()=>{Ce(this,dr,Ir).call(this,{type:"continue"})},n={client:T(this,js),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,on,bd({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(R,M)=>{Ce(this,dr,Ir).call(this,{type:"failed",failureCount:R,error:M})},onPause:()=>{Ce(this,dr,Ir).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,vt).canRun(this)}));const s=this.state.status==="pending",i=!T(this,on).canStart();try{if(s)r();else{Ce(this,dr,Ir).call(this,{type:"pending",variables:t,isPaused:i}),T(this,vt).config.onMutate&&await T(this,vt).config.onMutate(t,this,n);const M=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,t,n));M!==this.state.context&&Ce(this,dr,Ir).call(this,{type:"pending",context:M,variables:t,isPaused:i})}const R=await T(this,on).start();return await((u=(l=T(this,vt).config).onSuccess)==null?void 0:u.call(l,R,t,this.state.context,this,n)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,R,t,this.state.context,n)),await((p=(g=T(this,vt).config).onSettled)==null?void 0:p.call(g,R,null,this.state.variables,this.state.context,this,n)),await((h=(C=this.options).onSettled)==null?void 0:h.call(C,R,null,t,this.state.context,n)),Ce(this,dr,Ir).call(this,{type:"success",data:R}),R}catch(R){try{await((v=(y=T(this,vt).config).onError)==null?void 0:v.call(y,R,t,this.state.context,this,n))}catch(M){Promise.reject(M)}try{await((w=(b=this.options).onError)==null?void 0:w.call(b,R,t,this.state.context,n))}catch(M){Promise.reject(M)}try{await((_=(S=T(this,vt).config).onSettled)==null?void 0:_.call(S,void 0,R,this.state.variables,this.state.context,this,n))}catch(M){Promise.reject(M)}try{await((D=(E=this.options).onSettled)==null?void 0:D.call(E,void 0,R,t,this.state.context,n))}catch(M){Promise.reject(M)}throw Ce(this,dr,Ir).call(this,{type:"error",error:R}),R}finally{T(this,vt).runNext(this)}}},js=new WeakMap,ur=new WeakMap,vt=new WeakMap,on=new WeakMap,dr=new WeakSet,Ir=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),dt.batch(()=>{T(this,ur).forEach(n=>{n.onMutationUpdate(t)}),T(this,vt).notify({mutation:this,type:"updated",action:t})})},dd);function Wp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var br,Zt,Ls,fd,Kp=(fd=class extends Ps{constructor(t={}){super();ae(this,br);ae(this,Zt);ae(this,Ls);this.config=t,Y(this,br,new Set),Y(this,Zt,new Map),Y(this,Ls,0)}build(t,r,n){const s=new Gp({client:t,mutationCache:this,mutationId:++Ys(this,Ls)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){T(this,br).add(t);const r=Zs(t);if(typeof r=="string"){const n=T(this,Zt).get(r);n?n.push(t):T(this,Zt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,br).delete(t)){const r=Zs(t);if(typeof r=="string"){const n=T(this,Zt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&T(this,Zt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Zs(t);if(typeof r=="string"){const n=T(this,Zt).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Zs(t);if(typeof r=="string"){const s=(n=T(this,Zt).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dt.batch(()=>{T(this,br).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,br).clear(),T(this,Zt).clear()})}getAll(){return Array.from(T(this,br))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>jl(r,n))}findAll(t={}){return this.getAll().filter(r=>jl(t,r))}notify(t){dt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return dt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Dt))))}},br=new WeakMap,Zt=new WeakMap,Ls=new WeakMap,fd);function Zs(e){var t;return(t=e.options.scope)==null?void 0:t.id}var fr,hd,Yp=(hd=class extends Ps{constructor(t={}){super();ae(this,fr);this.config=t,Y(this,fr,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??Ho(s,r);let a=this.get(i);return a||(a=new zp({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){T(this,fr).has(t.queryHash)||(T(this,fr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=T(this,fr).get(t.queryHash);r&&(t.destroy(),r===t&&T(this,fr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,fr).get(t)}getAll(){return[...T(this,fr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>kl(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>kl(t,n)):r}notify(t){dt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fr=new WeakMap,hd),Ye,Pr,Fr,Pn,Fn,Mr,Mn,Bn,pd,Zp=(pd=class{constructor(e={}){ae(this,Ye);ae(this,Pr);ae(this,Fr);ae(this,Pn);ae(this,Fn);ae(this,Mr);ae(this,Mn);ae(this,Bn);Y(this,Ye,e.queryCache||new Yp),Y(this,Pr,e.mutationCache||new Kp),Y(this,Fr,e.defaultOptions||{}),Y(this,Pn,new Map),Y(this,Fn,new Map),Y(this,Mr,0)}mount(){Ys(this,Mr)._++,T(this,Mr)===1&&(Y(this,Mn,Vo.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Ye).onFocus())})),Y(this,Bn,Oi.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Ye).onOnline())})))}unmount(){var e,t;Ys(this,Mr)._--,T(this,Mr)===0&&((e=T(this,Mn))==null||e.call(this),Y(this,Mn,void 0),(t=T(this,Bn))==null||t.call(this),Y(this,Bn,void 0))}isFetching(e){return T(this,Ye).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Pr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=T(this,Ye).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=T(this,Ye).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime($r(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return T(this,Ye).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=T(this,Ye).get(n.queryHash),i=s==null?void 0:s.state.data,a=Np(t,i);if(a!==void 0)return T(this,Ye).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return dt.batch(()=>T(this,Ye).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=T(this,Ye).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=T(this,Ye);dt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=T(this,Ye);return dt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=dt.batch(()=>T(this,Ye).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Dt).catch(Dt)}invalidateQueries(e,t={}){return dt.batch(()=>(T(this,Ye).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=dt.batch(()=>T(this,Ye).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Dt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Dt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=T(this,Ye).build(this,t);return r.isStaleByTime($r(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dt).catch(Dt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dt).catch(Dt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Oi.isOnline()?T(this,Pr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Ye)}getMutationCache(){return T(this,Pr)}getDefaultOptions(){return T(this,Fr)}setDefaultOptions(e){Y(this,Fr,e)}setQueryDefaults(e,t){T(this,Pn).set(Ss(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,Pn).values()],r={};return t.forEach(n=>{xs(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){T(this,Fn).set(Ss(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,Fn).values()],r={};return t.forEach(n=>{xs(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,Fr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ho(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===Ii&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,Fr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Ye).clear(),T(this,Pr).clear()}},Ye=new WeakMap,Pr=new WeakMap,Fr=new WeakMap,Pn=new WeakMap,Fn=new WeakMap,Mr=new WeakMap,Mn=new WeakMap,Bn=new WeakMap,pd),_d=Ae.createContext(void 0),Xp=e=>{const t=Ae.useContext(_d);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Jp=({client:e,children:t})=>(Ae.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(_d.Provider,{value:e,children:t})),Td=Ae.createContext(!1),em=()=>Ae.useContext(Td);Td.Provider;function tm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rm=Ae.createContext(tm()),nm=()=>Ae.useContext(rm),sm=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?yd(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},im=e=>{Ae.useEffect(()=>{e.clearReset()},[e])},am=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||yd(r,[e.error,n])),om=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))}},lm=(e,t)=>e.isLoading&&e.isFetching&&!t,cm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ul=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function um(e,t,r){var p,C,h,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=em(),s=nm(),i=Xp(),a=i.defaultQueryOptions(e);(C=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||C.call(p,a);const o=i.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 l=e.subscribed!==!1;a._optimisticResults=n?"isRestoring":l?"optimistic":void 0,om(a),sm(a,s,o),im(s);const u=!i.getQueryCache().get(a.queryHash),[d]=Ae.useState(()=>new t(i,a)),f=d.getOptimisticResult(a),g=!n&&l;if(Ae.useSyncExternalStore(Ae.useCallback(v=>{const b=g?d.subscribe(dt.batchCalls(v)):Dt;return d.updateResult(),b},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Ae.useEffect(()=>{d.setOptions(a)},[a,d]),cm(a,f))throw Ul(a,d,s);if(am({result:f,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw f.error;if((y=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||y.call(h,a,f),a.experimental_prefetchInRender&&!_s.isServer()&&lm(f,n)){const v=u?Ul(a,d,s):o==null?void 0:o.promise;v==null||v.catch(Dt).finally(()=>{d.updateResult()})}return a.notifyOnChangeProps?f:d.trackResult(f)}function $n(e,t){return um(e,Vp)}let dm={data:""},fm=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||dm},hm=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,pm=/\/\*[^]*?\*\/| +/g,zl=/\n+/g,Nr=(e,t)=>{let r="",n="",s="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+a+";":n+=i[1]=="f"?Nr(a,i):i+"{"+Nr(a,i[1]=="k"?"":t)+"}":typeof a=="object"?n+=Nr(a,t?t.replace(/([^,])+/g,o=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,o):o?o+" "+l:l)):i):a!=null&&(i=i[1]=="-"?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Nr.p?Nr.p(i,a):i+":"+a+";")}return r+(t&&s?t+"{"+s+"}":s)+n},_r={},Ed=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ed(e[r]);return t}return e},mm=(e,t,r,n,s)=>{let i=Ed(e),a=_r[i]||(_r[i]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(i));if(!_r[a]){let l=i!==e?e:(u=>{let d,f,g=[{}];for(;d=hm.exec(u.replace(pm,""));)d[4]?g.shift():d[3]?(f=d[3].replace(zl," ").trim(),g.unshift(g[0][f]=g[0][f]||{})):g[0][d[1]]=d[2].replace(zl," ").trim();return g[0]})(e);_r[a]=Nr(s?{["@keyframes "+a]:l}:l,r?"":"."+a)}let o=r&&_r.g;return r&&(_r.g=_r[a]),((l,u,d,f)=>{f?u.data=u.data.replace(f,l):u.data.indexOf(l)===-1&&(u.data=d?l+u.data:u.data+l)})(_r[a],t,n,o),a},gm=(e,t,r)=>e.reduce((n,s,i)=>{let a=t[i];if(a&&a.call){let o=a(r),l=o&&o.props&&o.props.className||/^go/.test(o)&&o;a=l?"."+l:o&&typeof o=="object"?o.props?"":Nr(o,""):o===!1?"":o}return n+s+(a??"")},"");function Hi(e){let t=this||{},r=e.call?e(t.p):e;return mm(r.unshift?r.raw?gm(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,fm(t.target),t.g,t.o,t.k)}let Id,co,uo;Hi.bind({g:1});let wr=Hi.bind({k:1});function ym(e,t,r,n){Nr.p=t,Id=e,co=r,uo=n}function Ur(e,t){let r=this||{};return function(){let n=arguments;function s(i,a){let o=Object.assign({},i),l=o.className||s.className;r.p=Object.assign({theme:co&&co()},o),r.o=/go\d/.test(l),o.className=Hi.apply(r,n)+(l?" "+l:"");let u=e;return e[0]&&(u=o.as||e,delete o.as),uo&&u[0]&&uo(o),Id(u,o)}return s}}var vm=e=>typeof e=="function",Ai=(e,t)=>vm(e)?e(t):e,bm=(()=>{let e=0;return()=>(++e).toString()})(),Od=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),wm=20,Go="default",Ad=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return Ad(e,{type:e.toasts.find(a=>a.id===n.id)?1:0,toast:n});case 3:let{toastId: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 i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+i}))}}},di=[],Dd={toasts:[],pausedAt:void 0,settings:{toastLimit:wm}},hr={},Nd=(e,t=Go)=>{hr[t]=Ad(hr[t]||Dd,e),di.forEach(([r,n])=>{r===t&&n(hr[t])})},Rd=e=>Object.keys(hr).forEach(t=>Nd(e,t)),Cm=e=>Object.keys(hr).find(t=>hr[t].toasts.some(r=>r.id===e)),Qi=(e=Go)=>t=>{Nd(t,e)},Sm={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},xm=(e={},t=Go)=>{let[r,n]=m.useState(hr[t]||Dd),s=m.useRef(hr[t]);m.useEffect(()=>(s.current!==hr[t]&&n(hr[t]),di.push([t,n]),()=>{let a=di.findIndex(([o])=>o===t);a>-1&&di.splice(a,1)}),[t]);let i=r.toasts.map(a=>{var o,l,u;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((o=e[a.type])==null?void 0:o.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((l=e[a.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||Sm[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...r,toasts:i}},_m=(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)||bm()}),Fs=e=>(t,r)=>{let n=_m(t,e,r);return Qi(n.toasterId||Cm(n.id))({type:2,toast:n}),n.id},tt=(e,t)=>Fs("blank")(e,t);tt.error=Fs("error");tt.success=Fs("success");tt.loading=Fs("loading");tt.custom=Fs("custom");tt.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Qi(t)(r):Rd(r)};tt.dismissAll=e=>tt.dismiss(void 0,e);tt.remove=(e,t)=>{let r={type:4,toastId:e};t?Qi(t)(r):Rd(r)};tt.removeAll=e=>tt.remove(void 0,e);tt.promise=(e,t,r)=>{let n=tt.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?Ai(t.success,s):void 0;return i?tt.success(i,{id:n,...r,...r==null?void 0:r.success}):tt.dismiss(n),s}).catch(s=>{let i=t.error?Ai(t.error,s):void 0;i?tt.error(i,{id:n,...r,...r==null?void 0:r.error}):tt.dismiss(n)}),e};var Tm=1e3,Em=(e,t="default")=>{let{toasts:r,pausedAt:n}=xm(e,t),s=m.useRef(new Map).current,i=m.useCallback((f,g=Tm)=>{if(s.has(f))return;let p=setTimeout(()=>{s.delete(f),a({type:4,toastId:f})},g);s.set(f,p)},[]);m.useEffect(()=>{if(n)return;let f=Date.now(),g=r.map(p=>{if(p.duration===1/0)return;let C=(p.duration||0)+p.pauseDuration-(f-p.createdAt);if(C<0){p.visible&&tt.dismiss(p.id);return}return setTimeout(()=>tt.dismiss(p.id,t),C)});return()=>{g.forEach(p=>p&&clearTimeout(p))}},[r,n,t]);let a=m.useCallback(Qi(t),[t]),o=m.useCallback(()=>{a({type:5,time:Date.now()})},[a]),l=m.useCallback((f,g)=>{a({type:1,toast:{id:f,height:g}})},[a]),u=m.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),d=m.useCallback((f,g)=>{let{reverseOrder:p=!1,gutter:C=8,defaultPosition:h}=g||{},y=r.filter(w=>(w.position||h)===(f.position||h)&&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(...p?[b+1]:[0,b]).reduce((w,S)=>w+(S.height||0)+C,0)},[r]);return m.useEffect(()=>{r.forEach(f=>{if(f.dismissed)i(f.id,f.removeDelay);else{let g=s.get(f.id);g&&(clearTimeout(g),s.delete(f.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:l,startPause:o,endPause:u,calculateOffset:d}}},Im=wr`
1
+ "use strict";var lm=Object.defineProperty;var Xl=e=>{throw TypeError(e)};var cm=(e,t,r)=>t in e?lm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var fs=(e,t,r)=>cm(e,typeof t!="symbol"?t+"":t,r),Po=(e,t,r)=>t.has(e)||Xl("Cannot "+r);var A=(e,t,r)=>(Po(e,t,"read from private field"),r?r.call(e):t.get(e)),fe=(e,t,r)=>t.has(e)?Xl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),X=(e,t,r,n)=>(Po(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),De=(e,t,r)=>(Po(e,t,"access private method"),r);var li=(e,t,r,n)=>({set _(s){X(e,t,s,r)},get _(){return A(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),Ur=require("react-dom"),l=require("react/jsx-runtime");function um(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 Fe=um(m);var Hs=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(){}},rn,Pr,Mn,Od,dm=(Od=class extends Hs{constructor(){super();fe(this,rn);fe(this,Pr);fe(this,Mn);X(this,Mn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){A(this,Pr)||this.setEventListener(A(this,Mn))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,Pr))==null||t.call(this),X(this,Pr,void 0))}setEventListener(t){var r;X(this,Mn,t),(r=A(this,Pr))==null||r.call(this),X(this,Pr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){A(this,rn)!==t&&(X(this,rn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof A(this,rn)=="boolean"?A(this,rn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},rn=new WeakMap,Pr=new WeakMap,Mn=new WeakMap,Od),fl=new dm,fm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hr,nn,Nd,hm=(Nd=class{constructor(){fe(this,hr,fm);fe(this,nn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&A(this,nn)&&e!==A(this,hr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:A(this,hr),provider:e}),X(this,hr,e),process.env.NODE_ENV!=="production"&&X(this,nn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&X(this,nn,!0),A(this,hr).setTimeout(e,t)}clearTimeout(e){A(this,hr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&X(this,nn,!0),A(this,hr).setInterval(e,t)}clearInterval(e){A(this,hr).clearInterval(e)}},hr=new WeakMap,nn=new WeakMap,Nd),Jr=new hm;function pm(e){setTimeout(e,0)}var mm=typeof window>"u"||"Deno"in globalThis;function Ft(){}function gm(e,t){return typeof e=="function"?e(t):e}function ga(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ud(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zr(e,t){return typeof e=="function"?e(t):e}function zt(e,t){return typeof e=="function"?e(t):e}function Jl(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==hl(o,t.options))return!1}else if(!Ds(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function ec(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(ks(t.options.mutationKey)!==ks(i))return!1}else if(!Ds(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function hl(e,t){return((t==null?void 0:t.queryKeyHashFn)||ks)(e)}function ks(e){return JSON.stringify(e,(t,r)=>ba(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Ds(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ds(e[r],t[r])):!1}var vm=Object.prototype.hasOwnProperty;function va(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=tc(e)&&tc(t);if(!n&&!(ba(e)&&ba(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,c=n?new Array(a):{};let u=0;for(let d=0;d<a;d++){const f=n?d:o[d],g=e[f],p=t[f];if(g===p){c[f]=g,(n?d<i:vm.call(e,f))&&u++;continue}if(g===null||p===null||typeof g!="object"||typeof p!="object"){c[f]=p;continue}const b=va(g,p,r+1);c[f]=b,b===g&&u++}return i===a&&u===i?e:c}function ya(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 tc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ba(e){if(!rc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!rc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function rc(e){return Object.prototype.toString.call(e)==="[object Object]"}function ym(e){return new Promise(t=>{Jr.setTimeout(t,e)})}function Ca(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 va(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 va(e,t)}return t}function bm(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Cm(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Bi=Symbol();function zd(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Bi&&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===Bi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vd(e,t){return typeof e=="function"?e(...t):!!e}function Sm(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 Ls=(()=>{let e=()=>mm;return{isServer(){return e()},setIsServer(t){e=t}}})();function Sa(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});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 _m=pm;function wm(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=_m;const i=a=>{t?e.push(a):s(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var yt=wm(),Bn,Rr,qn,jd,xm=(jd=class extends Hs{constructor(){super();fe(this,Bn,!0);fe(this,Rr);fe(this,qn);X(this,qn,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(){A(this,Rr)||this.setEventListener(A(this,qn))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,Rr))==null||t.call(this),X(this,Rr,void 0))}setEventListener(t){var r;X(this,qn,t),(r=A(this,Rr))==null||r.call(this),X(this,Rr,t(this.setOnline.bind(this)))}setOnline(t){A(this,Bn)!==t&&(X(this,Bn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return A(this,Bn)}},Bn=new WeakMap,Rr=new WeakMap,qn=new WeakMap,jd),qi=new xm;function Tm(e){return Math.min(1e3*2**e,3e4)}function Hd(e){return(e??"online")==="online"?qi.isOnline():!0}var _a=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Qd(e){let t=!1,r=0,n;const s=Sa(),i=()=>s.status!=="pending",o=h=>{var v;if(!i()){const y=new _a(h);g(y),(v=e.onCancel)==null||v.call(e,y)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>fl.isFocused()&&(e.networkMode==="always"||qi.isOnline())&&e.canRun(),d=()=>Hd(e.networkMode)&&e.canRun(),f=h=>{i()||(n==null||n(),s.resolve(h))},g=h=>{i()||(n==null||n(),s.reject(h))},p=()=>new Promise(h=>{var v;n=y=>{(i()||u())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,i()||(h=e.onContinue)==null||h.call(e)}),b=()=>{if(i())return;let h;const v=r===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(f).catch(y=>{var E;if(i())return;const C=e.retry??(Ls.isServer()?0:3),S=e.retryDelay??Tm,_=typeof S=="function"?S(r,y):S,x=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,y);if(t||!x){g(y);return}r++,(E=e.onFail)==null||E.call(e,r,y),ym(_).then(()=>u()?void 0:p()).then(()=>{t?g(y):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?b():p().then(b),s)}}var sn,Pd,Wd=(Pd=class{constructor(){fe(this,sn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ga(this.gcTime)&&X(this,sn,Jr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ls.isServer()?1/0:300*1e3))}clearGcTimeout(){A(this,sn)!==void 0&&(Jr.clearTimeout(A(this,sn)),X(this,sn,void 0))}},sn=new WeakMap,Pd);function Em(e){return{onFetch:(t,r)=>{var d,f,g,p,b;const n=t.options,s=(g=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const v=S=>{Sm(S,()=>t.signal,()=>h=!0)},y=zd(t.options,t.fetchOptions),C=async(S,_,x)=>{if(h)return Promise.reject(t.signal.reason);if(_==null&&S.pages.length)return Promise.resolve(S);const D=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:_,direction:x?"backward":"forward",meta:t.options.meta};return v(O),O})(),T=await y(D),{maxPages:j}=t.options,F=x?Cm:bm;return{pages:F(S.pages,T,j),pageParams:F(S.pageParams,_,j)}};if(s&&i.length){const S=s==="backward",_=S?Am:nc,x={pages:i,pageParams:o},E=_(n,x);a=await C(x,E,S)}else{const S=e??i.length;do{const _=c===0?o[0]??n.initialPageParam:nc(n,a);if(c>0&&_==null)break;a=await C(a,_),c++}while(c<S)}return a};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function nc(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 Am(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 $n,on,Un,Zt,an,dt,qs,ln,Ut,Gd,Sr,Rd,Im=(Rd=class extends Wd{constructor(t){super();fe(this,Ut);fe(this,$n);fe(this,on);fe(this,Un);fe(this,Zt);fe(this,an);fe(this,dt);fe(this,qs);fe(this,ln);X(this,ln,!1),X(this,qs,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,an,t.client),X(this,Zt,A(this,an).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,on,ic(this.options)),this.state=t.state??A(this,on),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return A(this,$n)}get promise(){var t;return(t=A(this,dt))==null?void 0:t.promise}setOptions(t){if(this.options={...A(this,qs),...t},t!=null&&t._type&&X(this,$n,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ic(this.options);r.data!==void 0&&(this.setState(sc(r.data,r.dataUpdatedAt)),X(this,on,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,Zt).remove(this)}setData(t,r){const n=Ca(this.state.data,t,this.options);return De(this,Ut,Sr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){De(this,Ut,Sr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=A(this,dt))==null?void 0:n.promise;return(s=A(this,dt))==null||s.cancel(t),r?r.then(Ft).catch(Ft):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,on)}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===Bi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ud(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,dt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,dt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,Zt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(A(this,dt)&&(A(this,ln)||De(this,Ut,Gd).call(this)?A(this,dt).cancel({revert:!0}):A(this,dt).cancelRetry()),this.scheduleGc()),A(this,Zt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,Ut,Sr).call(this,{type:"invalidate"})}async fetch(t,r){var u,d,f,g,p,b,h,v,y,C,S;if(this.state.fetchStatus!=="idle"&&((u=A(this,dt))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(A(this,dt))return A(this,dt).continueRetry(),A(this,dt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(x=>x.options.queryFn);_&&this.setOptions(_.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=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(X(this,ln,!0),n.signal)})},i=()=>{const _=zd(this.options,r),E=(()=>{const D={client:A(this,an),queryKey:this.queryKey,meta:this.meta};return s(D),D})();return X(this,ln,!1),this.options.persister?this.options.persister(_,E,this):_(E)},a=(()=>{const _={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:A(this,an),state:this.state,fetchFn:i};return s(_),_})(),c=A(this,$n)==="infinite"?Em(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),X(this,Un,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&De(this,Ut,Sr).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),X(this,dt,Qd({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:_=>{_ instanceof _a&&_.revert&&this.setState({...A(this,Un),fetchStatus:"idle"}),n.abort()},onFail:(_,x)=>{De(this,Ut,Sr).call(this,{type:"failed",failureCount:_,error:x})},onPause:()=>{De(this,Ut,Sr).call(this,{type:"pause"})},onContinue:()=>{De(this,Ut,Sr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const _=await A(this,dt).start();if(_===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(_),(p=(g=A(this,Zt).config).onSuccess)==null||p.call(g,_,this),(h=(b=A(this,Zt).config).onSettled)==null||h.call(b,_,this.state.error,this),_}catch(_){if(_ instanceof _a){if(_.silent)return A(this,dt).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw De(this,Ut,Sr).call(this,{type:"error",error:_}),(y=(v=A(this,Zt).config).onError)==null||y.call(v,_,this),(S=(C=A(this,Zt).config).onSettled)==null||S.call(C,this.state.data,_,this),_}finally{this.scheduleGc()}}},$n=new WeakMap,on=new WeakMap,Un=new WeakMap,Zt=new WeakMap,an=new WeakMap,dt=new WeakMap,qs=new WeakMap,ln=new WeakMap,Ut=new WeakSet,Gd=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Sr=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,...Kd(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...sc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return X(this,Un,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),A(this,Zt).notify({query:this,type:"updated",action:t})})},Rd);function Kd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ic(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 Rt,Le,$s,Dt,cn,zn,_r,Fr,Us,Vn,Hn,un,dn,Mr,Qn,Me,Ss,wa,xa,Ta,Ea,Aa,Ia,ka,Yd,Fd,km=(Fd=class extends Hs{constructor(t,r){super();fe(this,Me);fe(this,Rt);fe(this,Le);fe(this,$s);fe(this,Dt);fe(this,cn);fe(this,zn);fe(this,_r);fe(this,Fr);fe(this,Us);fe(this,Vn);fe(this,Hn);fe(this,un);fe(this,dn);fe(this,Mr);fe(this,Qn,new Set);this.options=r,X(this,Rt,t),X(this,Fr,null),X(this,_r,Sa()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(A(this,Le).addObserver(this),oc(A(this,Le),this.options)?De(this,Me,Ss).call(this):this.updateResult(),De(this,Me,Ea).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Da(A(this,Le),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Da(A(this,Le),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,Me,Aa).call(this),De(this,Me,Ia).call(this),A(this,Le).removeObserver(this)}setOptions(t){const r=this.options,n=A(this,Le);if(this.options=A(this,Rt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zt(this.options.enabled,A(this,Le))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,Me,ka).call(this),A(this,Le).setOptions(this.options),r._defaulted&&!ya(this.options,r)&&A(this,Rt).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,Le),observer:this});const s=this.hasListeners();s&&ac(A(this,Le),n,this.options,r)&&De(this,Me,Ss).call(this),this.updateResult(),s&&(A(this,Le)!==n||zt(this.options.enabled,A(this,Le))!==zt(r.enabled,A(this,Le))||zr(this.options.staleTime,A(this,Le))!==zr(r.staleTime,A(this,Le)))&&De(this,Me,wa).call(this);const i=De(this,Me,xa).call(this);s&&(A(this,Le)!==n||zt(this.options.enabled,A(this,Le))!==zt(r.enabled,A(this,Le))||i!==A(this,Mr))&&De(this,Me,Ta).call(this,i)}getOptimisticResult(t){const r=A(this,Rt).getQueryCache().build(A(this,Rt),t),n=this.createResult(r,t);return Lm(this,n)&&(X(this,Dt,n),X(this,zn,this.options),X(this,cn,A(this,Le).state)),n}getCurrentResult(){return A(this,Dt)}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&&A(this,_r).status==="pending"&&A(this,_r).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){A(this,Qn).add(t)}getCurrentQuery(){return A(this,Le)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=A(this,Rt).defaultQueryOptions(t),n=A(this,Rt).getQueryCache().build(A(this,Rt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return De(this,Me,Ss).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,Dt)))}createResult(t,r){var j;const n=A(this,Le),s=this.options,i=A(this,Dt),o=A(this,cn),a=A(this,zn),u=t!==n?t.state:A(this,$s),{state:d}=t;let f={...d},g=!1,p;if(r._optimisticResults){const F=this.hasListeners(),O=!F&&oc(t,r),N=F&&ac(t,n,r,s);(O||N)&&(f={...f,...Kd(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:h,status:v}=f;p=f.data;let y=!1;if(r.placeholderData!==void 0&&p===void 0&&v==="pending"){let F;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(F=i.data,y=!0):F=typeof r.placeholderData=="function"?r.placeholderData((j=A(this,Hn))==null?void 0:j.state.data,A(this,Hn)):r.placeholderData,F!==void 0&&(v="success",p=Ca(i==null?void 0:i.data,F,r),g=!0)}if(r.select&&p!==void 0&&!y)if(i&&p===(o==null?void 0:o.data)&&r.select===A(this,Us))p=A(this,Vn);else try{X(this,Us,r.select),p=r.select(p),p=Ca(i==null?void 0:i.data,p,r),X(this,Vn,p),X(this,Fr,null)}catch(F){X(this,Fr,F)}A(this,Fr)&&(b=A(this,Fr),p=A(this,Vn),h=Date.now(),v="error");const C=f.fetchStatus==="fetching",S=v==="pending",_=v==="error",x=S&&C,E=p!==void 0,T={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:_,isInitialLoading:x,isLoading:x,data:p,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:_&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:_&&E,isStale:pl(t,r),refetch:this.refetch,promise:A(this,_r),isEnabled:zt(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=T.data!==void 0,O=T.status==="error"&&!F,N=U=>{O?U.reject(T.error):F&&U.resolve(T.data)},B=()=>{const U=X(this,_r,T.promise=Sa());N(U)},P=A(this,_r);switch(P.status){case"pending":t.queryHash===n.queryHash&&N(P);break;case"fulfilled":(O||T.data!==P.value)&&B();break;case"rejected":(!O||T.error!==P.reason)&&B();break}}return T}updateResult(){const t=A(this,Dt),r=this.createResult(A(this,Le),this.options);if(X(this,cn,A(this,Le).state),X(this,zn,this.options),A(this,cn).data!==void 0&&X(this,Hn,A(this,Le)),ya(r,t))return;X(this,Dt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!A(this,Qn).size)return!0;const o=new Set(i??A(this,Qn));return this.options.throwOnError&&o.add("error"),Object.keys(A(this,Dt)).some(a=>{const c=a;return A(this,Dt)[c]!==t[c]&&o.has(c)})};De(this,Me,Yd).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,Me,Ea).call(this)}},Rt=new WeakMap,Le=new WeakMap,$s=new WeakMap,Dt=new WeakMap,cn=new WeakMap,zn=new WeakMap,_r=new WeakMap,Fr=new WeakMap,Us=new WeakMap,Vn=new WeakMap,Hn=new WeakMap,un=new WeakMap,dn=new WeakMap,Mr=new WeakMap,Qn=new WeakMap,Me=new WeakSet,Ss=function(t){De(this,Me,ka).call(this);let r=A(this,Le).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Ft)),r},wa=function(){De(this,Me,Aa).call(this);const t=zr(this.options.staleTime,A(this,Le));if(Ls.isServer()||A(this,Dt).isStale||!ga(t))return;const n=Ud(A(this,Dt).dataUpdatedAt,t)+1;X(this,un,Jr.setTimeout(()=>{A(this,Dt).isStale||this.updateResult()},n))},xa=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,Le)):this.options.refetchInterval)??!1},Ta=function(t){De(this,Me,Ia).call(this),X(this,Mr,t),!(Ls.isServer()||zt(this.options.enabled,A(this,Le))===!1||!ga(A(this,Mr))||A(this,Mr)===0)&&X(this,dn,Jr.setInterval(()=>{(this.options.refetchIntervalInBackground||fl.isFocused())&&De(this,Me,Ss).call(this)},A(this,Mr)))},Ea=function(){De(this,Me,wa).call(this),De(this,Me,Ta).call(this,De(this,Me,xa).call(this))},Aa=function(){A(this,un)!==void 0&&(Jr.clearTimeout(A(this,un)),X(this,un,void 0))},Ia=function(){A(this,dn)!==void 0&&(Jr.clearInterval(A(this,dn)),X(this,dn,void 0))},ka=function(){const t=A(this,Rt).getQueryCache().build(A(this,Rt),this.options);if(t===A(this,Le))return;const r=A(this,Le);X(this,Le,t),X(this,$s,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Yd=function(t){yt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(A(this,Dt))}),A(this,Rt).getQueryCache().notify({query:A(this,Le),type:"observerResultsUpdated"})})},Fd);function Dm(e,t){return zt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&zt(t.retryOnMount,e)===!1)}function oc(e,t){return Dm(e,t)||e.state.data!==void 0&&Da(e,t,t.refetchOnMount)}function Da(e,t,r){if(zt(t.enabled,e)!==!1&&zr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&pl(e,t)}return!1}function ac(e,t,r,n){return(e!==t||zt(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&pl(e,r)}function pl(e,t){return zt(t.enabled,e)!==!1&&e.isStaleByTime(zr(t.staleTime,e))}function Lm(e,t){return!ya(e.getCurrentResult(),t)}var zs,pr,Tt,fn,mr,Dr,Md,Om=(Md=class extends Wd{constructor(t){super();fe(this,mr);fe(this,zs);fe(this,pr);fe(this,Tt);fe(this,fn);X(this,zs,t.client),this.mutationId=t.mutationId,X(this,Tt,t.mutationCache),X(this,pr,[]),this.state=t.state||Nm(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,pr).includes(t)||(A(this,pr).push(t),this.clearGcTimeout(),A(this,Tt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,pr,A(this,pr).filter(r=>r!==t)),this.scheduleGc(),A(this,Tt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,pr).length||(this.state.status==="pending"?this.scheduleGc():A(this,Tt).remove(this))}continue(){var t;return((t=A(this,fn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,c,u,d,f,g,p,b,h,v,y,C,S,_,x,E,D;const r=()=>{De(this,mr,Dr).call(this,{type:"continue"})},n={client:A(this,zs),meta:this.options.meta,mutationKey:this.options.mutationKey};X(this,fn,Qd({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(T,j)=>{De(this,mr,Dr).call(this,{type:"failed",failureCount:T,error:j})},onPause:()=>{De(this,mr,Dr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,Tt).canRun(this)}));const s=this.state.status==="pending",i=!A(this,fn).canStart();try{if(s)r();else{De(this,mr,Dr).call(this,{type:"pending",variables:t,isPaused:i}),A(this,Tt).config.onMutate&&await A(this,Tt).config.onMutate(t,this,n);const j=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,n));j!==this.state.context&&De(this,mr,Dr).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const T=await A(this,fn).start();return await((u=(c=A(this,Tt).config).onSuccess)==null?void 0:u.call(c,T,t,this.state.context,this,n)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,T,t,this.state.context,n)),await((p=(g=A(this,Tt).config).onSettled)==null?void 0:p.call(g,T,null,this.state.variables,this.state.context,this,n)),await((h=(b=this.options).onSettled)==null?void 0:h.call(b,T,null,t,this.state.context,n)),De(this,mr,Dr).call(this,{type:"success",data:T}),T}catch(T){try{await((y=(v=A(this,Tt).config).onError)==null?void 0:y.call(v,T,t,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,T,t,this.state.context,n))}catch(j){Promise.reject(j)}try{await((x=(_=A(this,Tt).config).onSettled)==null?void 0:x.call(_,void 0,T,this.state.variables,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((D=(E=this.options).onSettled)==null?void 0:D.call(E,void 0,T,t,this.state.context,n))}catch(j){Promise.reject(j)}throw De(this,mr,Dr).call(this,{type:"error",error:T}),T}finally{A(this,Tt).runNext(this)}}},zs=new WeakMap,pr=new WeakMap,Tt=new WeakMap,fn=new WeakMap,mr=new WeakSet,Dr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),yt.batch(()=>{A(this,pr).forEach(n=>{n.onMutationUpdate(t)}),A(this,Tt).notify({mutation:this,type:"updated",action:t})})},Md);function Nm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wr,sr,Vs,Bd,jm=(Bd=class extends Hs{constructor(t={}){super();fe(this,wr);fe(this,sr);fe(this,Vs);this.config=t,X(this,wr,new Set),X(this,sr,new Map),X(this,Vs,0)}build(t,r,n){const s=new Om({client:t,mutationCache:this,mutationId:++li(this,Vs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){A(this,wr).add(t);const r=ci(t);if(typeof r=="string"){const n=A(this,sr).get(r);n?n.push(t):A(this,sr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(A(this,wr).delete(t)){const r=ci(t);if(typeof r=="string"){const n=A(this,sr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&A(this,sr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ci(t);if(typeof r=="string"){const n=A(this,sr).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=ci(t);if(typeof r=="string"){const s=(n=A(this,sr).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){yt.batch(()=>{A(this,wr).forEach(t=>{this.notify({type:"removed",mutation:t})}),A(this,wr).clear(),A(this,sr).clear()})}getAll(){return Array.from(A(this,wr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ec(r,n))}findAll(t={}){return this.getAll().filter(r=>ec(t,r))}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return yt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Ft))))}},wr=new WeakMap,sr=new WeakMap,Vs=new WeakMap,Bd);function ci(e){var t;return(t=e.options.scope)==null?void 0:t.id}var gr,qd,Pm=(qd=class extends Hs{constructor(t={}){super();fe(this,gr);this.config=t,X(this,gr,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??hl(s,r);let o=this.get(i);return o||(o=new Im({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){A(this,gr).has(t.queryHash)||(A(this,gr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=A(this,gr).get(t.queryHash);r&&(t.destroy(),r===t&&A(this,gr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,gr).get(t)}getAll(){return[...A(this,gr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Jl(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Jl(t,n)):r}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},gr=new WeakMap,qd),et,Br,qr,Wn,Gn,$r,Kn,Yn,$d,Rm=($d=class{constructor(e={}){fe(this,et);fe(this,Br);fe(this,qr);fe(this,Wn);fe(this,Gn);fe(this,$r);fe(this,Kn);fe(this,Yn);X(this,et,e.queryCache||new Pm),X(this,Br,e.mutationCache||new jm),X(this,qr,e.defaultOptions||{}),X(this,Wn,new Map),X(this,Gn,new Map),X(this,$r,0)}mount(){li(this,$r)._++,A(this,$r)===1&&(X(this,Kn,fl.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,et).onFocus())})),X(this,Yn,qi.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,et).onOnline())})))}unmount(){var e,t;li(this,$r)._--,A(this,$r)===0&&((e=A(this,Kn))==null||e.call(this),X(this,Kn,void 0),(t=A(this,Yn))==null||t.call(this),X(this,Yn,void 0))}isFetching(e){return A(this,et).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,Br).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,et).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=A(this,et).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(zr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return A(this,et).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=A(this,et).get(n.queryHash),i=s==null?void 0:s.state.data,o=gm(t,i);if(o!==void 0)return A(this,et).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return yt.batch(()=>A(this,et).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,et).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=A(this,et);yt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=A(this,et);return yt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=yt.batch(()=>A(this,et).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Ft).catch(Ft)}invalidateQueries(e,t={}){return yt.batch(()=>(A(this,et).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=yt.batch(()=>A(this,et).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Ft)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Ft)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=A(this,et).build(this,t);return r.isStaleByTime(zr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ft).catch(Ft)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ft).catch(Ft)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return qi.isOnline()?A(this,Br).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,et)}getMutationCache(){return A(this,Br)}getDefaultOptions(){return A(this,qr)}setDefaultOptions(e){X(this,qr,e)}setQueryDefaults(e,t){A(this,Wn).set(ks(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,Wn).values()],r={};return t.forEach(n=>{Ds(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){A(this,Gn).set(ks(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,Gn).values()],r={};return t.forEach(n=>{Ds(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,qr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=hl(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===Bi&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,qr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,et).clear(),A(this,Br).clear()}},et=new WeakMap,Br=new WeakMap,qr=new WeakMap,Wn=new WeakMap,Gn=new WeakMap,$r=new WeakMap,Kn=new WeakMap,Yn=new WeakMap,$d),Zd=Fe.createContext(void 0),Fm=e=>{const t=Fe.useContext(Zd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Mm=({client:e,children:t})=>(Fe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Zd.Provider,{value:e,children:t})),Xd=Fe.createContext(!1),Bm=()=>Fe.useContext(Xd);Xd.Provider;function qm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $m=Fe.createContext(qm()),Um=()=>Fe.useContext($m),zm=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Vd(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Vm=e=>{Fe.useEffect(()=>{e.clearReset()},[e])},Hm=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Vd(r,[e.error,n])),Qm=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))}},Wm=(e,t)=>e.isLoading&&e.isFetching&&!t,Gm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,lc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Km(e,t,r){var p,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=Bm(),s=Um(),i=Fm(),o=i.defaultQueryOptions(e);(b=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||b.call(p,o);const a=i.getQueryCache().get(o.queryHash);process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.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;o._optimisticResults=n?"isRestoring":c?"optimistic":void 0,Qm(o),zm(o,s,a),Vm(s);const u=!i.getQueryCache().get(o.queryHash),[d]=Fe.useState(()=>new t(i,o)),f=d.getOptimisticResult(o),g=!n&&c;if(Fe.useSyncExternalStore(Fe.useCallback(y=>{const C=g?d.subscribe(yt.batchCalls(y)):Ft;return d.updateResult(),C},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Fe.useEffect(()=>{d.setOptions(o)},[o,d]),Gm(o,f))throw lc(o,d,s);if(Hm({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw f.error;if((v=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,o,f),o.experimental_prefetchInRender&&!Ls.isServer()&&Wm(f,n)){const y=u?lc(o,d,s):a==null?void 0:a.promise;y==null||y.catch(Ft).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?f:d.trackResult(f)}function Zn(e,t){return Km(e,km)}let Ym={data:""},Zm=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||Ym},Xm=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Jm=/\/\*[^]*?\*\/| +/g,cc=/\n+/g,jr=(e,t)=>{let r="",n="",s="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+o+";":n+=i[1]=="f"?jr(o,i):i+"{"+jr(o,i[1]=="k"?"":t)+"}":typeof o=="object"?n+=jr(o,t?t.replace(/([^,])+/g,a=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):i):o!=null&&(i=i[1]=="-"?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=jr.p?jr.p(i,o):i+":"+o+";")}return r+(t&&s?t+"{"+s+"}":s)+n},Ar={},Jd=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Jd(e[r]);return t}return e},eg=(e,t,r,n,s)=>{let i=Jd(e),o=Ar[i]||(Ar[i]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(i));if(!Ar[o]){let c=i!==e?e:(u=>{let d,f,g=[{}];for(;d=Xm.exec(u.replace(Jm,""));)d[4]?g.shift():d[3]?(f=d[3].replace(cc," ").trim(),g.unshift(g[0][f]=g[0][f]||{})):g[0][d[1]]=d[2].replace(cc," ").trim();return g[0]})(e);Ar[o]=jr(s?{["@keyframes "+o]:c}:c,r?"":"."+o)}let a=r&&Ar.g;return r&&(Ar.g=Ar[o]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(Ar[o],t,n,a),o},tg=(e,t,r)=>e.reduce((n,s,i)=>{let o=t[i];if(o&&o.call){let a=o(r),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=c?"."+c:a&&typeof a=="object"?a.props?"":jr(a,""):a===!1?"":a}return n+s+(o??"")},"");function oo(e){let t=this||{},r=e.call?e(t.p):e;return eg(r.unshift?r.raw?tg(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,Zm(t.target),t.g,t.o,t.k)}let ef,La,Oa;oo.bind({g:1});let xr=oo.bind({k:1});function rg(e,t,r,n){jr.p=t,ef=e,La=r,Oa=n}function Qr(e,t){let r=this||{};return function(){let n=arguments;function s(i,o){let a=Object.assign({},i),c=a.className||s.className;r.p=Object.assign({theme:La&&La()},a),r.o=/go\d/.test(c),a.className=oo.apply(r,n)+(c?" "+c:"");let u=e;return e[0]&&(u=a.as||e,delete a.as),Oa&&u[0]&&Oa(a),ef(u,a)}return s}}var ng=e=>typeof e=="function",$i=(e,t)=>ng(e)?e(t):e,sg=(()=>{let e=0;return()=>(++e).toString()})(),tf=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),ig=20,ml="default",rf=(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(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return rf(e,{type:e.toasts.find(o=>o.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},wi=[],nf={toasts:[],pausedAt:void 0,settings:{toastLimit:ig}},vr={},sf=(e,t=ml)=>{vr[t]=rf(vr[t]||nf,e),wi.forEach(([r,n])=>{r===t&&n(vr[t])})},of=e=>Object.keys(vr).forEach(t=>sf(e,t)),og=e=>Object.keys(vr).find(t=>vr[t].toasts.some(r=>r.id===e)),ao=(e=ml)=>t=>{sf(t,e)},ag={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},lg=(e={},t=ml)=>{let[r,n]=m.useState(vr[t]||nf),s=m.useRef(vr[t]);m.useEffect(()=>(s.current!==vr[t]&&n(vr[t]),wi.push([t,n]),()=>{let o=wi.findIndex(([a])=>a===t);o>-1&&wi.splice(o,1)}),[t]);let i=r.toasts.map(o=>{var a,c,u;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((a=e[o.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((c=e[o.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||ag[o.type],style:{...e.style,...(u=e[o.type])==null?void 0:u.style,...o.style}}});return{...r,toasts:i}},cg=(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)||sg()}),Qs=e=>(t,r)=>{let n=cg(t,e,r);return ao(n.toasterId||og(n.id))({type:2,toast:n}),n.id},at=(e,t)=>Qs("blank")(e,t);at.error=Qs("error");at.success=Qs("success");at.loading=Qs("loading");at.custom=Qs("custom");at.dismiss=(e,t)=>{let r={type:3,toastId:e};t?ao(t)(r):of(r)};at.dismissAll=e=>at.dismiss(void 0,e);at.remove=(e,t)=>{let r={type:4,toastId:e};t?ao(t)(r):of(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 i=t.success?$i(t.success,s):void 0;return i?at.success(i,{id:n,...r,...r==null?void 0:r.success}):at.dismiss(n),s}).catch(s=>{let i=t.error?$i(t.error,s):void 0;i?at.error(i,{id:n,...r,...r==null?void 0:r.error}):at.dismiss(n)}),e};var ug=1e3,dg=(e,t="default")=>{let{toasts:r,pausedAt:n}=lg(e,t),s=m.useRef(new Map).current,i=m.useCallback((f,g=ug)=>{if(s.has(f))return;let p=setTimeout(()=>{s.delete(f),o({type:4,toastId:f})},g);s.set(f,p)},[]);m.useEffect(()=>{if(n)return;let f=Date.now(),g=r.map(p=>{if(p.duration===1/0)return;let b=(p.duration||0)+p.pauseDuration-(f-p.createdAt);if(b<0){p.visible&&at.dismiss(p.id);return}return setTimeout(()=>at.dismiss(p.id,t),b)});return()=>{g.forEach(p=>p&&clearTimeout(p))}},[r,n,t]);let o=m.useCallback(ao(t),[t]),a=m.useCallback(()=>{o({type:5,time:Date.now()})},[o]),c=m.useCallback((f,g)=>{o({type:1,toast:{id:f,height:g}})},[o]),u=m.useCallback(()=>{n&&o({type:6,time:Date.now()})},[n,o]),d=m.useCallback((f,g)=>{let{reverseOrder:p=!1,gutter:b=8,defaultPosition:h}=g||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),y=v.findIndex(S=>S.id===f.id),C=v.filter((S,_)=>_<y&&S.visible).length;return v.filter(S=>S.visible).slice(...p?[C+1]:[0,C]).reduce((S,_)=>S+(_.height||0)+b,0)},[r]);return m.useEffect(()=>{r.forEach(f=>{if(f.dismissed)i(f.id,f.removeDelay);else{let g=s.get(f.id);g&&(clearTimeout(g),s.delete(f.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:a,endPause:u,calculateOffset:d}}},fg=xr`
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
- }`,Om=wr`
9
+ }`,hg=xr`
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
- }`,Am=wr`
17
+ }`,pg=xr`
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
- }`,Dm=Ur("div")`
25
+ }`,mg=Qr("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: ${Im} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
34
+ animation: ${fg} 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: ${Om} 0.15s ease-out forwards;
41
+ animation: ${hg} 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: ${Am} 0.15s ease-out forwards;
54
+ animation: ${pg} 0.15s ease-out forwards;
55
55
  animation-delay: 180ms;
56
56
  transform: rotate(90deg);
57
57
  }
58
- `,Nm=wr`
58
+ `,gg=xr`
59
59
  from {
60
60
  transform: rotate(0deg);
61
61
  }
62
62
  to {
63
63
  transform: rotate(360deg);
64
64
  }
65
- `,Rm=Ur("div")`
65
+ `,vg=Qr("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: ${Nm} 1s linear infinite;
74
- `,km=wr`
73
+ animation: ${gg} 1s linear infinite;
74
+ `,yg=xr`
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
- }`,jm=wr`
82
+ }`,bg=xr`
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
- }`,Lm=Ur("div")`
96
+ }`,Cg=Qr("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: ${km} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
105
+ animation: ${yg} 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: ${jm} 0.2s ease-out forwards;
111
+ animation: ${bg} 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
- `,Pm=Ur("div")`
123
+ `,Sg=Qr("div")`
124
124
  position: absolute;
125
- `,Fm=Ur("div")`
125
+ `,_g=Qr("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
- `,Mm=wr`
132
+ `,wg=xr`
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
- }`,Bm=Ur("div")`
140
+ }`,xg=Qr("div")`
141
141
  position: relative;
142
142
  transform: scale(0.6);
143
143
  opacity: 0.4;
144
144
  min-width: 20px;
145
- animation: ${Mm} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
145
+ animation: ${wg} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
146
146
  forwards;
147
- `,$m=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?Ae.createElement(Bm,null,t):t:r==="blank"?null:Ae.createElement(Fm,null,Ae.createElement(Rm,{...n}),r!=="loading"&&Ae.createElement(Pm,null,r==="error"?Ae.createElement(Dm,{...n}):Ae.createElement(Lm,{...n})))},qm=e=>`
147
+ `,Tg=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?Fe.createElement(xg,null,t):t:r==="blank"?null:Fe.createElement(_g,null,Fe.createElement(vg,{...n}),r!=="loading"&&Fe.createElement(Sg,null,r==="error"?Fe.createElement(mg,{...n}):Fe.createElement(Cg,{...n})))},Eg=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
- `,Um=e=>`
150
+ `,Ag=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
- `,zm="0%{opacity:0;} 100%{opacity:1;}",Vm="0%{opacity:1;} 100%{opacity:0;}",Hm=Ur("div")`
153
+ `,Ig="0%{opacity:0;} 100%{opacity:1;}",kg="0%{opacity:1;} 100%{opacity:0;}",Dg=Qr("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
- `,Qm=Ur("div")`
165
+ `,Lg=Qr("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
- `,Gm=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=Od()?[zm,Vm]:[qm(r),Um(r)];return{animation:t?`${wr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${wr(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Wm=Ae.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?Gm(e.position||t||"top-center",e.visible):{opacity:0},i=Ae.createElement($m,{toast:e}),a=Ae.createElement(Qm,{...e.ariaProps},Ai(e.message,e));return Ae.createElement(Hm,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:i,message:a}):Ae.createElement(Ae.Fragment,null,i,a))});ym(Ae.createElement);var Km=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let i=Ae.useCallback(a=>{if(a){let o=()=>{let l=a.getBoundingClientRect().height;n(e,l)};o(),new MutationObserver(o).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return Ae.createElement("div",{ref:i,className:t,style:r},s)},Ym=(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:Od()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},Zm=Hi`
172
+ `,Og=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=tf()?[Ig,kg]:[Eg(r),Ag(r)];return{animation:t?`${xr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${xr(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Ng=Fe.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?Og(e.position||t||"top-center",e.visible):{opacity:0},i=Fe.createElement(Tg,{toast:e}),o=Fe.createElement(Lg,{...e.ariaProps},$i(e.message,e));return Fe.createElement(Dg,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:i,message:o}):Fe.createElement(Fe.Fragment,null,i,o))});rg(Fe.createElement);var jg=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let i=Fe.useCallback(o=>{if(o){let a=()=>{let c=o.getBoundingClientRect().height;n(e,c)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return Fe.createElement("div",{ref:i,className:t,style:r},s)},Pg=(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:tf()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},Rg=oo`
173
173
  z-index: 9999;
174
174
  > * {
175
175
  pointer-events: auto;
176
176
  }
177
- `,Xs=16,Xm=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:i,containerStyle:a,containerClassName:o})=>{let{toasts:l,handlers:u}=Em(r,i);return Ae.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Xs,left:Xs,right:Xs,bottom:Xs,pointerEvents:"none",...a},className:o,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let f=d.position||t,g=u.calculateOffset(d,{reverseOrder:e,gutter:n,defaultPosition:t}),p=Ym(f,g);return Ae.createElement(Km,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Zm:"",style:p},d.type==="custom"?Ai(d.message,d):s?s(d):Ae.createElement(Wm,{toast:d,position:f}))}))},Ee=tt;function Jm(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return m.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const Gi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Hn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Wo(e){return"nodeType"in e}function Tt(e){var t,r;return e?Hn(e)?e:Wo(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Ko(e){const{Document:t}=Tt(e);return e instanceof t}function Ms(e){return Hn(e)?!1:e instanceof Tt(e).HTMLElement}function kd(e){return e instanceof Tt(e).SVGElement}function Qn(e){return e?Hn(e)?e.document:Wo(e)?Ko(e)?e:Ms(e)||kd(e)?e.ownerDocument:document:document:document}const Jt=Gi?m.useLayoutEffect:m.useEffect;function Wi(e){const t=m.useRef(e);return Jt(()=>{t.current=e}),m.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 eg(){const e=m.useRef(null),t=m.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Ts(e,t){t===void 0&&(t=[e]);const r=m.useRef(e);return Jt(()=>{r.current!==e&&(r.current=e)},t),r}function Bs(e,t){const r=m.useRef();return m.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Di(e){const t=Wi(e),r=m.useRef(null),n=m.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function Ni(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let ga={};function $s(e,t){return m.useMemo(()=>{if(t)return t;const r=ga[e]==null?0:ga[e]+1;return ga[e]=r,e+"-"+r},[e,t])}function jd(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((i,a)=>{const o=Object.entries(a);for(const[l,u]of o){const d=i[l];d!=null&&(i[l]=d+e*u)}return i},{...t})}}const En=jd(1),Es=jd(-1);function tg(e){return"clientX"in e&&"clientY"in e}function Ki(e){if(!e)return!1;const{KeyboardEvent:t}=Tt(e.target);return t&&e instanceof t}function rg(e){if(!e)return!1;const{TouchEvent:t}=Tt(e.target);return t&&e instanceof t}function Ri(e){if(rg(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 tg(e)?{x:e.clientX,y:e.clientY}:null}const qr=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[qr.Translate.toString(e),qr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Vl="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ng(e){return e.matches(Vl)?e:e.querySelector(Vl)}const sg={display:"none"};function ig(e){let{id:t,value:r}=e;return m.createElement("div",{id:t,style:sg},r)}function ag(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 m.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function og(){const[e,t]=m.useState("");return{announce:m.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Ld=m.createContext(null);function lg(e){const t=m.useContext(Ld);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function cg(){const[e]=m.useState(()=>new Set),t=m.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[m.useCallback(n=>{let{type:s,event:i}=n;e.forEach(a=>{var o;return(o=a[s])==null?void 0:o.call(a,i)})},[e]),t]}const ug={draggable:`
177
+ `,ui=16,Fg=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:i,containerStyle:o,containerClassName:a})=>{let{toasts:c,handlers:u}=dg(r,i);return Fe.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:ui,left:ui,right:ui,bottom:ui,pointerEvents:"none",...o},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},c.map(d=>{let f=d.position||t,g=u.calculateOffset(d,{reverseOrder:e,gutter:n,defaultPosition:t}),p=Pg(f,g);return Fe.createElement(jg,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Rg:"",style:p},d.type==="custom"?$i(d.message,d):s?s(d):Fe.createElement(Ng,{toast:d,position:f}))}))},we=at;function Mg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return m.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const lo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rs(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function gl(e){return"nodeType"in e}function Lt(e){var t,r;return e?rs(e)?e:gl(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function vl(e){const{Document:t}=Lt(e);return e instanceof t}function Ws(e){return rs(e)?!1:e instanceof Lt(e).HTMLElement}function af(e){return e instanceof Lt(e).SVGElement}function ns(e){return e?rs(e)?e.document:gl(e)?vl(e)?e:Ws(e)||af(e)?e.ownerDocument:document:document:document}const or=lo?m.useLayoutEffect:m.useEffect;function co(e){const t=m.useRef(e);return or(()=>{t.current=e}),m.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 Bg(){const e=m.useRef(null),t=m.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Os(e,t){t===void 0&&(t=[e]);const r=m.useRef(e);return or(()=>{r.current!==e&&(r.current=e)},t),r}function Gs(e,t){const r=m.useRef();return m.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Ui(e){const t=co(e),r=m.useRef(null),n=m.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function zi(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let Ro={};function Ks(e,t){return m.useMemo(()=>{if(t)return t;const r=Ro[e]==null?0:Ro[e]+1;return Ro[e]=r,e+"-"+r},[e,t])}function lf(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((i,o)=>{const a=Object.entries(o);for(const[c,u]of a){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const Fn=lf(1),Ns=lf(-1);function qg(e){return"clientX"in e&&"clientY"in e}function uo(e){if(!e)return!1;const{KeyboardEvent:t}=Lt(e.target);return t&&e instanceof t}function $g(e){if(!e)return!1;const{TouchEvent:t}=Lt(e.target);return t&&e instanceof t}function Vi(e){if($g(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 qg(e)?{x:e.clientX,y:e.clientY}:null}const Vr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Vr.Translate.toString(e),Vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),uc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ug(e){return e.matches(uc)?e:e.querySelector(uc)}const zg={display:"none"};function Vg(e){let{id:t,value:r}=e;return m.createElement("div",{id:t,style:zg},r)}function Hg(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 m.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function Qg(){const[e,t]=m.useState("");return{announce:m.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const cf=m.createContext(null);function Wg(e){const t=m.useContext(cf);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Gg(){const[e]=m.useState(()=>new Set),t=m.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[m.useCallback(n=>{let{type:s,event:i}=n;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const Kg={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
- `},dg={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 fg(e){let{announcements:t=dg,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=ug}=e;const{announce:i,announcement:a}=og(),o=$s("DndLiveRegion"),[l,u]=m.useState(!1);if(m.useEffect(()=>{u(!0)},[]),lg(m.useMemo(()=>({onDragStart(f){let{active:g}=f;i(t.onDragStart({active:g}))},onDragMove(f){let{active:g,over:p}=f;t.onDragMove&&i(t.onDragMove({active:g,over:p}))},onDragOver(f){let{active:g,over:p}=f;i(t.onDragOver({active:g,over:p}))},onDragEnd(f){let{active:g,over:p}=f;i(t.onDragEnd({active:g,over:p}))},onDragCancel(f){let{active:g,over:p}=f;i(t.onDragCancel({active:g,over:p}))}}),[i,t])),!l)return null;const d=m.createElement(m.Fragment,null,m.createElement(ig,{id:n,value:s.draggable}),m.createElement(ag,{id:o,announcement:a}));return r?Br.createPortal(d,r):d}var et;(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"})(et||(et={}));function ki(){}function fo(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Pd(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return m.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const er=Object.freeze({x:0,y:0});function Fd(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function hg(e,t){const r=Ri(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 Md(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function pg(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Hl(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 Bd(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Ql(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 mg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Ql(t,t.left,t.top),i=[];for(const a of n){const{id:o}=a,l=r.get(o);if(l){const u=Fd(Ql(l),s);i.push({id:o,data:{droppableContainer:a,value:u}})}}return i.sort(Md)},gg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Hl(t),i=[];for(const a of n){const{id:o}=a,l=r.get(o);if(l){const u=Hl(l),d=s.reduce((g,p,C)=>g+Fd(u[C],p),0),f=Number((d/4).toFixed(4));i.push({id:o,data:{droppableContainer:a,value:f}})}}return i.sort(Md)};function yg(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),i=Math.min(t.top+t.height,e.top+e.height),a=s-n,o=i-r;if(n<s&&r<i){const l=t.width*t.height,u=e.width*e.height,d=a*o,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const vg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const i of n){const{id:a}=i,o=r.get(a);if(o){const l=yg(o,t);l>0&&s.push({id:a,data:{droppableContainer:i,value:l}})}}return s.sort(pg)};function bg(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function $d(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:er}function wg(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return s.reduce((a,o)=>({...a,top:a.top+e*o.y,bottom:a.bottom+e*o.y,left:a.left+e*o.x,right:a.right+e*o.x}),{...r})}}const Cg=wg(1);function qd(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 Sg(e,t,r){const n=qd(t);if(!n)return e;const{scaleX:s,scaleY:i,x:a,y:o}=n,l=e.left-a-(1-s)*parseFloat(r),u=e.top-o-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=s?e.width/s:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const xg={ignoreTransform:!1};function Gn(e,t){t===void 0&&(t=xg);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Tt(e).getComputedStyle(e);u&&(r=Sg(r,u,d))}const{top:n,left:s,width:i,height:a,bottom:o,right:l}=r;return{top:n,left:s,width:i,height:a,bottom:o,right:l}}function Gl(e){return Gn(e,{ignoreTransform:!0})}function _g(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Tg(e,t){return t===void 0&&(t=Tt(e).getComputedStyle(e)),t.position==="fixed"}function Eg(e,t){t===void 0&&(t=Tt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?r.test(i):!1})}function Yi(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(Ko(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Ms(s)||kd(s)||r.includes(s))return r;const i=Tt(e).getComputedStyle(s);return s!==e&&Eg(s,i)&&r.push(s),Tg(s,i)?r:n(s.parentNode)}return e?n(e):r}function Ud(e){const[t]=Yi(e,1);return t??null}function ya(e){return!Gi||!e?null:Hn(e)?e:Wo(e)?Ko(e)||e===Qn(e).scrollingElement?window:Ms(e)?e:null:null}function zd(e){return Hn(e)?e.scrollX:e.scrollLeft}function Vd(e){return Hn(e)?e.scrollY:e.scrollTop}function ho(e){return{x:zd(e),y:Vd(e)}}var lt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(lt||(lt={}));function Hd(e){return!Gi||!e?!1:e===document.scrollingElement}function Qd(e){const t={x:0,y:0},r=Hd(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,i=e.scrollLeft<=t.x,a=e.scrollTop>=n.y,o=e.scrollLeft>=n.x;return{isTop:s,isLeft:i,isBottom:a,isRight:o,maxScroll:n,minScroll:t}}const Ig={x:.2,y:.2};function Og(e,t,r,n,s){let{top:i,left:a,right:o,bottom:l}=r;n===void 0&&(n=10),s===void 0&&(s=Ig);const{isTop:u,isBottom:d,isLeft:f,isRight:g}=Qd(e),p={x:0,y:0},C={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!u&&i<=t.top+h.height?(p.y=lt.Backward,C.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&l>=t.bottom-h.height&&(p.y=lt.Forward,C.y=n*Math.abs((t.bottom-h.height-l)/h.height)),!g&&o>=t.right-h.width?(p.x=lt.Forward,C.x=n*Math.abs((t.right-h.width-o)/h.width)):!f&&a<=t.left+h.width&&(p.x=lt.Backward,C.x=n*Math.abs((t.left+h.width-a)/h.width)),{direction:p,speed:C}}function Ag(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,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 Gd(e){return e.reduce((t,r)=>En(t,ho(r)),er)}function Dg(e){return e.reduce((t,r)=>t+zd(r),0)}function Ng(e){return e.reduce((t,r)=>t+Vd(r),0)}function Wd(e,t){if(t===void 0&&(t=Gn),!e)return;const{top:r,left:n,bottom:s,right:i}=t(e);Ud(e)&&(s<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Rg=[["x",["left","right"],Dg],["y",["top","bottom"],Ng]];class Yo{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=Yi(r),s=Gd(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,o]of Rg)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=o(n),d=s[i]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ys{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 kg(e){const{EventTarget:t}=Tt(e);return e instanceof t?e:Qn(e)}function va(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 Qt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Qt||(Qt={}));function Wl(e){e.preventDefault()}function jg(e){e.stopPropagation()}var xe;(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"})(xe||(xe={}));const Kd={start:[xe.Space,xe.Enter],cancel:[xe.Esc],end:[xe.Space,xe.Enter,xe.Tab]},Lg=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case xe.Right:return{...r,x:r.x+25};case xe.Left:return{...r,x:r.x-25};case xe.Down:return{...r,y:r.y+25};case xe.Up:return{...r,y:r.y-25}}};class Zo{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 ys(Qn(r)),this.windowListeners=new ys(Tt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Qt.Resize,this.handleCancel),this.windowListeners.add(Qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Wd(n),r(er)}handleKeyDown(t){if(Ki(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:i=Kd,coordinateGetter:a=Lg,scrollBehavior:o="smooth"}=s,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:er;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:r,context:n.current,currentCoordinates:d});if(f){const g=Es(f,d),p={x:0,y:0},{scrollableAncestors:C}=n.current;for(const h of C){const y=t.code,{isTop:v,isRight:b,isLeft:w,isBottom:S,maxScroll:_,minScroll:E}=Qd(h),D=Ag(h),R={x:Math.min(y===xe.Right?D.right-D.width/2:D.right,Math.max(y===xe.Right?D.left:D.left+D.width/2,f.x)),y:Math.min(y===xe.Down?D.bottom-D.height/2:D.bottom,Math.max(y===xe.Down?D.top:D.top+D.height/2,f.y))},M=y===xe.Right&&!b||y===xe.Left&&!w,$=y===xe.Down&&!S||y===xe.Up&&!v;if(M&&R.x!==f.x){const N=h.scrollLeft+g.x,j=y===xe.Right&&N<=_.x||y===xe.Left&&N>=E.x;if(j&&!g.y){h.scrollTo({left:N,behavior:o});return}j?p.x=h.scrollLeft-N:p.x=y===xe.Right?h.scrollLeft-_.x:h.scrollLeft-E.x,p.x&&h.scrollBy({left:-p.x,behavior:o});break}else if($&&R.y!==f.y){const N=h.scrollTop+g.y,j=y===xe.Down&&N<=_.y||y===xe.Up&&N>=E.y;if(j&&!g.x){h.scrollTo({top:N,behavior:o});return}j?p.y=h.scrollTop-N:p.y=y===xe.Down?h.scrollTop-_.y:h.scrollTop-E.y,p.y&&h.scrollBy({top:-p.y,behavior:o});break}}this.handleMove(t,En(Es(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Zo.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Kd,onActivation:s}=t,{active:i}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const o=i.activatorNode.current;return o&&e.target!==o?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function Kl(e){return!!(e&&"distance"in e)}function Yl(e){return!!(e&&"delay"in e)}class Xo{constructor(t,r,n){var s;n===void 0&&(n=kg(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:i}=t,{target:a}=i;this.props=t,this.events=r,this.document=Qn(a),this.documentListeners=new ys(this.document),this.listeners=new ys(n),this.windowListeners=new ys(Tt(a)),this.initialCoordinates=(s=Ri(i))!=null?s:er,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(Qt.Resize,this.handleCancel),this.windowListeners.add(Qt.DragStart,Wl),this.windowListeners.add(Qt.VisibilityChange,this.handleCancel),this.windowListeners.add(Qt.ContextMenu,Wl),this.documentListeners.add(Qt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yl(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Kl(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(Qt.Click,jg,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Qt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:o}}=i;if(!s)return;const l=(r=Ri(t))!=null?r:er,u=Es(s,l);if(!n&&o){if(Kl(o)){if(o.tolerance!=null&&va(u,o.tolerance))return this.handleCancel();if(va(u,o.distance))return this.handleStart()}if(Yl(o)&&va(u,o.tolerance))return this.handleCancel();this.handlePending(o,u);return}t.cancelable&&t.preventDefault(),a(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===xe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Pg={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zi extends Xo{constructor(t){const{event:r}=t,n=Qn(r.target);super(t,Pg,n)}}Zi.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 Fg={move:{name:"mousemove"},end:{name:"mouseup"}};var po;(function(e){e[e.RightClick=2]="RightClick"})(po||(po={}));class Mg extends Xo{constructor(t){super(t,Fg,Qn(t.event.target))}}Mg.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===po.RightClick?!1:(n==null||n({event:r}),!0)}}];const ba={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Bg extends Xo{constructor(t){super(t,ba)}static setup(){return window.addEventListener(ba.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ba.move.name,t)};function t(){}}}Bg.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 vs;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(vs||(vs={}));var ji;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ji||(ji={}));function $g(e){let{acceleration:t,activator:r=vs.Pointer,canScroll:n,draggingRect:s,enabled:i,interval:a=5,order:o=ji.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:g}=e;const p=Ug({delta:f,disabled:!i}),[C,h]=eg(),y=m.useRef({x:0,y:0}),v=m.useRef({x:0,y:0}),b=m.useMemo(()=>{switch(r){case vs.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case vs.DraggableRect:return s}},[r,s,l]),w=m.useRef(null),S=m.useCallback(()=>{const E=w.current;if(!E)return;const D=y.current.x*v.current.x,R=y.current.y*v.current.y;E.scrollBy(D,R)},[]),_=m.useMemo(()=>o===ji.TreeOrder?[...u].reverse():u,[o,u]);m.useEffect(()=>{if(!i||!u.length||!b){h();return}for(const E of _){if((n==null?void 0:n(E))===!1)continue;const D=u.indexOf(E),R=d[D];if(!R)continue;const{direction:M,speed:$}=Og(E,R,b,t,g);for(const N of["x","y"])p[N][M[N]]||($[N]=0,M[N]=0);if($.x>0||$.y>0){h(),w.current=E,C(S,a),y.current=$,v.current=M;return}}y.current={x:0,y:0},v.current={x:0,y:0},h()},[t,S,n,h,i,a,JSON.stringify(b),JSON.stringify(p),C,u,_,d,JSON.stringify(g)])}const qg={x:{[lt.Backward]:!1,[lt.Forward]:!1},y:{[lt.Backward]:!1,[lt.Forward]:!1}};function Ug(e){let{delta:t,disabled:r}=e;const n=Ni(t);return Bs(s=>{if(r||!n||!s)return qg;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[lt.Backward]:s.x[lt.Backward]||i.x===-1,[lt.Forward]:s.x[lt.Forward]||i.x===1},y:{[lt.Backward]:s.y[lt.Backward]||i.y===-1,[lt.Forward]:s.y[lt.Forward]||i.y===1}}},[r,t,n])}function zg(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Bs(s=>{var i;return t==null?null:(i=n??s)!=null?i:null},[n,t])}function Vg(e,t){return m.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,i=s.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,n)}));return[...r,...i]},[]),[e,t])}var Is;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Is||(Is={}));var mo;(function(e){e.Optimized="optimized"})(mo||(mo={}));const Zl=new Map;function Hg(e,t){let{dragging:r,dependencies:n,config:s}=t;const[i,a]=m.useState(null),{frequency:o,measure:l,strategy:u}=s,d=m.useRef(e),f=y(),g=Ts(f),p=m.useCallback(function(v){v===void 0&&(v=[]),!g.current&&a(b=>b===null?v:b.concat(v.filter(w=>!b.includes(w))))},[g]),C=m.useRef(null),h=Bs(v=>{if(f&&!r)return Zl;if(!v||v===Zl||d.current!==e||i!=null){const b=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){b.set(w.id,w.rect.current);continue}const S=w.node.current,_=S?new Yo(l(S),S):null;w.rect.current=_,_&&b.set(w.id,_)}return b}return v},[e,i,r,f,l]);return m.useEffect(()=>{d.current=e},[e]),m.useEffect(()=>{f||p()},[r,f]),m.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),m.useEffect(()=>{f||typeof o!="number"||C.current!==null||(C.current=setTimeout(()=>{p(),C.current=null},o))},[o,f,p,...n]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:i!=null};function y(){switch(u){case Is.Always:return!1;case Is.BeforeDragging:return r;default:return!r}}}function Jo(e,t){return Bs(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Qg(e,t){return Jo(e,t)}function Gg(e){let{callback:t,disabled:r}=e;const n=Wi(t),s=m.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return m.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Xi(e){let{callback:t,disabled:r}=e;const n=Wi(t),s=m.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return m.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Wg(e){return new Yo(Gn(e),e)}function Xl(e,t,r){t===void 0&&(t=Wg);const[n,s]=m.useState(null);function i(){s(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const a=Gg({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),o=Xi({callback:i});return Jt(()=>{i(),e?(o==null||o.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),a==null||a.disconnect())},[e]),n}function Kg(e){const t=Jo(e);return $d(e,t)}const Jl=[];function Yg(e){const t=m.useRef(e),r=Bs(n=>e?n&&n!==Jl&&e&&t.current&&e.parentNode===t.current.parentNode?n:Yi(e):Jl,[e]);return m.useEffect(()=>{t.current=e},[e]),r}function Zg(e){const[t,r]=m.useState(null),n=m.useRef(e),s=m.useCallback(i=>{const a=ya(i.target);a&&r(o=>o?(o.set(a,ho(a)),new Map(o)):null)},[]);return m.useEffect(()=>{const i=n.current;if(e!==i){a(i);const o=e.map(l=>{const u=ya(l);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,ho(u)]):null}).filter(l=>l!=null);r(o.length?new Map(o):null),n.current=e}return()=>{a(e),a(i)};function a(o){o.forEach(l=>{const u=ya(l);u==null||u.removeEventListener("scroll",s)})}},[s,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,a)=>En(i,a),er):Gd(e):er,[e,t])}function ec(e,t){t===void 0&&(t=[]);const r=m.useRef(null);return m.useEffect(()=>{r.current=null},t),m.useEffect(()=>{const n=e!==er;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Es(e,r.current):er}function Xg(e){m.useEffect(()=>{if(!Gi)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 Jg(e,t){return m.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:i}=n;return r[s]=a=>{i(a,t)},r},{}),[e,t])}function Yd(e){return m.useMemo(()=>e?_g(e):null,[e])}const tc=[];function ey(e,t){t===void 0&&(t=Gn);const[r]=e,n=Yd(r?Tt(r):null),[s,i]=m.useState(tc);function a(){i(()=>e.length?e.map(l=>Hd(l)?n:new Yo(t(l),l)):tc)}const o=Xi({callback:a});return Jt(()=>{o==null||o.disconnect(),a(),e.forEach(l=>o==null?void 0:o.observe(l))},[e]),s}function Zd(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ms(t)?t:e}function ty(e){let{measure:t}=e;const[r,n]=m.useState(null),s=m.useCallback(u=>{for(const{target:d}of u)if(Ms(d)){n(f=>{const g=t(d);return f?{...f,width:g.width,height:g.height}:g});break}},[t]),i=Xi({callback:s}),a=m.useCallback(u=>{const d=Zd(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[o,l]=Di(a);return m.useMemo(()=>({nodeRef:o,rect:r,setRef:l}),[r,o,l])}const ry=[{sensor:Zi,options:{}},{sensor:Zo,options:{}}],ny={current:{}},fi={draggable:{measure:Gl},droppable:{measure:Gl,strategy:Is.WhileDragging,frequency:mo.Optimized},dragOverlay:{measure:Gn}};class bs 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 sy={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new bs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ki},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fi,measureDroppableContainers:ki,windowRect:null,measuringScheduled:!1},Xd={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ki,draggableNodes:new Map,over:null,measureDroppableContainers:ki},qs=m.createContext(Xd),Jd=m.createContext(sy);function iy(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new bs}}}function ay(e,t){switch(t.type){case et.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case et.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 et.DragEnd:case et.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case et.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new bs(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case et.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new bs(e.droppable.containers);return a.set(r,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case et.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const i=new bs(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function oy(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=m.useContext(qs),i=Ni(n),a=Ni(r==null?void 0:r.id);return m.useEffect(()=>{if(!t&&!n&&i&&a!=null){if(!Ki(i)||document.activeElement===i.target)return;const o=s.get(a);if(!o)return;const{activatorNode:l,node:u}=o;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=ng(d);if(f){f.focus();break}}})}},[n,t,s,a,i]),null}function ef(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...n}),r):r}function ly(e){return m.useMemo(()=>({draggable:{...fi.draggable,...e==null?void 0:e.draggable},droppable:{...fi.droppable,...e==null?void 0:e.droppable},dragOverlay:{...fi.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 cy(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const i=m.useRef(!1),{x:a,y:o}=typeof s=="boolean"?{x:s,y:s}:s;Jt(()=>{if(!a&&!o||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=$d(d,n);if(a||(f.x=0),o||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=Ud(u);g&&g.scrollBy({top:f.y,left:f.x})}},[t,a,o,n,r])}const Ji=m.createContext({...er,scaleX:1,scaleY:1});var Ar;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ar||(Ar={}));const tf=m.memo(function(t){var r,n,s,i;let{id:a,accessibility:o,autoScroll:l=!0,children:u,sensors:d=ry,collisionDetection:f=vg,measuring:g,modifiers:p,...C}=t;const h=m.useReducer(ay,void 0,iy),[y,v]=h,[b,w]=cg(),[S,_]=m.useState(Ar.Uninitialized),E=S===Ar.Initialized,{draggable:{active:D,nodes:R,translate:M},droppable:{containers:$}}=y,N=D!=null?R.get(D):null,j=m.useRef({initial:null,translated:null}),P=m.useMemo(()=>{var rt;return D!=null?{id:D,data:(rt=N==null?void 0:N.data)!=null?rt:ny,rect:j}:null},[D,N]),k=m.useRef(null),[L,V]=m.useState(null),[X,ye]=m.useState(null),_e=Ts(C,Object.values(C)),we=$s("DndDescribedBy",a),de=m.useMemo(()=>$.getEnabled(),[$]),Q=ly(g),{droppableRects:ne,measureDroppableContainers:te,measuringScheduled:U}=Hg(de,{dragging:E,dependencies:[M.x,M.y],config:Q.droppable}),H=zg(R,D),ie=m.useMemo(()=>X?Ri(X):null,[X]),fe=zr(),J=Qg(H,Q.draggable.measure);cy({activeNode:D!=null?R.get(D):null,config:fe.layoutShiftCompensation,initialRect:J,measure:Q.draggable.measure});const se=Xl(H,Q.draggable.measure,J),ke=Xl(H?H.parentElement:null),Te=m.useRef({activatorEvent:null,active:null,activeNode:H,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$e=$.getNodeFor((r=Te.current.over)==null?void 0:r.id),Ve=ty({measure:Q.dragOverlay.measure}),qe=(n=Ve.nodeRef.current)!=null?n:H,re=E?(s=Ve.rect)!=null?s:se:null,He=!!(Ve.nodeRef.current&&Ve.rect),ze=Kg(He?null:se),Ue=Yd(qe?Tt(qe):null),Ze=Yg(E?$e??H:null),Bt=ey(Ze),St=ef(p,{transform:{x:M.x-ze.x,y:M.y-ze.y,scaleX:1,scaleY:1},activatorEvent:X,active:P,activeNodeRect:se,containerNodeRect:ke,draggingNodeRect:re,over:Te.current.over,overlayNodeRect:Ve.rect,scrollableAncestors:Ze,scrollableAncestorRects:Bt,windowRect:Ue}),K=ie?En(ie,M):null,pe=Zg(Ze),ve=ec(pe),$t=ec(pe,[se]),x=En(St,ve),O=re?Cg(re,St):null,A=P&&O?f({active:P,collisionRect:O,droppableRects:ne,droppableContainers:de,pointerCoordinates:K}):null,z=Bd(A,"id"),[B,G]=m.useState(null),q=He?St:En(St,$t),ee=bg(q,(i=B==null?void 0:B.rect)!=null?i:null,se),ge=m.useRef(null),Qe=m.useCallback((rt,ht)=>{let{sensor:xt,options:Wt}=ht;if(k.current==null)return;const qt=R.get(k.current);if(!qt)return;const kt=rt.nativeEvent,nr=new xt({active:k.current,activeNode:qt,event:kt,options:Wt,context:Te,onAbort(ct){if(!R.get(ct))return;const{onDragAbort:sr}=_e.current,mr={id:ct};sr==null||sr(mr),b({type:"onDragAbort",event:mr})},onPending(ct,Sr,sr,mr){if(!R.get(ct))return;const{onDragPending:ts}=_e.current,xr={id:ct,constraint:Sr,initialCoordinates:sr,offset:mr};ts==null||ts(xr),b({type:"onDragPending",event:xr})},onStart(ct){const Sr=k.current;if(Sr==null)return;const sr=R.get(Sr);if(!sr)return;const{onDragStart:mr}=_e.current,es={activatorEvent:kt,active:{id:Sr,data:sr.data,rect:j}};Br.unstable_batchedUpdates(()=>{mr==null||mr(es),_(Ar.Initializing),v({type:et.DragStart,initialCoordinates:ct,active:Sr}),b({type:"onDragStart",event:es}),V(ge.current),ye(kt)})},onMove(ct){v({type:et.DragMove,coordinates:ct})},onEnd:pn(et.DragEnd),onCancel:pn(et.DragCancel)});ge.current=nr;function pn(ct){return async function(){const{active:sr,collisions:mr,over:es,scrollAdjustedTranslate:ts}=Te.current;let xr=null;if(sr&&ts){const{cancelDrop:rs}=_e.current;xr={activatorEvent:kt,active:sr,collisions:mr,delta:ts,over:es},ct===et.DragEnd&&typeof rs=="function"&&await Promise.resolve(rs(xr))&&(ct=et.DragCancel)}k.current=null,Br.unstable_batchedUpdates(()=>{v({type:ct}),_(Ar.Uninitialized),G(null),V(null),ye(null),ge.current=null;const rs=ct===et.DragEnd?"onDragEnd":"onDragCancel";if(xr){const pa=_e.current[rs];pa==null||pa(xr),b({type:rs,event:xr})}})}}},[R]),Et=m.useCallback((rt,ht)=>(xt,Wt)=>{const qt=xt.nativeEvent,kt=R.get(Wt);if(k.current!==null||!kt||qt.dndKit||qt.defaultPrevented)return;const nr={active:kt};rt(xt,ht.options,nr)===!0&&(qt.dndKit={capturedBy:ht.sensor},k.current=Wt,Qe(xt,ht))},[R,Qe]),It=Vg(d,Et);Xg(d),Jt(()=>{se&&S===Ar.Initializing&&_(Ar.Initialized)},[se,S]),m.useEffect(()=>{const{onDragMove:rt}=_e.current,{active:ht,activatorEvent:xt,collisions:Wt,over:qt}=Te.current;if(!ht||!xt)return;const kt={active:ht,activatorEvent:xt,collisions:Wt,delta:{x:x.x,y:x.y},over:qt};Br.unstable_batchedUpdates(()=>{rt==null||rt(kt),b({type:"onDragMove",event:kt})})},[x.x,x.y]),m.useEffect(()=>{const{active:rt,activatorEvent:ht,collisions:xt,droppableContainers:Wt,scrollAdjustedTranslate:qt}=Te.current;if(!rt||k.current==null||!ht||!qt)return;const{onDragOver:kt}=_e.current,nr=Wt.get(z),pn=nr&&nr.rect.current?{id:nr.id,rect:nr.rect.current,data:nr.data,disabled:nr.disabled}:null,ct={active:rt,activatorEvent:ht,collisions:xt,delta:{x:qt.x,y:qt.y},over:pn};Br.unstable_batchedUpdates(()=>{G(pn),kt==null||kt(ct),b({type:"onDragOver",event:ct})})},[z]),Jt(()=>{Te.current={activatorEvent:X,active:P,activeNode:H,collisionRect:O,collisions:A,droppableRects:ne,draggableNodes:R,draggingNode:qe,draggingNodeRect:re,droppableContainers:$,over:B,scrollableAncestors:Ze,scrollAdjustedTranslate:x},j.current={initial:re,translated:O}},[P,H,A,O,R,qe,re,ne,$,B,Ze,x]),$g({...fe,delta:M,draggingRect:O,pointerCoordinates:K,scrollableAncestors:Ze,scrollableAncestorRects:Bt});const pr=m.useMemo(()=>({active:P,activeNode:H,activeNodeRect:se,activatorEvent:X,collisions:A,containerNodeRect:ke,dragOverlay:Ve,draggableNodes:R,droppableContainers:$,droppableRects:ne,over:B,measureDroppableContainers:te,scrollableAncestors:Ze,scrollableAncestorRects:Bt,measuringConfiguration:Q,measuringScheduled:U,windowRect:Ue}),[P,H,se,X,A,ke,Ve,R,$,ne,B,te,Ze,Bt,Q,U,Ue]),Jn=m.useMemo(()=>({activatorEvent:X,activators:It,active:P,activeNodeRect:se,ariaDescribedById:{draggable:we},dispatch:v,draggableNodes:R,over:B,measureDroppableContainers:te}),[X,It,P,se,v,we,R,B,te]);return m.createElement(Ld.Provider,{value:w},m.createElement(qs.Provider,{value:Jn},m.createElement(Jd.Provider,{value:pr},m.createElement(Ji.Provider,{value:ee},u)),m.createElement(oy,{disabled:(o==null?void 0:o.restoreFocus)===!1})),m.createElement(fg,{...o,hiddenTextDescribedById:we}));function zr(){const rt=(L==null?void 0:L.autoScrollEnabled)===!1,ht=typeof l=="object"?l.enabled===!1:l===!1,xt=E&&!rt&&!ht;return typeof l=="object"?{...l,enabled:xt}:{enabled:xt}}}),uy=m.createContext(null),rc="button",dy="Draggable";function rf(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const i=$s(dy),{activators:a,activatorEvent:o,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:g}=m.useContext(qs),{role:p=rc,roleDescription:C="draggable",tabIndex:h=0}=s??{},y=(l==null?void 0:l.id)===t,v=m.useContext(y?Ji:uy),[b,w]=Di(),[S,_]=Di(),E=Jg(a,t),D=Ts(r);Jt(()=>(f.set(t,{id:t,key:i,node:b,activatorNode:S,data:D}),()=>{const M=f.get(t);M&&M.key===i&&f.delete(t)}),[f,t]);const R=m.useMemo(()=>({role:p,tabIndex:h,"aria-disabled":n,"aria-pressed":y&&p===rc?!0:void 0,"aria-roledescription":C,"aria-describedby":d.draggable}),[n,p,h,y,C,d.draggable]);return{active:l,activatorEvent:o,activeNodeRect:u,attributes:R,isDragging:y,listeners:n?void 0:E,node:b,over:g,setNodeRef:w,setActivatorNodeRef:_,transform:v}}function nf(){return m.useContext(Jd)}const fy="Droppable",hy={timeout:25};function py(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const i=$s(fy),{active:a,dispatch:o,over:l,measureDroppableContainers:u}=m.useContext(qs),d=m.useRef({disabled:r}),f=m.useRef(!1),g=m.useRef(null),p=m.useRef(null),{disabled:C,updateMeasurementsFor:h,timeout:y}={...hy,...s},v=Ts(h??n),b=m.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(v.current)?v.current:[v.current]),p.current=null},y)},[y]),w=Xi({callback:b,disabled:C||!a}),S=m.useCallback((R,M)=>{w&&(M&&(w.unobserve(M),f.current=!1),R&&w.observe(R))},[w]),[_,E]=Di(S),D=Ts(t);return m.useEffect(()=>{!w||!_.current||(w.disconnect(),f.current=!1,w.observe(_.current))},[_,w]),m.useEffect(()=>(o({type:et.RegisterDroppable,element:{id:n,key:i,disabled:r,node:_,rect:g,data:D}}),()=>o({type:et.UnregisterDroppable,key:i,id:n})),[n]),m.useEffect(()=>{r!==d.current.disabled&&(o({type:et.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,o]),{active:a,rect:g,isOver:(l==null?void 0:l.id)===n,node:_,over:l,setNodeRef:E}}function my(e){let{animation:t,children:r}=e;const[n,s]=m.useState(null),[i,a]=m.useState(null),o=Ni(r);return!r&&!n&&o&&s(o),Jt(()=>{if(!i)return;const l=n==null?void 0:n.key,u=n==null?void 0:n.props.id;if(l==null||u==null){s(null);return}Promise.resolve(t(u,i)).then(()=>{s(null)})},[t,n,i]),m.createElement(m.Fragment,null,r,n?m.cloneElement(n,{ref:a}):null)}const gy={x:0,y:0,scaleX:1,scaleY:1};function yy(e){let{children:t}=e;return m.createElement(qs.Provider,{value:Xd},m.createElement(Ji.Provider,{value:gy},t))}const vy={position:"fixed",touchAction:"none"},by=e=>Ki(e)?"transform 250ms ease":void 0,wy=m.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:i,className:a,rect:o,style:l,transform:u,transition:d=by}=e;if(!o)return null;const f=s?u:{...u,scaleX:1,scaleY:1},g={...vy,width:o.width,height:o.height,top:o.top,left:o.left,transform:qr.Transform.toString(f),transformOrigin:s&&n?hg(n,o):void 0,transition:typeof d=="function"?d(n):d,...l};return m.createElement(r,{className:a,style:g,ref:t},i)}),Cy=e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:i,className:a}=e;if(i!=null&&i.active)for(const[o,l]of Object.entries(i.active))l!==void 0&&(s[o]=r.node.style.getPropertyValue(o),r.node.style.setProperty(o,l));if(i!=null&&i.dragOverlay)for(const[o,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(o,l);return a!=null&&a.active&&r.node.classList.add(a.active),a!=null&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(s))r.node.style.setProperty(l,u);a!=null&&a.active&&r.node.classList.remove(a.active)}},Sy=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:qr.Transform.toString(t)},{transform:qr.Transform.toString(r)}]},xy={duration:250,easing:"ease",keyframes:Sy,sideEffects:Cy({styles:{active:{opacity:"0"}}})};function _y(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return Wi((i,a)=>{if(t===null)return;const o=r.get(i);if(!o)return;const l=o.node.current;if(!l)return;const u=Zd(a);if(!u)return;const{transform:d}=Tt(a).getComputedStyle(a),f=qd(d);if(!f)return;const g=typeof t=="function"?t:Ty(t);return Wd(l,s.draggable.measure),g({active:{id:i,data:o.data,node:l,rect:s.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:a,rect:s.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function Ty(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...xy,...e};return i=>{let{active:a,dragOverlay:o,transform:l,...u}=i;if(!t)return;const d={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},f={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/o.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/o.rect.height:1},g={x:l.x-d.x,y:l.y-d.y,...f},p=s({...u,active:a,dragOverlay:o,transform:{initial:l,final:g}}),[C]=p,h=p[p.length-1];if(JSON.stringify(C)===JSON.stringify(h))return;const y=n==null?void 0:n({active:a,dragOverlay:o,...u}),v=o.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(b=>{v.onfinish=()=>{y==null||y(),b()}})}}let nc=0;function Ey(e){return m.useMemo(()=>{if(e!=null)return nc++,nc},[e])}const Iy=m.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:i,modifiers:a,wrapperElement:o="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggableNodes:C,droppableContainers:h,dragOverlay:y,over:v,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:S,windowRect:_}=nf(),E=m.useContext(Ji),D=Ey(f==null?void 0:f.id),R=ef(a,{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:y.rect,over:v,overlayNodeRect:y.rect,scrollableAncestors:w,scrollableAncestorRects:S,transform:E,windowRect:_}),M=Jo(g),$=_y({config:n,draggableNodes:C,droppableContainers:h,measuringConfiguration:b}),N=M?y.setRef:void 0;return m.createElement(yy,null,m.createElement(my,{animation:$},f&&D?m.createElement(wy,{key:D,id:f.id,ref:N,as:o,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:M,style:{zIndex:u,...s},transform:R},r):null))});/**
181
+ `},Yg={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 Zg(e){let{announcements:t=Yg,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=Kg}=e;const{announce:i,announcement:o}=Qg(),a=Ks("DndLiveRegion"),[c,u]=m.useState(!1);if(m.useEffect(()=>{u(!0)},[]),Wg(m.useMemo(()=>({onDragStart(f){let{active:g}=f;i(t.onDragStart({active:g}))},onDragMove(f){let{active:g,over:p}=f;t.onDragMove&&i(t.onDragMove({active:g,over:p}))},onDragOver(f){let{active:g,over:p}=f;i(t.onDragOver({active:g,over:p}))},onDragEnd(f){let{active:g,over:p}=f;i(t.onDragEnd({active:g,over:p}))},onDragCancel(f){let{active:g,over:p}=f;i(t.onDragCancel({active:g,over:p}))}}),[i,t])),!c)return null;const d=m.createElement(m.Fragment,null,m.createElement(Vg,{id:n,value:s.draggable}),m.createElement(Hg,{id:a,announcement:o}));return r?Ur.createPortal(d,r):d}var ot;(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"})(ot||(ot={}));function Hi(){}function Na(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function uf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return m.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const ar=Object.freeze({x:0,y:0});function df(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Xg(e,t){const r=Vi(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 ff(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Jg(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function dc(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 hf(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function fc(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 ev=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=fc(t,t.left,t.top),i=[];for(const o of n){const{id:a}=o,c=r.get(a);if(c){const u=df(fc(c),s);i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(ff)},tv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=dc(t),i=[];for(const o of n){const{id:a}=o,c=r.get(a);if(c){const u=dc(c),d=s.reduce((g,p,b)=>g+df(u[b],p),0),f=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:f}})}}return i.sort(ff)};function rv(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),i=Math.min(t.top+t.height,e.top+e.height),o=s-n,a=i-r;if(n<s&&r<i){const c=t.width*t.height,u=e.width*e.height,d=o*a,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const nv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const i of n){const{id:o}=i,a=r.get(o);if(a){const c=rv(a,t);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(Jg)};function sv(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function pf(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ar}function iv(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return s.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...r})}}const ov=iv(1);function mf(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=mf(t);if(!n)return e;const{scaleX:s,scaleY:i,x:o,y:a}=n,c=e.left-o-(1-s)*parseFloat(r),u=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=s?e.width/s:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const lv={ignoreTransform:!1};function ss(e,t){t===void 0&&(t=lv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Lt(e).getComputedStyle(e);u&&(r=av(r,u,d))}const{top:n,left:s,width:i,height:o,bottom:a,right:c}=r;return{top:n,left:s,width:i,height:o,bottom:a,right:c}}function hc(e){return ss(e,{ignoreTransform:!0})}function cv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function uv(e,t){return t===void 0&&(t=Lt(e).getComputedStyle(e)),t.position==="fixed"}function dv(e,t){t===void 0&&(t=Lt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?r.test(i):!1})}function fo(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(vl(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Ws(s)||af(s)||r.includes(s))return r;const i=Lt(e).getComputedStyle(s);return s!==e&&dv(s,i)&&r.push(s),uv(s,i)?r:n(s.parentNode)}return e?n(e):r}function gf(e){const[t]=fo(e,1);return t??null}function Fo(e){return!lo||!e?null:rs(e)?e:gl(e)?vl(e)||e===ns(e).scrollingElement?window:Ws(e)?e:null:null}function vf(e){return rs(e)?e.scrollX:e.scrollLeft}function yf(e){return rs(e)?e.scrollY:e.scrollTop}function ja(e){return{x:vf(e),y:yf(e)}}var pt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(pt||(pt={}));function bf(e){return!lo||!e?!1:e===document.scrollingElement}function Cf(e){const t={x:0,y:0},r=bf(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,i=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:n,minScroll:t}}const fv={x:.2,y:.2};function hv(e,t,r,n,s){let{top:i,left:o,right:a,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=fv);const{isTop:u,isBottom:d,isLeft:f,isRight:g}=Cf(e),p={x:0,y:0},b={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!u&&i<=t.top+h.height?(p.y=pt.Backward,b.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&c>=t.bottom-h.height&&(p.y=pt.Forward,b.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!g&&a>=t.right-h.width?(p.x=pt.Forward,b.x=n*Math.abs((t.right-h.width-a)/h.width)):!f&&o<=t.left+h.width&&(p.x=pt.Backward,b.x=n*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:b}}function pv(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}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 Sf(e){return e.reduce((t,r)=>Fn(t,ja(r)),ar)}function mv(e){return e.reduce((t,r)=>t+vf(r),0)}function gv(e){return e.reduce((t,r)=>t+yf(r),0)}function _f(e,t){if(t===void 0&&(t=ss),!e)return;const{top:r,left:n,bottom:s,right:i}=t(e);gf(e)&&(s<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const vv=[["x",["left","right"],mv],["y",["top","bottom"],gv]];class yl{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=fo(r),s=Sf(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,a]of vv)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=a(n),d=s[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xs{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 yv(e){const{EventTarget:t}=Lt(e);return e instanceof t?e:ns(e)}function Mo(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 Xt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Xt||(Xt={}));function pc(e){e.preventDefault()}function bv(e){e.stopPropagation()}var Oe;(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"})(Oe||(Oe={}));const wf={start:[Oe.Space,Oe.Enter],cancel:[Oe.Esc],end:[Oe.Space,Oe.Enter,Oe.Tab]},Cv=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Oe.Right:return{...r,x:r.x+25};case Oe.Left:return{...r,x:r.x-25};case Oe.Down:return{...r,y:r.y+25};case Oe.Up:return{...r,y:r.y-25}}};class bl{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 xs(ns(r)),this.windowListeners=new xs(Lt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xt.Resize,this.handleCancel),this.windowListeners.add(Xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&_f(n),r(ar)}handleKeyDown(t){if(uo(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:i=wf,coordinateGetter:o=Cv,scrollBehavior:a="smooth"}=s,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:ar;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(t,{active:r,context:n.current,currentCoordinates:d});if(f){const g=Ns(f,d),p={x:0,y:0},{scrollableAncestors:b}=n.current;for(const h of b){const v=t.code,{isTop:y,isRight:C,isLeft:S,isBottom:_,maxScroll:x,minScroll:E}=Cf(h),D=pv(h),T={x:Math.min(v===Oe.Right?D.right-D.width/2:D.right,Math.max(v===Oe.Right?D.left:D.left+D.width/2,f.x)),y:Math.min(v===Oe.Down?D.bottom-D.height/2:D.bottom,Math.max(v===Oe.Down?D.top:D.top+D.height/2,f.y))},j=v===Oe.Right&&!C||v===Oe.Left&&!S,F=v===Oe.Down&&!_||v===Oe.Up&&!y;if(j&&T.x!==f.x){const O=h.scrollLeft+g.x,N=v===Oe.Right&&O<=x.x||v===Oe.Left&&O>=E.x;if(N&&!g.y){h.scrollTo({left:O,behavior:a});return}N?p.x=h.scrollLeft-O:p.x=v===Oe.Right?h.scrollLeft-x.x:h.scrollLeft-E.x,p.x&&h.scrollBy({left:-p.x,behavior:a});break}else if(F&&T.y!==f.y){const O=h.scrollTop+g.y,N=v===Oe.Down&&O<=x.y||v===Oe.Up&&O>=E.y;if(N&&!g.x){h.scrollTo({top:O,behavior:a});return}N?p.y=h.scrollTop-O:p.y=v===Oe.Down?h.scrollTop-x.y:h.scrollTop-E.y,p.y&&h.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Fn(Ns(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}bl.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=wf,onActivation:s}=t,{active:i}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function mc(e){return!!(e&&"distance"in e)}function gc(e){return!!(e&&"delay"in e)}class Cl{constructor(t,r,n){var s;n===void 0&&(n=yv(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:i}=t,{target:o}=i;this.props=t,this.events=r,this.document=ns(o),this.documentListeners=new xs(this.document),this.listeners=new xs(n),this.windowListeners=new xs(Lt(o)),this.initialCoordinates=(s=Vi(i))!=null?s:ar,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(Xt.Resize,this.handleCancel),this.windowListeners.add(Xt.DragStart,pc),this.windowListeners.add(Xt.VisibilityChange,this.handleCancel),this.windowListeners.add(Xt.ContextMenu,pc),this.documentListeners.add(Xt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(mc(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(Xt.Click,bv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(r=Vi(t))!=null?r:ar,u=Ns(s,c);if(!n&&a){if(mc(a)){if(a.tolerance!=null&&Mo(u,a.tolerance))return this.handleCancel();if(Mo(u,a.distance))return this.handleStart()}if(gc(a)&&Mo(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),o(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===Oe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Sv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ho extends Cl{constructor(t){const{event:r}=t,n=ns(r.target);super(t,Sv,n)}}ho.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 _v={move:{name:"mousemove"},end:{name:"mouseup"}};var Pa;(function(e){e[e.RightClick=2]="RightClick"})(Pa||(Pa={}));class wv extends Cl{constructor(t){super(t,_v,ns(t.event.target))}}wv.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Pa.RightClick?!1:(n==null||n({event:r}),!0)}}];const Bo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class xv extends Cl{constructor(t){super(t,Bo)}static setup(){return window.addEventListener(Bo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Bo.move.name,t)};function t(){}}}xv.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 Ts;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ts||(Ts={}));var Qi;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Qi||(Qi={}));function Tv(e){let{acceleration:t,activator:r=Ts.Pointer,canScroll:n,draggingRect:s,enabled:i,interval:o=5,order:a=Qi.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:g}=e;const p=Av({delta:f,disabled:!i}),[b,h]=Bg(),v=m.useRef({x:0,y:0}),y=m.useRef({x:0,y:0}),C=m.useMemo(()=>{switch(r){case Ts.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ts.DraggableRect:return s}},[r,s,c]),S=m.useRef(null),_=m.useCallback(()=>{const E=S.current;if(!E)return;const D=v.current.x*y.current.x,T=v.current.y*y.current.y;E.scrollBy(D,T)},[]),x=m.useMemo(()=>a===Qi.TreeOrder?[...u].reverse():u,[a,u]);m.useEffect(()=>{if(!i||!u.length||!C){h();return}for(const E of x){if((n==null?void 0:n(E))===!1)continue;const D=u.indexOf(E),T=d[D];if(!T)continue;const{direction:j,speed:F}=hv(E,T,C,t,g);for(const O of["x","y"])p[O][j[O]]||(F[O]=0,j[O]=0);if(F.x>0||F.y>0){h(),S.current=E,b(_,o),v.current=F,y.current=j;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,_,n,h,i,o,JSON.stringify(C),JSON.stringify(p),b,u,x,d,JSON.stringify(g)])}const Ev={x:{[pt.Backward]:!1,[pt.Forward]:!1},y:{[pt.Backward]:!1,[pt.Forward]:!1}};function Av(e){let{delta:t,disabled:r}=e;const n=zi(t);return Gs(s=>{if(r||!n||!s)return Ev;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[pt.Backward]:s.x[pt.Backward]||i.x===-1,[pt.Forward]:s.x[pt.Forward]||i.x===1},y:{[pt.Backward]:s.y[pt.Backward]||i.y===-1,[pt.Forward]:s.y[pt.Forward]||i.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 Gs(s=>{var i;return t==null?null:(i=n??s)!=null?i:null},[n,t])}function kv(e,t){return m.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...i]},[]),[e,t])}var js;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(js||(js={}));var Ra;(function(e){e.Optimized="optimized"})(Ra||(Ra={}));const vc=new Map;function Dv(e,t){let{dragging:r,dependencies:n,config:s}=t;const[i,o]=m.useState(null),{frequency:a,measure:c,strategy:u}=s,d=m.useRef(e),f=v(),g=Os(f),p=m.useCallback(function(y){y===void 0&&(y=[]),!g.current&&o(C=>C===null?y:C.concat(y.filter(S=>!C.includes(S))))},[g]),b=m.useRef(null),h=Gs(y=>{if(f&&!r)return vc;if(!y||y===vc||d.current!==e||i!=null){const C=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const _=S.node.current,x=_?new yl(c(_),_):null;S.rect.current=x,x&&C.set(S.id,x)}return C}return y},[e,i,r,f,c]);return m.useEffect(()=>{d.current=e},[e]),m.useEffect(()=>{f||p()},[r,f]),m.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),m.useEffect(()=>{f||typeof a!="number"||b.current!==null||(b.current=setTimeout(()=>{p(),b.current=null},a))},[a,f,p,...n]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:i!=null};function v(){switch(u){case js.Always:return!1;case js.BeforeDragging:return r;default:return!r}}}function Sl(e,t){return Gs(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Lv(e,t){return Sl(e,t)}function Ov(e){let{callback:t,disabled:r}=e;const n=co(t),s=m.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return m.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function po(e){let{callback:t,disabled:r}=e;const n=co(t),s=m.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return m.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Nv(e){return new yl(ss(e),e)}function yc(e,t,r){t===void 0&&(t=Nv);const[n,s]=m.useState(null);function i(){s(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??r)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const o=Ov({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=po({callback:i});return or(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),n}function jv(e){const t=Sl(e);return pf(e,t)}const bc=[];function Pv(e){const t=m.useRef(e),r=Gs(n=>e?n&&n!==bc&&e&&t.current&&e.parentNode===t.current.parentNode?n:fo(e):bc,[e]);return m.useEffect(()=>{t.current=e},[e]),r}function Rv(e){const[t,r]=m.useState(null),n=m.useRef(e),s=m.useCallback(i=>{const o=Fo(i.target);o&&r(a=>a?(a.set(o,ja(o)),new Map(a)):null)},[]);return m.useEffect(()=>{const i=n.current;if(e!==i){o(i);const a=e.map(c=>{const u=Fo(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,ja(u)]):null}).filter(c=>c!=null);r(a.length?new Map(a):null),n.current=e}return()=>{o(e),o(i)};function o(a){a.forEach(c=>{const u=Fo(c);u==null||u.removeEventListener("scroll",s)})}},[s,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>Fn(i,o),ar):Sf(e):ar,[e,t])}function Cc(e,t){t===void 0&&(t=[]);const r=m.useRef(null);return m.useEffect(()=>{r.current=null},t),m.useEffect(()=>{const n=e!==ar;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Ns(e,r.current):ar}function Fv(e){m.useEffect(()=>{if(!lo)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 Mv(e,t){return m.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:i}=n;return r[s]=o=>{i(o,t)},r},{}),[e,t])}function xf(e){return m.useMemo(()=>e?cv(e):null,[e])}const Sc=[];function Bv(e,t){t===void 0&&(t=ss);const[r]=e,n=xf(r?Lt(r):null),[s,i]=m.useState(Sc);function o(){i(()=>e.length?e.map(c=>bf(c)?n:new yl(t(c),c)):Sc)}const a=po({callback:o});return or(()=>{a==null||a.disconnect(),o(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),s}function Tf(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ws(t)?t:e}function qv(e){let{measure:t}=e;const[r,n]=m.useState(null),s=m.useCallback(u=>{for(const{target:d}of u)if(Ws(d)){n(f=>{const g=t(d);return f?{...f,width:g.width,height:g.height}:g});break}},[t]),i=po({callback:s}),o=m.useCallback(u=>{const d=Tf(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,c]=Ui(o);return m.useMemo(()=>({nodeRef:a,rect:r,setRef:c}),[r,a,c])}const $v=[{sensor:ho,options:{}},{sensor:bl,options:{}}],Uv={current:{}},xi={draggable:{measure:hc},droppable:{measure:hc,strategy:js.WhileDragging,frequency:Ra.Optimized},dragOverlay:{measure:ss}};class Es extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const zv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Es,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Hi},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:xi,measureDroppableContainers:Hi,windowRect:null,measuringScheduled:!1},Ef={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Hi,draggableNodes:new Map,over:null,measureDroppableContainers:Hi},Ys=m.createContext(Ef),Af=m.createContext(zv);function Vv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Es}}}function Hv(e,t){switch(t.type){case ot.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ot.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 ot.DragEnd:case ot.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ot.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new Es(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case ot.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new Es(e.droppable.containers);return o.set(r,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case ot.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const i=new Es(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=m.useContext(Ys),i=zi(n),o=zi(r==null?void 0:r.id);return m.useEffect(()=>{if(!t&&!n&&i&&o!=null){if(!uo(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=Ug(d);if(f){f.focus();break}}})}},[n,t,s,o,i]),null}function If(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...n}),r):r}function Wv(e){return m.useMemo(()=>({draggable:{...xi.draggable,...e==null?void 0:e.draggable},droppable:{...xi.droppable,...e==null?void 0:e.droppable},dragOverlay:{...xi.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 Gv(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const i=m.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;or(()=>{if(!o&&!a||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=pf(d,n);if(o||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=gf(u);g&&g.scrollBy({top:f.y,left:f.x})}},[t,o,a,n,r])}const mo=m.createContext({...ar,scaleX:1,scaleY:1});var Or;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Or||(Or={}));const kf=m.memo(function(t){var r,n,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:u,sensors:d=$v,collisionDetection:f=nv,measuring:g,modifiers:p,...b}=t;const h=m.useReducer(Hv,void 0,Vv),[v,y]=h,[C,S]=Gg(),[_,x]=m.useState(Or.Uninitialized),E=_===Or.Initialized,{draggable:{active:D,nodes:T,translate:j},droppable:{containers:F}}=v,O=D!=null?T.get(D):null,N=m.useRef({initial:null,translated:null}),B=m.useMemo(()=>{var ct;return D!=null?{id:D,data:(ct=O==null?void 0:O.data)!=null?ct:Uv,rect:N}:null},[D,O]),P=m.useRef(null),[U,ne]=m.useState(null),[H,te]=m.useState(null),he=Os(b,Object.values(b)),oe=Ks("DndDescribedBy",o),ge=m.useMemo(()=>F.getEnabled(),[F]),ve=Wv(g),{droppableRects:xe,measureDroppableContainers:ye,measuringScheduled:R}=Dv(ge,{dragging:E,dependencies:[j.x,j.y],config:ve.droppable}),M=Iv(T,D),Y=m.useMemo(()=>H?Vi(H):null,[H]),le=Yr(),Ce=Lv(M,ve.draggable.measure);Gv({activeNode:D!=null?T.get(D):null,config:le.layoutShiftCompensation,initialRect:Ce,measure:ve.draggable.measure});const de=yc(M,ve.draggable.measure,Ce),ce=yc(M?M.parentElement:null),Q=m.useRef({activatorEvent:null,active:null,activeNode:M,collisionRect:null,collisions:null,droppableRects:xe,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=F.getNodeFor((r=Q.current.over)==null?void 0:r.id),Te=qv({measure:ve.dragOverlay.measure}),me=(n=Te.nodeRef.current)!=null?n:M,ee=E?(s=Te.rect)!=null?s:de:null,He=!!(Te.nodeRef.current&&Te.rect),Ge=jv(He?null:de),Ze=xf(me?Lt(me):null),Qe=Pv(E?se??M:null),tt=Bv(Qe),st=If(p,{transform:{x:j.x-Ge.x,y:j.y-Ge.y,scaleX:1,scaleY:1},activatorEvent:H,active:B,activeNodeRect:de,containerNodeRect:ce,draggingNodeRect:ee,over:Q.current.over,overlayNodeRect:Te.rect,scrollableAncestors:Qe,scrollableAncestorRects:tt,windowRect:Ze}),Kr=Y?Fn(Y,j):null,_n=Rv(Qe),K=Cc(_n),_e=Cc(_n,[de]),w=Fn(st,K),k=ee?ov(ee,st):null,L=B&&k?f({active:B,collisionRect:k,droppableRects:xe,droppableContainers:ge,pointerCoordinates:Kr}):null,z=hf(L,"id"),[V,G]=m.useState(null),$=He?st:Fn(st,_e),re=sv($,(i=V==null?void 0:V.rect)!=null?i:null,de),be=m.useRef(null),$e=m.useCallback((ct,Ct)=>{let{sensor:kt,options:tr}=Ct;if(P.current==null)return;const Qt=T.get(P.current);if(!Qt)return;const qt=ct.nativeEvent,cr=new kt({active:P.current,activeNode:Qt,event:qt,options:tr,context:Q,onAbort(mt){if(!T.get(mt))return;const{onDragAbort:ur}=he.current,Cr={id:mt};ur==null||ur(Cr),C({type:"onDragAbort",event:Cr})},onPending(mt,Tr,ur,Cr){if(!T.get(mt))return;const{onDragPending:us}=he.current,Er={id:mt,constraint:Tr,initialCoordinates:ur,offset:Cr};us==null||us(Er),C({type:"onDragPending",event:Er})},onStart(mt){const Tr=P.current;if(Tr==null)return;const ur=T.get(Tr);if(!ur)return;const{onDragStart:Cr}=he.current,cs={activatorEvent:qt,active:{id:Tr,data:ur.data,rect:N}};Ur.unstable_batchedUpdates(()=>{Cr==null||Cr(cs),x(Or.Initializing),y({type:ot.DragStart,initialCoordinates:mt,active:Tr}),C({type:"onDragStart",event:cs}),ne(be.current),te(qt)})},onMove(mt){y({type:ot.DragMove,coordinates:mt})},onEnd:wn(ot.DragEnd),onCancel:wn(ot.DragCancel)});be.current=cr;function wn(mt){return async function(){const{active:ur,collisions:Cr,over:cs,scrollAdjustedTranslate:us}=Q.current;let Er=null;if(ur&&us){const{cancelDrop:ds}=he.current;Er={activatorEvent:qt,active:ur,collisions:Cr,delta:us,over:cs},mt===ot.DragEnd&&typeof ds=="function"&&await Promise.resolve(ds(Er))&&(mt=ot.DragCancel)}P.current=null,Ur.unstable_batchedUpdates(()=>{y({type:mt}),x(Or.Uninitialized),G(null),ne(null),te(null),be.current=null;const ds=mt===ot.DragEnd?"onDragEnd":"onDragCancel";if(Er){const jo=he.current[ds];jo==null||jo(Er),C({type:ds,event:Er})}})}}},[T]),Ot=m.useCallback((ct,Ct)=>(kt,tr)=>{const Qt=kt.nativeEvent,qt=T.get(tr);if(P.current!==null||!qt||Qt.dndKit||Qt.defaultPrevented)return;const cr={active:qt};ct(kt,Ct.options,cr)===!0&&(Qt.dndKit={capturedBy:Ct.sensor},P.current=tr,$e(kt,Ct))},[T,$e]),Nt=kv(d,Ot);Fv(d),or(()=>{de&&_===Or.Initializing&&x(Or.Initialized)},[de,_]),m.useEffect(()=>{const{onDragMove:ct}=he.current,{active:Ct,activatorEvent:kt,collisions:tr,over:Qt}=Q.current;if(!Ct||!kt)return;const qt={active:Ct,activatorEvent:kt,collisions:tr,delta:{x:w.x,y:w.y},over:Qt};Ur.unstable_batchedUpdates(()=>{ct==null||ct(qt),C({type:"onDragMove",event:qt})})},[w.x,w.y]),m.useEffect(()=>{const{active:ct,activatorEvent:Ct,collisions:kt,droppableContainers:tr,scrollAdjustedTranslate:Qt}=Q.current;if(!ct||P.current==null||!Ct||!Qt)return;const{onDragOver:qt}=he.current,cr=tr.get(z),wn=cr&&cr.rect.current?{id:cr.id,rect:cr.rect.current,data:cr.data,disabled:cr.disabled}:null,mt={active:ct,activatorEvent:Ct,collisions:kt,delta:{x:Qt.x,y:Qt.y},over:wn};Ur.unstable_batchedUpdates(()=>{G(wn),qt==null||qt(mt),C({type:"onDragOver",event:mt})})},[z]),or(()=>{Q.current={activatorEvent:H,active:B,activeNode:M,collisionRect:k,collisions:L,droppableRects:xe,draggableNodes:T,draggingNode:me,draggingNodeRect:ee,droppableContainers:F,over:V,scrollableAncestors:Qe,scrollAdjustedTranslate:w},N.current={initial:ee,translated:k}},[B,M,L,k,T,me,ee,xe,F,V,Qe,w]),Tv({...le,delta:j,draggingRect:k,pointerCoordinates:Kr,scrollableAncestors:Qe,scrollableAncestorRects:tt});const br=m.useMemo(()=>({active:B,activeNode:M,activeNodeRect:de,activatorEvent:H,collisions:L,containerNodeRect:ce,dragOverlay:Te,draggableNodes:T,droppableContainers:F,droppableRects:xe,over:V,measureDroppableContainers:ye,scrollableAncestors:Qe,scrollableAncestorRects:tt,measuringConfiguration:ve,measuringScheduled:R,windowRect:Ze}),[B,M,de,H,L,ce,Te,T,F,xe,V,ye,Qe,tt,ve,R,Ze]),ls=m.useMemo(()=>({activatorEvent:H,activators:Nt,active:B,activeNodeRect:de,ariaDescribedById:{draggable:oe},dispatch:y,draggableNodes:T,over:V,measureDroppableContainers:ye}),[H,Nt,B,de,y,oe,T,V,ye]);return m.createElement(cf.Provider,{value:S},m.createElement(Ys.Provider,{value:ls},m.createElement(Af.Provider,{value:br},m.createElement(mo.Provider,{value:re},u)),m.createElement(Qv,{disabled:(a==null?void 0:a.restoreFocus)===!1})),m.createElement(Zg,{...a,hiddenTextDescribedById:oe}));function Yr(){const ct=(U==null?void 0:U.autoScrollEnabled)===!1,Ct=typeof c=="object"?c.enabled===!1:c===!1,kt=E&&!ct&&!Ct;return typeof c=="object"?{...c,enabled:kt}:{enabled:kt}}}),Kv=m.createContext(null),_c="button",Yv="Draggable";function Df(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const i=Ks(Yv),{activators:o,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:g}=m.useContext(Ys),{role:p=_c,roleDescription:b="draggable",tabIndex:h=0}=s??{},v=(c==null?void 0:c.id)===t,y=m.useContext(v?mo:Kv),[C,S]=Ui(),[_,x]=Ui(),E=Mv(o,t),D=Os(r);or(()=>(f.set(t,{id:t,key:i,node:C,activatorNode:_,data:D}),()=>{const j=f.get(t);j&&j.key===i&&f.delete(t)}),[f,t]);const T=m.useMemo(()=>({role:p,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&p===_c?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[n,p,h,v,b,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:T,isDragging:v,listeners:n?void 0:E,node:C,over:g,setNodeRef:S,setActivatorNodeRef:x,transform:y}}function Lf(){return m.useContext(Af)}const Zv="Droppable",Xv={timeout:25};function Jv(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const i=Ks(Zv),{active:o,dispatch:a,over:c,measureDroppableContainers:u}=m.useContext(Ys),d=m.useRef({disabled:r}),f=m.useRef(!1),g=m.useRef(null),p=m.useRef(null),{disabled:b,updateMeasurementsFor:h,timeout:v}={...Xv,...s},y=Os(h??n),C=m.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),p.current=null},v)},[v]),S=po({callback:C,disabled:b||!o}),_=m.useCallback((T,j)=>{S&&(j&&(S.unobserve(j),f.current=!1),T&&S.observe(T))},[S]),[x,E]=Ui(_),D=Os(t);return m.useEffect(()=>{!S||!x.current||(S.disconnect(),f.current=!1,S.observe(x.current))},[x,S]),m.useEffect(()=>(a({type:ot.RegisterDroppable,element:{id:n,key:i,disabled:r,node:x,rect:g,data:D}}),()=>a({type:ot.UnregisterDroppable,key:i,id:n})),[n]),m.useEffect(()=>{r!==d.current.disabled&&(a({type:ot.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:o,rect:g,isOver:(c==null?void 0:c.id)===n,node:x,over:c,setNodeRef:E}}function ey(e){let{animation:t,children:r}=e;const[n,s]=m.useState(null),[i,o]=m.useState(null),a=zi(r);return!r&&!n&&a&&s(a),or(()=>{if(!i)return;const c=n==null?void 0:n.key,u=n==null?void 0:n.props.id;if(c==null||u==null){s(null);return}Promise.resolve(t(u,i)).then(()=>{s(null)})},[t,n,i]),m.createElement(m.Fragment,null,r,n?m.cloneElement(n,{ref:o}):null)}const ty={x:0,y:0,scaleX:1,scaleY:1};function ry(e){let{children:t}=e;return m.createElement(Ys.Provider,{value:Ef},m.createElement(mo.Provider,{value:ty},t))}const ny={position:"fixed",touchAction:"none"},sy=e=>uo(e)?"transform 250ms ease":void 0,iy=m.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:i,className:o,rect:a,style:c,transform:u,transition:d=sy}=e;if(!a)return null;const f=s?u:{...u,scaleX:1,scaleY:1},g={...ny,width:a.width,height:a.height,top:a.top,left:a.left,transform:Vr.Transform.toString(f),transformOrigin:s&&n?Xg(n,a):void 0,transition:typeof d=="function"?d(n):d,...c};return m.createElement(r,{className:o,style:g,ref:t},i)}),oy=e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&n.node.style.setProperty(a,c);return o!=null&&o.active&&r.node.classList.add(o.active),o!=null&&o.dragOverlay&&n.node.classList.add(o.dragOverlay),function(){for(const[c,u]of Object.entries(s))r.node.style.setProperty(c,u);o!=null&&o.active&&r.node.classList.remove(o.active)}},ay=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Vr.Transform.toString(t)},{transform:Vr.Transform.toString(r)}]},ly={duration:250,easing:"ease",keyframes:ay,sideEffects:oy({styles:{active:{opacity:"0"}}})};function cy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return co((i,o)=>{if(t===null)return;const a=r.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=Tf(o);if(!u)return;const{transform:d}=Lt(o).getComputedStyle(o),f=mf(d);if(!f)return;const g=typeof t=="function"?t:uy(t);return _f(c,s.draggable.measure),g({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:o,rect:s.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function uy(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...ly,...e};return i=>{let{active:o,dragOverlay:a,transform:c,...u}=i;if(!t)return;const d={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/a.rect.height:1},g={x:c.x-d.x,y:c.y-d.y,...f},p=s({...u,active:o,dragOverlay:a,transform:{initial:c,final:g}}),[b]=p,h=p[p.length-1];if(JSON.stringify(b)===JSON.stringify(h))return;const v=n==null?void 0:n({active:o,dragOverlay:a,...u}),y=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(C=>{y.onfinish=()=>{v==null||v(),C()}})}}let wc=0;function dy(e){return m.useMemo(()=>{if(e!=null)return wc++,wc},[e])}const fy=m.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggableNodes:b,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:_,windowRect:x}=Lf(),E=m.useContext(mo),D=dy(f==null?void 0:f.id),T=If(o,{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:_,transform:E,windowRect:x}),j=Sl(g),F=cy({config:n,draggableNodes:b,droppableContainers:h,measuringConfiguration:C}),O=j?v.setRef:void 0;return m.createElement(ry,null,m.createElement(ey,{animation:F},f&&D?m.createElement(iy,{key:D,id:f.id,ref:O,as:a,activatorEvent:d,adjustScale:t,className:c,transition:i,rect:j,style:{zIndex:u,...s},transform:T},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 Oy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sf=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
186
+ */const hy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Of=(...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 Ay={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 py={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 Dy=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:a,...o},l)=>m.createElement("svg",{ref:l,...Ay,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:sf("lucide",s),...o},[...a.map(([u,d])=>m.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
196
+ */const my=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},c)=>m.createElement("svg",{ref:c,...py,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Of("lucide",s),...a},[...o.map(([u,d])=>m.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
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=m.forwardRef(({className:n,...s},i)=>m.createElement(Dy,{ref:i,iconNode:t,className:sf(`lucide-${Oy(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
201
+ */const ie=(e,t)=>{const r=m.forwardRef(({className:n,...s},i)=>m.createElement(my,{ref:i,iconNode:t,className:Of(`lucide-${hy(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 Ny=le("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
206
+ */const gy=ie("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 Ry=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 _l=ie("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 ky=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 vy=ie("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 jy=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 yy=ie("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 Wr=ie("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 Kn=le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
231
+ */const by=ie("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 af=le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
236
+ */const yn=ie("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 Ly=le("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
241
+ */const bn=ie("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 of=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 wl=ie("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 el=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 Cy=ie("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 Py=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 Nf=ie("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 Fy=le("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
261
+ */const go=ie("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 My=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 Sy=ie("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 lf=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 _y=ie("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 ea=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 wy=ie("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 Yn=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 jf=ie("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 By=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 xy=ie("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 cf=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 Zs=ie("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 Gr=ie("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 qy=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 xc=ie("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 uf=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 Ty=ie("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 Uy=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 Pf=ie("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 df=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 Rf=ie("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 tl=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 Ey=ie("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 rl=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 Ff=ie("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 zy=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 Ay=ie("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 hi=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 Mf=ie("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 nl=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 Ps=ie("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 sl=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 vo=ie("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 Vy=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 Iy=ie("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 Hy=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 Ti=ie("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 Qy=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 Bf=ie("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 Gy=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 ky=ie("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 Us=le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
371
+ */const yo=ie("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 sc=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 bo=ie("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 ic=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 Dy=ie("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 Wy=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 Ly=ie("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 Ky=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 Oy=ie("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 Yy=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 Ny=ie("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 go=le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
401
+ */const Cn=ie("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 Zy=le("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
406
+ */const Tc=ie("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 Xy=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 Ec=ie("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 Jy=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 jy=ie("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 ev=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 Py=ie("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 il=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 Ry=ie("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 tv=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 Wi=ie("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 yo=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 Fy=ie("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 rv=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 My=ie("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 nv=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 By=ie("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 al=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 qy=ie("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 Cr=le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),sv={},ac=e=>{let t;const r=new Set,n=(d,f)=>{const g=typeof d=="function"?d(t):d;if(!Object.is(g,t)){const p=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),r.forEach(C=>C(t,p))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(sv?"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()}},u=t=e(n,s,l);return l},iv=e=>e?ac(e):ac;function ff(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vo={exports:{}},wa={},Js={exports:{}},Ca={};/**
456
+ */const $y=ie("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 Co=ie("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 Uy=ie("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 Fa=ie("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 zy=ie("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 Vy=ie("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 So=ie("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 yr=ie("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 Hy=ie("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"}]]),Qy={},Ac=e=>{let t;const r=new Set,n=(d,f)=>{const g=typeof d=="function"?d(t):d;if(!Object.is(g,t)){const p=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),r.forEach(b=>b(t,p))}},s=()=>t,c={setState:n,getState:s,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Qy?"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()}},u=t=e(n,s,c);return c},Wy=e=>e?Ac(e):Ac;function xl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var di={exports:{}},qo={},fi={exports:{}},$o={};/**
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 oc;function av(){if(oc)return Ca;oc=1;var e=m;function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(f,g){var p=g(),C=n({inst:{value:p,getSnapshot:g}}),h=C[0].inst,y=C[1];return i(function(){h.value=p,h.getSnapshot=g,l(h)&&y({inst:h})},[f,p,g]),s(function(){return l(h)&&y({inst:h}),f(function(){l(h)&&y({inst:h})})},[f]),a(p),p}function l(f){var g=f.getSnapshot;f=f.value;try{var p=g();return!r(f,p)}catch{return!0}}function u(f,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return Ca.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Ca}var Sa={};/**
504
+ */var Ic;function Gy(){if(Ic)return $o;Ic=1;var e=m;function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(f,g){var p=g(),b=n({inst:{value:p,getSnapshot:g}}),h=b[0].inst,v=b[1];return i(function(){h.value=p,h.getSnapshot=g,c(h)&&v({inst:h})},[f,p,g]),s(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),o(p),p}function c(f){var g=f.getSnapshot;f=f.value;try{var p=g();return!r(f,p)}catch{return!0}}function u(f,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return $o.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,$o}var Uo={};/**
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 lc;function ov(){return lc||(lc=1,process.env.NODE_ENV!=="production"&&function(){function e(p,C){return p===C&&(p!==0||1/p===1/C)||p!==p&&C!==C}function t(p,C){d||s.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=C();if(!f){var y=C();i(h,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}y=a({inst:{value:h,getSnapshot:C}});var v=y[0].inst,b=y[1];return l(function(){v.value=h,v.getSnapshot=C,r(v)&&b({inst:v})},[p,h,C]),o(function(){return r(v)&&b({inst:v}),p(function(){r(v)&&b({inst:v})})},[p]),u(h),h}function r(p){var C=p.getSnapshot;p=p.value;try{var h=C();return!i(p,h)}catch{return!0}}function n(p,C){return C()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=m,i=typeof Object.is=="function"?Object.is:e,a=s.useState,o=s.useEffect,l=s.useLayoutEffect,u=s.useDebugValue,d=!1,f=!1,g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Sa.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:g,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Sa}var cc;function ol(){return cc||(cc=1,process.env.NODE_ENV==="production"?Js.exports=av():Js.exports=ov()),Js.exports}/**
512
+ */var kc;function Ky(){return kc||(kc=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}function t(p,b){d||s.startTransition===void 0||(d=!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();i(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=o({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})},[p,h,b]),a(function(){return r(y)&&C({inst:y}),p(function(){r(y)&&C({inst:y})})},[p]),u(h),h}function r(p){var b=p.getSnapshot;p=p.value;try{var h=b();return!i(p,h)}catch{return!0}}function n(p,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=m,i=typeof Object.is=="function"?Object.is:e,o=s.useState,a=s.useEffect,c=s.useLayoutEffect,u=s.useDebugValue,d=!1,f=!1,g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Uo.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:g,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Uo}var Dc;function Tl(){return Dc||(Dc=1,process.env.NODE_ENV==="production"?fi.exports=Gy():fi.exports=Ky()),fi.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 uc;function lv(){if(uc)return wa;uc=1;var e=m,t=ol();function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return wa.useSyncExternalStoreWithSelector=function(u,d,f,g,p){var C=i(null);if(C.current===null){var h={hasValue:!1,value:null};C.current=h}else h=C.current;C=o(function(){function v(E){if(!b){if(b=!0,w=E,E=g(E),p!==void 0&&h.hasValue){var D=h.value;if(p(D,E))return S=D}return S=E}if(D=S,n(w,E))return D;var R=g(E);return p!==void 0&&p(D,R)?(w=E,D):(w=E,S=R)}var b=!1,w,S,_=f===void 0?null:f;return[function(){return v(d())},_===null?void 0:function(){return v(_())}]},[d,f,g,p]);var y=s(u,C[0],C[1]);return a(function(){h.hasValue=!0,h.value=y},[y]),l(y),y},wa}var xa={};/**
520
+ */var Lc;function Yy(){if(Lc)return qo;Lc=1;var e=m,t=Tl();function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,c=e.useDebugValue;return qo.useSyncExternalStoreWithSelector=function(u,d,f,g,p){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=a(function(){function y(E){if(!C){if(C=!0,S=E,E=g(E),p!==void 0&&h.hasValue){var D=h.value;if(p(D,E))return _=D}return _=E}if(D=_,n(S,E))return D;var T=g(E);return p!==void 0&&p(D,T)?(S=E,D):(S=E,_=T)}var C=!1,S,_,x=f===void 0?null:f;return[function(){return y(d())},x===null?void 0:function(){return y(x())}]},[d,f,g,p]);var v=s(u,b[0],b[1]);return o(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},qo}var zo={};/**
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 dc;function cv(){return dc||(dc=1,process.env.NODE_ENV!=="production"&&function(){function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=m,r=ol(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,l=t.useDebugValue;xa.useSyncExternalStoreWithSelector=function(u,d,f,g,p){var C=i(null);if(C.current===null){var h={hasValue:!1,value:null};C.current=h}else h=C.current;C=o(function(){function v(E){if(!b){if(b=!0,w=E,E=g(E),p!==void 0&&h.hasValue){var D=h.value;if(p(D,E))return S=D}return S=E}if(D=S,n(w,E))return D;var R=g(E);return p!==void 0&&p(D,R)?(w=E,D):(w=E,S=R)}var b=!1,w,S,_=f===void 0?null:f;return[function(){return v(d())},_===null?void 0:function(){return v(_())}]},[d,f,g,p]);var y=s(u,C[0],C[1]);return a(function(){h.hasValue=!0,h.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())}()),xa}process.env.NODE_ENV==="production"?vo.exports=lv():vo.exports=cv();var uv=vo.exports;const dv=ff(uv),hf={},{useDebugValue:fv}=m,{useSyncExternalStoreWithSelector:hv}=dv;let fc=!1;const pv=e=>e;function mv(e,t=pv,r){(hf?"production":void 0)!=="production"&&r&&!fc&&(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"),fc=!0);const n=hv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return fv(n),n}const hc=e=>{(hf?"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"?iv(e):e,r=(n,s)=>mv(t,n,s);return Object.assign(r,t),r},zs=e=>e?hc(e):hc,oe=zs(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=oe.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}})})),gv=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:oe},Symbol.toStringTag,{value:"Module"}));function Gr(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 pf(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 i=pf(s.children,t,r+1);if(i>=0)return i}}return-1}const yv=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function mf(e,t,r){return e.map(n=>{if(n.id===t){const s=r.metadata??{},i={};for(const a of yv)a in r&&(i[a]=r[a]);return{...n,...r,metadata:{...n.metadata??{},...i,...s}}}return n.children&&n.children.length>0?{...n,children:mf(n.children,t,r)}:n})}function pi(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:pi(n.children,t,r)}:n)}function bo(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?bo(r.children,t):[]}))}function gf(e,t,r,n){return e.map(s=>{if(s.id===t){const i=[...s.children??[]],[a]=i.splice(r,1);return i.splice(n,0,a),{...s,children:i}}return s.children&&s.children.length>0?{...s,children:gf(s.children,t,r,n)}:s})}function yf(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?yf(r.children,t):[]}})}function vv(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 bv(e,t){const r=Gr(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Gr(e,s.parent):void 0;return n}const Oe=zs((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:i}=t(),a=Gr(n,r),o=i(r),l={...(a==null?void 0:a.metadata)??{},...s[r]??{}};oe.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),e({selectedNodeId:r,breadcrumb:o,activeNodeMeta:l})},updateNode:(r,n)=>{e(s=>({treeData:mf(s.treeData,r,n),treeCache:{...s.treeCache,[r]:{...s.treeCache[r]??{},...n}}})),t().markDirty()},addNode:(r,n)=>{var u,d;const s=t(),i=((d=(u=oe.getState().editorConfig)==null?void 0:u.config)==null?void 0:d.maxDepth)??4,a=pf(s.treeData,r);if(a>=i)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${i}). parentDepth=${a}`),"";const o="temp-"+Math.random().toString(36).slice(2),l={id:o,identifier:o,name:"Untitled Unit",isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:o,name:"Untitled Unit",visibility:"Parent"}};return e(f=>({treeData:pi(f.treeData,r,l),treeCache:{...f.treeCache,[o]:{...l.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(o),0),o},deleteNode:r=>{e(n=>({treeData:bo(n.treeData,r),selectedNodeId:n.selectedNodeId===r?null:n.selectedNodeId}))},reorderChildren:(r,n,s)=>{e(i=>({treeData:gf(i.treeData,r,n,s)}))},moveNode:(r,n,s)=>{e(i=>{const a=Gr(i.treeData,r);if(!a)return i;let o=bo(i.treeData,r);return o=pi(o,s,{...a,parent:s}),{treeData:o}}),t().markDirty()},addResource:(r,n)=>{var d,f,g;const s=oe.getState().editorConfig,i=((d=s==null?void 0:s.config)==null?void 0:d.allowContentUnderRoot)??!1,a=(f=t().treeData[0])==null?void 0:f.id;if(!i&&n===a||Gr(t().treeData,r.identifier))return!1;const o=((g=s==null?void 0:s.config)==null?void 0:g.maxContentsLimit)??1200;if(vv(t().treeData)>=o)return!1;const u={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(p=>({treeData:pi(p.treeData,n,u)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=oe.getState();r==="edit"&&n(!0)},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=yf(n.treeData,r),i={};for(const[o,l]of Object.entries(n.treeCache)){const u=r[o]??o,{isNew:d,...f}=l;i[u]=f}const a=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:s,treeCache:i,selectedNodeId:a}})},getNodeById:r=>Gr(t().treeData,r),getChildrenOf:r=>{const n=Gr(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>bv(t().treeData,r)})),wv=zs(e=>({activeModal:null,modalData:{},openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}})})),Cv="_spin_1ah4d_9",Sv={spin:Cv},xv={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"},_v={ariaLabel:"Select language"},Tv={errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},Ev={nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},Iv={detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},Ov={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"},Av={selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},Dv={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"},Nv={dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},Rv={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"},kv={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"},jv={shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},Lv={requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},Pv={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."},Fv={addPlaceholder:"Add…",addButtonLabel:"Add"},Mv={requiredError:"{field} is required"},Bv={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"},$v={requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},qv={requiredError:"{field} is required",selectPlaceholder:"Select license…"},Uv={requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},zv={requiredError:"{field} is required",selectPlaceholder:"Select…"},Vv={requiredError:"{field} is required"},Hv={requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Qv={requiredError:"{field} is required",maxLengthError:"Max {max} characters"},Gv={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"},Wv={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"},Kv={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"},Yv={confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},Zv={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"},Xv={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"},Jv={title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},eb={contentTypeFiltersAriaLabel:"Content type filters"},tb={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"},rb={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"},nb={boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},sb={contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},ib={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"},ab={expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},ob={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."},lb={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."},cb={unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},ub={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"},db={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"},fb={closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},hb={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"},pb={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"},mb={remove:"Remove"},gb={dropHere:"Drop here"},yb={loading:"Loading"},wo={contextualEditor:xv,languageSelector:_v,collectionEditor:Tv,breadcrumb:Ev,tabBar:Iv,contentEditForm:Ov,titleAppIcon:Av,unitContentList:Dv,contentRow:Nv,csvUpload:Rv,manageCollaborators:kv,sparkMetaForm:jv,appIconField:Lv,appIconPickerModal:Pv,chipGroupField:Fv,dateTimeField:Mv,dialcodeInputField:Bv,keywordSuggestField:$v,licenseSelectField:qv,multiSelectField:Uv,nestedSelectField:zv,radioField:Vv,selectField:Hv,textField:Qv,assetBrowser:Gv,resourceReorderDialog:Wv,assignPageNumber:Kv,confirmDialog:Yv,publishChecklist:Zv,qualityParamsModal:Xv,unsavedChangesModal:Jv,filterChips:eb,libraryCard:tb,libraryDock:rb,libraryFilterPanel:nb,libraryPreviewPanel:sb,outlineTree:ib,treeNode:ab,contentPlayer:ob,dialcodePanel:lb,progressStatus:cb,splitBuilderShell:ub,topbar:db,reviewCommentModal:fb,confirmReviewModal:hb,generateQRModal:pb,chip:mb,dropZone:gb,spinner:yb},vb={emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},bb={ariaLabel:"اختيار اللغة"},wb={errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},Cb={nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},Sb={detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},xb={moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},_b={selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},Tb={removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},Eb={dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},Ib={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:"تحميل"},Ob={saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},Ab={shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},Db={requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},Nb={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:"فشل التحميل."},Rb={addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},kb={requiredError:"{field} مطلوب"},jb={requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},Lb={requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},Pb={requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},Fb={requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},Mb={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},Bb={requiredError:"{field} مطلوب"},$b={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},qb={requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},Ub={dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},zb={dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},Vb={dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},Hb={confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},Qb={publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},Gb={reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},Wb={title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},Kb={contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},Yb={alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},Zb={selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},Xb={boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},Jb={contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},ew={maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},tw={expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},rw={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:"لم يتم العثور على السؤال في مجموعة الأسئلة."},nw={title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},sw={unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},iw={dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},aw={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:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},ow={closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},lw={closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},cw={closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},uw={remove:"إزالة"},dw={dropHere:"أفلت هنا"},fw={loading:"جارٍ التحميل"},hw={contextualEditor:vb,languageSelector:bb,collectionEditor:wb,breadcrumb:Cb,tabBar:Sb,contentEditForm:xb,titleAppIcon:_b,unitContentList:Tb,contentRow:Eb,csvUpload:Ib,manageCollaborators:Ob,sparkMetaForm:Ab,appIconField:Db,appIconPickerModal:Nb,chipGroupField:Rb,dateTimeField:kb,dialcodeInputField:jb,keywordSuggestField:Lb,licenseSelectField:Pb,multiSelectField:Fb,nestedSelectField:Mb,radioField:Bb,selectField:$b,textField:qb,assetBrowser:Ub,resourceReorderDialog:zb,assignPageNumber:Vb,confirmDialog:Hb,publishChecklist:Qb,qualityParamsModal:Gb,unsavedChangesModal:Wb,filterChips:Kb,libraryCard:Yb,libraryDock:Zb,libraryFilterPanel:Xb,libraryPreviewPanel:Jb,outlineTree:ew,treeNode:tw,contentPlayer:rw,dialcodePanel:nw,progressStatus:sw,splitBuilderShell:iw,topbar:aw,reviewCommentModal:ow,confirmReviewModal:lw,generateQRModal:cw,chip:uw,dropZone:dw,spinner:fw},pw={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é"},mw={ariaLabel:"Sélectionner la langue"},gw={errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},yw={nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},vw={detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},bw={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"},ww={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"},Cw={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"},Sw={dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},xw={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"},_w={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"},Tw={shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},Ew={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"},Iw={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é."},Ow={addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},Aw={requiredError:"{field} est requis"},Dw={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"},Nw={requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},Rw={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},kw={requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},jw={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},Lw={requiredError:"{field} est requis"},Pw={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},Fw={requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},Mw={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"},Bw={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"},$w={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"},qw={confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},Uw={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"},zw={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"},Vw={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"},Hw={contentTypeFiltersAriaLabel:"Filtres par type de contenu"},Qw={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é"},Gw={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"},Ww={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"},Kw={contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},Yw={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é"},Zw={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"},Xw={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."},Jw={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."},eC={unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},tC={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"},rC={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"},nC={closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},sC={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"},iC={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"},aC={remove:"Supprimer"},oC={dropHere:"Déposer ici"},lC={loading:"Chargement"},cC={contextualEditor:pw,languageSelector:mw,collectionEditor:gw,breadcrumb:yw,tabBar:vw,contentEditForm:bw,titleAppIcon:ww,unitContentList:Cw,contentRow:Sw,csvUpload:xw,manageCollaborators:_w,sparkMetaForm:Tw,appIconField:Ew,appIconPickerModal:Iw,chipGroupField:Ow,dateTimeField:Aw,dialcodeInputField:Dw,keywordSuggestField:Nw,licenseSelectField:Rw,multiSelectField:kw,nestedSelectField:jw,radioField:Lw,selectField:Pw,textField:Fw,assetBrowser:Mw,resourceReorderDialog:Bw,assignPageNumber:$w,confirmDialog:qw,publishChecklist:Uw,qualityParamsModal:zw,unsavedChangesModal:Vw,filterChips:Hw,libraryCard:Qw,libraryDock:Gw,libraryFilterPanel:Ww,libraryPreviewPanel:Kw,outlineTree:Yw,treeNode:Zw,contentPlayer:Xw,dialcodePanel:Jw,progressStatus:eC,splitBuilderShell:tC,topbar:rC,reviewCommentModal:nC,confirmReviewModal:sC,generateQRModal:iC,chip:aC,dropZone:oC,spinner:lC},uC={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"},dC={ariaLabel:"Selecionar idioma"},fC={errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},hC={nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},pC={detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},mC={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"},gC={selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},yC={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"},vC={dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},bC={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"},wC={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"},CC={shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},SC={requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},xC={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."},_C={addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},TC={requiredError:"{field} é obrigatório"},EC={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"},IC={requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},OC={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},AC={requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},DC={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},NC={requiredError:"{field} é obrigatório"},RC={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},kC={requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},jC={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"},LC={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"},PC={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"},FC={confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},MC={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"},BC={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"},$C={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"},qC={contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},UC={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"},zC={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"},VC={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"},HC={contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},QC={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"},GC={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"},WC={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."},KC={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."},YC={unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},ZC={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"},XC={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"},JC={closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},eS={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"},tS={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"},rS={remove:"Remover"},nS={dropHere:"Solte aqui"},sS={loading:"Carregando"},iS={contextualEditor:uC,languageSelector:dC,collectionEditor:fC,breadcrumb:hC,tabBar:pC,contentEditForm:mC,titleAppIcon:gC,unitContentList:yC,contentRow:vC,csvUpload:bC,manageCollaborators:wC,sparkMetaForm:CC,appIconField:SC,appIconPickerModal:xC,chipGroupField:_C,dateTimeField:TC,dialcodeInputField:EC,keywordSuggestField:IC,licenseSelectField:OC,multiSelectField:AC,nestedSelectField:DC,radioField:NC,selectField:RC,textField:kC,assetBrowser:jC,resourceReorderDialog:LC,assignPageNumber:PC,confirmDialog:FC,publishChecklist:MC,qualityParamsModal:BC,unsavedChangesModal:$C,filterChips:qC,libraryCard:UC,libraryDock:zC,libraryFilterPanel:VC,libraryPreviewPanel:HC,outlineTree:QC,treeNode:GC,contentPlayer:WC,dialcodePanel:KC,progressStatus:YC,splitBuilderShell:ZC,topbar:XC,reviewCommentModal:JC,confirmReviewModal:eS,generateQRModal:tS,chip:rS,dropZone:nS,spinner:sS},aS=["ar"],oS={en:wo,ar:hw,fr:cC,pt:iS};function vf(e,t){const r={...e};for(const n of Object.keys(t)){const s=e[n],i=t[n];s&&i&&typeof s=="object"&&typeof i=="object"&&!Array.isArray(s)&&!Array.isArray(i)?r[n]=vf(s,i):i!==void 0&&(r[n]=i)}return r}function pc(e){const t=oS[e];return!t||e==="en"?wo:vf(wo,t)}function lS(e){return aS.includes(e)}const Co="app-language",So="app-language-change",bf=zs(e=>({lang:"en",labelConfig:pc("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:pc(t)}),localStorage.setItem(Co,t),document.documentElement.setAttribute("dir",lS(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(So,{detail:{lang:t}}))}}));function ce(){return bf(e=>e.labelConfig)}const cS=({size:e=16,color:t="currentColor"})=>{const r=ce();return c.jsx("svg",{className:Sv.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"})})},Fe=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:i,className:a,type:o="button"})=>c.jsxs("button",{type:o,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${a??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?c.jsx(cS,{size:14}):null,i]}),uS="_overlay_w9xez_1",dS="_modal_w9xez_11",fS="_modalHeader_w9xez_23",hS="_modalHeaderClose_w9xez_33",pS="_modalBody_w9xez_51",mS="_modalFooter_w9xez_58",gS="_checkRow_w9xez_65",yS="_formGroup_w9xez_108",vS="_textarea_w9xez_119",bS="_sliderGroup_w9xez_140",wS="_sliderValue_w9xez_152",CS="_sliderLabels_w9xez_160",SS="_sectionTitle_w9xez_168",je={overlay:uS,modal:dS,modalHeader:fS,modalHeaderClose:hS,modalBody:pS,modalFooter:mS,checkRow:gS,formGroup:yS,textarea:vS,sliderGroup:bS,sliderValue:wS,sliderLabels:CS,sectionTitle:SS},xS=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ce(),s=oe(f=>{var g,p;return(p=(g=f.editorConfig)==null?void 0:g.config)==null?void 0:p.objectType})||"Content",i=oe(f=>f.publishChecklist)??[],[a,o]=m.useState({}),l=i.every(f=>a[f.code]),u=i.length===0||l,d=()=>{t()};return c.jsx("div",{className:je.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:c.jsxs("div",{className:je.modal,children:[c.jsxs("div",{className:je.modalHeader,children:[c.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),c.jsx("button",{className:je.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:je.modalBody,children:i.length===0?c.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",s,"?"]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:je.sectionTitle,children:n.publishChecklist.checklistInstructions}),i.map(f=>c.jsxs("label",{className:je.checkRow,children:[c.jsx("input",{type:"checkbox",checked:!!a[f.code],onChange:g=>o(p=>({...p,[f.code]:g.target.checked}))}),c.jsx("span",{children:f.label})]},f.code))]})}),c.jsxs("div",{className:je.modalFooter,children:[c.jsx(Fe,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),c.jsx(Fe,{variant:"primary",onClick:d,disabled:!u,children:n.publishChecklist.yesButton})]})]})})},_S=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const s=ce(),[i,a]=m.useState(""),[o,l]=m.useState(7),u=t==="approve",d=u?s.qualityParamsModal.reviewQualityTitle:s.qualityParamsModal.rejectContentTitle,f=!u&&i.trim().length===0,g=()=>{u?r(i.trim(),o):r(i.trim())};return c.jsx("div",{className:je.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:c.jsxs("div",{className:je.modal,children:[c.jsxs("div",{className:je.modalHeader,children:[c.jsx("span",{id:"quality-modal-title",children:d}),c.jsx("button",{className:je.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:je.modalBody,children:u?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:je.formGroup,children:[c.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),c.jsxs("div",{className:je.sliderGroup,children:[c.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:o,onChange:p=>l(Number(p.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":o}),c.jsx("span",{className:je.sliderValue,children:o})]}),c.jsxs("div",{className:je.sliderLabels,children:[c.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),c.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),c.jsxs("div",{className:je.formGroup,children:[c.jsxs("label",{htmlFor:"quality-comment",children:[s.qualityParamsModal.commentLabel," ",c.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:s.qualityParamsModal.optionalLabel})]}),c.jsx("textarea",{id:"quality-comment",className:je.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:i,onChange:p=>a(p.target.value),rows:4})]})]}):c.jsxs("div",{className:je.formGroup,children:[c.jsxs("label",{htmlFor:"reject-reason",children:[s.qualityParamsModal.rejectionReasonLabel," ",c.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:"reject-reason",className:je.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:i,onChange:p=>a(p.target.value),rows:5,required:!0,"aria-required":"true"}),i.trim().length===0&&c.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:s.qualityParamsModal.rejectionRequiredMessage})]})}),c.jsxs("div",{className:je.modalFooter,children:[c.jsx(Fe,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),c.jsx(Fe,{variant:u?"primary":"danger",onClick:g,disabled:f,children:u?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})};function wf(e,t){return function(){return e.apply(t,arguments)}}const{toString:TS}=Object.prototype,{getPrototypeOf:qn}=Object,{iterator:Vs,toStringTag:Cf}=Symbol,Li=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Os=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Li(r,t))return!0;r=qn(r)}return!1},ES=(e,t)=>e!=null&&Os(e,t)?e[t]:void 0,ll=(e=>t=>{const r=TS.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),tr=e=>(e=e.toLowerCase(),t=>ll(t)===e),ta=e=>t=>typeof t===e,{isArray:un}=Array,Un=ta("undefined");function Zn(e){return e!==null&&!Un(e)&&e.constructor!==null&&!Un(e.constructor)&&Nt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Sf=tr("ArrayBuffer");function IS(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Sf(e.buffer),t}const OS=ta("string"),Nt=ta("function"),xf=ta("number"),Xn=e=>e!==null&&typeof e=="object",AS=e=>e===!0||e===!1,mi=e=>{if(!Xn(e))return!1;const t=qn(e);return(t===null||t===Object.prototype||qn(t)===null)&&!Os(e,Cf)&&!Os(e,Vs)},DS=e=>{if(!Xn(e)||Zn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},NS=tr("Date"),RS=tr("File"),kS=e=>!!(e&&typeof e.uri<"u"),jS=e=>e&&typeof e.getParts<"u",LS=tr("Blob"),PS=tr("FileList"),FS=e=>Xn(e)&&Nt(e.pipe);function MS(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const mc=MS(),gc=typeof mc.FormData<"u"?mc.FormData:void 0,BS=e=>{if(!e)return!1;if(gc&&e instanceof gc)return!0;const t=qn(e);if(!t||t===Object.prototype||!Nt(e.append))return!1;const r=ll(e);return r==="formdata"||r==="object"&&Nt(e.toString)&&e.toString()==="[object FormData]"},$S=tr("URLSearchParams"),[qS,US,zS,VS]=["ReadableStream","Request","Response","Headers"].map(tr),HS=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hs(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),un(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Zn(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function _f(e,t){if(Zn(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 Kr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Tf=e=>!Un(e)&&e!==Kr;function xo(...e){const{caseless:t,skipUndefined:r}=Tf(this)&&this||{},n={},s=(i,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const o=t&&typeof a=="string"&&_f(n,a)||a,l=Li(n,o)?n[o]:void 0;mi(l)&&mi(i)?n[o]=xo(l,i):mi(i)?n[o]=xo({},i):un(i)?n[o]=i.slice():(!r||!Un(i))&&(n[o]=i)};for(let i=0,a=e.length;i<a;i++){const o=e[i];if(!o||Zn(o)||(Hs(o,s),typeof o!="object"||un(o)))continue;const l=Object.getOwnPropertySymbols(o);for(let u=0;u<l.length;u++){const d=l[u];nx.call(o,d)&&s(o[d],d)}}return n}const QS=(e,t,r,{allOwnKeys:n}={})=>(Hs(t,(s,i)=>{r&&Nt(s)?Object.defineProperty(e,i,{__proto__:null,value:wf(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),GS=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),WS=(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)},KS=(e,t,r,n)=>{let s,i,a;const o={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],(!n||n(a,e,t))&&!o[a]&&(t[a]=e[a],o[a]=!0);e=r!==!1&&qn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},YS=(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},ZS=e=>{if(!e)return null;if(un(e))return e;let t=e.length;if(!xf(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},XS=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qn(Uint8Array)),JS=(e,t)=>{const n=(e&&e[Vs]).call(e);let s;for(;(s=n.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},ex=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},tx=tr("HTMLFormElement"),rx=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:nx}=Object.prototype,sx=tr("RegExp"),Ef=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Hs(r,(s,i)=>{let a;(a=t(s,i,e))!==!1&&(n[i]=a||s)}),Object.defineProperties(e,n)},ix=e=>{Ef(e,(t,r)=>{if(Nt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Nt(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+"'")})}})},ax=(e,t)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return un(e)?n(e):n(String(e).split(t)),r},ox=()=>{},lx=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function cx(e){return!!(e&&Nt(e.append)&&e[Cf]==="FormData"&&e[Vs])}const ux=e=>{const t=new WeakSet,r=n=>{if(Xn(n)){if(t.has(n))return;if(Zn(n))return n;if(!("toJSON"in n)){t.add(n);const s=un(n)?[]:{};return Hs(n,(i,a)=>{const o=r(i);!Un(o)&&(s[a]=o)}),t.delete(n),s}}return n};return r(e)},dx=tr("AsyncFunction"),fx=e=>e&&(Xn(e)||Nt(e))&&Nt(e.then)&&Nt(e.catch),If=((e,t)=>e?setImmediate:t?((r,n)=>(Kr.addEventListener("message",({source:s,data:i})=>{s===Kr&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),Kr.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Nt(Kr.postMessage)),hx=typeof queueMicrotask<"u"?queueMicrotask.bind(Kr):typeof process<"u"&&process.nextTick||If,Of=e=>e!=null&&Nt(e[Vs]),px=e=>e!=null&&Os(e,Vs)&&Of(e),I={isArray:un,isArrayBuffer:Sf,isBuffer:Zn,isFormData:BS,isArrayBufferView:IS,isString:OS,isNumber:xf,isBoolean:AS,isObject:Xn,isPlainObject:mi,isEmptyObject:DS,isReadableStream:qS,isRequest:US,isResponse:zS,isHeaders:VS,isUndefined:Un,isDate:NS,isFile:RS,isReactNativeBlob:kS,isReactNative:jS,isBlob:LS,isRegExp:sx,isFunction:Nt,isStream:FS,isURLSearchParams:$S,isTypedArray:XS,isFileList:PS,forEach:Hs,merge:xo,extend:QS,trim:HS,stripBOM:GS,inherits:WS,toFlatObject:KS,kindOf:ll,kindOfTest:tr,endsWith:YS,toArray:ZS,forEachEntry:JS,matchAll:ex,isHTMLForm:tx,hasOwnProperty:Li,hasOwnProp:Li,hasOwnInPrototypeChain:Os,getSafeProp:ES,reduceDescriptors:Ef,freezeMethods:ix,toObjectSet:ax,toCamelCase:rx,noop:ox,toFiniteNumber:lx,findKey:_f,global:Kr,isContextDefined:Tf,isSpecCompliantForm:cx,toJSONObject:ux,isAsyncFn:dx,isThenable:fx,setImmediate:If,asap:hx,isIterable:Of,isSafeIterable:px},mx=I.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"]),gx=e=>{const t={};let r,n,s;return e&&e.split(`
489
- `).forEach(function(a){s=a.indexOf(":"),r=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!r||t[r]&&mx[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function yx(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 vx=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),bx=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function cl(e,t){return I.isArray(e)?e.map(r=>cl(r,t)):yx(String(e).replace(t,""))}const wx=e=>cl(e,vx),Cx=e=>cl(e,bx);function Af(e){const t=Object.create(null);return I.forEach(e.toJSON(),(r,n)=>{t[n]=Cx(r)}),t}const yc=Symbol("internals");function ss(e){return e&&String(e).trim().toLowerCase()}function gi(e){return e===!1||e==null?e:I.isArray(e)?e.map(gi):wx(String(e))}function Sx(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 xx=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function _a(e,t,r,n,s){if(I.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!I.isString(t)){if(I.isString(n))return t.indexOf(n)!==-1;if(I.isRegExp(n))return n.test(t)}}function _x(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Tx(e,t){const r=I.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,i,a){return this[n].call(this,t,s,i,a)},configurable:!0})})}let Ct=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function i(o,l,u){const d=ss(l);if(!d)return;const f=I.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||l]=gi(o))}const a=(o,l)=>I.forEach(o,(u,d)=>i(u,d,l));if(I.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(I.isString(t)&&(t=t.trim())&&!xx(t))a(gx(t),r);else if(I.isObject(t)&&I.isSafeIterable(t)){let o=Object.create(null),l,u;for(const d of t){if(!I.isArray(d))throw new TypeError("Object iterator must return a key-value pair");u=d[0],I.hasOwnProp(o,u)?(l=o[u],o[u]=I.isArray(l)?[...l,d[1]]:[l,d[1]]):o[u]=d[1]}a(o,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=ss(t),t){const n=I.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Sx(s);if(I.isFunction(r))return r.call(this,s,n);if(I.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ss(t),t){const n=I.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||_a(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function i(a){if(a=ss(a),a){const o=I.findKey(n,a);o&&(!r||_a(n,n[o],o,r))&&(delete n[o],s=!0)}}return I.isArray(t)?t.forEach(i):i(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!t||_a(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const r=this,n={};return I.forEach(this,(s,i)=>{const a=I.findKey(n,i);if(a){r[a]=gi(s),delete r[i];return}const o=t?_x(i):String(i).trim();o!==i&&delete r[i],r[o]=gi(s),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return I.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&I.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(s=>n.set(s)),n}static accessor(t){const n=(this[yc]=this[yc]={accessors:{}}).accessors,s=this.prototype;function i(a){const o=ss(a);n[o]||(Tx(s,a),n[o]=!0)}return I.isArray(t)?t.forEach(i):i(t),this}};Ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(Ct.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});I.freezeMethods(Ct);const Ex="[REDACTED ****]";function Ix(e){if(I.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(I.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Ox(e,t){const r=new Set(t.map(i=>String(i).toLowerCase())),n=[],s=i=>{if(i===null||typeof i!="object"||I.isBuffer(i))return i;if(n.indexOf(i)!==-1)return;i instanceof Ct&&(i=i.toJSON()),n.push(i);let a;if(I.isArray(i))a=[],i.forEach((o,l)=>{const u=s(o);I.isUndefined(u)||(a[l]=u)});else{if(!I.isPlainObject(i)&&Ix(i))return n.pop(),i;a=Object.create(null);for(const[o,l]of Object.entries(i)){const u=r.has(o.toLowerCase())?Ex:s(l);I.isUndefined(u)||(a[o]=u)}}return n.pop(),a};return s(e)}let Z=class Df extends Error{static from(t,r,n,s,i,a){const o=new Df(t.message,r||t.code,n,s,i);return o.cause=t,o.name=t.name,t.status!=null&&o.status==null&&(o.status=t.status),a&&Object.assign(o,a),o}constructor(t,r,n,s,i){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),i&&(this.response=i,this.status=i.status)}toJSON(){const t=this.config,r=t&&I.hasOwnProp(t,"redact")?t.redact:void 0,n=I.isArray(r)&&r.length>0?Ox(t,r):I.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 Ax=null,Nf=100;function _o(e){return I.isPlainObject(e)||I.isArray(e)}function Rf(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function Ta(e,t,r){return e?e.concat(t).map(function(s,i){return s=Rf(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function Dx(e){return I.isArray(e)&&!e.some(_o)}const Nx=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function ra(e,t,r){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!I.isUndefined(w[b])});const n=r.metaTokens,s=r.visitor||C,i=r.dots,a=r.indexes,o=r.Blob||typeof Blob<"u"&&Blob,l=r.maxDepth===void 0?Nf:r.maxDepth,u=o&&I.isSpecCompliantForm(t),d=[];if(!I.isFunction(s))throw new TypeError("visitor must be a function");function f(v){if(v===null)return"";if(I.isDate(v))return v.toISOString();if(I.isBoolean(v))return v.toString();if(!u&&I.isBlob(v))throw new Z("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(v)||I.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function g(v){if(v>l)throw new Z("Object is too deeply nested ("+v+" levels). Max depth: "+l,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(v,b){if(l===1/0)return JSON.stringify(v);const w=[];return JSON.stringify(v,function(_,E){if(!I.isObject(E))return E;for(;w.length&&w[w.length-1]!==this;)w.pop();return w.push(E),g(b+w.length-1),E})}function C(v,b,w){let S=v;if(I.isReactNative(t)&&I.isReactNativeBlob(v))return t.append(Ta(w,b,i),f(v)),!1;if(v&&!w&&typeof v=="object"){if(I.endsWith(b,"{}"))b=n?b:b.slice(0,-2),v=p(v,1);else if(I.isArray(v)&&Dx(v)||(I.isFileList(v)||I.endsWith(b,"[]"))&&(S=I.toArray(v)))return b=Rf(b),S.forEach(function(E,D){!(I.isUndefined(E)||E===null)&&t.append(a===!0?Ta([b],D,i):a===null?b:b+"[]",f(E))}),!1}return _o(v)?!0:(t.append(Ta(w,b,i),f(v)),!1)}const h=Object.assign(Nx,{defaultVisitor:C,convertValue:f,isVisitable:_o});function y(v,b,w=0){if(!I.isUndefined(v)){if(g(w),d.indexOf(v)!==-1)throw new Error("Circular reference detected in "+b.join("."));d.push(v),I.forEach(v,function(_,E){(!(I.isUndefined(_)||_===null)&&s.call(t,_,I.isString(E)?E.trim():E,b,h))===!0&&y(_,b?b.concat(E):[E],w+1)}),d.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return y(e),t}function vc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function ul(e,t){this._pairs=[],e&&ra(e,this,t)}const kf=ul.prototype;kf.append=function(t,r){this._pairs.push([t,r])};kf.toString=function(t){const r=t?function(n){return t.call(this,n,vc)}:vc;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Rx(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jf(e,t,r){if(!t)return e;const n=I.isFunction(r)?{serialize:r}:r,s=I.getSafeProp(n,"encode")||Rx,i=I.getSafeProp(n,"serialize");let a;if(i?a=i(t,n):a=I.isURLSearchParams(t)?t.toString():new ul(t,n).toString(s),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class bc{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){I.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},kx=typeof URLSearchParams<"u"?URLSearchParams:ul,jx=typeof FormData<"u"?FormData:null,Lx=typeof Blob<"u"?Blob:null,Px={isBrowser:!0,classes:{URLSearchParams:kx,FormData:jx,Blob:Lx},protocols:["http","https","file","blob","url","data"]},fl=typeof window<"u"&&typeof document<"u",To=typeof navigator=="object"&&navigator||void 0,Fx=fl&&(!To||["ReactNative","NativeScript","NS"].indexOf(To.product)<0),Mx=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bx=fl&&window.location.href||"http://localhost",$x=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fl,hasStandardBrowserEnv:Fx,hasStandardBrowserWebWorkerEnv:Mx,navigator:To,origin:Bx},Symbol.toStringTag,{value:"Module"})),ft={...$x,...Px};function qx(e,t){return ra(e,new ft.classes.URLSearchParams,{visitor:function(r,n,s,i){return ft.isNode&&I.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}const wc=Nf;function Lf(e){if(e>wc)throw new Z("FormData field is too deeply nested ("+e+" levels). Max depth: "+wc,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ux(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)Lf(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function zx(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function Pf(e){function t(r,n,s,i){Lf(i);let a=r[i++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),l=i>=r.length;return a=!a&&I.isArray(s)?s.length:a,l?(I.hasOwnProp(s,a)?s[a]=I.isArray(s[a])?s[a].concat(n):[s[a],n]:s[a]=n,!o):((!I.hasOwnProp(s,a)||!I.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],i)&&I.isArray(s[a])&&(s[a]=zx(s[a])),!o)}if(I.isFormData(e)&&I.isFunction(e.entries)){const r={};return I.forEachEntry(e,(n,s)=>{t(Ux(n),s,r,0)}),r}return null}const mn=(e,t)=>e!=null&&I.hasOwnProp(e,t)?e[t]:void 0;function Vx(e,t,r){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Qs={transitional:dl,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=I.isObject(t);if(i&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return s?JSON.stringify(Pf(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){const l=mn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return qx(t,l).toString();if((o=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=mn(this,"env"),d=u&&u.FormData;return ra(o?{"files[]":t}:t,d&&new d,l)}}return i||s?(r.setContentType("application/json",!1),Vx(t)):t}],transformResponse:[function(t){const r=mn(this,"transitional")||Qs.transitional,n=r&&r.forcedJSONParsing,s=mn(this,"responseType"),i=s==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(n&&!s||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,mn(this,"parseReviver"))}catch(l){if(o)throw l.name==="SyntaxError"?Z.from(l,Z.ERR_BAD_RESPONSE,this,null,mn(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}}};I.forEach(["delete","get","head","post","put","patch","query"],e=>{Qs.headers[e]={}});function Ea(e,t){const r=this||Qs,n=t||r,s=Ct.from(n.headers);let i=n.data;return I.forEach(e,function(o){i=o.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ff(e){return!!(e&&e.__CANCEL__)}let Gs=class extends Z{constructor(t,r,n){super(t??"canceled",Z.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function Mf(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 Hx(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Qx(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,i=0,a;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),d=n[i];a||(a=u),r[s]=l,n[s]=u;let f=i,g=0;for(;f!==s;)g+=r[f++],f=f%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-a<t)return;const p=d&&u-d;return p?Math.round(g*1e3/p):void 0}}function Gx(e,t){let r=0,n=1e3/t,s,i;const a=(u,d=Date.now())=>{r=d,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?a(u,d):(s=u,i||(i=setTimeout(()=>{i=null,a(s)},n-f)))},()=>s&&a(s)]}const Pi=(e,t,r=3)=>{let n=0;const s=Qx(50,250);return Gx(i=>{if(!i||typeof i.loaded!="number")return;const a=i.loaded,o=i.lengthComputable?i.total:void 0,l=o!=null?Math.min(a,o):a,u=Math.max(0,l-n),d=s(u);n=Math.max(n,l);const f={loaded:l,total:o,progress:o?l/o:void 0,bytes:u,rate:d||void 0,estimated:d&&o?(o-l)/d:void 0,event:i,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(f)},r)},Cc=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Sc=e=>(...t)=>I.asap(()=>e(...t)),Wx=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,Kx=ft.hasStandardBrowserEnv?{write(e,t,r,n,s,i,a){if(typeof document>"u")return;const o=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&o.push(`expires=${new Date(r).toUTCString()}`),I.isString(n)&&o.push(`path=${n}`),I.isString(s)&&o.push(`domain=${s}`),i===!0&&o.push("secure"),I.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.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 Yx(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zx(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Xx=/^https?:(?!\/\/)/i,Jx=/[\t\n\r]/g;function e_(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function t_(e){return e_(e).replace(Jx,"")}function xc(e,t){if(typeof e=="string"&&Xx.test(t_(e)))throw new Z('Invalid URL: missing "//" after protocol',Z.ERR_INVALID_URL,t)}function Bf(e,t,r,n){xc(t,n);let s=!Yx(t);return e&&(s||r===!1)?(xc(e,n),Zx(e,t)):t}const _c=e=>e instanceof Ct?{...e}:e;function dn(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(d,f,g,p){return I.isPlainObject(d)&&I.isPlainObject(f)?I.merge.call({caseless:p},d,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function s(d,f,g,p){if(I.isUndefined(f)){if(!I.isUndefined(d))return n(void 0,d,g,p)}else return n(d,f,g,p)}function i(d,f){if(!I.isUndefined(f))return n(void 0,f)}function a(d,f){if(I.isUndefined(f)){if(!I.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function o(d){const f=I.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!I.isUndefined(f))if(I.isPlainObject(f)){if(I.hasOwnProp(f,d))return f[d]}else return;const g=I.hasOwnProp(e,"transitional")?e.transitional:void 0;if(I.isPlainObject(g)&&I.hasOwnProp(g,d))return g[d]}function l(d,f,g){if(I.hasOwnProp(t,g))return n(d,f);if(I.hasOwnProp(e,g))return n(void 0,d)}const u={url:i,method:i,data:i,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:l,headers:(d,f,g)=>s(_c(d),_c(f),g,!0)};return I.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const g=I.hasOwnProp(u,f)?u[f]:s,p=I.hasOwnProp(e,f)?e[f]:void 0,C=I.hasOwnProp(t,f)?t[f]:void 0,h=g(p,C,f);I.isUndefined(h)&&g!==l||(r[f]=h)}),I.hasOwnProp(t,"validateStatus")&&I.isUndefined(t.validateStatus)&&o("validateStatusUndefinedResolves")===!1&&(I.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const r_=["content-type","content-length"];function n_(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{r_.includes(n.toLowerCase())&&e.set(n,s)})}const s_=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function $f(e){const t=dn({},e),r=g=>I.hasOwnProp(t,g)?t[g]:void 0,n=r("data");let s=r("withXSRFToken");const i=r("xsrfHeaderName"),a=r("xsrfCookieName");let o=r("headers");const l=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(t.headers=o=Ct.from(o),t.url=jf(Bf(u,f,d,t),r("params"),r("paramsSerializer")),l){const g=I.getSafeProp(l,"username")||"",p=I.getSafeProp(l,"password")||"";o.set("Authorization","Basic "+btoa(g+":"+(p?s_(p):"")))}if(I.isFormData(n)&&(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv||I.isReactNative(n)?o.setContentType(void 0):I.isFunction(n.getHeaders)&&n_(o,n.getHeaders(),r("formDataHeaderPolicy"))),ft.hasStandardBrowserEnv&&(I.isFunction(s)&&(s=s(t)),s===!0||s==null&&Wx(t.url))){const p=i&&a&&Kx.read(a);p&&o.set(i,p)}return t}const i_=typeof XMLHttpRequest<"u",a_=i_&&function(e){return new Promise(function(r,n){const s=$f(e);let i=s.data;const a=Ct.from(s.headers).normalize();let{responseType:o,onUploadProgress:l,onDownloadProgress:u}=s,d,f,g,p,C;function h(){p&&p(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function v(){if(!y)return;const w=Ct.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),_={data:!o||o==="text"||o==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:e,request:y};Mf(function(D){r(D),h()},function(D){n(D),h()},_),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)),h(),y=null)},y.onerror=function(S){const _=S&&S.message?S.message:"Network Error",E=new Z(_,Z.ERR_NETWORK,e,y);E.event=S||null,n(E),h(),y=null},y.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||dl;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),n(new Z(S,_.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,e,y)),h(),y=null},i===void 0&&a.setContentType(null),"setRequestHeader"in y&&I.forEach(Af(a),function(S,_){y.setRequestHeader(_,S)}),I.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),o&&o!=="json"&&(y.responseType=s.responseType),u&&([g,C]=Pi(u,!0),y.addEventListener("progress",g)),l&&y.upload&&([f,p]=Pi(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(d=w=>{y&&(n(!w||w.type?new Gs(null,e,y):w),y.abort(),h(),y=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const b=Hx(s.url);if(b&&!ft.protocols.includes(b)){n(new Z("Unsupported protocol "+b+":",Z.ERR_BAD_REQUEST,e));return}y.send(i||null)})},o_=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(l){if(!n){n=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof Z?u:new Gs(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new Z(`timeout of ${t}ms exceeded`,Z.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:o}=r;return o.unsubscribe=()=>I.asap(a),o},l_=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},c_=async function*(e,t){for await(const r of u_(e))yield*l_(r,t)},u_=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()}},Tc=(e,t,r,n)=>{const s=c_(e,t);let i=0,a,o=l=>{a||(a=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await s.next();if(u){o(),l.close();return}let f=d.byteLength;if(r){let g=i+=f;r(g)}l.enqueue(new Uint8Array(d))}catch(u){throw o(u),u}},cancel(l){return o(l),s.return()}},{highWaterMark:2})},Fi=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,d_=(e,t,r)=>t+2<r&&Fi(e.charCodeAt(t+1))&&Fi(e.charCodeAt(t+2));function f_(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 o=n.length;for(let p=0;p<o;p++)if(n.charCodeAt(p)===37&&p+2<o){const C=n.charCodeAt(p+1),h=n.charCodeAt(p+2);Fi(C)&&Fi(h)&&(a-=2,p+=2)}let l=0,u=o-1;const d=p=>p>=2&&n.charCodeAt(p-2)===37&&n.charCodeAt(p-1)===51&&(n.charCodeAt(p)===68||n.charCodeAt(p)===100);u>=0&&(n.charCodeAt(u)===61?(l++,u--):d(u)&&(l++,u-=3)),l===1&&u>=0&&(n.charCodeAt(u)===61||d(u))&&l++;const g=Math.floor(a/4)*3-(l||0);return g>0?g:0}let i=0;for(let a=0,o=n.length;a<o;a++){const l=n.charCodeAt(a);if(l===37&&d_(n,a,o))i+=1,a+=2;else if(l<128)i+=1;else if(l<2048)i+=2;else if(l>=55296&&l<=56319&&a+1<o){const u=n.charCodeAt(a+1);u>=56320&&u<=57343?(i+=4,a++):i+=3}else i+=3}return i}const hl="1.18.0",Ec=64*1024,{isFunction:ei}=I,h_=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Ic=e=>{if(!I.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Oc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},p_=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},m_=e=>{const t=I.global!==void 0&&I.global!==null?I.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=I.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:i,Response:a}=e,o=s?ei(s):typeof fetch=="function",l=ei(i),u=ei(a);if(!o)return!1;const d=o&&ei(r),f=o&&(typeof n=="function"?(v=>b=>v.encode(b))(new n):async v=>new Uint8Array(await new i(v).arrayBuffer())),g=l&&d&&Oc(()=>{let v=!1;const b=new i(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}),p=u&&d&&Oc(()=>I.isReadableStream(new a("").body)),C={stream:p&&(v=>v.body)};o&&["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 h=async v=>{if(v==null)return 0;if(I.isBlob(v))return v.size;if(I.isSpecCompliantForm(v))return(await new i(ft.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(I.isArrayBufferView(v)||I.isArrayBuffer(v))return v.byteLength;if(I.isURLSearchParams(v)&&(v=v+""),I.isString(v))return(await f(v)).byteLength},y=async(v,b)=>{const w=I.toFiniteNumber(v.getContentLength());return w??h(b)};return async v=>{let{url:b,method:w,data:S,signal:_,cancelToken:E,timeout:D,onDownloadProgress:R,onUploadProgress:M,responseType:$,headers:N,withCredentials:j="same-origin",fetchOptions:P,maxContentLength:k,maxBodyLength:L}=$f(v);const V=I.isNumber(k)&&k>-1,X=I.isNumber(L)&&L>-1,ye=H=>I.hasOwnProp(v,H)?v[H]:void 0;let _e=s||fetch;$=$?($+"").toLowerCase():"text";let we=o_([_,E&&E.toAbortSignal()],D),de=null;const Q=we&&we.unsubscribe&&(()=>{we.unsubscribe()});let ne,te=null;const U=()=>new Z("Request body larger than maxBodyLength limit",Z.ERR_BAD_REQUEST,v,de);try{let H;const ie=ye("auth");if(ie){const re=I.getSafeProp(ie,"username")||"",He=I.getSafeProp(ie,"password")||"";H={username:re,password:He}}if(p_(b)){const re=new URL(b,ft.origin);if(!H&&(re.username||re.password)){const He=Ic(re.username),ze=Ic(re.password);H={username:He,password:ze}}(re.username||re.password)&&(re.username="",re.password="",b=re.href)}if(H&&(N.delete("authorization"),N.set("Authorization","Basic "+btoa(h_((H.username||"")+":"+(H.password||""))))),V&&typeof b=="string"&&b.startsWith("data:")&&f_(b)>k)throw new Z("maxContentLength size of "+k+" exceeded",Z.ERR_BAD_RESPONSE,v,de);if(X&&w!=="get"&&w!=="head"){const re=await h(S);if(typeof re=="number"&&isFinite(re)&&(ne=re,re>L))throw U()}const fe=X&&(I.isReadableStream(S)||I.isStream(S)),J=(re,He,ze)=>Tc(re,Ec,Ue=>{if(X&&Ue>L)throw te=U();He&&He(Ue)},ze);if(g&&w!=="get"&&w!=="head"&&(M||fe)){if(ne=ne??await y(N,S),ne!==0||fe){let re=new i(b,{method:"POST",body:S,duplex:"half"}),He;if(I.isFormData(S)&&(He=re.headers.get("content-type"))&&N.setContentType(He),re.body){const[ze,Ue]=M&&Cc(ne,Pi(Sc(M)))||[];S=J(re.body,ze,Ue)}}}else if(fe&&!l&&d&&w!=="get"&&w!=="head")S=J(S);else if(fe&&l&&!g&&w!=="get"&&w!=="head")throw new Z("Stream request bodies are not supported by the current fetch implementation",Z.ERR_NOT_SUPPORT,v,de);I.isString(j)||(j=j?"include":"omit");const se=l&&"credentials"in i.prototype;if(I.isFormData(S)){const re=N.getContentType();re&&/^multipart\/form-data/i.test(re)&&!/boundary=/i.test(re)&&N.delete("content-type")}N.set("User-Agent","axios/"+hl,!1);const ke={...P,signal:we,method:w.toUpperCase(),headers:Af(N.normalize()),body:S,duplex:"half",credentials:se?j:void 0};de=l&&new i(b,ke);let Te=await(l?_e(de,P):_e(b,ke));const $e=Ct.from(Te.headers);if(V){const re=I.toFiniteNumber($e.getContentLength());if(re!=null&&re>k)throw new Z("maxContentLength size of "+k+" exceeded",Z.ERR_BAD_RESPONSE,v,de)}const Ve=p&&($==="stream"||$==="response");if(p&&Te.body&&(R||V||Ve&&Q)){const re={};["status","statusText","headers"].forEach(St=>{re[St]=Te[St]});const He=I.toFiniteNumber($e.getContentLength()),[ze,Ue]=R&&Cc(He,Pi(Sc(R),!0))||[];let Ze=0;const Bt=St=>{if(V&&(Ze=St,Ze>k))throw new Z("maxContentLength size of "+k+" exceeded",Z.ERR_BAD_RESPONSE,v,de);ze&&ze(St)};Te=new a(Tc(Te.body,Ec,Bt,()=>{Ue&&Ue(),Q&&Q()}),re)}$=$||"text";let qe=await C[I.findKey(C,$)||"text"](Te,v);if(V&&!p&&!Ve){let re;if(qe!=null&&(typeof qe.byteLength=="number"?re=qe.byteLength:typeof qe.size=="number"?re=qe.size:typeof qe=="string"&&(re=typeof n=="function"?new n().encode(qe).byteLength:qe.length)),typeof re=="number"&&re>k)throw new Z("maxContentLength size of "+k+" exceeded",Z.ERR_BAD_RESPONSE,v,de)}return!Ve&&Q&&Q(),await new Promise((re,He)=>{Mf(re,He,{data:qe,headers:Ct.from(Te.headers),status:Te.status,statusText:Te.statusText,config:v,request:de})})}catch(H){if(Q&&Q(),we&&we.aborted&&we.reason instanceof Z){const ie=we.reason;throw ie.config=v,de&&(ie.request=de),H!==ie&&(ie.cause=H),ie}throw te?(de&&!te.request&&(te.request=de),te):H instanceof Z?(de&&!H.request&&(H.request=de),H):H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new Z("Network Error",Z.ERR_NETWORK,v,de,H&&H.response),{cause:H.cause||H}):Z.from(H,H&&H.code,v,de,H&&H.response)}}},g_=new Map,qf=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,i=[n,s,r];let a=i.length,o=a,l,u,d=g_;for(;o--;)l=i[o],u=d.get(l),u===void 0&&d.set(l,u=o?new Map:m_(t)),d=u;return u};qf();const pl={http:Ax,xhr:a_,fetch:{get:qf}};I.forEach(pl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Ac=e=>`- ${e}`,y_=e=>I.isFunction(e)||e===null||e===!1;function v_(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let n,s;const i={};for(let a=0;a<r;a++){n=e[a];let o;if(s=n,!y_(n)&&(s=pl[(o=String(n)).toLowerCase()],s===void 0))throw new Z(`Unknown adapter '${o}'`);if(s&&(I.isFunction(s)||(s=s.get(t))))break;i[o||"#"+a]=s}if(!s){const a=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=r?a.length>1?`since :
491
- `+a.map(Ac).join(`
492
- `):" "+Ac(a[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s}const Uf={getAdapter:v_,adapters:pl};function Ia(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Gs(null,e)}function Dc(e){return Ia(e),e.headers=Ct.from(e.headers),e.data=Ea.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Uf.getAdapter(e.adapter||Qs.adapter,e)(e).then(function(n){Ia(e),e.response=n;try{n.data=Ea.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=Ct.from(n.headers),n},function(n){if(!Ff(n)&&(Ia(e),n&&n.response)){e.response=n.response;try{n.response.data=Ea.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=Ct.from(n.response.headers)}return Promise.reject(n)})}const na={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{na[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Nc={};na.transitional=function(t,r,n){function s(i,a){return"[Axios v"+hl+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return(i,a,o)=>{if(t===!1)throw new Z(s(a," has been removed"+(r?" in "+r:"")),Z.ERR_DEPRECATED);return r&&!Nc[a]&&(Nc[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,o):!0}};na.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function b_(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 s=n.length;for(;s-- >0;){const i=n[s],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){const o=e[i],l=o===void 0||a(o,i,e);if(l!==!0)throw new Z("option "+i+" must be "+l,Z.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Z("Unknown option "+i,Z.ERR_BAD_OPTION)}}const yi={assertOptions:b_,validators:na},pt=yi.validators;let ln=class{constructor(t){this.defaults=t||{},this.interceptors={request:new bc,response:new bc}}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 i=(()=>{if(!s.stack)return"";const a=s.stack.indexOf(`
493
- `);return a===-1?"":s.stack.slice(a+1)})();try{if(!n.stack)n.stack=i;else if(i){const a=i.indexOf(`
494
- `),o=a===-1?-1:i.indexOf(`
495
- `,a+1),l=o===-1?"":i.slice(o+1);String(n.stack).endsWith(l)||(n.stack+=`
496
- `+i)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dn(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&yi.assertOptions(n,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean),legacyInterceptorReqResOrdering:pt.transitional(pt.boolean),advertiseZstdAcceptEncoding:pt.transitional(pt.boolean),validateStatusUndefinedResolves:pt.transitional(pt.boolean)},!1),s!=null&&(I.isFunction(s)?r.paramsSerializer={serialize:s}:yi.assertOptions(s,{encode:pt.function,serialize:pt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),yi.assertOptions(r,{baseUrl:pt.spelling("baseURL"),withXsrfToken:pt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=i&&I.merge(i.common,i[r.method]);i&&I.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete i[C]}),r.headers=Ct.concat(a,i);const o=[];let l=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(r)===!1)return;l=l&&h.synchronous;const y=r.transitional||dl;y&&y.legacyInterceptorReqResOrdering?o.unshift(h.fulfilled,h.rejected):o.push(h.fulfilled,h.rejected)});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,g;if(!l){const C=[Dc.bind(this),void 0];for(C.unshift(...o),C.push(...u),g=C.length,d=Promise.resolve(r);f<g;)d=d.then(C[f++],C[f++]);return d}g=o.length;let p=r;for(;f<g;){const C=o[f++],h=o[f++];try{p=C(p)}catch(y){h.call(this,y);break}}try{d=Dc.call(this,p)}catch(C){return Promise.reject(C)}for(f=0,g=u.length;f<g;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=dn(this.defaults,t);const r=Bf(t.baseURL,t.url,t.allowAbsoluteUrls,t);return jf(r,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){ln.prototype[t]=function(r,n){return this.request(dn(n||{},{method:t,url:r,data:n&&I.hasOwnProp(n,"data")?n.data:void 0}))}});I.forEach(["post","put","patch","query"],function(t){function r(n){return function(i,a,o){return this.request(dn(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}ln.prototype[t]=r(),t!=="query"&&(ln.prototype[t+"Form"]=r(!0))});let w_=class zf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(o=>{n.subscribe(o),i=o}).then(s);return a.cancel=function(){n.unsubscribe(i)},a},t(function(i,a,o){n.reason||(n.reason=new Gs(i,a,o),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 zf(function(s){t=s}),cancel:t}}};function C_(e){return function(r){return e.apply(null,r)}}function S_(e){return I.isObject(e)&&e.isAxiosError===!0}const Eo={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(Eo).forEach(([e,t])=>{Eo[t]=e});function Vf(e){const t=new ln(e),r=wf(ln.prototype.request,t);return I.extend(r,ln.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Vf(dn(e,s))},r}const Xe=Vf(Qs);Xe.Axios=ln;Xe.CanceledError=Gs;Xe.CancelToken=w_;Xe.isCancel=Ff;Xe.VERSION=hl;Xe.toFormData=ra;Xe.AxiosError=Z;Xe.Cancel=Xe.CanceledError;Xe.all=function(t){return Promise.all(t)};Xe.spread=C_;Xe.isAxiosError=S_;Xe.mergeConfig=dn;Xe.AxiosHeaders=Ct;Xe.formToJSON=e=>Pf(I.isHTMLForm(e)?new FormData(e):e);Xe.getAdapter=Uf.getAdapter;Xe.HttpStatusCode=Eo;Xe.default=Xe;const{Axios:eM,AxiosError:tM,CanceledError:rM,isCancel:nM,CancelToken:sM,VERSION:iM,all:aM,Cancel:oM,isAxiosError:lM,spread:cM,toFormData:uM,AxiosHeaders:dM,HttpStatusCode:fM,formToJSON:hM,getAdapter:pM,mergeConfig:mM,create:gM}=Xe;let Io="";function Hf(e){Io=e}const Ne=Xe.create({timeout:3e4});Ne.interceptors.request.use(async e=>{var s;const{useEditorStore:t}=await Promise.resolve().then(()=>gv),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),Io&&(e.baseURL=Io),e});const Qf=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function x_(e,t={}){var l,u,d,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 s=e.includes("@"),i=/^\d{10,}$/.test(e.trim()),a={filters:n,fields:Qf,offset:0,limit:t.limit??200};return s?n.email=e.trim():i?n.phone=e.trim():a.query=e,((f=(d=(u=(await Ne.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:u.result)==null?void 0:d.response)==null?void 0:f.content)??[]}async function __(e){var r,n,s;return e.length?((s=(n=(r=(await Ne.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Qf,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 T_(e){var r,n;return((n=(r=(await Ne.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const Gf="/portal";async function Wf(e){var n,s,i,a,o,l,u;const t=await Ne.get(`${Gf}/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 d=((a=(i=t.data)==null?void 0:i.params)==null?void 0:a.errmsg)||((l=(o=t.data)==null?void 0:o.params)==null?void 0:l.err)||((u=t.data)==null?void 0:u.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${d}`)}return r}async function E_(e){var r,n;return e.length?((n=(r=(await Ne.post(`${Gf}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function ml(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",i=r.mimeType??"",a=r.children,o=Array.isArray(a)?a.map(u=>ml(u,n)):[],l=i==="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"||i==="application/vnd.sunbird.questionset"&&o.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:l,children:o,metadata:r,parent:t}}async function Kf(e){var s,i,a,o,l,u,d;const t=await Ne.get(`/action/content/v3/hierarchy/${e}`,{params:{mode:"edit"}}),r=(i=(s=t.data)==null?void 0:s.result)==null?void 0:i.content;if(!r||!r.identifier){const f=((o=(a=t.data)==null?void 0:a.params)==null?void 0:o.errmsg)||((u=(l=t.data)==null?void 0:l.params)==null?void 0:u.err)||((d=t.data)==null?void 0:d.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=ml(r);return{content:r,rootNode:n}}async function I_(e){const t=await Wf(e),r=ml(t);return{content:t,rootNode:r}}async function O_(e,t,r,n){var i;return((i=(await Ne.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:i.result)??{}}async function A_(e,t=""){await Ne.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function D_(e){var r,n;return(n=(r=(await Ne.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function N_(e){await Ne.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function R_(e,t){await Ne.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function k_(e,t){await Ne.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const j_="_container_r27rp_1",L_="_header_r27rp_13",P_="_title_r27rp_22",F_="_closeBtn_r27rp_29",M_="_body_r27rp_45",B_="_label_r27rp_54",$_="_searchSection_r27rp_62",q_="_searchRow_r27rp_68",U_="_searchInput_r27rp_74",z_="_searchSpinner_r27rp_89",V_="_resultsList_r27rp_105",H_="_resultItem_r27rp_118",Q_="_userInfo_r27rp_133",G_="_userName_r27rp_141",W_="_userEmail_r27rp_150",K_="_userOrg_r27rp_158",Y_="_noResults_r27rp_167",Z_="_collabSection_r27rp_174",X_="_sectionTitle_r27rp_179",J_="_badge_r27rp_189",e0="_emptyCollab_r27rp_203",t0="_collabList_r27rp_214",r0="_collabItem_r27rp_223",n0="_userAvatar_r27rp_237",s0="_error_r27rp_251",i0="_success_r27rp_257",a0="_footer_r27rp_263",Ie={container:j_,header:L_,title:P_,closeBtn:F_,body:M_,label:B_,searchSection:$_,searchRow:q_,searchInput:U_,searchSpinner:z_,resultsList:V_,resultItem:H_,userInfo:Q_,userName:G_,userEmail:W_,userOrg:K_,noResults:Y_,collabSection:Z_,sectionTitle:X_,badge:J_,emptyCollab:e0,collabList:t0,collabItem:r0,userAvatar:n0,error:s0,success:i0,footer:a0},o0=({contentId:e,onClose:t})=>{var M,$;const r=ce(),n=oe(N=>N.editorConfig),s=(M=n==null?void 0:n.context)==null?void 0:M.channel,i=($=n==null?void 0:n.config)==null?void 0:$.objectType,[a,o]=m.useState(""),[l,u]=m.useState([]),[d,f]=m.useState(!1),[g,p]=m.useState([]),[C,h]=m.useState(!1),[y,v]=m.useState(""),[b,w]=m.useState(!1),S=m.useRef(null);m.useEffect(()=>{let N=!1;return(async()=>{try{const j=await D_(e),P=(j==null?void 0:j.collaborators)??[];if(!P.length)return;const k=await __(P);if(N)return;const L=P.map(V=>k.find(X=>X.identifier===V)??{identifier:V,firstName:V});p(L)}catch{}})(),()=>{N=!0}},[e]),m.useEffect(()=>{S.current&&clearTimeout(S.current);const N=a.trim();if(N.length<2){u([]);return}return S.current=setTimeout(async()=>{f(!0);try{const j=await x_(N,{rootOrgId:s,objectType:i}),P=new Set(g.map(k=>k.identifier));u(j.filter(k=>!P.has(k.identifier)))}catch{u([])}finally{f(!1)}},300),()=>{S.current&&clearTimeout(S.current)}},[a,g,s,i]);const _=m.useCallback(N=>{p(j=>j.find(P=>P.identifier===N.identifier)?j:[...j,N]),u(j=>j.filter(P=>P.identifier!==N.identifier)),w(!1)},[]),E=m.useCallback(N=>{p(j=>j.filter(P=>P.identifier!==N)),w(!1)},[]),D=m.useCallback(async()=>{h(!0),v(""),w(!1);try{await k_(e,g.map(N=>N.identifier)),w(!0)}catch{v(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,g,r.manageCollaborators.saveFailed]),R=N=>`${N.firstName}${N.lastName?` ${N.lastName}`:""}`;return c.jsxs("div",{className:Ie.container,children:[c.jsxs("div",{className:Ie.header,children:[c.jsx("h2",{className:Ie.title,children:r.manageCollaborators.title}),c.jsx("button",{className:Ie.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:c.jsx(Cr,{size:18})})]}),c.jsxs("div",{className:Ie.body,children:[c.jsxs("div",{className:Ie.searchSection,children:[c.jsx("label",{className:Ie.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),c.jsxs("div",{className:Ie.searchRow,children:[c.jsx("input",{id:"collab-search",type:"text",className:Ie.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:a,onChange:N=>o(N.target.value)}),d&&c.jsx("span",{className:Ie.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),l.length>0&&c.jsx("ul",{className:Ie.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:l.map(N=>{var j,P,k,L;return c.jsxs("li",{className:Ie.resultItem,role:"option","aria-selected":"false",children:[c.jsxs("div",{className:Ie.userInfo,children:[c.jsx("span",{className:Ie.userName,children:R(N)}),N.email&&c.jsx("span",{className:Ie.userEmail,children:N.email}),(((P=(j=N.organisations)==null?void 0:j[0])==null?void 0:P.orgName)??N.rootOrgName)&&c.jsx("span",{className:Ie.userOrg,children:((L=(k=N.organisations)==null?void 0:k[0])==null?void 0:L.orgName)??N.rootOrgName})]}),c.jsx(Fe,{variant:"primary",size:"sm",onClick:()=>_(N),children:r.manageCollaborators.add})]},N.identifier)})}),a.trim().length>=2&&!d&&l.length===0&&c.jsx("p",{className:Ie.noResults,children:r.manageCollaborators.noUsersFound})]}),c.jsxs("div",{className:Ie.collabSection,children:[c.jsxs("h3",{className:Ie.sectionTitle,children:[r.manageCollaborators.currentCollaborators,g.length>0&&c.jsx("span",{className:Ie.badge,children:g.length})]}),g.length===0?c.jsx("p",{className:Ie.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):c.jsx("ul",{className:Ie.collabList,children:g.map(N=>{var j,P,k,L;return c.jsxs("li",{className:Ie.collabItem,children:[c.jsx("div",{className:Ie.userAvatar,"aria-hidden":"true",children:R(N).charAt(0).toUpperCase()}),c.jsxs("div",{className:Ie.userInfo,children:[c.jsx("span",{className:Ie.userName,children:R(N)}),N.email&&c.jsx("span",{className:Ie.userEmail,children:N.email}),(((P=(j=N.organisations)==null?void 0:j[0])==null?void 0:P.orgName)??N.rootOrgName)&&c.jsx("span",{className:Ie.userOrg,children:((L=(k=N.organisations)==null?void 0:k[0])==null?void 0:L.orgName)??N.rootOrgName})]}),c.jsx(Fe,{variant:"danger",size:"sm",onClick:()=>E(N.identifier),children:r.manageCollaborators.remove})]},N.identifier)})})]}),y&&c.jsx("p",{className:Ie.error,role:"alert",children:y}),b&&c.jsx("p",{className:Ie.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),c.jsxs("div",{className:Ie.footer,children:[c.jsx(Fe,{variant:"ghost",onClick:t,disabled:C,children:r.manageCollaborators.cancel}),c.jsx(Fe,{variant:"primary",isLoading:C,onClick:D,children:r.manageCollaborators.save})]})]})};async function l0(e){return(await Ne.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function c0(e,t){var s;const n=((s=(await Ne.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 u0(e){var n;const r=((n=(await Ne.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 d0="_topbar_zj8wk_1",f0="_left_zj8wk_15",h0="_right_zj8wk_23",p0="_backBtn_zj8wk_30",m0="_title_zj8wk_49",g0="_statusChip_zj8wk_61",y0="_savedIndicator_zj8wk_73",v0="_unsaved_zj8wk_83",b0="_iconBtn_zj8wk_88",w0="_iconBtnLabel_zj8wk_115",C0="_qrDropdown_zj8wk_119",S0="_qrMenu_zj8wk_123",x0="_reviewBtns_zj8wk_158",_0="_sourcingBtns_zj8wk_167",T0="_modalOverlay_zj8wk_176",E0="_sbOverlay_zj8wk_186",I0="_sbModal_zj8wk_196",O0="_sbModalHeader_zj8wk_207",A0="_sbModalTitle_zj8wk_215",D0="_sbModalClose_zj8wk_222",N0="_sbModalBody_zj8wk_235",R0="_sbLabel_zj8wk_242",k0="_sbTextarea_zj8wk_249",j0="_sbError_zj8wk_266",L0="_sbModalFooter_zj8wk_273",ue={topbar:d0,left:f0,right:h0,backBtn:p0,title:m0,statusChip:g0,savedIndicator:y0,unsaved:v0,iconBtn:b0,iconBtnLabel:w0,qrDropdown:C0,qrMenu:S0,reviewBtns:x0,sourcingBtns:_0,modalOverlay:T0,sbOverlay:E0,sbModal:I0,sbModalHeader:O0,sbModalTitle:A0,sbModalClose:D0,sbModalBody:N0,sbLabel:R0,sbTextarea:k0,sbError:j0,sbModalFooter:L0};function P0(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function F0(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const M0=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:s="primary",onConfirm:i,onCancel:a})=>{const o=ce(),[l,u]=m.useState(""),d=e.toLowerCase().replace(/\s+/g,"-");return c.jsx("div",{className:ue.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,children:c.jsxs("div",{className:ue.sbModal,children:[c.jsxs("div",{className:ue.sbModalHeader,children:[c.jsx("span",{id:`${d}-title`,className:ue.sbModalTitle,children:e}),c.jsx("button",{className:ue.sbModalClose,onClick:a,"aria-label":o.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:ue.sbModalBody,children:[c.jsxs("label",{className:ue.sbLabel,htmlFor:`${d}-comment`,children:[t," ",c.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:`${d}-comment`,className:ue.sbTextarea,placeholder:r,value:l,onChange:f=>u(f.target.value),rows:4,required:!0,"aria-required":"true"}),l.trim().length===0&&c.jsx("p",{className:ue.sbError,children:o.reviewCommentModal.fillCommentsError})]}),c.jsxs("div",{className:ue.sbModalFooter,children:[c.jsx(Fe,{variant:"ghost",onClick:a,children:o.reviewCommentModal.cancelButton}),c.jsx(Fe,{variant:s,onClick:()=>i(l.trim()),disabled:l.trim().length===0,children:n})]})]})})},B0=({onConfirm:e,onCancel:t})=>{const r=ce(),[n,s]=m.useState(!1);return c.jsx("div",{className:ue.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:c.jsxs("div",{className:ue.sbModal,children:[c.jsxs("div",{className:ue.sbModalHeader,children:[c.jsx("span",{id:"review-confirm-title",className:ue.sbModalTitle,children:r.confirmReviewModal.title}),c.jsx("button",{className:ue.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsx("div",{className:ue.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:i=>s(i.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:ue.sbModalFooter,children:[c.jsx(Fe,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),c.jsx(Fe,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},$0=({onConfirm:e,onCancel:t})=>{const r=ce(),[n,s]=m.useState(""),i=parseInt(n,10),a=!isNaN(i)&&i>=2&&i<=250;return c.jsx("div",{className:ue.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:c.jsxs("div",{className:ue.sbModal,children:[c.jsxs("div",{className:ue.sbModalHeader,children:[c.jsx("span",{id:"genqr-title",className:ue.sbModalTitle,children:r.generateQRModal.title}),c.jsx("button",{className:ue.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:ue.sbModalBody,children:[c.jsxs("label",{className:ue.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:ue.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:o=>s(o.target.value)}),n&&!a&&c.jsx("p",{className:ue.sbError,children:r.generateQRModal.countRangeError})]}),c.jsxs("div",{className:ue.sbModalFooter,children:[c.jsx(Fe,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),c.jsx(Fe,{variant:"primary",onClick:()=>e(i),disabled:!a,children:r.generateQRModal.generateButton})]})]})})},q0=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:s=!0,onToolbarEvent:i})=>{var ie,fe;const a=ce(),l=Oe(J=>J.treeData)[0],u=(l==null?void 0:l.name)??a.contextualEditor.untitledPlaceholder,d=F0(((ie=l==null?void 0:l.metadata)==null?void 0:ie.status)??(l==null?void 0:l.status),a.topbar.draftStatusFallback),f=oe(J=>{var se,ke,Te,$e;return((ke=(se=J.editorConfig)==null?void 0:se.context)==null?void 0:ke.contentId)??(($e=(Te=J.editorConfig)==null?void 0:Te.context)==null?void 0:$e.identifier)??""}),{activeModal:g,modalData:p,closeModal:C,openModal:h}=wv(),y=oe(J=>J.buttonLoaders),v=oe(J=>J.categoryMeta),b=!v||v.schemaDefaults.generateDIALCodes!=="No",[w,S]=m.useState(!1),[_,E]=m.useState(!1),[D,R]=m.useState(!1),M=m.useRef(null),[$,N]=m.useState(!1);m.useEffect(()=>{if(!D)return;const J=se=>{var ke;(ke=M.current)!=null&&ke.contains(se.target)||R(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[D]);const[j,P]=m.useState(!1),[k,L]=m.useState(!1),{updateNode:V}=Oe(),X=(fe=l==null?void 0:l.metadata)==null?void 0:fe.qrCodeProcessId,ye=m.useCallback(async J=>{if(f){N(!1),P(!0);try{const{processId:se,reservedDialcodes:ke}=await c0(f,J);se&&l&&V(l.id,{qrCodeProcessId:se,reservedDialcodes:ke}),Ee.success(a.topbar.qrGenerationStartedToast)}catch{Ee.error(a.topbar.qrGenerationFailedToast)}finally{P(!1)}}},[f,l,V,a]),_e=m.useCallback(async()=>{if(!X){Ee.error(a.topbar.qrCodesNotGeneratedToast);return}L(!0);try{const J=await u0(X);if(J.status==="in-process"){Ee(a.topbar.qrGenerationInProgressToast,{icon:c.jsx(tl,{size:16})});return}const se=J.url;if(!se){Ee.error(a.topbar.qrCodesNotReadyToast);return}const ke=await fetch(se).then(Ue=>Ue.blob()),Te=await new Promise(Ue=>{const Ze=new FileReader;Ze.onloadend=()=>Ue(Ze.result),Ze.readAsDataURL(ke)}),$e=(l==null?void 0:l.metadata)??{},Ve=Ue=>Array.isArray(Ue)?Ue.join("_"):typeof Ue=="string"?Ue:"",qe=[f,Ve($e.medium),Ve($e.gradeLevel),Ve($e.subject)].filter(Boolean),re=new Date().toISOString().replace(/[:.]/g,"-"),He=`${qe.join("_")}_${re}.zip`,ze=document.createElement("a");ze.href=Te,ze.download=He,ze.style.display="none",document.body.appendChild(ze),ze.click(),document.body.removeChild(ze),Ee.success(a.topbar.qrCodesDownloadedToast)}catch{Ee.error(a.topbar.qrCodesDownloadFailedToast)}finally{L(!1)}},[X,l,f,a]),we=e==="edit",de=e==="review",Q=e==="sourcingreview",ne=e==="read",te=m.useCallback((J,se)=>{i({action:J,data:se})},[i]),U=m.useCallback(()=>{C(),te("publish")},[C,te]),H=m.useCallback((J,se)=>{const ke=p==null?void 0:p.action;C(),ke==="approve"?te("sourcingApprove",{comment:J,score:se}):te("reject",{comment:J})},[C,te,p]);return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:ue.topbar,role:"banner",children:[c.jsxs("div",{className:ue.left,children:[c.jsx("button",{className:ue.backBtn,onClick:()=>te("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:c.jsx(Ny,{size:18})}),c.jsx("h1",{className:ue.title,title:u,children:u}),c.jsx("span",{className:`sbx-chip ${ue.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${d}`,children:d})]}),c.jsxs("div",{className:ue.right,children:[t?c.jsx("span",{className:ue.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&we?c.jsx("span",{className:`${ue.savedIndicator} ${ue.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?c.jsxs("span",{className:ue.savedIndicator,"aria-live":"polite",children:[c.jsx(Wn,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",P0(n)]}):null,!ne&&!de&&!Q&&d!=="Review"&&c.jsx("span",{title:s?void 0:a.topbar.fillRequiredFieldsTooltip,children:c.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>te("saveCollection"),disabled:!s,children:a.topbar.saveAsDraftButton})}),we&&c.jsxs(c.Fragment,{children:[c.jsxs(Fe,{variant:"primary",size:"sm",onClick:()=>E(!0),disabled:y.saveCollection,isLoading:y.saveCollection,children:[c.jsx(Zy,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),c.jsx("button",{className:ue.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:c.jsx(nv,{size:16,"aria-hidden":"true"})}),b&&c.jsxs("div",{className:ue.qrDropdown,ref:M,children:[c.jsxs("button",{className:ue.iconBtn,onClick:()=>R(J=>!J),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":D,children:[c.jsx(sc,{size:16,"aria-hidden":"true"}),c.jsx("span",{className:ue.iconBtnLabel,children:a.topbar.qrCodesLabel}),c.jsx(Kn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),D&&c.jsxs("div",{className:ue.qrMenu,role:"menu",children:[c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{R(!1),N(!0)},disabled:j,children:[c.jsx(sc,{size:14}),j?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{R(!1),_e()},disabled:k||!X,children:[c.jsx(My,{size:14}),k?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),de&&c.jsxs("div",{className:ue.reviewBtns,children:[c.jsxs(Fe,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:y.publishCollection,isLoading:y.publishCollection,children:[c.jsx(of,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),c.jsxs(Fe,{variant:"primary",size:"sm",onClick:()=>S(!0),disabled:y.rejectCollection,isLoading:y.rejectCollection,children:[c.jsx(ic,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),Q&&c.jsxs("div",{className:ue.sourcingBtns,children:[c.jsxs(Fe,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[c.jsx(Xy,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),c.jsxs(Fe,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[c.jsx(ic,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),g==="publishChecklist"&&c.jsx(xS,{contentId:f,onConfirm:U,onCancel:C}),g==="qualityParams"&&c.jsx(_S,{contentId:f,action:(p==null?void 0:p.action)??"reject",onConfirm:H,onCancel:C}),g==="manageCollaborators"&&c.jsx("div",{className:ue.modalOverlay,role:"dialog","aria-modal":"true",children:c.jsx(o0,{contentId:f,onClose:C})}),_&&c.jsx(B0,{onConfirm:()=>{E(!1),te("sendForReview")},onCancel:()=>E(!1)}),w&&c.jsx(M0,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:J=>{S(!1),te("reject",{comment:J})},onCancel:()=>S(!1)}),$&&c.jsx($0,{onConfirm:ye,onCancel:()=>N(!1)})]})},U0=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=ce();return Br.createPortal(c.jsx("div",{className:je.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:c.jsxs("div",{className:je.modal,children:[c.jsxs("div",{className:je.modalHeader,children:[c.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),c.jsx("button",{className:je.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),c.jsx("div",{className:je.modalBody,children:c.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),c.jsxs("div",{className:je.modalFooter,children:[c.jsx(Fe,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),c.jsx(Fe,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),c.jsx(Fe,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var z0=ol();const Yf=m.createContext(null);function Rt(){const e=m.useContext(Yf);if(e===null)throw new Error("No Tree Api Provided");return e}const Zf=m.createContext(null);function V0(){const e=m.useContext(Zf);if(e===null)throw new Error("Provide a NodesContext");return e}const Xf=m.createContext(null);function H0(){const e=m.useContext(Xf);if(e===null)throw new Error("Provide a DnDContext");return e}const Jf=m.createContext(0);function eh(){m.useContext(Jf)}function vi(e,t,r){return Math.max(Math.min(e,r),t)}function th(e){return e&&e.isLeaf}function rh(e){return e&&e.isInternal&&!e.isOpen}function nh(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const sh=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},ih=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function gl(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=gl(r,t);if(n)return n}return null}function Mi(e,t){if(t(e),e.children)for(let r of e.children)Mi(r,t)}function ah(e){const t=lh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Q0(t,n);break}r==null||r.focus()}function oh(e){const t=lh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=G0(t,n);break}r==null||r.focus()}function Q0(e,t){return t+1<e.length?e[t+1]:e[0]}function G0(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function lh(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 ps(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function _n(e){return typeof e=="string"?e:e.id}function W0(e,...t){if(e)return e(...t)}function ch(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function uh(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 dh(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const K0=Object.freeze(Object.defineProperty({__proto__:null,access:ps,bound:vi,dfs:gl,focusNextElement:ah,focusPrevElement:oh,getInsertIndex:uh,getInsertParentId:dh,identify:_n,indexOf:ih,isClosed:rh,isDescendant:sh,isItem:th,isOpenWithEmptyChildren:nh,safeRun:W0,waitFor:ch,walk:Mi},Symbol.toStringTag,{value:"Module"})),Y0={display:"flex",alignItems:"center",zIndex:1},Z0={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},X0={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},J0=m.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 c.jsxs("div",{style:Object.assign(Object.assign({},Y0),s),children:[c.jsx("div",{style:Object.assign({},X0)}),c.jsx("div",{style:Object.assign({},Z0)})]})});function eT({node:e,attrs:t,innerRef:r,children:n}){return c.jsx("div",Object.assign({},t,{ref:r,onFocus:s=>s.stopPropagation(),onClick:e.handleClick,children:n}))}function tT(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(nT,Object.assign({},e)):c.jsx(rT,Object.assign({},e))]})}function rT(e){return c.jsx(c.Fragment,{children:c.jsx("span",{children:e.node.data.name})})}function nT({node:e}){const t=m.useRef();return m.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 As="__REACT_ARBORIST_INTERNAL_ROOT__";function Rc(e){var t;function r(i,a,o){const l=e.accessId(i),u=new Ds({tree:e,data:i,level:a,parent:o,id:l,children:null,isDraggable:e.isDraggable(i),rowIndex:null}),d=e.accessChildren(i);return d&&(u.children=d.map(f=>r(f,a+1,u))),u}const n=new Ds({tree:e,id:As,data:{id:As},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(i=>r(i,0,n)),n}class Ds{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===As}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 Ds(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Oa(e){return{type:"EDIT",id:e}}function sT(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function gn(e){return{type:"FOCUS",id:e}}function iT(){return{type:"TREE_BLUR"}}function aT(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 Oo={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 kc(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 oT(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:kc(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:kc(e.unfiltered,t)}):e}const zn=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}}},Tr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:_n(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(_n)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(_n)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:_n(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:_n(e)})};function lT(e=zn().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 Vn={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 cT(e=zn().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 zn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const uT={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},dT=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},fT=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function fh({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return c.jsxs(hT,{isDragging:s,children:[c.jsx(pT,{offset:e,children:c.jsx(gT,{id:r,dragIds:n})}),c.jsx(mT,{mouse:t,count:n.length})]})}const hT=m.memo(function(t){return t.isDragging?c.jsx("div",{style:uT,children:t.children}):null});function pT(e){return c.jsx("div",{className:"row preview",style:dT(e.offset),children:e.children})}function mT(e){const{count:t,mouse:r}=e;return t>1?c.jsx("div",{className:"selected-count",style:fT(r),children:t}):null}const gT=m.memo(function(t){const r=Rt(),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 Ao(){return Ao=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},Ao.apply(null,arguments)}function jc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Do(e,t){return Do=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Do(e,t)}function yT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Do(e,t)}var Lc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function vT(e,t){return!!(e===t||Lc(e)&&Lc(t))}function bT(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!vT(e[r],t[r]))return!1;return!0}function Aa(e,t){t===void 0&&(t=bT);var r,n=[],s,i=!1;function a(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];return i&&r===this&&t(o,n)||(s=e.apply(this,o),i=!0,r=this,n=o),s}return a}var wT=typeof performance=="object"&&typeof performance.now=="function",Pc=wT?function(){return performance.now()}:function(){return Date.now()};function Fc(e){cancelAnimationFrame(e.id)}function CT(e,t){var r=Pc();function n(){Pc()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Da=-1;function Mc(e){if(e===void 0&&(e=!1),Da===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Da=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Da}var yn=null;function Bc(e){if(e===void 0&&(e=!1),yn===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?yn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?yn="negative":yn="positive-ascending"),document.body.removeChild(t),yn}return yn}process.env.NODE_ENV;var ST=150,xT=function(t,r){return t},bi=null,wi=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(bi=new WeakSet,wi=new WeakSet);function hh(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,o=e.getStopIndexForStartIndex,l=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(f){yT(g,f);function g(C){var h;return h=f.call(this,C)||this,h._instanceProps=l(h.props,jc(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:jc(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Aa(function(y,v,b,w){return h.props.onItemsRendered({overscanStartIndex:y,overscanStopIndex:v,visibleStartIndex:b,visibleStopIndex:w})}),h._callOnScroll=void 0,h._callOnScroll=Aa(function(y,v,b){return h.props.onScroll({scrollDirection:y,scrollOffset:v,scrollUpdateWasRequested:b})}),h._getItemStyle=void 0,h._getItemStyle=function(y){var v=h.props,b=v.direction,w=v.itemSize,S=v.layout,_=h._getItemStyleCache(u&&w,u&&S,u&&b),E;if(_.hasOwnProperty(y))E=_[y];else{var D=r(h.props,y,h._instanceProps),R=s(h.props,y,h._instanceProps),M=b==="horizontal"||S==="horizontal",$=b==="rtl",N=M?D:0;_[y]=E={position:"absolute",left:$?void 0:N,right:$?N:void 0,top:M?0:D,height:M?"100%":R,width:M?R:"100%"}}return E},h._getItemStyleCache=void 0,h._getItemStyleCache=Aa(function(y,v,b){return{}}),h._onScrollHorizontal=function(y){var v=y.currentTarget,b=v.clientWidth,w=v.scrollLeft,S=v.scrollWidth;h.setState(function(_){if(_.scrollOffset===w)return null;var E=h.props.direction,D=w;if(E==="rtl")switch(Bc()){case"negative":D=-w;break;case"positive-descending":D=S-b-w;break}return D=Math.max(0,Math.min(D,S-b)),{isScrolling:!0,scrollDirection:_.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(y){var v=y.currentTarget,b=v.clientHeight,w=v.scrollHeight,S=v.scrollTop;h.setState(function(_){if(_.scrollOffset===S)return null;var E=Math.max(0,Math.min(S,w-b));return{isScrolling:!0,scrollDirection:_.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(y){var v=h.props.outerRef;h._outerRef=y,typeof v=="function"?v(y):v!=null&&typeof v=="object"&&v.hasOwnProperty("current")&&(v.current=y)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&&Fc(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=CT(h._resetIsScrolling,ST)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}g.getDerivedStateFromProps=function(h,y){return _T(h,y),d(h),null};var p=g.prototype;return p.scrollTo=function(h){h=Math.max(0,h),this.setState(function(y){return y.scrollOffset===h?null:{scrollDirection:y.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},p.scrollToItem=function(h,y){y===void 0&&(y="auto");var v=this.props,b=v.itemCount,w=v.layout,S=this.state.scrollOffset;h=Math.max(0,Math.min(h,b-1));var _=0;if(this._outerRef){var E=this._outerRef;w==="vertical"?_=E.scrollWidth>E.clientWidth?Mc():0:_=E.scrollHeight>E.clientHeight?Mc():0}this.scrollTo(i(this.props,h,y,S,this._instanceProps,_))},p.componentDidMount=function(){var h=this.props,y=h.direction,v=h.initialScrollOffset,b=h.layout;if(typeof v=="number"&&this._outerRef!=null){var w=this._outerRef;y==="horizontal"||b==="horizontal"?w.scrollLeft=v:w.scrollTop=v}this._callPropsCallbacks()},p.componentDidUpdate=function(){var h=this.props,y=h.direction,v=h.layout,b=this.state,w=b.scrollOffset,S=b.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var _=this._outerRef;if(y==="horizontal"||v==="horizontal")if(y==="rtl")switch(Bc()){case"negative":_.scrollLeft=-w;break;case"positive-ascending":_.scrollLeft=w;break;default:var E=_.clientWidth,D=_.scrollWidth;_.scrollLeft=D-E-w;break}else _.scrollLeft=w;else _.scrollTop=w}this._callPropsCallbacks()},p.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Fc(this._resetIsScrollingTimeoutId)},p.render=function(){var h=this.props,y=h.children,v=h.className,b=h.direction,w=h.height,S=h.innerRef,_=h.innerElementType,E=h.innerTagName,D=h.itemCount,R=h.itemData,M=h.itemKey,$=M===void 0?xT:M,N=h.layout,j=h.outerElementType,P=h.outerTagName,k=h.style,L=h.useIsScrolling,V=h.width,X=this.state.isScrolling,ye=b==="horizontal"||N==="horizontal",_e=ye?this._onScrollHorizontal:this._onScrollVertical,we=this._getRangeToRender(),de=we[0],Q=we[1],ne=[];if(D>0)for(var te=de;te<=Q;te++)ne.push(m.createElement(y,{data:R,key:$(te,R),index:te,isScrolling:L?X:void 0,style:this._getItemStyle(te)}));var U=n(this.props,this._instanceProps);return m.createElement(j||P||"div",{className:v,onScroll:_e,ref:this._outerRefSetter,style:Ao({position:"relative",height:w,width:V,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},k)},m.createElement(_||E||"div",{children:ne,ref:S,style:{height:ye?"100%":U,pointerEvents:X?"none":void 0,width:ye?U:"100%"}}))},p._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>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 _=this.state,E=_.scrollDirection,D=_.scrollOffset,R=_.scrollUpdateWasRequested;this._callOnScroll(E,D,R)}},p._getRangeToRender=function(){var h=this.props,y=h.itemCount,v=h.overscanCount,b=this.state,w=b.isScrolling,S=b.scrollDirection,_=b.scrollOffset;if(y===0)return[0,0,0,0];var E=a(this.props,_,this._instanceProps),D=o(this.props,E,_,this._instanceProps),R=!w||S==="backward"?Math.max(1,v):1,M=!w||S==="forward"?Math.max(1,v):1;return[Math.max(0,E-R),Math.max(0,Math.min(y-1,D+M)),E,D]},g}(m.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var _T=function(t,r){var n=t.children,s=t.direction,i=t.height,a=t.layout,o=t.innerTagName,l=t.outerTagName,u=t.width,d=r.instance;if(process.env.NODE_ENV!=="production"){(o!=null||l!=null)&&wi&&!wi.has(d)&&(wi.add(d),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":bi&&!bi.has(d)&&(bi.add(d),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 u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!f&&typeof i!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(i===null?"null":typeof i)+'" was specified.'))}},TT=50,Tn=function(t,r,n){var s=t,i=s.itemSize,a=n.itemMetadataMap,o=n.lastMeasuredIndex;if(r>o){var l=0;if(o>=0){var u=a[o];l=u.offset+u.size}for(var d=o+1;d<=r;d++){var f=i(d);a[d]={offset:l,size:f},l+=f}n.lastMeasuredIndex=r}return a[r]},ET=function(t,r,n){var s=r.itemMetadataMap,i=r.lastMeasuredIndex,a=i>0?s[i].offset:0;return a>=n?ph(t,r,i,0,n):IT(t,r,Math.max(0,i),n)},ph=function(t,r,n,s,i){for(;s<=n;){var a=s+Math.floor((n-s)/2),o=Tn(t,a,r).offset;if(o===i)return a;o<i?s=a+1:o>i&&(n=a-1)}return s>0?s-1:0},IT=function(t,r,n,s){for(var i=t.itemCount,a=1;n<i&&Tn(t,n,r).offset<s;)n+=a,a*=2;return ph(t,r,Math.min(n,i-1),Math.floor(n/2),s)},$c=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,i=r.estimatedItemSize,a=r.lastMeasuredIndex,o=0;if(a>=n&&(a=n-1),a>=0){var l=s[a];o=l.offset+l.size}var u=n-a-1,d=u*i;return o+d},OT=hh({getItemOffset:function(t,r,n){return Tn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:$c,getOffsetForIndexAndAlignment:function(t,r,n,s,i,a){var o=t.direction,l=t.height,u=t.layout,d=t.width,f=o==="horizontal"||u==="horizontal",g=f?d:l,p=Tn(t,r,i),C=$c(t,i),h=Math.max(0,Math.min(C-g,p.offset)),y=Math.max(0,p.offset-g+p.size+a);switch(n==="smart"&&(s>=y-g&&s<=h+g?n="auto":n="center"),n){case"start":return h;case"end":return y;case"center":return Math.round(y+(h-y)/2);case"auto":default:return s>=y&&s<=h?s:s<y?y:h}},getStartIndexForOffset:function(t,r,n){return ET(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var i=t.direction,a=t.height,o=t.itemCount,l=t.layout,u=t.width,d=i==="horizontal"||l==="horizontal",f=d?u:a,g=Tn(t,r,s),p=n+f,C=g.offset+g.size,h=r;h<o-1&&C<p;)h++,C+=Tn(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,i={itemMetadataMap:{},estimatedItemSize:s||TT,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,o){o===void 0&&(o=!0),i.lastMeasuredIndex=Math.min(i.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),o&&r.forceUpdate()},i},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),AT=hh({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,i,a){var o=t.direction,l=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,g=t.width,p=o==="horizontal"||f==="horizontal",C=p?g:l,h=Math.max(0,u*d-C),y=Math.min(h,r*d),v=Math.max(0,r*d-C+d+a);switch(n==="smart"&&(s>=v-C&&s<=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>h+Math.floor(C/2)?h:b}case"auto":default:return s>=v&&s<=y?s:s<v?v:y}},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,i=t.height,a=t.itemCount,o=t.itemSize,l=t.layout,u=t.width,d=s==="horizontal"||l==="horizontal",f=r*o,g=d?u:i,p=Math.ceil((g+n-f)/o);return Math.max(0,Math.min(a-1,r+p-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function DT(){var e,t;const r=Rt(),s=H0().cursor;if(!s||s.type!=="line")return null;const i=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),o=i*s.level,l=r.renderCursor;return c.jsx(l,{top:a,left:o,indent:i})}var NT=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 RT=m.forwardRef(function(t,r){const{children:n}=t,s=NT(t,["children"]),i=Rt();return c.jsxs("div",Object.assign({ref:r},s,{onClick:a=>{a.currentTarget===a.target&&i.deselectAll()},children:[c.jsx(kT,{}),n]}))}),kT=()=>{const e=Rt();return c.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:c.jsx(DT,{})})};var jT=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 LT=m.forwardRef(function(t,r){var n,s,i,a,{style:o}=t,l=jT(t,["style"]);const u=Rt(),d=(s=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingTop)!==null&&s!==void 0?s:0,f=(a=(i=u.props.padding)!==null&&i!==void 0?i:u.props.paddingBottom)!==null&&a!==void 0?a:0;return c.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},o),{height:`${parseFloat(o.height)+d+f}px`})},l))});var mh=m.createContext({dragDropManager:void 0}),Gt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Gt||(Gt={}));function he(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 i;if(t===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;i=new Error(t.replace(/%s/g,function(){return n[a++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}var yl="dnd-core/INIT_COORDS",sa="dnd-core/BEGIN_DRAG",vl="dnd-core/PUBLISH_DRAG_SOURCE",ia="dnd-core/HOVER",aa="dnd-core/DROP",oa="dnd-core/END_DRAG";function qc(e,t){return{type:yl,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Ci(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ci=function(r){return typeof r}:Ci=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ci(e)}function PT(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function FT(e,t){return e.filter(function(r){return r!==t})}function gh(e){return Ci(e)==="object"}function MT(e,t){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(i,a){i===1&&s.push(a)}),s}function BT(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var $T={type:yl,payload:{clientOffset:null,sourceClientOffset:null}};function qT(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,i=s===void 0?!0:s,a=n.clientOffset,o=n.getSourceClientOffset,l=e.getMonitor(),u=e.getRegistry();e.dispatch(qc(a)),UT(r,l,u);var d=HT(r,l);if(d===null){e.dispatch($T);return}var f=null;if(a){if(!o)throw new Error("getSourceClientOffset must be defined");zT(o),f=o(d)}e.dispatch(qc(a,f));var g=u.getSource(d),p=g.beginDrag(l,d);if(p!=null){VT(p),u.pinSource(d);var C=u.getSourceType(d);return{type:sa,payload:{itemType:C,item:p,sourceId:d,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!i}}}}}function UT(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 zT(e){he(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function VT(e){he(gh(e),"Item must be an object.")}function HT(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 QT(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:vl}}}function No(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function GT(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;WT(r);var i=r.slice(0),a=e.getMonitor(),o=e.getRegistry();KT(i,a,o);var l=a.getItemType();return YT(i,o,l),ZT(i,a,o),{type:ia,payload:{targetIds:i,clientOffset:s||null}}}}function WT(e){he(Array.isArray(e),"Expected targetIds to be an array.")}function KT(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 s=e[n];he(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var i=r.getTarget(s);he(i,"Expected targetIds to be registered.")}}function YT(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],i=t.getTargetType(s);No(i,r)||e.splice(n,1)}}function ZT(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function Uc(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 zc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Uc(Object(r),!0).forEach(function(n){XT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JT(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();eE(n);var i=nE(n);i.forEach(function(a,o){var l=tE(a,o,s,n),u={type:aa,payload:{dropResult:zc(zc({},r),l)}};e.dispatch(u)})}}function eE(e){he(e.isDragging(),"Cannot call drop while not dragging."),he(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function tE(e,t,r,n){var s=r.getTarget(e),i=s?s.drop(n,e):void 0;return rE(i),typeof i>"u"&&(i=t===0?{}:n.getDropResult()),i}function rE(e){he(typeof e>"u"||gh(e),"Drop result must either be an object or undefined.")}function nE(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function sE(e){return function(){var r=e.getMonitor(),n=e.getRegistry();iE(r);var s=r.getSourceId();if(s!=null){var i=n.getSource(s,!0);i.endDrag(r,s),n.unpinSource()}return{type:oa}}}function iE(e){he(e.isDragging(),"Cannot call endDrag while not dragging.")}function aE(e){return{beginDrag:qT(e),publishDragSource:QT(e),hover:GT(e),drop:JT(e),endDrag:sE(e)}}function oE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lE(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 cE(e,t,r){return t&&lE(e.prototype,t),e}function is(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var uE=function(){function e(t,r){var n=this;oE(this,e),is(this,"store",void 0),is(this,"monitor",void 0),is(this,"backend",void 0),is(this,"isSetUp",!1),is(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 cE(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 o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var d=a.apply(r,l);typeof d<"u"&&n(d)}}var i=aE(this);return Object.keys(i).reduce(function(a,o){var l=i[o];return a[o]=s(l),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e}();function Ut(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 Vc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Hc=function(){return Math.random().toString(36).substring(7).split("").join(".")},Qc={INIT:"@@redux/INIT"+Hc(),REPLACE:"@@redux/REPLACE"+Hc()};function dE(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 fE(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(mE(e))return"date";if(pE(e))return"error";var r=hE(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 hE(e){return typeof e.constructor=="function"?e.constructor.name:null}function pE(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function mE(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function vn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=fE(e)),t}function yh(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ut(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"?Ut(1):"Expected the enhancer to be a function. Instead, received: '"+vn(r)+"'");return r(yh)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ut(2):"Expected the root reducer to be a function. Instead, received: '"+vn(e)+"'");var s=e,i=t,a=[],o=a,l=!1;function u(){o===a&&(o=a.slice())}function d(){if(l)throw new Error(process.env.NODE_ENV==="production"?Ut(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 i}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ut(4):"Expected the listener to be a function. Instead, received: '"+vn(h)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?Ut(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 u(),o.push(h),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?Ut(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,u();var b=o.indexOf(h);o.splice(b,1),a=null}}}function g(h){if(!dE(h))throw new Error(process.env.NODE_ENV==="production"?Ut(7):"Actions must be plain objects. Instead, the actual type was: '"+vn(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ut(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"?Ut(9):"Reducers may not dispatch actions.");try{l=!0,i=s(i,h)}finally{l=!1}for(var y=a=o,v=0;v<y.length;v++){var b=y[v];b()}return h}function p(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Ut(10):"Expected the nextReducer to be a function. Instead, received: '"+vn(h));s=h,g({type:Qc.REPLACE})}function C(){var h,y=f;return h={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?Ut(11):"Expected the observer to be an object. Instead, received: '"+vn(b)+"'");function w(){b.next&&b.next(d())}w();var S=y(w);return{unsubscribe:S}}},h[Vc]=function(){return this},h}return g({type:Qc.INIT}),n={dispatch:g,subscribe:f,getState:d,replaceReducer:p},n[Vc]=C,n}var gE=function(t,r){return t===r};function yE(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function vE(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gE;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 Gc(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 Wc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gc(Object(r),!0).forEach(function(n){bE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Kc={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function wE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Kc,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case yl:case sa:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case ia:return yE(e.clientOffset,r.clientOffset)?e:Wc(Wc({},e),{},{clientOffset:r.clientOffset});case oa:case aa:return Kc;default:return e}}var bl="dnd-core/ADD_SOURCE",wl="dnd-core/ADD_TARGET",Cl="dnd-core/REMOVE_SOURCE",la="dnd-core/REMOVE_TARGET";function CE(e){return{type:bl,payload:{sourceId:e}}}function SE(e){return{type:wl,payload:{targetId:e}}}function xE(e){return{type:Cl,payload:{sourceId:e}}}function _E(e){return{type:la,payload:{targetId:e}}}function Yc(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?Yc(Object(r),!0).forEach(function(n){TE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var EE={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function IE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:EE,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case sa:return zt(zt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case vl:return zt(zt({},e),{},{isSourcePublic:!0});case ia:return zt(zt({},e),{},{targetIds:r.targetIds});case la:return e.targetIds.indexOf(r.targetId)===-1?e:zt(zt({},e),{},{targetIds:FT(e.targetIds,r.targetId)});case aa:return zt(zt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case oa:return zt(zt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function OE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case bl:case wl:return e+1;case Cl:case la:return e-1;default:return e}}var Bi=[],Sl=[];Bi.__IS_NONE__=!0;Sl.__IS_ALL__=!0;function AE(e,t){if(e===Bi)return!1;if(e===Sl||typeof t>"u")return!0;var r=BT(t,e);return r.length>0}function DE(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case ia:break;case bl:case wl:case la:case Cl:return Bi;case sa:case vl:case oa:case aa:default:return Sl}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,i=s===void 0?[]:s,a=MT(n,i),o=a.length>0||!vE(n,i);if(!o)return Bi;var l=i[i.length-1],u=n[n.length-1];return l!==u&&(l&&a.push(l),u&&a.push(u)),a}function NE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Zc(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 Xc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zc(Object(r),!0).forEach(function(n){RE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:DE(e.dirtyHandlerIds,{type:t.type,payload:Xc(Xc({},t.payload),{},{prevTargetIds:PT(e,"dragOperation.targetIds",[])})}),dragOffset:wE(e.dragOffset,t),refCount:OE(e.refCount,t),dragOperation:IE(e.dragOperation,t),stateId:NE(e.stateId)}}function jE(e,t){return{x:e.x+t.x,y:e.y+t.y}}function vh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function LE(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:vh(jE(t,n),r)}function PE(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:vh(t,r)}function FE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ME(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 BE(e,t,r){return t&&ME(e.prototype,t),e}function Jc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $E=function(){function e(t,r){FE(this,e),Jc(this,"store",void 0),Jc(this,"registry",void 0),this.store=t,this.registry=r}return BE(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},i=s.handlerIds;he(typeof r=="function","listener must be a function."),he(typeof i>"u"||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,o=function(){var u=n.store.getState(),d=u.stateId;try{var f=d===a||d===a+1&&!AE(u.dirtyHandlerIds,i);f||r()}finally{a=d}};return this.store.subscribe(o)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;he(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,i=function(){var o=n.store.getState().dragOffset;o!==s&&(s=o,r())};return this.store.subscribe(i)}},{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 s=this.registry.getTargetType(r),i=this.getItemType();return No(s,i)&&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 s=this.registry.getSourceType(r),i=this.getItemType();return s!==i?!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 i=this.registry.getTargetType(r),a=this.getItemType();if(a&&!No(i,a))return!1;var o=this.getTargetIds();if(!o.length)return!1;var l=o.indexOf(r);return s?l===o.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 LE(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return PE(this.store.getState().dragOffset)}}]),e}(),qE=0;function UE(){return qE++}function Si(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Si=function(r){return typeof r}:Si=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Si(e)}function zE(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 VE(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 Ro(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return Ro(r,!1)});return}he(typeof e=="string"||Si(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 eu=typeof global<"u"?global:self,bh=eu.MutationObserver||eu.WebKitMutationObserver;function wh(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function HE(e){let t=1;const r=new bh(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const QE=typeof bh=="function"?HE:wh;class GE{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=QE(this.flush),this.requestErrorThrow=wh(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class WE{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 KE{create(t){const r=this.freeTasks,n=r.length?r.pop():new WE(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Ch=new GE,YE=new KE(Ch.registerPendingError);function ZE(e){Ch.enqueueTask(YE.create(e))}function XE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JE(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 e1(e,t,r){return t&&JE(e.prototype,t),e}function bn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t1(e,t){return i1(e)||s1(e,t)||n1(e,t)||r1()}function r1(){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 n1(e,t){if(e){if(typeof e=="string")return tu(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 tu(e,t)}}function tu(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 s1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,a,o;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function i1(e){if(Array.isArray(e))return e}function a1(e){var t=UE().toString();switch(e){case Gt.SOURCE:return"S".concat(t);case Gt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function ru(e){switch(e[0]){case"S":return Gt.SOURCE;case"T":return Gt.TARGET;default:he(!1,"Cannot parse handler ID: ".concat(e))}}function nu(e,t){var r=e.entries(),n=!1;do{var s=r.next(),i=s.done,a=t1(s.value,2),o=a[1];if(o===t)return!0;n=!!i}while(!n);return!1}var o1=function(){function e(t){XE(this,e),bn(this,"types",new Map),bn(this,"dragSources",new Map),bn(this,"dropTargets",new Map),bn(this,"pinnedSourceId",null),bn(this,"pinnedSource",null),bn(this,"store",void 0),this.store=t}return e1(e,[{key:"addSource",value:function(r,n){Ro(r),zE(n);var s=this.addHandler(Gt.SOURCE,r,n);return this.store.dispatch(CE(s)),s}},{key:"addTarget",value:function(r,n){Ro(r,!0),VE(n);var s=this.addHandler(Gt.TARGET,r,n);return this.store.dispatch(SE(s)),s}},{key:"containsHandler",value:function(r){return nu(this.dragSources,r)||nu(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 s=n&&r===this.pinnedSourceId,i=s?this.pinnedSource:this.dragSources.get(r);return i}},{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=ru(r);return n===Gt.SOURCE}},{key:"isTargetId",value:function(r){var n=ru(r);return n===Gt.TARGET}},{key:"removeSource",value:function(r){var n=this;he(this.getSource(r),"Expected an existing source."),this.store.dispatch(xE(r)),ZE(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(_E(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,s){var i=a1(r);return this.types.set(i,n),r===Gt.SOURCE?this.dragSources.set(i,s):r===Gt.TARGET&&this.dropTargets.set(i,s),i}}]),e}();function l1(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=c1(n),i=new $E(s,new o1(s)),a=new uE(s,i),o=e(a,t,r);return a.receiveBackend(o),a}function c1(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return yh(kE,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var u1=["children"];function d1(e,t){return m1(e)||p1(e,t)||h1(e,t)||f1()}function f1(){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 h1(e,t){if(e){if(typeof e=="string")return su(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 su(e,t)}}function su(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,a,o;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function m1(e){if(Array.isArray(e))return e}function g1(e,t){if(e==null)return{};var r=y1(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[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,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var iu=0,xi=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),v1=m.memo(function(t){var r=t.children,n=g1(t,u1),s=b1(n),i=d1(s,2),a=i[0],o=i[1];return m.useEffect(function(){if(o){var l=Sh();return++iu,function(){--iu===0&&(l[xi]=null)}}},[]),c.jsx(mh.Provider,Object.assign({value:a},{children:r}),void 0)});function b1(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=w1(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function w1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sh(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[xi]||(s[xi]={dragDropManager:l1(e,t,r,n)}),s[xi]}function Sh(){return typeof global<"u"?global:window}function C1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S1(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 x1(e,t,r){return t&&S1(e.prototype,t),e}function au(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Na=!1,Ra=!1,_1=function(){function e(t){C1(this,e),au(this,"internalMonitor",void 0),au(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return x1(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){he(!Na,"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 Na=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Na=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;he(!Ra,"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 Ra=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ra=!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 T1(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 I1(e,t,r){return t&&E1(e.prototype,t),e}function ou(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ka=!1,O1=function(){function e(t){T1(this,e),ou(this,"internalMonitor",void 0),ou(this,"targetId",null),this.internalMonitor=t.getMonitor()}return I1(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(!ka,"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 ka=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ka=!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 A1(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 D1(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(!m.isValidElement(t)){var n=t;return e(n,r),n}var s=t;A1(s);var i=r?function(a){return e(a,r)}:e;return N1(s,i)}}function xh(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=D1(n);t[r]=function(){return s}}}),t}function lu(e,t){typeof e=="function"?e(t):e.current=t}function N1(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?m.cloneElement(e,{ref:function(s){lu(r,s),lu(t,s)}}):m.cloneElement(e,{ref:t})}function _i(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_i=function(r){return typeof r}:_i=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_i(e)}function ko(e){return e!==null&&_i(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function jo(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 i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var u=i[l];if(!o(u))return!1;var d=e[u],f=t[u];if(s=void 0,s===!1||s===void 0&&d!==f)return!1}return!0}function R1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k1(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 j1(e,t,r){return t&&k1(e.prototype,t),e}function mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var L1=function(){function e(t){var r=this;R1(this,e),mt(this,"hooks",xh({dragSource:function(s,i){r.clearDragSource(),r.dragSourceOptions=i||null,ko(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,i){r.clearDragPreview(),r.dragPreviewOptions=i||null,ko(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),mt(this,"handlerId",null),mt(this,"dragSourceRef",null),mt(this,"dragSourceNode",void 0),mt(this,"dragSourceOptionsInternal",null),mt(this,"dragSourceUnsubscribe",void 0),mt(this,"dragPreviewRef",null),mt(this,"dragPreviewNode",void 0),mt(this,"dragPreviewOptionsInternal",null),mt(this,"dragPreviewUnsubscribe",void 0),mt(this,"lastConnectedHandlerId",null),mt(this,"lastConnectedDragSource",null),mt(this,"lastConnectedDragSourceOptions",null),mt(this,"lastConnectedDragPreview",null),mt(this,"lastConnectedDragPreviewOptions",null),mt(this,"backend",void 0),this.backend=t}return j1(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!jo(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!jo(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 P1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F1(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 M1(e,t,r){return t&&F1(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 B1=function(){function e(t){var r=this;P1(this,e),ir(this,"hooks",xh({dropTarget:function(s,i){r.clearDropTarget(),r.dropTargetOptions=i,ko(s)?r.dropTargetRef=s:r.dropTargetNode=s,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 M1(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!jo(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 $1(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function q1(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var fn=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Ti(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ti=function(r){return typeof r}:Ti=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ti(e)}function U1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z1(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 V1(e,t,r){return t&&z1(e.prototype,t),e}function ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var H1=function(){function e(t,r,n){U1(this,e),ja(this,"spec",void 0),ja(this,"monitor",void 0),ja(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return V1(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,i=null;return Ti(n.item)==="object"?i=n.item:typeof n.item=="function"?i=n.item(s):i={},(r=i)!==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,i=this.monitor,a=s.isDragging;return a?a(i):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,i=r.end;i&&i(n.getItem(),n),s.reconnect()}}]),e}();function Q1(e,t,r){var n=m.useMemo(function(){return new H1(e,t,r)},[t,r]);return m.useEffect(function(){n.spec=e},[e]),n}function hn(){var e=m.useContext(mh),t=e.dragDropManager;return he(t!=null,"Expected drag drop context"),t}function G1(e){return m.useMemo(function(){var t=e.type;return he(t!=null,"spec.type must be defined"),t},[e])}function W1(e,t){return X1(e)||Z1(e,t)||Y1(e,t)||K1()}function K1(){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 Y1(e,t){if(e){if(typeof e=="string")return cu(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 cu(e,t)}}function cu(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 Z1(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,a,o;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function X1(e){if(Array.isArray(e))return e}function J1(e,t,r){var n=hn(),s=Q1(e,t,r),i=G1(e);fn(function(){if(i!=null){var o=q1(i,s,n),l=W1(o,2),u=l[0],d=l[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d}},[n,t,r,s,i])}function eI(e){return sI(e)||nI(e)||rI(e)||tI()}function tI(){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 rI(e,t){if(e){if(typeof e=="string")return Lo(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 Lo(e,t)}}function nI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sI(e){if(Array.isArray(e))return Lo(e)}function Lo(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=eI(t||[]);return t==null&&typeof e!="function"&&r.push(e),m.useMemo(function(){return typeof e=="function"?e():e},r)}function iI(){var e=hn();return m.useMemo(function(){return new _1(e)},[e])}function aI(e,t){var r=hn(),n=m.useMemo(function(){return new L1(r.getBackend())},[r]);return fn(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),fn(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var oI=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,i;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(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r};const lI=ff(oI);function cI(e,t){return hI(e)||fI(e,t)||dI(e,t)||uI()}function uI(){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 dI(e,t){if(e){if(typeof e=="string")return uu(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 uu(e,t)}}function uu(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 fI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,a,o;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function hI(e){if(Array.isArray(e))return e}function Th(e,t,r){var n=m.useState(function(){return t(e)}),s=cI(n,2),i=s[0],a=s[1],o=m.useCallback(function(){var l=t(e);lI(i,l)||(a(l),r&&r())},[i,e,r]);return fn(o),[i,o]}function pI(e,t){return vI(e)||yI(e,t)||gI(e,t)||mI()}function mI(){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 gI(e,t){if(e){if(typeof e=="string")return du(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 du(e,t)}}function du(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 yI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,a,o;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function vI(e){if(Array.isArray(e))return e}function bI(e,t,r){var n=Th(e,t,r),s=pI(n,2),i=s[0],a=s[1];return fn(function(){var l=e.getHandlerId();if(l!=null)return e.subscribeToStateChange(a,{handlerIds:[l]})},[e,a]),i}function Eh(e,t,r){return bI(t,e||function(){return{}},function(){return r.reconnect()})}function wI(e){return m.useMemo(function(){return e.hooks.dragSource()},[e])}function CI(e){return m.useMemo(function(){return e.hooks.dragPreview()},[e])}function SI(e,t){var r=_h(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=iI(),s=aI(r.options,r.previewOptions);return J1(r,n,s),[Eh(r.collect,n,s),wI(s),CI(s)]}function xI(e){var t=e.accept;return m.useMemo(function(){return he(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function _I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TI(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 EI(e,t,r){return t&&TI(e.prototype,t),e}function fu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var II=function(){function e(t,r){_I(this,e),fu(this,"spec",void 0),fu(this,"monitor",void 0),this.spec=t,this.monitor=r}return EI(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 OI(e,t){var r=m.useMemo(function(){return new II(e,t)},[t]);return m.useEffect(function(){r.spec=e},[e]),r}function AI(e,t){return kI(e)||RI(e,t)||NI(e,t)||DI()}function DI(){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 NI(e,t){if(e){if(typeof e=="string")return hu(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 hu(e,t)}}function hu(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 RI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,a,o;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function kI(e){if(Array.isArray(e))return e}function jI(e,t,r){var n=hn(),s=OI(e,t),i=xI(e);fn(function(){var o=$1(i,s,n),l=AI(o,2),u=l[0],d=l[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d},[n,t,s,r,i.map(function(a){return a.toString()}).join("|")])}function LI(){var e=hn();return m.useMemo(function(){return new O1(e)},[e])}function PI(e){var t=hn(),r=m.useMemo(function(){return new B1(t.getBackend())},[t]);return fn(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function FI(e){return m.useMemo(function(){return e.hooks.dropTarget()},[e])}function Ih(e,t){var r=_h(e,t),n=LI(),s=PI(r.options);return jI(r,n,s),[Eh(r.collect,n,s),FI(s)]}function MI(e,t){return UI(e)||qI(e,t)||$I(e,t)||BI()}function BI(){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 $I(e,t){if(e){if(typeof e=="string")return pu(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 pu(e,t)}}function pu(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 qI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,a,o;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function UI(e){if(Array.isArray(e))return e}function zI(e){var t=hn(),r=t.getMonitor(),n=Th(r,e),s=MI(n,2),i=s[0],a=s[1];return m.useEffect(function(){return r.subscribeToOffsetChange(a)}),m.useEffect(function(){return r.subscribeToStateChange(a)}),i}function Oh(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function VI(e,t){return e.filter(function(r){return r!==t})}function HI(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(i){return s.push(i)}),s}function QI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GI(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 WI(e,t,r){return t&&GI(e.prototype,t),e}function mu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var KI=function(){function e(t){QI(this,e),mu(this,"entered",[]),mu(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return WI(e,[{key:"enter",value:function(r){var n=this,s=this.entered.length,i=function(o){return n.isNodeInDocument(o)&&(!o.contains||o.contains(r))};return this.entered=HI(this.entered.filter(i),[r]),s===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=VI(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),YI=Oh(function(){return/firefox/i.test(navigator.userAgent)}),Ah=Oh(function(){return!!window.safari});function ZI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XI(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 JI(e,t,r){return t&&XI(e.prototype,t),e}function as(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gu=function(){function e(t,r){ZI(this,e),as(this,"xs",void 0),as(this,"ys",void 0),as(this,"c1s",void 0),as(this,"c2s",void 0),as(this,"c3s",void 0);for(var n=t.length,s=[],i=0;i<n;i++)s.push(i);s.sort(function(R,M){return t[R]<t[M]?-1:1});for(var a=[],o=[],l,u,d=0;d<n-1;d++)l=t[d+1]-t[d],u=r[d+1]-r[d],a.push(l),o.push(u/l);for(var f=[o[0]],g=0;g<a.length-1;g++){var p=o[g],C=o[g+1];if(p*C<=0)f.push(0);else{l=a[g];var h=a[g+1],y=l+h;f.push(3*y/((y+h)/p+(y+l)/C))}}f.push(o[o.length-1]);for(var v=[],b=[],w,S=0;S<f.length-1;S++){w=o[S];var _=f[S],E=1/a[S],D=_+f[S+1]-w-w;v.push((w-_-D)*E),b.push(D*E*E)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=v,this.c3s=b}return JI(e,[{key:"interpolate",value:function(r){var n=this.xs,s=this.ys,i=this.c1s,a=this.c2s,o=this.c3s,l=n.length-1;if(r===n[l])return s[l];for(var u=0,d=o.length-1,f;u<=d;){f=Math.floor(.5*(u+d));var g=n[f];if(g<r)u=f+1;else if(g>r)d=f-1;else return s[f]}l=Math.max(0,d);var p=r-n[l],C=p*p;return s[l]+i[l]*p+a[l]*C+o[l]*p*C}}]),e}(),eO=1;function Dh(e){var t=e.nodeType===eO?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function ti(e){return{x:e.clientX,y:e.clientY}}function tO(e){var t;return e.nodeName==="IMG"&&(YI()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function rO(e,t,r,n){var s=e?t.width:r,i=e?t.height:n;return Ah()&&e&&(i/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:i}}function nO(e,t,r,n,s){var i=tO(t),a=i?e:t,o=Dh(a),l={x:r.x-o.x,y:r.y-o.y},u=e.offsetWidth,d=e.offsetHeight,f=n.anchorX,g=n.anchorY,p=rO(i,t,u,d),C=p.dragPreviewWidth,h=p.dragPreviewHeight,y=function(){var D=new gu([0,.5,1],[l.y,l.y/d*h,l.y+h-d]),R=D.interpolate(g);return Ah()&&i&&(R+=(window.devicePixelRatio-1)*h),R},v=function(){var D=new gu([0,.5,1],[l.x,l.x/u*C,l.x+C-u]);return D.interpolate(f)},b=s.offsetX,w=s.offsetY,S=b===0||b,_=w===0||w;return{x:S?b:v(),y:_?w:y()}}var Nh="__NATIVE_FILE__",Rh="__NATIVE_URL__",kh="__NATIVE_TEXT__",jh="__NATIVE_HTML__";const yu=Object.freeze(Object.defineProperty({__proto__:null,FILE:Nh,HTML:jh,TEXT:kh,URL:Rh},Symbol.toStringTag,{value:"Module"}));function La(e,t,r){var n=t.reduce(function(s,i){return s||e.getData(i)},"");return n??r}var wn;function ri(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Po=(wn={},ri(wn,Nh,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),ri(wn,jh,{exposeProperties:{html:function(t,r){return La(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),ri(wn,Rh,{exposeProperties:{urls:function(t,r){return La(t,r,"").split(`
505
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),ri(wn,kh,{exposeProperties:{text:function(t,r){return La(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),wn);function sO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iO(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 aO(e,t,r){return t&&iO(e.prototype,t),e}function vu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var oO=function(){function e(t){sO(this,e),vu(this,"item",void 0),vu(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return aO(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(i){s[i]={value:n.config.exposeProperties[i](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 lO(e,t){var r=new oO(Po[e]);return r.loadDataTransfer(t),r}function Pa(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Po).filter(function(r){var n=Po[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function cO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uO(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 dO(e,t,r){return t&&uO(e.prototype,t),e}function Fa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fO=function(){function e(t,r){cO(this,e),Fa(this,"ownerDocument",null),Fa(this,"globalContext",void 0),Fa(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return dO(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 bu(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 wu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bu(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pO(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 mO(e,t,r){return t&&pO(e.prototype,t),e}function be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gO=function(){function e(t,r,n){var s=this;hO(this,e),be(this,"options",void 0),be(this,"actions",void 0),be(this,"monitor",void 0),be(this,"registry",void 0),be(this,"enterLeaveCounter",void 0),be(this,"sourcePreviewNodes",new Map),be(this,"sourcePreviewNodeOptions",new Map),be(this,"sourceNodes",new Map),be(this,"sourceNodeOptions",new Map),be(this,"dragStartSourceIds",null),be(this,"dropTargetIds",[]),be(this,"dragEnterTargetIds",[]),be(this,"currentNativeSource",null),be(this,"currentNativeHandle",null),be(this,"currentDragSourceNode",null),be(this,"altKeyPressed",!1),be(this,"mouseMoveTimeoutTimer",null),be(this,"asyncEndDragFrameId",null),be(this,"dragOverTargetIds",null),be(this,"lastClientOffset",null),be(this,"hoverRafId",null),be(this,"getSourceClientOffset",function(i){var a=s.sourceNodes.get(i);return a&&Dh(a)||null}),be(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),be(this,"isNodeInDocument",function(i){return!!(i&&s.document&&s.document.body&&s.document.body.contains(i))}),be(this,"endDragIfSourceWasRemovedFromDOM",function(){var i=s.currentDragSourceNode;i==null||s.isNodeInDocument(i)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),be(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),be(this,"handleTopDragStart",function(i){if(!i.defaultPrevented){var a=s.dragStartSourceIds;s.dragStartSourceIds=null;var o=ti(i);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:o});var l=i.dataTransfer,u=Pa(l);if(s.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var d=s.monitor.getSourceId(),f=s.sourceNodes.get(d),g=s.sourcePreviewNodes.get(d)||f;if(g){var p=s.getCurrentSourcePreviewNodeOptions(),C=p.anchorX,h=p.anchorY,y=p.offsetX,v=p.offsetY,b={anchorX:C,anchorY:h},w={offsetX:y,offsetY:v},S=nO(f,g,o,b,w);l.setDragImage(g,S.x,S.y)}}try{l==null||l.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(i.target);var _=s.getCurrentSourcePreviewNodeOptions(),E=_.captureDraggingState;E?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(u)s.beginDragNativeItem(u);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}}}),be(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),be(this,"handleTopDragEnterCapture",function(i){s.dragEnterTargetIds=[];var a=s.enterLeaveCounter.enter(i.target);if(!(!a||s.monitor.isDragging())){var o=i.dataTransfer,l=Pa(o);l&&s.beginDragNativeItem(l,o)}}),be(this,"handleTopDragEnter",function(i){var a=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=i.altKey,a.length>0&&s.actions.hover(a,{clientOffset:ti(i)});var o=a.some(function(l){return s.monitor.canDropOnTarget(l)});o&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),be(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),be(this,"handleTopDragOver",function(i){var a=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}s.altKeyPressed=i.altKey,s.lastClientOffset=ti(i),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(a||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var o=(a||[]).some(function(l){return s.monitor.canDropOnTarget(l)});o?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))}),be(this,"handleTopDragLeaveCapture",function(i){s.isDraggingNativeItem()&&i.preventDefault();var a=s.enterLeaveCounter.leave(i.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),be(this,"handleTopDropCapture",function(i){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var a;i.preventDefault(),(a=s.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else Pa(i.dataTransfer)&&i.preventDefault();s.enterLeaveCounter.reset()}),be(this,"handleTopDrop",function(i){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:ti(i)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),be(this,"handleSelectStart",function(i){var a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))}),this.options=new fO(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new KI(this.isNodeInDocument)}return mO(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 i=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){i.sourcePreviewNodes.delete(r),i.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var i=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var a=function(u){return i.handleDragStart(u,r)},o=function(u){return i.handleSelectStart(u)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",o),function(){i.sourceNodes.delete(r),i.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",o),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,i=function(u){return s.handleDragEnter(u,r)},a=function(u){return s.handleDragOver(u,r)},o=function(u){return s.handleDrop(u,r)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",a),n.addEventListener("drop",o),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",a),n.removeEventListener("drop",o)}}},{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 wu({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 wu({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(yu).some(function(n){return yu[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=lO(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 i;return(i=n.rootElement)===null||i===void 0?void 0:i.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}(),ni;function yO(){return ni||(ni=new Image,ni.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ni}var vO=function(t,r,n){return new gO(t,r,n)};function bO(e,t){return typeof e=="function"?e(t):e??"NODE"}function wO(e){return e.isDraggable&&!e.isEditing}function CO(e){const t=Rt(),r=t.selectedIds,[n,s,i]=SI(()=>({canDrag:()=>wO(e),type:bO(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(Vn.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(Vn.dragEnd())}}),[r,e,t.props.dragType]);return m.useEffect(()=>{i(yO())},[i]),s}function SO(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),i=r.height,a=s<i/2,o=!a,l=i/4,u=s>l&&s<i-l;return{x:n,inTopHalf:a,inBottomHalf:o,inMiddle:u,atTop:!u&&a,atBottom:!u&&o}}function xO(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 si(e,t){return{parentId:e||null,index:t}}function Cn(e,t){return{type:"line",index:e,level:t}}function _O(e){return{type:"highlight",id:e}}function Ma(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,i=ih(n)+1;return{parentId:s,index:i}}function Lh(e){var t;const r=SO(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:i,nextNode:a,prevNode:o}=e,[l,u]=xO(i,o,a,r);if(i&&i.isInternal&&r.inMiddle)return{drop:si(i.id,null),cursor:_O(i.id)};if(!l)return{drop:si((t=u==null?void 0:u.parent)===null||t===void 0?void 0:t.id,0),cursor:Cn(0,0)};if(th(l)){const d=vi(s,(u==null?void 0:u.level)||0,l.level);return{drop:Ma(l,d),cursor:Cn(l.rowIndex+1,d)}}if(rh(l)){const d=vi(s,(u==null?void 0:u.level)||0,l.level);return{drop:Ma(l,d),cursor:Cn(l.rowIndex+1,d)}}if(nh(l)){const d=vi(s,0,l.level+1);return d>l.level?{drop:si(l.id,0),cursor:Cn(l.rowIndex+1,d)}:{drop:Ma(l,d),cursor:Cn(l.rowIndex+1,d)}}return{drop:si(l==null?void 0:l.id,0),cursor:Cn(l.rowIndex+1,l.level+1)}}function TO(e,t){const r=Rt(),[n,s]=Ih(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(i,a)=>{const o=a.getClientOffset();if(!e.current||!o)return;const{cursor:l,drop:u}=Lh({element:e.current,offset:o,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});u&&r.dispatch(Vn.hovering(u.parentId,u.index)),a.canDrop()?l&&r.showCursor(l):r.hideCursor()},drop:(i,a)=>{if(!a.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function EO(e){const t=Rt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return m.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Cu=m.memo(function({index:t,style:r}){eh(),V0();const n=Rt(),s=EO(t),i=m.useRef(null),a=CO(s),o=TO(i,s),l=m.useCallback(h=>{i.current=h,o(h)},[o]),u=n.indent*s.level,d=m.useMemo(()=>({paddingLeft:u}),[u]),f=m.useMemo(()=>{var h,y;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((y=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&y!==void 0?y:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};m.useEffect(()=>{var h;!s.isEditing&&s.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,i.current]);const p=n.renderNode,C=n.renderRow;return c.jsx(C,{node:s,innerRef:l,attrs:g,children:c.jsx(p,{node:s,tree:n,style:d,dragHandle:a})})});let Ba="",Su=null;function Ph(){eh();const e=Rt();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 s=Array.from(e.selectedIds);if(s.length>1){let i=e.mostRecentNode;for(;i&&i.isSelected;)i=i.nextSibling;i||(i=e.lastNode),e.focus(i,{scroll:!1}),e.delete(Array.from(s))}else{const i=e.focusedNode;if(i){const a=i.nextSibling,o=i.parent;e.focus(a||o,{scroll:!1}),e.delete(i)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),ah(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),oh(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 i=e.focusedNode;i?i.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 i=e.focusedNode;i?i.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(Su),Ba+=t.key,Su=setTimeout(()=>{Ba=""},600);const n=e.visibleNodes.find(s=>{const i=s.data.name;return typeof i=="string"?i.toLowerCase().startsWith(Ba):!1});n&&e.focus(n.id)},children:c.jsx(IO,{})})}function IO(){var e,t;const r=Rt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var i;return((i=r.visibleNodes[s])===null||i===void 0?void 0:i.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:RT,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:LT,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?c.jsx(OT,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Cu})):c.jsx(AT,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Cu}))}function xu(e){return e.isFiltered?AO(e.root,e.isMatch.bind(e)):OO(e.root)}function OO(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(Fh),t}function AO(e,t){const r={},n=[];function s(a){if(!a.isRoot&&t(a)){r[a.id]=!0;let l=a.parent;for(;l;)r[l.id]=!0,l=l.parent}if(a.children)for(let l of a.children)s(l)}function i(a){var o;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((o=a.children)===null||o===void 0||o.forEach(i))}return s(e),i(e),n.forEach(Fh),n}function Fh(e,t){e.rowIndex=t}const _u=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var $a=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function o(d){try{u(n.next(d))}catch(f){a(f)}}function l(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((n=n.apply(e,t||[])).next())})};const{safeRun:gt}=K0;class ws{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=i=>{const a=this.props.rowHeight;if(typeof a=="function"){const o=this.at(i);return o?a(o):this.rowHeight}return a??24},this.rowTopPosition=i=>{if(typeof this.props.rowHeight!="function")return i*this.rowHeight;const a=this.getRowOffsets(),o=Math.max(0,Math.min(i,a.length-1));return a[o]},this.redrawList=(i=0)=>{this.rowOffsets=null;const a=this.list.current;a&&"resetAfterIndex"in a&&a.resetAfterIndex(Math.max(0,i))},this.root=Rc(this),this.visibleNodes=xu(this),this.idToIndex=_u(this.visibleNodes)}update(t){this.props=t,this.root=Rc(this),this.visibleNodes=xu(this),this.idToIndex=_u(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=ps(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=ps(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 Ds)return t.id;const r=this.props.idAccessor||"id";return ps(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,i=this.indexOf(r);if(i===null)return[];const a=Math.min(s,i),o=Math.max(s,i);return this.visibleNodes.slice(a,o+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 $a(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?dh(this):t.parentId,i=(r=t.index)!==null&&r!==void 0?r:uh(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",o=yield gt(this.props.onCreate,{type:a,parentId:s,index:i,parentNode:this.get(s)});o&&(this.focus(o),setTimeout(()=>{this.edit(o).then(()=>{this.select(o),this.activate(o)})}))})}delete(t){return $a(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),i=s.length?Math.min(...s.map(a=>{var o;return(o=a.rowIndex)!==null&&o!==void 0?o:0})):0;yield gt(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(i)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(Oa(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(i=>{ws.editPromise=i})}submit(t,r){return $a(this,void 0,void 0,function*(){var n,s;if(!t)return;const i=this.identify(t);yield gt(this.props.onRename,{id:i,name:r,node:this.get(i)}),this.dispatch(Oa(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Oa(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&gt(this.props.onActivate,r)}resolveEdit(t){const r=ws.editPromise;r&&r(t),ws.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(gn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&gt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,i=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-i,0),this.focus(this.at(a))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,i=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+i,this.visibleNodes.length-1),this.focus(this.at(a))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,i=this.identify(t);s&&this.dispatch(gn(i)),!((n=this.get(i))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[i],anchor:i,mostRecent:i}),this.scrollTo(i,r.align),this.focusedNode&&s&&gt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Tr.remove(r)),gt(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(gn(n.id)),n.isSelectable&&(this.dispatch(Tr.add(n.id)),this.dispatch(Tr.anchor(n.id)),this.dispatch(Tr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&gt(this.props.onFocus,this.focusedNode),gt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(gn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:i}=this.state.nodes.selection,a=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(Tr.remove(this.nodesBetween(s,i))),this.dispatch(Tr.add(a)),this.dispatch(Tr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&gt(this.props.onFocus,this.focusedNode),gt(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(gn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&gt(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),i=this.identifyNull(t.mostRecent);this.dispatch(Tr.set({ids:n,anchor:s,mostRecent:i})),gt(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 i of n)if(!i||!r||i.isInternal&&sh(r,i))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;gt(this.props.onMove,{dragIds:n,parentId:t===As?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(Vn.cursor({type:"none"}))}showCursor(t){this.dispatch(Vn.cursor(t))}open(t,r=!0){var n,s;const i=this.identifyNull(t);i&&(this.isOpen(i)||(this.dispatch(Oo.open(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),gt(this.props.onToggle,i)))}close(t,r=!0){var n,s;const i=this.identifyNull(t);i&&this.isOpen(i)&&(this.dispatch(Oo.close(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),gt(this.props.onToggle,i))}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=gl(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(){Mi(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){Mi(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),ch(()=>n in this.idToIndex).then(()=>{var s;const i=this.idToIndex[n];i!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(i,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===As)return!0;const i=(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:i}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!ps(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(gn(t.id))}onBlur(){this.dispatch(iT())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ph}get renderRow(){return this.props.renderRow||eT}get renderNode(){return this.props.children||tT}get renderDragPreview(){return this.props.renderDragPreview||fh}get renderCursor(){return this.props.renderCursor||J0}}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 DO=typeof Symbol=="function"&&Symbol.observable||"@@observable",Tu=DO,qa=()=>Math.random().toString(36).substring(7).split("").join("."),NO={INIT:`@@redux/INIT${qa()}`,REPLACE:`@@redux/REPLACE${qa()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${qa()}`},cn=NO;function Mh(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 RO(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(LO(e))return"date";if(jO(e))return"error";const r=kO(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 kO(e){return typeof e.constructor=="function"?e.constructor.name:null}function jO(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function LO(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Or(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=RO(e)),t}function Bh(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?yt(2):`Expected the root reducer to be a function. Instead, received: '${Or(e)}'`);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: '${Or(r)}'`);return r(Bh)(e,t)}let n=e,s=t,i=new Map,a=i,o=0,l=!1;function u(){a===i&&(a=new Map,i.forEach((y,v)=>{a.set(v,y)}))}function d(){if(l)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 s}function f(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?yt(4):`Expected the listener to be a function. Instead, received: '${Or(y)}'`);if(l)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.");let v=!0;u();const b=o++;return a.set(b,y),function(){if(v){if(l)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,u(),a.delete(b),i=null}}}function g(y){if(!Mh(y))throw new Error(process.env.NODE_ENV==="production"?yt(7):`Actions must be plain objects. Instead, the actual type was: '${Or(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"?yt(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"?yt(17):`Action "type" property must be a string. Instead, the actual type was: '${Or(y.type)}'. Value was: '${y.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?yt(9):"Reducers may not dispatch actions.");try{l=!0,s=n(s,y)}finally{l=!1}return(i=a).forEach(b=>{b()}),y}function p(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?yt(10):`Expected the nextReducer to be a function. Instead, received: '${Or(y)}`);n=y,g({type:cn.REPLACE})}function C(){const y=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?yt(11):`Expected the observer to be an object. Instead, received: '${Or(v)}'`);function b(){const S=v;S.next&&S.next(d())}return b(),{unsubscribe:y(b)}},[Tu](){return this}}}return g({type:cn.INIT}),{dispatch:g,subscribe:f,getState:d,replaceReducer:p,[Tu]:C}}function Eu(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function PO(e,t,r,n){const s=Object.keys(t),i=r&&r.type===cn.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(!Mh(e))return`The ${i} has unexpected type of "${Or(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const a=Object.keys(e).filter(o=>!t.hasOwnProperty(o)&&!n[o]);if(a.forEach(o=>{n[o]=!0}),!(r&&r.type===cn.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function FO(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:cn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?yt(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:cn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?yt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${cn.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 Iu(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const o=t[a];process.env.NODE_ENV!=="production"&&typeof e[o]>"u"&&Eu(`No reducer provided for key "${o}"`),typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let i;try{FO(r)}catch(a){i=a}return function(o={},l){if(i)throw i;if(process.env.NODE_ENV!=="production"){const f=PO(o,r,l,s);f&&Eu(f)}let u=!1;const d={};for(let f=0;f<n.length;f++){const g=n[f],p=r[g],C=o[g],h=p(C,l);if(typeof h>"u"){const y=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?yt(14):`When called with an action of type ${y?`"${String(y)}"`:"(unknown type)"}, the slice reducer for key "${g}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}d[g]=h,u=u||h!==C}return u=u||n.length!==Object.keys(o).length,u?d:o}}function MO(e=zn().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 BO=Iu({nodes:Iu({focus:aT,edit:sT,open:oT,selection:lT,drag:MO}),dnd:cT}),$O=zn();function qO({treeProps:e,imperativeHandle:t,children:r}){const n=m.useRef(null),s=m.useRef(null),i=m.useRef(Bh(BO,zn(e))),a=z0.useSyncExternalStore(i.current.subscribe,i.current.getState,()=>$O),o=m.useMemo(()=>new ws(i.current,e,n,s),[]),l=m.useRef(0);return m.useMemo(()=>{l.current+=1,o.update(e)},Object.values(e)),m.useMemo(()=>{l.current+=1,o.update(o.props)},[a.nodes.open]),m.useImperativeHandle(t,()=>o),m.useEffect(()=>{o.props.selection?o.select(o.props.selection,{focus:!1}):o.deselectAll()},[o.props.selection]),m.useEffect(()=>{o.props.searchTerm||i.current.dispatch(Oo.clear(!0))},[o.props.searchTerm]),c.jsx(Yf.Provider,{value:o,children:c.jsx(Jf.Provider,{value:l.current,children:c.jsx(Zf.Provider,{value:a.nodes,children:c.jsx(Xf.Provider,{value:a.dnd,children:c.jsx(v1,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||vO,options:{rootElement:o.props.dndRootElement||void 0}},{children:r}))})})})})}function UO(){const e=Rt(),[,t]=Ih(()=>({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:i,drop:a}=Lh({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(Vn.hovering(a.parentId,a.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function zO(e){return UO(),e.children}function VO(){const t=Rt().props.renderContainer||Ph;return c.jsx(c.Fragment,{children:c.jsx(t,{})})}function HO(){const e=Rt(),{offset:t,mouse:r,item:n,isDragging:s}=zI(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),i=e.props.renderDragPreview||fh;return c.jsx(i,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function QO(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:i=>i[n],getChildren:typeof s=="function"?s:i=>i[s],childrenKey:typeof s=="string"?s:"children"}}class GO{constructor(t,r={}){this.accessors=QO(r),this.root=WO(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 WO(e,t){const r=new $h({},null,t,"ROOT");return r.children=e.map(n=>xl(n,r,t)),r}function xl(e,t,r){const n=new $h(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(i=>xl(i,n,r))),n}class $h{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 i=xl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,i);const a=this.accessors.childrenKey,o=this.data;o[a]=(s=o[a])!==null&&s!==void 0?s:[],o[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 KO=0;function YO(e,t={}){const[r,n]=m.useState(e),s=t.idAccessor,i=t.childrenAccessor,a=m.useMemo(()=>new GO(r,{idAccessor:s,childrenAccessor:i}),[r,s,i]),o=C=>{for(const h of C.dragIds)a.move({id:h,parentId:C.parentId,index:C.index});n(a.data)},l=({name:C,id:h})=>{a.update({id:h,changes:{name:C}}),n(a.data)},u=typeof s=="string"?s:"id",d=typeof i=="string"?i:"children";return[r,{onMove:o,onRename:l,onCreate:({parentId:C,index:h,type:y})=>{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(y==="internal"&&typeof i=="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={[u]:`simple-tree-id-${KO++}`,name:""};return y==="internal"&&(v[d]=[]),a.create({parentId:C,index:h,data:v}),n(a.data),v},onDelete:C=>{C.ids.forEach(h=>a.drop({id:h})),n(a.data)}}]}function ZO(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]=YO(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function XO(e,t){const r=ZO(e);return c.jsxs(qO,{treeProps:r,imperativeHandle:t,children:[c.jsx(zO,{children:c.jsx(VO,{})}),c.jsx(HO,{})]})}const JO=m.forwardRef(XO);function _l(){return Oe(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 eA(){return Oe(e=>{var s;if(!e.selectedNodeId)return!1;const t=(s=e.treeData[0])==null?void 0:s.id,r=i=>{var a;for(const o of i){if(o.id===e.selectedNodeId)return o;if((a=o.children)!=null&&a.length){const l=r(o.children);if(l)return l}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Ou={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",default:"#6B7280"},Au={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",default:"File"},Du=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],tA=[{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 rA(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 ca(e){const t=rA(e);return{key:t,color:Ou[t]??Ou.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:Au[t]??Au.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const nA="_row_i3qt2_1",sA="_grip_i3qt2_16",iA="_menuBtn_i3qt2_19",aA="_selected_i3qt2_23",oA="_title_i3qt2_28",lA="_dropTarget_i3qt2_33",cA="_toggle_i3qt2_50",uA="_ctIcon_i3qt2_65",dA="_folderIcon_i3qt2_77",fA="_renameInput_i3qt2_92",hA="_dropHere_i3qt2_101",pA="_menuWrap_i3qt2_111",mA="_menu_i3qt2_19",gA="_dangerItem_i3qt2_163",Ot={row:nA,grip:sA,menuBtn:iA,selected:aA,title:oA,dropTarget:lA,toggle:cA,ctIcon:uA,folderIcon:dA,renameInput:fA,dropHere:hA,menuWrap:pA,menu:mA,dangerItem:gA},yA={video:al,pdf:ea,h5p:rl,scorm:sl,audio:nl,quiz:el,default:Yn},vA=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[s,i]=m.useState(!1),[a,o]=m.useState(!1),[l,u]=m.useState(e.data.name),d=m.useRef(null),f=ce(),g=n==="edit",p=_l(),C=ca(e.data),h=yA[C.key]??Yn,y=e.isSelected,v=e.level===0,b=e.data.isFolder??(e.children&&e.children.length>0),w=v?jy:b?$y:h;m.useEffect(()=>{if(!s)return;const E=D=>{var R;(R=d.current)!=null&&R.contains(D.target)||i(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[s]);const S=m.useCallback(()=>{l.trim()&&e.submit(l.trim()),o(!1)},[l,e]),_=m.useCallback(E=>{E.key==="Enter"&&S(),E.key==="Escape"&&(u(e.data.name),o(!1))},[S,e.data.name]);return c.jsxs("div",{className:[Ot.row,y?Ot.selected:"",e.state.isOver&&b?Ot.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:[g&&c.jsx("span",{ref:r,className:Ot.grip,"aria-hidden":"true",children:c.jsx(uf,{size:14})}),c.jsx("button",{className:Ot.toggle,onClick:E=>{E.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:b?"visible":"hidden"},children:e.isClosed?c.jsx(af,{size:14}):c.jsx(Kn,{size:14})}),c.jsx("span",{className:`${Ot.ctIcon} ${v||b?Ot.folderIcon:C.bgClass}`,"aria-hidden":"true",children:c.jsx(w,{size:12})}),a?c.jsx("input",{className:Ot.renameInput,value:l,autoFocus:!0,onChange:E=>u(E.target.value),onBlur:S,onKeyDown:_,onClick:E=>E.stopPropagation()}):c.jsx("span",{className:Ot.title,title:e.data.name,onDoubleClick:()=>g&&o(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&b&&c.jsx("span",{className:Ot.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),g&&c.jsxs("div",{className:Ot.menuWrap,ref:d,children:[c.jsx("button",{className:Ot.menuBtn,onClick:E=>{E.stopPropagation(),i(D=>!D)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:c.jsx(lf,{size:14})}),s&&c.jsxs("div",{className:Ot.menu,role:"menu",children:[c.jsxs("button",{role:"menuitem",onClick:()=>{o(!0),i(!1)},children:[c.jsx(Gy,{size:13})," ",f.treeNode.renameMenuItem]}),b&&p&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),i(!1)},children:[c.jsx(cf,{size:13})," ",f.treeNode.addSubunitMenuItem]}),e.data.parent&&p&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),i(!1)},children:[c.jsx(Us,{size:13})," ",f.treeNode.addSiblingMenuItem]}),c.jsxs("button",{role:"menuitem",className:Ot.dangerItem,onClick:()=>{e.tree.delete(e.id),i(!1)},children:[c.jsx(il,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function bA(e,t){var i,a;const n=((i=(await Ne.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:i.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 wA(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 CA(e,t){var o;const r=await bA(e,t.name),n=await wA(r,t),s=new FormData;return s.append("fileUrl",n),s.append("mimeType",t.type||"text/csv"),{processId:(((o=(await Ne.post(`/action/collection/v1/import/${e}`,s)).data)==null?void 0:o.result)??{}).processId??""}}async function SA(e){var r;return((r=(await Ne.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function qh(e){var n,s,i;const r=(i=(s=(n=(await Ne.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:i.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function xA(e){return qh(e)}const _A="_container_jr3ij_1",TA="_header_jr3ij_13",EA="_title_jr3ij_22",IA="_closeBtn_jr3ij_29",OA="_body_jr3ij_45",AA="_dropZone_jr3ij_54",DA="_dragOver_jr3ij_67",NA="_hasFile_jr3ij_72",RA="_hiddenInput_jr3ij_78",kA="_fileInfo_jr3ij_82",jA="_fileIcon_jr3ij_89",LA="_fileName_jr3ij_93",PA="_fileSize_jr3ij_100",FA="_dropHint_jr3ij_105",MA="_dropIcon_jr3ij_112",BA="_dropText_jr3ij_117",$A="_dropSubtext_jr3ij_124",qA="_sampleLink_jr3ij_130",UA="_statusBar_jr3ij_145",zA="_status_uploading_jr3ij_154",VA="_status_processing_jr3ij_154",HA="_status_done_jr3ij_159",QA="_status_error_jr3ij_164",GA="_successDetail_jr3ij_170",WA="_spinner_jr3ij_175",KA="_spin_jr3ij_175",YA="_errorMsg_jr3ij_191",ZA="_failedSection_jr3ij_197",XA="_failedTitle_jr3ij_203",JA="_tableWrap_jr3ij_213",eD="_failedTable_jr3ij_219",tD="_reasonCell_jr3ij_244",rD="_footer_jr3ij_248",Re={container:_A,header:TA,title:EA,closeBtn:IA,body:OA,dropZone:AA,dragOver:DA,hasFile:NA,hiddenInput:RA,fileInfo:kA,fileIcon:jA,fileName:LA,fileSize:PA,dropHint:FA,dropIcon:MA,dropText:BA,dropSubtext:$A,sampleLink:qA,statusBar:UA,status_uploading:zA,status_processing:VA,status_done:HA,status_error:QA,successDetail:GA,spinner:WA,spin:KA,errorMsg:YA,failedSection:ZA,failedTitle:XA,tableWrap:JA,failedTable:eD,reasonCell:tD,footer:rD},nD=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const s=ce(),[i,a]=m.useState(null),[o,l]=m.useState(!1),[u,d]=m.useState("idle"),[f,g]=m.useState(""),[p,C]=m.useState([]),[h,y]=m.useState(null),v=m.useRef(null),b=m.useRef(null),w=m.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[]);m.useEffect(()=>()=>w(),[w]);const S=N=>N.name.toLowerCase().endsWith(".csv")?N.size>50*1024*1024?(g(s.csvUpload.fileTooLarge),!1):!0:(g(s.csvUpload.invalidFileType),!1),_=m.useCallback(N=>{g(""),C([]),y(null),d("idle"),S(N)&&a(N)},[]),E=m.useCallback(N=>{N.preventDefault(),l(!1);const j=N.dataTransfer.files[0];j&&_(j)},[_]),D=m.useCallback(N=>{var P;const j=(P=N.target.files)==null?void 0:P[0];j&&_(j),N.target.value=""},[_]),R=m.useCallback(async()=>{try{const N=await xA(e),j=document.createElement("a");j.href=N,j.download="sample_hierarchy.csv",j.target="_blank",j.click()}catch{g(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),M=m.useCallback(async()=>{if(i){d("uploading"),g(""),C([]);try{const{processId:N}=await CA(e,i);if(!N){d("done"),y(null),setTimeout(t,1500);return}d("processing"),b.current=setInterval(async()=>{try{const j=await SA(N);j.status==="COMPLETED"?(w(),d("done"),y(j.successCount??null),j.failedRecords&&j.failedRecords.length>0?C(j.failedRecords):setTimeout(t,1500)):j.status==="FAILED"&&(w(),d("error"),g(s.csvUpload.processingFailed),j.failedRecords&&C(j.failedRecords))}catch{w(),d("error"),g(s.csvUpload.connectionLost)}},2e3)}catch{d("error"),g(s.csvUpload.uploadFailed)}}},[e,i,t,w,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 c.jsxs("div",{className:Re.container,children:[c.jsxs("div",{className:Re.header,children:[c.jsx("h2",{className:Re.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),c.jsx("button",{className:Re.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:c.jsx(Cr,{size:18})})]}),c.jsxs("div",{className:Re.body,children:[c.jsxs("div",{className:`${Re.dropZone} ${o?Re.dragOver:""} ${i?Re.hasFile:""}`,onDragEnter:N=>{N.preventDefault(),l(!0)},onDragOver:N=>{N.preventDefault(),l(!0)},onDragLeave:N=>{N.preventDefault(),l(!1)},onDrop:E,onClick:()=>{var N;return(N=v.current)==null?void 0:N.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:N=>{var j;return N.key==="Enter"&&((j=v.current)==null?void 0:j.click())},children:[c.jsx("input",{ref:v,type:"file",accept:".csv",className:Re.hiddenInput,onChange:D,"aria-hidden":"true"}),i?c.jsxs("div",{className:Re.fileInfo,children:[c.jsx(ea,{size:24,className:Re.fileIcon}),c.jsx("span",{className:Re.fileName,children:i.name}),c.jsxs("span",{className:Re.fileSize,children:["(",(i.size/1024).toFixed(1)," KB)"]})]}):c.jsxs("div",{className:Re.dropHint,children:[c.jsx(yo,{size:32,className:Re.dropIcon}),c.jsx("p",{className:Re.dropText,children:s.csvUpload.dropText}),c.jsx("p",{className:Re.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),c.jsx("button",{className:Re.sampleLink,onClick:R,type:"button",children:s.csvUpload.downloadSample}),u!=="idle"&&c.jsxs("div",{className:`${Re.statusBar} ${Re[`status_${u}`]}`,role:"status","aria-live":"polite",children:[u==="processing"&&c.jsx("span",{className:Re.spinner,"aria-hidden":"true"}),$[u],u==="done"&&h!==null&&c.jsx("span",{className:Re.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&c.jsx("p",{className:Re.errorMsg,role:"alert",children:f}),p.length>0&&c.jsxs("div",{className:Re.failedSection,children:[c.jsx("h4",{className:Re.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(p.length))}),c.jsx("div",{className:Re.tableWrap,children:c.jsxs("table",{className:Re.failedTable,children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:s.csvUpload.rowHeader}),c.jsx("th",{children:s.csvUpload.nameHeader}),c.jsx("th",{children:s.csvUpload.reasonHeader})]})}),c.jsx("tbody",{children:p.map((N,j)=>c.jsxs("tr",{children:[c.jsx("td",{children:N.rowNumber??j+1}),c.jsx("td",{children:N.name??"—"}),c.jsx("td",{className:Re.reasonCell,children:N.reason??s.csvUpload.unknownError})]},j))})]})})]})]}),c.jsxs("div",{className:Re.footer,children:[c.jsx(Fe,{variant:"ghost",onClick:r,disabled:u==="uploading"||u==="processing",children:s.csvUpload.cancel}),c.jsx(Fe,{variant:"primary",isLoading:u==="uploading"||u==="processing",disabled:!i||u==="done",onClick:M,children:u==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})},sD="_container_1y30m_1",iD="_header_1y30m_8",aD="_headerActions_1y30m_19",oD="_iconBtn_1y30m_25",lD="_menuWrap_1y30m_43",cD="_dropdownMenu_1y30m_47",uD="_treeWrapper_1y30m_79",dD="_csvModal_1y30m_95",fD="_footer_1y30m_105",ar={container:sD,header:iD,headerActions:aD,iconBtn:oD,menuWrap:lD,dropdownMenu:cD,treeWrapper:uD,csvModal:dD,footer:fD},hD=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var de;const n=ce(),s=m.useRef(null),i=m.useRef(null),a=m.useRef(null),[o,l]=m.useState(400),[u,d]=m.useState(!1),[f,g]=m.useState(!1),[p,C]=m.useState("create"),{treeData:h,selectedNodeId:y,selectNode:v,addNode:b,deleteNode:w,reorderChildren:S,moveNode:_,setTreeData:E}=Oe(),D=e==="edit",R=_l(),M=D&&R,$=(((de=h[0])==null?void 0:de.children)??[]).some(Q=>Q.isFolder),N=oe(Q=>{var ne,te,U,H;return((te=(ne=Q.editorConfig)==null?void 0:ne.context)==null?void 0:te.contentId)??((H=(U=Q.editorConfig)==null?void 0:U.context)==null?void 0:H.identifier)??""}),j=oe(Q=>{var te,U;const ne=(U=(te=Q.categoryMeta)==null?void 0:te.sourcingSettings)==null?void 0:U.collection;return(ne==null?void 0:ne.enableBulkUpload)!==!1});m.useEffect(()=>{const Q=i.current;if(!Q)return;const ne=new ResizeObserver(()=>{l(Q.clientHeight||400)});return ne.observe(Q),l(Q.clientHeight||400),()=>ne.disconnect()},[]),m.useEffect(()=>{if(!u)return;const Q=ne=>{var te;(te=a.current)!=null&&te.contains(ne.target)||d(!1)};return document.addEventListener("mousedown",Q),()=>document.removeEventListener("mousedown",Q)},[u]);const P=m.useCallback(Q=>{Q.length>0&&v(Q[0].data.id)},[v]),k=m.useCallback(({parentId:Q,index:ne,dragIds:te})=>{if(!Q)return;const U=te[0],H=Fo(h,U);if(!H)return;const ie=H.parent;if(ie===Q){const fe=Fo(h,Q);if(!(fe!=null&&fe.children))return;const J=fe.children.findIndex(se=>se.id===U);if(J<0)return;S(Q,J,ne>J?ne-1:ne)}else _(U,ie??"",Q)},[h,S,_]),L=m.useCallback(({ids:Q})=>{Q.forEach(ne=>w(ne))},[w]),V=m.useCallback(({parentId:Q})=>{var U;const ne=Q??((U=h[0])==null?void 0:U.id)??"";if(!ne)return{id:crypto.randomUUID()};const te=b(ne,"unit");return te?{id:te}:(Ee.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[b,h,n]),X=m.useCallback(()=>{var ne;const Q=(ne=h[0])==null?void 0:ne.id;Q&&(b(Q,"unit")||Ee.error(n.outlineTree.maxDepthReachedToast))},[h,b,n]),ye=m.useCallback(()=>{y&&(b(y,"subunit")||Ee.error(n.outlineTree.maxDepthReachedToast))},[y,b,n]),_e=m.useCallback(async()=>{if(d(!1),!!N)try{const Q=await qh(N),ne=await fetch(Q).then(H=>H.blob()),te=URL.createObjectURL(ne),U=document.createElement("a");U.href=te,U.download=`${N}-folders.csv`,U.style.display="none",document.body.appendChild(U),U.click(),document.body.removeChild(U),URL.revokeObjectURL(te)}catch{Ee.error(n.outlineTree.downloadCsvFailedToast)}},[N,n]),we=m.useCallback(async()=>{if(g(!1),!!N)try{const{rootNode:Q}=await Kf(N);E([Q]),Ee.success(n.outlineTree.outlineRefreshedToast)}catch{Ee.error(n.outlineTree.outlineRefreshFailedToast)}},[N,E,n]);return c.jsxs("div",{className:ar.container,children:[c.jsx("div",{className:ar.header,children:c.jsxs("div",{className:ar.headerActions,children:[D&&c.jsxs("div",{className:ar.menuWrap,ref:a,children:[c.jsx("button",{type:"button",className:ar.iconBtn,onClick:()=>d(Q=>!Q),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":u,children:c.jsx(lf,{size:15})}),u&&c.jsx("div",{className:ar.dropdownMenu,role:"menu",children:j&&c.jsxs(c.Fragment,{children:[c.jsx("button",{role:"menuitem",type:"button",disabled:$,title:$?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{d(!1),C("create"),g(!0)},children:n.outlineTree.createFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!$,title:$?void 0:n.outlineTree.noFoldersYetTitle,onClick:_e,children:n.outlineTree.downloadFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!$,title:$?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{d(!1),C("update"),g(!0)},children:n.outlineTree.updateFoldersCsvButton})]})})]}),r&&c.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?c.jsx(Hy,{size:15}):c.jsx(Vy,{size:15})})]})}),c.jsx("div",{className:ar.treeWrapper,ref:i,children:c.jsx(JO,{ref:s,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:P,onMove:D?k:void 0,onDelete:D?L:void 0,onCreate:D?V:void 0,disableEdit:!D,disableDrop:!D,selection:y??void 0,rowHeight:40,indent:20,paddingBottom:16,height:o,width:"100%",children:Q=>c.jsx(vA,{...Q,editorMode:e})})}),D&&c.jsxs("div",{className:ar.footer,children:[c.jsxs(Fe,{variant:"ghost",size:"sm",onClick:X,disabled:!M,children:[c.jsx(Us,{size:14})," ",n.outlineTree.addUnitButton]}),c.jsxs(Fe,{variant:"ghost",size:"sm",onClick:ye,disabled:!M||!y,children:[c.jsx(cf,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&c.jsx("div",{className:ar.csvModal,children:c.jsx(nD,{contentId:N,mode:p,onComplete:we,onClose:()=>g(!1)})})]})};function Fo(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=Fo(r.children,t);if(n)return n}}}const pD="_breadcrumb_zd1aj_1",mD="_crumb_zd1aj_10",gD="_sep_zd1aj_26",yD="_current_zd1aj_31",os={breadcrumb:pD,crumb:mD,sep:gD,current:yD},vD=({crumbs:e})=>{const t=Oe(n=>n.selectNode),r=ce();return e.length?c.jsxs("nav",{className:os.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[c.jsx("button",{className:os.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:c.jsx(Uy,{size:13})}),e.map((n,s)=>c.jsxs(m.Fragment,{children:[c.jsx(af,{size:13,className:os.sep}),s<e.length-1?c.jsx("button",{className:os.crumb,onClick:()=>t(n.id),children:n.name}):c.jsx("span",{className:os.current,children:n.name})]},n.id))]}):null},bD="_tabBar_qhks1_1",wD="_tab_qhks1_1",CD="_active_qhks1_29",SD="_error_qhks1_35",xD="_errorDot_qhks1_39",ls={tabBar:bD,tab:wD,active:CD,error:SD,errorDot:xD},_D=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=ce(),i=[{id:"details",label:s.tabBar.detailsTab},{id:"audience",label:s.tabBar.audienceCurriculumTab},{id:"licensing",label:s.tabBar.licensingTab}],a=n?i.filter(o=>n.includes(o.id)):i;return c.jsx("div",{className:ls.tabBar,role:"tablist","aria-label":s.tabBar.metadataSectionsAriaLabel,children:a.map(o=>c.jsxs("button",{role:"tab","aria-selected":e===o.id,"aria-controls":`panel-${o.id}`,className:[ls.tab,e===o.id?ls.active:"",r.includes(o.id)?ls.error:""].join(" "),onClick:()=>t(o.id),children:[o.label,r.includes(o.id)&&c.jsx("span",{className:ls.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},o.id))})};var Ws=e=>e.type==="checkbox",Yr=e=>e instanceof Date,ut=e=>e==null;const Uh=e=>typeof e=="object";var We=e=>!ut(e)&&!Array.isArray(e)&&Uh(e)&&!Yr(e),Mo=e=>We(e)&&e.target?Ws(e.target)?e.target.checked:e.target.value:e,zh=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Vh=e=>{const t=e.constructor&&e.constructor.prototype;return We(t)&&t.hasOwnProperty("isPrototypeOf")},ua=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ke(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(ua&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(We(e)&&Vh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Ke(e[s]));return n}const Dr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Xt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Yt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ua="form",Hh="root",Qh=["__proto__","constructor","prototype"];var Ks=e=>/^\w*$/.test(e),Be=e=>e===void 0,da=e=>e.split(/[.[\]'"]/g).filter(Boolean),W=(e,t,r)=>{if(!t||!We(e))return r;const n=Ks(t)?[t]:da(t);if(n.some(i=>Qh.includes(i)))return r;const s=n.reduce((i,a)=>ut(i)?void 0:i[a],e);return Be(s)||s===e?Be(e[t])?r:e[t]:s},Ft=e=>typeof e=="boolean",bt=e=>typeof e=="function",Le=(e,t,r)=>{let n=-1;const s=Ks(t)?[t]:da(t),i=s.length,a=i-1;for(;++n<i;){const o=s[n];let l=r;if(n!==a){const u=e[o];l=We(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(Qh.includes(o))return;e[o]=l,e=e[o]}};const Tl=m.createContext(null);Tl.displayName="HookFormControlContext";const El=()=>m.useContext(Tl);var Gh=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Xt.all&&(t._proxyFormState[a]=!n||Xt.all),r&&(r[a]=!0),e[a]}});return s};const Il=ua?m.useLayoutEffect:m.useEffect;function TD(e){const t=El(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[a,o]=m.useState(()=>({...r._formState,defaultValues:r._defaultValues})),l=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Il(()=>r._subscribe({name:s,formState:l.current,exact:i,callback:u=>{!n&&o({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),m.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),m.useMemo(()=>Gh(a,r,l.current,!1),[a,r])}var wt=e=>typeof e=="string",Bo=(e,t,r,n,s)=>wt(e)?(n&&t.watch.add(e),W(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),W(r,i))):(n&&(t.watchAll=!0),r),$o=e=>ut(e)||!Uh(e);const Nu=(e,t)=>t.length===0&&!Array.isArray(e)&&!Vh(e);function Mt(e,t,r=new WeakMap){if(e===t)return!0;if($o(e)||$o(t))return Object.is(e,t);if(Yr(e)&&Yr(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(Nu(e,n)||Nu(t,s))return Object.is(e,t);const i=r.get(e);if(i&&i.has(t))return!0;i?i.add(t):r.set(e,new WeakSet([t]));for(const a of n){const o=e[a];if(!(a in t))return!1;if(a!=="ref"){const l=t[a];if(Yr(o)&&Yr(l)||(We(o)||Array.isArray(o))&&(We(l)||Array.isArray(l))?!Mt(o,l,r):!Object.is(o,l))return!1}}return!0}function ED(e){const t=El(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:a,compute:o}=e||{},l=m.useRef(s),u=m.useRef(o),d=m.useRef(void 0),f=m.useRef(r),g=m.useRef(n);u.current=o;const[p,C]=m.useState(()=>{const S=r._getWatch(n,l.current);return u.current?u.current(S):S}),h=m.useCallback(S=>{const _=Bo(n,r._names,S||r._formValues,!1,l.current);return u.current?u.current(_):_},[r._formValues,r._names,n]),y=m.useCallback(S=>{if(!i){const _=Bo(n,r._names,S||r._formValues,!1,l.current);if(u.current){const E=u.current(_);Mt(E,d.current)||(C(E),d.current=E)}else C(_)}},[r._formValues,r._names,i,n]);Il(()=>((f.current!==r||!Mt(g.current,n))&&(f.current=r,g.current=n,y()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:S=>{y(S.values)}})),[r,a,n,y]),m.useEffect(()=>r._removeUnmounted());const v=f.current!==r,b=g.current,w=m.useMemo(()=>{if(i)return null;const S=!v&&!Mt(b,n);return v||S?h():null},[i,v,n,b,h]);return w!==null?w:p}function fa(e){const t=El(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:a,exact:o=!0}=e,l=zh(s._names.array,r),u=m.useMemo(()=>W(s._formValues,r,W(s._defaultValues,r,a)),[s,r,a]),d=ED({control:s,name:r,defaultValue:u,exact:o}),f=TD({control:s,name:r,exact:o}),g=m.useRef(e),p=m.useRef(null),C=m.useRef(s.register(r,{...e.rules,value:d,...Ft(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const h=m.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=m.useCallback(S=>{const _=Mo(S);return W(s._fields,r)||(C.current=s.register(r,{...g.current.rules,value:_})),C.current.onChange({target:{value:Mo(S),name:r},type:Dr.CHANGE})},[r,s]),v=m.useCallback(()=>C.current.onBlur({target:{value:W(s._formValues,r),name:r},type:Dr.BLUR}),[r,s._formValues]),b=m.useCallback(S=>{S&&(p.current={focus:()=>bt(S.focus)&&S.focus(),select:()=>bt(S.select)&&S.select(),setCustomValidity:E=>bt(S.setCustomValidity)&&S.setCustomValidity(E),reportValidity:()=>bt(S.reportValidity)&&S.reportValidity()});const _=W(s._fields,r);_&&_._f&&S&&(_._f.ref=p.current)},[s._fields,r]),w=m.useMemo(()=>({name:r,value:d,...Ft(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:y,onBlur:v,ref:b}),[r,n,f.disabled,y,v,b,d]);return m.useEffect(()=>{const S=s._options.shouldUnregister||i;s.register(r,{...g.current.rules,...Ft(g.current.disabled)?{disabled:g.current.disabled}:{}});const _=(E,D)=>{const R=W(s._fields,E);R&&R._f&&(R._f.mount=D)};if(_(r,!0),S){const E=Ke(W(i?s._defaultValues:s._options.values||s._defaultValues,r,W(s._options.defaultValues,r,g.current.defaultValue)));Le(s._defaultValues,r,E),Be(W(s._formValues,r))&&Le(s._formValues,r,E)}if(!l&&s.register(r),p.current){const E=W(s._fields,r);E&&E._f&&(E._f.ref=p.current)}return()=>{(l?S&&!s._state.action:S)?s.unregister(r):_(r,!1)}},[r,s,l,i]),m.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),m.useMemo(()=>({field:w,formState:f,fieldState:h}),[w,f,h])}const Ol=m.createContext(null);Ol.displayName="HookFormContext";const rr=()=>m.useContext(Ol),ID=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:a,setValues:o,trigger:l,formState:u,resetField:d,reset:f,handleSubmit:g,unregister:p,control:C,register:h,setFocus:y,subscribe:v})=>{const b=m.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:a,setValues:o,trigger:l,formState:u,resetField:d,reset:f,handleSubmit:g,unregister:p,control:C,register:h,setFocus:y,subscribe:v}),[i,C,u,n,r,g,h,f,d,s,y,a,o,v,l,p,t]);return m.createElement(Ol.Provider,{value:b},m.createElement(Tl.Provider,{value:b.control},e))};var OD=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Wh=e=>Array.isArray(e)?e.filter(Boolean):[],Ei=e=>Array.isArray(e)?e:[e],Ru=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function Kh(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&&We(s)&&i){const a=Kh(s,i);We(a)&&(r[n]=a)}else e[n]&&(r[n]=i)}return r}var at=e=>We(e)&&!Object.keys(e).length,Al=e=>e.type==="file",$i=e=>{if(!ua)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Yh=e=>e.type==="select-multiple",Dl=e=>e.type==="radio",AD=e=>Dl(e)||Ws(e),za=e=>$i(e)&&e.isConnected;function DD(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(ut(e)){e=void 0;break}e=e[t[n]],n++}return e}function ND(e){for(const t in e)if(e.hasOwnProperty(t)&&!Be(e[t]))return!1;return!0}function Je(e,t){if(wt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Ks(t)?[t]:da(t),n=r.length===1?e:DD(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(We(n)&&at(n)||Array.isArray(n)&&ND(n))&&Je(e,r.slice(0,-1)),e}var RD=e=>{for(const t in e)if(bt(e[t]))return!0;return!1};function Zh(e){return Array.isArray(e)||We(e)&&!RD(e)}function qo(e,t={}){for(const r in e){const n=e[r];Zh(n)?(t[r]=Array.isArray(n)?[]:{},qo(n,t[r])):Be(n)||(t[r]=!0)}return t}function Uo(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>Uo(r));return t.some(r=>r!==void 0)?t:void 0}if(We(e)){const t={};for(const r in e){const n=Uo(e[r]);Be(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Qr(e,t,r){r||(r=qo(t));for(const n in e){const s=e[n];if(Zh(s))Be(t)||$o(r[n])?r[n]=qo(s,Array.isArray(s)?[]:{}):Qr(s,ut(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!Mt(s,i)}}return Uo(r)||{}}const ku={value:!1,isValid:!1},ju={value:!0,isValid:!0};var Xh=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&&!Be(e[0].attributes.value)?Be(e[0].value)||e[0].value===""?ju:{value:e[0].value,isValid:!0}:ju:ku}return ku},Jh=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Be(e)?e:t?e===""?NaN:e&&+e:r&&wt(e)?new Date(e):n?n(e):e;const Lu={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,Lu):Lu;function Pu(e){const t=e.ref;return Al(t)?t.files:Dl(t)?ep(e.refs).value:Yh(t)?[...t.selectedOptions].map(({value:r})=>r):Ws(t)?Xh(e.refs).value:Jh(Be(t.value)?e.ref.value:t.value,e)}var kD=(e,t,r,n)=>{const s={};for(const i of e){const a=W(t,i);a&&Le(s,i,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},qi=e=>e instanceof RegExp,cs=e=>Be(e)?e:qi(e)?e.source:We(e)?qi(e.value)?e.value.source:e.value:e,Fu=e=>({isOnSubmit:!e||e===Xt.onSubmit,isOnBlur:e===Xt.onBlur,isOnChange:e===Xt.onChange,isOnAll:e===Xt.all,isOnTouch:e===Xt.onTouched});const Mu="AsyncFunction";var jD=e=>!!e&&!!e.validate&&!!(bt(e.validate)&&e.validate.constructor.name===Mu||We(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Mu)),LD=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Va=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Cs=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=W(e,s);if(i){const{_f:a,...o}=i;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(Cs(o,t))break}else if(We(o)&&Cs(o,t))break}}};function Bu(e,t,r){const n=W(e,r);if(n||Ks(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),a=W(t,i),o=W(e,i);if(a&&!Array.isArray(a)&&r!==i)return{name:r};if(o&&o.type)return{name:i,error:o};if(o&&o.root&&o.root.type)return{name:`${i}.root`,error:o.root};s.pop()}return{name:r}}var PD=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return at(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!n||Xt.all))},FD=(e,t,r)=>!e||!t||e===t||Ei(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),MD=(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,BD=(e,t)=>!Wh(W(e,t)).length&&Je(e,t),$u=(e,t,r)=>{const n=W(e,r),s=Array.isArray(n)?n:[];return Le(s,Hh,t[r]),Le(e,r,s),e};function qu(e,t,r="validate"){if(wt(e)||Array.isArray(e)&&e.every(wt)||Ft(e)&&!e)return{type:r,message:wt(e)?e:"",ref:t}}var Sn=e=>We(e)&&!qi(e)?e:{value:e,message:""},Uu=async(e,t,r,n,s,i)=>{const{ref:a,refs:o,required:l,maxLength:u,minLength:d,min:f,max:g,pattern:p,validate:C,name:h,valueAsNumber:y,mount:v}=e._f,b=W(r,h);if(!v||t.has(h))return{};const w=o?o[0]:a,S=j=>{if(s&&w.reportValidity){const P=Ft(j)?"":j||"";o?o.forEach(k=>k.setCustomValidity(P)):w.setCustomValidity(P),w.reportValidity()}},_={},E=Dl(a),D=Ws(a),R=E||D,M=(y||Al(a))&&Be(a.value)&&Be(b)||$i(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,$=OD.bind(null,h,n,_),N=(j,P,k,L=Yt.maxLength,V=Yt.minLength)=>{const X=j?P:k;_[h]={type:j?L:V,message:X,ref:a,...$(j?L:V,X)}};if(i?!Array.isArray(b)||!b.length:l&&(!R&&(M||ut(b))||Ft(b)&&!b||D&&!Xh(o).isValid||E&&!ep(o).isValid)){const{value:j,message:P}=wt(l)?{value:!!l,message:l}:Sn(l);if(j&&(_[h]={type:Yt.required,message:P,ref:w,...$(Yt.required,P)},!n))return S(P),_}if(!M&&(!ut(f)||!ut(g))){let j,P;const k=Sn(g),L=Sn(f);if(!ut(b)&&!isNaN(b)){const V=a.valueAsNumber||b&&+b;ut(k.value)||(j=V>k.value),ut(L.value)||(P=V<L.value)}else{const V=a.valueAsDate||new Date(b),X=we=>new Date(new Date().toDateString()+" "+we),ye=a.type=="time",_e=a.type=="week";wt(k.value)&&b&&(j=ye?X(b)>X(k.value):_e?b>k.value:V>new Date(k.value)),wt(L.value)&&b&&(P=ye?X(b)<X(L.value):_e?b<L.value:V<new Date(L.value))}if((j||P)&&(N(!!j,k.message,L.message,Yt.max,Yt.min),!n))return S(_[h].message),_}if((u||d)&&!M&&(wt(b)||i&&Array.isArray(b))){const j=Sn(u),P=Sn(d),k=!ut(j.value)&&b.length>+j.value,L=!ut(P.value)&&b.length<+P.value;if((k||L)&&(N(k,j.message,P.message),!n))return S(_[h].message),_}if(p&&!M&&wt(b)){const{value:j,message:P}=Sn(p);if(qi(j)&&!b.match(j)&&(_[h]={type:Yt.pattern,message:P,ref:a,...$(Yt.pattern,P)},!n))return S(P),_}if(C){if(bt(C)){const j=await C(b,r),P=qu(j,w);if(P&&(_[h]={...P,...$(Yt.validate,P.message)},!n))return S(P.message),_}else if(We(C)){let j={};for(const P in C){if(!at(j)&&!n)break;const k=qu(await C[P](b,r),w,P);k&&(j={...k,...$(P,k.message)},S(k.message),n&&(_[h]=j))}if(!at(j)&&(_[h]={ref:w,...j},!n))return _}}return S(!0),_};const $D={mode:Xt.onSubmit,reValidateMode:Xt.onChange,shouldFocusError:!0},tp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function qD(e={}){let t={...$D,...e},r={...Ke(tp),isLoading:bt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=We(t.defaultValues)||We(t.values)?Ke(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Ke(s),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let g={...f};const p={array:Ru(),state:Ru()},C=t.criteriaMode===Xt.all,h=x=>O=>{clearTimeout(u),u=setTimeout(x,O)},y=async x=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||g.isValid||x)){let O;t.resolver?(O=at((await $()).errors),v()):O=await P({fields:n,onlyCheckValid:!0,eventType:Dr.VALID}),O!==r.isValid&&p.state.next({isValid:O})}},v=(x,O)=>{!t.disabled&&(f.isValidating||f.validatingFields||g.isValidating||g.validatingFields)&&((x||Array.from(o.mount)).forEach(A=>{A&&(O?Le(r.validatingFields,A,O):Je(r.validatingFields,A))}),p.state.next({validatingFields:r.validatingFields,isValidating:!at(r.validatingFields)}))},b=()=>{r.dirtyFields=Qr(s,i)},w=(x,O=[],A,z,B=!0,G=!0)=>{if(z&&A&&!t.disabled){if(a.action=!0,G&&Array.isArray(W(n,x))){const q=A(W(n,x),z.argA,z.argB);B&&Le(n,x,q)}if(G&&Array.isArray(W(r.errors,x))){const q=A(W(r.errors,x),z.argA,z.argB);B&&Le(r.errors,x,q),BD(r.errors,x)}if((f.touchedFields||g.touchedFields)&&G&&Array.isArray(W(r.touchedFields,x))){const q=A(W(r.touchedFields,x),z.argA,z.argB);B&&Le(r.touchedFields,x,q)}(f.dirtyFields||g.dirtyFields)&&b(),p.state.next({name:x,isDirty:L(x,O),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Le(i,x,O)},S=(x,O)=>{Le(r.errors,x,O),r.errors={...r.errors},p.state.next({errors:r.errors})},_=x=>{r.errors=x,p.state.next({errors:r.errors,isValid:!1})},E=x=>{const O=Ks(x)?[x]:da(x);let A=i,z=s;for(let B=0;B<O.length-1;B++){const G=O[B];if(A=ut(A)?A:A[G],z=ut(z)?z:z[G],A===null&&z!==null)return!0}return!1},D=(x,O,A,z)=>{const B=W(n,x);if(B){if(E(x))return;const G=Be(W(i,x)),q=W(i,x,Be(A)?W(s,x):A);Be(q)||z&&z.defaultChecked||O?Le(i,x,O?q:Pu(B._f)):ye(x,q),a.mount&&!a.action&&(y(),G&&r.isDirty&&(f.isDirty||g.isDirty)&&(L()||(r.isDirty=!1,p.state.next({...r}))),e.shouldUnregister&&G&&!Be(W(i,x))&&Va(x,o)&&(a.watch=!0))}},R=(x,O,A,z,B)=>{let G=!1,q=!1;const ee={name:x};if(!t.disabled){if(!A||z){(f.isDirty||g.isDirty)&&(q=r.isDirty,r.isDirty=ee.isDirty=L(),G=q!==ee.isDirty);const ge=Mt(W(s,x),O);q=!!W(r.dirtyFields,x),ge!==r.isDirty?r.dirtyFields=Qr(s,i):ge?Je(r.dirtyFields,x):Le(r.dirtyFields,x,!0),ee.dirtyFields=r.dirtyFields,G=G||(f.dirtyFields||g.dirtyFields)&&q!==!ge}if(A){const ge=W(r.touchedFields,x);ge||(Le(r.touchedFields,x,A),ee.touchedFields=r.touchedFields,G=G||(f.touchedFields||g.touchedFields)&&ge!==A)}G&&B&&p.state.next(ee)}return G?ee:{}},M=(x,O,A,z)=>{const B=W(r.errors,x),G=(f.isValid||g.isValid)&&Ft(O)&&r.isValid!==O;if(t.delayError&&A?(l=h(()=>S(x,A)),l(t.delayError)):(clearTimeout(u),l=null,A?Le(r.errors,x,A):Je(r.errors,x),r.errors={...r.errors}),(A?!Mt(B,A):B)||!at(z)||G){const q={...z,...G&&Ft(O)?{isValid:O}:{},errors:r.errors,name:x};r={...r,...q},p.state.next(q)}},$=async x=>(v(x,!0),await t.resolver(i,t.context,kD(x||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),N=async x=>{const{errors:O}=await $(x);if(v(x),x){for(const A of x){const z=W(O,A);z?o.array.has(A)&&We(z)&&!Object.keys(z).some(B=>!Number.isNaN(Number(B)))?$u(r.errors,{[A]:z},A):Le(r.errors,A,z):Je(r.errors,A)}r.errors={...r.errors}}else r.errors=O;return O},j=async({name:x,eventType:O})=>{if(e.validate){const A=await e.validate({formValues:i,formState:r,name:x,eventType:O});if(We(A))for(const z in A){const B=A[z];B&&J(`${Ua}.${z}`,{message:wt(B.message)?B.message:"",type:B.type||Yt.validate})}else wt(A)||!A?J(Ua,{message:A||"",type:Yt.validate}):fe(Ua);return A}return!0},P=async({fields:x,onlyCheckValid:O,name:A,eventType:z,context:B={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(B.runRootValidation=!0,!await j({name:A,eventType:z})&&(B.valid=!1,O)))return B.valid;for(const G in x){const q=x[G];if(q){const{_f:ee,...ge}=q;if(ee){const Qe=o.array.has(ee.name),Et=q._f&&jD(q._f),It=f.validatingFields||f.isValidating||g.validatingFields||g.isValidating;Et&&It&&v([ee.name],!0);const pr=await Uu(q,o.disabled,i,C,t.shouldUseNativeValidation&&!O,Qe);if(Et&&It&&v([ee.name]),pr[ee.name]&&(B.valid=!1,O)||(!O&&(W(pr,ee.name)?Qe?$u(r.errors,pr,ee.name):Le(r.errors,ee.name,pr[ee.name]):Je(r.errors,ee.name)),e.shouldUseNativeValidation&&pr[ee.name]))break}!at(ge)&&await P({context:B,onlyCheckValid:O,fields:ge,name:G,eventType:z})}}return B.valid},k=()=>{for(const x of o.unMount){const O=W(n,x);O&&(O._f.refs?O._f.refs.every(A=>!za(A)):!za(O._f.ref))&&$e(x)}o.unMount=new Set},L=(x,O)=>!t.disabled&&(x&&O&&Le(i,x,O),!Mt(H(),s)),V=(x,O,A)=>Bo(x,o,{...a.mount?i:Be(O)?s:wt(x)?{[x]:O}:O},A,O),X=x=>Wh(W(a.mount?i:s,x,t.shouldUnregister?W(s,x,[]):[])),ye=(x,O,A={},z=!1)=>{const B=W(n,x);let G=O;if(B){const q=B._f;q&&(!q.disabled&&Le(i,x,Jh(O,q)),G=$i(q.ref)&&ut(O)?"":O,Yh(q.ref)?[...q.ref.options].forEach(ee=>ee.selected=G.includes(ee.value)):q.refs?Ws(q.ref)?q.refs.forEach(ee=>{(!ee.defaultChecked||!ee.disabled)&&(Array.isArray(G)?ee.checked=!!G.find(ge=>ge===ee.value):ee.checked=G===ee.value||!!G)}):q.refs.forEach(ee=>ee.checked=ee.value===G):Al(q.ref)?q.ref.value="":(q.ref.value=G,q.ref.type||p.state.next({name:x,values:z?i:Ke(i)})))}(A.shouldDirty||A.shouldTouch)&&R(x,G,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&U(x)},_e=(x,O,A,z=!1)=>{for(const B in O){if(!O.hasOwnProperty(B))return;const G=O[B],q=x+"."+B,ee=W(n,q);(o.array.has(x)||We(G)||ee&&!ee._f)&&!Yr(G)?_e(q,G,A,z):ye(q,G,A,z)}},we=(x,O,A,z)=>{const B=W(n,x),G=o.array.has(x),q=z?O:Ke(O),ee=W(i,x),ge=Mt(ee,q);if(ge||Le(i,x,q),G)p.array.next({name:x,values:z?i:Ke(i)}),(f.isDirty||f.dirtyFields||g.isDirty||g.dirtyFields)&&A.shouldDirty&&(b(),p.state.next({name:x,dirtyFields:r.dirtyFields,isDirty:L(x,q)}));else{const Qe=Array.isArray(q)&&!q.length||at(q);!B||B._f||ut(q)||Qe?ye(x,q,A,z):_e(x,q,A,z)}if(!ge){const Qe=Va(x,o),Et=z?i:Ke(i);p.state.next({...Qe&&r,name:a.mount||Qe?x:void 0,values:Et})}},de=(x,O,A={})=>we(x,O,A,!1),Q=(x,O={})=>{const A=bt(x)?x(i):x;if(!Mt(i,A)){i={...i,...A};for(const z of o.mount)we(z,W(A,z),O,!0);p.state.next({...r,name:void 0,type:void 0,values:i}),O.shouldValidate&&y()}},ne=async x=>{a.mount=!0;const O=x.target;let A=O.name,z=!0;const B=W(n,A),G=ge=>{z=Number.isNaN(ge)||Yr(ge)&&isNaN(ge.getTime())||Mt(ge,W(i,A,ge))},q=Fu(t.mode),ee=Fu(t.reValidateMode);if(B){let ge,Qe;const Et=O.type?Pu(B._f):Mo(x),It=x.type===Dr.BLUR||x.type===Dr.FOCUS_OUT,pr=!LD(B._f)&&!e.validate&&!t.resolver&&!W(r.errors,A)&&!B._f.deps||MD(It,W(r.touchedFields,A),r.isSubmitted,ee,q),Jn=Va(A,o,It);Le(i,A,Et),It?(!O||!O.readOnly)&&(B._f.onBlur&&B._f.onBlur(x),l&&l(0)):B._f.onChange&&B._f.onChange(x);const zr=R(A,Et,It),rt=!at(zr)||Jn;if(!It&&p.state.next({name:A,type:x.type,values:Ke(i)}),pr)return(f.isValid||g.isValid)&&(t.mode==="onBlur"?It&&y():It||y()),rt&&p.state.next({name:A,...Jn?{}:zr});if(!t.resolver&&e.validate&&await j({name:A,eventType:x.type}),!It&&Jn&&p.state.next({...r}),t.resolver){const{errors:ht}=await $([A]);if(v([A]),G(Et),!z){!at(zr)&&p.state.next(zr);return}const xt=Bu(r.errors,n,A),Wt=Bu(ht,n,xt.name||A);ge=Wt.error,A=Wt.name,Qe=at(ht)}else v([A],!0),ge=(await Uu(B,o.disabled,i,C,t.shouldUseNativeValidation))[A],v([A]),G(Et),z&&(ge?Qe=!1:(f.isValid||g.isValid)&&(Qe=await P({fields:n,onlyCheckValid:!0,name:A,eventType:x.type})));z&&(B._f.deps&&(!Array.isArray(B._f.deps)||B._f.deps.length>0)&&U(B._f.deps),M(A,Qe,ge,zr))}},te=(x,O)=>{if(W(r.errors,O)&&x.focus)return x.focus(),1},U=async(x,O={})=>{let A,z;const B=Ei(x);if(t.resolver){const G=await N(Be(x)?x:B);A=at(G),z=x?!B.some(q=>W(G,q)):A}else x?(z=(await Promise.all(B.map(async G=>{const q=W(n,G);return await P({fields:q&&q._f?{[G]:q}:q,eventType:Dr.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&y()):z=A=await P({fields:n,name:x,eventType:Dr.TRIGGER});return p.state.next({...!wt(x)||(f.isValid||g.isValid)&&A!==r.isValid?{}:{name:x},...t.resolver||!x?{isValid:A}:{},errors:r.errors}),O.shouldFocus&&!z&&Cs(n,te,x?B:o.mount),z},H=(x,O)=>{let A={...a.mount?i:s};return O&&(A=Kh(O.dirtyFields?r.dirtyFields:r.touchedFields,A)),Be(x)?A:wt(x)?W(A,x):x.map(z=>W(A,z))},ie=(x,O)=>({invalid:!!W((O||r).errors,x),isDirty:!!W((O||r).dirtyFields,x),error:W((O||r).errors,x),isValidating:!!W(r.validatingFields,x),isTouched:!!W((O||r).touchedFields,x)}),fe=x=>{const O=x?Ei(x):void 0;O==null||O.forEach(A=>Je(r.errors,A)),O?O.forEach(A=>{p.state.next({name:A,errors:r.errors})}):p.state.next({errors:{}})},J=(x,O,A)=>{const z=(W(n,x,{_f:{}})._f||{}).ref,B=W(r.errors,x)||{},{ref:G,message:q,type:ee,...ge}=B;Le(r.errors,x,{...ge,...O,ref:z}),p.state.next({name:x,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&z&&z.focus&&z.focus()},se=(x,O)=>bt(x)?p.state.subscribe({next:A=>"values"in A&&x(A.values||V(void 0,O),A)}):V(x,O,!0),ke=x=>p.state.subscribe({next:O=>{if(FD(x.name,O.name,x.exact)&&PD(O,x.formState||f,K,x.reRenderRoot)){const A={...i};x.callback({values:A,...r,...O,defaultValues:s})}}}).unsubscribe,Te=x=>(a.mount=!0,g={...g,...x.formState},ke({...x,formState:{...d,...x.formState}})),$e=(x,O={})=>{for(const A of x?Ei(x):o.mount)o.mount.delete(A),o.array.delete(A),O.keepValue||(Je(n,A),Je(i,A)),!O.keepError&&Je(r.errors,A),!O.keepDirty&&Je(r.dirtyFields,A),!O.keepTouched&&Je(r.touchedFields,A),!O.keepIsValidating&&Je(r.validatingFields,A),!t.shouldUnregister&&!O.keepDefaultValue&&Je(s,A);p.state.next({values:Ke(i)}),p.state.next({...r,...O.keepDirty?{isDirty:L()}:{}}),!O.keepIsValid&&y()},Ve=({disabled:x,name:O})=>{if(Ft(x)&&a.mount||x||o.disabled.has(O)){const B=o.disabled.has(O)!==!!x;x?o.disabled.add(O):o.disabled.delete(O),B&&a.mount&&!a.action&&y()}},qe=(x,O={})=>{let A=W(n,x);const z=Ft(O.disabled)||Ft(t.disabled),B=!o.registerName.has(x)&&A&&A._f&&!A._f.mount;return Le(n,x,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:x}},name:x,mount:!0,...O}}),o.mount.add(x),A&&!B?Ve({disabled:Ft(O.disabled)?O.disabled:t.disabled,name:x}):D(x,!0,O.value),{...z?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:cs(O.min),max:cs(O.max),minLength:cs(O.minLength),maxLength:cs(O.maxLength),pattern:cs(O.pattern)}:{},name:x,onChange:ne,onBlur:ne,ref:G=>{if(G){o.registerName.add(x),qe(x,O),o.registerName.delete(x),A=W(n,x);const q=Be(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,ee=AD(q),ge=A._f.refs||[];if(ee?ge.find(Qe=>Qe===q):q===A._f.ref)return;Le(n,x,{_f:{...A._f,...ee?{refs:[...ge.filter(za),q,...Array.isArray(W(s,x))?[{}]:[]],ref:{type:q.type,name:x}}:{ref:q}}}),D(x,!1,void 0,q)}else A=W(n,x,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(zh(o.array,x)&&a.action)&&o.unMount.add(x)}}},re=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Cs(n,te,o.mount),He=x=>{Ft(x)&&(p.state.next({disabled:x}),Cs(n,(O,A)=>{const z=W(n,A);z&&(O.disabled=z._f.disabled||x,Array.isArray(z._f.refs)&&z._f.refs.forEach(B=>{B.disabled=z._f.disabled||x}))},0,!1))},ze=(x,O)=>async A=>{let z;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let B=Ke(i);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:q}=await $();v(),r.errors=G,B=Ke(q)}else await P({fields:n,eventType:Dr.SUBMIT});if(o.disabled.size)for(const G of o.disabled)Je(B,G);if(Je(r.errors,Hh),at(r.errors)){p.state.next({errors:{}});try{await x(B,A)}catch(G){z=G}}else O&&await O({...r.errors},A),re(),setTimeout(re);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:at(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},Ue=(x,O={})=>{W(n,x)&&(Be(O.defaultValue)?de(x,Ke(W(s,x))):(de(x,O.defaultValue),Le(s,x,Ke(O.defaultValue))),O.keepTouched||Je(r.touchedFields,x),O.keepDirty||(Je(r.dirtyFields,x),r.isDirty=O.defaultValue?L(x,Ke(W(s,x))):L()),O.keepError||(Je(r.errors,x),f.isValid&&y()),p.state.next({...r}))},Ze=(x,O={})=>{const A=x?Ke(x):s,z=Ke(A),B=at(x),G=z;if(O.keepDefaultValues||(s=A),!O.keepValues){if(O.keepDirtyValues){const q=new Set([...o.mount,...Object.keys(Qr(s,i))]);for(const ee of Array.from(q)){const ge=W(r.dirtyFields,ee),Qe=W(i,ee),Et=W(G,ee);ge&&!Be(Qe)?Le(G,ee,Qe):!ge&&!Be(Et)&&de(ee,Et)}}else{if(ua&&Be(x))for(const q of o.mount){const ee=W(n,q);if(ee&&ee._f){const ge=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if($i(ge)){const Qe=ge.closest("form");if(Qe){Qe.reset();break}}}}if(O.keepFieldsRef)for(const q of o.mount)de(q,W(G,q));else n={}}if(t.shouldUnregister){if(i=O.keepDefaultValues?Ke(s):{},O.keepFieldsRef)for(const q of o.mount)Le(i,q,W(G,q))}else i=Ke(G);p.array.next({values:{...G}}),p.state.next({values:{...G}})}o={mount:O.keepDirtyValues?o.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||!!O.keepIsValid||!!O.keepDirtyValues||!t.shouldUnregister&&!at(G),a.watch=!!t.shouldUnregister,a.keepIsValid=!!O.keepIsValid,a.action=!1,O.keepErrors||(r.errors={}),p.state.next({submitCount:O.keepSubmitCount?r.submitCount:0,isDirty:B?!1:O.keepDirty?r.isDirty:O.keepValues?L():!!(O.keepDefaultValues&&!Mt(x,s)),isSubmitted:O.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:B?{}:O.keepDirtyValues?O.keepDefaultValues&&i?Qr(s,i):r.dirtyFields:O.keepDefaultValues&&x?Qr(s,x):O.keepDirty?r.dirtyFields:{},touchedFields:O.keepTouched?r.touchedFields:{},errors:O.keepErrors?r.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Bt=(x,O)=>Ze(bt(x)?x(i):x,{...t.resetOptions,...O}),St=(x,O={})=>{const A=W(n,x),z=A&&A._f;if(z){const B=z.refs?z.refs[0]:z.ref;B.focus&&setTimeout(()=>{B.focus(),O.shouldSelect&&bt(B.select)&&B.select()})}},K=x=>{r={...r,...x}},$t={control:{register:qe,unregister:$e,getFieldState:ie,handleSubmit:ze,setError:J,_subscribe:ke,_runSchema:$,_updateIsValidating:v,_focusError:re,_getWatch:V,_getDirty:L,_setValid:y,_setFieldArray:w,_setDisabledField:Ve,_setErrors:_,_getFieldArray:X,_reset:Ze,_resetDefaultValues:()=>bt(t.defaultValues)&&t.defaultValues().then(x=>{Bt(x,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:k,_disableForm:He,_subjects:p,_proxyFormState:f,get _fields(){return n},get _formValues(){return i},get _state(){return a},set _state(x){a=x},get _defaultValues(){return s},get _names(){return o},set _names(x){o=x},get _formState(){return r},get _options(){return t},set _options(x){t={...t,...x}}},subscribe:Te,trigger:U,register:qe,handleSubmit:ze,watch:se,setValue:de,setValues:Q,getValues:H,reset:Bt,resetField:Ue,resetDefaultValues:(x,O={})=>{if(s=Ke(x),!O.keepDirty){const A=Qr(s,i);r.dirtyFields=A,r.isDirty=!at(A)}O.keepIsValid||y(),p.state.next({...r,defaultValues:s})},clearErrors:fe,unregister:$e,setError:J,setFocus:St,getFieldState:ie};return{...$t,formControl:$t}}function UD(e={}){const t=m.useRef(void 0),r=m.useRef(void 0),n=m.useRef(e.formControl),[s,i]=m.useState(()=>({...Ke(tp),isLoading:bt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:bt(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&&!bt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...l}=qD(e);t.current={...l,formState:s}}const a=t.current.control;return a._options=e,Il(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(l=>({...l,isReady:!0})),a._formState.isReady=!0,o},[a]),m.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),m.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),m.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),m.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),m.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==s.isDirty&&a._subjects.state.next({isDirty:o})}},[a,s.isDirty]),m.useEffect(()=>{var o;e.values&&!Mt(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=e.values,i(l=>({...l}))):a._resetDefaultValues()},[a,e.values]),m.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=m.useMemo(()=>Gh(s,a),[a,s]),t.current}async function zu(e){var r,n;return(n=(r=(await Ne.get(`/api/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function zD(e){var r,n;return((n=(r=(await Ne.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 Nl(e,t){const r=$n({queryKey:["framework",e],queryFn:()=>zu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=$n({queryKey:["framework",n],queryFn:()=>zu(n),enabled:!!n,staleTime:5*60*1e3}),i=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:i,isLoading:r.isLoading||s.isLoading}}function VD(e,t,r){const n=e??[],s=new Set(n.map(d=>d.type).filter(Boolean)),i=(t??[]).filter(d=>!s.has(d)),{data:a}=$n({queryKey:["framework-search",i.sort().join(","),r],queryFn:()=>zD({type:i,systemDefault:"Yes"}),enabled:i.length>0,staleTime:10*60*1e3}),o=t&&t.length?n.filter(d=>d.type&&t.includes(d.type)):n,l=[...(a??[]).map(d=>({label:d.name,value:d.identifier})),...o.map(d=>({label:d.name,value:d.identifier}))],u=new Set;return l.filter(d=>u.has(d.value)?!1:(u.add(d.value),!0))}async function rp(e){var r,n;return(n=(r=(await Ne.get(`/api/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function HD(e){var r,n,s,i,a,o,l;const t=$n({queryKey:["channel",e],queryFn:()=>rp(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:(i=t.data)==null?void 0:i.collectionAdditionalCategories,contentAdditionalCategories:(a=t.data)==null?void 0:a.contentAdditionalCategories,defaultLicense:(o=t.data)==null?void 0:o.defaultLicense,defaultFramework:(l=t.data)==null?void 0:l.defaultFramework,isLoading:t.isLoading}}function QD(e){const{data:t}=$n({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>T_(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const GD={"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."}},WD=new Set(["review","read","sourcingreview","orgreview"]),ii={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},KD={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},YD={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"},ha={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},np=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function sp(e,t,r,n,s={}){if(!(e!=null&&e.length))return Vu(hN(t,n,r),r,t,n);const i=new Map;for(const l of e){const u=l.code;u&&!i.has(u)&&i.set(u,l)}const a=new Set,o=e.filter(l=>{if(n&&(l.code==="dialCode"||l.code==="dialcode")||l.visible===!1)return!1;const u=l.code;return a.has(u)?!1:(a.add(u),!0)}).map(l=>{const u=l.code??"",d=nN(l),f=sN(l,r,t,i,s),g=t[u],p=XD(u,ip(g,d),d,t,s),C={code:u,label:l.label??u,inputType:d,required:!!(l.required===!0||Array.isArray(l.validations)&&l.validations.some(h=>h.type==="required")),editable:ZD(u,l.editable!==!1,s),placeholder:l.placeholder,maxLength:l.maxLength,options:tN(f,p,d,r),depends:l.depends,tab:rN(l),section:l.section,sourceCategory:l.sourceCategory,defaultValue:l.defaultValue??l.default,currentValue:p};if(u==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...C,required:h,visible:h}}return C});return Vu(o,r,t,n)}function ZD(e,t,r){var i;const n=r.editorMode??"edit";if(!WD.has(n))return t!==!1;const s=(i=r.editableFields)==null?void 0:i[n];return!!(s&&s.includes(e))}function XD(e,t,r,n,s){const i=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return i?s.defaultLicense??"":t;case"copyright":return i&&s.channelName?s.channelName:t;case"copyrightYear":return i?String(new Date().getFullYear()):t;case"author":case"creator":return i&&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(!i)return t;const a=n.timeLimits,o=a==null?void 0:a[e];return o!=null&&o!==""?JD(Number(o)):t}default:return t}}function JD(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=i=>String(i).padStart(2,"0");return n>0?`${s(n)}:${s(r)}:${s(t)}`:`${s(r)}:${s(t)}`}function eN(e){var n,s,i;const t=new Map,r=a=>a==null?void 0:a.forEach(o=>{o.identifier&&t.set(o.identifier,o.name),o.name&&t.set(o.name,o.name)});return(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(a=>r(a.terms)),(i=e.targetFrameworks)==null||i.forEach(a=>{var o;return(o=a.categories)==null?void 0:o.forEach(l=>r(l.terms))}),t}function tN(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 i=e?[...e]:[],a=new Set(i.map(l=>l.value)),o=eN(n);for(const l of s){const u=String(l);a.has(u)||(i.push({label:o.get(u)??u,value:u}),a.add(u))}return i}function rN(e){const t=e.section;if(t){if(ii[t])return ii[t];const n=KD[t];if(n&&ii[n])return ii[n]}const r=e.code??"";return YD[r]??"details"}function ip(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 nN(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 sN(e,t,r,n,s){const i=e.code??"";if(i==="maxQuestions"){const u=s.childCount??0;if(u>0)return Array.from({length:u},(d,f)=>({label:String(f+1),value:String(f+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 o=e.enum;if(o!=null&&o.length)return o.map(u=>({label:u,value:u}));if(i==="framework")return t.orgFrameworks;if(i==="additionalCategories"){const d=(s.objectType??"")==="QuestionSet"?s.contentAdditionalCategories??s.collectionAdditionalCategories:s.collectionAdditionalCategories??s.contentAdditionalCategories,f=(d&&d.length?d:s.contextAdditionalCategories)??t.channelAdditionalCategories;return f!=null&&f.length?lN(f).map(g=>({label:g,value:g})):void 0}const l=e.sourceCategory??ha[i];if(l)return ap(i,l,e,t,r,n)}function iN(e,t){return np.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function aN(e,t){return np.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function Ha(e,t,r){var i,a,o,l,u;const n=(a=(i=e.organisationFramework)==null?void 0:i.categories)==null?void 0:a.find(d=>d.code===t),s=(u=(l=(o=e.targetFrameworks)==null?void 0:o[0])==null?void 0:l.categories)==null?void 0:u.find(d=>d.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 oN(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 lN(e){return Array.from(new Set(e))}function cN(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function ap(e,t,r,n,s,i){const a=iN(e,r),o=aN(e,r),l=h=>({label:h.name,value:a?h.identifier:h.name}),u=r.depends;if(!(u!=null&&u.length))return Ha(n,t,o).map(l);const d=u.flatMap(h=>cN(s[h])).map(String);if(!d.length)return[];const f=[];for(const h of u){const y=i.get(h),v=(y==null?void 0:y.sourceCategory)??ha[h]??h;f.push(...Ha(n,v,o))}const p=f.filter(h=>d.includes(String(h.name))||d.includes(String(h.identifier))||d.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),C=oN(p);return C.length?C.map(l):Ha(n,t,o).map(l)}function us(e,t){const r=ha[e];if(r)return ap(e,r,{},t,{},new Map)}function nt(e,t,r){return ip(e[t],r)}const uN=["board","medium","gradeLevel","subject"];function dN(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>uN.includes(n.code)):!0}function fN(e,t){var r,n,s;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(i=>i.code===t)||(s=e.targetFrameworks)!=null&&s.some(i=>{var a;return(a=i.categories)==null?void 0:a.some(o=>o.code===t)}))}function Vu(e,t,r,n){var l;if(!n||dN(t))return e;const s=e.filter(u=>{const d=u.sourceCategory??ha[u.code];return!d||fN(t,d)}),i=new Set(s.map(u=>u.code)),a=[];for(const u of((l=t.organisationFramework)==null?void 0:l.categories)??[])i.has(u.code)||a.push({code:u.code,label:u.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(u.terms??[]).map(d=>({label:d.name,value:d.name})),currentValue:nt(r,u.code,"multiselect")});if(!a.length)return s;const o=s.findIndex(u=>u.code==="framework");return o>=0?[...s.slice(0,o+1),...a,...s.slice(o+1)]:[...s,...a]}function hN(e,t,r){var s;const n=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:nt(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:nt(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:nt(e,"keywords","chips")}];return t&&(n.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:nt(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:nt(e,"additionalCategories","multiselect"),options:(s=r.channelAdditionalCategories)==null?void 0:s.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:nt(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:us("subjectIds",r),currentValue:nt(e,"subjectIds","multiselect")}),n.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:nt(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:us("targetBoardIds",r),currentValue:nt(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:us("targetMediumIds",r),currentValue:nt(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:us("targetGradeLevelIds",r),currentValue:nt(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:us("targetSubjectIds",r),currentValue:nt(e,"targetSubjectIds","multiselect")}),n.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:nt(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:nt(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:nt(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:nt(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:nt(e,"license","select")})),n}const pN=["allowECM","levels","setPeriod","instances"];function op(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function mN(e,t={}){const r={...e};for(const i of pN)delete r[i];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:op(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 gN(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?op(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function yN(e,t){const{watch:r,setValue:n}=e,s=m.useRef(!1);m.useEffect(()=>{const i=r((a,{name:o})=>{var l;if(!(!o||s.current)){s.current=!0;try{const u=new Set([o]);let d=!0;for(;d;){d=!1;for(const f of t)u.has(f.code)||(l=f.depends)!=null&&l.some(g=>u.has(g))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),u.add(f.code),d=!0)}}finally{s.current=!1}}});return()=>i.unsubscribe()},[r,n,t])}const vN="_section_ylgu8_1",bN="_header_ylgu8_11",wN="_title_ylgu8_17",CN="_description_ylgu8_24",SN="_divider_ylgu8_30",xN="_fields_ylgu8_36",xn={section:vN,header:bN,title:wN,description:CN,divider:SN,fields:xN},_N=({title:e,description:t,children:r})=>c.jsxs("div",{className:xn.section,children:[c.jsxs("div",{className:xn.header,children:[c.jsx("h3",{className:xn.title,children:e}),t&&c.jsx("p",{className:xn.description,children:t})]}),c.jsx("hr",{className:xn.divider}),c.jsx("div",{className:xn.fields,children:r})]}),TN="_field_1s288_1",EN="_fullWidth_1s288_7",IN="_label_1s288_11",ON="_required_1s288_19",AN="_input_1s288_24",DN="_textarea_1s288_45",NN="_inputError_1s288_50",RN="_error_1s288_54",kN="_selectBtn_1s288_59",jN="_selectOpen_1s288_83",LN="_placeholder_1s288_87",PN="_selectedVal_1s288_91",FN="_chevronUp_1s288_95",MN="_dropdown_1s288_100",BN="_option_1s288_116",$N="_optionSelected_1s288_134",qN="_noOpts_1s288_139",UN="_chipGroup_1s288_146",zN="_chipInput_1s288_158",VN="_addChipBtn_1s288_167",HN="_radioGroup_1s288_184",QN="_radioLabel_1s288_191",GN="_iconWrap_1s288_199",WN="_iconPreview_1s288_214",KN="_iconPlaceholder_1s288_220",YN="_removeIconBtn_1s288_233",ZN="_tagChip_1s288_252",XN="_tagChipRemove_1s288_264",JN="_nestedSelectRow_1s288_278",eR="_dialcodeRow_1s288_287",tR="_validateBtn_1s288_293",rR="_dialcodeValid_1s288_315",nR="_dialcodeSpinner_1s288_325",F={field:TN,fullWidth:EN,label:IN,required:ON,input:AN,textarea:DN,inputError:NN,error:RN,selectBtn:kN,selectOpen:jN,placeholder:LN,selectedVal:PN,chevronUp:FN,dropdown:MN,option:BN,optionSelected:$N,noOpts:qN,chipGroup:UN,chipInput:zN,addChipBtn:VN,radioGroup:HN,radioLabel:QN,iconWrap:GN,iconPreview:WN,iconPlaceholder:KN,removeIconBtn:YN,tagChip:ZN,tagChipRemove:XN,nestedSelectRow:JN,dialcodeRow:eR,validateBtn:tR,dialcodeValid:rR,dialcodeSpinner:nR},Hu=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:i,placeholder:a})=>{const o=ce(),{register:l,formState:{errors:u}}=rr(),d=u[e],f={required:r?o.textField.requiredError.replace("{field}",t):!1,maxLength:i?{value:i,message:o.textField.maxLengthError.replace("{max}",String(i))}:void 0};return c.jsxs("div",{className:[F.field,s?F.fullWidth:""].join(" "),children:[c.jsxs("label",{className:F.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:F.required,children:"*"})]}),s?c.jsx("textarea",{id:e,className:[F.input,F.textarea,d?F.inputError:""].join(" "),disabled:n,placeholder:a,rows:3,...l(e,f)}):c.jsx("input",{id:e,type:"text",className:[F.input,d?F.inputError:""].join(" "),disabled:n,placeholder:a,...l(e,f)}),d&&c.jsx("span",{className:F.error,children:String(d.message)})]})},sR=({name:e,label:t,options:r,required:n,disabled:s})=>{var y;const i=ce(),[a,o]=m.useState(!1),l=m.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:g}}=rr(),p=d(e),C=((y=r.find(v=>v.value===p))==null?void 0:y.label)??i.selectField.selectPlaceholder,h=g[e];return m.useEffect(()=>{if(!a)return;const v=b=>{var w;(w=l.current)!=null&&w.contains(b.target)||o(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[a]),c.jsxs("div",{className:F.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:F.label,children:[t,n&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsx("input",{type:"hidden",...u(e,{required:n?i.selectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:s,className:[F.selectBtn,h?F.inputError:"",a?F.selectOpen:""].join(" "),onClick:()=>o(v=>!v),children:[c.jsx("span",{className:p?F.selectedVal:F.placeholder,children:C}),c.jsx(Kn,{size:14,className:a?F.chevronUp:""})]}),a&&c.jsxs("div",{className:F.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[F.option,p===v.value?F.optionSelected:""].join(" "),onClick:()=>{f(e,v.value,{shouldDirty:!0,shouldValidate:!0}),o(!1)},children:[c.jsx("span",{children:v.label}),p===v.value&&c.jsx(Wn,{size:13})]},v.value)),!r.length&&c.jsx("span",{className:F.noOpts,children:i.selectField.noOptionsMessage})]}),h&&c.jsx("span",{className:F.error,children:String(h.message)})]})},iR=({name:e,label:t,options:r,required:n,disabled:s})=>{const i=ce(),[a,o]=m.useState(!1),l=m.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:g}}=rr(),p=d(e)??[],C=g[e],h=p.length?`${p.length} ${i.multiSelectField.selectedCountSuffix}`:i.multiSelectField.selectPlaceholder;m.useEffect(()=>{if(!a)return;const v=b=>{var w;(w=l.current)!=null&&w.contains(b.target)||o(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[a]);const y=v=>{const b=p.includes(v)?p.filter(w=>w!==v):[...p,v];f(e,b,{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:F.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:F.label,children:[t,n&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsx("input",{type:"hidden",...u(e,{required:n?i.multiSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:s,className:[F.selectBtn,C?F.inputError:"",a?F.selectOpen:""].join(" "),onClick:()=>o(v=>!v),children:[c.jsx("span",{className:p.length?F.selectedVal:F.placeholder,children:h}),c.jsx(Kn,{size:14,className:a?F.chevronUp:""})]}),a&&c.jsxs("div",{className:F.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[F.option,p.includes(v.value)?F.optionSelected:""].join(" "),onClick:()=>y(v.value),children:[c.jsx(Wn,{size:13,style:{opacity:p.includes(v.value)?1:0}}),c.jsx("span",{children:v.label})]},v.value)),!r.length&&c.jsx("span",{className:F.noOpts,children:i.multiSelectField.noOptionsMessage})]}),C&&c.jsx("span",{className:F.error,children:String(C.message)})]})},aR=({name:e,label:t,required:r,disabled:n,placeholder:s})=>{const i=ce(),a=s??i.chipGroupField.addPlaceholder,[o,l]=m.useState(""),[u,d]=m.useState(!1),f=m.useRef(null),{watch:g,setValue:p,formState:{errors:C}}=rr(),h=g(e)??[],y=C[e],v=()=>{const w=o.trim();w&&!h.includes(w)&&p(e,[...h,w],{shouldDirty:!0}),l(""),d(!1)},b=w=>p(e,h.filter(S=>S!==w),{shouldDirty:!0});return c.jsxs("div",{className:[F.field,F.fullWidth].join(" "),children:[c.jsxs("label",{className:F.label,children:[t,r&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsxs("div",{className:F.chipGroup,children:[h.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&&(u?c.jsx("input",{ref:f,autoFocus:!0,className:F.chipInput,value:o,onChange:w=>l(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),v()),w.key==="Escape"&&(l(""),d(!1))},onBlur:v,placeholder:a}):c.jsxs("button",{type:"button",className:F.addChipBtn,onClick:()=>{d(!0),setTimeout(()=>{var w;return(w=f.current)==null?void 0:w.focus()},50)},children:[c.jsx(Us,{size:12})," ",i.chipGroupField.addButtonLabel]}))]}),y&&c.jsx("span",{className:F.error,children:String(y.message)})]})},oR=({name:e,label:t,options:r,required:n,disabled:s})=>{const i=ce(),{register:a,formState:{errors:o}}=rr(),l=o[e];return c.jsxs("div",{className:F.field,children:[c.jsxs("label",{className:F.label,children:[t,n&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsx("div",{className:F.radioGroup,children:r.map(u=>c.jsxs("label",{className:F.radioLabel,children:[c.jsx("input",{type:"radio",value:u.value,disabled:s,...a(e,{required:n?i.radioField.requiredError.replace("{field}",t):!1})}),u.label]},u.value))}),l&&c.jsx("span",{className:F.error,children:String(l.message)})]})};async function lR(e,t,r,n){var a,o;const i=(o=(a=(await Ne.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:o.node_id;if(!i)throw new Error("Asset creation failed: no node_id returned");return i}async function cR(e,t){var s,i;const n=(i=(s=(await Ne.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)==null?void 0:i.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function uR(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 dR(e,t,r){var a,o;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const i=(o=(a=(await Ne.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:o.content_url;if(!i)throw new Error("Asset finalize failed: no content_url returned");return i}const fR="_overlay_ga6eh_1",hR="_modal_ga6eh_12",pR="_header_ga6eh_24",mR="_title_ga6eh_33",gR="_closeBtn_ga6eh_39",yR="_tabs_ga6eh_57",vR="_tab_ga6eh_57",bR="_activeTab_ga6eh_83",wR="_body_ga6eh_88",CR="_searchWrap_ga6eh_99",SR="_searchIcon_ga6eh_104",xR="_searchInput_ga6eh_113",_R="_grid_ga6eh_132",TR="_imgCell_ga6eh_148",ER="_imgCellSelected_ga6eh_166",IR="_thumb_ga6eh_171",OR="_noThumb_ga6eh_177",AR="_checkBadge_ga6eh_183",DR="_loadMoreBtn_ga6eh_198",NR="_loadingRow_ga6eh_220",RR="_empty_ga6eh_230",kR="_spinner_ga6eh_237",jR="_uploadArea_ga6eh_247",LR="_dropZone_ga6eh_256",PR="_uploadIcon_ga6eh_277",FR="_dropText_ga6eh_281",MR="_dropSubtext_ga6eh_288",BR="_uploadPreview_ga6eh_294",$R="_hiddenInput_ga6eh_301",qR="_fileName_ga6eh_305",UR="_errorText_ga6eh_311",zR="_footer_ga6eh_318",VR="_cancelBtn_ga6eh_328",HR="_confirmBtn_ga6eh_345",me={overlay:fR,modal:hR,header:pR,title:mR,closeBtn:gR,tabs:yR,tab:vR,activeTab:bR,body:wR,searchWrap:CR,searchIcon:SR,searchInput:xR,grid:_R,imgCell:TR,imgCellSelected:ER,thumb:IR,noThumb:OR,checkBadge:AR,loadMoreBtn:DR,loadingRow:NR,empty:RR,spinner:kR,uploadArea:jR,dropZone:LR,uploadIcon:PR,dropText:FR,dropSubtext:MR,uploadPreview:BR,hiddenInput:$R,fileName:qR,errorText:UR,footer:zR,cancelBtn:VR,confirmBtn:HR},Qu=18,lp=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const s=ce(),[i,a]=m.useState("my"),[o,l]=m.useState(""),[u,d]=m.useState([]),[f,g]=m.useState(0),[p,C]=m.useState(!1),[h,y]=m.useState(null),[v,b]=m.useState(0),[w,S]=m.useState(null),[_,E]=m.useState(""),[D,R]=m.useState(!1),[M,$]=m.useState(""),N=m.useRef(null),j=oe(U=>{var H,ie;return((ie=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ie.channel)??""}),P=oe(U=>{var H,ie;return((ie=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ie.uid)??""}),k=oe(U=>{var H,ie,fe;return((fe=(ie=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ie.cloudStorage)==null?void 0:fe.presigned_headers)??{}}),L=oe(U=>{var H,ie,fe;return((fe=(ie=(H=U.editorConfig)==null?void 0:H.config)==null?void 0:ie.assetConfig)==null?void 0:fe.size)??1*1024*1024}),V=oe(U=>{var H,ie,fe;return((fe=(ie=(H=U.editorConfig)==null?void 0:H.config)==null?void 0:ie.assetConfig)==null?void 0:fe.accepted)??"image/png,image/jpeg"}),X=m.useCallback(async(U,H,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"]};i==="my"&&P&&(J.createdBy=P),j&&(J.channel=j);const ke=((fe=(await Ne.post("/action/composite/v3/search",{request:{filters:J,query:U,limit:Qu,offset:H,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:fe.result)??{},Te=ke.content??[];g(ke.count??0),d($e=>ie?[...$e,...Te]:Te)}catch{}finally{C(!1)}},[i,P,j]);m.useEffect(()=>{i!=="upload"&&(d([]),b(0),X(o,0))},[i]);const ye=m.useRef(),_e=U=>{l(U),clearTimeout(ye.current),ye.current=setTimeout(()=>{d([]),b(0),X(U,0)},400)},we=()=>{const U=v+Qu;b(U),X(o,U,!0)},de=()=>{const U=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";U&&r(U)};m.useEffect(()=>()=>{_&&URL.revokeObjectURL(_)},[_]);const Q=U=>{var fe;const H=(fe=U.target.files)==null?void 0:fe[0];if(U.target.value="",!H)return;const ie=V.split(",").map(J=>J.trim());if(!ie.includes(H.type)){const J=ie.map(se=>se.replace("image/","").toUpperCase()).join(", ");$(s.appIconPickerModal.invalidFileTypeError.replace("{types}",J));return}if(H.size>L){const J=(L/1048576).toFixed(0);$(s.appIconPickerModal.fileTooLargeError.replace("{size}",J));return}_&&URL.revokeObjectURL(_),S(H),E(URL.createObjectURL(H)),$("")},ne=async()=>{if(w){R(!0),$("");try{const U=await lR(w.name.split(".").slice(0,-1).join(".")||w.name,w.type,P,j),H=await cR(U,w.name);await uR(H,w,k);const ie=H.split("?")[0],fe=await dR(U,ie,w.type);r(fe)}catch(U){$(U instanceof Error?U.message:s.appIconPickerModal.uploadFailedError)}finally{R(!1)}}},te=u.length<f;return c.jsx("div",{className:me.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:c.jsxs("div",{className:me.modal,children:[c.jsxs("div",{className:me.header,children:[c.jsx("span",{className:me.title,children:s.appIconPickerModal.title}),c.jsx("button",{className:me.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:c.jsx(Cr,{size:18})})]}),c.jsxs("div",{className:me.tabs,role:"tablist",children:[c.jsx("button",{role:"tab","aria-selected":i==="my",className:`${me.tab} ${i==="my"?me.activeTab:""}`,onClick:()=>a("my"),children:s.appIconPickerModal.myImagesTab}),c.jsx("button",{role:"tab","aria-selected":i==="all",className:`${me.tab} ${i==="all"?me.activeTab:""}`,onClick:()=>a("all"),children:s.appIconPickerModal.allImagesTab}),c.jsxs("button",{role:"tab","aria-selected":i==="upload",className:`${me.tab} ${i==="upload"?me.activeTab:""}`,onClick:()=>a("upload"),children:[c.jsx(yo,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),c.jsx("div",{className:me.body,children:i!=="upload"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:me.searchWrap,children:[c.jsx(go,{size:14,className:me.searchIcon}),c.jsx("input",{type:"search",className:me.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:o,onChange:U=>_e(U.target.value)})]}),p&&u.length===0?c.jsxs("div",{className:me.loadingRow,children:[c.jsx(hi,{size:20,className:me.spinner}),c.jsx("span",{children:s.appIconPickerModal.loadingText})]}):u.length===0?c.jsx("div",{className:me.empty,children:s.appIconPickerModal.noImagesFound}):c.jsx("div",{className:me.grid,children:u.map(U=>{const H=U.appIcon??U.artifactUrl??U.downloadUrl??"",ie=(h==null?void 0:h.identifier)===U.identifier;return c.jsxs("button",{type:"button",className:`${me.imgCell} ${ie?me.imgCellSelected:""}`,onClick:()=>y(U),title:U.name,children:[H?c.jsx("img",{src:H,alt:U.name,className:me.thumb}):c.jsx("div",{className:me.noThumb,children:s.appIconPickerModal.noThumbnailText}),ie&&c.jsx("div",{className:me.checkBadge,children:c.jsx(Wn,{size:12})})]},U.identifier)})}),te&&!p&&c.jsx("button",{className:me.loadMoreBtn,onClick:we,children:s.appIconPickerModal.loadMoreButton}),p&&u.length>0&&c.jsx("div",{className:me.loadingRow,children:c.jsx(hi,{size:16,className:me.spinner})})]}):c.jsxs("div",{className:me.uploadArea,children:[c.jsx("div",{className:me.dropZone,onClick:()=>{var U;return(U=N.current)==null?void 0:U.click()},onDragOver:U=>U.preventDefault(),onDrop:U=>{U.preventDefault();const H=U.dataTransfer.files[0];H&&Q({target:{files:[H],value:""}})},children:_?c.jsx("img",{src:_,alt:s.appIconPickerModal.previewAlt,className:me.uploadPreview}):c.jsxs(c.Fragment,{children:[c.jsx(yo,{size:32,className:me.uploadIcon}),c.jsx("p",{className:me.dropText,children:s.appIconPickerModal.dropZoneText}),c.jsx("p",{className:me.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",V.split(",").map(U=>U.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(L/(1024*1024)).toFixed(0))})]})}),c.jsx("input",{ref:N,type:"file",accept:V,className:me.hiddenInput,onChange:Q}),w&&c.jsx("p",{className:me.fileName,children:w.name}),M&&c.jsx("p",{className:me.errorText,children:M})]})}),c.jsxs("div",{className:me.footer,children:[c.jsx("button",{className:me.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),i==="upload"?c.jsx("button",{className:me.confirmBtn,disabled:!w||D,onClick:ne,children:D?c.jsxs(c.Fragment,{children:[c.jsx(hi,{size:14,className:me.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):c.jsx("button",{className:me.confirmBtn,disabled:!h,onClick:de,children:s.appIconPickerModal.useSelectedButton})]})]})})},QR=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const i=ce(),[a,o]=m.useState(!1),{watch:l,setValue:u,register:d,formState:{errors:f}}=rr(),g=l(e),p=f[e],C=y=>{u(e,y,{shouldDirty:!0,shouldValidate:!0}),o(!1)},h=()=>{u(e,"",{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:F.field,children:[c.jsxs("label",{className:F.label,children:[t,n&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsx("input",{type:"hidden",...d(e,{required:n?i.appIconField.requiredError.replace("{field}",t):!1})}),c.jsx("div",{className:F.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":i.appIconField.selectIconAriaLabel,onClick:()=>!s&&o(!0),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&!s&&o(!0)},children:g?c.jsx("img",{src:g,alt:i.appIconField.iconAlt,className:F.iconPreview}):c.jsxs("div",{className:F.iconPlaceholder,children:[c.jsx(df,{size:20}),c.jsx("span",{children:i.appIconField.selectIconLabel})]})}),g&&!s&&c.jsxs("button",{type:"button",className:F.removeIconBtn,onClick:h,"aria-label":i.appIconField.removeIconAriaLabel,children:[c.jsx(il,{size:13}),c.jsx("span",{children:i.appIconField.removeLabel})]}),p&&c.jsx("span",{className:F.error,children:String(p.message)}),a&&c.jsx(lp,{nodeId:r,currentValue:g,onSelect:C,onClose:()=>o(!1)})]})},GR=({name:e,label:t,required:r,disabled:n})=>{const s=ce(),{control:i}=rr(),{field:a,fieldState:{error:o}}=fa({name:e,control:i,rules:{required:r?s.dateTimeField.requiredError.replace("{field}",t):!1}});return c.jsxs("div",{className:F.field,children:[c.jsxs("label",{className:F.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsx("input",{id:e,type:"datetime-local",className:[F.input,o?F.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:a.onChange,onBlur:a.onBlur,ref:a.ref}),o&&c.jsx("span",{className:F.error,children:String(o.message)})]})},WR=({name:e,label:t,required:r,disabled:n})=>{const s=ce(),{control:i}=rr(),{field:a,fieldState:{error:o}}=fa({name:e,control:i,rules:{required:r?s.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[l,u]=m.useState(""),d=m.useRef(null),f=a.value??[],g=y=>{const v=y.trim();!v||f.includes(v)||a.onChange([...f,v])},p=y=>{a.onChange(f.filter(v=>v!==y))},C=y=>{y.key==="Enter"||y.key===","?(y.preventDefault(),g(l),u("")):y.key==="Backspace"&&l===""&&f.length>0&&p(f[f.length-1])},h=()=>{l.trim()&&(g(l),u("")),a.onBlur()};return c.jsxs("div",{className:[F.field,F.fullWidth].join(" "),children:[c.jsxs("label",{className:F.label,children:[t,r&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsxs("div",{className:[F.chipGroup,o?F.inputError:""].join(" "),onClick:()=>{var y;return!n&&((y=d.current)==null?void 0:y.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(y=>c.jsxs("span",{className:F.tagChip,children:[y,!n&&c.jsx("button",{type:"button",className:F.tagChipRemove,onClick:v=>{v.stopPropagation(),p(y)},"aria-label":`Remove ${y}`,children:c.jsx(Cr,{size:11})})]},y)),!n&&c.jsx("input",{ref:d,className:F.chipInput,value:l,onChange:y=>u(y.target.value),onKeyDown:C,onBlur:h,placeholder:f.length===0?s.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),o&&c.jsx("span",{className:F.error,children:String(o.message)})]})},KR=({name:e,label:t,levels:r,required:n,disabled:s})=>{const i=ce(),{control:a}=rr(),{field:o,fieldState:{error:l}}=fa({name:e,control:a,rules:{required:n?i.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),u=o.value??{},d=(f,g,p)=>{const C={};for(let h=0;h<g;h++)C[r[h].code]=u[r[h].code]??"";C[f]=p;for(let h=g+1;h<r.length;h++)C[r[h].code]="";o.onChange(C)};return c.jsxs("div",{className:[F.field,F.fullWidth].join(" "),children:[c.jsxs("label",{className:F.label,children:[t,n&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsx("div",{className:F.nestedSelectRow,children:r.map((f,g)=>{const p=g>0&&!u[r[g-1].code];return c.jsxs("div",{className:F.field,style:{flex:1},children:[c.jsx("label",{className:F.label,htmlFor:`${e}_${f.code}`,children:f.label}),c.jsxs("select",{id:`${e}_${f.code}`,className:[F.input,l?F.inputError:""].join(" "),disabled:s||p,value:u[f.code]??"",onChange:C=>d(f.code,g,C.target.value),onBlur:o.onBlur,children:[c.jsx("option",{value:"",children:i.nestedSelectField.selectPlaceholder}),f.options.map(C=>c.jsx("option",{value:C.value,children:C.label},C.value))]})]},f.code)})}),l&&c.jsx("span",{className:F.error,children:String(l.message)})]})},Gu=[{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"}],YR=({name:e,label:t,required:r,disabled:n})=>{const s=ce(),[i,a]=m.useState(!1),o=m.useRef(null),{register:l,watch:u,setValue:d,formState:{errors:f}}=rr(),g=u(e),p=Gu.find(y=>y.value===g),C=(p==null?void 0:p.label)??s.licenseSelectField.selectPlaceholder,h=f[e];return m.useEffect(()=>{if(!i)return;const y=v=>{var b;(b=o.current)!=null&&b.contains(v.target)||a(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]),c.jsxs("div",{className:F.field,ref:o,style:{position:"relative"},children:[c.jsxs("label",{className:F.label,children:[t,r&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsx("input",{type:"hidden",...l(e,{required:r?s.licenseSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:n,className:[F.selectBtn,h?F.inputError:"",i?F.selectOpen:""].join(" "),onClick:()=>a(y=>!y),"aria-haspopup":"listbox","aria-expanded":i,children:[c.jsx("span",{className:g?F.selectedVal:F.placeholder,children:C}),c.jsx(Kn,{size:14,className:i?F.chevronUp:""})]}),i&&c.jsx("div",{className:F.dropdown,role:"listbox",children:Gu.map(y=>c.jsxs("button",{type:"button",role:"option","aria-selected":g===y.value,className:[F.option,g===y.value?F.optionSelected:""].join(" "),onClick:()=>{d(e,y.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[c.jsx("span",{children:y.label}),g===y.value&&c.jsx(Wn,{size:13})]},y.value))}),h&&c.jsx("span",{className:F.error,children:String(h.message)})]})},ZR=({name:e,label:t,required:r,disabled:n})=>{const s=ce(),{control:i}=rr(),{field:a,fieldState:{error:o}}=fa({name:e,control:i,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[l,u]=m.useState("idle"),[d,f]=m.useState(""),g=async()=>{const C=(a.value??"").trim();if(!C){u("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}u("loading"),f("");try{const h=await l0(C),y=h==null?void 0:h.result,v=y==null?void 0:y.dialcodes;Array.isArray(v)&&v.length>0?(u("valid"),f(s.dialcodeInputField.validMessage)):(u("invalid"),f(s.dialcodeInputField.notFoundMessage))}catch{u("invalid"),f(s.dialcodeInputField.validationFailedMessage)}},p=()=>l==="loading"?c.jsx(hi,{size:16,className:F.dialcodeSpinner}):l==="valid"?c.jsx(of,{size:16,color:"var(--sbx-success, #2e7d32)"}):l==="invalid"?c.jsx(Py,{size:16,color:"var(--sbx-error)"}):null;return c.jsxs("div",{className:F.field,children:[c.jsxs("label",{className:F.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:F.required,children:"*"})]}),c.jsxs("div",{className:F.dialcodeRow,children:[c.jsx("input",{id:e,type:"text",className:[F.input,o?F.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:C=>{a.onChange(C),u("idle"),f("")},onBlur:a.onBlur,ref:a.ref,placeholder:s.dialcodeInputField.placeholderExample,style:{flex:1}}),c.jsx("button",{type:"button",className:F.validateBtn,onClick:g,disabled:n||l==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:l==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),p()]}),o&&c.jsx("span",{className:F.error,children:String(o.message)}),!o&&d&&c.jsx("span",{className:l==="valid"?F.dialcodeValid:F.error,children:d})]})},XR="_form_szqex_1",JR="_ungrouped_szqex_7",ek="_noFields_szqex_18",Qa={form:XR,ungrouped:JR,noFields:ek},tk=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:i,onFormStatusChange:a})=>{var Ve,qe,re,He,ze,Ue,Ze,Bt,St;const o=ce(),l=oe(K=>K.editorConfig),u=oe(K=>K.rootFormConfig),d=oe(K=>K.unitFormConfig),f=oe(K=>K.categoryMeta),g=oe(K=>K.contentFramework),p=oe(K=>K.contentTargetFWIds),{organisationFramework:C,targetFrameworks:h,isLoading:y}=Nl(g??((Ve=l==null?void 0:l.context)==null?void 0:Ve.framework),p??((qe=l==null?void 0:l.context)==null?void 0:qe.targetFWIds)),{frameworks:v,collectionAdditionalCategories:b,contentAdditionalCategories:w,defaultLicense:S,name:_}=HD((re=l==null?void 0:l.context)==null?void 0:re.channel),E=QD(((He=l==null?void 0:l.context)==null?void 0:He.userId)??((ze=l==null?void 0:l.context)==null?void 0:ze.uid)),D=VD(v,(Ue=f==null?void 0:f.frameworkMetadata)==null?void 0:Ue.orgFWType,(Ze=l==null?void 0:l.context)==null?void 0:Ze.channel),R={organisationFramework:C,targetFrameworks:h,orgFrameworks:D,channelAdditionalCategories:b},M=Oe(K=>K.selectedNodeId),$=Oe(K=>K.treeData),N=Oe(K=>K.treeCache),j=M?N[M]??{}:{},P={...e,...j},k=m.useMemo(()=>{var pe;if(!M)return 0;const K=[...$];for(;K.length;){const ve=K.shift();if(ve.id===M)return((pe=ve.children)==null?void 0:pe.length)??0;ve.children&&K.push(...ve.children)}return 0},[$,M]),L=(l==null?void 0:l.config)??{},V=(l==null?void 0:l.context)??{},X={editorMode:s,editableFields:L.editableFields,objectType:L.objectType,setDefaultCopyRight:L.setDefaultCopyRight===!0,defaultLicense:V.defaultLicense??S,contextAdditionalCategories:V.additionalCategories,userFullName:((Bt=V.user)==null?void 0:Bt.fullName)??E,channelName:_,collectionAdditionalCategories:b,contentAdditionalCategories:w,childCount:k},ye=r?u:d,_e=ye||(((St=l==null?void 0:l.config.hierarchy)==null?void 0:St.formConfig)??[]),we=sp(_e,P,R,r,X),de=we.filter(K=>K.tab===t&&K.inputType!=="appIcon"&&K.visible!==!1),Q=UD({mode:"onChange",defaultValues:Object.fromEntries(we.map(K=>{const pe=["multiselect","chips","keywords","tagsinput"],ve=["nestedselect"];return pe.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??[]]:ve.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??{}]:[K.code,K.currentValue??K.defaultValue??""]}))});yN(Q,we);const{updateNode:ne}=Oe(),te=m.useRef(we);te.current=we;const U=m.useRef(M);U.current=M;const H=m.useRef(i);H.current=i;const ie=m.useRef(a);ie.current=a;const fe=m.useRef(typeof P.shuffle=="boolean"?P.shuffle:void 0),J=m.useRef(P.name??"");J.current=P.name??"";const se=m.useRef(s);se.current=s;const ke=["review","read","sourcingreview","orgreview"];m.useEffect(()=>{const K=U.current;if(K){const pe=Object.fromEntries(te.current.filter(ve=>ve.currentValue!==void 0&&ve.currentValue!==null).map(ve=>[ve.code,ve.currentValue]));Object.keys(pe).length>0&&ne(K,pe)}Q.trigger().then(()=>{const pe=Q.formState.errors,ve=te.current,$t=Array.from(new Set(Object.keys(pe).map(x=>{var O;return(O=ve.find(A=>A.code===x))==null?void 0:O.tab}).filter(Boolean)));ie.current(Object.keys(pe).length===0,$t)})},[]),m.useEffect(()=>{const K=Q.watch((pe,{name:ve})=>{const $t=U.current;if(!$t)return;const x=te.current,O=new Set(x.map(B=>B.code));if(ve&&O.has(ve)){let B=Q.getValues(ve);if(ve==="dialcodes"&&(B=Array.isArray(B)?B:B?[B]:[]),ve==="shuffle"&&(B===!0&&fe.current===!1&&Ee(o.sparkMetaForm.shuffleEnabledMessage,{icon:c.jsx(tl,{size:16})}),fe.current=B),ve==="framework"&&r&&typeof B=="string"&&B){const q=oe.getState();q.setContentFramework(B,q.contentTargetFWIds)}const G=gN(ve,B);G&&(ne($t,G),H.current(G))}else if(!ve){const B=Q.getValues(),G=Object.fromEntries(Object.entries(B).filter(([ee])=>O.has(ee))),q=mN(G,{isReview:ke.includes(se.current),nodeTitle:J.current});Object.keys(q).length>0&&(ne($t,q),H.current(q))}const A=Q.formState.errors,z=Array.from(new Set(Object.keys(A).map(B=>{var G;return(G=x.find(q=>q.code===B))==null?void 0:G.tab}).filter(Boolean)));ie.current(Object.keys(A).length===0,z)});return()=>K.unsubscribe()},[Q]),m.useEffect(()=>{for(const K of["author","creator","copyright","copyrightYear","license"]){const pe=te.current.find($t=>$t.code===K);if(!pe||pe.currentValue===void 0||pe.currentValue===null||pe.currentValue==="")continue;const ve=Q.getValues(K);(ve==null||ve==="")&&Q.setValue(K,pe.currentValue,{shouldDirty:!1})}},[E,_,Q]);const Te=de.reduce((K,pe)=>{const ve=K[K.length-1];return ve&&ve.section===pe.section?ve.fields.push(pe):K.push({section:pe.section,fields:[pe]}),K},[]),$e=K=>{const pe={key:K.code,name:K.code,label:K.label,required:K.required,disabled:K.editable===!1};switch(K.inputType){case"textarea":return c.jsx(Hu,{...pe,multiline:!0,maxLength:K.maxLength});case"select":return c.jsx(sR,{...pe,options:K.options??[]});case"multiselect":return c.jsx(iR,{...pe,options:K.options??[]});case"chips":return c.jsx(aR,{...pe});case"radio":return c.jsx(oR,{...pe,options:K.options??[]});case"appIcon":return c.jsx(QR,{...pe,nodeId:M??""});case"datepicker":case"datetime":return c.jsx(GR,{...pe});case"keywords":case"tagsinput":return c.jsx(WR,{...pe});case"nestedselect":return c.jsx(KR,{...pe,levels:K.levels??[]});case"license":return c.jsx(YR,{...pe});case"dialcode":return c.jsx(ZR,{...pe});default:return c.jsx(Hu,{...pe,maxLength:K.maxLength})}};return c.jsx(ID,{...Q,children:c.jsxs("div",{className:Qa.form,children:[Te.map((K,pe)=>{const ve=K.section?GD[K.section]:void 0;return ve?c.jsx(_N,{title:ve.title,description:ve.description,children:K.fields.map($e)},K.section??pe):c.jsx("div",{className:Qa.ungrouped,children:K.fields.map($e)},pe)}),de.length===0&&!y&&c.jsx("p",{className:Qa.noFields,children:o.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 rk(e,t){return e.reduce((r,n,s)=>{const i=t.get(n);return i&&(r[s]=i),r},Array(e.length))}function ai(e){return e!==null&&e>=0}function nk(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 sk(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const up=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const i=cp(t,n,r),a=t[s],o=i[s];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},oi={scaleX:1,scaleY:1},ik=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:i,overIndex:a}=e;const o=(t=i[r])!=null?t:n;if(!o)return null;if(s===r){const u=i[a];return u?{x:0,y:r<a?u.top+u.height-(o.top+o.height):u.top-o.top,...oi}:null}const l=ak(i,s,r);return s>r&&s<=a?{x:0,y:-o.height-l,...oi}:s<r&&s>=a?{x:0,y:o.height+l,...oi}:{x:0,y:0,...oi}};function ak(e,t,r){const n=e[t],s=e[t-1],i=e[t+1];return n?r<t?s?n.top-(s.top+s.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const dp="Sortable",fp=m.createContext({activeIndex:-1,containerId:dp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:up,disabled:{draggable:!1,droppable:!1}});function ok(e){let{children:t,id:r,items:n,strategy:s=up,disabled:i=!1}=e;const{active:a,dragOverlay:o,droppableRects:l,over:u,measureDroppableContainers:d}=nf(),f=$s(dp,r),g=o.rect!==null,p=m.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),C=a!=null,h=a?p.indexOf(a.id):-1,y=u?p.indexOf(u.id):-1,v=m.useRef(p),b=!nk(p,v.current),w=y!==-1&&h===-1||b,S=sk(i);Jt(()=>{b&&C&&d(p)},[b,p,C,d]),m.useEffect(()=>{v.current=p},[p]);const _=m.useMemo(()=>({activeIndex:h,containerId:f,disabled:S,disableTransforms:w,items:p,overIndex:y,useDragOverlay:g,sortedRects:rk(p,l),strategy:s}),[h,f,S.draggable,S.droppable,w,p,y,l,g,s]);return m.createElement(fp.Provider,{value:_},t)}const lk=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return cp(r,n,s).indexOf(t)},ck=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:i,newIndex:a,previousItems:o,previousContainerId:l,transition:u}=e;return!u||!n||o!==i&&s===a?!1:r?!0:a!==s&&t===l},uk={duration:200,easing:"ease"},hp="transform",dk=qr.Transition.toString({property:hp,duration:0,easing:"linear"}),fk={roleDescription:"sortable"};function hk(e){let{disabled:t,index:r,node:n,rect:s}=e;const[i,a]=m.useState(null),o=m.useRef(r);return Jt(()=>{if(!t&&r!==o.current&&n.current){const l=s.current;if(l){const u=Gn(n.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&a(d)}}r!==o.current&&(o.current=r)},[t,r,n,s]),m.useEffect(()=>{i&&a(null)},[i]),i}function pk(e){let{animateLayoutChanges:t=ck,attributes:r,disabled:n,data:s,getNewIndex:i=lk,id:a,strategy:o,resizeObserverConfig:l,transition:u=uk}=e;const{items:d,containerId:f,activeIndex:g,disabled:p,disableTransforms:C,sortedRects:h,overIndex:y,useDragOverlay:v,strategy:b}=m.useContext(fp),w=mk(n,p),S=d.indexOf(a),_=m.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...s}),[f,s,S,d]),E=m.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:D,node:R,isOver:M,setNodeRef:$}=py({id:a,data:_,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:N,activatorEvent:j,activeNodeRect:P,attributes:k,setNodeRef:L,listeners:V,isDragging:X,over:ye,setActivatorNodeRef:_e,transform:we}=rf({id:a,data:_,attributes:{...fk,...r},disabled:w.draggable}),de=Jm($,L),Q=!!N,ne=Q&&!C&&ai(g)&&ai(y),te=!v&&X,U=te&&ne?we:null,ie=ne?U??(o??b)({rects:h,activeNodeRect:P,activeIndex:g,overIndex:y,index:S}):null,fe=ai(g)&&ai(y)?i({id:a,items:d,activeIndex:g,overIndex:y}):S,J=N==null?void 0:N.id,se=m.useRef({activeId:J,items:d,newIndex:fe,containerId:f}),ke=d!==se.current.items,Te=t({active:N,containerId:f,isDragging:X,isSorting:Q,id:a,index:S,items:d,newIndex:se.current.newIndex,previousItems:se.current.items,previousContainerId:se.current.containerId,transition:u,wasDragging:se.current.activeId!=null}),$e=hk({disabled:!Te,index:S,node:R,rect:D});return m.useEffect(()=>{Q&&se.current.newIndex!==fe&&(se.current.newIndex=fe),f!==se.current.containerId&&(se.current.containerId=f),d!==se.current.items&&(se.current.items=d)},[Q,fe,f,d]),m.useEffect(()=>{if(J===se.current.activeId)return;if(J&&!se.current.activeId){se.current.activeId=J;return}const qe=setTimeout(()=>{se.current.activeId=J},50);return()=>clearTimeout(qe)},[J]),{active:N,activeIndex:g,attributes:k,data:_,rect:D,index:S,newIndex:fe,items:d,isOver:M,isSorting:Q,isDragging:X,listeners:V,node:R,overIndex:y,over:ye,setNodeRef:de,setActivatorNodeRef:_e,setDroppableNodeRef:$,setDraggableNodeRef:L,transform:$e??ie,transition:Ve()};function Ve(){if($e||ke&&se.current.newIndex===S)return dk;if(!(te&&!Ki(j)||!u)&&(Q||Te))return qr.Transition.toString({...u,property:hp})}}function mk(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 Ui(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 gk=[xe.Down,xe.Right,xe.Up,xe.Left],yk=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:i,over:a,scrollableAncestors:o}}=t;if(gk.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const g=s.get(f.id);if(g)switch(e.code){case xe.Down:n.top<g.top&&l.push(f);break;case xe.Up:n.top>g.top&&l.push(f);break;case xe.Left:n.left>g.left&&l.push(f);break;case xe.Right:n.left<g.left&&l.push(f);break}});const u=gg({collisionRect:n,droppableRects:s,droppableContainers:l});let d=Bd(u,"id");if(d===(a==null?void 0:a.id)&&u.length>1&&(d=u[1].id),d!=null){const f=i.get(r.id),g=i.get(d),p=g?s.get(g.id):null,C=g==null?void 0:g.node.current;if(C&&p&&f&&g){const y=Yi(C).some((E,D)=>o[D]!==E),v=pp(f,g),b=vk(f,g),w=y||!v?{x:0,y:0}:{x:b?n.width-p.width:0,y:b?n.height-p.height:0},S={x:p.left,y:p.top};return w.x&&w.y?S:Es(S,w)}}}};function pp(e,t){return!Ui(e)||!Ui(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function vk(e,t){return!Ui(e)||!Ui(t)||!pp(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const bk="_row_11nth_1",wk="_removeBtn_11nth_14",Ck="_grip_11nth_17",Sk="_ctIcon_11nth_34",xk="_info_11nth_38",_k="_name_11nth_46",Tk="_meta_11nth_55",Vr={row:bk,removeBtn:wk,grip:Ck,ctIcon:Sk,info:xk,name:_k,meta:Tk},Ek={video:al,pdf:ea,h5p:rl,scorm:sl,audio:nl,quiz:el,default:Yn},Ik=({item:e,onRemove:t,isEditable:r})=>{const n=ce(),s=ca(e),i=Ek[s.key]??Yn,{attributes:a,listeners:o,setNodeRef:l,transform:u,transition:d,isDragging:f}=pk({id:e.id,disabled:!r}),g={transform:qr.Transform.toString(u),transition:d,opacity:f?.5:1};return c.jsxs("div",{ref:l,style:g,className:Vr.row,role:"listitem",children:[r&&c.jsx("span",{className:Vr.grip,...a,...o,"aria-label":n.contentRow.dragToReorderAriaLabel,children:c.jsx(uf,{size:15})}),c.jsx("span",{className:[`sbx-ct-sq--${s.key}`,Vr.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(i,{size:14})}),c.jsxs("div",{className:Vr.info,children:[c.jsx("span",{className:Vr.name,title:e.name,children:e.name}),c.jsx("span",{className:Vr.meta,children:s.label})]}),c.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&c.jsx("button",{type:"button",className:Vr.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:c.jsx(Cr,{size:14})})]})},Ok="_container_lzvke_1",Ak="_header_lzvke_7",Dk="_heading_lzvke_13",Nk="_count_lzvke_21",Rk="_list_lzvke_30",kk="_emptyState_lzvke_36",jk="_addRow_lzvke_52",Hr={container:Ok,header:Ak,heading:Dk,count:Nk,list:Rk,emptyState:kk,addRow:jk},Lk=({editorMode:e})=>{const t=ce(),{selectedNodeId:r,getChildrenOf:n,reorderChildren:s,deleteNode:i}=Oe(),a=r?n(r):[],o=e==="edit",l=Pd(fo(Zi,{activationConstraint:{distance:5}}),fo(Zo,{coordinateGetter:yk})),u=m.useCallback(f=>{const{active:g,over:p}=f;if(!p||g.id===p.id||!r)return;const C=Oe.getState().getChildrenOf(r),h=C.findIndex(v=>v.id===g.id),y=C.findIndex(v=>v.id===p.id);h<0||y<0||s(r,h,y)},[r,s]),d=m.useCallback(f=>{window.confirm(t.unitContentList.removeConfirm)&&i(f)},[i,t.unitContentList.removeConfirm]);return r?c.jsxs("div",{className:Hr.container,children:[c.jsxs("div",{className:Hr.header,children:[c.jsx("span",{className:Hr.heading,children:t.unitContentList.heading}),c.jsx("span",{className:Hr.count,children:a.length})]}),a.length>0?c.jsx(tf,{sensors:l,collisionDetection:mg,onDragEnd:u,children:c.jsx(ok,{items:a.map(f=>f.id),strategy:ik,children:c.jsx("div",{className:Hr.list,role:"list",children:a.map(f=>c.jsx(Ik,{item:f,onRemove:d,isEditable:o},f.id))})})}):c.jsxs("div",{className:Hr.emptyState,children:[c.jsx("p",{children:t.unitContentList.emptyTitle}),c.jsx("span",{children:t.unitContentList.emptyHint})]}),o&&c.jsxs("button",{className:Hr.addRow,type:"button","aria-label":t.unitContentList.addContentAriaLabel,children:[c.jsx(Us,{size:14})," ",t.unitContentList.addContent]})]}):null},Pk="_dropZone_ijo5w_1",Fk="_active_ijo5w_14",Wu={dropZone:Pk,active:Fk},Mk=({isActive:e,label:t,nodeId:r,className:n})=>{const s=ce(),i=t??s.dropZone.dropHere;return c.jsx("div",{className:`${Wu.dropZone} ${e?Wu.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":i,role:"region",children:c.jsx("span",{children:i})})};async function Bk(e){var a;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((a=(await Ne.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:a.result)??{},s=new Set(["count","facets"]);return{content:Object.entries(n).filter(([o])=>!s.has(o)).flatMap(([,o])=>Array.isArray(o)?o:[]),count:n.count??0}}async function $k(e){var r,n;return(n=(r=(await Ne.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Ku="application/vnd.sunbird.question";function Yu(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function mp(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=mp(n,t,e);if(s)return s}return null}function qk(e,t){const r=mp(e,t);if(!r)return null;const{question:n,parent:s}=r,i={...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?i.maxScore=1:n.qType==="SA"?delete i.maxScore:n.maxScore!=null&&(i.maxScore=n.maxScore),i}function Uk(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 Wf(e),s=d=>{if(!d)return[];const f=d.mimeType===Ku&&d.identifier?[d.identifier]:[],g=(d.children??[]).flatMap(s);return[...f,...g]},i=s(n),a=new Map;i.length&&(await E_(i)).forEach(f=>{const g=f.identifier;g&&a.set(g,f)});const o=d=>{if(!d)return d;if(d.mimeType===Ku&&d.identifier){const f=a.get(d.identifier)??d,g=f.outcomeDeclaration;return g!=null&&g.maxScore||(f.outcomeDeclaration={...g??{},maxScore:Yu(f)}),f}return Array.isArray(d.children)&&(d.children=d.children.map(f=>o(f))),d},l=o(n),u=l.outcomeDeclaration;return u!=null&&u.maxScore||(l.outcomeDeclaration={...u??{},maxScore:Yu(l)}),l}})}const Zu="/assets/quml-player/sunbird-quml-player.js",zk="/assets/quml-player/styles.css",Xu="sunbird-quml-player";function Vk(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const st=class st{constructor(){ns(this,"eventHandlers",new WeakMap)}loadScript(){return st.scriptLoaded||customElements.get(Xu)?(st.scriptLoaded=!0,Promise.resolve()):(st.scriptLoading||(st.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Zu,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{st.scriptLoaded=!0,st.scriptLoading=void 0,t()},n.onerror=()=>{st.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Zu}`))},document.body.appendChild(n)})),st.scriptLoading)}loadStyles(){if(st.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){st.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=zk,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),st.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),st.stylesLoaded=!1}async createConfig(t,r,n){var i,a,o;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((i=r==null?void 0:r.pdata)==null?void 0:i.id)??"sunbird.portal",ver:((a=r==null?void 0:r.pdata)==null?void 0:a.ver)??"1.0",pid:((o=r==null?void 0:r.pdata)==null?void 0:o.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:Vk(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Xu);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),i=a=>n==null?void 0:n(a.detail);t.addEventListener("playerEvent",s),t.addEventListener("telemetryEvent",i),this.eventHandlers.set(t,{player:s,telemetry:i})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};ns(st,"scriptLoaded",!1),ns(st,"scriptLoading"),ns(st,"stylesLoaded",!1);let zi=st;const li=new zi,Hk="_contentPlayerRoot_r6xk8_1",Qk="_flowLayout_r6xk8_9",Gk="_stage_r6xk8_13",Wk="_aspectRatio_r6xk8_16",Kk="_playerHeader_r6xk8_32",Yk="_playerHeaderThumb_r6xk8_46",Zk="_playerHeaderTitle_r6xk8_56",Xk="_typeBadge_r6xk8_66",Jk="_typeDot_r6xk8_105",ej="_playerFrame_r6xk8_125",tj="_coverOverlay_r6xk8_133",rj="_coverHidden_r6xk8_145",nj="_coverThumb_r6xk8_150",sj="_coverPlayRing_r6xk8_159",ij="_coverPlayIcon_r6xk8_172",aj="_coverLabel_r6xk8_181",oj="_coverSkeleton_r6xk8_187",lj="_playerWrapper_r6xk8_213",cj="_infoStrip_r6xk8_223",uj="_infoChip_r6xk8_239",dj="_infoChipLabel_r6xk8_258",fj="_infoChipIcon_r6xk8_267",hj="_playerError_r6xk8_273",pj="_playerErrorIcon_r6xk8_287",mj="_playerErrorMsg_r6xk8_292",gj="_qumlRoot_r6xk8_299",Pe={contentPlayerRoot:Hk,flowLayout:Qk,stage:Gk,aspectRatio:Wk,playerHeader:Kk,playerHeaderThumb:Yk,playerHeaderTitle:Zk,typeBadge:Xk,typeDot:Jk,playerFrame:ej,coverOverlay:tj,coverHidden:rj,coverThumb:nj,coverPlayRing:sj,coverPlayIcon:ij,coverLabel:aj,coverSkeleton:oj,playerWrapper:lj,infoStrip:cj,infoChip:uj,infoChipLabel:dj,infoChipIcon:fj,playerError:hj,playerErrorIcon:pj,playerErrorMsg:mj,qumlRoot:gj},yj="application/vnd.sunbird.questionset";function vj(e,t){const r=new Map,n=i=>{for(const a of i)r.set(a.id,a),a.children&&n(a.children)};n(e);let s=r.get(t);for(;s;){if(s.mimeType===yj)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const bj=[{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 wj(e){return bj.find(t=>t.mimes.includes(e))??{key:"other"}}function Cj(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 Sj={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},xj={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},_j={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},Tj="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Ga(e){for(const[t,r]of Object.entries(Sj))if(r.includes(e))return t;return"default-player"}function Ej(e,t,r){var i;const n=r==null?void 0:r.context,s=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((i=n==null?void 0:n.pdata)==null?void 0:i.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 Ij(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 Oj(e,t,r=100){await Ij(xj[t]??""),!customElements.get(e)&&await new Promise((n,s)=>{let i=0;const a=setInterval(()=>{i++,customElements.get(e)?(clearInterval(a),n()):i>=r&&(clearInterval(a),s(new Error(`Custom element <${e}> did not register`)))},100)})}const Aj=[{key:"author",icon:rv},{key:"license",icon:Ky},{key:"language",icon:qy},{key:"gradeLevel",icon:Yy},{key:"subject",icon:ky},{key:"contentType",icon:ev}];function Dj(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 Nj({node:e}){const t=ce(),r=e.metadata??{},n=Aj.flatMap(s=>{const i=r[s.key];if(!i)return[];const a=Array.isArray(i)?i.join(", "):String(i);return a?[{...s,label:Dj(s.key,t),val:a}]:[]});return n.length?c.jsx("div",{className:Pe.infoStrip,children:n.map(s=>c.jsxs("div",{className:Pe.infoChip,children:[s.icon&&c.jsx(s.icon,{size:13,className:Pe.infoChipIcon}),c.jsx("span",{className:Pe.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function gp({node:e,hidden:t}){var s;const r=ce(),n=e.appIcon??((s=e.metadata)==null?void 0:s.appIcon);return c.jsx("div",{className:`${Pe.coverOverlay} ${t?Pe.coverHidden:""}`,children:n?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:n,alt:e.name,className:Pe.coverThumb}),c.jsx("div",{className:Pe.coverPlayRing,children:c.jsx("div",{className:Pe.coverPlayIcon})}),c.jsx("span",{className:Pe.coverLabel,children:r.contentPlayer.loadingPreview})]}):c.jsx("div",{className:Pe.coverSkeleton})})}function yp({message:e}){return c.jsxs("div",{className:Pe.playerError,children:[c.jsx(tv,{size:28,className:Pe.playerErrorIcon}),c.jsx("span",{className:Pe.playerErrorMsg,children:e})]})}function Rj({mimeType:e}){const t=ce(),r=wj(e);return c.jsxs("span",{className:Pe.typeBadge,"data-type":r.key,children:[c.jsx("span",{className:Pe.typeDot}),Cj(r.key,t)]})}const zo=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var a;if(r==="quml")return c.jsx(jj,{node:e,editorMode:t,singleQuestion:!!n});const i=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return c.jsxs("div",{className:`${Pe.contentPlayerRoot} ${s==="flow"?Pe.flowLayout:""}`,children:[c.jsxs("div",{className:Pe.stage,children:[c.jsxs("div",{className:Pe.playerHeader,children:[i&&c.jsx("img",{src:i,alt:"",className:Pe.playerHeaderThumb}),c.jsx("span",{className:Pe.playerHeaderTitle,children:e.name}),c.jsx(Rj,{mimeType:e.mimeType??""})]}),c.jsx(kj,{node:e})]}),c.jsx(Nj,{node:e})]})};function kj({node:e}){var v;const t=ce(),r=oe(b=>b.editorConfig),[n,s]=m.useState(()=>Ga(e.mimeType??"")),[i,a]=m.useState(!1),[o,l]=m.useState(null),[u,d]=m.useState(e.metadata??{}),[f,g]=m.useState(!1),p=m.useRef(null),C=m.useRef(null),h=((v=r==null?void 0:r.config)==null?void 0:v.previewCdnUrl)??Tj;m.useEffect(()=>{let b=!1;return g(!1),a(!1),l(null),d(e.metadata??{}),s(Ga(e.mimeType??"")),$k(e.identifier).then(w=>{if(b)return;const S={...e.metadata??{},...w};d(S);const _=w.mimeType??e.mimeType??"";s(Ga(_)),g(!0)}).catch(()=>{b||g(!0)}),()=>{b=!0}},[e.identifier]);const y=Ej(e,u,r);return m.useEffect(()=>{if(!f||n!=="default-player")return;const b=p.current;if(!b)return;b.src=h;const w=()=>{try{const _=b.contentWindow;if(typeof(_==null?void 0:_.initializePreview)!="function"){l(t.contentPlayer.previewPlayerUnavailable);return}_.initializePreview(y),setTimeout(()=>a(!0),300)}catch(_){console.error("[ContentPlayer] initializePreview failed",_),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,h,f,t]),m.useEffect(()=>{if(!f||n==="default-player")return;const b=C.current;if(!b)return;const w=_j[n];if(!w)return;const S=y;Oj(w,n).then(()=>{if(!C.current)return;if(!customElements.get(w)){s("default-player");return}const _=document.createElement(w);_.setAttribute("player-config",JSON.stringify(S)),_.addEventListener("playerEvent",()=>{}),_.addEventListener("telemetryEvent",()=>{}),b.innerHTML="",b.appendChild(_),setTimeout(()=>{try{_.playerConfig=S}catch{}a(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),s("default-player")})},[e.identifier,n,f]),c.jsxs("div",{className:Pe.aspectRatio,children:[o?c.jsx(yp,{message:o}):c.jsx(gp,{node:e,hidden:i}),n==="default-player"?c.jsx("iframe",{ref:p,id:"contentPlayer",title:e.name,className:Pe.playerFrame,name:"contentPlayer",allowFullScreen:!0}):c.jsx("div",{ref:C,className:Pe.playerFrame})]})}function jj({node:e,editorMode:t,singleQuestion:r}){const n=ce(),s=oe(p=>p.editorConfig),i=Oe(p=>p.treeData),a=m.useRef(null),o=r?vj(i,e.id):e.identifier,{data:l,isLoading:u,error:d}=Uk(o??"",{enabled:!!o}),f=m.useMemo(()=>l?r?qk(l,e.identifier):l:null,[l,r,e.identifier]);m.useEffect(()=>{const p=a.current;if(!p||!f)return;let C=null,h=!1;return(async()=>{try{const y=await li.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(h||!a.current)return;const v=li.createElement(y);C=v,li.attachEventListeners(v,b=>console.debug("[QumlPlayer] playerEvent",b.detail),b=>console.debug("[QumlPlayer] telemetryEvent",b)),p.innerHTML="",p.appendChild(v)}catch(y){console.error("[QumlPlayer] failed to initialize",y)}})(),()=>{h=!0,C&&(li.removeEventListeners(C),C.remove()),zi.unloadStyles()}},[f,s,t,r]);const g=d?`${n.contentPlayer.unableToLoadQuestionset} ${d.message}`:r&&!o?n.contentPlayer.parentQuestionsetNotResolved:r&&l&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return c.jsxs("div",{className:Pe.qumlRoot,children:[g?c.jsx(yp,{message:g}):u||!f?c.jsx(gp,{node:e,hidden:!1}):null,c.jsx("div",{ref:a,className:Pe.playerWrapper})]})}const Lj="_overlay_ifddx_1",Pj="_modal_ifddx_11",Fj="_header_ifddx_21",Mj="_body_ifddx_37",Bj="_hint_ifddx_43",$j="_list_ifddx_49",qj="_item_ifddx_55",Uj="_selected_ifddx_68",zj="_empty_ifddx_73",Vj="_footer_ifddx_79",Hj="_cancelBtn_ifddx_87",Qj="_moveBtn_ifddx_95",Vt={overlay:Lj,modal:Pj,header:Fj,body:Mj,hint:Bj,list:$j,item:qj,selected:Uj,empty:zj,footer:Vj,cancelBtn:Hj,moveBtn:Qj};function Gj(e,t,r){const n=[],s=i=>{var a;for(const o of i)o.isFolder&&o.id!==r&&o.id!==t&&n.push(o),(a=o.children)!=null&&a.length&&s(o.children)};return s(e),n}const Wj=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=ce(),{treeData:i,moveNode:a}=Oe(),o=Gj(i,((f=i[0])==null?void 0:f.id)??"",r),[l,u]=m.useState(null),d=()=>{l&&(a(e,r,l),n())};return c.jsx("div",{className:Vt.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:c.jsxs("div",{className:Vt.modal,children:[c.jsxs("div",{className:Vt.header,children:[c.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),c.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:c.jsx(Cr,{size:16})})]}),c.jsxs("div",{className:Vt.body,children:[c.jsx("p",{className:Vt.hint,children:s.resourceReorderDialog.selectUnitHint}),c.jsxs("ul",{className:Vt.list,children:[o.map(g=>c.jsxs("li",{className:`${Vt.item} ${l===g.id?Vt.selected:""}`,onClick:()=>u(g.id),children:[c.jsx(By,{size:14}),c.jsx("span",{children:g.name})]},g.id)),o.length===0&&c.jsx("li",{className:Vt.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),c.jsxs("div",{className:Vt.footer,children:[c.jsx("button",{className:Vt.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),c.jsx("button",{className:Vt.moveBtn,onClick:d,disabled:!l,children:s.resourceReorderDialog.moveButton})]})]})})},Kj="_overlay_16at9_1",Yj="_modal_16at9_11",Zj="_header_16at9_21",Xj="_body_16at9_37",Jj="_table_16at9_43",eL="_pageInput_16at9_61",tL="_empty_16at9_68",rL="_footer_16at9_74",nL="_cancelBtn_16at9_82",sL="_saveBtn_16at9_90",or={overlay:Kj,modal:Yj,header:Zj,body:Xj,table:Jj,pageInput:eL,empty:tL,footer:rL,cancelBtn:nL,saveBtn:sL};function iL(e){const t=[],r=n=>{var s;for(const i of n)!i.isFolder&&(!i.children||i.children.length===0)?t.push(i):(s=i.children)!=null&&s.length&&r(i.children)};return r(e),t}const aL=({onClose:e})=>{const t=ce(),{treeData:r,updateNode:n}=Oe(),s=iL(r),[i,a]=m.useState(()=>Object.fromEntries(s.map(l=>{var u;return[l.id,String(((u=l.metadata)==null?void 0:u.pageNumber)??"")]}))),o=m.useCallback(()=>{for(const[l,u]of Object.entries(i))u!==""&&n(l,{pageNumber:parseInt(u,10)||void 0});e()},[i,n,e]);return c.jsx("div",{className:or.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:c.jsxs("div",{className:or.modal,children:[c.jsxs("div",{className:or.header,children:[c.jsx("span",{children:t.assignPageNumber.title}),c.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:c.jsx(Cr,{size:16})})]}),c.jsx("div",{className:or.body,children:s.length===0?c.jsx("p",{className:or.empty,children:t.assignPageNumber.emptyState}):c.jsxs("table",{className:or.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:s.map(l=>c.jsxs("tr",{children:[c.jsx("td",{children:l.name}),c.jsx("td",{children:c.jsx("input",{type:"number",min:1,value:i[l.id]??"",onChange:u=>a(d=>({...d,[l.id]:u.target.value})),className:or.pageInput})})]},l.id))})]})}),c.jsxs("div",{className:or.footer,children:[c.jsx("button",{className:or.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),c.jsxs("button",{className:or.saveBtn,onClick:o,children:[c.jsx(Wy,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},oL="_container_1a7t2_1",lL="_panelHeader_1a7t2_10",cL="_panelHeaderLeft_1a7t2_19",uL="_panelCollapseBtn_1a7t2_27",dL="_titleRow_1a7t2_46",fL="_field_1a7t2_47",hL="_moveBtn_1a7t2_64",pL="_icon_1a7t2_84",mL="_nameInput_1a7t2_93",gL="_fieldHeader_1a7t2_118",yL="_label_1a7t2_124",vL="_fieldCount_1a7t2_133",bL="_chips_1a7t2_170",wL="_chip_1a7t2_170",CL="_chipRemove_1a7t2_188",SL="_keywordInput_1a7t2_202",xL="_input_1a7t2_207",_L="_addBtn_1a7t2_220",TL="_radioGroup_1a7t2_234",EL="_radioLabel_1a7t2_239",Ge={container:oL,panelHeader:lL,panelHeaderLeft:cL,panelCollapseBtn:uL,titleRow:dL,field:fL,moveBtn:hL,icon:pL,nameInput:mL,fieldHeader:gL,label:yL,fieldCount:vL,chips:bL,chip:wL,chipRemove:CL,keywordInput:SL,input:xL,addBtn:_L,radioGroup:TL,radioLabel:EL},IL=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var j,P;const{updateNode:s,markDirty:i}=Oe(),a=t==="edit",o=ca(e),l=ce(),u=oe(k=>k.relationalFormConfig),d=k=>u==null?void 0:u.find(L=>L.code===k),f=k=>!u||!!d(k),g=(k,L)=>{var V;return((V=d(k))==null?void 0:V.label)||L},[p,C]=m.useState(!0),h=((j=e.metadata)==null?void 0:j.relationalMetadata)??{},[y,v]=m.useState(h.name??e.name??""),[b,w]=m.useState(""),[S,_]=m.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((P=e.metadata)==null?void 0:P.keywords)?e.metadata.keywords:[]),[E,D]=m.useState(!!h.optional);m.useEffect(()=>{var L,V;const k=((L=e.metadata)==null?void 0:L.relationalMetadata)??{};v(k.name??e.name??""),_(Array.isArray(k.keywords)?k.keywords:Array.isArray((V=e.metadata)==null?void 0:V.keywords)?e.metadata.keywords:[]),D(!!k.optional)},[e.id]);const R=()=>{y.trim()&&y!==e.name&&(s(e.id,{name:y.trim()}),i())},M=()=>{const k=b.trim();if(k&&!S.includes(k)){const L=[...S,k];_(L),s(e.id,{keywords:L}),i()}w("")},$=k=>{const L=S.filter(V=>V!==k);_(L),s(e.id,{keywords:L}),i()},N=k=>{D(k),s(e.id,{optional:k}),i()};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--${o.key}`,children:o.label}),a&&c.jsx("button",{type:"button",className:Ge.moveBtn,onClick:r,children:l.contentEditForm.moveToAnotherUnitButton})]}),c.jsx("button",{type:"button",className:Ge.panelCollapseBtn,onClick:()=>C(k=>!k),"aria-expanded":p,"aria-label":p?l.contentEditForm.collapseMetadataPanelAriaLabel:l.contentEditForm.expandMetadataPanelAriaLabel,title:p?l.contentEditForm.collapseTitle:l.contentEditForm.expandTitle,children:p?c.jsx(Kn,{size:15}):c.jsx(Ly,{size:15})})]}),p&&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:!a,onChange:k=>v(k.target.value),onBlur:R,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:[g("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(k=>c.jsxs("span",{className:Ge.chip,children:[k,a&&c.jsx("button",{type:"button",className:Ge.chipRemove,onClick:()=>$(k),children:"×"})]},k))}),a&&c.jsxs("div",{className:Ge.keywordInput,children:[c.jsx("input",{type:"text",className:Ge.input,value:b,placeholder:l.contentEditForm.addKeywordPlaceholder,onChange:k=>w(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),M())}}),c.jsx("button",{type:"button",className:Ge.addBtn,onClick:M,children:l.contentEditForm.addButton})]})]}),f("optional")&&c.jsxs("div",{className:Ge.field,children:[c.jsx("label",{className:Ge.label,children:g("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:E===!0,onChange:()=>N(!0),disabled:!a}),l.contentEditForm.yesOption]}),c.jsxs("label",{className:Ge.radioLabel,children:[c.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!1,onChange:()=>N(!1),disabled:!a}),l.contentEditForm.noOption]})]})]})]}),n]})},OL="_iconBtn_vl14u_1",AL="_editable_vl14u_14",DL="_iconImg_vl14u_26",NL="_placeholder_vl14u_34",RL="_removeBtn_vl14u_41",ds={iconBtn:OL,editable:AL,iconImg:DL,placeholder:NL,removeBtn:RL},kL=({nodeId:e,value:t,editable:r})=>{const[n,s]=m.useState(!1),{updateNode:i,markDirty:a}=Oe(),o=ce(),l=d=>{i(e,{appIcon:d}),a(),s(!1)},u=d=>{d.stopPropagation(),i(e,{appIcon:""}),a()};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:[ds.iconBtn,r?ds.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?o.titleAppIcon.selectAppIconAriaLabel:o.titleAppIcon.appIconAriaLabel,onClick:()=>r&&s(!0),onKeyDown:d=>{r&&(d.key==="Enter"||d.key===" ")&&s(!0)},children:[t?c.jsx("img",{src:t,alt:o.titleAppIcon.appIconAlt,className:ds.iconImg}):c.jsx("div",{className:ds.placeholder,children:c.jsx(df,{size:18})}),t&&r&&c.jsx("button",{type:"button",className:ds.removeBtn,onClick:u,"aria-label":o.titleAppIcon.removeIconAriaLabel,children:c.jsx(il,{size:11})})]}),n&&c.jsx(lp,{nodeId:e,currentValue:t,onSelect:l,onClose:()=>s(!1)})]})},jL="_leafContentLayout_1lchu_1",LL="_container_1lchu_15",PL="_emptyState_1lchu_24",FL="_titleRow_1lchu_34",ML="_nodeTitle_1lchu_50",BL="_formArea_1lchu_72",$L="_contentListArea_1lchu_76",qL="_dropZone_1lchu_81",UL="_reviewComment_1lchu_88",zL="_reviewCommentLabel_1lchu_101",VL="_reviewCommentText_1lchu_107",Kt={leafContentLayout:jL,container:LL,emptyState:PL,titleRow:FL,nodeTitle:ML,formArea:BL,contentListArea:$L,dropZone:qL,reviewComment:UL,reviewCommentLabel:zL,reviewCommentText:VL},HL="application/vnd.sunbird.questionset",vp="application/vnd.sunbird.question",QL=[HL,vp];function Ju(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 GL=({editorMode:e,onToolbarEvent:t})=>{var P;const r=ce(),[n,s]=m.useState("details"),[i,a]=m.useState([]),[o,l]=m.useState(null),[u,d]=m.useState(!1),f=m.useRef(null),g=m.useRef(),{selectedNodeId:p,breadcrumb:C,activeNodeMeta:h,updateNode:y,treeData:v}=Oe(),b=oe(k=>{var L,V,X,ye;return((V=(L=k.editorConfig)==null?void 0:L.context)==null?void 0:V.contentId)??((ye=(X=k.editorConfig)==null?void 0:X.context)==null?void 0:ye.identifier)??""}),w=p?bp(v,p):null,S=!!w&&!w.parent,_=!!(w!=null&&w.isFolder),E=w&&QL.includes(w.mimeType??""),D=(w==null?void 0:w.mimeType)===vp,R=w&&!w.isFolder&&!E&&!S,M=Ju(w)??(S?Ju(v[0]):void 0),$=m.useCallback(()=>{const k=f.current;if(!k||!p)return;const L=k.innerText.trim();clearTimeout(g.current),g.current=setTimeout(()=>{y(p,{name:L})},600)},[p,y]),N=m.useCallback(k=>{t({action:"onFormValueChange",data:k})},[t]),j=m.useCallback((k,L)=>{a(L),t({action:"onFormStatusChange",data:{isValid:k,nodeId:p}})},[t,p]);return w?E?c.jsx(zo,{node:w,editorMode:e,type:"quml",singleQuestion:D}):R?c.jsxs("div",{className:Kt.leafContentLayout,children:[c.jsx(zo,{node:w,editorMode:e,type:"content",layout:"flow"}),c.jsx(IL,{node:w,editorMode:e,onMoveClick:()=>l(w.identifier),reorderDialog:o?c.jsx(Wj,{resourceId:o,resourceName:w.name,currentUnitId:w.parent??"",onClose:()=>l(null)}):null})]}):c.jsxs("div",{className:Kt.container,children:[c.jsx(vD,{crumbs:C}),M&&c.jsxs("div",{className:Kt.reviewComment,role:"alert",children:[c.jsx("span",{className:Kt.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),c.jsx("span",{className:Kt.reviewCommentText,children:M})]}),c.jsxs("div",{className:Kt.titleRow,children:[S&&p&&c.jsx(kL,{nodeId:p,value:String(w.appIcon??((P=w.metadata)==null?void 0:P.appIcon)??""),editable:e==="edit"}),c.jsx("div",{ref:f,className:Kt.nodeTitle,contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:$,onBlur:$,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:w.name})]}),c.jsx(_D,{activeTab:n,onChange:k=>s(k),errorTabs:i,visibleTabs:S?void 0:["details"]}),c.jsx("div",{className:Kt.formArea,children:c.jsx(tk,{nodeMetadata:h,activeTab:n,isRoot:S,isFolder:_,editorMode:e,onFormValueChange:N,onFormStatusChange:j},`${p??"none"}:${S?"root":"node"}`)}),(_||S)&&n==="details"&&c.jsx("div",{className:Kt.contentListArea,children:c.jsx(Lk,{editorMode:e})}),c.jsx(Mk,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:p??void 0,className:Kt.dropZone}),u&&c.jsx(aL,{contentId:b,onClose:()=>d(!1)})]}):c.jsx("div",{className:Kt.emptyState,children:c.jsx("p",{children:r.contextualEditor.emptyStateMessage})})};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 wp=zs((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 i=[...t().allContent,...r];e({allContent:i,totalCount:n,offset:i.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 i=r;if(n&&n!=="all"){const a=n.toLowerCase();i=i.filter(o=>[o.mimeType??"",o.primaryCategory??"",o.contentType??""].join(" ").toLowerCase().includes(a))}if(s&&s.trim()!==""){const a=s.toLowerCase().trim();i=i.filter(o=>(o.name??"").toLowerCase().includes(a))}e({filteredContent:i})}})),WL=20;function Cp(){var u;const e=oe(d=>d.editorConfig),t=Oe(d=>d.selectedNodeId),r=Oe(d=>d.treeData),n=m.useCallback(()=>{if(!t||!r.length)return 0;function d(f,g,p=0){var C;for(const h of f){if(h.id===g)return p;if((C=h.children)!=null&&C.length){const y=d(h.children,g,p+1);if(y>=0)return y}}return-1}return Math.max(0,d(r,t))},[t,r])(),s=(u=e==null?void 0:e.config)==null?void 0:u.hierarchy;if(!s)return[...Du];const i=`level${n}`,a=s[i],o=a==null?void 0:a.children,l=o==null?void 0:o.Content;return l!=null&&l.length?l:[...Du]}function KL(){const e=wp(),t=oe(f=>{var g,p;return((p=(g=f.editorConfig)==null?void 0:g.context)==null?void 0:p.channel)??""}),r=Cp(),n=m.useRef(),s=m.useCallback(async(f="",g="all",p={},C=!0,h=!1)=>{var y,v,b,w,S;e.setLoading(!0);try{const _={status:["Live"],primaryCategory:g&&g!=="all"?[g]:r};(y=p==null?void 0:p.board)!=null&&y.length&&(_.board=p.board),(v=p==null?void 0:p.medium)!=null&&v.length&&(_.medium=p.medium),(b=p==null?void 0:p.gradeLevel)!=null&&b.length&&(_.gradeLevel=p.gradeLevel),(w=p==null?void 0:p.subject)!=null&&w.length&&(_.subject=p.subject),(S=p==null?void 0:p.primaryCategory)!=null&&S.length&&(_.primaryCategory=p.primaryCategory);const E=C?0:e.offset,{content:D,count:R}=await Bk({filters:_,query:f,limit:f?50:WL,offset:E,channel:t||void 0,sortBy:h?{name:"asc"}:{lastUpdatedOn:"desc"}});C?e.setContent(D,R):e.appendContent(D,R)}catch(_){console.error("[useLibrary] load error:",_)}finally{e.setLoading(!1)}},[r,t]);m.useEffect(()=>{s()},[t]);const i=m.useCallback(f=>{e.setSearch(f),clearTimeout(n.current),n.current=setTimeout(()=>s(f,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,s]),a=m.useCallback(f=>{e.setFilter(f),s(e.searchQuery,f,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,s]),o=m.useCallback(f=>{e.setAdvancedFilters(f),s(e.searchQuery,e.activeFilter,f,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,s]),l=m.useCallback(()=>{const f=!e.sortAZ;e.setSortAZ(f),s(e.searchQuery,e.activeFilter,e.advancedFilters,!0,f)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,s]),u=m.useCallback(()=>{e.isLoading||s(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,s]),d=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:d,search:i,setFilter:a,applyAdvancedFilters:o,toggleSort:l,loadMore:u,refetch:()=>s(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ)}}const YL="_card_jzciw_1",ZL="_addBtn_jzciw_17",XL="_dragging_jzciw_24",JL="_ctIcon_jzciw_29",eP="_info_jzciw_33",tP="_name_jzciw_41",rP="_meta_jzciw_50",nP="_addBtnMuted_jzciw_78",sP="_added_jzciw_87",iP="_addedBadge_jzciw_96",lr={card:YL,addBtn:ZL,dragging:XL,ctIcon:JL,info:eP,name:tP,meta:rP,addBtnMuted:nP,added:sP,addedBadge:iP},aP={video:al,pdf:ea,h5p:rl,scorm:sl,audio:nl,quiz:el,default:Yn},oP=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var y,v;const i=ce(),a=ca(e),o=aP[a.key]??Yn,l=_l(),u=eA(),d=l&&!s&&u,{attributes:f,listeners:g,setNodeRef:p,isDragging:C}=rf({id:e.identifier,disabled:!n||!l||!u,data:{type:"library-item",item:e}}),h=()=>{r&&r(e)};return c.jsxs("div",{ref:p,className:[lr.card,C?lr.dragging:"",s?lr.added:""].join(" "),"aria-label":e.name,...n?{...f,...g}:{},role:"listitem",onClick:h,children:[c.jsx("span",{className:[`sbx-ct-sq--${a.key}`,lr.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(o,{size:14})}),c.jsxs("div",{className:lr.info,children:[c.jsx("span",{className:lr.name,title:e.name,children:e.name}),c.jsxs("span",{className:lr.meta,children:[((y=e.organisation)==null?void 0:y[0])??e.channel??"",(v=e.organisation)!=null&&v[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]})]}),s&&c.jsx("span",{className:lr.addedBadge,"aria-label":i.libraryCard.alreadyAddedAriaLabel,title:i.libraryCard.alreadyAddedTitle,children:c.jsx(Wn,{size:12})}),!s&&n&&c.jsx("button",{type:"button",className:[lr.addBtn,!d&&l?lr.addBtnMuted:""].join(" "),onClick:b=>{b.stopPropagation(),t(e)},disabled:!l,"aria-disabled":!d,"aria-label":i.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:l?u?i.libraryCard.addToUnitTitle:i.libraryCard.selectUnitToAddTitle:i.libraryCard.draftOnlyTitle,children:c.jsx(Us,{size:14})})]})},lP="_chips_xhhaq_1",cP="_chip_xhhaq_1",ed={chips:lP,chip:cP},uP=({filters:e,active:t,onChange:r})=>{const n=ce();return c.jsx("div",{className:ed.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(s=>c.jsx("button",{type:"button",role:"radio","aria-checked":t===s.value,className:["sbx-chip",t===s.value?"filled":"outline",ed.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},dP="_panel_1cl11_1",fP="_header_1cl11_10",hP="_headerTitle_1cl11_19",pP="_closeBtn_1cl11_25",mP="_body_1cl11_43",gP="_section_1cl11_59",yP="_sectionLabel_1cl11_65",vP="_chips_1cl11_73",bP="_chip_1cl11_73",wP="_active_1cl11_96",CP="_footer_1cl11_102",SP="_resetBtn_1cl11_112",xP="_applyBtn_1cl11_129",ot={panel:dP,header:fP,headerTitle:hP,closeBtn:pP,body:mP,section:gP,sectionLabel:yP,chips:vP,chip:bP,active:wP,footer:CP,resetBtn:SP,applyBtn:xP},_P=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}],TP=new Set(["board","medium","gradeLevel","subject","topic"]),EP=({local:e,toggle:t})=>{const r=ce(),n=Cp();return n.length?c.jsxs("div",{className:ot.section,children:[c.jsx("div",{className:ot.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),c.jsx("div",{className:ot.chips,children:n.map(s=>c.jsx("button",{type:"button",className:[ot.chip,(e.primaryCategory??[]).includes(s)?ot.active:""].join(" "),onClick:()=>t("primaryCategory",s),children:s},s))})]}):null},IP=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var y,v;const s=ce(),i=oe(b=>b.editorConfig),a=oe(b=>b.searchFormConfig),o=oe(b=>b.contentFramework),l=oe(b=>b.contentTargetFWIds),{organisationFramework:u}=Nl(o??((y=i==null?void 0:i.context)==null?void 0:y.framework),l??((v=i==null?void 0:i.context)==null?void 0:v.targetFWIds)),[d,f]=m.useState(t),g=a!=null&&a.length?a.filter(b=>TP.has(b.code)).map(b=>({key:b.code,label:b.label||b.code})):_P(s);m.useEffect(()=>{f(t)},[t]);const p=(b,w)=>{f(S=>{const _=S[b]??[],E=_.includes(w)?_.filter(D=>D!==w):[..._,w];return{...S,[b]:E}})},C=(u==null?void 0:u.categories)??[],h=b=>{var w;return((w=C.find(S=>S.code===b))==null?void 0:w.terms)??[]};return e?c.jsxs("div",{className:ot.panel,role:"dialog","aria-label":s.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[c.jsxs("div",{className:ot.header,children:[c.jsx("span",{className:ot.headerTitle,children:s.libraryFilterPanel.filtersHeaderTitle}),c.jsx("button",{type:"button",className:ot.closeBtn,onClick:n,"aria-label":s.libraryFilterPanel.closeFiltersAriaLabel,children:c.jsx(Cr,{size:16})})]}),c.jsxs("div",{className:ot.body,children:[g.map(({key:b,label:w})=>{const S=h(b);return S.length?c.jsxs("div",{className:ot.section,children:[c.jsx("div",{className:ot.sectionLabel,children:w}),c.jsx("div",{className:ot.chips,children:S.slice(0,20).map(_=>c.jsx("button",{type:"button",className:[ot.chip,(d[b]??[]).includes(_.name)?ot.active:""].join(" "),onClick:()=>p(b,_.name),children:_.name},_.identifier))})]},b):null}),c.jsx(EP,{local:d,toggle:p})]}),c.jsxs("div",{className:ot.footer,children:[c.jsx("button",{type:"button",className:ot.resetBtn,onClick:()=>f({}),children:s.libraryFilterPanel.resetButton}),c.jsx("button",{type:"button",className:ot.applyBtn,onClick:()=>{r(d),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},OP="_header_6qdpu_10",AP="_title_6qdpu_20",DP="_headerActions_6qdpu_31",NP="_iconBtn_6qdpu_38",RP="_playerArea_6qdpu_56",kP="_footer_6qdpu_64",jP="_addBtn_6qdpu_73",LP="_modalOverlay_6qdpu_92",PP="_modalPanel_6qdpu_103",gr={header:OP,title:AP,headerActions:DP,iconBtn:NP,playerArea:RP,footer:kP,addBtn:jP,modalOverlay:LP,modalPanel:PP},FP="application/vnd.sunbird.questionset",MP=({content:e,editorMode:t,onAdd:r,onClose:n})=>{const s=ce(),i=t==="edit";if(!e)return null;const a={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 Br.createPortal(c.jsx("div",{className:gr.modalOverlay,role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:c.jsxs("div",{className:gr.modalPanel,onClick:o=>o.stopPropagation(),children:[c.jsxs("div",{className:gr.header,children:[c.jsx("span",{className:gr.title,title:e.name,children:e.name}),c.jsx("div",{className:gr.headerActions,children:c.jsx("button",{type:"button",className:gr.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:c.jsx(Cr,{size:16})})})]}),c.jsx("div",{className:gr.playerArea,children:c.jsx(zo,{node:a,editorMode:"read",type:e.mimeType===FP?"quml":"content"})}),i&&c.jsx("div",{className:gr.footer,children:c.jsx("button",{type:"button",className:gr.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},BP="_dock_1lpg0_1",$P="_header_1lpg0_8",qP="_headerLeft_1lpg0_17",UP="_headerTitle_1lpg0_24",zP="_count_1lpg0_30",VP="_searchRow_1lpg0_39",HP="_searchWrap_1lpg0_47",QP="_searchIcon_1lpg0_53",GP="_searchInput_1lpg0_62",WP="_filterToggleBtn_1lpg0_80",KP="_filterToggleBtnActive_1lpg0_99",YP="_filterBadge_1lpg0_105",ZP="_filters_1lpg0_124",XP="_mainArea_1lpg0_134",JP="_sidePanelOverlay_1lpg0_143",eF="_cardList_1lpg0_152",tF="_skeleton_1lpg0_168",rF="_skeletonIcon_1lpg0_178",nF="_skeletonText_1lpg0_186",sF="_skeletonLine_1lpg0_193",iF="_skeletonLineSm_1lpg0_200",aF="_loadMoreBtn_1lpg0_215",oF="_emptyState_1lpg0_240",lF="_collapseBtn_1lpg0_260",Me={dock:BP,header:$P,headerLeft:qP,headerTitle:UP,count:zP,searchRow:VP,searchWrap:HP,searchIcon:QP,searchInput:GP,filterToggleBtn:WP,filterToggleBtnActive:KP,filterBadge:YP,filters:ZP,mainArea:XP,sidePanelOverlay:JP,cardList:eF,skeleton:tF,skeletonIcon:rF,skeletonText:nF,skeletonLine:sF,skeletonLineSm:iF,loadMoreBtn:aF,emptyState:oF,collapseBtn:lF};function cF(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 uF=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ce(),{content:s,isLoading:i,totalCount:a,activeFilter:o,searchQuery:l,sortAZ:u,hasMore:d,search:f,setFilter:g,applyAdvancedFilters:p,toggleSort:C,loadMore:h}=KL(),{addResource:y,selectedNodeId:v,treeData:b}=Oe(),w=e==="edit",[S,_]=m.useState(!1),[E,D]=m.useState({}),[R,M]=m.useState(null),$=m.useMemo(()=>cF(b),[b]),N=m.useCallback(V=>{var _e;if(!v){Ee.error(n.libraryDock.selectUnitFirstToast);return}const X=(_e=b[0])==null?void 0:_e.id;if(v===X){Ee(n.libraryDock.selectUnitFromOutlineToast,{icon:c.jsx(tl,{size:16}),duration:4e3});return}if(y(V,v)===!1){Ee.error(n.libraryDock.itemAlreadyAddedToast.replace("{name}",V.name));return}Ee.success(n.libraryDock.itemAddedToast.replace("{name}",V.name))},[v,y,b,n]),j=m.useCallback(V=>{D(V),p(V)},[p]),P=m.useCallback(V=>{M(V)},[]),k=m.useCallback(V=>{N(V),M(null)},[N]),L=m.useMemo(()=>Object.values(E).reduce((V,X)=>V+((X==null?void 0:X.length)??0),0),[E]);return c.jsxs("div",{className:Me.dock,children:[c.jsx("div",{className:Me.header,children:c.jsxs("div",{className:Me.headerLeft,children:[c.jsx("button",{type:"button",className:Me.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:c.jsx(Qy,{size:15})}),c.jsx(zy,{size:16}),c.jsx("span",{className:Me.headerTitle,children:n.libraryDock.headerTitle}),a>0&&c.jsx("span",{className:Me.count,children:a})]})}),c.jsxs("div",{className:Me.searchRow,children:[c.jsxs("div",{className:Me.searchWrap,children:[c.jsx(go,{size:14,className:Me.searchIcon}),c.jsx("input",{type:"search",className:Me.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:l,onChange:V=>f(V.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),c.jsx("button",{type:"button",className:[Me.filterToggleBtn,u?Me.filterToggleBtnActive:""].join(" "),onClick:C,"aria-label":u?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:u?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:u?c.jsx(Ry,{size:15}):c.jsx(Fy,{size:15})}),c.jsxs("button",{type:"button",className:[Me.filterToggleBtn,S?Me.filterToggleBtnActive:""].join(" "),onClick:()=>_(V=>!V),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":S,title:n.libraryDock.advancedFiltersTitle,children:[c.jsx(Jy,{size:15}),L>0&&c.jsx("span",{className:Me.filterBadge,children:L})]})]}),c.jsx("div",{className:Me.filters,children:c.jsx(uP,{filters:tA,active:o,onChange:g})}),c.jsxs("div",{className:Me.mainArea,children:[c.jsx("div",{className:Me.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:i&&s.length===0?Array.from({length:4}).map((V,X)=>c.jsxs("div",{className:Me.skeleton,"aria-hidden":"true",children:[c.jsx("div",{className:Me.skeletonIcon}),c.jsxs("div",{className:Me.skeletonText,children:[c.jsx("div",{className:Me.skeletonLine}),c.jsx("div",{className:Me.skeletonLineSm})]})]},X)):s.length>0?c.jsxs(c.Fragment,{children:[s.map(V=>c.jsx(oP,{item:V,onAdd:N,onPreview:P,isDraggable:w,isAdded:$.has(V.identifier)},V.identifier)),d&&c.jsx("button",{type:"button",className:Me.loadMoreBtn,onClick:h,disabled:i,"aria-label":n.libraryDock.loadMoreAriaLabel,children:i?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):c.jsxs("div",{className:Me.emptyState,children:[c.jsx(go,{size:24}),c.jsx("p",{children:n.libraryDock.noContentFound}),c.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})}),S&&c.jsx("div",{className:Me.sidePanelOverlay,children:c.jsx(IP,{isOpen:S,filters:E,onApply:j,onClose:()=>_(!1)})}),R&&c.jsx(MP,{content:R,editorMode:e,onAdd:k,onClose:()=>M(null)})]})]})};function dF(e,t,r){const n={},s={},i=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional"]),a=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),o=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 u(g,p=!1){const C={};for(const[h,y]of Object.entries(g))if(!i.has(h)&&!(p&&a.has(h)))if(o.has(h))Array.isArray(y)?C[h]=y:y!=null&&y!==""?C[h]=[y]:C[h]=[];else if(l.has(h)){const v=Number(y);isNaN(v)||(C[h]=v)}else C[h]=y;return C}function d(g){var C;const p={};for(const h of g.children??[]){if(h.isFolder)continue;const y=t[h.identifier];if(!y)continue;const{isNew:v,...b}=y;if(Object.keys(b).length===0)continue;const w=((C=h.metadata)==null?void 0:C.relationalMetadata)??{};p[h.identifier]={name:h.name,...w,...b}}return p}function f(g,p){var w,S;const C=g.identifier,h=t[C],y=C.startsWith("temp-")||!!(h!=null&&h.isNew),v=!g.isFolder&&!p;if(p||y||h&&!v){let _;if(y)_={mimeType:"application/vnd.ekstep.content-collection",code:C,contentType:((w=g.metadata)==null?void 0:w.contentType)??"CourseUnit",primaryCategory:((S=g.metadata)==null?void 0:S.primaryCategory)??"Course Unit",name:g.name,visibility:"Parent",channel:r,...u(g.metadata??{})};else if(p){const{isNew:E,...D}=h??{};_={...u(g.metadata??{},!0),...u(D,!1),name:g.name}}else{const{isNew:E,...D}=h??{};_={name:g.name,visibility:"Parent",...u(D,!0)}}n[C]={metadata:_,objectType:g.objectType||(g.isFolder?"Collection":"Content"),root:p,isNew:y}}const b=g.isFolder?d(g):{};s[C]={name:g.name,children:(g.children??[]).map(_=>_.identifier),...Object.keys(b).length>0?{relationalMetadata:b}:{},root:p},(g.children??[]).forEach(_=>f(_,!1))}return e.forEach((g,p)=>f(g,p===0)),{nodesModified:n,hierarchy:s}}function fF(){const[e,t]=m.useState(!1),r=Oe(d=>d.treeCache),n=Oe(d=>d.treeData),s=oe(d=>d.isDirty),i=oe(d=>d.lastSaved),{setIsDirty:a,setLastSaved:o}=oe(),l=oe(d=>d.editorConfig);return{save:m.useCallback(async()=>{if(!l||e)return;const d=l.context.contentId??l.context.identifier??"";if(!d)return;const f=l.context.channel??"",g=l.context.userId??l.context.uid??"";t(!0);try{const{nodesModified:p,hierarchy:C}=dF(n,r,f),{identifiers:h}=await O_(d,p,C,g);h&&Object.keys(h).length>0&&Oe.getState().replaceNodeIds(h);const y=new Date().toISOString();o(y),a(!1)}catch(p){console.error("[useSaveHierarchy] save failed:",p),Ee.error("Failed to save. Please try again.")}finally{t(!1)}},[l,e,n,r,a,o]),isSaving:e,isDirty:s,lastSaved:i}}const hF={};function pF(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function mF(e,t,r,n,s,i=hF){const a=[],o=(l,u)=>{var d;for(const f of l){const g=u&&!f.parent,p=g?r:f.isFolder?n:null;if(p&&p.length>0){const C={...f.metadata??{},...t[f.id]??{}},y=sp(p,C,i,g,s).filter(v=>v.required&&v.visible!==!1&&v.inputType!=="appIcon"&&pF(v.currentValue)).map(v=>v.label);y.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:y})}(d=f.children)!=null&&d.length&&o(f.children,!1)}};return o(e,!0),a}function gF(e){var h,y;const t=oe(v=>v.editorConfig),r=oe(v=>v.setButtonLoader),n=oe(v=>v.validateAllForms),s=oe(v=>v.rootFormConfig),i=oe(v=>v.unitFormConfig),a=Oe(v=>v.treeData),o=Oe(v=>v.treeCache),l=Oe(v=>v.selectNode),u=oe(v=>v.contentFramework),d=oe(v=>v.contentTargetFWIds),{organisationFramework:f,targetFrameworks:g}=Nl(u??((h=t==null?void 0:t.context)==null?void 0:h.framework),d??((y=t==null?void 0:t.context)==null?void 0:y.targetFWIds)),p=m.useCallback(()=>{var _,E,D;const v={editorMode:"edit",objectType:(_=t==null?void 0:t.config)==null?void 0:_.objectType,userFullName:(D=(E=t==null?void 0:t.context)==null?void 0:E.user)==null?void 0:D.fullName},b=mF(a,o,s,i,v,{organisationFramework:f,targetFrameworks:g});if(b.length===0)return!0;const w=b[0];Ee.error(`"${w.nodeName}": please fill required field${w.missing.length>1?"s":""} — ${w.missing.join(", ")}`);const{setFormStatus:S}=oe.getState();return b.forEach(R=>S(R.nodeId,!1)),l(w.nodeId),!1},[a,o,s,i,t,l,f,g]);return{runAction:m.useCallback(async(v,b)=>{var _,E,D,R;const w=((_=t==null?void 0:t.context)==null?void 0:_.contentId)??((E=t==null?void 0:t.context)==null?void 0:E.identifier)??"";if(!w)return Ee.error("No content identifier found."),!1;const S=((D=t==null?void 0:t.context)==null?void 0:D.userId)??((R=t==null?void 0:t.context)==null?void 0:R.uid)??"";try{switch(v){case"sendForReview":return p()?n(a)?(r("saveCollection",!0),await e(),await N_(w),Ee.success("Content sent for review"),!0):(Ee.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{r("rejectCollection",!0);const M=(b==null?void 0:b.comment)??"";return await R_(w,M),Ee.success("Content rejected and sent back to the author"),!0}case"publish":return p()?n(a)?(r("publishCollection",!0),await e(),await A_(w,S),Ee.success("Content published successfully"),!0):(Ee.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(M){console.error(`[useToolbarActions] ${v} failed`,M);const $=v==="sendForReview"?"send for review":v==="reject"?"reject":"publish";return Ee.error(`Failed to ${$}. Please try again.`),!1}finally{r("saveCollection",!1),r("rejectCollection",!1),r("publishCollection",!1)}},[t,e,r,p,n,a]),checkRequiredFields:p}}const yF="_shell_90fon_1",vF="_workspace_90fon_8",bF="_sidebarCollapsed_90fon_16",wF="_dockCollapsed_90fon_19",CF="_dock_90fon_19",SF="_outline_90fon_40",xF="_reopenTab_90fon_45",_F="_outlineHidden_90fon_79",TF="_editor_90fon_86",EF="_dockHidden_90fon_101",IF="_dockReopenTab_90fon_108",OF="_dragChip_90fon_133",AF="_dragChipLabel_90fon_148",jt={shell:yF,workspace:vF,sidebarCollapsed:bF,dockCollapsed:wF,dock:CF,outline:SF,reopenTab:xF,outlineHidden:_F,editor:TF,dockHidden:EF,dockReopenTab:IF,dragChip:OF,dragChipLabel:AF},DF=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const s=ce(),[i,a]=m.useState(null),[o,l]=m.useState(!1),[u,d]=m.useState(!1),[f,g]=m.useState(!1),{addResource:p,treeData:C}=Oe(),h=oe(L=>L.setFormStatus),[y,v]=m.useState(!0),b=Oe(L=>L.selectedNodeId),{save:w,isSaving:S,isDirty:_,lastSaved:E}=fF(),{runAction:D,checkRequiredFields:R}=gF(w);m.useEffect(()=>{if(!_)return;const L=V=>{V.preventDefault(),V.returnValue=""};return window.addEventListener("beforeunload",L),()=>window.removeEventListener("beforeunload",L)},[_]);const M=Pd(fo(Zi,{activationConstraint:{distance:8}})),$=m.useCallback(L=>{var X;const V=(X=L.active.data.current)==null?void 0:X.item;V&&a(V)},[]),N=m.useCallback(L=>{var de,Q;a(null);const V=(de=L.active.data.current)==null?void 0:de.item;if(!V)return;const X=L.over,ye=(X==null?void 0:X.id)??b??void 0;if(!ye){Ee.error(s.splitBuilderShell.dropOntoUnitError);return}const _e=(Q=C[0])==null?void 0:Q.id;if(ye===_e){Ee.error(s.splitBuilderShell.dropOntoCourseError);return}if(!p(V,ye)){Ee.error(s.splitBuilderShell.alreadyInCollectionError.replace("{name}",V.name));return}r==null||r(V,ye),Ee.success(s.splitBuilderShell.addedToUnitSuccess.replace("{name}",V.name))},[b,p,r,s]),j=m.useCallback(async L=>{if(L.action==="onFormStatusChange"){const{isValid:V,nodeId:X}=L.data??{},ye=V!==!1;v(ye),X&&h(X,ye);return}if(L.action==="back"&&_&&e==="edit"){g(!0);return}if(L.action==="saveCollection"){if(!y){Ee.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!R())return;await w(),n==null||n(C),t==null||t(L);return}if(L.action==="sendForReview"||L.action==="reject"||L.action==="publish"){await D(L.action,L.data)&&(t==null||t(L));return}t==null||t(L)},[w,D,R,t,n,C,_,y,e,s]),P=m.useCallback(async()=>{if(!R()){g(!1);return}await w(),g(!1),n==null||n(C),t==null||t({action:"back"})},[w,R,n,t,C]),k=m.useCallback(()=>{g(!1),t==null||t({action:"back"})},[t]);return c.jsxs(tf,{sensors:M,onDragStart:$,onDragEnd:N,children:[c.jsxs("div",{className:jt.shell,children:[c.jsx(q0,{editorMode:e,isSaving:S,isDirty:_,lastSaved:E,isFormValid:y,onToolbarEvent:j}),c.jsxs("div",{className:[jt.workspace,o?jt.sidebarCollapsed:"",u?jt.dockCollapsed:""].filter(Boolean).join(" "),children:[c.jsx("aside",{className:[jt.outline,o?jt.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":o,children:c.jsx(hD,{editorMode:e,collapsed:o,onToggleCollapse:()=>l(L=>!L)})}),o&&c.jsx("button",{className:jt.reopenTab,onClick:()=>l(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),c.jsx("main",{className:jt.editor,role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:c.jsx(GL,{editorMode:e,onToolbarEvent:j})}),c.jsx("aside",{className:[jt.dock,u?jt.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":u,children:c.jsx(uF,{editorMode:e,collapsed:u,onToggleCollapse:()=>d(L=>!L)})}),u&&c.jsx("button",{className:jt.dockReopenTab,onClick:()=>d(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),c.jsx(Iy,{dropAnimation:null,children:i?c.jsx("div",{className:jt.dragChip,children:c.jsx("span",{className:jt.dragChipLabel,children:i.name})}):null}),f&&c.jsx(U0,{onSave:P,onDiscard:k,onCancel:()=>g(!1),isSaving:S})]})},NF="v1";function RF(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 td(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:RF(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 Er(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,i=n.fields.filter(a=>!!a.code).sort((a,o)=>(a.index??0)-(o.index??0));for(const a of i)r.push(td(a,s))}else n.code&&r.push(td(n));return r}function kF(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 jF(e,t,r="Collection",n=NF){var u,d;const i=(d=(u=(await Ne.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:u.result)==null?void 0:d.objectCategoryDefinition,a=(i==null?void 0:i.forms)??{},o=(i==null?void 0:i.objectMetadata)??{},l=o.config??{};return{rootForm:Er(a.create),unitForm:Er(a.unitMetadata),childForm:Er(a.childMetadata),searchForm:Er(a.search??a.searchConfig),relationalForm:Er(a.relationalMetadata),publishChecklist:Er(a.publishchecklist),reviewChecklist:Er(a.review),rfcChecklist:Er(a.requestforchangeschecklist),schemaDefaults:kF(o.schema),frameworkMetadata:l.frameworkMetadata??{},sourcingSettings:l.sourcingSettings??{}}}function rd(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function LF({config:e,onError:t}){const[r,n]=m.useState(!0),[s,i]=m.useState(null),[a,o]=m.useState(!1),{setEditorConfig:l,setEditorMode:u,setCategoryDefinition:d,setContentFramework:f}=oe(),{setTreeData:g,selectNode:p}=Oe();return m.useEffect(()=>{let C=!1;async function h(){var y,v,b;try{n(!0),i(null),e.apiBaseUrl&&Hf(e.apiBaseUrl),l(e),u(e.config.mode);const w=e.context.contentId??e.context.identifier??"",S=e.context.channel??"";let _;if(S)try{_=(y=await rp(S))==null?void 0:y.defaultFramework}catch{}let E=!1;if(w){const D=e.config.objectType==="QuestionSet",{rootNode:R}=D?await I_(w):await Kf(w);if(!C&&(g(R?[R]:[]),R)){p(R.id);const{framework:P,targetFWIds:k}=rd(R.metadata??{},_,e.context);f(P,k),E=!0}const M=e.config.primaryCategory??"Course",$=e.context.channel??"",N=e.config.categoryDefinitionApiVersion??"v1";try{const j=await jF(M,$,e.config.objectType??"Collection",N);if(!C){d(j);const P=((v=j.sourcingSettings)==null?void 0:v.collection)??{},k={};P.maxDepth&&!e.config.maxDepth&&(k.maxDepth=P.maxDepth),P.children&&!e.config.children&&(k.children=P.children),P.hierarchy&&!((b=e.config.hierarchy)!=null&&b.level1)&&(k.hierarchy={...e.config.hierarchy??{},...P.hierarchy}),Object.keys(k).length>0&&l({...e,config:{...e.config,...k}})}}catch{}}if(!C&&!E){const{framework:D,targetFWIds:R}=rd({},_,e.context);f(D,R)}C||o(!0)}catch(w){if(!C){const S=w instanceof Error?w:new Error(String(w));i(S),t==null||t(S)}}finally{C||n(!1)}}return h(),()=>{C=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:a}}function PF(){const e=bf(t=>t.setLanguage);m.useEffect(()=>{e(localStorage.getItem(Co)||"en",{broadcast:!1});const t=n=>{n.key===Co&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var i;const s=(i=n.detail)==null?void 0:i.lang;s&&e(s,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(So,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(So,r)}},[e])}const FF="_root_qcpw6_1",MF="_loadingState_qcpw6_10",BF="_loadingSpinner_qcpw6_20",$F="_errorState_qcpw6_34",ms={root:FF,loadingState:MF,loadingSpinner:BF,errorState:$F},qF=new Zp({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function UF({error:e,onRetry:t}){const r=ce();return c.jsxs("div",{className:ms.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 zF extends m.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(UF,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function VF(e){PF();const t=ce(),{isLoading:r,error:n}=LF({config:e,onError:e.onError}),s=oe(i=>i.editorMode);return r?c.jsxs("div",{className:ms.loadingState,children:[c.jsx("div",{className:ms.loadingSpinner}),c.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?c.jsxs("div",{className:ms.errorState,children:[c.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),c.jsx("p",{children:n.message})]}):c.jsx("div",{className:`sb-split-builder ${ms.root}`,children:c.jsx(DF,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const Sp=e=>c.jsx(zF,{onError:e.onError,children:c.jsxs(Jp,{client:qF,children:[c.jsx(VF,{...e}),c.jsx(Xm,{position:"top-right",toastOptions:{duration:3e3}})]})}),Vi=Symbol.for("r2wc.reactRender"),nd=Symbol.for("r2wc.shouldRender"),ci=Symbol.for("r2wc.root");function HF(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function QF(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var sd={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[Vi]()}}),e[Vi]()}};function GF(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},i=!1,a=function(){var u=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?u.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.'),u.attachShadow({mode:"open"})),u},o=Object.create(HTMLElement.prototype);o.constructor=a;var l=new Proxy(o,{has:function(u,d){return d in e.propTypes||d in o},set:function(u,d,f,g){return i&&(s[d]=!0),typeof d=="symbol"||s[d]||d in u?(e.propTypes&&d in e.propTypes&&sd.expando(g,d,f),Reflect.set(u,d,f,g)):(sd.expando(g,d,f),!0)},getOwnPropertyDescriptor:function(u,d){var f=Reflect.getOwnPropertyDescriptor(u,d);if(f)return f;if(d in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return a.prototype=l,o.connectedCallback=function(){this[nd]=!0,this[Vi]()},o.disconnectedCallback=function(){typeof r.createRoot=="function"?this[ci].unmount():r.unmountComponentAtNode(this)},o[Vi]=function(){if(this[nd]===!0){var u={};Object.keys(this).forEach(function(g){s[g]!==!1&&(u[g]=this[g])},this),i=!0;const d=n.shadow?this.shadowRoot:this,f=t.createElement(e,u);typeof r.createRoot=="function"?(this[ci]||(this[ci]=r.createRoot(d)),this[ci].render(f)):r.render(f,d),i=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(u){return HF(u)}):Object.keys(e.propTypes),o.attributeChangedCallback=function(u,d,f){var g=n.dashStyleAttributes?QF(u):u;this[g]=f}),a}var gs={},fs=Br;if(process.env.NODE_ENV==="production")gs.createRoot=fs.createRoot,gs.hydrateRoot=fs.hydrateRoot;else{var ui=fs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;gs.createRoot=function(e,t){ui.usingClientEntryPoint=!0;try{return fs.createRoot(e,t)}finally{ui.usingClientEntryPoint=!1}},gs.hydrateRoot=function(e,t,r){ui.usingClientEntryPoint=!0;try{return fs.hydrateRoot(e,t,r)}finally{ui.usingClientEntryPoint=!1}}}function WF(){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 KF(e="sb-collection-editor"){if(WF(),typeof customElements>"u"||customElements.get(e))return;const t=GF(Sp,m,gs,{});customElements.define(e,t)}exports.CollectionEditor=Sp;exports.registerCollectionEditor=KF;exports.setApiBaseUrl=Hf;exports.useEditorStore=oe;exports.useLibraryStore=wp;exports.useTreeStore=Oe;
528
+ */var Oc;function Zy(){return Oc||(Oc=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=m,r=Tl(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,i=t.useRef,o=t.useEffect,a=t.useMemo,c=t.useDebugValue;zo.useSyncExternalStoreWithSelector=function(u,d,f,g,p){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=a(function(){function y(E){if(!C){if(C=!0,S=E,E=g(E),p!==void 0&&h.hasValue){var D=h.value;if(p(D,E))return _=D}return _=E}if(D=_,n(S,E))return D;var T=g(E);return p!==void 0&&p(D,T)?(S=E,D):(S=E,_=T)}var C=!1,S,_,x=f===void 0?null:f;return[function(){return y(d())},x===null?void 0:function(){return y(x())}]},[d,f,g,p]);var v=s(u,b[0],b[1]);return o(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())})()),zo}var Nc;function Xy(){return Nc||(Nc=1,process.env.NODE_ENV==="production"?di.exports=Yy():di.exports=Zy()),di.exports}var Jy=Xy();const eb=xl(Jy),qf={},{useDebugValue:tb}=m,{useSyncExternalStoreWithSelector:rb}=eb;let jc=!1;const nb=e=>e;function sb(e,t=nb,r){(qf?"production":void 0)!=="production"&&r&&!jc&&(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"),jc=!0);const n=rb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return tb(n),n}const Pc=e=>{(qf?"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"?Wy(e):e,r=(n,s)=>sb(t,n,s);return Object.assign(r,t),r},Xs=e=>e?Pc(e):Pc,El={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}},ib={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 ob(e){return e.config.primaryCategory==="Learning Path"?ib:El}const Z=Xs(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:El,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorProfile:t=>e({editorProfile:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=Z.getState().formStatusMapper,n=[...t];for(;n.length>0;){const 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}})})),ab=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:Z},Symbol.toStringTag,{value:"Module"})),Hr=Xs(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t})})),lb={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"},cb={ariaLabel:"Select language"},ub={errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},db={nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},fb={detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},hb={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"},pb={selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},mb={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"},gb={dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},vb={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"},yb={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"},bb={shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},Cb={requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},Sb={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."},_b={addPlaceholder:"Add…",addButtonLabel:"Add"},wb={requiredError:"{field} is required"},xb={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"},Tb={requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},Eb={requiredError:"{field} is required",selectPlaceholder:"Select license…"},Ab={requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Ib={requiredError:"{field} is required",selectPlaceholder:"Select…"},kb={requiredError:"{field} is required"},Db={requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Lb={requiredError:"{field} is required",maxLengthError:"Max {max} characters"},Ob={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"},Nb={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"},jb={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"},Pb={confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},Rb={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"},Fb={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"},Mb={title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},Bb={contentTypeFiltersAriaLabel:"Content type filters"},qb={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"},$b={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"},Ub={boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},zb={contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},Vb={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"},Hb={expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},Qb={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."},Wb={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."},Gb={unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},Kb={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"},Yb={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"},Zb={closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},Xb={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"},Jb={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"},eC={remove:"Remove"},tC={dropHere:"Drop here"},rC={loading:"Loading"},nC={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."},Ma={contextualEditor:lb,languageSelector:cb,collectionEditor:ub,breadcrumb:db,tabBar:fb,contentEditForm:hb,titleAppIcon:pb,unitContentList:mb,contentRow:gb,csvUpload:vb,manageCollaborators:yb,sparkMetaForm:bb,appIconField:Cb,appIconPickerModal:Sb,chipGroupField:_b,dateTimeField:wb,dialcodeInputField:xb,keywordSuggestField:Tb,licenseSelectField:Eb,multiSelectField:Ab,nestedSelectField:Ib,radioField:kb,selectField:Db,textField:Lb,assetBrowser:Ob,resourceReorderDialog:Nb,assignPageNumber:jb,confirmDialog:Pb,publishChecklist:Rb,qualityParamsModal:Fb,unsavedChangesModal:Mb,filterChips:Bb,libraryCard:qb,libraryDock:$b,libraryFilterPanel:Ub,libraryPreviewPanel:zb,outlineTree:Vb,treeNode:Hb,contentPlayer:Qb,dialcodePanel:Wb,progressStatus:Gb,splitBuilderShell:Kb,topbar:Yb,reviewCommentModal:Zb,confirmReviewModal:Xb,generateQRModal:Jb,chip:eC,dropZone:tC,spinner:rC,learningPath:nC},sC={emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},iC={ariaLabel:"اختيار اللغة"},oC={errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},aC={nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},lC={detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},cC={moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},uC={selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},dC={removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},fC={dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},hC={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:"تحميل"},pC={saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},mC={shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},gC={requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},vC={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:"فشل التحميل."},yC={addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},bC={requiredError:"{field} مطلوب"},CC={requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},SC={requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},_C={requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},wC={requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},xC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},TC={requiredError:"{field} مطلوب"},EC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},AC={requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},IC={dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},kC={dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},DC={dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},LC={confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},OC={publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},NC={reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},jC={title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},PC={contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},RC={alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},FC={selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},MC={boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},BC={contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},qC={maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},$C={expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},UC={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:"لم يتم العثور على السؤال في مجموعة الأسئلة."},zC={title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},VC={unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},HC={dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},QC={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:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},WC={closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},GC={closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},KC={closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},YC={remove:"إزالة"},ZC={dropHere:"أفلت هنا"},XC={loading:"جارٍ التحميل"},JC={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} من المقررات المرتبطة بمنهج مختلف من هذا المسار."},eS={contextualEditor:sC,languageSelector:iC,collectionEditor:oC,breadcrumb:aC,tabBar:lC,contentEditForm:cC,titleAppIcon:uC,unitContentList:dC,contentRow:fC,csvUpload:hC,manageCollaborators:pC,sparkMetaForm:mC,appIconField:gC,appIconPickerModal:vC,chipGroupField:yC,dateTimeField:bC,dialcodeInputField:CC,keywordSuggestField:SC,licenseSelectField:_C,multiSelectField:wC,nestedSelectField:xC,radioField:TC,selectField:EC,textField:AC,assetBrowser:IC,resourceReorderDialog:kC,assignPageNumber:DC,confirmDialog:LC,publishChecklist:OC,qualityParamsModal:NC,unsavedChangesModal:jC,filterChips:PC,libraryCard:RC,libraryDock:FC,libraryFilterPanel:MC,libraryPreviewPanel:BC,outlineTree:qC,treeNode:$C,contentPlayer:UC,dialcodePanel:zC,progressStatus:VC,splitBuilderShell:HC,topbar:QC,reviewCommentModal:WC,confirmReviewModal:GC,generateQRModal:KC,chip:YC,dropZone:ZC,spinner:XC,learningPath:JC},tS={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é"},rS={ariaLabel:"Sélectionner la langue"},nS={errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},sS={nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},iS={detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},oS={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"},aS={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"},lS={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"},cS={dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},uS={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"},dS={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"},fS={shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},hS={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"},pS={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é."},mS={addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},gS={requiredError:"{field} est requis"},vS={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"},yS={requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},bS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},CS={requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},SS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},_S={requiredError:"{field} est requis"},wS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},xS={requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},TS={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"},ES={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"},AS={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"},IS={confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},kS={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"},DS={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"},LS={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"},OS={contentTypeFiltersAriaLabel:"Filtres par type de contenu"},NS={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é"},jS={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"},PS={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"},RS={contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},FS={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é"},MS={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"},BS={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."},qS={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."},$S={unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},US={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"},zS={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"},VS={closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},HS={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"},QS={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"},WS={remove:"Supprimer"},GS={dropHere:"Déposer ici"},KS={loading:"Chargement"},YS={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."},ZS={contextualEditor:tS,languageSelector:rS,collectionEditor:nS,breadcrumb:sS,tabBar:iS,contentEditForm:oS,titleAppIcon:aS,unitContentList:lS,contentRow:cS,csvUpload:uS,manageCollaborators:dS,sparkMetaForm:fS,appIconField:hS,appIconPickerModal:pS,chipGroupField:mS,dateTimeField:gS,dialcodeInputField:vS,keywordSuggestField:yS,licenseSelectField:bS,multiSelectField:CS,nestedSelectField:SS,radioField:_S,selectField:wS,textField:xS,assetBrowser:TS,resourceReorderDialog:ES,assignPageNumber:AS,confirmDialog:IS,publishChecklist:kS,qualityParamsModal:DS,unsavedChangesModal:LS,filterChips:OS,libraryCard:NS,libraryDock:jS,libraryFilterPanel:PS,libraryPreviewPanel:RS,outlineTree:FS,treeNode:MS,contentPlayer:BS,dialcodePanel:qS,progressStatus:$S,splitBuilderShell:US,topbar:zS,reviewCommentModal:VS,confirmReviewModal:HS,generateQRModal:QS,chip:WS,dropZone:GS,spinner:KS,learningPath:YS},XS={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"},JS={ariaLabel:"Selecionar idioma"},e_={errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},t_={nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},r_={detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},n_={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"},s_={selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},i_={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"},o_={dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},a_={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"},l_={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"},c_={shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},u_={requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},d_={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."},f_={addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},h_={requiredError:"{field} é obrigatório"},p_={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"},m_={requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},g_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},v_={requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},y_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},b_={requiredError:"{field} é obrigatório"},C_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},S_={requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},__={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"},w_={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"},x_={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"},T_={confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},E_={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"},A_={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"},I_={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"},k_={contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},D_={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"},L_={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"},O_={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"},N_={contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},j_={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"},P_={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"},R_={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."},F_={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."},M_={unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},B_={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"},q_={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"},$_={closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},U_={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"},z_={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"},V_={remove:"Remover"},H_={dropHere:"Solte aqui"},Q_={loading:"Carregando"},W_={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."},G_={contextualEditor:XS,languageSelector:JS,collectionEditor:e_,breadcrumb:t_,tabBar:r_,contentEditForm:n_,titleAppIcon:s_,unitContentList:i_,contentRow:o_,csvUpload:a_,manageCollaborators:l_,sparkMetaForm:c_,appIconField:u_,appIconPickerModal:d_,chipGroupField:f_,dateTimeField:h_,dialcodeInputField:p_,keywordSuggestField:m_,licenseSelectField:g_,multiSelectField:v_,nestedSelectField:y_,radioField:b_,selectField:C_,textField:S_,assetBrowser:__,resourceReorderDialog:w_,assignPageNumber:x_,confirmDialog:T_,publishChecklist:E_,qualityParamsModal:A_,unsavedChangesModal:I_,filterChips:k_,libraryCard:D_,libraryDock:L_,libraryFilterPanel:O_,libraryPreviewPanel:N_,outlineTree:j_,treeNode:P_,contentPlayer:R_,dialcodePanel:F_,progressStatus:M_,splitBuilderShell:B_,topbar:q_,reviewCommentModal:$_,confirmReviewModal:U_,generateQRModal:z_,chip:V_,dropZone:H_,spinner:Q_,learningPath:W_},K_=["ar"],Y_={en:Ma,ar:eS,fr:ZS,pt:G_};function $f(e,t){const r={...e};for(const n of Object.keys(t)){const s=e[n],i=t[n];s&&i&&typeof s=="object"&&typeof i=="object"&&!Array.isArray(s)&&!Array.isArray(i)?r[n]=$f(s,i):i!==void 0&&(r[n]=i)}return r}function Rc(e){const t=Y_[e];return!t||e==="en"?Ma:$f(Ma,t)}function Z_(e){return K_.includes(e)}const Ba="app-language",qa="app-language-change",Al=Xs(e=>({lang:"en",labelConfig:Rc("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:Rc(t)}),localStorage.setItem(Ba,t),document.documentElement.setAttribute("dir",Z_(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(qa,{detail:{lang:t}}))}}));function Uf(e,t){return function(){return e.apply(t,arguments)}}const{toString:X_}=Object.prototype,{getPrototypeOf:Xn}=Object,{iterator:Js,toStringTag:zf}=Symbol,Gi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Rs=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Gi(r,t))return!0;r=Xn(r)}return!1},J_=(e,t)=>e!=null&&Rs(e,t)?e[t]:void 0,Il=(e=>t=>{const r=X_.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),lr=e=>(e=e.toLowerCase(),t=>Il(t)===e),_o=e=>t=>typeof t===e,{isArray:mn}=Array,Jn=_o("undefined");function is(e){return e!==null&&!Jn(e)&&e.constructor!==null&&!Jn(e.constructor)&&Mt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Vf=lr("ArrayBuffer");function ew(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Vf(e.buffer),t}const tw=_o("string"),Mt=_o("function"),Hf=_o("number"),os=e=>e!==null&&typeof e=="object",rw=e=>e===!0||e===!1,Ei=e=>{if(!os(e))return!1;const t=Xn(e);return(t===null||t===Object.prototype||Xn(t)===null)&&!Rs(e,zf)&&!Rs(e,Js)},nw=e=>{if(!os(e)||is(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},sw=lr("Date"),iw=lr("File"),ow=e=>!!(e&&typeof e.uri<"u"),aw=e=>e&&typeof e.getParts<"u",lw=lr("Blob"),cw=lr("FileList"),uw=e=>os(e)&&Mt(e.pipe);function dw(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Fc=dw(),Mc=typeof Fc.FormData<"u"?Fc.FormData:void 0,fw=e=>{if(!e)return!1;if(Mc&&e instanceof Mc)return!0;const t=Xn(e);if(!t||t===Object.prototype||!Mt(e.append))return!1;const r=Il(e);return r==="formdata"||r==="object"&&Mt(e.toString)&&e.toString()==="[object FormData]"},hw=lr("URLSearchParams"),[pw,mw,gw,vw]=["ReadableStream","Request","Response","Headers"].map(lr),yw=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ei(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),mn(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(is(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function Qf(e,t){if(is(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const en=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wf=e=>!Jn(e)&&e!==en;function $a(...e){const{caseless:t,skipUndefined:r}=Wf(this)&&this||{},n={},s=(i,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const a=t&&typeof o=="string"&&Qf(n,o)||o,c=Gi(n,a)?n[a]:void 0;Ei(c)&&Ei(i)?n[a]=$a(c,i):Ei(i)?n[a]=$a({},i):mn(i)?n[a]=i.slice():(!r||!Jn(i))&&(n[a]=i)};for(let i=0,o=e.length;i<o;i++){const a=e[i];if(!a||is(a)||(ei(a,s),typeof a!="object"||mn(a)))continue;const c=Object.getOwnPropertySymbols(a);for(let u=0;u<c.length;u++){const d=c[u];Dw.call(a,d)&&s(a[d],d)}}return n}const bw=(e,t,r,{allOwnKeys:n}={})=>(ei(t,(s,i)=>{r&&Mt(s)?Object.defineProperty(e,i,{__proto__:null,value:Uf(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Cw=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Sw=(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)},_w=(e,t,r,n)=>{let s,i,o;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=r!==!1&&Xn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ww=(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},xw=e=>{if(!e)return null;if(mn(e))return e;let t=e.length;if(!Hf(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Tw=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xn(Uint8Array)),Ew=(e,t)=>{const n=(e&&e[Js]).call(e);let s;for(;(s=n.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Aw=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Iw=lr("HTMLFormElement"),kw=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:Dw}=Object.prototype,Lw=lr("RegExp"),Gf=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ei(r,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(n[i]=o||s)}),Object.defineProperties(e,n)},Ow=e=>{Gf(e,(t,r)=>{if(Mt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Mt(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+"'")})}})},Nw=(e,t)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return mn(e)?n(e):n(String(e).split(t)),r},jw=()=>{},Pw=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Rw(e){return!!(e&&Mt(e.append)&&e[zf]==="FormData"&&e[Js])}const Fw=e=>{const t=new WeakSet,r=n=>{if(os(n)){if(t.has(n))return;if(is(n))return n;if(!("toJSON"in n)){t.add(n);const s=mn(n)?[]:{};return ei(n,(i,o)=>{const a=r(i);!Jn(a)&&(s[o]=a)}),t.delete(n),s}}return n};return r(e)},Mw=lr("AsyncFunction"),Bw=e=>e&&(os(e)||Mt(e))&&Mt(e.then)&&Mt(e.catch),Kf=((e,t)=>e?setImmediate:t?((r,n)=>(en.addEventListener("message",({source:s,data:i})=>{s===en&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),en.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Mt(en.postMessage)),qw=typeof queueMicrotask<"u"?queueMicrotask.bind(en):typeof process<"u"&&process.nextTick||Kf,Yf=e=>e!=null&&Mt(e[Js]),$w=e=>e!=null&&Rs(e,Js)&&Yf(e),I={isArray:mn,isArrayBuffer:Vf,isBuffer:is,isFormData:fw,isArrayBufferView:ew,isString:tw,isNumber:Hf,isBoolean:rw,isObject:os,isPlainObject:Ei,isEmptyObject:nw,isReadableStream:pw,isRequest:mw,isResponse:gw,isHeaders:vw,isUndefined:Jn,isDate:sw,isFile:iw,isReactNativeBlob:ow,isReactNative:aw,isBlob:lw,isRegExp:Lw,isFunction:Mt,isStream:uw,isURLSearchParams:hw,isTypedArray:Tw,isFileList:cw,forEach:ei,merge:$a,extend:bw,trim:yw,stripBOM:Cw,inherits:Sw,toFlatObject:_w,kindOf:Il,kindOfTest:lr,endsWith:ww,toArray:xw,forEachEntry:Ew,matchAll:Aw,isHTMLForm:Iw,hasOwnProperty:Gi,hasOwnProp:Gi,hasOwnInPrototypeChain:Rs,getSafeProp:J_,reduceDescriptors:Gf,freezeMethods:Ow,toObjectSet:Nw,toCamelCase:kw,noop:jw,toFiniteNumber:Pw,findKey:Qf,global:en,isContextDefined:Wf,isSpecCompliantForm:Rw,toJSONObject:Fw,isAsyncFn:Mw,isThenable:Bw,setImmediate:Kf,asap:qw,isIterable:Yf,isSafeIterable:$w},Uw=I.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"]),zw=e=>{const t={};let r,n,s;return e&&e.split(`
529
+ `).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||t[r]&&Uw[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function Vw(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 Hw=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Qw=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function kl(e,t){return I.isArray(e)?e.map(r=>kl(r,t)):Vw(String(e).replace(t,""))}const Ww=e=>kl(e,Hw),Gw=e=>kl(e,Qw);function Zf(e){const t=Object.create(null);return I.forEach(e.toJSON(),(r,n)=>{t[n]=Gw(r)}),t}const Bc=Symbol("internals");function hs(e){return e&&String(e).trim().toLowerCase()}function Ai(e){return e===!1||e==null?e:I.isArray(e)?e.map(Ai):Ww(String(e))}function Kw(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 Yw=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Vo(e,t,r,n,s){if(I.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!I.isString(t)){if(I.isString(n))return t.indexOf(n)!==-1;if(I.isRegExp(n))return n.test(t)}}function Zw(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Xw(e,t){const r=I.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,i,o){return this[n].call(this,t,s,i,o)},configurable:!0})})}let It=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function i(a,c,u){const d=hs(c);if(!d)return;const f=I.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=Ai(a))}const o=(a,c)=>I.forEach(a,(u,d)=>i(u,d,c));if(I.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(I.isString(t)&&(t=t.trim())&&!Yw(t))o(zw(t),r);else if(I.isObject(t)&&I.isSafeIterable(t)){let a=Object.create(null),c,u;for(const d of t){if(!I.isArray(d))throw new TypeError("Object iterator must return a key-value pair");u=d[0],I.hasOwnProp(a,u)?(c=a[u],a[u]=I.isArray(c)?[...c,d[1]]:[c,d[1]]):a[u]=d[1]}o(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=hs(t),t){const n=I.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Kw(s);if(I.isFunction(r))return r.call(this,s,n);if(I.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=hs(t),t){const n=I.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Vo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function i(o){if(o=hs(o),o){const a=I.findKey(n,o);a&&(!r||Vo(n,n[a],a,r))&&(delete n[a],s=!0)}}return I.isArray(t)?t.forEach(i):i(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!t||Vo(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const r=this,n={};return I.forEach(this,(s,i)=>{const o=I.findKey(n,i);if(o){r[o]=Ai(s),delete r[i];return}const a=t?Zw(i):String(i).trim();a!==i&&delete r[i],r[a]=Ai(s),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return I.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&I.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[Bc]=this[Bc]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=hs(o);n[a]||(Xw(s,o),n[a]=!0)}return I.isArray(t)?t.forEach(i):i(t),this}};It.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(It.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});I.freezeMethods(It);const Jw="[REDACTED ****]";function ex(e){if(I.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(I.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function tx(e,t){const r=new Set(t.map(i=>String(i).toLowerCase())),n=[],s=i=>{if(i===null||typeof i!="object"||I.isBuffer(i))return i;if(n.indexOf(i)!==-1)return;i instanceof It&&(i=i.toJSON()),n.push(i);let o;if(I.isArray(i))o=[],i.forEach((a,c)=>{const u=s(a);I.isUndefined(u)||(o[c]=u)});else{if(!I.isPlainObject(i)&&ex(i))return n.pop(),i;o=Object.create(null);for(const[a,c]of Object.entries(i)){const u=r.has(a.toLowerCase())?Jw:s(c);I.isUndefined(u)||(o[a]=u)}}return n.pop(),o};return s(e)}let J=class Xf extends Error{static from(t,r,n,s,i,o){const a=new Xf(t.message,r||t.code,n,s,i);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),o&&Object.assign(a,o),a}constructor(t,r,n,s,i){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),i&&(this.response=i,this.status=i.status)}toJSON(){const t=this.config,r=t&&I.hasOwnProp(t,"redact")?t.redact:void 0,n=I.isArray(r)&&r.length>0?tx(t,r):I.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 rx=null,Jf=100;function Ua(e){return I.isPlainObject(e)||I.isArray(e)}function eh(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function Ho(e,t,r){return e?e.concat(t).map(function(s,i){return s=eh(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function nx(e){return I.isArray(e)&&!e.some(Ua)}const sx=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function wo(e,t,r){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!I.isUndefined(S[C])});const n=r.metaTokens,s=r.visitor||b,i=r.dots,o=r.indexes,a=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?Jf:r.maxDepth,u=a&&I.isSpecCompliantForm(t),d=[];if(!I.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(I.isDate(y))return y.toISOString();if(I.isBoolean(y))return y.toString();if(!u&&I.isBlob(y))throw new J("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(y)||I.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function g(y){if(y>c)throw new J("Object is too deeply nested ("+y+" levels). Max depth: "+c,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(y,C){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(x,E){if(!I.isObject(E))return E;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(E),g(C+S.length-1),E})}function b(y,C,S){let _=y;if(I.isReactNative(t)&&I.isReactNativeBlob(y))return t.append(Ho(S,C,i),f(y)),!1;if(y&&!S&&typeof y=="object"){if(I.endsWith(C,"{}"))C=n?C:C.slice(0,-2),y=p(y,1);else if(I.isArray(y)&&nx(y)||(I.isFileList(y)||I.endsWith(C,"[]"))&&(_=I.toArray(y)))return C=eh(C),_.forEach(function(E,D){!(I.isUndefined(E)||E===null)&&t.append(o===!0?Ho([C],D,i):o===null?C:C+"[]",f(E))}),!1}return Ua(y)?!0:(t.append(Ho(S,C,i),f(y)),!1)}const h=Object.assign(sx,{defaultVisitor:b,convertValue:f,isVisitable:Ua});function v(y,C,S=0){if(!I.isUndefined(y)){if(g(S),d.indexOf(y)!==-1)throw new Error("Circular reference detected in "+C.join("."));d.push(y),I.forEach(y,function(x,E){(!(I.isUndefined(x)||x===null)&&s.call(t,x,I.isString(E)?E.trim():E,C,h))===!0&&v(x,C?C.concat(E):[E],S+1)}),d.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return v(e),t}function qc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Dl(e,t){this._pairs=[],e&&wo(e,this,t)}const th=Dl.prototype;th.append=function(t,r){this._pairs.push([t,r])};th.toString=function(t){const r=t?function(n){return t.call(this,n,qc)}:qc;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function ix(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rh(e,t,r){if(!t)return e;const n=I.isFunction(r)?{serialize:r}:r,s=I.getSafeProp(n,"encode")||ix,i=I.getSafeProp(n,"serialize");let o;if(i?o=i(t,n):o=I.isURLSearchParams(t)?t.toString():new Dl(t,n).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class $c{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){I.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ll={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ox=typeof URLSearchParams<"u"?URLSearchParams:Dl,ax=typeof FormData<"u"?FormData:null,lx=typeof Blob<"u"?Blob:null,cx={isBrowser:!0,classes:{URLSearchParams:ox,FormData:ax,Blob:lx},protocols:["http","https","file","blob","url","data"]},Ol=typeof window<"u"&&typeof document<"u",za=typeof navigator=="object"&&navigator||void 0,ux=Ol&&(!za||["ReactNative","NativeScript","NS"].indexOf(za.product)<0),dx=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fx=Ol&&window.location.href||"http://localhost",hx=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ol,hasStandardBrowserEnv:ux,hasStandardBrowserWebWorkerEnv:dx,navigator:za,origin:fx},Symbol.toStringTag,{value:"Module"})),bt={...hx,...cx};function px(e,t){return wo(e,new bt.classes.URLSearchParams,{visitor:function(r,n,s,i){return bt.isNode&&I.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}const Uc=Jf;function nh(e){if(e>Uc)throw new J("FormData field is too deeply nested ("+e+" levels). Max depth: "+Uc,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function mx(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)nh(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function gx(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function sh(e){function t(r,n,s,i){nh(i);let o=r[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=r.length;return o=!o&&I.isArray(s)?s.length:o,c?(I.hasOwnProp(s,o)?s[o]=I.isArray(s[o])?s[o].concat(n):[s[o],n]:s[o]=n,!a):((!I.hasOwnProp(s,o)||!I.isObject(s[o]))&&(s[o]=[]),t(r,n,s[o],i)&&I.isArray(s[o])&&(s[o]=gx(s[o])),!a)}if(I.isFormData(e)&&I.isFunction(e.entries)){const r={};return I.forEachEntry(e,(n,s)=>{t(mx(n),s,r,0)}),r}return null}const xn=(e,t)=>e!=null&&I.hasOwnProp(e,t)?e[t]:void 0;function vx(e,t,r){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ti={transitional:Ll,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=I.isObject(t);if(i&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return s?JSON.stringify(sh(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){const c=xn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return px(t,c).toString();if((a=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=xn(this,"env"),d=u&&u.FormData;return wo(a?{"files[]":t}:t,d&&new d,c)}}return i||s?(r.setContentType("application/json",!1),vx(t)):t}],transformResponse:[function(t){const r=xn(this,"transitional")||ti.transitional,n=r&&r.forcedJSONParsing,s=xn(this,"responseType"),i=s==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(n&&!s||i)){const a=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,xn(this,"parseReviver"))}catch(c){if(a)throw c.name==="SyntaxError"?J.from(c,J.ERR_BAD_RESPONSE,this,null,xn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch","query"],e=>{ti.headers[e]={}});function Qo(e,t){const r=this||ti,n=t||r,s=It.from(n.headers);let i=n.data;return I.forEach(e,function(a){i=a.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ih(e){return!!(e&&e.__CANCEL__)}let ri=class extends J{constructor(t,r,n){super(t??"canceled",J.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function oh(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 yx(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function bx(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[i];o||(o=u),r[s]=c,n[s]=u;let f=i,g=0;for(;f!==s;)g+=r[f++],f=f%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const p=d&&u-d;return p?Math.round(g*1e3/p):void 0}}function Cx(e,t){let r=0,n=1e3/t,s,i;const o=(u,d=Date.now())=>{r=d,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?o(u,d):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},n-f)))},()=>s&&o(s)]}const Ki=(e,t,r=3)=>{let n=0;const s=bx(50,250);return Cx(i=>{if(!i||typeof i.loaded!="number")return;const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=a!=null?Math.min(o,a):o,u=Math.max(0,c-n),d=s(u);n=Math.max(n,c);const f={loaded:c,total:a,progress:a?c/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a?(a-c)/d:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},r)},zc=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Vc=e=>(...t)=>I.asap(()=>e(...t)),Sx=bt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,bt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,_x=bt.hasStandardBrowserEnv?{write(e,t,r,n,s,i,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),I.isString(n)&&a.push(`path=${n}`),I.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),I.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.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 wx(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xx(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Tx=/^https?:(?!\/\/)/i,Ex=/[\t\n\r]/g;function Ax(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Ix(e){return Ax(e).replace(Ex,"")}function Hc(e,t){if(typeof e=="string"&&Tx.test(Ix(e)))throw new J('Invalid URL: missing "//" after protocol',J.ERR_INVALID_URL,t)}function ah(e,t,r,n){Hc(t,n);let s=!wx(t);return e&&(s||r===!1)?(Hc(e,n),xx(e,t)):t}const Qc=e=>e instanceof It?{...e}:e;function gn(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(d,f,g,p){return I.isPlainObject(d)&&I.isPlainObject(f)?I.merge.call({caseless:p},d,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function s(d,f,g,p){if(I.isUndefined(f)){if(!I.isUndefined(d))return n(void 0,d,g,p)}else return n(d,f,g,p)}function i(d,f){if(!I.isUndefined(f))return n(void 0,f)}function o(d,f){if(I.isUndefined(f)){if(!I.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function a(d){const f=I.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!I.isUndefined(f))if(I.isPlainObject(f)){if(I.hasOwnProp(f,d))return f[d]}else return;const g=I.hasOwnProp(e,"transitional")?e.transitional:void 0;if(I.isPlainObject(g)&&I.hasOwnProp(g,d))return g[d]}function c(d,f,g){if(I.hasOwnProp(t,g))return n(d,f);if(I.hasOwnProp(e,g))return n(void 0,d)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(d,f,g)=>s(Qc(d),Qc(f),g,!0)};return I.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const g=I.hasOwnProp(u,f)?u[f]:s,p=I.hasOwnProp(e,f)?e[f]:void 0,b=I.hasOwnProp(t,f)?t[f]:void 0,h=g(p,b,f);I.isUndefined(h)&&g!==c||(r[f]=h)}),I.hasOwnProp(t,"validateStatus")&&I.isUndefined(t.validateStatus)&&a("validateStatusUndefinedResolves")===!1&&(I.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const kx=["content-type","content-length"];function Dx(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{kx.includes(n.toLowerCase())&&e.set(n,s)})}const Lx=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function lh(e){const t=gn({},e),r=g=>I.hasOwnProp(t,g)?t[g]:void 0,n=r("data");let s=r("withXSRFToken");const i=r("xsrfHeaderName"),o=r("xsrfCookieName");let a=r("headers");const c=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(t.headers=a=It.from(a),t.url=rh(ah(u,f,d,t),r("params"),r("paramsSerializer")),c){const g=I.getSafeProp(c,"username")||"",p=I.getSafeProp(c,"password")||"";a.set("Authorization","Basic "+btoa(g+":"+(p?Lx(p):"")))}if(I.isFormData(n)&&(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv||I.isReactNative(n)?a.setContentType(void 0):I.isFunction(n.getHeaders)&&Dx(a,n.getHeaders(),r("formDataHeaderPolicy"))),bt.hasStandardBrowserEnv&&(I.isFunction(s)&&(s=s(t)),s===!0||s==null&&Sx(t.url))){const p=i&&o&&_x.read(o);p&&a.set(i,p)}return t}const Ox=typeof XMLHttpRequest<"u",Nx=Ox&&function(e){return new Promise(function(r,n){const s=lh(e);let i=s.data;const o=It.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=s,d,f,g,p,b;function h(){p&&p(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=It.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};oh(function(D){r(D),h()},function(D){n(D),h()},x),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(_){const x=_&&_.message?_.message:"Network Error",E=new J(x,J.ERR_NETWORK,e,v);E.event=_||null,n(E),h(),v=null},v.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const x=s.transitional||Ll;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),n(new J(_,x.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,v)),h(),v=null},i===void 0&&o.setContentType(null),"setRequestHeader"in v&&I.forEach(Zf(o),function(_,x){v.setRequestHeader(x,_)}),I.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),u&&([g,b]=Ki(u,!0),v.addEventListener("progress",g)),c&&v.upload&&([f,p]=Ki(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(d=S=>{v&&(n(!S||S.type?new ri(null,e,v):S),v.abort(),h(),v=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const C=yx(s.url);if(C&&!bt.protocols.includes(C)){n(new J("Unsupported protocol "+C+":",J.ERR_BAD_REQUEST,e));return}v.send(i||null)})},jx=(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,o();const u=c instanceof Error?c:this.reason;r.abort(u instanceof J?u:new ri(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new J(`timeout of ${t}ms exceeded`,J.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>I.asap(o),a},Px=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},Rx=async function*(e,t){for await(const r of Fx(e))yield*Px(r,t)},Fx=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()}},Wc=(e,t,r,n)=>{const s=Rx(e,t);let i=0,o,a=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){a(),c.close();return}let f=d.byteLength;if(r){let g=i+=f;r(g)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Yi=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Mx=(e,t,r)=>t+2<r&&Yi(e.charCodeAt(t+1))&&Yi(e.charCodeAt(t+2));function Bx(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 o=n.length;const a=n.length;for(let p=0;p<a;p++)if(n.charCodeAt(p)===37&&p+2<a){const b=n.charCodeAt(p+1),h=n.charCodeAt(p+2);Yi(b)&&Yi(h)&&(o-=2,p+=2)}let c=0,u=a-1;const d=p=>p>=2&&n.charCodeAt(p-2)===37&&n.charCodeAt(p-1)===51&&(n.charCodeAt(p)===68||n.charCodeAt(p)===100);u>=0&&(n.charCodeAt(u)===61?(c++,u--):d(u)&&(c++,u-=3)),c===1&&u>=0&&(n.charCodeAt(u)===61||d(u))&&c++;const g=Math.floor(o/4)*3-(c||0);return g>0?g:0}let i=0;for(let o=0,a=n.length;o<a;o++){const c=n.charCodeAt(o);if(c===37&&Mx(n,o,a))i+=1,o+=2;else if(c<128)i+=1;else if(c<2048)i+=2;else if(c>=55296&&c<=56319&&o+1<a){const u=n.charCodeAt(o+1);u>=56320&&u<=57343?(i+=4,o++):i+=3}else i+=3}return i}const Nl="1.18.0",Gc=64*1024,{isFunction:hi}=I,qx=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Kc=e=>{if(!I.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Yc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$x=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},Ux=e=>{const t=I.global!==void 0&&I.global!==null?I.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=I.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:i,Response:o}=e,a=s?hi(s):typeof fetch=="function",c=hi(i),u=hi(o);if(!a)return!1;const d=a&&hi(r),f=a&&(typeof n=="function"?(y=>C=>y.encode(C))(new n):async y=>new Uint8Array(await new i(y).arrayBuffer())),g=c&&d&&Yc(()=>{let y=!1;const C=new i(bt.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),y&&!S}),p=u&&d&&Yc(()=>I.isReadableStream(new o("").body)),b={stream:p&&(y=>y.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!b[y]&&(b[y]=(C,S)=>{let _=C&&C[y];if(_)return _.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(I.isBlob(y))return y.size;if(I.isSpecCompliantForm(y))return(await new i(bt.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(I.isArrayBufferView(y)||I.isArrayBuffer(y))return y.byteLength;if(I.isURLSearchParams(y)&&(y=y+""),I.isString(y))return(await f(y)).byteLength},v=async(y,C)=>{const S=I.toFiniteNumber(y.getContentLength());return S??h(C)};return async y=>{let{url:C,method:S,data:_,signal:x,cancelToken:E,timeout:D,onDownloadProgress:T,onUploadProgress:j,responseType:F,headers:O,withCredentials:N="same-origin",fetchOptions:B,maxContentLength:P,maxBodyLength:U}=lh(y);const ne=I.isNumber(P)&&P>-1,H=I.isNumber(U)&&U>-1,te=M=>I.hasOwnProp(y,M)?y[M]:void 0;let he=s||fetch;F=F?(F+"").toLowerCase():"text";let oe=jx([x,E&&E.toAbortSignal()],D),ge=null;const ve=oe&&oe.unsubscribe&&(()=>{oe.unsubscribe()});let xe,ye=null;const R=()=>new J("Request body larger than maxBodyLength limit",J.ERR_BAD_REQUEST,y,ge);try{let M;const Y=te("auth");if(Y){const ee=I.getSafeProp(Y,"username")||"",He=I.getSafeProp(Y,"password")||"";M={username:ee,password:He}}if($x(C)){const ee=new URL(C,bt.origin);if(!M&&(ee.username||ee.password)){const He=Kc(ee.username),Ge=Kc(ee.password);M={username:He,password:Ge}}(ee.username||ee.password)&&(ee.username="",ee.password="",C=ee.href)}if(M&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa(qx((M.username||"")+":"+(M.password||""))))),ne&&typeof C=="string"&&C.startsWith("data:")&&Bx(C)>P)throw new J("maxContentLength size of "+P+" exceeded",J.ERR_BAD_RESPONSE,y,ge);if(H&&S!=="get"&&S!=="head"){const ee=await h(_);if(typeof ee=="number"&&isFinite(ee)&&(xe=ee,ee>U))throw R()}const le=H&&(I.isReadableStream(_)||I.isStream(_)),Ce=(ee,He,Ge)=>Wc(ee,Gc,Ze=>{if(H&&Ze>U)throw ye=R();He&&He(Ze)},Ge);if(g&&S!=="get"&&S!=="head"&&(j||le)){if(xe=xe??await v(O,_),xe!==0||le){let ee=new i(C,{method:"POST",body:_,duplex:"half"}),He;if(I.isFormData(_)&&(He=ee.headers.get("content-type"))&&O.setContentType(He),ee.body){const[Ge,Ze]=j&&zc(xe,Ki(Vc(j)))||[];_=Ce(ee.body,Ge,Ze)}}}else if(le&&!c&&d&&S!=="get"&&S!=="head")_=Ce(_);else if(le&&c&&!g&&S!=="get"&&S!=="head")throw new J("Stream request bodies are not supported by the current fetch implementation",J.ERR_NOT_SUPPORT,y,ge);I.isString(N)||(N=N?"include":"omit");const de=c&&"credentials"in i.prototype;if(I.isFormData(_)){const ee=O.getContentType();ee&&/^multipart\/form-data/i.test(ee)&&!/boundary=/i.test(ee)&&O.delete("content-type")}O.set("User-Agent","axios/"+Nl,!1);const ce={...B,signal:oe,method:S.toUpperCase(),headers:Zf(O.normalize()),body:_,duplex:"half",credentials:de?N:void 0};ge=c&&new i(C,ce);let Q=await(c?he(ge,B):he(C,ce));const se=It.from(Q.headers);if(ne){const ee=I.toFiniteNumber(se.getContentLength());if(ee!=null&&ee>P)throw new J("maxContentLength size of "+P+" exceeded",J.ERR_BAD_RESPONSE,y,ge)}const Te=p&&(F==="stream"||F==="response");if(p&&Q.body&&(T||ne||Te&&ve)){const ee={};["status","statusText","headers"].forEach(st=>{ee[st]=Q[st]});const He=I.toFiniteNumber(se.getContentLength()),[Ge,Ze]=T&&zc(He,Ki(Vc(T),!0))||[];let Qe=0;const tt=st=>{if(ne&&(Qe=st,Qe>P))throw new J("maxContentLength size of "+P+" exceeded",J.ERR_BAD_RESPONSE,y,ge);Ge&&Ge(st)};Q=new o(Wc(Q.body,Gc,tt,()=>{Ze&&Ze(),ve&&ve()}),ee)}F=F||"text";let me=await b[I.findKey(b,F)||"text"](Q,y);if(ne&&!p&&!Te){let ee;if(me!=null&&(typeof me.byteLength=="number"?ee=me.byteLength:typeof me.size=="number"?ee=me.size:typeof me=="string"&&(ee=typeof n=="function"?new n().encode(me).byteLength:me.length)),typeof ee=="number"&&ee>P)throw new J("maxContentLength size of "+P+" exceeded",J.ERR_BAD_RESPONSE,y,ge)}return!Te&&ve&&ve(),await new Promise((ee,He)=>{oh(ee,He,{data:me,headers:It.from(Q.headers),status:Q.status,statusText:Q.statusText,config:y,request:ge})})}catch(M){if(ve&&ve(),oe&&oe.aborted&&oe.reason instanceof J){const Y=oe.reason;throw Y.config=y,ge&&(Y.request=ge),M!==Y&&(Y.cause=M),Y}throw ye?(ge&&!ye.request&&(ye.request=ge),ye):M instanceof J?(ge&&!M.request&&(M.request=ge),M):M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,y,ge,M&&M.response),{cause:M.cause||M}):J.from(M,M&&M.code,y,ge,M&&M.response)}}},zx=new Map,ch=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,i=[n,s,r];let o=i.length,a=o,c,u,d=zx;for(;a--;)c=i[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:Ux(t)),d=u;return u};ch();const jl={http:rx,xhr:Nx,fetch:{get:ch}};I.forEach(jl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Zc=e=>`- ${e}`,Vx=e=>I.isFunction(e)||e===null||e===!1;function Hx(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let n,s;const i={};for(let o=0;o<r;o++){n=e[o];let a;if(s=n,!Vx(n)&&(s=jl[(a=String(n)).toLowerCase()],s===void 0))throw new J(`Unknown adapter '${a}'`);if(s&&(I.isFunction(s)||(s=s.get(t))))break;i[a||"#"+o]=s}if(!s){const o=Object.entries(i).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=r?o.length>1?`since :
531
+ `+o.map(Zc).join(`
532
+ `):" "+Zc(o[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const uh={getAdapter:Hx,adapters:jl};function Wo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ri(null,e)}function Xc(e){return Wo(e),e.headers=It.from(e.headers),e.data=Qo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),uh.getAdapter(e.adapter||ti.adapter,e)(e).then(function(n){Wo(e),e.response=n;try{n.data=Qo.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=It.from(n.headers),n},function(n){if(!ih(n)&&(Wo(e),n&&n.response)){e.response=n.response;try{n.response.data=Qo.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=It.from(n.response.headers)}return Promise.reject(n)})}const xo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{xo[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Jc={};xo.transitional=function(t,r,n){function s(i,o){return"[Axios v"+Nl+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,a)=>{if(t===!1)throw new J(s(o," has been removed"+(r?" in "+r:"")),J.ERR_DEPRECATED);return r&&!Jc[o]&&(Jc[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,a):!0}};xo.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Qx(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 i=n[s],o=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(o){const a=e[i],c=a===void 0||o(a,i,e);if(c!==!0)throw new J("option "+i+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new J("Unknown option "+i,J.ERR_BAD_OPTION)}}const Ii={assertOptions:Qx,validators:xo},St=Ii.validators;let hn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new $c,response:new $c}}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 i=(()=>{if(!s.stack)return"";const o=s.stack.indexOf(`
533
+ `);return o===-1?"":s.stack.slice(o+1)})();try{if(!n.stack)n.stack=i;else if(i){const o=i.indexOf(`
534
+ `),a=o===-1?-1:i.indexOf(`
535
+ `,o+1),c=a===-1?"":i.slice(a+1);String(n.stack).endsWith(c)||(n.stack+=`
536
+ `+i)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=gn(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&Ii.assertOptions(n,{silentJSONParsing:St.transitional(St.boolean),forcedJSONParsing:St.transitional(St.boolean),clarifyTimeoutError:St.transitional(St.boolean),legacyInterceptorReqResOrdering:St.transitional(St.boolean),advertiseZstdAcceptEncoding:St.transitional(St.boolean),validateStatusUndefinedResolves:St.transitional(St.boolean)},!1),s!=null&&(I.isFunction(s)?r.paramsSerializer={serialize:s}:Ii.assertOptions(s,{encode:St.function,serialize:St.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Ii.assertOptions(r,{baseUrl:St.spelling("baseURL"),withXsrfToken:St.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&I.merge(i.common,i[r.method]);i&&I.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete i[b]}),r.headers=It.concat(o,i);const a=[];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||Ll;v&&v.legacyInterceptorReqResOrdering?a.unshift(h.fulfilled,h.rejected):a.push(h.fulfilled,h.rejected)});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,g;if(!c){const b=[Xc.bind(this),void 0];for(b.unshift(...a),b.push(...u),g=b.length,d=Promise.resolve(r);f<g;)d=d.then(b[f++],b[f++]);return d}g=a.length;let p=r;for(;f<g;){const b=a[f++],h=a[f++];try{p=b(p)}catch(v){h.call(this,v);break}}try{d=Xc.call(this,p)}catch(b){return Promise.reject(b)}for(f=0,g=u.length;f<g;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=gn(this.defaults,t);const r=ah(t.baseURL,t.url,t.allowAbsoluteUrls,t);return rh(r,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){hn.prototype[t]=function(r,n){return this.request(gn(n||{},{method:t,url:r,data:n&&I.hasOwnProp(n,"data")?n.data:void 0}))}});I.forEach(["post","put","patch","query"],function(t){function r(n){return function(i,o,a){return this.request(gn(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}hn.prototype[t]=r(),t!=="query"&&(hn.prototype[t+"Form"]=r(!0))});let Wx=class dh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{n.subscribe(a),i=a}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,a){n.reason||(n.reason=new ri(i,o,a),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 dh(function(s){t=s}),cancel:t}}};function Gx(e){return function(r){return e.apply(null,r)}}function Kx(e){return I.isObject(e)&&e.isAxiosError===!0}const Va={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(Va).forEach(([e,t])=>{Va[t]=e});function fh(e){const t=new hn(e),r=Uf(hn.prototype.request,t);return I.extend(r,hn.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return fh(gn(e,s))},r}const rt=fh(ti);rt.Axios=hn;rt.CanceledError=ri;rt.CancelToken=Wx;rt.isCancel=ih;rt.VERSION=Nl;rt.toFormData=wo;rt.AxiosError=J;rt.Cancel=rt.CanceledError;rt.all=function(t){return Promise.all(t)};rt.spread=Gx;rt.isAxiosError=Kx;rt.mergeConfig=gn;rt.AxiosHeaders=It;rt.formToJSON=e=>sh(I.isHTMLForm(e)?new FormData(e):e);rt.getAdapter=uh.getAdapter;rt.HttpStatusCode=Va;rt.default=rt;const{Axios:Nq,AxiosError:jq,CanceledError:Pq,isCancel:Rq,CancelToken:Fq,VERSION:Mq,all:Bq,Cancel:qq,isAxiosError:$q,spread:Uq,toFormData:zq,AxiosHeaders:Vq,HttpStatusCode:Hq,formToJSON:Qq,getAdapter:Wq,mergeConfig:Gq,create:Kq}=rt;let Ha="";function hh(e){Ha=e}const Re=rt.create({timeout:3e4});Re.interceptors.request.use(async e=>{var s;const{useEditorStore:t}=await Promise.resolve().then(()=>ab),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),Ha&&(e.baseURL=Ha),e});const ph="/portal";async function mh(e){var n,s,i,o,a,c,u;const t=await Re.get(`${ph}/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 d=((o=(i=t.data)==null?void 0:i.params)==null?void 0:o.errmsg)||((c=(a=t.data)==null?void 0:a.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${d}`)}return r}async function Yx(e){var r,n;return e.length?((n=(r=(await Re.post(`${ph}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function To(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",i=r.mimeType??"",o=r.children,a=Array.isArray(o)?o.map(u=>To(u,n)):[],c=i==="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"||i==="application/vnd.sunbird.questionset"&&a.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:a,metadata:r,parent:t}}async function gh(e){var s,i,o,a,c,u,d;const t=await Re.get(`/action/content/v3/hierarchy/${e}`,{params:{mode:"edit"}}),r=(i=(s=t.data)==null?void 0:s.result)==null?void 0:i.content;if(!r||!r.identifier){const f=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((u=(c=t.data)==null?void 0:c.params)==null?void 0:u.err)||((d=t.data)==null?void 0:d.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=To(r);return{content:r,rootNode:n}}async function Zx(e){const t=await mh(e),r=To(t);return{content:t,rootNode:r}}async function Xx(e,t,r,n){var i;return((i=(await Re.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:i.result)??{}}async function Jx(e,t=""){await Re.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function vh(e){var n,s,i,o,a,c,u;const t=await Re.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 d=((o=(i=t.data)==null?void 0:i.params)==null?void 0:o.errmsg)||((c=(a=t.data)==null?void 0:a.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${d}`)}return r}async function e1(e){var r,n;return(n=(r=(await Re.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function t1(e){await Re.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function r1(e,t){await Re.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function n1(e,t){await Re.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const s1="application/vnd.sunbird.questionset";function yh(e){let t=!1,r=!0;function n(s){for(const i of s){const o=i.children??[];if(o.length>0){n(o);continue}t=!0,i.objectType==="QuestionSet"&&i.mimeType===s1||(r=!1)}}return n(e.children??[]),t&&r}const eu=new Map;async function bh(e){const t=eu.get(e);if(t)return t;const r=await vh(e),{children:n,...s}=r??{},i={qualifies:yh(r),meta:s};return eu.set(e,i),i}async function Ch(e){return(await bh(e)).qualifies}async function i1(e){var n;const t=e.children??[],r=[];for(let s=0;s<t.length;s++){const i=t[s],o=i.children??[],a=[];for(const c of o){let u=!!((n=c.metadata)!=null&&n.isAssessmentCourse);if(!u){if((c.children??[]).length>0)u=yh(c);else if(o.length===1&&(s===0||s===t.length-1))try{u=await Ch(c.identifier)}catch(d){console.error("[lpStructure] assessment-course check failed on load:",d)}}a.push({...c,isFolder:!1,children:[],metadata:{...c.metadata??{},...u?{isAssessmentCourse:!0}:{}}})}r.push({...i,children:a})}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 o1(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function a1(e,t){const r=e.findIndex(s=>s.id===t);return r===-1?null:Zi(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((s,i)=>!Zi(e,i)).length}}function Fs(e,t){return t==="pre"?e.length>0&&lt(e[0]):e.length>1&&lt(e[e.length-1])}function Zi(e,t){const r=o1(t,e.length,lt(e[t]));return r==="pre"||r==="post"}function Qa(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&Zi(e,r)}function l1(e){return Fs(e,"pre")?Fs(e,"post")?null:"post":"pre"}function c1(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 i=[...e],[o]=i.splice(t,1);return i.splice(r,0,o),!(n&&i[0]!==n||s&&i[i.length-1]!==s)}function tu(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(s=>{var i;return!!((i=s.metadata)!=null&&i.isAssessmentCourse)}):!0}function Xi(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function Sh(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 _h(e,t){return!!Sh(e,t)}function u1(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((s,i)=>{var o,a;Zi(n,i)?Xi((o=s.children[0].metadata)==null?void 0:o[t]).forEach(c=>r.add(c)):Xi((a=s.metadata)==null?void 0:a[t]).forEach(c=>r.add(c))}),Array.from(r)}const wh=new Set(["Diagnostic","PriorLearning"]);function d1(e,t,r){var p,b,h;const n=[];if(!e)return n;const s=(p=e.metadata)==null?void 0:p.policy;s||n.push({code:"policyMissing",message:"Set a consumption policy for this path."});const i=e.children??[],o=i[0],a=i.length>1?i[i.length-1]:void 0,c=lt(o),u=lt(a);!c&&s&&wh.has(s)&&n.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive/Prior learning policy."}),u||n.push({code:"outcomeAssessmentMissing",message:"Add an Outcome Assessment to close the path."}),[[o,"Prior Assessment"],[a,"Outcome Assessment"]].forEach(([v,y])=>{var S,_;if(!v)return;const C=v.children??[];(C.length!==1||!((_=(S=C[0])==null?void 0:S.metadata)!=null&&_.isAssessmentCourse))&&n.push({code:"slotNotPure",nodeId:v.id,message:`${y} must contain exactly one question-set-only course.`})});const d=new Set,f=(v,y)=>{d.has(v)&&n.push({code:"duplicateCourse",nodeId:y,message:"A course appears more than once in this path."}),d.add(v)},g=i.slice(c?1:0,i.length-(u?1:0));c&&f(o.children[0].id,o.id),u&&f(a.children[0].id,a.id);for(const v of g){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?Xi((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(_=>!r.includes(_));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?Xi((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 f1(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[i,o]of[[n,"Prior Assessment"],[s,"Outcome Assessment"]]){if(!i||!lt(i))continue;const a=i.children[0].id;await Ch(a)||t.push({code:"slotCourseChanged",nodeId:i.id,message:`${o}'s course is no longer question-set-only — pick a different course.`})}return t}function Pt(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 xh(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 i=xh(s.children,t,r+1);if(i>=0)return i}}return-1}const ru=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function Th(e,t,r,n){return e.map(s=>{if(s.id===t){const i=r.metadata??{},o=n!=null&&n.length?new Set([...ru,...n]):ru,a={};for(const c of o)c in r&&(a[c]=r[c]);return{...s,...r,metadata:{...s.metadata??{},...a,...i}}}return s.children&&s.children.length>0?{...s,children:Th(s.children,t,r,n)}:s})}function ki(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:ki(n.children,t,r)}:n)}function Eh(e,t,r,n){return e.map(s=>{if(s.id===t){const i=[...s.children??[]];return i.splice(n,0,r),{...s,children:i}}return s.children&&s.children.length>0?{...s,children:Eh(s.children,t,r,n)}:s})}function Wa(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Wa(r.children,t):[]}))}function Ga(e,t,r,n){return e.map(s=>{if(s.id===t){const i=[...s.children??[]],[o]=i.splice(r,1);return i.splice(n,0,o),{...s,children:i}}return s.children&&s.children.length>0?{...s,children:Ga(s.children,t,r,n)}:s})}function Ah(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?Ah(r.children,t):[]}})}function h1(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 p1(e,t){const r=Pt(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Pt(e,s.parent):void 0;return n}const ue=Xs((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:i}=t(),o=Pt(n,r),a=i(r),c={...(o==null?void 0:o.metadata)??{},...s[r]??{}};Z.getState().setNodeFlags({isFolder:(o==null?void 0:o.isFolder)??!1,isRoot:!(o!=null&&o.parent),isQuml:!1}),Hr.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:a,activeNodeMeta:c})},updateNode:(r,n,s)=>{if(e(i=>({treeData:Th(i.treeData,r,n,s),treeCache:{...i.treeCache,[r]:{...i.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const i=Pt(t().treeData,r);e(o=>({activeNodeMeta:{...(i==null?void 0:i.metadata)??{},...o.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var g,p,b;const s=t(),i=Z.getState().editorProfile,o=((p=(g=Z.getState().editorConfig)==null?void 0:g.config)==null?void 0:p.maxDepth)??i.maxDepth,a=xh(s.treeData,r);if(a>=o)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${o}). parentDepth=${a}`),"";const c="temp-"+Math.random().toString(36).slice(2),u={id:c,identifier:c,name:i.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:c,name:i.defaultUnitName,contentType:i.unitContentType,primaryCategory:i.unitPrimaryCategory,visibility:"Parent"}},d=((b=Pt(s.treeData,r))==null?void 0:b.children)??[],f=i.derivedRoles&&Fs(d,"post");return e(h=>({treeData:f?Eh(h.treeData,r,u,d.length-1):ki(h.treeData,r,u),treeCache:{...h.treeCache,[c]:{...u.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(i=>({treeData:Wa(i.treeData,r),selectedNodeId:i.selectedNodeId===r?null:i.selectedNodeId}))},reorderChildren:(r,n,s)=>{var a;const i=Z.getState().editorProfile,o=(a=t().treeData[0])==null?void 0:a.id;if(i.derivedRoles&&r===o){const c=Pt(t().treeData,r);if(c!=null&&c.children&&!c1(c.children,n,s))return}e(c=>({treeData:Ga(c.treeData,r,n,s)}))},moveNode:(r,n,s)=>{var u,d,f;const i=Z.getState().editorProfile,o=Pt(t().treeData,r),a=Pt(t().treeData,s);if(!(a!=null&&a.isFolder))return;const c=(u=t().treeData[0])==null?void 0:u.id;if(!(i.derivedRoles&&(o!=null&&o.isFolder)&&s!==c)){if(i.derivedRoles&&o&&!o.isFolder){const g=!!((d=o.metadata)!=null&&d.isAssessmentCourse),p=((f=t().treeData[0])==null?void 0:f.children)??[];if(!tu(a,g,Qa(p,a)))return}e(g=>{const p=Pt(g.treeData,r);if(!p)return g;let b=Wa(g.treeData,r);return b=ki(b,s,{...p,parent:s}),{treeData:b}}),t().markDirty()}},addResource:(r,n,s)=>{var b,h,v,y,C,S;const i=Z.getState().editorConfig,o=Z.getState().editorProfile,a=(b=t().treeData[0])==null?void 0:b.id,c=!!(s!=null&&s.isAssessmentCourse);if(o.derivedRoles&&n===a){if(!c||Pt(t().treeData,r.identifier))return!1;const _=t().treeData[0],x=(_==null?void 0:_.children)??[],E=(s==null?void 0:s.slot)??l1(x);if(!E||Fs(x,E))return!1;const D=t().addNode(a,"unit");if(!D)return!1;const{learningPath:T}=Al.getState().labelConfig;if(t().updateNode(D,{name:E==="pre"?T.priorAssessmentLabel:T.outcomeAssessmentLabel}),E==="pre"){const j=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e(F=>({treeData:Ga(F.treeData,a,j,0)}))}return t().addResource(r,D,s)}if(!(((y=i==null?void 0:i.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===a||Pt(t().treeData,r.identifier))return!1;const d=Pt(t().treeData,n);if(!(d!=null&&d.isFolder))return!1;if(o.derivedRoles){const _=((C=t().treeData[0])==null?void 0:C.children)??[];if(!tu(d,c,Qa(_,d)))return!1}const f=((S=i==null?void 0:i.config)==null?void 0:S.maxContentsLimit)??1200;if(h1(t().treeData)>=f)return!1;const p={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:{...r,...c?{isAssessmentCourse:!0}:{}}};return e(_=>({treeData:ki(_.treeData,n,p)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=Z.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(s=>{const i=s.treeData[0];if(!i)return s;const o=[];for(const a of i.children??[]){const c=lt(a),u=(a.children??[]).filter(d=>{var p;if(d.isFolder)return!0;const f=(p=d.metadata)==null?void 0:p.framework,g=!f||(Array.isArray(f)?f.includes(r):f===r);return g||n++,g});c&&u.length===0||o.push(u.length===(a.children??[]).length?a:{...a,children:u})}return n===0?s:{treeData:[{...i,children:o}]}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=Ah(n.treeData,r),i={};for(const[a,c]of Object.entries(n.treeCache)){const u=r[a]??a,{isNew:d,...f}=c;i[u]=f}const o=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:s,treeCache:i,selectedNodeId:o}})},getNodeById:r=>Pt(t().treeData,r),getChildrenOf:r=>{const n=Pt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>p1(t().treeData,r)})),m1="_spin_1ah4d_9",g1={spin:m1};function ae(){return Al(e=>e.labelConfig)}const v1=({size:e=16,color:t="currentColor"})=>{const r=ae();return l.jsx("svg",{className:g1.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"})})},qe=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:i,className:o,type:a="button"})=>l.jsxs("button",{type:a,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${o??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(v1,{size:14}):null,i]}),Ih=({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 nu(e){var r,n;return(n=(r=(await Re.get(`/api/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function y1(e){var r,n;return((n=(r=(await Re.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 Eo(e,t){const r=Zn({queryKey:["framework",e],queryFn:()=>nu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=Zn({queryKey:["framework",n],queryFn:()=>nu(n),enabled:!!n,staleTime:300*1e3}),i=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:i,isLoading:r.isLoading||s.isLoading}}function kh(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 b1(e){var n,s,i,o;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!lt(t))return;const r=(o=(i=(s=t==null?void 0:t.children)==null?void 0:s[0])==null?void 0:i.metadata)==null?void 0:o.framework;return Array.isArray(r)?r[0]:r}function as(){var i;const e=Z(o=>o.editorConfig),t=Z(o=>o.contentFramework),r=ue(o=>o.treeData),n=b1(r[0])??t??((i=e==null?void 0:e.context)==null?void 0:i.framework),{organisationFramework:s}=Eo(n);return kh(s==null?void 0:s.categories)}function C1(e,t,r){var u,d,f,g;const n={scope:((t==null?void 0:t.terms)??[]).map(p=>p.name),source:"manual"};if(!t)return n;const s=(u=e==null?void 0:e.children)==null?void 0:u[0];if(!lt(s))return n;const i=(d=s==null?void 0:s.children)==null?void 0:d[0];if(!i)return n;const a=((f=r[i.id])==null?void 0:f[t.code])??((g=i.metadata)==null?void 0:g[t.code]);return{scope:Array.isArray(a)?a:a?[a]:[],source:"prior"}}function Dh(){const e=as(),t=ue(n=>n.treeData),r=ue(n=>n.treeCache);return m.useMemo(()=>C1(t[0],e,r),[t,e,r])}const S1="_overlay_kdzmi_1",_1="_modal_kdzmi_15",w1="_modalHeader_kdzmi_27",x1="_modalHeaderClose_kdzmi_37",T1="_modalBody_kdzmi_55",E1="_modalFooter_kdzmi_62",A1="_checkRow_kdzmi_69",I1="_formGroup_kdzmi_112",k1="_textarea_kdzmi_123",D1="_sliderGroup_kdzmi_144",L1="_sliderValue_kdzmi_156",O1="_sliderLabels_kdzmi_164",N1="_sectionTitle_kdzmi_172",Ne={overlay:S1,modal:_1,modalHeader:w1,modalHeaderClose:x1,modalBody:T1,modalFooter:E1,checkRow:A1,formGroup:I1,textarea:k1,sliderGroup:D1,sliderValue:L1,sliderLabels:O1,sectionTitle:N1},j1=({objectType:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=ue(p=>p.treeData[0]),i=as(),{scope:o}=Dh(),[a,c]=m.useState(null),u=d1(s,i==null?void 0:i.code,o);m.useEffect(()=>{let p=!1;return c(null),f1(s).then(b=>{p||c(b)}),()=>{p=!0}},[s]);const d=a===null,f=[...u,...a??[]],g=!d&&f.length===0;return l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:f.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:d?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ne.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:f.map((p,b)=>l.jsx("li",{children:p.message},`${p.code}-${p.nodeId??b}`))})]})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(qe,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(qe,{variant:"primary",onClick:t,disabled:!g,children:n.publishChecklist.yesButton})]})]})})},P1=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ae(),s=Z(g=>{var p,b;return(b=(p=g.editorConfig)==null?void 0:p.config)==null?void 0:b.objectType})||"Content",i=Z(g=>g.editorProfile.key==="learningPath"),o=Z(g=>g.publishChecklist)??[],[a,c]=m.useState({}),u=o.every(g=>a[g.code]),d=o.length===0||u,f=()=>{t()};return i?l.jsx(j1,{objectType:s,onConfirm:t,onCancel:r}):l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:o.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:Ne.sectionTitle,children:n.publishChecklist.checklistInstructions}),o.map(g=>l.jsxs("label",{className:Ne.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!a[g.code],onChange:p=>c(b=>({...b,[g.code]:p.target.checked}))}),l.jsx("span",{children:g.label})]},g.code))]})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(qe,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(qe,{variant:"primary",onClick:f,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},R1=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const s=ae(),[i,o]=m.useState(""),[a,c]=m.useState(7),u=t==="approve",d=u?s.qualityParamsModal.reviewQualityTitle:s.qualityParamsModal.rejectContentTitle,f=!u&&i.trim().length===0,g=()=>{u?r(i.trim(),a):r(i.trim())};return l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:d}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:u?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ne.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Ne.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:a,onChange:p=>c(Number(p.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":a}),l.jsx("span",{className:Ne.sliderValue,children:a})]}),l.jsxs("div",{className:Ne.sliderLabels,children:[l.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Ne.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:Ne.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:i,onChange:p=>o(p.target.value),rows:4})]})]}):l.jsxs("div",{className:Ne.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:Ne.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:i,onChange:p=>o(p.target.value),rows:5,required:!0,"aria-required":"true"}),i.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:s.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(qe,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),l.jsx(qe,{variant:u?"primary":"danger",onClick:g,disabled:f,children:u?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})},Lh=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function F1(e,t={}){var c,u,d,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("@"),i=/^\d{10,}$/.test(e.trim()),o={filters:n,fields:Lh,offset:0,limit:t.limit??200};return s?n.email=e.trim():i?n.phone=e.trim():o.query=e,((f=(d=(u=(await Re.post("/action/user/v1/search",{request:o},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:u.result)==null?void 0:d.response)==null?void 0:f.content)??[]}async function M1(e){var r,n,s;return e.length?((s=(n=(r=(await Re.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Lh,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 B1(e){var r,n;return((n=(r=(await Re.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const q1="_container_1hnn8_1",$1="_header_1hnn8_13",U1="_title_1hnn8_22",z1="_closeBtn_1hnn8_29",V1="_body_1hnn8_45",H1="_label_1hnn8_54",Q1="_searchSection_1hnn8_62",W1="_searchRow_1hnn8_68",G1="_searchInput_1hnn8_74",K1="_searchSpinner_1hnn8_89",Y1="_resultsList_1hnn8_105",Z1="_resultItem_1hnn8_118",X1="_userInfo_1hnn8_133",J1="_userName_1hnn8_141",e0="_userEmail_1hnn8_150",t0="_userOrg_1hnn8_158",r0="_noResults_1hnn8_167",n0="_collabSection_1hnn8_174",s0="_sectionTitle_1hnn8_179",i0="_badge_1hnn8_189",o0="_emptyCollab_1hnn8_203",a0="_collabList_1hnn8_214",l0="_collabItem_1hnn8_223",c0="_userAvatar_1hnn8_237",u0="_error_1hnn8_251",d0="_success_1hnn8_257",f0="_footer_1hnn8_263",Pe={container:q1,header:$1,title:U1,closeBtn:z1,body:V1,label:H1,searchSection:Q1,searchRow:W1,searchInput:G1,searchSpinner:K1,resultsList:Y1,resultItem:Z1,userInfo:X1,userName:J1,userEmail:e0,userOrg:t0,noResults:r0,collabSection:n0,sectionTitle:s0,badge:i0,emptyCollab:o0,collabList:a0,collabItem:l0,userAvatar:c0,error:u0,success:d0,footer:f0},h0=({contentId:e,onClose:t})=>{var j,F;const r=ae(),n=Z(O=>O.editorConfig),s=(j=n==null?void 0:n.context)==null?void 0:j.channel,i=(F=n==null?void 0:n.config)==null?void 0:F.objectType,[o,a]=m.useState(""),[c,u]=m.useState([]),[d,f]=m.useState(!1),[g,p]=m.useState([]),[b,h]=m.useState(!1),[v,y]=m.useState(""),[C,S]=m.useState(!1),_=m.useRef(null);m.useEffect(()=>{let O=!1;return(async()=>{try{const N=await e1(e),B=(N==null?void 0:N.collaborators)??[];if(!B.length)return;const P=await M1(B);if(O)return;const U=B.map(ne=>P.find(H=>H.identifier===ne)??{identifier:ne,firstName:ne});p(U)}catch{}})(),()=>{O=!0}},[e]),m.useEffect(()=>{_.current&&clearTimeout(_.current);const O=o.trim();if(O.length<2){u([]);return}return _.current=setTimeout(async()=>{f(!0);try{const N=await F1(O,{rootOrgId:s,objectType:i}),B=new Set(g.map(P=>P.identifier));u(N.filter(P=>!B.has(P.identifier)))}catch{u([])}finally{f(!1)}},300),()=>{_.current&&clearTimeout(_.current)}},[o,g,s,i]);const x=m.useCallback(O=>{p(N=>N.find(B=>B.identifier===O.identifier)?N:[...N,O]),u(N=>N.filter(B=>B.identifier!==O.identifier)),S(!1)},[]),E=m.useCallback(O=>{p(N=>N.filter(B=>B.identifier!==O)),S(!1)},[]),D=m.useCallback(async()=>{h(!0),y(""),S(!1);try{await n1(e,g.map(O=>O.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,g,r.manageCollaborators.saveFailed]),T=O=>`${O.firstName}${O.lastName?` ${O.lastName}`:""}`;return l.jsxs("div",{className:Pe.container,children:[l.jsxs("div",{className:Pe.header,children:[l.jsx("h2",{className:Pe.title,children:r.manageCollaborators.title}),l.jsx("button",{className:Pe.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(yr,{size:18})})]}),l.jsxs("div",{className:Pe.body,children:[l.jsxs("div",{className:Pe.searchSection,children:[l.jsx("label",{className:Pe.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:Pe.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Pe.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:o,onChange:O=>a(O.target.value)}),d&&l.jsx("span",{className:Pe.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:Pe.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(O=>{var N,B,P,U;return l.jsxs("li",{className:Pe.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:T(O)}),O.email&&l.jsx("span",{className:Pe.userEmail,children:O.email}),(((B=(N=O.organisations)==null?void 0:N[0])==null?void 0:B.orgName)??O.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:((U=(P=O.organisations)==null?void 0:P[0])==null?void 0:U.orgName)??O.rootOrgName})]}),l.jsx(qe,{variant:"primary",size:"sm",onClick:()=>x(O),children:r.manageCollaborators.add})]},O.identifier)})}),o.trim().length>=2&&!d&&c.length===0&&l.jsx("p",{className:Pe.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:Pe.collabSection,children:[l.jsxs("h3",{className:Pe.sectionTitle,children:[r.manageCollaborators.currentCollaborators,g.length>0&&l.jsx("span",{className:Pe.badge,children:g.length})]}),g.length===0?l.jsx("p",{className:Pe.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:Pe.collabList,children:g.map(O=>{var N,B,P,U;return l.jsxs("li",{className:Pe.collabItem,children:[l.jsx("div",{className:Pe.userAvatar,"aria-hidden":"true",children:T(O).charAt(0).toUpperCase()}),l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:T(O)}),O.email&&l.jsx("span",{className:Pe.userEmail,children:O.email}),(((B=(N=O.organisations)==null?void 0:N[0])==null?void 0:B.orgName)??O.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:((U=(P=O.organisations)==null?void 0:P[0])==null?void 0:U.orgName)??O.rootOrgName})]}),l.jsx(qe,{variant:"danger",size:"sm",onClick:()=>E(O.identifier),children:r.manageCollaborators.remove})]},O.identifier)})})]}),v&&l.jsx("p",{className:Pe.error,role:"alert",children:v}),C&&l.jsx("p",{className:Pe.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:Pe.footer,children:[l.jsx(qe,{variant:"ghost",onClick:t,disabled:b,children:r.manageCollaborators.cancel}),l.jsx(qe,{variant:"primary",isLoading:b,onClick:D,children:r.manageCollaborators.save})]})]})};async function p0(e){return(await Re.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function m0(e,t){var s;const n=((s=(await Re.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 g0(e){var n;const r=((n=(await Re.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 v0="_topbar_c3y0z_1",y0="_left_c3y0z_15",b0="_right_c3y0z_23",C0="_backBtn_c3y0z_30",S0="_title_c3y0z_49",_0="_profileBadge_c3y0z_61",w0="_statusChip_c3y0z_76",x0="_savedIndicator_c3y0z_88",T0="_unsaved_c3y0z_98",E0="_iconBtn_c3y0z_103",A0="_iconBtnLabel_c3y0z_130",I0="_qrDropdown_c3y0z_134",k0="_qrMenu_c3y0z_138",D0="_reviewBtns_c3y0z_173",L0="_sourcingBtns_c3y0z_182",O0="_modalOverlay_c3y0z_191",N0="_sbOverlay_c3y0z_201",j0="_sbModal_c3y0z_211",P0="_sbModalHeader_c3y0z_222",R0="_sbModalTitle_c3y0z_230",F0="_sbModalClose_c3y0z_237",M0="_sbModalBody_c3y0z_250",B0="_sbLabel_c3y0z_257",q0="_sbTextarea_c3y0z_264",$0="_sbError_c3y0z_281",U0="_sbModalFooter_c3y0z_288",Se={topbar:v0,left:y0,right:b0,backBtn:C0,title:S0,profileBadge:_0,statusChip:w0,savedIndicator:x0,unsaved:T0,iconBtn:E0,iconBtnLabel:A0,qrDropdown:I0,qrMenu:k0,reviewBtns:D0,sourcingBtns:L0,modalOverlay:O0,sbOverlay:N0,sbModal:j0,sbModalHeader:P0,sbModalTitle:R0,sbModalClose:F0,sbModalBody:M0,sbLabel:B0,sbTextarea:q0,sbError:$0,sbModalFooter:U0};function z0(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function V0(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const H0=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:s="primary",onConfirm:i,onCancel:o})=>{const a=ae(),[c,u]=m.useState(""),d=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:Se.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,children:l.jsxs("div",{className:Se.sbModal,children:[l.jsxs("div",{className:Se.sbModalHeader,children:[l.jsx("span",{id:`${d}-title`,className:Se.sbModalTitle,children:e}),l.jsx("button",{className:Se.sbModalClose,onClick:o,"aria-label":a.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:Se.sbModalBody,children:[l.jsxs("label",{className:Se.sbLabel,htmlFor:`${d}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${d}-comment`,className:Se.sbTextarea,placeholder:r,value:c,onChange:f=>u(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:Se.sbError,children:a.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:Se.sbModalFooter,children:[l.jsx(qe,{variant:"ghost",onClick:o,children:a.reviewCommentModal.cancelButton}),l.jsx(qe,{variant:s,onClick:()=>i(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},Q0=({onConfirm:e,onCancel:t})=>{const r=ae(),[n,s]=m.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:i=>s(i.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(qe,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),l.jsx(qe,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},W0=({onConfirm:e,onCancel:t})=>{const r=ae(),[n,s]=m.useState(""),i=parseInt(n,10),o=!isNaN(i)&&i>=2&&i<=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:a=>s(a.target.value)}),n&&!o&&l.jsx("p",{className:Se.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:Se.sbModalFooter,children:[l.jsx(qe,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(qe,{variant:"primary",onClick:()=>e(i),disabled:!o,children:r.generateQRModal.generateButton})]})]})})},G0=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:s=!0,onToolbarEvent:i})=>{var Ce,de;const o=ae(),c=ue(ce=>ce.treeData)[0],u=(c==null?void 0:c.name)??o.contextualEditor.untitledPlaceholder,d=V0(((Ce=c==null?void 0:c.metadata)==null?void 0:Ce.status)??(c==null?void 0:c.status),o.topbar.draftStatusFallback),f=Z(ce=>{var Q,se,Te,me;return((se=(Q=ce.editorConfig)==null?void 0:Q.context)==null?void 0:se.contentId)??((me=(Te=ce.editorConfig)==null?void 0:Te.context)==null?void 0:me.identifier)??""}),{activeModal:g,modalData:p,closeModal:b,openModal:h}=Hr(),v=Z(ce=>ce.buttonLoaders),y=Z(ce=>ce.categoryMeta),C=Z(ce=>ce.editorProfile),S=C.key==="learningPath",_=C.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[x,E]=m.useState(!1),[D,T]=m.useState(!1),[j,F]=m.useState(!1),O=m.useRef(null),[N,B]=m.useState(!1);m.useEffect(()=>{if(!j)return;const ce=Q=>{var se;(se=O.current)!=null&&se.contains(Q.target)||F(!1)};return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[j]);const[P,U]=m.useState(!1),[ne,H]=m.useState(!1),{updateNode:te}=ue(),he=(de=c==null?void 0:c.metadata)==null?void 0:de.qrCodeProcessId,oe=m.useCallback(async ce=>{if(f){B(!1),U(!0);try{const{processId:Q,reservedDialcodes:se}=await m0(f,ce);Q&&c&&te(c.id,{qrCodeProcessId:Q,reservedDialcodes:se}),we.success(o.topbar.qrGenerationStartedToast)}catch{we.error(o.topbar.qrGenerationFailedToast)}finally{U(!1)}}},[f,c,te,o]),ge=m.useCallback(async()=>{if(!he){we.error(o.topbar.qrCodesNotGeneratedToast);return}H(!0);try{const ce=await g0(he);if(ce.status==="in-process"){we(o.topbar.qrGenerationInProgressToast,{icon:l.jsx(Ps,{size:16})});return}const Q=ce.url;if(!Q){we.error(o.topbar.qrCodesNotReadyToast);return}const se=await fetch(Q).then(tt=>tt.blob()),Te=await new Promise(tt=>{const st=new FileReader;st.onloadend=()=>tt(st.result),st.readAsDataURL(se)}),me=(c==null?void 0:c.metadata)??{},ee=tt=>Array.isArray(tt)?tt.join("_"):typeof tt=="string"?tt:"",He=[f,ee(me.medium),ee(me.gradeLevel),ee(me.subject)].filter(Boolean),Ge=new Date().toISOString().replace(/[:.]/g,"-"),Ze=`${He.join("_")}_${Ge}.zip`,Qe=document.createElement("a");Qe.href=Te,Qe.download=Ze,Qe.style.display="none",document.body.appendChild(Qe),Qe.click(),document.body.removeChild(Qe),we.success(o.topbar.qrCodesDownloadedToast)}catch{we.error(o.topbar.qrCodesDownloadFailedToast)}finally{H(!1)}},[he,c,f,o]),ve=e==="edit",xe=e==="review",ye=e==="sourcingreview",R=e==="read",M=m.useCallback((ce,Q)=>{i({action:ce,data:Q})},[i]),Y=m.useCallback(()=>{b(),M("publish")},[b,M]),le=m.useCallback((ce,Q)=>{const se=p==null?void 0:p.action;b(),se==="approve"?M("sourcingApprove",{comment:ce,score:Q}):M("reject",{comment:ce})},[b,M,p]);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:()=>M("back"),"aria-label":o.topbar.backAriaLabel,type:"button",children:l.jsx(_l,{size:18})}),l.jsx("h1",{className:Se.title,title:u,children:u}),S&&l.jsxs("span",{className:Se.profileBadge,children:[l.jsx(Ih,{size:13,"aria-hidden":"true"}),o.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${Se.statusChip}`,"aria-label":`${o.topbar.statusAriaLabelPrefix} ${d}`,children:d})]}),l.jsxs("div",{className:Se.right,children:[t?l.jsx("span",{className:Se.savedIndicator,"aria-live":"polite",children:o.topbar.savingIndicator}):r&&ve?l.jsx("span",{className:`${Se.savedIndicator} ${Se.unsaved}`,"aria-live":"polite",children:o.topbar.unsavedIndicator}):n?l.jsxs("span",{className:Se.savedIndicator,"aria-live":"polite",children:[l.jsx(yn,{size:14,"aria-hidden":"true"}),o.topbar.savedIndicatorPrefix," ",z0(n)]}):null,!R&&!xe&&!ye&&d!=="Review"&&l.jsx("span",{title:s?void 0:o.topbar.fillRequiredFieldsTooltip,children:l.jsx(qe,{variant:"ghost",size:"sm",onClick:()=>M("saveCollection"),disabled:!s,children:o.topbar.saveAsDraftButton})}),ve&&l.jsxs(l.Fragment,{children:[l.jsxs(qe,{variant:"primary",size:"sm",onClick:()=>T(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(Fy,{size:14,"aria-hidden":"true"})," ",o.topbar.sendForReviewButton]}),C.features.collaborators&&l.jsx("button",{className:Se.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":o.topbar.collaboratorsLabel,title:o.topbar.collaboratorsLabel,type:"button",children:l.jsx(Vy,{size:16,"aria-hidden":"true"})}),_&&l.jsxs("div",{className:Se.qrDropdown,ref:O,children:[l.jsxs("button",{className:Se.iconBtn,onClick:()=>F(ce=>!ce),"aria-label":o.topbar.qrCodesLabel,title:o.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":j,children:[l.jsx(Tc,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:Se.iconBtnLabel,children:o.topbar.qrCodesLabel}),l.jsx(bn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),j&&l.jsxs("div",{className:Se.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),B(!0)},disabled:P,children:[l.jsx(Tc,{size:14}),P?o.topbar.generatingEllipsis:o.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),ge()},disabled:ne||!he,children:[l.jsx(wy,{size:14}),ne?o.topbar.downloadingEllipsis:o.topbar.downloadQrCodesMenuItem]})]})]})]}),xe&&l.jsxs("div",{className:Se.reviewBtns,children:[l.jsxs(qe,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(Nf,{size:14,"aria-hidden":"true"})," ",o.topbar.publishButton]}),l.jsxs(qe,{variant:"primary",size:"sm",onClick:()=>E(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(Ec,{size:14,"aria-hidden":"true"})," ",o.topbar.requestForChangesButton]})]}),ye&&l.jsxs("div",{className:Se.sourcingBtns,children:[l.jsxs(qe,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(By,{size:14,"aria-hidden":"true"})," ",o.topbar.approveButton]}),l.jsxs(qe,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(Ec,{size:14,"aria-hidden":"true"})," ",o.topbar.requestForChangesButton]})]})]})]}),g==="publishChecklist"&&l.jsx(P1,{contentId:f,onConfirm:Y,onCancel:b}),g==="qualityParams"&&l.jsx(R1,{contentId:f,action:(p==null?void 0:p.action)??"reject",onConfirm:le,onCancel:b}),g==="manageCollaborators"&&l.jsx("div",{className:Se.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(h0,{contentId:f,onClose:b})}),D&&l.jsx(Q0,{onConfirm:()=>{T(!1),M("sendForReview")},onCancel:()=>T(!1)}),x&&l.jsx(H0,{titleText:o.topbar.requestChangesTitle,labelText:o.topbar.changesRequestedLabel,placeholderText:o.topbar.describeChangesPlaceholder,submitLabel:o.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:ce=>{E(!1),M("reject",{comment:ce})},onCancel:()=>E(!1)}),N&&l.jsx(W0,{onConfirm:oe,onCancel:()=>B(!1)})]})},K0=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=ae();return Ur.createPortal(l.jsx("div",{className:Ne.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Ne.modal,children:[l.jsxs("div",{className:Ne.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),l.jsx("button",{className:Ne.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Ne.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Ne.modalFooter,children:[l.jsx(qe,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),l.jsx(qe,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),l.jsx(qe,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var Y0=Tl();const Oh=m.createContext(null);function Bt(){const e=m.useContext(Oh);if(e===null)throw new Error("No Tree Api Provided");return e}const Nh=m.createContext(null);function Z0(){const e=m.useContext(Nh);if(e===null)throw new Error("Provide a NodesContext");return e}const jh=m.createContext(null);function X0(){const e=m.useContext(jh);if(e===null)throw new Error("Provide a DnDContext");return e}const Ph=m.createContext(0);function Rh(){m.useContext(Ph)}function Di(e,t,r){return Math.max(Math.min(e,r),t)}function Fh(e){return e&&e.isLeaf}function Mh(e){return e&&e.isInternal&&!e.isOpen}function Bh(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const qh=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},$h=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Pl(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Pl(r,t);if(n)return n}return null}function Ji(e,t){if(t(e),e.children)for(let r of e.children)Ji(r,t)}function Uh(e){const t=Vh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=J0(t,n);break}r==null||r.focus()}function zh(e){const t=Vh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=eT(t,n);break}r==null||r.focus()}function J0(e,t){return t+1<e.length?e[t+1]:e[0]}function eT(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Vh(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function _s(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Pn(e){return typeof e=="string"?e:e.id}function tT(e,...t){if(e)return e(...t)}function Hh(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function Qh(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 Wh(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const rT=Object.freeze(Object.defineProperty({__proto__:null,access:_s,bound:Di,dfs:Pl,focusNextElement:Uh,focusPrevElement:zh,getInsertIndex:Qh,getInsertParentId:Wh,identify:Pn,indexOf:$h,isClosed:Mh,isDescendant:qh,isItem:Fh,isOpenWithEmptyChildren:Bh,safeRun:tT,waitFor:Hh,walk:Ji},Symbol.toStringTag,{value:"Module"})),nT={display:"flex",alignItems:"center",zIndex:1},sT={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},iT={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},oT=m.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({},nT),s),children:[l.jsx("div",{style:Object.assign({},iT)}),l.jsx("div",{style:Object.assign({},sT)})]})});function aT({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 lT(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(uT,Object.assign({},e)):l.jsx(cT,Object.assign({},e))]})}function cT(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function uT({node:e}){const t=m.useRef();return m.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 Ms="__REACT_ARBORIST_INTERNAL_ROOT__";function su(e){var t;function r(i,o,a){const c=e.accessId(i),u=new Bs({tree:e,data:i,level:o,parent:a,id:c,children:null,isDraggable:e.isDraggable(i),rowIndex:null}),d=e.accessChildren(i);return d&&(u.children=d.map(f=>r(f,o+1,u))),u}const n=new Bs({tree:e,id:Ms,data:{id:Ms},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(i=>r(i,0,n)),n}class Bs{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===Ms}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 Bs(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Go(e){return{type:"EDIT",id:e}}function dT(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function Tn(e){return{type:"FOCUS",id:e}}function fT(){return{type:"TREE_BLUR"}}function hT(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 Ka={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 pT(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 es=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}}},Ir={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:Pn(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Pn)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Pn)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:Pn(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:Pn(e)})};function mT(e=es().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 ts={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 gT(e=es().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 es().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const vT={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},yT=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},bT=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function Gh({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(CT,{isDragging:s,children:[l.jsx(ST,{offset:e,children:l.jsx(wT,{id:r,dragIds:n})}),l.jsx(_T,{mouse:t,count:n.length})]})}const CT=m.memo(function(t){return t.isDragging?l.jsx("div",{style:vT,children:t.children}):null});function ST(e){return l.jsx("div",{className:"row preview",style:yT(e.offset),children:e.children})}function _T(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:bT(r),children:t}):null}const wT=m.memo(function(t){const r=Bt(),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 Ya(){return Ya=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},Ya.apply(null,arguments)}function ou(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Za(e,t){return Za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Za(e,t)}function xT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Za(e,t)}var au=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function TT(e,t){return!!(e===t||au(e)&&au(t))}function ET(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!TT(e[r],t[r]))return!1;return!0}function Ko(e,t){t===void 0&&(t=ET);var r,n=[],s,i=!1;function o(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return i&&r===this&&t(a,n)||(s=e.apply(this,a),i=!0,r=this,n=a),s}return o}var AT=typeof performance=="object"&&typeof performance.now=="function",lu=AT?function(){return performance.now()}:function(){return Date.now()};function cu(e){cancelAnimationFrame(e.id)}function IT(e,t){var r=lu();function n(){lu()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Yo=-1;function uu(e){if(e===void 0&&(e=!1),Yo===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Yo=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Yo}var En=null;function du(e){if(e===void 0&&(e=!1),En===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?En="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?En="negative":En="positive-ascending"),document.body.removeChild(t),En}return En}process.env.NODE_ENV;var kT=150,DT=function(t,r){return t},Li=null,Oi=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Li=new WeakSet,Oi=new WeakSet);function Kh(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,i=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=(function(f){xT(g,f);function g(b){var h;return h=f.call(this,b)||this,h._instanceProps=c(h.props,ou(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:ou(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Ko(function(v,y,C,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Ko(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,_=y.layout,x=h._getItemStyleCache(u&&S,u&&_,u&&C),E;if(x.hasOwnProperty(v))E=x[v];else{var D=r(h.props,v,h._instanceProps),T=s(h.props,v,h._instanceProps),j=C==="horizontal"||_==="horizontal",F=C==="rtl",O=j?D:0;x[v]=E={position:"absolute",left:F?void 0:O,right:F?O:void 0,top:j?0:D,height:j?"100%":T,width:j?T:"100%"}}return E},h._getItemStyleCache=void 0,h._getItemStyleCache=Ko(function(v,y,C){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,S=y.scrollLeft,_=y.scrollWidth;h.setState(function(x){if(x.scrollOffset===S)return null;var E=h.props.direction,D=S;if(E==="rtl")switch(du()){case"negative":D=-S;break;case"positive-descending":D=_-C-S;break}return D=Math.max(0,Math.min(D,_-C)),{isScrolling:!0,scrollDirection:x.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,S=y.scrollHeight,_=y.scrollTop;h.setState(function(x){if(x.scrollOffset===_)return null;var E=Math.max(0,Math.min(_,S-C));return{isScrolling:!0,scrollDirection:x.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(v){var y=h.props.outerRef;h._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&&cu(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=IT(h._resetIsScrolling,kT)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}g.getDerivedStateFromProps=function(h,v){return LT(h,v),d(h),null};var p=g.prototype;return p.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)},p.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,S=y.layout,_=this.state.scrollOffset;h=Math.max(0,Math.min(h,C-1));var x=0;if(this._outerRef){var E=this._outerRef;S==="vertical"?x=E.scrollWidth>E.clientWidth?uu():0:x=E.scrollHeight>E.clientHeight?uu():0}this.scrollTo(i(this.props,h,v,_,this._instanceProps,x))},p.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()},p.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,C=this.state,S=C.scrollOffset,_=C.scrollUpdateWasRequested;if(_&&this._outerRef!=null){var x=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(du()){case"negative":x.scrollLeft=-S;break;case"positive-ascending":x.scrollLeft=S;break;default:var E=x.clientWidth,D=x.scrollWidth;x.scrollLeft=D-E-S;break}else x.scrollLeft=S;else x.scrollTop=S}this._callPropsCallbacks()},p.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&cu(this._resetIsScrollingTimeoutId)},p.render=function(){var h=this.props,v=h.children,y=h.className,C=h.direction,S=h.height,_=h.innerRef,x=h.innerElementType,E=h.innerTagName,D=h.itemCount,T=h.itemData,j=h.itemKey,F=j===void 0?DT:j,O=h.layout,N=h.outerElementType,B=h.outerTagName,P=h.style,U=h.useIsScrolling,ne=h.width,H=this.state.isScrolling,te=C==="horizontal"||O==="horizontal",he=te?this._onScrollHorizontal:this._onScrollVertical,oe=this._getRangeToRender(),ge=oe[0],ve=oe[1],xe=[];if(D>0)for(var ye=ge;ye<=ve;ye++)xe.push(m.createElement(v,{data:T,key:F(ye,T),index:ye,isScrolling:U?H:void 0,style:this._getItemStyle(ye)}));var R=n(this.props,this._instanceProps);return m.createElement(N||B||"div",{className:y,onScroll:he,ref:this._outerRefSetter,style:Ya({position:"relative",height:S,width:ne,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},P)},m.createElement(x||E||"div",{children:xe,ref:_,style:{height:te?"100%":R,pointerEvents:H?"none":void 0,width:te?R:"100%"}}))},p._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],_=v[3];this._callOnItemsRendered(y,C,S,_)}}if(typeof this.props.onScroll=="function"){var x=this.state,E=x.scrollDirection,D=x.scrollOffset,T=x.scrollUpdateWasRequested;this._callOnScroll(E,D,T)}},p._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,C=this.state,S=C.isScrolling,_=C.scrollDirection,x=C.scrollOffset;if(v===0)return[0,0,0,0];var E=o(this.props,x,this._instanceProps),D=a(this.props,E,x,this._instanceProps),T=!S||_==="backward"?Math.max(1,y):1,j=!S||_==="forward"?Math.max(1,y):1;return[Math.max(0,E-T),Math.max(0,Math.min(v-1,D+j)),E,D]},g})(m.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var LT=function(t,r){var n=t.children,s=t.direction,i=t.height,o=t.layout,a=t.innerTagName,c=t.outerTagName,u=t.width,d=r.instance;if(process.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Oi&&!Oi.has(d)&&(Oi.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||o==="horizontal";switch(s){case"horizontal":case"vertical":Li&&!Li.has(d)&&(Li.add(d),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(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+o+'" 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 u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!f&&typeof i!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(i===null?"null":typeof i)+'" was specified.'))}},OT=50,Rn=function(t,r,n){var s=t,i=s.itemSize,o=n.itemMetadataMap,a=n.lastMeasuredIndex;if(r>a){var c=0;if(a>=0){var u=o[a];c=u.offset+u.size}for(var d=a+1;d<=r;d++){var f=i(d);o[d]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return o[r]},NT=function(t,r,n){var s=r.itemMetadataMap,i=r.lastMeasuredIndex,o=i>0?s[i].offset:0;return o>=n?Yh(t,r,i,0,n):jT(t,r,Math.max(0,i),n)},Yh=function(t,r,n,s,i){for(;s<=n;){var o=s+Math.floor((n-s)/2),a=Rn(t,o,r).offset;if(a===i)return o;a<i?s=o+1:a>i&&(n=o-1)}return s>0?s-1:0},jT=function(t,r,n,s){for(var i=t.itemCount,o=1;n<i&&Rn(t,n,r).offset<s;)n+=o,o*=2;return Yh(t,r,Math.min(n,i-1),Math.floor(n/2),s)},fu=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,i=r.estimatedItemSize,o=r.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var c=s[o];a=c.offset+c.size}var u=n-o-1,d=u*i;return a+d},PT=Kh({getItemOffset:function(t,r,n){return Rn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:fu,getOffsetForIndexAndAlignment:function(t,r,n,s,i,o){var a=t.direction,c=t.height,u=t.layout,d=t.width,f=a==="horizontal"||u==="horizontal",g=f?d:c,p=Rn(t,r,i),b=fu(t,i),h=Math.max(0,Math.min(b-g,p.offset)),v=Math.max(0,p.offset-g+p.size+o);switch(n==="smart"&&(s>=v-g&&s<=h+g?n="auto":n="center"),n){case"start":return h;case"end":return v;case"center":return Math.round(v+(h-v)/2);case"auto":default:return s>=v&&s<=h?s:s<v?v:h}},getStartIndexForOffset:function(t,r,n){return NT(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var i=t.direction,o=t.height,a=t.itemCount,c=t.layout,u=t.width,d=i==="horizontal"||c==="horizontal",f=d?u:o,g=Rn(t,r,s),p=n+f,b=g.offset+g.size,h=r;h<a-1&&b<p;)h++,b+=Rn(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,i={itemMetadataMap:{},estimatedItemSize:s||OT,lastMeasuredIndex:-1};return r.resetAfterIndex=function(o,a){a===void 0&&(a=!0),i.lastMeasuredIndex=Math.min(i.lastMeasuredIndex,o-1),r._getItemStyleCache(-1),a&&r.forceUpdate()},i},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.'))}}),RT=Kh({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,i,o){var a=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,g=t.width,p=a==="horizontal"||f==="horizontal",b=p?g:c,h=Math.max(0,u*d-b),v=Math.min(h,r*d),y=Math.max(0,r*d-b+d+o);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,i=t.height,o=t.itemCount,a=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=r*a,g=d?u:i,p=Math.ceil((g+n-f)/a);return Math.max(0,Math.min(o-1,r+p-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function FT(){var e,t;const r=Bt(),s=X0().cursor;if(!s||s.type!=="line")return null;const i=r.indent,o=r.rowTopPosition(s.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),a=i*s.level,c=r.renderCursor;return l.jsx(c,{top:o,left:a,indent:i})}var MT=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 BT=m.forwardRef(function(t,r){const{children:n}=t,s=MT(t,["children"]),i=Bt();return l.jsxs("div",Object.assign({ref:r},s,{onClick:o=>{o.currentTarget===o.target&&i.deselectAll()},children:[l.jsx(qT,{}),n]}))}),qT=()=>{const e=Bt();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(FT,{})})};var $T=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 UT=m.forwardRef(function(t,r){var n,s,i,o,{style:a}=t,c=$T(t,["style"]);const u=Bt(),d=(s=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingTop)!==null&&s!==void 0?s:0,f=(o=(i=u.props.padding)!==null&&i!==void 0?i:u.props.paddingBottom)!==null&&o!==void 0?o:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+f}px`})},c))});var Zh=m.createContext({dragDropManager:void 0}),Jt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Jt||(Jt={}));function Ee(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 i;if(t===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;i=new Error(t.replace(/%s/g,function(){return n[o++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}var Rl="dnd-core/INIT_COORDS",Ao="dnd-core/BEGIN_DRAG",Fl="dnd-core/PUBLISH_DRAG_SOURCE",Io="dnd-core/HOVER",ko="dnd-core/DROP",Do="dnd-core/END_DRAG";function hu(e,t){return{type:Rl,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Ni(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ni=function(r){return typeof r}:Ni=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ni(e)}function zT(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function VT(e,t){return e.filter(function(r){return r!==t})}function Xh(e){return Ni(e)==="object"}function HT(e,t){var r=new Map,n=function(o){r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(i,o){i===1&&s.push(o)}),s}function QT(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var WT={type:Rl,payload:{clientOffset:null,sourceClientOffset:null}};function GT(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,i=s===void 0?!0:s,o=n.clientOffset,a=n.getSourceClientOffset,c=e.getMonitor(),u=e.getRegistry();e.dispatch(hu(o)),KT(r,c,u);var d=XT(r,c);if(d===null){e.dispatch(WT);return}var f=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");YT(a),f=a(d)}e.dispatch(hu(o,f));var g=u.getSource(d),p=g.beginDrag(c,d);if(p!=null){ZT(p),u.pinSource(d);var b=u.getSourceType(d);return{type:Ao,payload:{itemType:b,item:p,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!i}}}}}function KT(e,t,r){Ee(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Ee(r.getSource(n),"Expected sourceIds to be registered.")})}function YT(e){Ee(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ZT(e){Ee(Xh(e),"Item must be an object.")}function XT(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 JT(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Fl}}}function Xa(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function eE(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;tE(r);var i=r.slice(0),o=e.getMonitor(),a=e.getRegistry();rE(i,o,a);var c=o.getItemType();return nE(i,a,c),sE(i,o,a),{type:Io,payload:{targetIds:i,clientOffset:s||null}}}}function tE(e){Ee(Array.isArray(e),"Expected targetIds to be an array.")}function rE(e,t,r){Ee(t.isDragging(),"Cannot call hover while not dragging."),Ee(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var s=e[n];Ee(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var i=r.getTarget(s);Ee(i,"Expected targetIds to be registered.")}}function nE(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],i=t.getTargetType(s);Xa(i,r)||e.splice(n,1)}}function sE(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function pu(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 mu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pu(Object(r),!0).forEach(function(n){iE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oE(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();aE(n);var i=uE(n);i.forEach(function(o,a){var c=lE(o,a,s,n),u={type:ko,payload:{dropResult:mu(mu({},r),c)}};e.dispatch(u)})}}function aE(e){Ee(e.isDragging(),"Cannot call drop while not dragging."),Ee(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function lE(e,t,r,n){var s=r.getTarget(e),i=s?s.drop(n,e):void 0;return cE(i),typeof i>"u"&&(i=t===0?{}:n.getDropResult()),i}function cE(e){Ee(typeof e>"u"||Xh(e),"Drop result must either be an object or undefined.")}function uE(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function dE(e){return function(){var r=e.getMonitor(),n=e.getRegistry();fE(r);var s=r.getSourceId();if(s!=null){var i=n.getSource(s,!0);i.endDrag(r,s),n.unpinSource()}return{type:Do}}}function fE(e){Ee(e.isDragging(),"Cannot call endDrag while not dragging.")}function hE(e){return{beginDrag:GT(e),publishDragSource:JT(e),hover:eE(e),drop:oE(e),endDrag:dE(e)}}function pE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mE(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 gE(e,t,r){return t&&mE(e.prototype,t),e}function ps(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vE=(function(){function e(t,r){var n=this;pE(this,e),ps(this,"store",void 0),ps(this,"monitor",void 0),ps(this,"backend",void 0),ps(this,"isSetUp",!1),ps(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 gE(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(o){return function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];var d=o.apply(r,c);typeof d<"u"&&n(d)}}var i=hE(this);return Object.keys(i).reduce(function(o,a){var c=i[a];return o[a]=s(c),o},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function Wt(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 gu=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),vu=function(){return Math.random().toString(36).substring(7).split("").join(".")},yu={INIT:"@@redux/INIT"+vu(),REPLACE:"@@redux/REPLACE"+vu()};function yE(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 bE(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(_E(e))return"date";if(SE(e))return"error";var r=CE(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 CE(e){return typeof e.constructor=="function"?e.constructor.name:null}function SE(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function _E(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function An(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=bE(e)),t}function Jh(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"?Wt(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"?Wt(1):"Expected the enhancer to be a function. Instead, received: '"+An(r)+"'");return r(Jh)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(2):"Expected the root reducer to be a function. Instead, received: '"+An(e)+"'");var s=e,i=t,o=[],a=o,c=!1;function u(){a===o&&(a=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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 i}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(4):"Expected the listener to be a function. Instead, received: '"+An(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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 u(),a.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Wt(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,u();var C=a.indexOf(h);a.splice(C,1),o=null}}}function g(h){if(!yE(h))throw new Error(process.env.NODE_ENV==="production"?Wt(7):"Actions must be plain objects. Instead, the actual type was: '"+An(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"?Wt(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"?Wt(9):"Reducers may not dispatch actions.");try{c=!0,i=s(i,h)}finally{c=!1}for(var v=o=a,y=0;y<v.length;y++){var C=v[y];C()}return h}function p(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Wt(10):"Expected the nextReducer to be a function. Instead, received: '"+An(h));s=h,g({type:yu.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"?Wt(11):"Expected the observer to be an object. Instead, received: '"+An(C)+"'");function S(){C.next&&C.next(d())}S();var _=v(S);return{unsubscribe:_}}},h[gu]=function(){return this},h}return g({type:yu.INIT}),n={dispatch:g,subscribe:f,getState:d,replaceReducer:p},n[gu]=b,n}var wE=function(t,r){return t===r};function xE(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function TE(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wE;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 bu(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 Cu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bu(Object(r),!0).forEach(function(n){EE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Su={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function AE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Su,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Rl:case Ao:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Io:return xE(e.clientOffset,r.clientOffset)?e:Cu(Cu({},e),{},{clientOffset:r.clientOffset});case Do:case ko:return Su;default:return e}}var Ml="dnd-core/ADD_SOURCE",Bl="dnd-core/ADD_TARGET",ql="dnd-core/REMOVE_SOURCE",Lo="dnd-core/REMOVE_TARGET";function IE(e){return{type:Ml,payload:{sourceId:e}}}function kE(e){return{type:Bl,payload:{targetId:e}}}function DE(e){return{type:ql,payload:{sourceId:e}}}function LE(e){return{type:Lo,payload:{targetId:e}}}function _u(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 Gt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_u(Object(r),!0).forEach(function(n){OE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_u(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var NE={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:NE,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ao:return Gt(Gt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Fl:return Gt(Gt({},e),{},{isSourcePublic:!0});case Io:return Gt(Gt({},e),{},{targetIds:r.targetIds});case Lo:return e.targetIds.indexOf(r.targetId)===-1?e:Gt(Gt({},e),{},{targetIds:VT(e.targetIds,r.targetId)});case ko:return Gt(Gt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Do:return Gt(Gt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function PE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ml:case Bl:return e+1;case ql:case Lo:return e-1;default:return e}}var eo=[],$l=[];eo.__IS_NONE__=!0;$l.__IS_ALL__=!0;function RE(e,t){if(e===eo)return!1;if(e===$l||typeof t>"u")return!0;var r=QT(t,e);return r.length>0}function FE(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Io:break;case Ml:case Bl:case Lo:case ql:return eo;case Ao:case Fl:case Do:case ko:default:return $l}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,i=s===void 0?[]:s,o=HT(n,i),a=o.length>0||!TE(n,i);if(!a)return eo;var c=i[i.length-1],u=n[n.length-1];return c!==u&&(c&&o.push(c),u&&o.push(u)),o}function ME(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function wu(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 xu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wu(Object(r),!0).forEach(function(n){BE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:FE(e.dirtyHandlerIds,{type:t.type,payload:xu(xu({},t.payload),{},{prevTargetIds:zT(e,"dragOperation.targetIds",[])})}),dragOffset:AE(e.dragOffset,t),refCount:PE(e.refCount,t),dragOperation:jE(e.dragOperation,t),stateId:ME(e.stateId)}}function $E(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ep(e,t){return{x:e.x-t.x,y:e.y-t.y}}function UE(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:ep($E(t,n),r)}function zE(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:ep(t,r)}function VE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HE(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 QE(e,t,r){return t&&HE(e.prototype,t),e}function Tu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var WE=(function(){function e(t,r){VE(this,e),Tu(this,"store",void 0),Tu(this,"registry",void 0),this.store=t,this.registry=r}return QE(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},i=s.handlerIds;Ee(typeof r=="function","listener must be a function."),Ee(typeof i>"u"||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var u=n.store.getState(),d=u.stateId;try{var f=d===o||d===o+1&&!RE(u.dirtyHandlerIds,i);f||r()}finally{o=d}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;Ee(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,i=function(){var a=n.store.getState().dragOffset;a!==s&&(s=a,r())};return this.store.subscribe(i)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return Ee(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(Ee(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(r),i=this.getItemType();return Xa(s,i)&&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(Ee(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(r),i=this.getItemType();return s!==i?!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 i=this.registry.getTargetType(r),o=this.getItemType();if(o&&!Xa(i,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var c=a.indexOf(r);return s?c===a.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 UE(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return zE(this.store.getState().dragOffset)}}]),e})(),GE=0;function KE(){return GE++}function ji(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ji=function(r){return typeof r}:ji=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ji(e)}function YE(e){Ee(typeof e.canDrag=="function","Expected canDrag to be a function."),Ee(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Ee(typeof e.endDrag=="function","Expected endDrag to be a function.")}function ZE(e){Ee(typeof e.canDrop=="function","Expected canDrop to be a function."),Ee(typeof e.hover=="function","Expected hover to be a function."),Ee(typeof e.drop=="function","Expected beginDrag to be a function.")}function Ja(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return Ja(r,!1)});return}Ee(typeof e=="string"||ji(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 Eu=typeof global<"u"?global:self,tp=Eu.MutationObserver||Eu.WebKitMutationObserver;function rp(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function XE(e){let t=1;const r=new tp(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const JE=typeof tp=="function"?XE:rp;class eA{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=JE(this.flush),this.requestErrorThrow=rp(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class tA{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 rA{create(t){const r=this.freeTasks,n=r.length?r.pop():new tA(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const np=new eA,nA=new rA(np.registerPendingError);function sA(e){np.enqueueTask(nA.create(e))}function iA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oA(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 aA(e,t,r){return t&&oA(e.prototype,t),e}function In(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lA(e,t){return fA(e)||dA(e,t)||uA(e,t)||cA()}function cA(){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 uA(e,t){if(e){if(typeof e=="string")return Au(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 Au(e,t)}}function Au(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 dA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function fA(e){if(Array.isArray(e))return e}function hA(e){var t=KE().toString();switch(e){case Jt.SOURCE:return"S".concat(t);case Jt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Iu(e){switch(e[0]){case"S":return Jt.SOURCE;case"T":return Jt.TARGET;default:Ee(!1,"Cannot parse handler ID: ".concat(e))}}function ku(e,t){var r=e.entries(),n=!1;do{var s=r.next(),i=s.done,o=lA(s.value,2),a=o[1];if(a===t)return!0;n=!!i}while(!n);return!1}var pA=(function(){function e(t){iA(this,e),In(this,"types",new Map),In(this,"dragSources",new Map),In(this,"dropTargets",new Map),In(this,"pinnedSourceId",null),In(this,"pinnedSource",null),In(this,"store",void 0),this.store=t}return aA(e,[{key:"addSource",value:function(r,n){Ja(r),YE(n);var s=this.addHandler(Jt.SOURCE,r,n);return this.store.dispatch(IE(s)),s}},{key:"addTarget",value:function(r,n){Ja(r,!0),ZE(n);var s=this.addHandler(Jt.TARGET,r,n);return this.store.dispatch(kE(s)),s}},{key:"containsHandler",value:function(r){return ku(this.dragSources,r)||ku(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Ee(this.isSourceId(r),"Expected a valid source ID.");var s=n&&r===this.pinnedSourceId,i=s?this.pinnedSource:this.dragSources.get(r);return i}},{key:"getTarget",value:function(r){return Ee(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return Ee(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return Ee(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Iu(r);return n===Jt.SOURCE}},{key:"isTargetId",value:function(r){var n=Iu(r);return n===Jt.TARGET}},{key:"removeSource",value:function(r){var n=this;Ee(this.getSource(r),"Expected an existing source."),this.store.dispatch(DE(r)),sA(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){Ee(this.getTarget(r),"Expected an existing target."),this.store.dispatch(LE(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);Ee(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){Ee(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,s){var i=hA(r);return this.types.set(i,n),r===Jt.SOURCE?this.dragSources.set(i,s):r===Jt.TARGET&&this.dropTargets.set(i,s),i}}]),e})();function mA(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=gA(n),i=new WE(s,new pA(s)),o=new vE(s,i),a=e(o,t,r);return o.receiveBackend(a),o}function gA(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Jh(qE,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var vA=["children"];function yA(e,t){return _A(e)||SA(e,t)||CA(e,t)||bA()}function bA(){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 CA(e,t){if(e){if(typeof e=="string")return Du(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 Du(e,t)}}function Du(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 SA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function _A(e){if(Array.isArray(e))return e}function wA(e,t){if(e==null)return{};var r=xA(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xA(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var Lu=0,Pi=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),TA=m.memo(function(t){var r=t.children,n=wA(t,vA),s=EA(n),i=yA(s,2),o=i[0],a=i[1];return m.useEffect(function(){if(a){var c=sp();return++Lu,function(){--Lu===0&&(c[Pi]=null)}}},[]),l.jsx(Zh.Provider,Object.assign({value:o},{children:r}),void 0)});function EA(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=AA(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function AA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sp(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[Pi]||(s[Pi]={dragDropManager:mA(e,t,r,n)}),s[Pi]}function sp(){return typeof global<"u"?global:window}function IA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kA(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 DA(e,t,r){return t&&kA(e.prototype,t),e}function Ou(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Zo=!1,Xo=!1,LA=(function(){function e(t){IA(this,e),Ou(this,"internalMonitor",void 0),Ou(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return DA(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Ee(!Zo,"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 Zo=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Zo=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Ee(!Xo,"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 Xo=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Xo=!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 OA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NA(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 jA(e,t,r){return t&&NA(e.prototype,t),e}function Nu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Jo=!1,PA=(function(){function e(t){OA(this,e),Nu(this,"internalMonitor",void 0),Nu(this,"targetId",null),this.internalMonitor=t.getMonitor()}return jA(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;Ee(!Jo,"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 Jo=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Jo=!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 RA(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 FA(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(!m.isValidElement(t)){var n=t;return e(n,r),n}var s=t;RA(s);var i=r?function(o){return e(o,r)}:e;return MA(s,i)}}function ip(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=FA(n);t[r]=function(){return s}}}),t}function ju(e,t){typeof e=="function"?e(t):e.current=t}function MA(e,t){var r=e.ref;return Ee(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?m.cloneElement(e,{ref:function(s){ju(r,s),ju(t,s)}}):m.cloneElement(e,{ref:t})}function Ri(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ri=function(r){return typeof r}:Ri=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ri(e)}function el(e){return e!==null&&Ri(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function tl(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 i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),c=0;c<i.length;c++){var u=i[c];if(!a(u))return!1;var d=e[u],f=t[u];if(s=void 0,s===!1||s===void 0&&d!==f)return!1}return!0}function BA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qA(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 $A(e,t,r){return t&&qA(e.prototype,t),e}function _t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var UA=(function(){function e(t){var r=this;BA(this,e),_t(this,"hooks",ip({dragSource:function(s,i){r.clearDragSource(),r.dragSourceOptions=i||null,el(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,i){r.clearDragPreview(),r.dragPreviewOptions=i||null,el(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),_t(this,"handlerId",null),_t(this,"dragSourceRef",null),_t(this,"dragSourceNode",void 0),_t(this,"dragSourceOptionsInternal",null),_t(this,"dragSourceUnsubscribe",void 0),_t(this,"dragPreviewRef",null),_t(this,"dragPreviewNode",void 0),_t(this,"dragPreviewOptionsInternal",null),_t(this,"dragPreviewUnsubscribe",void 0),_t(this,"lastConnectedHandlerId",null),_t(this,"lastConnectedDragSource",null),_t(this,"lastConnectedDragSourceOptions",null),_t(this,"lastConnectedDragPreview",null),_t(this,"lastConnectedDragPreviewOptions",null),_t(this,"backend",void 0),this.backend=t}return $A(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!tl(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!tl(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 zA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VA(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 HA(e,t,r){return t&&VA(e.prototype,t),e}function dr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var QA=(function(){function e(t){var r=this;zA(this,e),dr(this,"hooks",ip({dropTarget:function(s,i){r.clearDropTarget(),r.dropTargetOptions=i,el(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),dr(this,"handlerId",null),dr(this,"dropTargetRef",null),dr(this,"dropTargetNode",void 0),dr(this,"dropTargetOptionsInternal",null),dr(this,"unsubscribeDropTarget",void 0),dr(this,"lastConnectedHandlerId",null),dr(this,"lastConnectedDropTarget",null),dr(this,"lastConnectedDropTargetOptions",null),dr(this,"backend",void 0),this.backend=t}return HA(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!tl(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 WA(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function GA(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var vn=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Fi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fi=function(r){return typeof r}:Fi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fi(e)}function KA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YA(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 ZA(e,t,r){return t&&YA(e.prototype,t),e}function ea(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var XA=(function(){function e(t,r,n){KA(this,e),ea(this,"spec",void 0),ea(this,"monitor",void 0),ea(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return ZA(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,i=null;return Fi(n.item)==="object"?i=n.item:typeof n.item=="function"?i=n.item(s):i={},(r=i)!==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,i=this.monitor,o=s.isDragging;return o?o(i):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,i=r.end;i&&i(n.getItem(),n),s.reconnect()}}]),e})();function JA(e,t,r){var n=m.useMemo(function(){return new XA(e,t,r)},[t,r]);return m.useEffect(function(){n.spec=e},[e]),n}function Sn(){var e=m.useContext(Zh),t=e.dragDropManager;return Ee(t!=null,"Expected drag drop context"),t}function eI(e){return m.useMemo(function(){var t=e.type;return Ee(t!=null,"spec.type must be defined"),t},[e])}function tI(e,t){return iI(e)||sI(e,t)||nI(e,t)||rI()}function rI(){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 nI(e,t){if(e){if(typeof e=="string")return Pu(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 Pu(e,t)}}function Pu(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 sI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function iI(e){if(Array.isArray(e))return e}function oI(e,t,r){var n=Sn(),s=JA(e,t,r),i=eI(e);vn(function(){if(i!=null){var a=GA(i,s,n),c=tI(a,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d}},[n,t,r,s,i])}function aI(e){return dI(e)||uI(e)||cI(e)||lI()}function lI(){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 cI(e,t){if(e){if(typeof e=="string")return rl(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 rl(e,t)}}function uI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dI(e){if(Array.isArray(e))return rl(e)}function rl(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 op(e,t){var r=aI(t||[]);return t==null&&typeof e!="function"&&r.push(e),m.useMemo(function(){return typeof e=="function"?e():e},r)}function fI(){var e=Sn();return m.useMemo(function(){return new LA(e)},[e])}function hI(e,t){var r=Sn(),n=m.useMemo(function(){return new UA(r.getBackend())},[r]);return vn(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),vn(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var ta,Ru;function pI(){return Ru||(Ru=1,ta=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,i;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(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),ta}var mI=pI();const gI=xl(mI);function vI(e,t){return SI(e)||CI(e,t)||bI(e,t)||yI()}function yI(){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 bI(e,t){if(e){if(typeof e=="string")return Fu(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 Fu(e,t)}}function Fu(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 CI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function SI(e){if(Array.isArray(e))return e}function ap(e,t,r){var n=m.useState(function(){return t(e)}),s=vI(n,2),i=s[0],o=s[1],a=m.useCallback(function(){var c=t(e);gI(i,c)||(o(c),r&&r())},[i,e,r]);return vn(a),[i,a]}function _I(e,t){return EI(e)||TI(e,t)||xI(e,t)||wI()}function wI(){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 xI(e,t){if(e){if(typeof e=="string")return Mu(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 Mu(e,t)}}function Mu(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 TI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function EI(e){if(Array.isArray(e))return e}function AI(e,t,r){var n=ap(e,t,r),s=_I(n,2),i=s[0],o=s[1];return vn(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(o,{handlerIds:[c]})},[e,o]),i}function lp(e,t,r){return AI(t,e||function(){return{}},function(){return r.reconnect()})}function II(e){return m.useMemo(function(){return e.hooks.dragSource()},[e])}function kI(e){return m.useMemo(function(){return e.hooks.dragPreview()},[e])}function DI(e,t){var r=op(e,t);Ee(!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=fI(),s=hI(r.options,r.previewOptions);return oI(r,n,s),[lp(r.collect,n,s),II(s),kI(s)]}function LI(e){var t=e.accept;return m.useMemo(function(){return Ee(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function OI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NI(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 jI(e,t,r){return t&&NI(e.prototype,t),e}function Bu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var PI=(function(){function e(t,r){OI(this,e),Bu(this,"spec",void 0),Bu(this,"monitor",void 0),this.spec=t,this.monitor=r}return jI(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 RI(e,t){var r=m.useMemo(function(){return new PI(e,t)},[t]);return m.useEffect(function(){r.spec=e},[e]),r}function FI(e,t){return $I(e)||qI(e,t)||BI(e,t)||MI()}function MI(){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 BI(e,t){if(e){if(typeof e=="string")return qu(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 qu(e,t)}}function qu(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 qI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function $I(e){if(Array.isArray(e))return e}function UI(e,t,r){var n=Sn(),s=RI(e,t),i=LI(e);vn(function(){var a=WA(i,s,n),c=FI(a,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d},[n,t,s,r,i.map(function(o){return o.toString()}).join("|")])}function zI(){var e=Sn();return m.useMemo(function(){return new PA(e)},[e])}function VI(e){var t=Sn(),r=m.useMemo(function(){return new QA(t.getBackend())},[t]);return vn(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function HI(e){return m.useMemo(function(){return e.hooks.dropTarget()},[e])}function cp(e,t){var r=op(e,t),n=zI(),s=VI(r.options);return UI(r,n,s),[lp(r.collect,n,s),HI(s)]}function QI(e,t){return YI(e)||KI(e,t)||GI(e,t)||WI()}function WI(){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 GI(e,t){if(e){if(typeof e=="string")return $u(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 $u(e,t)}}function $u(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 KI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function YI(e){if(Array.isArray(e))return e}function ZI(e){var t=Sn(),r=t.getMonitor(),n=ap(r,e),s=QI(n,2),i=s[0],o=s[1];return m.useEffect(function(){return r.subscribeToOffsetChange(o)}),m.useEffect(function(){return r.subscribeToStateChange(o)}),i}function up(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function XI(e,t){return e.filter(function(r){return r!==t})}function JI(e,t){var r=new Set,n=function(o){return r.add(o)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(i){return s.push(i)}),s}function ek(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tk(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 rk(e,t,r){return t&&tk(e.prototype,t),e}function Uu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var nk=(function(){function e(t){ek(this,e),Uu(this,"entered",[]),Uu(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return rk(e,[{key:"enter",value:function(r){var n=this,s=this.entered.length,i=function(a){return n.isNodeInDocument(a)&&(!a.contains||a.contains(r))};return this.entered=JI(this.entered.filter(i),[r]),s===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=XI(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),sk=up(function(){return/firefox/i.test(navigator.userAgent)}),dp=up(function(){return!!window.safari});function ik(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ok(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 ak(e,t,r){return t&&ok(e.prototype,t),e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zu=(function(){function e(t,r){ik(this,e),ms(this,"xs",void 0),ms(this,"ys",void 0),ms(this,"c1s",void 0),ms(this,"c2s",void 0),ms(this,"c3s",void 0);for(var n=t.length,s=[],i=0;i<n;i++)s.push(i);s.sort(function(T,j){return t[T]<t[j]?-1:1});for(var o=[],a=[],c,u,d=0;d<n-1;d++)c=t[d+1]-t[d],u=r[d+1]-r[d],o.push(c),a.push(u/c);for(var f=[a[0]],g=0;g<o.length-1;g++){var p=a[g],b=a[g+1];if(p*b<=0)f.push(0);else{c=o[g];var h=o[g+1],v=c+h;f.push(3*v/((v+h)/p+(v+c)/b))}}f.push(a[a.length-1]);for(var y=[],C=[],S,_=0;_<f.length-1;_++){S=a[_];var x=f[_],E=1/o[_],D=x+f[_+1]-S-S;y.push((S-x-D)*E),C.push(D*E*E)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=C}return ak(e,[{key:"interpolate",value:function(r){var n=this.xs,s=this.ys,i=this.c1s,o=this.c2s,a=this.c3s,c=n.length-1;if(r===n[c])return s[c];for(var u=0,d=a.length-1,f;u<=d;){f=Math.floor(.5*(u+d));var g=n[f];if(g<r)u=f+1;else if(g>r)d=f-1;else return s[f]}c=Math.max(0,d);var p=r-n[c],b=p*p;return s[c]+i[c]*p+o[c]*b+a[c]*p*b}}]),e})(),lk=1;function fp(e){var t=e.nodeType===lk?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function pi(e){return{x:e.clientX,y:e.clientY}}function ck(e){var t;return e.nodeName==="IMG"&&(sk()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function uk(e,t,r,n){var s=e?t.width:r,i=e?t.height:n;return dp()&&e&&(i/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:i}}function dk(e,t,r,n,s){var i=ck(t),o=i?e:t,a=fp(o),c={x:r.x-a.x,y:r.y-a.y},u=e.offsetWidth,d=e.offsetHeight,f=n.anchorX,g=n.anchorY,p=uk(i,t,u,d),b=p.dragPreviewWidth,h=p.dragPreviewHeight,v=function(){var D=new zu([0,.5,1],[c.y,c.y/d*h,c.y+h-d]),T=D.interpolate(g);return dp()&&i&&(T+=(window.devicePixelRatio-1)*h),T},y=function(){var D=new zu([0,.5,1],[c.x,c.x/u*b,c.x+b-u]);return D.interpolate(f)},C=s.offsetX,S=s.offsetY,_=C===0||C,x=S===0||S;return{x:_?C:y(),y:x?S:v()}}var hp="__NATIVE_FILE__",pp="__NATIVE_URL__",mp="__NATIVE_TEXT__",gp="__NATIVE_HTML__";const Vu=Object.freeze(Object.defineProperty({__proto__:null,FILE:hp,HTML:gp,TEXT:mp,URL:pp},Symbol.toStringTag,{value:"Module"}));function ra(e,t,r){var n=t.reduce(function(s,i){return s||e.getData(i)},"");return n??r}var kn;function mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var nl=(kn={},mi(kn,hp,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),mi(kn,gp,{exposeProperties:{html:function(t,r){return ra(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),mi(kn,pp,{exposeProperties:{urls:function(t,r){return ra(t,r,"").split(`
545
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),mi(kn,mp,{exposeProperties:{text:function(t,r){return ra(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),kn);function fk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pk(e,t,r){return t&&hk(e.prototype,t),e}function Hu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var mk=(function(){function e(t){fk(this,e),Hu(this,"item",void 0),Hu(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return pk(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(i){s[i]={value:n.config.exposeProperties[i](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 gk(e,t){var r=new mk(nl[e]);return r.loadDataTransfer(t),r}function na(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(nl).filter(function(r){var n=nl[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function vk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yk(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 bk(e,t,r){return t&&yk(e.prototype,t),e}function sa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ck=(function(){function e(t,r){vk(this,e),sa(this,"ownerDocument",null),sa(this,"globalContext",void 0),sa(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return bk(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 Qu(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 Wu(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){ke(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 Sk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _k(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wk(e,t,r){return t&&_k(e.prototype,t),e}function ke(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xk=(function(){function e(t,r,n){var s=this;Sk(this,e),ke(this,"options",void 0),ke(this,"actions",void 0),ke(this,"monitor",void 0),ke(this,"registry",void 0),ke(this,"enterLeaveCounter",void 0),ke(this,"sourcePreviewNodes",new Map),ke(this,"sourcePreviewNodeOptions",new Map),ke(this,"sourceNodes",new Map),ke(this,"sourceNodeOptions",new Map),ke(this,"dragStartSourceIds",null),ke(this,"dropTargetIds",[]),ke(this,"dragEnterTargetIds",[]),ke(this,"currentNativeSource",null),ke(this,"currentNativeHandle",null),ke(this,"currentDragSourceNode",null),ke(this,"altKeyPressed",!1),ke(this,"mouseMoveTimeoutTimer",null),ke(this,"asyncEndDragFrameId",null),ke(this,"dragOverTargetIds",null),ke(this,"lastClientOffset",null),ke(this,"hoverRafId",null),ke(this,"getSourceClientOffset",function(i){var o=s.sourceNodes.get(i);return o&&fp(o)||null}),ke(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),ke(this,"isNodeInDocument",function(i){return!!(i&&s.document&&s.document.body&&s.document.body.contains(i))}),ke(this,"endDragIfSourceWasRemovedFromDOM",function(){var i=s.currentDragSourceNode;i==null||s.isNodeInDocument(i)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),ke(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),ke(this,"handleTopDragStart",function(i){if(!i.defaultPrevented){var o=s.dragStartSourceIds;s.dragStartSourceIds=null;var a=pi(i);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:a});var c=i.dataTransfer,u=na(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var d=s.monitor.getSourceId(),f=s.sourceNodes.get(d),g=s.sourcePreviewNodes.get(d)||f;if(g){var p=s.getCurrentSourcePreviewNodeOptions(),b=p.anchorX,h=p.anchorY,v=p.offsetX,y=p.offsetY,C={anchorX:b,anchorY:h},S={offsetX:v,offsetY:y},_=dk(f,g,a,C,S);c.setDragImage(g,_.x,_.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(i.target);var x=s.getCurrentSourcePreviewNodeOptions(),E=x.captureDraggingState;E?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(u)s.beginDragNativeItem(u);else{if(c&&!c.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}}}),ke(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),ke(this,"handleTopDragEnterCapture",function(i){s.dragEnterTargetIds=[];var o=s.enterLeaveCounter.enter(i.target);if(!(!o||s.monitor.isDragging())){var a=i.dataTransfer,c=na(a);c&&s.beginDragNativeItem(c,a)}}),ke(this,"handleTopDragEnter",function(i){var o=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=i.altKey,o.length>0&&s.actions.hover(o,{clientOffset:pi(i)});var a=o.some(function(c){return s.monitor.canDropOnTarget(c)});a&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),ke(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),ke(this,"handleTopDragOver",function(i){var o=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}s.altKeyPressed=i.altKey,s.lastClientOffset=pi(i),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(o||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var a=(o||[]).some(function(c){return s.monitor.canDropOnTarget(c)});a?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))}),ke(this,"handleTopDragLeaveCapture",function(i){s.isDraggingNativeItem()&&i.preventDefault();var o=s.enterLeaveCounter.leave(i.target);o&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),ke(this,"handleTopDropCapture",function(i){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var o;i.preventDefault(),(o=s.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else na(i.dataTransfer)&&i.preventDefault();s.enterLeaveCounter.reset()}),ke(this,"handleTopDrop",function(i){var o=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(o,{clientOffset:pi(i)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),ke(this,"handleSelectStart",function(i){var o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))}),this.options=new Ck(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new nk(this.isNodeInDocument)}return wk(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,s){var i=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){i.sourcePreviewNodes.delete(r),i.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var i=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var o=function(u){return i.handleDragStart(u,r)},a=function(u){return i.handleSelectStart(u)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(r),i.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,i=function(u){return s.handleDragEnter(u,r)},o=function(u){return s.handleDragOver(u,r)},a=function(u){return s.handleDrop(u,r)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",o),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",o),n.removeEventListener("drop",a)}}},{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 Wu({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 Wu({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Vu).some(function(n){return Vu[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=gk(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 i;return(i=n.rootElement)===null||i===void 0?void 0:i.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})(),gi;function Tk(){return gi||(gi=new Image,gi.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),gi}var Ek=function(t,r,n){return new xk(t,r,n)};function Ak(e,t){return typeof e=="function"?e(t):e??"NODE"}function Ik(e){return e.isDraggable&&!e.isEditing}function kk(e){const t=Bt(),r=t.selectedIds,[n,s,i]=DI(()=>({canDrag:()=>Ik(e),type:Ak(t.props.dragType,e),item:()=>{const o=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(ts.dragStart(e.id,o)),{id:e.id,dragIds:o,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(ts.dragEnd())}}),[r,e,t.props.dragType]);return m.useEffect(()=>{i(Tk())},[i]),s}function Dk(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),i=r.height,o=s<i/2,a=!o,c=i/4,u=s>c&&s<i-c;return{x:n,inTopHalf:o,inBottomHalf:a,inMiddle:u,atTop:!u&&o,atBottom:!u&&a}}function Lk(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 vi(e,t){return{parentId:e||null,index:t}}function Dn(e,t){return{type:"line",index:e,level:t}}function Ok(e){return{type:"highlight",id:e}}function ia(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,i=$h(n)+1;return{parentId:s,index:i}}function vp(e){var t;const r=Dk(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:i,nextNode:o,prevNode:a}=e,[c,u]=Lk(i,a,o,r);if(i&&i.isInternal&&r.inMiddle)return{drop:vi(i.id,null),cursor:Ok(i.id)};if(!c)return{drop:vi((t=u==null?void 0:u.parent)===null||t===void 0?void 0:t.id,0),cursor:Dn(0,0)};if(Fh(c)){const d=Di(s,(u==null?void 0:u.level)||0,c.level);return{drop:ia(c,d),cursor:Dn(c.rowIndex+1,d)}}if(Mh(c)){const d=Di(s,(u==null?void 0:u.level)||0,c.level);return{drop:ia(c,d),cursor:Dn(c.rowIndex+1,d)}}if(Bh(c)){const d=Di(s,0,c.level+1);return d>c.level?{drop:vi(c.id,0),cursor:Dn(c.rowIndex+1,d)}:{drop:ia(c,d),cursor:Dn(c.rowIndex+1,d)}}return{drop:vi(c==null?void 0:c.id,0),cursor:Dn(c.rowIndex+1,c.level+1)}}function Nk(e,t){const r=Bt(),[n,s]=cp(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(i,o)=>{const a=o.getClientOffset();if(!e.current||!a)return;const{cursor:c,drop:u}=vp({element:e.current,offset:a,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});u&&r.dispatch(ts.hovering(u.parentId,u.index)),o.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(i,o)=>{if(!o.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function jk(e){const t=Bt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return m.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Gu=m.memo(function({index:t,style:r}){Rh(),Z0();const n=Bt(),s=jk(t),i=m.useRef(null),o=kk(s),a=Nk(i,s),c=m.useCallback(h=>{i.current=h,a(h)},[a]),u=n.indent*s.level,d=m.useMemo(()=>({paddingLeft:u}),[u]),f=m.useMemo(()=>{var h,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};m.useEffect(()=>{var h;!s.isEditing&&s.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,i.current]);const p=n.renderNode,b=n.renderRow;return l.jsx(b,{node:s,innerRef:c,attrs:g,children:l.jsx(p,{node:s,tree:n,style:d,dragHandle:o})})});let oa="",Ku=null;function yp(){Rh();const e=Bt();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 i=e.mostRecentNode;for(;i&&i.isSelected;)i=i.nextSibling;i||(i=e.lastNode),e.focus(i,{scroll:!1}),e.delete(Array.from(s))}else{const i=e.focusedNode;if(i){const o=i.nextSibling,a=i.parent;e.focus(o||a,{scroll:!1}),e.delete(i)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Uh(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),zh(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 i=e.focusedNode;i?i.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 i=e.focusedNode;i?i.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(Ku),oa+=t.key,Ku=setTimeout(()=>{oa=""},600);const n=e.visibleNodes.find(s=>{const i=s.data.name;return typeof i=="string"?i.toLowerCase().startsWith(oa):!1});n&&e.focus(n.id)},children:l.jsx(Pk,{})})}function Pk(){var e,t;const r=Bt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var i;return((i=r.visibleNodes[s])===null||i===void 0?void 0:i.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:BT,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:UT,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(PT,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Gu})):l.jsx(RT,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Gu}))}function Yu(e){return e.isFiltered?Fk(e.root,e.isMatch.bind(e)):Rk(e.root)}function Rk(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(bp),t}function Fk(e,t){const r={},n=[];function s(o){if(!o.isRoot&&t(o)){r[o.id]=!0;let c=o.parent;for(;c;)r[c.id]=!0,c=c.parent}if(o.children)for(let c of o.children)s(c)}function i(o){var a;o.level>=0&&r[o.id]&&n.push(o),o.isOpen&&((a=o.children)===null||a===void 0||a.forEach(i))}return s(e),i(e),n.forEach(bp),n}function bp(e,t){e.rowIndex=t}const Zu=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var aa=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function c(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};const{safeRun:wt}=rT;class As{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=i=>{const o=this.props.rowHeight;if(typeof o=="function"){const a=this.at(i);return a?o(a):this.rowHeight}return o??24},this.rowTopPosition=i=>{if(typeof this.props.rowHeight!="function")return i*this.rowHeight;const o=this.getRowOffsets(),a=Math.max(0,Math.min(i,o.length-1));return o[a]},this.redrawList=(i=0)=>{this.rowOffsets=null;const o=this.list.current;o&&"resetAfterIndex"in o&&o.resetAfterIndex(Math.max(0,i))},this.root=su(this),this.visibleNodes=Yu(this),this.idToIndex=Zu(this.visibleNodes)}update(t){this.props=t,this.root=su(this),this.visibleNodes=Yu(this),this.idToIndex=Zu(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:((n,s)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(s.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=_s(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=_s(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof Bs)return t.id;const r=this.props.idAccessor||"id";return _s(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const s=(n=this.indexOf(t))!==null&&n!==void 0?n:0,i=this.indexOf(r);if(i===null)return[];const o=Math.min(s,i),a=Math.max(s,i);return this.visibleNodes.slice(o,a+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 aa(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?Wh(this):t.parentId,i=(r=t.index)!==null&&r!==void 0?r:Qh(this),o=(n=t.type)!==null&&n!==void 0?n:"leaf",a=yield wt(this.props.onCreate,{type:o,parentId:s,index:i,parentNode:this.get(s)});a&&(this.focus(a),setTimeout(()=>{this.edit(a).then(()=>{this.select(a),this.activate(a)})}))})}delete(t){return aa(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(o=>this.identify(o)),s=n.map(o=>this.get(o)).filter(o=>!!o),i=s.length?Math.min(...s.map(o=>{var a;return(a=o.rowIndex)!==null&&a!==void 0?a:0})):0;yield wt(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(i)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(Go(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(i=>{As.editPromise=i})}submit(t,r){return aa(this,void 0,void 0,function*(){var n,s;if(!t)return;const i=this.identify(t);yield wt(this.props.onRename,{id:i,name:r,node:this.get(i)}),this.dispatch(Go(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Go(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&wt(this.props.onActivate,r)}resolveEdit(t){const r=As.editPromise;r&&r(t),As.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(Tn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&wt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,i=this.visibleStopIndex-n;let o=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;o>n?o=n:o=Math.max(n-i,0),this.focus(this.at(o))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,i=s-n;let o=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;o<s?o=s:o=Math.min(o+i,this.visibleNodes.length-1),this.focus(this.at(o))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,i=this.identify(t);s&&this.dispatch(Tn(i)),!((n=this.get(i))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[i],anchor:i,mostRecent:i}),this.scrollTo(i,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Ir.remove(r)),wt(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(Tn(n.id)),n.isSelectable&&(this.dispatch(Ir.add(n.id)),this.dispatch(Ir.anchor(n.id)),this.dispatch(Ir.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode),wt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(Tn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:i}=this.state.nodes.selection,o=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(Ir.remove(this.nodesBetween(s,i))),this.dispatch(Ir.add(o)),this.dispatch(Ir.mostRecent(n))}this.scrollTo(n),this.focusedNode&&wt(this.props.onFocus,this.focusedNode),wt(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(Tn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&wt(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(o=>this.identify(o))),s=this.identifyNull(t.anchor),i=this.identifyNull(t.mostRecent);this.dispatch(Ir.set({ids:n,anchor:s,mostRecent:i})),wt(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 i of n)if(!i||!r||i.isInternal&&qh(r,i))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;wt(this.props.onMove,{dragIds:n,parentId:t===Ms?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(ts.cursor({type:"none"}))}showCursor(t){this.dispatch(ts.cursor(t))}open(t,r=!0){var n,s;const i=this.identifyNull(t);i&&(this.isOpen(i)||(this.dispatch(Ka.open(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,i)))}close(t,r=!0){var n,s;const i=this.identifyNull(t);i&&this.isOpen(i)&&(this.dispatch(Ka.close(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,i))}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=Pl(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(){Ji(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){Ji(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),Hh(()=>n in this.idToIndex).then(()=>{var s;const i=this.idToIndex[n];i!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(i,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===Ms)return!0;const i=(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:i}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!_s(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:s}=this.state.nodes.drag;return r===n&&s===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(Tn(t.id))}onBlur(){this.dispatch(fT())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||yp}get renderRow(){return this.props.renderRow||aT}get renderNode(){return this.props.children||lT}get renderDragPreview(){return this.props.renderDragPreview||Gh}get renderCursor(){return this.props.renderCursor||oT}}function xt(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 Mk=typeof Symbol=="function"&&Symbol.observable||"@@observable",Xu=Mk,la=()=>Math.random().toString(36).substring(7).split("").join("."),Bk={INIT:`@@redux/INIT${la()}`,REPLACE:`@@redux/REPLACE${la()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${la()}`},pn=Bk;function Cp(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 qk(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(zk(e))return"date";if(Uk(e))return"error";const r=$k(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 $k(e){return typeof e.constructor=="function"?e.constructor.name:null}function Uk(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function zk(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Lr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=qk(e)),t}function Sp(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?xt(2):`Expected the root reducer to be a function. Instead, received: '${Lr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?xt(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"?xt(1):`Expected the enhancer to be a function. Instead, received: '${Lr(r)}'`);return r(Sp)(e,t)}let n=e,s=t,i=new Map,o=i,a=0,c=!1;function u(){o===i&&(o=new Map,i.forEach((v,y)=>{o.set(y,v)}))}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?xt(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"?xt(4):`Expected the listener to be a function. Instead, received: '${Lr(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?xt(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;u();const C=a++;return o.set(C,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?xt(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,u(),o.delete(C),i=null}}}function g(v){if(!Cp(v))throw new Error(process.env.NODE_ENV==="production"?xt(7):`Actions must be plain objects. Instead, the actual type was: '${Lr(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"?xt(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"?xt(17):`Action "type" property must be a string. Instead, the actual type was: '${Lr(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?xt(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(i=o).forEach(C=>{C()}),v}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?xt(10):`Expected the nextReducer to be a function. Instead, received: '${Lr(v)}`);n=v,g({type:pn.REPLACE})}function b(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?xt(11):`Expected the observer to be an object. Instead, received: '${Lr(y)}'`);function C(){const _=y;_.next&&_.next(d())}return C(),{unsubscribe:v(C)}},[Xu](){return this}}}return g({type:pn.INIT}),{dispatch:g,subscribe:f,getState:d,replaceReducer:p,[Xu]:b}}function Ju(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Vk(e,t,r,n){const s=Object.keys(t),i=r&&r.type===pn.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(!Cp(e))return`The ${i} has unexpected type of "${Lr(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const o=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!n[a]);if(o.forEach(a=>{n[a]=!0}),!(r&&r.type===pn.REPLACE)&&o.length>0)return`Unexpected ${o.length>1?"keys":"key"} "${o.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function Hk(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:pn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?xt(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:pn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?xt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${pn.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 ed(e){const t=Object.keys(e),r={};for(let o=0;o<t.length;o++){const a=t[o];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&Ju(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(r[a]=e[a])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let i;try{Hk(r)}catch(o){i=o}return function(a={},c){if(i)throw i;if(process.env.NODE_ENV!=="production"){const f=Vk(a,r,c,s);f&&Ju(f)}let u=!1;const d={};for(let f=0;f<n.length;f++){const g=n[f],p=r[g],b=a[g],h=p(b,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?xt(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${g}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}d[g]=h,u=u||h!==b}return u=u||n.length!==Object.keys(a).length,u?d:a}}function Qk(e=es().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 Wk=ed({nodes:ed({focus:hT,edit:dT,open:pT,selection:mT,drag:Qk}),dnd:gT}),Gk=es();function Kk({treeProps:e,imperativeHandle:t,children:r}){const n=m.useRef(null),s=m.useRef(null),i=m.useRef(Sp(Wk,es(e))),o=Y0.useSyncExternalStore(i.current.subscribe,i.current.getState,()=>Gk),a=m.useMemo(()=>new As(i.current,e,n,s),[]),c=m.useRef(0);return m.useMemo(()=>{c.current+=1,a.update(e)},Object.values(e)),m.useMemo(()=>{c.current+=1,a.update(a.props)},[o.nodes.open]),m.useImperativeHandle(t,()=>a),m.useEffect(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),m.useEffect(()=>{a.props.searchTerm||i.current.dispatch(Ka.clear(!0))},[a.props.searchTerm]),l.jsx(Oh.Provider,{value:a,children:l.jsx(Ph.Provider,{value:c.current,children:l.jsx(Nh.Provider,{value:o.nodes,children:l.jsx(jh.Provider,{value:o.dnd,children:l.jsx(TA,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||Ek,options:{rootElement:a.props.dndRootElement||void 0}},{children:r}))})})})})}function Yk(){const e=Bt(),[,t]=cp(()=>({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:i,drop:o}=vp({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});o&&e.dispatch(ts.hovering(o.parentId,o.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function Zk(e){return Yk(),e.children}function Xk(){const t=Bt().props.renderContainer||yp;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function Jk(){const e=Bt(),{offset:t,mouse:r,item:n,isDragging:s}=ZI(o=>({offset:o.getSourceClientOffset(),mouse:o.getClientOffset(),item:o.getItem(),isDragging:o.isDragging()})),i=e.props.renderDragPreview||Gh;return l.jsx(i,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function eD(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:i=>i[n],getChildren:typeof s=="function"?s:i=>i[s],childrenKey:typeof s=="string"?s:"children"}}class tD{constructor(t,r={}){this.accessors=eD(r),this.root=rD(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 rD(e,t){const r=new _p({},null,t,"ROOT");return r.children=e.map(n=>Ul(n,r,t)),r}function Ul(e,t,r){const n=new _p(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(i=>Ul(i,n,r))),n}class _p{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 i=Ul(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,i);const o=this.accessors.childrenKey,a=this.data;a[o]=(s=a[o])!==null&&s!==void 0?s:[],a[o].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 nD=0;function sD(e,t={}){const[r,n]=m.useState(e),s=t.idAccessor,i=t.childrenAccessor,o=m.useMemo(()=>new tD(r,{idAccessor:s,childrenAccessor:i}),[r,s,i]),a=b=>{for(const h of b.dragIds)o.move({id:h,parentId:b.parentId,index:b.index});n(o.data)},c=({name:b,id:h})=>{o.update({id:h,changes:{name:b}}),n(o.data)},u=typeof s=="string"?s:"id",d=typeof i=="string"?i:"children";return[r,{onMove:a,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 i=="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={[u]:`simple-tree-id-${nD++}`,name:""};return v==="internal"&&(y[d]=[]),o.create({parentId:b,index:h,data:y}),n(o.data),y},onDelete:b=>{b.ids.forEach(h=>o.drop({id:h})),n(o.data)}}]}function iD(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]=sD(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function oD(e,t){const r=iD(e);return l.jsxs(Kk,{treeProps:r,imperativeHandle:t,children:[l.jsx(Zk,{children:l.jsx(Xk,{})}),l.jsx(Jk,{})]})}const aD=m.forwardRef(oD);function zl(){return ue(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 lD(){return ue(e=>{var s;if(!e.selectedNodeId)return!1;const t=(s=e.treeData[0])==null?void 0:s.id,r=i=>{var o;for(const a of i){if(a.id===e.selectedNodeId)return a;if((o=a.children)!=null&&o.length){const c=r(a.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const td={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},rd={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},nd=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],cD=[{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 uD(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 ni(e){const t=uD(e);return{key:t,color:td[t]??td.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:rd[t]??rd.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const dD="_row_nm332_1",fD="_grip_nm332_16",hD="_menuBtn_nm332_19",pD="_rowLp_nm332_23",mD="_selected_nm332_27",gD="_title_nm332_32",vD="_dropTarget_nm332_41",yD="_toggle_nm332_58",bD="_ctIcon_nm332_73",CD="_ctIconLp_nm332_85",SD="_folderIcon_nm332_89",_D="_rootIcon_nm332_94",wD="_titleLp_nm332_110",xD="_levelTitle_nm332_114",TD="_renameInput_nm332_119",ED="_dropHere_nm332_128",AD="_menuWrap_nm332_138",ID="_menu_nm332_19",kD="_dangerItem_nm332_190",it={row:dD,grip:fD,menuBtn:hD,rowLp:pD,selected:mD,title:gD,dropTarget:vD,toggle:yD,ctIcon:bD,ctIconLp:CD,folderIcon:SD,rootIcon:_D,titleLp:wD,levelTitle:xD,renameInput:TD,dropHere:ED,menuWrap:AD,menu:ID,dangerItem:kD},DD={video:So,pdf:Zs,h5p:vo,scorm:bo,audio:yo,quiz:go,course:Wr,default:Gr},LD=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[s,i]=m.useState(!1),[o,a]=m.useState(!1),[c,u]=m.useState(e.data.name),d=m.useRef(null),f=ae(),g=Z(N=>N.editorProfile),p=n==="edit",b=zl(),h=ni(e.data),v=DD[h.key]??Gr,y=e.isSelected,C=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),_=g.key==="learningPath",x=C?_?Ih:by:S?_?ky:Rf:v,E=_&&S&&!C&&!lt(e.data),D=e.level+1<=g.maxDepth,T=_?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,j=_?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;m.useEffect(()=>{if(!s)return;const N=B=>{var P;(P=d.current)!=null&&P.contains(B.target)||i(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[s]);const F=m.useCallback(()=>{c.trim()&&e.submit(c.trim()),a(!1)},[c,e]),O=m.useCallback(N=>{N.key==="Enter"&&F(),N.key==="Escape"&&(u(e.data.name),a(!1))},[F,e.data.name]);return l.jsxs("div",{className:[it.row,_?it.rowLp:"",y?it.selected:"",e.state.isOver&&S?it.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":S?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":S?!e.isClosed:void 0,children:[p&&l.jsx("span",{ref:r,className:it.grip,"aria-hidden":"true",children:l.jsx(Ff,{size:14})}),l.jsx("button",{className:it.toggle,onClick:N=>{N.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(wl,{size:14}):l.jsx(bn,{size:14})}),l.jsx("span",{className:[it.ctIcon,C||S?it.folderIcon:h.bgClass,_?it.ctIconLp:"",C&&_?it.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(x,{size:C&&_?15:12})}),o?l.jsx("input",{className:it.renameInput,value:c,autoFocus:!0,onChange:N=>u(N.target.value),onBlur:F,onKeyDown:O,onClick:N=>N.stopPropagation()}):l.jsx("span",{className:[it.title,_?it.titleLp:"",E?it.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>p&&a(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:it.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),p&&l.jsxs("div",{className:it.menuWrap,ref:d,children:[l.jsx("button",{className:it.menuBtn,onClick:N=>{N.stopPropagation(),i(B=>!B)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(jf,{size:14})}),s&&l.jsxs("div",{className:it.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{a(!0),i(!1)},children:[l.jsx(Ny,{size:13})," ",f.treeNode.renameMenuItem]}),S&&b&&D&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),i(!1)},children:[l.jsx(Pf,{size:13})," ",T]}),e.data.parent&&b&&!_&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),i(!1)},children:[l.jsx(Cn,{size:13})," ",j]}),!C&&l.jsxs("button",{role:"menuitem",className:it.dangerItem,onClick:()=>{e.tree.delete(e.id),i(!1)},children:[l.jsx(Co,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function OD(e,t){var i,o;const n=((i=(await Re.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:i.result)??{},s=((o=n.content)==null?void 0:o.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!s)throw new Error("Could not obtain an upload URL");return s}async function ND(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 jD(e,t){var a;const r=await OD(e,t.name),n=await ND(r,t),s=new FormData;return s.append("fileUrl",n),s.append("mimeType",t.type||"text/csv"),{processId:(((a=(await Re.post(`/action/collection/v1/import/${e}`,s)).data)==null?void 0:a.result)??{}).processId??""}}async function PD(e){var r;return((r=(await Re.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function wp(e){var n,s,i;const r=(i=(s=(n=(await Re.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:i.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function RD(e){return wp(e)}const FD="_container_jw2be_1",MD="_header_jw2be_13",BD="_title_jw2be_22",qD="_closeBtn_jw2be_29",$D="_body_jw2be_45",UD="_dropZone_jw2be_54",zD="_dragOver_jw2be_67",VD="_hasFile_jw2be_72",HD="_hiddenInput_jw2be_78",QD="_fileInfo_jw2be_82",WD="_fileIcon_jw2be_89",GD="_fileName_jw2be_93",KD="_fileSize_jw2be_100",YD="_dropHint_jw2be_105",ZD="_dropIcon_jw2be_112",XD="_dropText_jw2be_117",JD="_dropSubtext_jw2be_124",eL="_sampleLink_jw2be_130",tL="_statusBar_jw2be_145",rL="_status_uploading_jw2be_154",nL="_status_processing_jw2be_154",sL="_status_done_jw2be_159",iL="_status_error_jw2be_164",oL="_successDetail_jw2be_170",aL="_spinner_jw2be_175",lL="_spin_jw2be_175",cL="_errorMsg_jw2be_191",uL="_failedSection_jw2be_197",dL="_failedTitle_jw2be_203",fL="_tableWrap_jw2be_213",hL="_failedTable_jw2be_219",pL="_reasonCell_jw2be_244",mL="_footer_jw2be_248",Be={container:FD,header:MD,title:BD,closeBtn:qD,body:$D,dropZone:UD,dragOver:zD,hasFile:VD,hiddenInput:HD,fileInfo:QD,fileIcon:WD,fileName:GD,fileSize:KD,dropHint:YD,dropIcon:ZD,dropText:XD,dropSubtext:JD,sampleLink:eL,statusBar:tL,status_uploading:rL,status_processing:nL,status_done:sL,status_error:iL,successDetail:oL,spinner:aL,spin:lL,errorMsg:cL,failedSection:uL,failedTitle:dL,tableWrap:fL,failedTable:hL,reasonCell:pL,footer:mL},gL=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const s=ae(),[i,o]=m.useState(null),[a,c]=m.useState(!1),[u,d]=m.useState("idle"),[f,g]=m.useState(""),[p,b]=m.useState([]),[h,v]=m.useState(null),y=m.useRef(null),C=m.useRef(null),S=m.useCallback(()=>{C.current!==null&&(clearInterval(C.current),C.current=null)},[]);m.useEffect(()=>()=>S(),[S]);const _=O=>O.name.toLowerCase().endsWith(".csv")?O.size>50*1024*1024?(g(s.csvUpload.fileTooLarge),!1):!0:(g(s.csvUpload.invalidFileType),!1),x=m.useCallback(O=>{g(""),b([]),v(null),d("idle"),_(O)&&o(O)},[]),E=m.useCallback(O=>{O.preventDefault(),c(!1);const N=O.dataTransfer.files[0];N&&x(N)},[x]),D=m.useCallback(O=>{var B;const N=(B=O.target.files)==null?void 0:B[0];N&&x(N),O.target.value=""},[x]),T=m.useCallback(async()=>{try{const O=await RD(e),N=document.createElement("a");N.href=O,N.download="sample_hierarchy.csv",N.target="_blank",N.click()}catch{g(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),j=m.useCallback(async()=>{if(i){d("uploading"),g(""),b([]);try{const{processId:O}=await jD(e,i);if(!O){d("done"),v(null),setTimeout(t,1500);return}d("processing"),C.current=setInterval(async()=>{try{const N=await PD(O);N.status==="COMPLETED"?(S(),d("done"),v(N.successCount??null),N.failedRecords&&N.failedRecords.length>0?b(N.failedRecords):setTimeout(t,1500)):N.status==="FAILED"&&(S(),d("error"),g(s.csvUpload.processingFailed),N.failedRecords&&b(N.failedRecords))}catch{S(),d("error"),g(s.csvUpload.connectionLost)}},2e3)}catch{d("error"),g(s.csvUpload.uploadFailed)}}},[e,i,t,S,s.csvUpload.processingFailed,s.csvUpload.connectionLost,s.csvUpload.uploadFailed]),F={idle:"",uploading:s.csvUpload.statusUploading,processing:s.csvUpload.statusProcessing,done:s.csvUpload.statusDone,error:s.csvUpload.statusError};return l.jsxs("div",{className:Be.container,children:[l.jsxs("div",{className:Be.header,children:[l.jsx("h2",{className:Be.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),l.jsx("button",{className:Be.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:l.jsx(yr,{size:18})})]}),l.jsxs("div",{className:Be.body,children:[l.jsxs("div",{className:`${Be.dropZone} ${a?Be.dragOver:""} ${i?Be.hasFile:""}`,onDragEnter:O=>{O.preventDefault(),c(!0)},onDragOver:O=>{O.preventDefault(),c(!0)},onDragLeave:O=>{O.preventDefault(),c(!1)},onDrop:E,onClick:()=>{var O;return(O=y.current)==null?void 0:O.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:O=>{var N;return O.key==="Enter"&&((N=y.current)==null?void 0:N.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:Be.hiddenInput,onChange:D,"aria-hidden":"true"}),i?l.jsxs("div",{className:Be.fileInfo,children:[l.jsx(Zs,{size:24,className:Be.fileIcon}),l.jsx("span",{className:Be.fileName,children:i.name}),l.jsxs("span",{className:Be.fileSize,children:["(",(i.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Be.dropHint,children:[l.jsx(Fa,{size:32,className:Be.dropIcon}),l.jsx("p",{className:Be.dropText,children:s.csvUpload.dropText}),l.jsx("p",{className:Be.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:Be.sampleLink,onClick:T,type:"button",children:s.csvUpload.downloadSample}),u!=="idle"&&l.jsxs("div",{className:`${Be.statusBar} ${Be[`status_${u}`]}`,role:"status","aria-live":"polite",children:[u==="processing"&&l.jsx("span",{className:Be.spinner,"aria-hidden":"true"}),F[u],u==="done"&&h!==null&&l.jsx("span",{className:Be.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:Be.errorMsg,role:"alert",children:f}),p.length>0&&l.jsxs("div",{className:Be.failedSection,children:[l.jsx("h4",{className:Be.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(p.length))}),l.jsx("div",{className:Be.tableWrap,children:l.jsxs("table",{className:Be.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:p.map((O,N)=>l.jsxs("tr",{children:[l.jsx("td",{children:O.rowNumber??N+1}),l.jsx("td",{children:O.name??"—"}),l.jsx("td",{className:Be.reasonCell,children:O.reason??s.csvUpload.unknownError})]},N))})]})})]})]}),l.jsxs("div",{className:Be.footer,children:[l.jsx(qe,{variant:"ghost",onClick:r,disabled:u==="uploading"||u==="processing",children:s.csvUpload.cancel}),l.jsx(qe,{variant:"primary",isLoading:u==="uploading"||u==="processing",disabled:!i||u==="done",onClick:j,children:u==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})};function Vl(){var g,p,b,h,v;const e=ae(),t=ue(y=>y.treeData),r=ue(y=>y.treeCache),n=ue(y=>y.deleteNode),s=Hr(y=>y.activeAssessmentSlot),i=Hr(y=>y.setActiveAssessmentSlot),o=((g=t[0])==null?void 0:g.children)??[],a=o[0],c=o.length>1?o[o.length-1]:void 0,u=lt(a),d=lt(c),f=y=>{var D,T;const C=y==="pre"?a:c;if(!C)return;const S=t[0],_=S?((D=r[S.id])==null?void 0:D.policy)??((T=S.metadata)==null?void 0:T.policy):void 0,E=y==="pre"&&!!_&&wh.has(_)?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;window.confirm(E)&&n(C.id)};return{pre:{level:a,filled:u,courseName:u?(b=(p=a==null?void 0:a.children)==null?void 0:p[0])==null?void 0:b.name:void 0},post:{level:c,filled:d,courseName:d?(v=(h=c==null?void 0:c.children)==null?void 0:h[0])==null?void 0:v.name:void 0},activeAssessmentSlot:s,setActiveAssessmentSlot:i,deleteSlot:f}}const vL="_container_2qylm_1",yL="_header_2qylm_8",bL="_sectionLabel_2qylm_18",CL="_headerActions_2qylm_26",SL="_iconBtn_2qylm_33",_L="_menuWrap_2qylm_51",wL="_dropdownMenu_2qylm_55",xL="_treeWrapper_2qylm_87",TL="_csvModal_2qylm_103",EL="_footer_2qylm_113",rr={container:vL,header:yL,sectionLabel:bL,headerActions:CL,iconBtn:SL,menuWrap:_L,dropdownMenu:wL,treeWrapper:xL,csvModal:TL,footer:EL},AL=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var ce;const n=ae(),s=m.useRef(null),i=m.useRef(null),o=m.useRef(null),[a,c]=m.useState(400),[u,d]=m.useState(!1),[f,g]=m.useState(!1),[p,b]=m.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:C,deleteNode:S,reorderChildren:_,moveNode:x,setTreeData:E}=ue(),D=Z(Q=>Q.editorProfile),T=D.key==="learningPath",j=e==="edit",F=zl(),O=j&&F,N=T?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,B=D.maxDepth>1,P=(((ce=h[0])==null?void 0:ce.children)??[]).some(Q=>Q.isFolder),{pre:U,post:ne,deleteSlot:H}=Vl(),{level:te}=U,{level:he}=ne,oe=Z(Q=>{var se,Te,me,ee;return((Te=(se=Q.editorConfig)==null?void 0:se.context)==null?void 0:Te.contentId)??((ee=(me=Q.editorConfig)==null?void 0:me.context)==null?void 0:ee.identifier)??""}),ge=Z(Q=>{var Te,me;const se=(me=(Te=Q.categoryMeta)==null?void 0:Te.sourcingSettings)==null?void 0:me.collection;return(se==null?void 0:se.enableBulkUpload)!==!1}),ve=D.features.csvUpload&&ge;m.useEffect(()=>{const Q=i.current;if(!Q)return;const se=new ResizeObserver(()=>{c(Q.clientHeight||400)});return se.observe(Q),c(Q.clientHeight||400),()=>se.disconnect()},[]),m.useEffect(()=>{if(!u)return;const Q=se=>{var Te;(Te=o.current)!=null&&Te.contains(se.target)||d(!1)};return document.addEventListener("mousedown",Q),()=>document.removeEventListener("mousedown",Q)},[u]);const xe=m.useCallback(Q=>{Q.length>0&&y(Q[0].data.id)},[y]),ye=m.useCallback(({parentId:Q,index:se,dragIds:Te})=>{if(!Q)return;const me=Te[0],ee=sl(h,me);if(!ee)return;const He=ee.parent;if(He===Q){const Ge=sl(h,Q);if(!(Ge!=null&&Ge.children))return;const Ze=Ge.children.findIndex(Qe=>Qe.id===me);if(Ze<0)return;_(Q,Ze,se>Ze?se-1:se)}else x(me,He??"",Q)},[h,_,x]),R=m.useCallback(({ids:Q})=>{for(const se of Q){if(T&&(te==null?void 0:te.id)===se){H("pre");continue}if(T&&(he==null?void 0:he.id)===se){H("post");continue}S(se)}},[S,H,T,te,he]),M=m.useCallback(({parentId:Q})=>{var me;const se=Q??((me=h[0])==null?void 0:me.id)??"";if(!se)return{id:crypto.randomUUID()};const Te=C(se,"unit");return Te?{id:Te}:(we.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[C,h,n]),Y=m.useCallback(()=>{var se;const Q=(se=h[0])==null?void 0:se.id;Q&&(C(Q,"unit")||we.error(n.outlineTree.maxDepthReachedToast))},[h,C,n]),le=m.useCallback(()=>{v&&(C(v,"subunit")||we.error(n.outlineTree.maxDepthReachedToast))},[v,C,n]),Ce=m.useCallback(async()=>{if(d(!1),!!oe)try{const Q=await wp(oe),se=await fetch(Q).then(ee=>ee.blob()),Te=URL.createObjectURL(se),me=document.createElement("a");me.href=Te,me.download=`${oe}-folders.csv`,me.style.display="none",document.body.appendChild(me),me.click(),document.body.removeChild(me),URL.revokeObjectURL(Te)}catch{we.error(n.outlineTree.downloadCsvFailedToast)}},[oe,n]),de=m.useCallback(async()=>{if(g(!1),!!oe)try{const{rootNode:Q}=await gh(oe);E([Q]),we.success(n.outlineTree.outlineRefreshedToast)}catch{we.error(n.outlineTree.outlineRefreshFailedToast)}},[oe,E,n]);return l.jsxs("div",{className:rr.container,children:[l.jsxs("div",{className:rr.header,children:[T&&l.jsx("span",{className:rr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:rr.headerActions,children:[j&&ve&&l.jsxs("div",{className:rr.menuWrap,ref:o,children:[l.jsx("button",{type:"button",className:rr.iconBtn,onClick:()=>d(Q=>!Q),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":u,children:l.jsx(jf,{size:15})}),u&&l.jsxs("div",{className:rr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:P,title:P?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{d(!1),b("create"),g(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!P,title:P?void 0:n.outlineTree.noFoldersYetTitle,onClick:Ce,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!P,title:P?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{d(!1),b("update"),g(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:rr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(Ly,{size:15}):l.jsx(Dy,{size:15})})]})]}),l.jsx("div",{className:rr.treeWrapper,ref:i,children:l.jsx(aD,{ref:s,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:xe,onMove:j?ye:void 0,onDelete:j?R:void 0,onCreate:j?M:void 0,disableEdit:!j,disableDrop:!j,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:a,width:"100%",children:Q=>l.jsx(LD,{...Q,editorMode:e})})}),j&&l.jsxs("div",{className:rr.footer,children:[l.jsxs(qe,{variant:"ghost",size:"sm",onClick:Y,disabled:!O,children:[l.jsx(Cn,{size:14})," ",N]}),B&&l.jsxs(qe,{variant:"ghost",size:"sm",onClick:le,disabled:!O||!v,children:[l.jsx(Pf,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:rr.csvModal,children:l.jsx(gL,{contentId:oe,mode:p,onComplete:de,onClose:()=>g(!1)})})]})};function sl(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=sl(r.children,t);if(n)return n}}}const IL="_breadcrumb_zd1aj_1",kL="_crumb_zd1aj_10",DL="_sep_zd1aj_26",LL="_current_zd1aj_31",gs={breadcrumb:IL,crumb:kL,sep:DL,current:LL},OL=({crumbs:e})=>{const t=ue(n=>n.selectNode),r=ae();return e.length?l.jsxs("nav",{className:gs.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:gs.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Ay,{size:13})}),e.map((n,s)=>l.jsxs(m.Fragment,{children:[l.jsx(wl,{size:13,className:gs.sep}),s<e.length-1?l.jsx("button",{className:gs.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:gs.current,children:n.name})]},n.id))]}):null},NL="_tabBar_qhks1_1",jL="_tab_qhks1_1",PL="_active_qhks1_29",RL="_error_qhks1_35",FL="_errorDot_qhks1_39",vs={tabBar:NL,tab:jL,active:PL,error:RL,errorDot:FL},ML=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=ae(),i=[{id:"details",label:s.tabBar.detailsTab},{id:"audience",label:s.tabBar.audienceCurriculumTab},{id:"licensing",label:s.tabBar.licensingTab}],o=n?i.filter(a=>n.includes(a.id)):i;return l.jsx("div",{className:vs.tabBar,role:"tablist","aria-label":s.tabBar.metadataSectionsAriaLabel,children:o.map(a=>l.jsxs("button",{role:"tab","aria-selected":e===a.id,"aria-controls":`panel-${a.id}`,className:[vs.tab,e===a.id?vs.active:"",r.includes(a.id)?vs.error:""].join(" "),onClick:()=>t(a.id),children:[a.label,r.includes(a.id)&&l.jsx("span",{className:vs.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},a.id))})};var si=e=>e.type==="checkbox",tn=e=>e instanceof Date,vt=e=>e==null;const xp=e=>typeof e=="object";var Ye=e=>!vt(e)&&!Array.isArray(e)&&xp(e)&&!tn(e),il=e=>Ye(e)&&e.target?si(e.target)?e.target.checked:e.target.value:e,Tp=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Ep=e=>{const t=e.constructor&&e.constructor.prototype;return Ye(t)&&t.hasOwnProperty("isPrototypeOf")},Oo=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xe(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Oo&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ye(e)&&Ep(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Xe(e[s]));return n}const Nr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ir={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},nr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ca="form",Ap="root",Ip=["__proto__","constructor","prototype"];var ii=e=>/^\w*$/.test(e),We=e=>e===void 0,No=e=>e.split(/[.[\]'"]/g).filter(Boolean),W=(e,t,r)=>{if(!t||!Ye(e))return r;const n=ii(t)?[t]:No(t);if(n.some(i=>Ip.includes(i)))return r;const s=n.reduce((i,o)=>vt(i)?void 0:i[o],e);return We(s)||s===e?We(e[t])?r:e[t]:s},Vt=e=>typeof e=="boolean",Et=e=>typeof e=="function",ze=(e,t,r)=>{let n=-1;const s=ii(t)?[t]:No(t),i=s.length,o=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==o){const u=e[a];c=Ye(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(Ip.includes(a))return;e[a]=c,e=e[a]}};const Hl=m.createContext(null);Hl.displayName="HookFormControlContext";const Ql=()=>m.useContext(Hl);var kp=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==ir.all&&(t._proxyFormState[o]=!n||ir.all),r&&(r[o]=!0),e[o]}});return s};const Wl=Oo?m.useLayoutEffect:m.useEffect;function BL(e){const t=Ql(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[o,a]=m.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Wl(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:u=>{!n&&a({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),m.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),m.useMemo(()=>kp(o,r,c.current,!1),[o,r])}var At=e=>typeof e=="string",ol=(e,t,r,n,s)=>At(e)?(n&&t.watch.add(e),W(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),W(r,i))):(n&&(t.watchAll=!0),r),al=e=>vt(e)||!xp(e);const sd=(e,t)=>t.length===0&&!Array.isArray(e)&&!Ep(e);function Ht(e,t,r=new WeakMap){if(e===t)return!0;if(al(e)||al(t))return Object.is(e,t);if(tn(e)&&tn(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(sd(e,n)||sd(t,s))return Object.is(e,t);const i=r.get(e);if(i&&i.has(t))return!0;i?i.add(t):r.set(e,new WeakSet([t]));for(const o of n){const a=e[o];if(!(o in t))return!1;if(o!=="ref"){const c=t[o];if(tn(a)&&tn(c)||(Ye(a)||Array.isArray(a))&&(Ye(c)||Array.isArray(c))?!Ht(a,c,r):!Object.is(a,c))return!1}}return!0}function qL(e){const t=Ql(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:o,compute:a}=e||{},c=m.useRef(s),u=m.useRef(a),d=m.useRef(void 0),f=m.useRef(r),g=m.useRef(n);u.current=a;const[p,b]=m.useState(()=>{const _=r._getWatch(n,c.current);return u.current?u.current(_):_}),h=m.useCallback(_=>{const x=ol(n,r._names,_||r._formValues,!1,c.current);return u.current?u.current(x):x},[r._formValues,r._names,n]),v=m.useCallback(_=>{if(!i){const x=ol(n,r._names,_||r._formValues,!1,c.current);if(u.current){const E=u.current(x);Ht(E,d.current)||(b(E),d.current=E)}else b(x)}},[r._formValues,r._names,i,n]);Wl(()=>((f.current!==r||!Ht(g.current,n))&&(f.current=r,g.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:o,callback:_=>{v(_.values)}})),[r,o,n,v]),m.useEffect(()=>r._removeUnmounted());const y=f.current!==r,C=g.current,S=m.useMemo(()=>{if(i)return null;const _=!y&&!Ht(C,n);return y||_?h():null},[i,y,n,C,h]);return S!==null?S:p}function oi(e){const t=Ql(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:o,exact:a=!0}=e,c=Tp(s._names.array,r),u=m.useMemo(()=>W(s._formValues,r,W(s._defaultValues,r,o)),[s,r,o]),d=qL({control:s,name:r,defaultValue:u,exact:a}),f=BL({control:s,name:r,exact:a}),g=m.useRef(e),p=m.useRef(null),b=m.useRef(s.register(r,{...e.rules,value:d,...Vt(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const h=m.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]),v=m.useCallback(_=>{const x=il(_);return W(s._fields,r)||(b.current=s.register(r,{...g.current.rules,value:x})),b.current.onChange({target:{value:il(_),name:r},type:Nr.CHANGE})},[r,s]),y=m.useCallback(()=>b.current.onBlur({target:{value:W(s._formValues,r),name:r},type:Nr.BLUR}),[r,s._formValues]),C=m.useCallback(_=>{_&&(p.current={focus:()=>Et(_.focus)&&_.focus(),select:()=>Et(_.select)&&_.select(),setCustomValidity:E=>Et(_.setCustomValidity)&&_.setCustomValidity(E),reportValidity:()=>Et(_.reportValidity)&&_.reportValidity()});const x=W(s._fields,r);x&&x._f&&_&&(x._f.ref=p.current)},[s._fields,r]),S=m.useMemo(()=>({name:r,value:d,...Vt(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:C}),[r,n,f.disabled,v,y,C,d]);return m.useEffect(()=>{const _=s._options.shouldUnregister||i;s.register(r,{...g.current.rules,...Vt(g.current.disabled)?{disabled:g.current.disabled}:{}});const x=(E,D)=>{const T=W(s._fields,E);T&&T._f&&(T._f.mount=D)};if(x(r,!0),_){const E=Xe(W(i?s._defaultValues:s._options.values||s._defaultValues,r,W(s._options.defaultValues,r,g.current.defaultValue)));ze(s._defaultValues,r,E),We(W(s._formValues,r))&&ze(s._formValues,r,E)}if(!c&&s.register(r),p.current){const E=W(s._fields,r);E&&E._f&&(E._f.ref=p.current)}return()=>{(c?_&&!s._state.action:_)?s.unregister(r):x(r,!1)}},[r,s,c,i]),m.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),m.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const $L=e=>e.render(oi(e)),Gl=m.createContext(null);Gl.displayName="HookFormContext";const er=()=>m.useContext(Gl),UL=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:o,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:g,unregister:p,control:b,register:h,setFocus:v,subscribe:y})=>{const C=m.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:o,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:g,unregister:p,control:b,register:h,setFocus:v,subscribe:y}),[i,b,u,n,r,g,h,f,d,s,v,o,a,y,c,p,t]);return m.createElement(Gl.Provider,{value:C},m.createElement(Hl.Provider,{value:C.control},e))};var zL=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Dp=e=>Array.isArray(e)?e.filter(Boolean):[],Mi=e=>Array.isArray(e)?e:[e],id=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function Lp(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&&Ye(s)&&i){const o=Lp(s,i);Ye(o)&&(r[n]=o)}else e[n]&&(r[n]=i)}return r}var ft=e=>Ye(e)&&!Object.keys(e).length,Kl=e=>e.type==="file",to=e=>{if(!Oo)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Op=e=>e.type==="select-multiple",Yl=e=>e.type==="radio",VL=e=>Yl(e)||si(e),ua=e=>to(e)&&e.isConnected;function HL(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(vt(e)){e=void 0;break}e=e[t[n]],n++}return e}function QL(e){for(const t in e)if(e.hasOwnProperty(t)&&!We(e[t]))return!1;return!0}function nt(e,t){if(At(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:ii(t)?[t]:No(t),n=r.length===1?e:HL(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(Ye(n)&&ft(n)||Array.isArray(n)&&QL(n))&&nt(e,r.slice(0,-1)),e}var WL=e=>{for(const t in e)if(Et(e[t]))return!0;return!1};function Np(e){return Array.isArray(e)||Ye(e)&&!WL(e)}function ll(e,t={}){for(const r in e){const n=e[r];Np(n)?(t[r]=Array.isArray(n)?[]:{},ll(n,t[r])):We(n)||(t[r]=!0)}return t}function cl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>cl(r));return t.some(r=>r!==void 0)?t:void 0}if(Ye(e)){const t={};for(const r in e){const n=cl(e[r]);We(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Xr(e,t,r){r||(r=ll(t));for(const n in e){const s=e[n];if(Np(s))We(t)||al(r[n])?r[n]=ll(s,Array.isArray(s)?[]:{}):Xr(s,vt(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!Ht(s,i)}}return cl(r)||{}}const od={value:!1,isValid:!1},ad={value:!0,isValid:!0};var jp=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&&!We(e[0].attributes.value)?We(e[0].value)||e[0].value===""?ad:{value:e[0].value,isValid:!0}:ad:od}return od},Pp=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>We(e)?e:t?e===""?NaN:e&&+e:r&&At(e)?new Date(e):n?n(e):e;const ld={isValid:!1,value:null};var Rp=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ld):ld;function cd(e){const t=e.ref;return Kl(t)?t.files:Yl(t)?Rp(e.refs).value:Op(t)?[...t.selectedOptions].map(({value:r})=>r):si(t)?jp(e.refs).value:Pp(We(t.value)?e.ref.value:t.value,e)}var GL=(e,t,r,n)=>{const s={};for(const i of e){const o=W(t,i);o&&ze(s,i,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},ro=e=>e instanceof RegExp,ys=e=>We(e)?e:ro(e)?e.source:Ye(e)?ro(e.value)?e.value.source:e.value:e,ud=e=>({isOnSubmit:!e||e===ir.onSubmit,isOnBlur:e===ir.onBlur,isOnChange:e===ir.onChange,isOnAll:e===ir.all,isOnTouch:e===ir.onTouched});const dd="AsyncFunction";var KL=e=>!!e&&!!e.validate&&!!(Et(e.validate)&&e.validate.constructor.name===dd||Ye(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===dd)),YL=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),da=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Is=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=W(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Is(a,t))break}else if(Ye(a)&&Is(a,t))break}}};function fd(e,t,r){const n=W(e,r);if(n||ii(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),o=W(t,i),a=W(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var ZL=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return ft(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||ir.all))},XL=(e,t,r)=>!e||!t||e===t||Mi(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),JL=(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,eO=(e,t)=>!Dp(W(e,t)).length&&nt(e,t),hd=(e,t,r)=>{const n=W(e,r),s=Array.isArray(n)?n:[];return ze(s,Ap,t[r]),ze(e,r,s),e};function pd(e,t,r="validate"){if(At(e)||Array.isArray(e)&&e.every(At)||Vt(e)&&!e)return{type:r,message:At(e)?e:"",ref:t}}var Ln=e=>Ye(e)&&!ro(e)?e:{value:e,message:""},md=async(e,t,r,n,s,i)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:d,min:f,max:g,pattern:p,validate:b,name:h,valueAsNumber:v,mount:y}=e._f,C=W(r,h);if(!y||t.has(h))return{};const S=a?a[0]:o,_=N=>{if(s&&S.reportValidity){const B=Vt(N)?"":N||"";a?a.forEach(P=>P.setCustomValidity(B)):S.setCustomValidity(B),S.reportValidity()}},x={},E=Yl(o),D=si(o),T=E||D,j=(v||Kl(o))&&We(o.value)&&We(C)||to(o)&&o.value===""||C===""||Array.isArray(C)&&!C.length,F=zL.bind(null,h,n,x),O=(N,B,P,U=nr.maxLength,ne=nr.minLength)=>{const H=N?B:P;x[h]={type:N?U:ne,message:H,ref:o,...F(N?U:ne,H)}};if(i?!Array.isArray(C)||!C.length:c&&(!T&&(j||vt(C))||Vt(C)&&!C||D&&!jp(a).isValid||E&&!Rp(a).isValid)){const{value:N,message:B}=At(c)?{value:!!c,message:c}:Ln(c);if(N&&(x[h]={type:nr.required,message:B,ref:S,...F(nr.required,B)},!n))return _(B),x}if(!j&&(!vt(f)||!vt(g))){let N,B;const P=Ln(g),U=Ln(f);if(!vt(C)&&!isNaN(C)){const ne=o.valueAsNumber||C&&+C;vt(P.value)||(N=ne>P.value),vt(U.value)||(B=ne<U.value)}else{const ne=o.valueAsDate||new Date(C),H=oe=>new Date(new Date().toDateString()+" "+oe),te=o.type=="time",he=o.type=="week";At(P.value)&&C&&(N=te?H(C)>H(P.value):he?C>P.value:ne>new Date(P.value)),At(U.value)&&C&&(B=te?H(C)<H(U.value):he?C<U.value:ne<new Date(U.value))}if((N||B)&&(O(!!N,P.message,U.message,nr.max,nr.min),!n))return _(x[h].message),x}if((u||d)&&!j&&(At(C)||i&&Array.isArray(C))){const N=Ln(u),B=Ln(d),P=!vt(N.value)&&C.length>+N.value,U=!vt(B.value)&&C.length<+B.value;if((P||U)&&(O(P,N.message,B.message),!n))return _(x[h].message),x}if(p&&!j&&At(C)){const{value:N,message:B}=Ln(p);if(ro(N)&&!C.match(N)&&(x[h]={type:nr.pattern,message:B,ref:o,...F(nr.pattern,B)},!n))return _(B),x}if(b){if(Et(b)){const N=await b(C,r),B=pd(N,S);if(B&&(x[h]={...B,...F(nr.validate,B.message)},!n))return _(B.message),x}else if(Ye(b)){let N={};for(const B in b){if(!ft(N)&&!n)break;const P=pd(await b[B](C,r),S,B);P&&(N={...P,...F(B,P.message)},_(P.message),n&&(x[h]=N))}if(!ft(N)&&(x[h]={ref:S,...N},!n))return x}}return _(!0),x};const tO={mode:ir.onSubmit,reValidateMode:ir.onChange,shouldFocusError:!0},Fp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function rO(e={}){let t={...tO,...e},r={...Xe(Fp),isLoading:Et(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=Ye(t.defaultValues)||Ye(t.values)?Xe(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Xe(s),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let g={...f};const p={array:id(),state:id()},b=t.criteriaMode===ir.all,h=w=>k=>{clearTimeout(u),u=setTimeout(w,k)},v=async w=>{if(!o.keepIsValid&&!t.disabled&&(f.isValid||g.isValid||w)){let k;t.resolver?(k=ft((await F()).errors),y()):k=await B({fields:n,onlyCheckValid:!0,eventType:Nr.VALID}),k!==r.isValid&&p.state.next({isValid:k})}},y=(w,k)=>{!t.disabled&&(f.isValidating||f.validatingFields||g.isValidating||g.validatingFields)&&((w||Array.from(a.mount)).forEach(L=>{L&&(k?ze(r.validatingFields,L,k):nt(r.validatingFields,L))}),p.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},C=()=>{r.dirtyFields=Xr(s,i)},S=(w,k=[],L,z,V=!0,G=!0)=>{if(z&&L&&!t.disabled){if(o.action=!0,G&&Array.isArray(W(n,w))){const $=L(W(n,w),z.argA,z.argB);V&&ze(n,w,$)}if(G&&Array.isArray(W(r.errors,w))){const $=L(W(r.errors,w),z.argA,z.argB);V&&ze(r.errors,w,$),eO(r.errors,w)}if((f.touchedFields||g.touchedFields)&&G&&Array.isArray(W(r.touchedFields,w))){const $=L(W(r.touchedFields,w),z.argA,z.argB);V&&ze(r.touchedFields,w,$)}(f.dirtyFields||g.dirtyFields)&&C(),p.state.next({name:w,isDirty:U(w,k),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ze(i,w,k)},_=(w,k)=>{ze(r.errors,w,k),r.errors={...r.errors},p.state.next({errors:r.errors})},x=w=>{r.errors=w,p.state.next({errors:r.errors,isValid:!1})},E=w=>{const k=ii(w)?[w]:No(w);let L=i,z=s;for(let V=0;V<k.length-1;V++){const G=k[V];if(L=vt(L)?L:L[G],z=vt(z)?z:z[G],L===null&&z!==null)return!0}return!1},D=(w,k,L,z)=>{const V=W(n,w);if(V){if(E(w))return;const G=We(W(i,w)),$=W(i,w,We(L)?W(s,w):L);We($)||z&&z.defaultChecked||k?ze(i,w,k?$:cd(V._f)):te(w,$),o.mount&&!o.action&&(v(),G&&r.isDirty&&(f.isDirty||g.isDirty)&&(U()||(r.isDirty=!1,p.state.next({...r}))),e.shouldUnregister&&G&&!We(W(i,w))&&da(w,a)&&(o.watch=!0))}},T=(w,k,L,z,V)=>{let G=!1,$=!1;const re={name:w};if(!t.disabled){if(!L||z){(f.isDirty||g.isDirty)&&($=r.isDirty,r.isDirty=re.isDirty=U(),G=$!==re.isDirty);const be=Ht(W(s,w),k);$=!!W(r.dirtyFields,w),be!==r.isDirty?r.dirtyFields=Xr(s,i):be?nt(r.dirtyFields,w):ze(r.dirtyFields,w,!0),re.dirtyFields=r.dirtyFields,G=G||(f.dirtyFields||g.dirtyFields)&&$!==!be}if(L){const be=W(r.touchedFields,w);be||(ze(r.touchedFields,w,L),re.touchedFields=r.touchedFields,G=G||(f.touchedFields||g.touchedFields)&&be!==L)}G&&V&&p.state.next(re)}return G?re:{}},j=(w,k,L,z)=>{const V=W(r.errors,w),G=(f.isValid||g.isValid)&&Vt(k)&&r.isValid!==k;if(t.delayError&&L?(c=h(()=>_(w,L)),c(t.delayError)):(clearTimeout(u),c=null,L?ze(r.errors,w,L):nt(r.errors,w),r.errors={...r.errors}),(L?!Ht(V,L):V)||!ft(z)||G){const $={...z,...G&&Vt(k)?{isValid:k}:{},errors:r.errors,name:w};r={...r,...$},p.state.next($)}},F=async w=>(y(w,!0),await t.resolver(i,t.context,GL(w||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),O=async w=>{const{errors:k}=await F(w);if(y(w),w){for(const L of w){const z=W(k,L);z?a.array.has(L)&&Ye(z)&&!Object.keys(z).some(V=>!Number.isNaN(Number(V)))?hd(r.errors,{[L]:z},L):ze(r.errors,L,z):nt(r.errors,L)}r.errors={...r.errors}}else r.errors=k;return k},N=async({name:w,eventType:k})=>{if(e.validate){const L=await e.validate({formValues:i,formState:r,name:w,eventType:k});if(Ye(L))for(const z in L){const V=L[z];V&&Ce(`${ca}.${z}`,{message:At(V.message)?V.message:"",type:V.type||nr.validate})}else At(L)||!L?Ce(ca,{message:L||"",type:nr.validate}):le(ca);return L}return!0},B=async({fields:w,onlyCheckValid:k,name:L,eventType:z,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await N({name:L,eventType:z})&&(V.valid=!1,k)))return V.valid;for(const G in w){const $=w[G];if($){const{_f:re,...be}=$;if(re){const $e=a.array.has(re.name),Ot=$._f&&KL($._f),Nt=f.validatingFields||f.isValidating||g.validatingFields||g.isValidating;Ot&&Nt&&y([re.name],!0);const br=await md($,a.disabled,i,b,t.shouldUseNativeValidation&&!k,$e);if(Ot&&Nt&&y([re.name]),br[re.name]&&(V.valid=!1,k)||(!k&&(W(br,re.name)?$e?hd(r.errors,br,re.name):ze(r.errors,re.name,br[re.name]):nt(r.errors,re.name)),e.shouldUseNativeValidation&&br[re.name]))break}!ft(be)&&await B({context:V,onlyCheckValid:k,fields:be,name:G,eventType:z})}}return V.valid},P=()=>{for(const w of a.unMount){const k=W(n,w);k&&(k._f.refs?k._f.refs.every(L=>!ua(L)):!ua(k._f.ref))&&se(w)}a.unMount=new Set},U=(w,k)=>!t.disabled&&(w&&k&&ze(i,w,k),!Ht(M(),s)),ne=(w,k,L)=>ol(w,a,{...o.mount?i:We(k)?s:At(w)?{[w]:k}:k},L,k),H=w=>Dp(W(o.mount?i:s,w,t.shouldUnregister?W(s,w,[]):[])),te=(w,k,L={},z=!1)=>{const V=W(n,w);let G=k;if(V){const $=V._f;$&&(!$.disabled&&ze(i,w,Pp(k,$)),G=to($.ref)&&vt(k)?"":k,Op($.ref)?[...$.ref.options].forEach(re=>re.selected=G.includes(re.value)):$.refs?si($.ref)?$.refs.forEach(re=>{(!re.defaultChecked||!re.disabled)&&(Array.isArray(G)?re.checked=!!G.find(be=>be===re.value):re.checked=G===re.value||!!G)}):$.refs.forEach(re=>re.checked=re.value===G):Kl($.ref)?$.ref.value="":($.ref.value=G,$.ref.type||p.state.next({name:w,values:z?i:Xe(i)})))}(L.shouldDirty||L.shouldTouch)&&T(w,G,L.shouldTouch,L.shouldDirty,!0),L.shouldValidate&&R(w)},he=(w,k,L,z=!1)=>{for(const V in k){if(!k.hasOwnProperty(V))return;const G=k[V],$=w+"."+V,re=W(n,$);(a.array.has(w)||Ye(G)||re&&!re._f)&&!tn(G)?he($,G,L,z):te($,G,L,z)}},oe=(w,k,L,z)=>{const V=W(n,w),G=a.array.has(w),$=z?k:Xe(k),re=W(i,w),be=Ht(re,$);if(be||ze(i,w,$),G)p.array.next({name:w,values:z?i:Xe(i)}),(f.isDirty||f.dirtyFields||g.isDirty||g.dirtyFields)&&L.shouldDirty&&(C(),p.state.next({name:w,dirtyFields:r.dirtyFields,isDirty:U(w,$)}));else{const $e=Array.isArray($)&&!$.length||ft($);!V||V._f||vt($)||$e?te(w,$,L,z):he(w,$,L,z)}if(!be){const $e=da(w,a),Ot=z?i:Xe(i);p.state.next({...$e&&r,name:o.mount||$e?w:void 0,values:Ot})}},ge=(w,k,L={})=>oe(w,k,L,!1),ve=(w,k={})=>{const L=Et(w)?w(i):w;if(!Ht(i,L)){i={...i,...L};for(const z of a.mount)oe(z,W(L,z),k,!0);p.state.next({...r,name:void 0,type:void 0,values:i}),k.shouldValidate&&v()}},xe=async w=>{o.mount=!0;const k=w.target;let L=k.name,z=!0;const V=W(n,L),G=be=>{z=Number.isNaN(be)||tn(be)&&isNaN(be.getTime())||Ht(be,W(i,L,be))},$=ud(t.mode),re=ud(t.reValidateMode);if(V){let be,$e;const Ot=k.type?cd(V._f):il(w),Nt=w.type===Nr.BLUR||w.type===Nr.FOCUS_OUT,br=!YL(V._f)&&!e.validate&&!t.resolver&&!W(r.errors,L)&&!V._f.deps||JL(Nt,W(r.touchedFields,L),r.isSubmitted,re,$),ls=da(L,a,Nt);ze(i,L,Ot),Nt?(!k||!k.readOnly)&&(V._f.onBlur&&V._f.onBlur(w),c&&c(0)):V._f.onChange&&V._f.onChange(w);const Yr=T(L,Ot,Nt),ct=!ft(Yr)||ls;if(!Nt&&p.state.next({name:L,type:w.type,values:Xe(i)}),br)return(f.isValid||g.isValid)&&(t.mode==="onBlur"?Nt&&v():Nt||v()),ct&&p.state.next({name:L,...ls?{}:Yr});if(!t.resolver&&e.validate&&await N({name:L,eventType:w.type}),!Nt&&ls&&p.state.next({...r}),t.resolver){const{errors:Ct}=await F([L]);if(y([L]),G(Ot),!z){!ft(Yr)&&p.state.next(Yr);return}const kt=fd(r.errors,n,L),tr=fd(Ct,n,kt.name||L);be=tr.error,L=tr.name,$e=ft(Ct)}else y([L],!0),be=(await md(V,a.disabled,i,b,t.shouldUseNativeValidation))[L],y([L]),G(Ot),z&&(be?$e=!1:(f.isValid||g.isValid)&&($e=await B({fields:n,onlyCheckValid:!0,name:L,eventType:w.type})));z&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&R(V._f.deps),j(L,$e,be,Yr))}},ye=(w,k)=>{if(W(r.errors,k)&&w.focus)return w.focus(),1},R=async(w,k={})=>{let L,z;const V=Mi(w);if(t.resolver){const G=await O(We(w)?w:V);L=ft(G),z=w?!V.some($=>W(G,$)):L}else w?(z=(await Promise.all(V.map(async G=>{const $=W(n,G);return await B({fields:$&&$._f?{[G]:$}:$,eventType:Nr.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&v()):z=L=await B({fields:n,name:w,eventType:Nr.TRIGGER});return p.state.next({...!At(w)||(f.isValid||g.isValid)&&L!==r.isValid?{}:{name:w},...t.resolver||!w?{isValid:L}:{},errors:r.errors}),k.shouldFocus&&!z&&Is(n,ye,w?V:a.mount),z},M=(w,k)=>{let L={...o.mount?i:s};return k&&(L=Lp(k.dirtyFields?r.dirtyFields:r.touchedFields,L)),We(w)?L:At(w)?W(L,w):w.map(z=>W(L,z))},Y=(w,k)=>({invalid:!!W((k||r).errors,w),isDirty:!!W((k||r).dirtyFields,w),error:W((k||r).errors,w),isValidating:!!W(r.validatingFields,w),isTouched:!!W((k||r).touchedFields,w)}),le=w=>{const k=w?Mi(w):void 0;k==null||k.forEach(L=>nt(r.errors,L)),k?k.forEach(L=>{p.state.next({name:L,errors:r.errors})}):p.state.next({errors:{}})},Ce=(w,k,L)=>{const z=(W(n,w,{_f:{}})._f||{}).ref,V=W(r.errors,w)||{},{ref:G,message:$,type:re,...be}=V;ze(r.errors,w,{...be,...k,ref:z}),p.state.next({name:w,errors:r.errors,isValid:!1}),L&&L.shouldFocus&&z&&z.focus&&z.focus()},de=(w,k)=>Et(w)?p.state.subscribe({next:L=>"values"in L&&w(L.values||ne(void 0,k),L)}):ne(w,k,!0),ce=w=>p.state.subscribe({next:k=>{if(XL(w.name,k.name,w.exact)&&ZL(k,w.formState||f,Kr,w.reRenderRoot)){const L={...i};w.callback({values:L,...r,...k,defaultValues:s})}}}).unsubscribe,Q=w=>(o.mount=!0,g={...g,...w.formState},ce({...w,formState:{...d,...w.formState}})),se=(w,k={})=>{for(const L of w?Mi(w):a.mount)a.mount.delete(L),a.array.delete(L),k.keepValue||(nt(n,L),nt(i,L)),!k.keepError&&nt(r.errors,L),!k.keepDirty&&nt(r.dirtyFields,L),!k.keepTouched&&nt(r.touchedFields,L),!k.keepIsValidating&&nt(r.validatingFields,L),!t.shouldUnregister&&!k.keepDefaultValue&&nt(s,L);p.state.next({values:Xe(i)}),p.state.next({...r,...k.keepDirty?{isDirty:U()}:{}}),!k.keepIsValid&&v()},Te=({disabled:w,name:k})=>{if(Vt(w)&&o.mount||w||a.disabled.has(k)){const V=a.disabled.has(k)!==!!w;w?a.disabled.add(k):a.disabled.delete(k),V&&o.mount&&!o.action&&v()}},me=(w,k={})=>{let L=W(n,w);const z=Vt(k.disabled)||Vt(t.disabled),V=!a.registerName.has(w)&&L&&L._f&&!L._f.mount;return ze(n,w,{...L||{},_f:{...L&&L._f?L._f:{ref:{name:w}},name:w,mount:!0,...k}}),a.mount.add(w),L&&!V?Te({disabled:Vt(k.disabled)?k.disabled:t.disabled,name:w}):D(w,!0,k.value),{...z?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!k.required,min:ys(k.min),max:ys(k.max),minLength:ys(k.minLength),maxLength:ys(k.maxLength),pattern:ys(k.pattern)}:{},name:w,onChange:xe,onBlur:xe,ref:G=>{if(G){a.registerName.add(w),me(w,k),a.registerName.delete(w),L=W(n,w);const $=We(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,re=VL($),be=L._f.refs||[];if(re?be.find($e=>$e===$):$===L._f.ref)return;ze(n,w,{_f:{...L._f,...re?{refs:[...be.filter(ua),$,...Array.isArray(W(s,w))?[{}]:[]],ref:{type:$.type,name:w}}:{ref:$}}}),D(w,!1,void 0,$)}else L=W(n,w,{}),L._f&&(L._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!(Tp(a.array,w)&&o.action)&&a.unMount.add(w)}}},ee=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Is(n,ye,a.mount),He=w=>{Vt(w)&&(p.state.next({disabled:w}),Is(n,(k,L)=>{const z=W(n,L);z&&(k.disabled=z._f.disabled||w,Array.isArray(z._f.refs)&&z._f.refs.forEach(V=>{V.disabled=z._f.disabled||w}))},0,!1))},Ge=(w,k)=>async L=>{let z;L&&(L.preventDefault&&L.preventDefault(),L.persist&&L.persist());let V=Xe(i);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:$}=await F();y(),r.errors=G,V=Xe($)}else await B({fields:n,eventType:Nr.SUBMIT});if(a.disabled.size)for(const G of a.disabled)nt(V,G);if(nt(r.errors,Ap),ft(r.errors)){p.state.next({errors:{}});try{await w(V,L)}catch(G){z=G}}else k&&await k({...r.errors},L),ee(),setTimeout(ee);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ft(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},Ze=(w,k={})=>{W(n,w)&&(We(k.defaultValue)?ge(w,Xe(W(s,w))):(ge(w,k.defaultValue),ze(s,w,Xe(k.defaultValue))),k.keepTouched||nt(r.touchedFields,w),k.keepDirty||(nt(r.dirtyFields,w),r.isDirty=k.defaultValue?U(w,Xe(W(s,w))):U()),k.keepError||(nt(r.errors,w),f.isValid&&v()),p.state.next({...r}))},Qe=(w,k={})=>{const L=w?Xe(w):s,z=Xe(L),V=ft(w),G=z;if(k.keepDefaultValues||(s=L),!k.keepValues){if(k.keepDirtyValues){const $=new Set([...a.mount,...Object.keys(Xr(s,i))]);for(const re of Array.from($)){const be=W(r.dirtyFields,re),$e=W(i,re),Ot=W(G,re);be&&!We($e)?ze(G,re,$e):!be&&!We(Ot)&&ge(re,Ot)}}else{if(Oo&&We(w))for(const $ of a.mount){const re=W(n,$);if(re&&re._f){const be=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(to(be)){const $e=be.closest("form");if($e){$e.reset();break}}}}if(k.keepFieldsRef)for(const $ of a.mount)ge($,W(G,$));else n={}}if(t.shouldUnregister){if(i=k.keepDefaultValues?Xe(s):{},k.keepFieldsRef)for(const $ of a.mount)ze(i,$,W(G,$))}else i=Xe(G);p.array.next({values:{...G}}),p.state.next({values:{...G}})}a={mount:k.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!k.keepIsValid||!!k.keepDirtyValues||!t.shouldUnregister&&!ft(G),o.watch=!!t.shouldUnregister,o.keepIsValid=!!k.keepIsValid,o.action=!1,k.keepErrors||(r.errors={}),p.state.next({submitCount:k.keepSubmitCount?r.submitCount:0,isDirty:V?!1:k.keepDirty?r.isDirty:k.keepValues?U():!!(k.keepDefaultValues&&!Ht(w,s)),isSubmitted:k.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:k.keepDirtyValues?k.keepDefaultValues&&i?Xr(s,i):r.dirtyFields:k.keepDefaultValues&&w?Xr(s,w):k.keepDirty?r.dirtyFields:{},touchedFields:k.keepTouched?r.touchedFields:{},errors:k.keepErrors?r.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},tt=(w,k)=>Qe(Et(w)?w(i):w,{...t.resetOptions,...k}),st=(w,k={})=>{const L=W(n,w),z=L&&L._f;if(z){const V=z.refs?z.refs[0]:z.ref;V.focus&&setTimeout(()=>{V.focus(),k.shouldSelect&&Et(V.select)&&V.select()})}},Kr=w=>{r={...r,...w}},_e={control:{register:me,unregister:se,getFieldState:Y,handleSubmit:Ge,setError:Ce,_subscribe:ce,_runSchema:F,_updateIsValidating:y,_focusError:ee,_getWatch:ne,_getDirty:U,_setValid:v,_setFieldArray:S,_setDisabledField:Te,_setErrors:x,_getFieldArray:H,_reset:Qe,_resetDefaultValues:()=>Et(t.defaultValues)&&t.defaultValues().then(w=>{tt(w,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:He,_subjects:p,_proxyFormState:f,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(w){o=w},get _defaultValues(){return s},get _names(){return a},set _names(w){a=w},get _formState(){return r},get _options(){return t},set _options(w){t={...t,...w}}},subscribe:Q,trigger:R,register:me,handleSubmit:Ge,watch:de,setValue:ge,setValues:ve,getValues:M,reset:tt,resetField:Ze,resetDefaultValues:(w,k={})=>{if(s=Xe(w),!k.keepDirty){const L=Xr(s,i);r.dirtyFields=L,r.isDirty=!ft(L)}k.keepIsValid||v(),p.state.next({...r,defaultValues:s})},clearErrors:le,unregister:se,setError:Ce,setFocus:st,getFieldState:Y};return{..._e,formControl:_e}}function nO(e={}){const t=m.useRef(void 0),r=m.useRef(void 0),n=m.useRef(e.formControl),[s,i]=m.useState(()=>({...Xe(Fp),isLoading:Et(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Et(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&&!Et(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=rO(e);t.current={...c,formState:s}}const o=t.current.control;return o._options=e,Wl(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),m.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),m.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),m.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),m.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),m.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==s.isDirty&&o._subjects.state.next({isDirty:a})}},[o,s.isDirty]),m.useEffect(()=>{var a;e.values&&!Ht(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),r.current=e.values,i(c=>({...c}))):o._resetDefaultValues()},[o,e.values]),m.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=m.useMemo(()=>kp(s,o),[o,s]),t.current}function sO(e,t,r){const n=e??[],s=new Set(n.map(d=>d.type).filter(Boolean)),i=(t??[]).filter(d=>!s.has(d)),{data:o}=Zn({queryKey:["framework-search",i.sort().join(","),r],queryFn:()=>y1({type:i,systemDefault:"Yes"}),enabled:i.length>0,staleTime:600*1e3}),a=t&&t.length?n.filter(d=>d.type&&t.includes(d.type)):n,c=[...(o??[]).map(d=>({label:d.name,value:d.identifier})),...a.map(d=>({label:d.name,value:d.identifier}))],u=new Set;return c.filter(d=>u.has(d.value)?!1:(u.add(d.value),!0))}async function Mp(e){var r,n;return(n=(r=(await Re.get(`/api/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function iO(e){var r,n,s,i,o,a,c;const t=Zn({queryKey:["channel",e],queryFn:()=>Mp(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:(i=t.data)==null?void 0:i.collectionAdditionalCategories,contentAdditionalCategories:(o=t.data)==null?void 0:o.contentAdditionalCategories,defaultLicense:(a=t.data)==null?void 0:a.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function oO(e){const{data:t}=Zn({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>B1(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const Bp=[{label:"Strict",value:"Fixed"},{label:"Adaptive",value:"Diagnostic"},{label:"Prior learning",value:"PriorLearning"}],aO={"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."}},lO=new Set(["review","read","sourcingreview","orgreview"]),yi={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},cO={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},uO={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"},ai={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},Zl=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function qp(e,t,r,n,s={}){if(!(e!=null&&e.length))return gd(kO(t,n,r,s),r,t,n,s);const i=new Map;for(const c of e){const u=c.code;u&&!i.has(u)&&i.set(u,c)}const o=new Set,a=e.filter(c=>{var d;if(n&&(c.code==="dialCode"||c.code==="dialcode")||((d=s.profile)==null?void 0:d.key)==="learningPath"&&Zl.has(c.code)||c.visible===!1)return!1;const u=c.code;return o.has(u)?!1:(o.add(u),!0)}).map(c=>{const u=c.code??"",d=vO(c),f=yO(c,r,t,i,s),g=t[u],p=fO(u,$p(g,d),d,t,s),b={code:u,label:c.label??u,inputType:d,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:dO(u,c.editable!==!1,s),placeholder:c.placeholder,maxLength:c.maxLength,options:mO(f,p,d,r),depends:c.depends,tab:gO(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:p};if(u==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...b,required:h,visible:h}}return b});return gd(a,r,t,n,s)}function gd(e,t,r,n,s){var i;return((i=s.profile)==null?void 0:i.key)==="learningPath"?IO(e,t,r,n):AO(e,t,r,n)}function dO(e,t,r){var i;const n=r.editorMode??"edit";if(!lO.has(n))return t!==!1;const s=(i=r.editableFields)==null?void 0:i[n];return!!(s&&s.includes(e))}function fO(e,t,r,n,s){const i=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return i?s.defaultLicense??"":t;case"copyright":return i&&s.channelName?s.channelName:t;case"copyrightYear":return i?String(new Date().getFullYear()):t;case"author":case"creator":return i&&s.userFullName?s.userFullName:t;case"instructions":{const o=n.instructions;return o&&typeof o=="object"&&!Array.isArray(o)?o.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!i)return t;const o=n.timeLimits,a=o==null?void 0:o[e];return a!=null&&a!==""?hO(Number(a)):t}default:return t}}function hO(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=i=>String(i).padStart(2,"0");return n>0?`${s(n)}:${s(r)}:${s(t)}`:`${s(r)}:${s(t)}`}function pO(e){var n,s,i;const t=new Map,r=o=>o==null?void 0:o.forEach(a=>{a.identifier&&t.set(a.identifier,a.name),a.name&&t.set(a.name,a.name)});return(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(o=>r(o.terms)),(i=e.targetFrameworks)==null||i.forEach(o=>{var a;return(a=o.categories)==null?void 0:a.forEach(c=>r(c.terms))}),t}function mO(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 i=e?[...e]:[],o=new Set(i.map(c=>c.value)),a=pO(n);for(const c of s){const u=String(c);o.has(u)||(i.push({label:a.get(u)??u,value:u}),o.add(u))}return i}function gO(e){const t=e.section;if(t){if(yi[t])return yi[t];const n=cO[t];if(n&&yi[n])return yi[n]}const r=e.code??"";return uO[r]??"details"}function $p(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 vO(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 yO(e,t,r,n,s){var u;const i=e.code??"";if(((u=s.profile)==null?void 0:u.key)==="learningPath"&&i==="policy")return Bp;if(i==="maxQuestions"){const d=s.childCount??0;if(d>0)return Array.from({length:d},(f,g)=>({label:String(g+1),value:String(g+1)}))}const o=e.range;if(Array.isArray(o)&&o.length)return typeof o[0]=="string"?o.map(d=>({label:d,value:d})):o.map(d=>({label:d.name,value:d.identifier}));const a=e.enum;if(a!=null&&a.length)return a.map(d=>({label:d,value:d}));if(i==="framework")return t.orgFrameworks;if(i==="additionalCategories"){const f=(s.objectType??"")==="QuestionSet"?s.contentAdditionalCategories??s.collectionAdditionalCategories:s.collectionAdditionalCategories??s.contentAdditionalCategories,g=(f&&f.length?f:s.contextAdditionalCategories)??t.channelAdditionalCategories;return g!=null&&g.length?_O(g).map(p=>({label:p,value:p})):void 0}const c=e.sourceCategory??ai[i];if(c)return Up(i,c,e,t,r,n)}function bO(e,t){return Zl.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function CO(e,t){return Zl.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function fa(e,t,r){var i,o,a,c,u;const n=(o=(i=e.organisationFramework)==null?void 0:i.categories)==null?void 0:o.find(d=>d.code===t),s=(u=(c=(a=e.targetFrameworks)==null?void 0:a[0])==null?void 0:c.categories)==null?void 0:u.find(d=>d.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 SO(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 _O(e){return Array.from(new Set(e))}function wO(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function Up(e,t,r,n,s,i){const o=bO(e,r),a=CO(e,r),c=h=>({label:h.name,value:o?h.identifier:h.name}),u=r.depends;if(!(u!=null&&u.length))return fa(n,t,a).map(c);const d=u.flatMap(h=>wO(s[h])).map(String);if(!d.length)return[];const f=[];for(const h of u){const v=i.get(h),y=(v==null?void 0:v.sourceCategory)??ai[h]??h;f.push(...fa(n,y,a))}const p=f.filter(h=>d.includes(String(h.name))||d.includes(String(h.identifier))||d.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),b=SO(p);return b.length?b.map(c):fa(n,t,a).map(c)}function bs(e,t){const r=ai[e];if(r)return Up(e,r,{},t,{},new Map)}function Je(e,t,r){return $p(e[t],r)}const xO=["board","medium","gradeLevel","subject"];function TO(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>xO.includes(n.code)):!0}function EO(e,t){var r,n,s;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(i=>i.code===t)||(s=e.targetFrameworks)!=null&&s.some(i=>{var o;return(o=i.categories)==null?void 0:o.some(a=>a.code===t)}))}function AO(e,t,r,n){var c;if(!n||TO(t))return e;const s=e.filter(u=>{const d=u.sourceCategory??ai[u.code];return!d||EO(t,d)}),i=new Set(s.map(u=>u.code)),o=[];for(const u of((c=t.organisationFramework)==null?void 0:c.categories)??[])i.has(u.code)||o.push({code:u.code,label:u.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(u.terms??[]).map(d=>({label:d.name,value:d.name})),currentValue:Je(r,u.code,"multiselect")});if(!o.length)return s;const a=s.findIndex(u=>u.code==="framework");return a>=0?[...s.slice(0,a+1),...o,...s.slice(a+1)]:[...s,...o]}const ha="Organisation Framework Terms";function IO(e,t,r,n){var g,p;if(!n)return e;const s=[...((g=t.organisationFramework)==null?void 0:g.categories)??[]].sort((b,h)=>(b.index??1/0)-(h.index??1/0));if(!s.length)return e;const i=(p=kh(s))==null?void 0:p.code,o=b=>b.sourceCategory??ai[b.code];let c=e.filter(b=>{const h=o(b);return h?h!==i&&s.some(v=>v.code===h):!0}).map(b=>o(b)?{...b,section:ha}:b),u=c.findIndex(b=>b.code==="framework");if(u===-1){const b={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:ha,options:t.orgFrameworks,currentValue:Je(r,"framework","select")},h=c.findIndex(v=>!!o(v));u=h>=0?h:c.length,c=[...c.slice(0,u),b,...c.slice(u)]}const d=new Set(c.map(b=>b.code)),f=s.filter(b=>b.code!==i&&!d.has(b.code)).map(b=>({code:b.code,label:b.name,inputType:"multiselect",editable:!0,tab:"details",section:ha,options:(b.terms??[]).map(h=>({label:h.name,value:h.name})),currentValue:Je(r,b.code,"multiselect")}));return f.length?[...c.slice(0,u+1),...f,...c.slice(u+1)]:c}function kO(e,t,r,n={}){var i,o;const s=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:Je(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:Je(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:Je(e,"keywords","chips")}];return t?((i=n.profile)==null?void 0:i.key)==="learningPath"?(s.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Je(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:Bp,currentValue:Je(e,"policy","select")||"Fixed"}),s):(s.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:Je(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:Je(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:Je(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:bs("subjectIds",r),currentValue:Je(e,"subjectIds","multiselect")}),s.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:Je(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:bs("targetBoardIds",r),currentValue:Je(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:bs("targetMediumIds",r),currentValue:Je(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:bs("targetGradeLevelIds",r),currentValue:Je(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:bs("targetSubjectIds",r),currentValue:Je(e,"targetSubjectIds","multiselect")}),s.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Je(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Je(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Je(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Je(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Je(e,"license","select")}),s):s}const DO=["allowECM","levels","setPeriod","instances"];function zp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function LO(e,t={}){const r={...e};for(const i of DO)delete r[i];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:zp(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 OO(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?zp(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function NO(e,t){const{watch:r,setValue:n}=e,s=m.useRef(!1);m.useEffect(()=>{const i=r((o,{name:a})=>{var c;if(!(!a||s.current)){s.current=!0;try{const u=new Set([a]);let d=!0;for(;d;){d=!1;for(const f of t)u.has(f.code)||(c=f.depends)!=null&&c.some(g=>u.has(g))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),u.add(f.code),d=!0)}}finally{s.current=!1}}});return()=>i.unsubscribe()},[r,n,t])}const jO="_section_qa0tm_1",PO="_header_qa0tm_11",RO="_title_qa0tm_17",FO="_description_qa0tm_24",MO="_divider_qa0tm_30",BO="_fields_qa0tm_36",On={section:jO,header:PO,title:RO,description:FO,divider:MO,fields:BO},qO=({title:e,description:t,children:r})=>l.jsxs("div",{className:On.section,children:[l.jsxs("div",{className:On.header,children:[l.jsx("h3",{className:On.title,children:e}),t&&l.jsx("p",{className:On.description,children:t})]}),l.jsx("hr",{className:On.divider}),l.jsx("div",{className:On.fields,children:r})]}),$O="_field_93co8_1",UO="_fullWidth_93co8_7",zO="_label_93co8_11",VO="_required_93co8_19",HO="_input_93co8_24",QO="_textarea_93co8_45",WO="_inputError_93co8_50",GO="_error_93co8_54",KO="_selectBtn_93co8_59",YO="_selectOpen_93co8_83",ZO="_placeholder_93co8_87",XO="_selectedVal_93co8_91",JO="_chevronUp_93co8_95",eN="_dropdown_93co8_100",tN="_option_93co8_116",rN="_optionSelected_93co8_134",nN="_noOpts_93co8_139",sN="_chipGroup_93co8_146",iN="_chipInput_93co8_158",oN="_addChipBtn_93co8_167",aN="_radioGroup_93co8_184",lN="_radioLabel_93co8_191",cN="_iconWrap_93co8_199",uN="_iconPreview_93co8_214",dN="_iconPlaceholder_93co8_220",fN="_removeIconBtn_93co8_233",hN="_tagChip_93co8_252",pN="_tagChipRemove_93co8_264",mN="_nestedSelectRow_93co8_278",gN="_dialcodeRow_93co8_287",vN="_validateBtn_93co8_293",yN="_dialcodeValid_93co8_315",bN="_dialcodeSpinner_93co8_325",q={field:$O,fullWidth:UO,label:zO,required:VO,input:HO,textarea:QO,inputError:WO,error:GO,selectBtn:KO,selectOpen:YO,placeholder:ZO,selectedVal:XO,chevronUp:JO,dropdown:eN,option:tN,optionSelected:rN,noOpts:nN,chipGroup:sN,chipInput:iN,addChipBtn:oN,radioGroup:aN,radioLabel:lN,iconWrap:cN,iconPreview:uN,iconPlaceholder:dN,removeIconBtn:fN,tagChip:hN,tagChipRemove:pN,nestedSelectRow:mN,dialcodeRow:gN,validateBtn:vN,dialcodeValid:yN,dialcodeSpinner:bN},vd=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:i,placeholder:o})=>{const a=ae(),{register:c,formState:{errors:u}}=er(),d=u[e],f={required:r?a.textField.requiredError.replace("{field}",t):!1,maxLength:i?{value:i,message:a.textField.maxLengthError.replace("{max}",String(i))}:void 0};return l.jsxs("div",{className:[q.field,s?q.fullWidth:""].join(" "),children:[l.jsxs("label",{className:q.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),s?l.jsx("textarea",{id:e,className:[q.input,q.textarea,d?q.inputError:""].join(" "),disabled:n,placeholder:o,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[q.input,d?q.inputError:""].join(" "),disabled:n,placeholder:o,...c(e,f)}),d&&l.jsx("span",{className:q.error,children:String(d.message)})]})},CN=({name:e,label:t,options:r,required:n,disabled:s})=>{var v;const i=ae(),[o,a]=m.useState(!1),c=m.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:g}}=er(),p=d(e),b=((v=r.find(y=>y.value===p))==null?void 0:v.label)??i.selectField.selectPlaceholder,h=g[e];return m.useEffect(()=>{if(!o)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||a(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o]),l.jsxs("div",{className:q.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?i.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[q.selectBtn,h?q.inputError:"",o?q.selectOpen:""].join(" "),onClick:()=>a(y=>!y),children:[l.jsx("span",{className:p?q.selectedVal:q.placeholder,children:b}),l.jsx(bn,{size:14,className:o?q.chevronUp:""})]}),o&&l.jsxs("div",{className:q.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[q.option,p===y.value?q.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:y.label}),p===y.value&&l.jsx(yn,{size:13})]},y.value)),!r.length&&l.jsx("span",{className:q.noOpts,children:i.selectField.noOptionsMessage})]}),h&&l.jsx("span",{className:q.error,children:String(h.message)})]})},SN=({name:e,label:t,options:r,required:n,disabled:s})=>{const i=ae(),[o,a]=m.useState(!1),c=m.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:g}}=er(),p=d(e)??[],b=g[e],h=p.length?`${p.length} ${i.multiSelectField.selectedCountSuffix}`:i.multiSelectField.selectPlaceholder;m.useEffect(()=>{if(!o)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||a(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o]);const v=y=>{const C=p.includes(y)?p.filter(S=>S!==y):[...p,y];f(e,C,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:q.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?i.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[q.selectBtn,b?q.inputError:"",o?q.selectOpen:""].join(" "),onClick:()=>a(y=>!y),children:[l.jsx("span",{className:p.length?q.selectedVal:q.placeholder,children:h}),l.jsx(bn,{size:14,className:o?q.chevronUp:""})]}),o&&l.jsxs("div",{className:q.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[q.option,p.includes(y.value)?q.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(yn,{size:13,style:{opacity:p.includes(y.value)?1:0}}),l.jsx("span",{children:y.label})]},y.value)),!r.length&&l.jsx("span",{className:q.noOpts,children:i.multiSelectField.noOptionsMessage})]}),b&&l.jsx("span",{className:q.error,children:String(b.message)})]})},_N=({name:e,label:t,required:r,disabled:n,placeholder:s})=>{const i=ae(),o=s??i.chipGroupField.addPlaceholder,[a,c]=m.useState(""),[u,d]=m.useState(!1),f=m.useRef(null),{watch:g,setValue:p,formState:{errors:b}}=er(),h=g(e)??[],v=b[e],y=()=>{const S=a.trim();S&&!h.includes(S)&&p(e,[...h,S],{shouldDirty:!0}),c(""),d(!1)},C=S=>p(e,h.filter(_=>_!==S),{shouldDirty:!0});return l.jsxs("div",{className:[q.field,q.fullWidth].join(" "),children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsxs("div",{className:q.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&&(u?l.jsx("input",{ref:f,autoFocus:!0,className:q.chipInput,value:a,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),d(!1))},onBlur:y,placeholder:o}):l.jsxs("button",{type:"button",className:q.addChipBtn,onClick:()=>{d(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(Cn,{size:12})," ",i.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:q.error,children:String(v.message)})]})},wN=({name:e,label:t,options:r,required:n,disabled:s})=>{const i=ae(),{register:o,formState:{errors:a}}=er(),c=a[e];return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("div",{className:q.radioGroup,children:r.map(u=>l.jsxs("label",{className:q.radioLabel,children:[l.jsx("input",{type:"radio",value:u.value,disabled:s,...o(e,{required:n?i.radioField.requiredError.replace("{field}",t):!1})}),u.label]},u.value))}),c&&l.jsx("span",{className:q.error,children:String(c.message)})]})};async function xN(e,t,r,n){var o,a;const i=(a=(o=(await Re.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:o.result)==null?void 0:a.node_id;if(!i)throw new Error("Asset creation failed: no node_id returned");return i}async function TN(e,t){var s,i;const n=(i=(s=(await Re.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)==null?void 0:i.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function EN(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 AN(e,t,r){var o,a;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const i=(a=(o=(await Re.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:o.result)==null?void 0:a.content_url;if(!i)throw new Error("Asset finalize failed: no content_url returned");return i}const IN="_overlay_1bq5u_1",kN="_modal_1bq5u_12",DN="_header_1bq5u_24",LN="_title_1bq5u_33",ON="_closeBtn_1bq5u_39",NN="_tabs_1bq5u_57",jN="_tab_1bq5u_57",PN="_activeTab_1bq5u_83",RN="_body_1bq5u_88",FN="_searchWrap_1bq5u_99",MN="_searchIcon_1bq5u_104",BN="_searchInput_1bq5u_113",qN="_grid_1bq5u_132",$N="_imgCell_1bq5u_148",UN="_imgCellSelected_1bq5u_166",zN="_thumb_1bq5u_171",VN="_noThumb_1bq5u_177",HN="_checkBadge_1bq5u_183",QN="_loadMoreBtn_1bq5u_198",WN="_loadingRow_1bq5u_220",GN="_empty_1bq5u_230",KN="_spinner_1bq5u_237",YN="_uploadArea_1bq5u_247",ZN="_dropZone_1bq5u_256",XN="_uploadIcon_1bq5u_277",JN="_dropText_1bq5u_281",ej="_dropSubtext_1bq5u_288",tj="_uploadPreview_1bq5u_294",rj="_hiddenInput_1bq5u_301",nj="_fileName_1bq5u_305",sj="_errorText_1bq5u_311",ij="_footer_1bq5u_318",oj="_cancelBtn_1bq5u_328",aj="_confirmBtn_1bq5u_345",Ae={overlay:IN,modal:kN,header:DN,title:LN,closeBtn:ON,tabs:NN,tab:jN,activeTab:PN,body:RN,searchWrap:FN,searchIcon:MN,searchInput:BN,grid:qN,imgCell:$N,imgCellSelected:UN,thumb:zN,noThumb:VN,checkBadge:HN,loadMoreBtn:QN,loadingRow:WN,empty:GN,spinner:KN,uploadArea:YN,dropZone:ZN,uploadIcon:XN,dropText:JN,dropSubtext:ej,uploadPreview:tj,hiddenInput:rj,fileName:nj,errorText:sj,footer:ij,cancelBtn:oj,confirmBtn:aj},yd=18,Vp=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const s=ae(),[i,o]=m.useState("my"),[a,c]=m.useState(""),[u,d]=m.useState([]),[f,g]=m.useState(0),[p,b]=m.useState(!1),[h,v]=m.useState(null),[y,C]=m.useState(0),[S,_]=m.useState(null),[x,E]=m.useState(""),[D,T]=m.useState(!1),[j,F]=m.useState(""),O=m.useRef(null),N=Z(R=>{var M,Y;return((Y=(M=R.editorConfig)==null?void 0:M.context)==null?void 0:Y.channel)??""}),B=Z(R=>{var M,Y;return((Y=(M=R.editorConfig)==null?void 0:M.context)==null?void 0:Y.uid)??""}),P=Z(R=>{var M,Y,le;return((le=(Y=(M=R.editorConfig)==null?void 0:M.context)==null?void 0:Y.cloudStorage)==null?void 0:le.presigned_headers)??{}}),U=Z(R=>{var M,Y,le;return((le=(Y=(M=R.editorConfig)==null?void 0:M.config)==null?void 0:Y.assetConfig)==null?void 0:le.size)??1*1024*1024}),ne=Z(R=>{var M,Y,le;return((le=(Y=(M=R.editorConfig)==null?void 0:M.config)==null?void 0:Y.assetConfig)==null?void 0:le.accepted)??"image/png,image/jpeg"}),H=m.useCallback(async(R,M,Y=!1)=>{var le;b(!0);try{const Ce={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};i==="my"&&B&&(Ce.createdBy=B),N&&(Ce.channel=N);const ce=((le=(await Re.post("/action/composite/v3/search",{request:{filters:Ce,query:R,limit:yd,offset:M,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:le.result)??{},Q=ce.content??[];g(ce.count??0),d(se=>Y?[...se,...Q]:Q)}catch{}finally{b(!1)}},[i,B,N]);m.useEffect(()=>{i!=="upload"&&(d([]),C(0),H(a,0))},[i]);const te=m.useRef(),he=R=>{c(R),clearTimeout(te.current),te.current=setTimeout(()=>{d([]),C(0),H(R,0)},400)},oe=()=>{const R=y+yd;C(R),H(a,R,!0)},ge=()=>{const R=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";R&&r(R)};m.useEffect(()=>()=>{x&&URL.revokeObjectURL(x)},[x]);const ve=R=>{var le;const M=(le=R.target.files)==null?void 0:le[0];if(R.target.value="",!M)return;const Y=ne.split(",").map(Ce=>Ce.trim());if(!Y.includes(M.type)){const Ce=Y.map(de=>de.replace("image/","").toUpperCase()).join(", ");F(s.appIconPickerModal.invalidFileTypeError.replace("{types}",Ce));return}if(M.size>U){const Ce=(U/1048576).toFixed(0);F(s.appIconPickerModal.fileTooLargeError.replace("{size}",Ce));return}x&&URL.revokeObjectURL(x),_(M),E(URL.createObjectURL(M)),F("")},xe=async()=>{if(S){T(!0),F("");try{const R=await xN(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,B,N),M=await TN(R,S.name);await EN(M,S,P);const Y=M.split("?")[0],le=await AN(R,Y,S.type);r(le)}catch(R){F(R instanceof Error?R.message:s.appIconPickerModal.uploadFailedError)}finally{T(!1)}}},ye=u.length<f;return l.jsx("div",{className:Ae.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Ae.modal,children:[l.jsxs("div",{className:Ae.header,children:[l.jsx("span",{className:Ae.title,children:s.appIconPickerModal.title}),l.jsx("button",{className:Ae.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:l.jsx(yr,{size:18})})]}),l.jsxs("div",{className:Ae.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":i==="my",className:`${Ae.tab} ${i==="my"?Ae.activeTab:""}`,onClick:()=>o("my"),children:s.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":i==="all",className:`${Ae.tab} ${i==="all"?Ae.activeTab:""}`,onClick:()=>o("all"),children:s.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":i==="upload",className:`${Ae.tab} ${i==="upload"?Ae.activeTab:""}`,onClick:()=>o("upload"),children:[l.jsx(Fa,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Ae.body,children:i!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ae.searchWrap,children:[l.jsx(Wi,{size:14,className:Ae.searchIcon}),l.jsx("input",{type:"search",className:Ae.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:a,onChange:R=>he(R.target.value)})]}),p&&u.length===0?l.jsxs("div",{className:Ae.loadingRow,children:[l.jsx(Ti,{size:20,className:Ae.spinner}),l.jsx("span",{children:s.appIconPickerModal.loadingText})]}):u.length===0?l.jsx("div",{className:Ae.empty,children:s.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Ae.grid,children:u.map(R=>{const M=R.appIcon??R.artifactUrl??R.downloadUrl??"",Y=(h==null?void 0:h.identifier)===R.identifier;return l.jsxs("button",{type:"button",className:`${Ae.imgCell} ${Y?Ae.imgCellSelected:""}`,onClick:()=>v(R),title:R.name,children:[M?l.jsx("img",{src:M,alt:R.name,className:Ae.thumb}):l.jsx("div",{className:Ae.noThumb,children:s.appIconPickerModal.noThumbnailText}),Y&&l.jsx("div",{className:Ae.checkBadge,children:l.jsx(yn,{size:12})})]},R.identifier)})}),ye&&!p&&l.jsx("button",{className:Ae.loadMoreBtn,onClick:oe,children:s.appIconPickerModal.loadMoreButton}),p&&u.length>0&&l.jsx("div",{className:Ae.loadingRow,children:l.jsx(Ti,{size:16,className:Ae.spinner})})]}):l.jsxs("div",{className:Ae.uploadArea,children:[l.jsx("div",{className:Ae.dropZone,onClick:()=>{var R;return(R=O.current)==null?void 0:R.click()},onDragOver:R=>R.preventDefault(),onDrop:R=>{R.preventDefault();const M=R.dataTransfer.files[0];M&&ve({target:{files:[M],value:""}})},children:x?l.jsx("img",{src:x,alt:s.appIconPickerModal.previewAlt,className:Ae.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(Fa,{size:32,className:Ae.uploadIcon}),l.jsx("p",{className:Ae.dropText,children:s.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Ae.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",ne.split(",").map(R=>R.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(U/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:O,type:"file",accept:ne,className:Ae.hiddenInput,onChange:ve}),S&&l.jsx("p",{className:Ae.fileName,children:S.name}),j&&l.jsx("p",{className:Ae.errorText,children:j})]})}),l.jsxs("div",{className:Ae.footer,children:[l.jsx("button",{className:Ae.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),i==="upload"?l.jsx("button",{className:Ae.confirmBtn,disabled:!S||D,onClick:xe,children:D?l.jsxs(l.Fragment,{children:[l.jsx(Ti,{size:14,className:Ae.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Ae.confirmBtn,disabled:!h,onClick:ge,children:s.appIconPickerModal.useSelectedButton})]})]})})},lj=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const i=ae(),[o,a]=m.useState(!1),{watch:c,setValue:u,register:d,formState:{errors:f}}=er(),g=c(e),p=f[e],b=v=>{u(e,v,{shouldDirty:!0,shouldValidate:!0}),a(!1)},h=()=>{u(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?i.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:q.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":i.appIconField.selectIconAriaLabel,onClick:()=>!s&&a(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!s&&a(!0)},children:g?l.jsx("img",{src:g,alt:i.appIconField.iconAlt,className:q.iconPreview}):l.jsxs("div",{className:q.iconPlaceholder,children:[l.jsx(Mf,{size:20}),l.jsx("span",{children:i.appIconField.selectIconLabel})]})}),g&&!s&&l.jsxs("button",{type:"button",className:q.removeIconBtn,onClick:h,"aria-label":i.appIconField.removeIconAriaLabel,children:[l.jsx(Co,{size:13}),l.jsx("span",{children:i.appIconField.removeLabel})]}),p&&l.jsx("span",{className:q.error,children:String(p.message)}),o&&l.jsx(Vp,{nodeId:r,currentValue:g,onSelect:b,onClose:()=>a(!1)})]})},cj=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:i}=er(),{field:o,fieldState:{error:a}}=oi({name:e,control:i,rules:{required:r?s.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[q.input,a?q.inputError:""].join(" "),disabled:n,value:o.value??"",onChange:o.onChange,onBlur:o.onBlur,ref:o.ref}),a&&l.jsx("span",{className:q.error,children:String(a.message)})]})},uj=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:i}=er(),{field:o,fieldState:{error:a}}=oi({name:e,control:i,rules:{required:r?s.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,u]=m.useState(""),d=m.useRef(null),f=o.value??[],g=v=>{const y=v.trim();!y||f.includes(y)||o.onChange([...f,y])},p=v=>{o.onChange(f.filter(y=>y!==v))},b=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),g(c),u("")):v.key==="Backspace"&&c===""&&f.length>0&&p(f[f.length-1])},h=()=>{c.trim()&&(g(c),u("")),o.onBlur()};return l.jsxs("div",{className:[q.field,q.fullWidth].join(" "),children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsxs("div",{className:[q.chipGroup,a?q.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=d.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:q.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:q.tagChipRemove,onClick:y=>{y.stopPropagation(),p(v)},"aria-label":`Remove ${v}`,children:l.jsx(yr,{size:11})})]},v)),!n&&l.jsx("input",{ref:d,className:q.chipInput,value:c,onChange:v=>u(v.target.value),onKeyDown:b,onBlur:h,placeholder:f.length===0?s.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),a&&l.jsx("span",{className:q.error,children:String(a.message)})]})},dj=({name:e,label:t,levels:r,required:n,disabled:s})=>{const i=ae(),{control:o}=er(),{field:a,fieldState:{error:c}}=oi({name:e,control:o,rules:{required:n?i.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),u=a.value??{},d=(f,g,p)=>{const b={};for(let h=0;h<g;h++)b[r[h].code]=u[r[h].code]??"";b[f]=p;for(let h=g+1;h<r.length;h++)b[r[h].code]="";a.onChange(b)};return l.jsxs("div",{className:[q.field,q.fullWidth].join(" "),children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("div",{className:q.nestedSelectRow,children:r.map((f,g)=>{const p=g>0&&!u[r[g-1].code];return l.jsxs("div",{className:q.field,style:{flex:1},children:[l.jsx("label",{className:q.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[q.input,c?q.inputError:""].join(" "),disabled:s||p,value:u[f.code]??"",onChange:b=>d(f.code,g,b.target.value),onBlur:a.onBlur,children:[l.jsx("option",{value:"",children:i.nestedSelectField.selectPlaceholder}),f.options.map(b=>l.jsx("option",{value:b.value,children:b.label},b.value))]})]},f.code)})}),c&&l.jsx("span",{className:q.error,children:String(c.message)})]})},bd=[{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"}],fj=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),[i,o]=m.useState(!1),a=m.useRef(null),{register:c,watch:u,setValue:d,formState:{errors:f}}=er(),g=u(e),p=bd.find(v=>v.value===g),b=(p==null?void 0:p.label)??s.licenseSelectField.selectPlaceholder,h=f[e];return m.useEffect(()=>{if(!i)return;const v=y=>{var C;(C=a.current)!=null&&C.contains(y.target)||o(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]),l.jsxs("div",{className:q.field,ref:a,style:{position:"relative"},children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.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:[q.selectBtn,h?q.inputError:"",i?q.selectOpen:""].join(" "),onClick:()=>o(v=>!v),"aria-haspopup":"listbox","aria-expanded":i,children:[l.jsx("span",{className:g?q.selectedVal:q.placeholder,children:b}),l.jsx(bn,{size:14,className:i?q.chevronUp:""})]}),i&&l.jsx("div",{className:q.dropdown,role:"listbox",children:bd.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":g===v.value,className:[q.option,g===v.value?q.optionSelected:""].join(" "),onClick:()=>{d(e,v.value,{shouldDirty:!0,shouldValidate:!0}),o(!1)},children:[l.jsx("span",{children:v.label}),g===v.value&&l.jsx(yn,{size:13})]},v.value))}),h&&l.jsx("span",{className:q.error,children:String(h.message)})]})},hj=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:i}=er(),{field:o,fieldState:{error:a}}=oi({name:e,control:i,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,u]=m.useState("idle"),[d,f]=m.useState(""),g=async()=>{const b=(o.value??"").trim();if(!b){u("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}u("loading"),f("");try{const h=await p0(b),v=h==null?void 0:h.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(u("valid"),f(s.dialcodeInputField.validMessage)):(u("invalid"),f(s.dialcodeInputField.notFoundMessage))}catch{u("invalid"),f(s.dialcodeInputField.validationFailedMessage)}},p=()=>c==="loading"?l.jsx(Ti,{size:16,className:q.dialcodeSpinner}):c==="valid"?l.jsx(Nf,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(Sy,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsxs("div",{className:q.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[q.input,a?q.inputError:""].join(" "),disabled:n,value:o.value??"",onChange:b=>{o.onChange(b),u("idle"),f("")},onBlur:o.onBlur,ref:o.ref,placeholder:s.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:q.validateBtn,onClick:g,disabled:n||c==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:c==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),p()]}),a&&l.jsx("span",{className:q.error,children:String(a.message)}),!a&&d&&l.jsx("span",{className:c==="valid"?q.dialcodeValid:q.error,children:d})]})},pj="_cards_1oc2m_1",mj="_card_1oc2m_1",gj="_cardActive_1oc2m_30",vj="_cardIcon_1oc2m_35",yj="_cardIconPrimary_1oc2m_46",bj="_cardIconHover_1oc2m_50",Cj="_radioDot_1oc2m_54",Sj="_radioDotActive_1oc2m_65",_j="_cardTitle_1oc2m_70",wj="_cardTitleInk_1oc2m_76",xj="_cardDescription_1oc2m_80",Tj="_cardDescriptionCharcoal_1oc2m_86",$t={cards:pj,card:mj,cardActive:gj,cardIcon:vj,cardIconPrimary:yj,cardIconHover:bj,radioDot:Cj,radioDotActive:Sj,cardTitle:_j,cardTitleInk:wj,cardDescription:xj,cardDescriptionCharcoal:Tj},Ej=({name:e,label:t,required:r,disabled:n})=>{const s=ae(),{control:i}=er(),o=[{value:"Fixed",Icon:Bf,iconVariant:$t.cardIconPrimary,title:s.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"Diagnostic",Icon:Hy,iconVariant:$t.cardIconPrimary,title:s.learningPath.policyAdaptiveLabel,titleVariant:$t.cardTitleInk,description:l.jsxs(l.Fragment,{children:[s.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:q.required,children:"*"}),s.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:$t.cardDescriptionCharcoal},{value:"PriorLearning",Icon:My,iconVariant:$t.cardIconHover,title:s.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx($L,{name:e,control:i,rules:{required:r?s.selectField.requiredError.replace("{field}",t):!1},render:({field:a})=>l.jsx("div",{className:$t.cards,children:o.map(({value:c,Icon:u,iconVariant:d,title:f,titleVariant:g,description:p,descriptionVariant:b})=>{const h=a.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[$t.card,h?$t.cardActive:""].join(" "),onClick:()=>a.onChange(c),children:[l.jsx("span",{className:[$t.cardIcon,d].join(" "),children:l.jsx(u,{size:16})}),l.jsx("span",{className:[$t.radioDot,h?$t.radioDotActive:""].join(" ")}),l.jsx("span",{className:[$t.cardTitle,g].join(" "),children:f}),l.jsx("span",{className:[$t.cardDescription,b].join(" "),children:p})]},c)})})})]})},Aj="_form_lktqh_1",Ij="_formLp_lktqh_7",kj="_ungrouped_lktqh_12",Dj="_ungroupedLp_lktqh_23",Lj="_fullWidthField_lktqh_27",Oj="_noFields_lktqh_31",Nn={form:Aj,formLp:Ij,ungrouped:kj,ungroupedLp:Dj,fullWidthField:Lj,noFields:Oj},Nj=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:i,onFormStatusChange:o})=>{var ee,He,Ge,Ze,Qe,tt,st,Kr,_n;const a=ae(),c=Z(K=>K.editorConfig),u=Z(K=>K.editorProfile),d=u.key==="learningPath",f=Z(K=>K.rootFormConfig),g=Z(K=>K.unitFormConfig),p=Z(K=>K.categoryMeta),b=Z(K=>K.contentFramework),h=Z(K=>K.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:C}=Eo(b??((ee=c==null?void 0:c.context)==null?void 0:ee.framework),h??((He=c==null?void 0:c.context)==null?void 0:He.targetFWIds)),{frameworks:S,collectionAdditionalCategories:_,contentAdditionalCategories:x,defaultLicense:E,name:D}=iO((Ge=c==null?void 0:c.context)==null?void 0:Ge.channel),T=oO(((Ze=c==null?void 0:c.context)==null?void 0:Ze.userId)??((Qe=c==null?void 0:c.context)==null?void 0:Qe.uid)),j=sO(S,(tt=p==null?void 0:p.frameworkMetadata)==null?void 0:tt.orgFWType,(st=c==null?void 0:c.context)==null?void 0:st.channel),F={organisationFramework:v,targetFrameworks:y,orgFrameworks:j,channelAdditionalCategories:_},O=ue(K=>K.selectedNodeId),N=ue(K=>K.treeData),B=ue(K=>K.treeCache),P=O?B[O]??{}:{},U={...e,...P},ne=m.useMemo(()=>{var _e;if(!O)return 0;const K=[...N];for(;K.length;){const w=K.shift();if(w.id===O)return((_e=w.children)==null?void 0:_e.length)??0;w.children&&K.push(...w.children)}return 0},[N,O]),H=(c==null?void 0:c.config)??{},te=(c==null?void 0:c.context)??{},he={editorMode:s,editableFields:H.editableFields,objectType:H.objectType,setDefaultCopyRight:H.setDefaultCopyRight===!0,defaultLicense:te.defaultLicense??E,contextAdditionalCategories:te.additionalCategories,userFullName:((Kr=te.user)==null?void 0:Kr.fullName)??T,channelName:D,collectionAdditionalCategories:_,contentAdditionalCategories:x,childCount:ne,profile:u},oe=r?f:g,ge=oe||(((_n=c==null?void 0:c.config.hierarchy)==null?void 0:_n.formConfig)??[]),ve=qp(ge,U,F,r,he),xe=ve.filter(K=>K.tab===t&&K.inputType!=="appIcon"&&K.visible!==!1),ye=nO({mode:"onChange",defaultValues:Object.fromEntries(ve.map(K=>{const _e=["multiselect","chips","keywords","tagsinput"],w=["nestedselect"];return _e.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??[]]:w.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??{}]:[K.code,K.currentValue??K.defaultValue??""]}))});NO(ye,ve);const{updateNode:R}=ue(),M=m.useRef(ve);M.current=ve;const Y=m.useRef(O);Y.current=O;const le=m.useRef(i);le.current=i;const Ce=m.useRef(o);Ce.current=o;const de=m.useRef(typeof U.shuffle=="boolean"?U.shuffle:void 0),ce=m.useRef(U.name??"");ce.current=U.name??"";const Q=m.useRef(s);Q.current=s;const se=["review","read","sourcingreview","orgreview"];m.useEffect(()=>{const K=Y.current;if(K){const _e=Object.fromEntries(M.current.filter(w=>w.currentValue!==void 0&&w.currentValue!==null).map(w=>[w.code,w.currentValue]));Object.keys(_e).length>0&&R(K,_e)}ye.trigger().then(()=>{const _e=ye.formState.errors,w=M.current,k=Array.from(new Set(Object.keys(_e).map(L=>{var z;return(z=w.find(V=>V.code===L))==null?void 0:z.tab}).filter(Boolean)));Ce.current(Object.keys(_e).length===0,k)})},[]),m.useEffect(()=>{const K=ye.watch((_e,{name:w})=>{const k=Y.current;if(!k)return;const L=M.current,z=new Set(L.map($=>$.code));if(w&&z.has(w)){let $=ye.getValues(w);if(w==="dialcodes"&&($=Array.isArray($)?$:$?[$]:[]),w==="shuffle"&&($===!0&&de.current===!1&&we(a.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(Ps,{size:16})}),de.current=$),w==="framework"&&r&&typeof $=="string"&&$){const be=Z.getState();if(be.setContentFramework($,be.contentTargetFWIds),d){const $e=ue.getState().pruneCoursesByFramework($);$e>0&&we(a.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String($e)),{icon:l.jsx(Ps,{size:16}),duration:5e3})}}const re=OO(w,$);re&&(R(k,re),le.current(re))}else if(!w){const $=ye.getValues(),re=Object.fromEntries(Object.entries($).filter(([$e])=>z.has($e))),be=LO(re,{isReview:se.includes(Q.current),nodeTitle:ce.current});Object.keys(be).length>0&&(R(k,be),le.current(be))}const V=ye.formState.errors,G=Array.from(new Set(Object.keys(V).map($=>{var re;return(re=L.find(be=>be.code===$))==null?void 0:re.tab}).filter(Boolean)));Ce.current(Object.keys(V).length===0,G)});return()=>K.unsubscribe()},[ye]),m.useEffect(()=>{for(const K of["author","creator","copyright","copyrightYear","license"]){const _e=M.current.find(k=>k.code===K);if(!_e||_e.currentValue===void 0||_e.currentValue===null||_e.currentValue==="")continue;const w=ye.getValues(K);(w==null||w==="")&&ye.setValue(K,_e.currentValue,{shouldDirty:!1})}},[T,D,ye]);const Te=xe.reduce((K,_e)=>{const w=K[K.length-1];return w&&w.section===_e.section?w.fields.push(_e):K.push({section:_e.section,fields:[_e]}),K},[]),me=K=>{const _e={key:K.code,name:K.code,label:K.label,required:K.required,disabled:K.editable===!1};if(d&&K.code==="policy")return l.jsx("div",{className:Nn.fullWidthField,children:l.jsx(Ej,{..._e})},K.code);switch(K.inputType){case"textarea":return l.jsx(vd,{..._e,multiline:!0,maxLength:K.maxLength});case"select":return l.jsx(CN,{..._e,options:K.options??[]});case"multiselect":return l.jsx(SN,{..._e,options:K.options??[]});case"chips":return l.jsx(_N,{..._e});case"radio":return l.jsx(wN,{..._e,options:K.options??[]});case"appIcon":return l.jsx(lj,{..._e,nodeId:O??""});case"datepicker":case"datetime":return l.jsx(cj,{..._e});case"keywords":case"tagsinput":return l.jsx(uj,{..._e});case"nestedselect":return l.jsx(dj,{..._e,levels:K.levels??[]});case"license":return l.jsx(fj,{..._e});case"dialcode":return l.jsx(hj,{..._e});default:return l.jsx(vd,{..._e,maxLength:K.maxLength})}};return l.jsx(UL,{...ye,children:l.jsxs("div",{className:[Nn.form,d?Nn.formLp:""].filter(Boolean).join(" "),children:[Te.map((K,_e)=>{const w=K.section?aO[K.section]:void 0;return w?l.jsx(qO,{title:w.title,description:w.description,children:K.fields.map(me)},K.section??_e):l.jsx("div",{className:[Nn.ungrouped,d?Nn.ungroupedLp:""].filter(Boolean).join(" "),children:K.fields.map(me)},_e)}),xe.length===0&&!C&&l.jsx("p",{className:Nn.noFields,children:a.sparkMetaForm.noFieldsMessage})]})})};function Hp(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function jj(e,t){return e.reduce((r,n,s)=>{const i=t.get(n);return i&&(r[s]=i),r},Array(e.length))}function bi(e){return e!==null&&e>=0}function Pj(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 Rj(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Qp=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const i=Hp(t,n,r),o=t[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},Ci={scaleX:1,scaleY:1},Fj=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:i,overIndex:o}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(s===r){const u=i[o];return u?{x:0,y:r<o?u.top+u.height-(a.top+a.height):u.top-a.top,...Ci}:null}const c=Mj(i,s,r);return s>r&&s<=o?{x:0,y:-a.height-c,...Ci}:s<r&&s>=o?{x:0,y:a.height+c,...Ci}:{x:0,y:0,...Ci}};function Mj(e,t,r){const n=e[t],s=e[t-1],i=e[t+1];return n?r<t?s?n.top-(s.top+s.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const Wp="Sortable",Gp=m.createContext({activeIndex:-1,containerId:Wp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Qp,disabled:{draggable:!1,droppable:!1}});function Bj(e){let{children:t,id:r,items:n,strategy:s=Qp,disabled:i=!1}=e;const{active:o,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=Lf(),f=Ks(Wp,r),g=a.rect!==null,p=m.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),b=o!=null,h=o?p.indexOf(o.id):-1,v=u?p.indexOf(u.id):-1,y=m.useRef(p),C=!Pj(p,y.current),S=v!==-1&&h===-1||C,_=Rj(i);or(()=>{C&&b&&d(p)},[C,p,b,d]),m.useEffect(()=>{y.current=p},[p]);const x=m.useMemo(()=>({activeIndex:h,containerId:f,disabled:_,disableTransforms:S,items:p,overIndex:v,useDragOverlay:g,sortedRects:jj(p,c),strategy:s}),[h,f,_.draggable,_.droppable,S,p,v,c,g,s]);return m.createElement(Gp.Provider,{value:x},t)}const qj=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return Hp(r,n,s).indexOf(t)},$j=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!n||a!==i&&s===o?!1:r?!0:o!==s&&t===c},Uj={duration:200,easing:"ease"},Kp="transform",zj=Vr.Transition.toString({property:Kp,duration:0,easing:"linear"}),Vj={roleDescription:"sortable"};function Hj(e){let{disabled:t,index:r,node:n,rect:s}=e;const[i,o]=m.useState(null),a=m.useRef(r);return or(()=>{if(!t&&r!==a.current&&n.current){const c=s.current;if(c){const u=ss(n.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&o(d)}}r!==a.current&&(a.current=r)},[t,r,n,s]),m.useEffect(()=>{i&&o(null)},[i]),i}function Qj(e){let{animateLayoutChanges:t=$j,attributes:r,disabled:n,data:s,getNewIndex:i=qj,id:o,strategy:a,resizeObserverConfig:c,transition:u=Uj}=e;const{items:d,containerId:f,activeIndex:g,disabled:p,disableTransforms:b,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:C}=m.useContext(Gp),S=Wj(n,p),_=d.indexOf(o),x=m.useMemo(()=>({sortable:{containerId:f,index:_,items:d},...s}),[f,s,_,d]),E=m.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:D,node:T,isOver:j,setNodeRef:F}=Jv({id:o,data:x,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:O,activatorEvent:N,activeNodeRect:B,attributes:P,setNodeRef:U,listeners:ne,isDragging:H,over:te,setActivatorNodeRef:he,transform:oe}=Df({id:o,data:x,attributes:{...Vj,...r},disabled:S.draggable}),ge=Mg(F,U),ve=!!O,xe=ve&&!b&&bi(g)&&bi(v),ye=!y&&H,R=ye&&xe?oe:null,Y=xe?R??(a??C)({rects:h,activeNodeRect:B,activeIndex:g,overIndex:v,index:_}):null,le=bi(g)&&bi(v)?i({id:o,items:d,activeIndex:g,overIndex:v}):_,Ce=O==null?void 0:O.id,de=m.useRef({activeId:Ce,items:d,newIndex:le,containerId:f}),ce=d!==de.current.items,Q=t({active:O,containerId:f,isDragging:H,isSorting:ve,id:o,index:_,items:d,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:u,wasDragging:de.current.activeId!=null}),se=Hj({disabled:!Q,index:_,node:T,rect:D});return m.useEffect(()=>{ve&&de.current.newIndex!==le&&(de.current.newIndex=le),f!==de.current.containerId&&(de.current.containerId=f),d!==de.current.items&&(de.current.items=d)},[ve,le,f,d]),m.useEffect(()=>{if(Ce===de.current.activeId)return;if(Ce&&!de.current.activeId){de.current.activeId=Ce;return}const me=setTimeout(()=>{de.current.activeId=Ce},50);return()=>clearTimeout(me)},[Ce]),{active:O,activeIndex:g,attributes:P,data:x,rect:D,index:_,newIndex:le,items:d,isOver:j,isSorting:ve,isDragging:H,listeners:ne,node:T,overIndex:v,over:te,setNodeRef:ge,setActivatorNodeRef:he,setDroppableNodeRef:F,setDraggableNodeRef:U,transform:se??Y,transition:Te()};function Te(){if(se||ce&&de.current.newIndex===_)return zj;if(!(ye&&!uo(N)||!u)&&(ve||Q))return Vr.Transition.toString({...u,property:Kp})}}function Wj(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 no(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 Gj=[Oe.Down,Oe.Right,Oe.Up,Oe.Left],Kj=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:a}}=t;if(Gj.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const g=s.get(f.id);if(g)switch(e.code){case Oe.Down:n.top<g.top&&c.push(f);break;case Oe.Up:n.top>g.top&&c.push(f);break;case Oe.Left:n.left>g.left&&c.push(f);break;case Oe.Right:n.left<g.left&&c.push(f);break}});const u=tv({collisionRect:n,droppableRects:s,droppableContainers:c});let d=hf(u,"id");if(d===(o==null?void 0:o.id)&&u.length>1&&(d=u[1].id),d!=null){const f=i.get(r.id),g=i.get(d),p=g?s.get(g.id):null,b=g==null?void 0:g.node.current;if(b&&p&&f&&g){const v=fo(b).some((E,D)=>a[D]!==E),y=Yp(f,g),C=Yj(f,g),S=v||!y?{x:0,y:0}:{x:C?n.width-p.width:0,y:C?n.height-p.height:0},_={x:p.left,y:p.top};return S.x&&S.y?_:Ns(_,S)}}}};function Yp(e,t){return!no(e)||!no(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Yj(e,t){return!no(e)||!no(t)||!Yp(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Zj="_row_1m6cn_1",Xj="_removeBtn_1m6cn_14",Jj="_grip_1m6cn_17",eP="_ctIcon_1m6cn_34",tP="_info_1m6cn_38",rP="_name_1m6cn_46",nP="_meta_1m6cn_55",Zr={row:Zj,removeBtn:Xj,grip:Jj,ctIcon:eP,info:tP,name:rP,meta:nP},sP={video:So,pdf:Zs,h5p:vo,scorm:bo,audio:yo,quiz:go,course:Wr,default:Gr},iP=({item:e,onRemove:t,isEditable:r})=>{const n=ae(),s=ni(e),i=sP[s.key]??Gr,{attributes:o,listeners:a,setNodeRef:c,transform:u,transition:d,isDragging:f}=Qj({id:e.id,disabled:!r}),g={transform:Vr.Transform.toString(u),transition:d,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:g,className:Zr.row,role:"listitem",children:[r&&l.jsx("span",{className:Zr.grip,...o,...a,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Ff,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${s.key}`,Zr.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Zr.info,children:[l.jsx("span",{className:Zr.name,title:e.name,children:e.name}),l.jsx("span",{className:Zr.meta,children:s.label})]}),l.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&l.jsx("button",{type:"button",className:Zr.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(yr,{size:14})})]})},oP="_container_1ls1w_1",aP="_header_1ls1w_7",lP="_heading_1ls1w_13",cP="_count_1ls1w_21",uP="_list_1ls1w_30",dP="_emptyState_1ls1w_36",fP="_skillPicker_1ls1w_52",hP="_skillsCovered_1ls1w_52",pP="_chips_1ls1w_64",mP="_chip_1ls1w_64",gP="_skillWarning_1ls1w_80",vP="_selectedSkills_1ls1w_85",yP="_skillPill_1ls1w_91",bP="_skillPillFlagged_1ls1w_103",CP="_skillPillRemove_1ls1w_107",SP="_skillSearchBox_1ls1w_122",_P="_skillSearchWrap_1ls1w_127",wP="_searchIcon_1ls1w_142",xP="_skillSearchInput_1ls1w_147",TP="_skillDropdown_1ls1w_160",EP="_skillOption_1ls1w_174",AP="_skillCheckbox_1ls1w_196",IP="_skillCheckboxChecked_1ls1w_208",kP="_skillDropdownEmpty_1ls1w_213",DP="_skillPickerNote_1ls1w_219",LP="_emptyHint_1ls1w_224",OP="_assessmentsCard_1ls1w_237",NP="_assessmentSlots_1ls1w_249",jP="_assessmentItemRow_1ls1w_255",PP="_assessmentItemIcon_1ls1w_266",RP="_assessmentItemInfo_1ls1w_278",FP="_assessmentItemTitle_1ls1w_285",MP="_assessmentItemMeta_1ls1w_294",BP="_addRowIcon_1ls1w_299",qP="_assessmentItemBadge_1ls1w_311",$P="_menuWrap_1ls1w_322",UP="_menuBtn_1ls1w_327",zP="_dropmenu_1ls1w_340",VP="_dangerItem_1ls1w_370",HP="_addRow_1ls1w_299",QP="_addRowAssessment_1ls1w_394",pe={container:oP,header:aP,heading:lP,count:cP,list:uP,emptyState:dP,skillPicker:fP,skillsCovered:hP,chips:pP,chip:mP,skillWarning:gP,selectedSkills:vP,skillPill:yP,skillPillFlagged:bP,skillPillRemove:CP,skillSearchBox:SP,skillSearchWrap:_P,searchIcon:wP,skillSearchInput:xP,skillDropdown:TP,skillOption:EP,skillCheckbox:AP,skillCheckboxChecked:IP,skillDropdownEmpty:kP,skillPickerNote:DP,emptyHint:LP,assessmentsCard:OP,assessmentSlots:NP,assessmentItemRow:jP,assessmentItemIcon:PP,assessmentItemInfo:RP,assessmentItemTitle:FP,assessmentItemMeta:MP,addRowIcon:BP,assessmentItemBadge:qP,menuWrap:$P,menuBtn:UP,dropmenu:zP,dangerItem:VP,addRow:HP,addRowAssessment:QP},WP=({options:e,selected:t,outOfScope:r,onChange:n,isEditable:s,description:i})=>{const o=ae(),[a,c]=m.useState(""),[u,d]=m.useState(!1),f=m.useRef(null);m.useEffect(()=>{if(!u)return;const h=v=>{var y;(y=f.current)!=null&&y.contains(v.target)||d(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[u]);const g=a?e.filter(h=>h.toLowerCase().includes(a.toLowerCase())):e,p=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:pe.skillPicker,children:[l.jsxs("div",{className:pe.header,children:[l.jsx("span",{className:pe.heading,children:o.learningPath.skillsHeading}),l.jsx("span",{className:pe.count,children:t.length})]}),l.jsx("span",{className:pe.skillPickerNote,children:i}),r.length>0&&l.jsx("div",{className:pe.skillWarning,role:"alert",children:o.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),t.length>0&&l.jsx("div",{className:pe.selectedSkills,children:t.map(h=>{const v=r.includes(h);return l.jsxs("span",{className:[pe.skillPill,v?pe.skillPillFlagged:""].join(" "),children:[h,s&&l.jsx("button",{type:"button",className:pe.skillPillRemove,onClick:()=>b(h),"aria-label":o.learningPath.removeSkillAriaLabel.replace("{skill}",h),children:l.jsx(yr,{size:11})})]},h)})}),s?l.jsxs("div",{className:pe.skillSearchBox,ref:f,children:[l.jsxs("div",{className:pe.skillSearchWrap,onClick:()=>d(!0),children:[l.jsx("input",{type:"search",className:pe.skillSearchInput,placeholder:o.learningPath.searchSkillsPlaceholder,value:a,onChange:h=>c(h.target.value),onFocus:()=>d(!0),"aria-label":o.learningPath.searchSkillsPlaceholder}),l.jsx(Wi,{size:14,className:pe.searchIcon})]}),u&&l.jsx("div",{className:pe.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:pe.skillDropdownEmpty,children:o.learningPath.noSkillsAvailable}):g.length===0?l.jsx("div",{className:pe.skillDropdownEmpty,children:o.learningPath.noMatchingSkills}):g.map(h=>{const v=t.includes(h);return l.jsxs("button",{type:"button",role:"option","aria-selected":v,className:pe.skillOption,onClick:()=>p(h),children:[l.jsx("span",{className:[pe.skillCheckbox,v?pe.skillCheckboxChecked:""].join(" "),children:v&&l.jsx(yn,{size:12})}),h]},h)})})]}):t.length===0&&l.jsx("span",{className:pe.emptyHint,children:o.learningPath.noSkillsSelectedYet})]})},ul=({slot:e,isEditable:t})=>{const r=ae(),{pre:n,post:s,setActiveAssessmentSlot:i,deleteSlot:o}=Vl(),a=ue(h=>h.selectNode),[c,u]=m.useState(!1),d=m.useRef(null),f=e==="pre"?n:s,g=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(m.useEffect(()=>{if(!c)return;const h=v=>{var y;(y=d.current)!=null&&y.contains(v.target)||u(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!f.filled)return l.jsxs("button",{type:"button",className:[pe.addRow,pe.addRowAssessment].join(" "),disabled:!t,onClick:()=>i(e),children:[l.jsx("span",{className:pe.addRowIcon,children:l.jsx(Cn,{size:16})}),r.learningPath.addAssessmentSlotButton.replace("{label}",g)]});const p=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,b=()=>f.level&&a(f.level.id);return l.jsxs("div",{className:pe.assessmentItemRow,role:"button",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[l.jsx("span",{className:pe.assessmentItemIcon,children:l.jsx(Wr,{size:16})}),l.jsxs("div",{className:pe.assessmentItemInfo,children:[l.jsx("span",{className:pe.assessmentItemTitle,children:f.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:pe.assessmentItemMeta,children:[g," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:pe.assessmentItemBadge,children:p}),t&&l.jsxs("div",{className:pe.menuWrap,ref:d,children:[l.jsx("button",{type:"button",className:pe.menuBtn,onClick:h=>{h.stopPropagation(),u(v=>!v)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),c&&l.jsxs("div",{className:pe.dropmenu,onClick:h=>h.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{u(!1),f.level&&a(f.level.id)},children:[l.jsx(xy,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:pe.dangerItem,onClick:()=>{u(!1),o(e)},children:[l.jsx(Co,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})},GP=({editorMode:e,isRoot:t=!1})=>{const r=ae(),{selectedNodeId:n,getChildrenOf:s,getNodeById:i,reorderChildren:o,deleteNode:a,activeNodeMeta:c,updateNode:u,treeData:d}=ue(),f=Z(N=>N.editorProfile),g=n?s(n):[],p=e==="edit",b=n?i(n):void 0,h=f.competencyScoped,v=h&&!t&&!lt(b),y=h&&t,{scope:C,source:S}=Dh(),_=as(),x=_&&Array.isArray(c[_.code])?c[_.code]:[],E=S==="prior"?x.filter(N=>!C.includes(N)):[],D=y?u1(d[0],_==null?void 0:_.code):[],T=m.useCallback(N=>{!n||!(_!=null&&_.code)||u(n,{[_.code]:N},[_.code])},[n,_==null?void 0:_.code,u]),j=uf(Na(ho,{activationConstraint:{distance:5}}),Na(bl,{coordinateGetter:Kj})),F=m.useCallback(N=>{const{active:B,over:P}=N;if(!P||B.id===P.id||!n)return;const U=ue.getState().getChildrenOf(n),ne=U.findIndex(te=>te.id===B.id),H=U.findIndex(te=>te.id===P.id);ne<0||H<0||o(n,ne,H)},[n,o]),O=m.useCallback(N=>{window.confirm(r.unitContentList.removeConfirm)&&a(N)},[a,r.unitContentList.removeConfirm]);return n?l.jsxs("div",{className:pe.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:pe.skillsCovered,children:[l.jsx("span",{className:pe.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:pe.emptyHint,children:r.learningPath.skillsCoveredDescription}),D.length>0&&l.jsx("div",{className:pe.chips,children:D.map(N=>l.jsx("span",{className:pe.chip,children:N},N))}),D.length===0&&l.jsx("span",{className:pe.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:pe.assessmentsCard,children:[l.jsx("span",{className:pe.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:pe.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:pe.assessmentSlots,children:[l.jsx(ul,{slot:"pre",isEditable:p}),l.jsx(ul,{slot:"post",isEditable:p})]})]})]}),v&&l.jsx(WP,{options:C,selected:x,outOfScope:E,onChange:T,isEditable:p,description:S==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:pe.header,children:[l.jsx("span",{className:pe.heading,children:r.unitContentList.heading}),l.jsx("span",{className:pe.count,children:g.length})]}),g.length>0?l.jsx(kf,{sensors:j,collisionDetection:ev,onDragEnd:F,children:l.jsx(Bj,{items:g.map(N=>N.id),strategy:Fj,children:l.jsx("div",{className:pe.list,role:"list",children:g.map(N=>l.jsx(iP,{item:N,onRemove:O,isEditable:p},N.id))})})}):l.jsxs("div",{className:pe.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),p&&!lt(b)&&l.jsxs("button",{className:pe.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Cn,{size:14})," ",r.unitContentList.addContent]})]})]}):null},KP="_dropZone_ijo5w_1",YP="_active_ijo5w_14",Cd={dropZone:KP,active:YP},ZP=({isActive:e,label:t,nodeId:r,className:n})=>{const s=ae(),i=t??s.dropZone.dropHere;return l.jsx("div",{className:`${Cd.dropZone} ${e?Cd.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":i,role:"region",children:l.jsx("span",{children:i})})},Zp=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function XP(e){var o;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((o=(await Re.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??Zp}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:o.result)??{},s=new Set(["count","facets"]);return{content:Object.entries(n).filter(([a])=>!s.has(a)).flatMap(([,a])=>Array.isArray(a)?a:[]),count:n.count??0}}async function JP(e){var r,n;return(n=(r=(await Re.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Sd="application/vnd.sunbird.question";function _d(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Xp(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=Xp(n,t,e);if(s)return s}return null}function eR(e,t){const r=Xp(e,t);if(!r)return null;const{question:n,parent:s}=r,i={...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?i.maxScore=1:n.qType==="SA"?delete i.maxScore:n.maxScore!=null&&(i.maxScore=n.maxScore),i}function tR(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return Zn({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await mh(e),s=d=>{if(!d)return[];const f=d.mimeType===Sd&&d.identifier?[d.identifier]:[],g=(d.children??[]).flatMap(s);return[...f,...g]},i=s(n),o=new Map;i.length&&(await Yx(i)).forEach(f=>{const g=f.identifier;g&&o.set(g,f)});const a=d=>{if(!d)return d;if(d.mimeType===Sd&&d.identifier){const f=o.get(d.identifier)??d,g=f.outcomeDeclaration;return g!=null&&g.maxScore||(f.outcomeDeclaration={...g??{},maxScore:_d(f)}),f}return Array.isArray(d.children)&&(d.children=d.children.map(f=>a(f))),d},c=a(n),u=c.outcomeDeclaration;return u!=null&&u.maxScore||(c.outcomeDeclaration={...u??{},maxScore:_d(c)}),c}})}const wd="/assets/quml-player/sunbird-quml-player.js",rR="/assets/quml-player/styles.css",xd="sunbird-quml-player";function nR(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const ut=class ut{constructor(){fs(this,"eventHandlers",new WeakMap)}loadScript(){return ut.scriptLoaded||customElements.get(xd)?(ut.scriptLoaded=!0,Promise.resolve()):(ut.scriptLoading||(ut.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=wd,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{ut.scriptLoaded=!0,ut.scriptLoading=void 0,t()},n.onerror=()=>{ut.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${wd}`))},document.body.appendChild(n)})),ut.scriptLoading)}loadStyles(){if(ut.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){ut.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=rR,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),ut.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),ut.stylesLoaded=!1}async createConfig(t,r,n){var i,o,a;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((i=r==null?void 0:r.pdata)==null?void 0:i.id)??"sunbird.portal",ver:((o=r==null?void 0:r.pdata)==null?void 0:o.ver)??"1.0",pid:((a=r==null?void 0:r.pdata)==null?void 0:a.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:nR(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(xd);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=o=>r==null?void 0:r(o),i=o=>n==null?void 0:n(o.detail);t.addEventListener("playerEvent",s),t.addEventListener("telemetryEvent",i),this.eventHandlers.set(t,{player:s,telemetry:i})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};fs(ut,"scriptLoaded",!1),fs(ut,"scriptLoading"),fs(ut,"stylesLoaded",!1);let so=ut;const Si=new so,sR="_contentPlayerRoot_1rdfn_1",iR="_flowLayout_1rdfn_9",oR="_stage_1rdfn_13",aR="_aspectRatio_1rdfn_16",lR="_playerHeader_1rdfn_32",cR="_playerHeaderThumb_1rdfn_46",uR="_playerHeaderTitle_1rdfn_56",dR="_typeBadge_1rdfn_66",fR="_typeDot_1rdfn_105",hR="_playerFrame_1rdfn_125",pR="_coverOverlay_1rdfn_133",mR="_coverHidden_1rdfn_145",gR="_coverThumb_1rdfn_150",vR="_coverPlayRing_1rdfn_159",yR="_coverPlayIcon_1rdfn_172",bR="_coverLabel_1rdfn_181",CR="_coverSkeleton_1rdfn_187",SR="_playerWrapper_1rdfn_213",_R="_infoStrip_1rdfn_223",wR="_infoChip_1rdfn_239",xR="_infoChipLabel_1rdfn_258",TR="_infoChipIcon_1rdfn_267",ER="_playerError_1rdfn_273",AR="_playerErrorIcon_1rdfn_287",IR="_playerErrorMsg_1rdfn_292",kR="_qumlRoot_1rdfn_299",Ve={contentPlayerRoot:sR,flowLayout:iR,stage:oR,aspectRatio:aR,playerHeader:lR,playerHeaderThumb:cR,playerHeaderTitle:uR,typeBadge:dR,typeDot:fR,playerFrame:hR,coverOverlay:pR,coverHidden:mR,coverThumb:gR,coverPlayRing:vR,coverPlayIcon:yR,coverLabel:bR,coverSkeleton:CR,playerWrapper:SR,infoStrip:_R,infoChip:wR,infoChipLabel:xR,infoChipIcon:TR,playerError:ER,playerErrorIcon:AR,playerErrorMsg:IR,qumlRoot:kR},DR="application/vnd.sunbird.questionset";function LR(e,t){const r=new Map,n=i=>{for(const o of i)r.set(o.id,o),o.children&&n(o.children)};n(e);let s=r.get(t);for(;s;){if(s.mimeType===DR)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const OR=[{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 NR(e){return OR.find(t=>t.mimes.includes(e))??{key:"other"}}function jR(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 PR={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},RR={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},FR={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},MR="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function pa(e){for(const[t,r]of Object.entries(PR))if(r.includes(e))return t;return"default-player"}function BR(e,t,r){var i;const n=r==null?void 0:r.context,s=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((i=n==null?void 0:n.pdata)==null?void 0:i.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 qR(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 $R(e,t,r=100){await qR(RR[t]??""),!customElements.get(e)&&await new Promise((n,s)=>{let i=0;const o=setInterval(()=>{i++,customElements.get(e)?(clearInterval(o),n()):i>=r&&(clearInterval(o),s(new Error(`Custom element <${e}> did not register`)))},100)})}const UR=[{key:"author",icon:zy},{key:"license",icon:Py},{key:"language",icon:Ey},{key:"gradeLevel",icon:Ry},{key:"subject",icon:Wr},{key:"contentType",icon:$y}];function zR(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 VR({node:e}){const t=ae(),r=e.metadata??{},n=UR.flatMap(s=>{const i=r[s.key];if(!i)return[];const o=Array.isArray(i)?i.join(", "):String(i);return o?[{...s,label:zR(s.key,t),val:o}]:[]});return n.length?l.jsx("div",{className:Ve.infoStrip,children:n.map(s=>l.jsxs("div",{className:Ve.infoChip,children:[s.icon&&l.jsx(s.icon,{size:13,className:Ve.infoChipIcon}),l.jsx("span",{className:Ve.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function Jp({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:`${Ve.coverOverlay} ${t?Ve.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:Ve.coverThumb}),l.jsx("div",{className:Ve.coverPlayRing,children:l.jsx("div",{className:Ve.coverPlayIcon})}),l.jsx("span",{className:Ve.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:Ve.coverSkeleton})})}function em({message:e}){return l.jsxs("div",{className:Ve.playerError,children:[l.jsx(Uy,{size:28,className:Ve.playerErrorIcon}),l.jsx("span",{className:Ve.playerErrorMsg,children:e})]})}function HR({mimeType:e}){const t=ae(),r=NR(e);return l.jsxs("span",{className:Ve.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:Ve.typeDot}),jR(r.key,t)]})}const dl=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var o;if(r==="quml")return l.jsx(WR,{node:e,editorMode:t,singleQuestion:!!n});const i=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return l.jsxs("div",{className:`${Ve.contentPlayerRoot} ${s==="flow"?Ve.flowLayout:""}`,children:[l.jsxs("div",{className:Ve.stage,children:[l.jsxs("div",{className:Ve.playerHeader,children:[i&&l.jsx("img",{src:i,alt:"",className:Ve.playerHeaderThumb}),l.jsx("span",{className:Ve.playerHeaderTitle,children:e.name}),l.jsx(HR,{mimeType:e.mimeType??""})]}),l.jsx(QR,{node:e})]}),l.jsx(VR,{node:e})]})};function QR({node:e}){var y;const t=ae(),r=Z(C=>C.editorConfig),[n,s]=m.useState(()=>pa(e.mimeType??"")),[i,o]=m.useState(!1),[a,c]=m.useState(null),[u,d]=m.useState(e.metadata??{}),[f,g]=m.useState(!1),p=m.useRef(null),b=m.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??MR;m.useEffect(()=>{let C=!1;return g(!1),o(!1),c(null),d(e.metadata??{}),s(pa(e.mimeType??"")),JP(e.identifier).then(S=>{if(C)return;const _={...e.metadata??{},...S};d(_);const x=S.mimeType??e.mimeType??"";s(pa(x)),g(!0)}).catch(()=>{C||g(!0)}),()=>{C=!0}},[e.identifier]);const v=BR(e,u,r);return m.useEffect(()=>{if(!f||n!=="default-player")return;const C=p.current;if(!C)return;C.src=h;const S=()=>{try{const x=C.contentWindow;if(typeof(x==null?void 0:x.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}x.initializePreview(v),setTimeout(()=>o(!0),300)}catch(x){console.error("[ContentPlayer] initializePreview failed",x),c(t.contentPlayer.failedToInitializePlayer)}},_=()=>c(t.contentPlayer.previewPlayerLoadFailed);return C.addEventListener("load",S),C.addEventListener("error",_),()=>{C.removeEventListener("load",S),C.removeEventListener("error",_),C.src=""}},[e.identifier,n,h,f,t]),m.useEffect(()=>{if(!f||n==="default-player")return;const C=b.current;if(!C)return;const S=FR[n];if(!S)return;const _=v;$R(S,n).then(()=>{if(!b.current)return;if(!customElements.get(S)){s("default-player");return}const x=document.createElement(S);x.setAttribute("player-config",JSON.stringify(_)),x.addEventListener("playerEvent",()=>{}),x.addEventListener("telemetryEvent",()=>{}),C.innerHTML="",C.appendChild(x),setTimeout(()=>{try{x.playerConfig=_}catch{}o(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),s("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:Ve.aspectRatio,children:[a?l.jsx(em,{message:a}):l.jsx(Jp,{node:e,hidden:i}),n==="default-player"?l.jsx("iframe",{ref:p,id:"contentPlayer",title:e.name,className:Ve.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:b,className:Ve.playerFrame})]})}function WR({node:e,editorMode:t,singleQuestion:r}){const n=ae(),s=Z(p=>p.editorConfig),i=ue(p=>p.treeData),o=m.useRef(null),a=r?LR(i,e.id):e.identifier,{data:c,isLoading:u,error:d}=tR(a??"",{enabled:!!a}),f=m.useMemo(()=>c?r?eR(c,e.identifier):c:null,[c,r,e.identifier]);m.useEffect(()=>{const p=o.current;if(!p||!f)return;let b=null,h=!1;return(async()=>{try{const v=await Si.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(h||!o.current)return;const y=Si.createElement(v);b=y,Si.attachEventListeners(y,C=>console.debug("[QumlPlayer] playerEvent",C.detail),C=>console.debug("[QumlPlayer] telemetryEvent",C)),p.innerHTML="",p.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,b&&(Si.removeEventListeners(b),b.remove()),so.unloadStyles()}},[f,s,t,r]);const g=d?`${n.contentPlayer.unableToLoadQuestionset} ${d.message}`:r&&!a?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:Ve.qumlRoot,children:[g?l.jsx(em,{message:g}):u||!f?l.jsx(Jp,{node:e,hidden:!1}):null,l.jsx("div",{ref:o,className:Ve.playerWrapper})]})}const GR="_overlay_1b1xq_1",KR="_modal_1b1xq_11",YR="_header_1b1xq_21",ZR="_body_1b1xq_37",XR="_hint_1b1xq_43",JR="_list_1b1xq_49",eF="_item_1b1xq_55",tF="_selected_1b1xq_68",rF="_empty_1b1xq_73",nF="_footer_1b1xq_79",sF="_cancelBtn_1b1xq_87",iF="_moveBtn_1b1xq_95",Kt={overlay:GR,modal:KR,header:YR,body:ZR,hint:XR,list:JR,item:eF,selected:tF,empty:rF,footer:nF,cancelBtn:sF,moveBtn:iF};function oF(e,t,r){const n=[],s=i=>{var o;for(const a of i)a.isFolder&&a.id!==r&&a.id!==t&&n.push(a),(o=a.children)!=null&&o.length&&s(a.children)};return s(e),n}const aF=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=ae(),{treeData:i,moveNode:o}=ue(),a=oF(i,((f=i[0])==null?void 0:f.id)??"",r),[c,u]=m.useState(null),d=()=>{c&&(o(e,r,c),n())};return l.jsx("div",{className:Kt.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Kt.modal,children:[l.jsxs("div",{className:Kt.header,children:[l.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:l.jsx(yr,{size:16})})]}),l.jsxs("div",{className:Kt.body,children:[l.jsx("p",{className:Kt.hint,children:s.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Kt.list,children:[a.map(g=>l.jsxs("li",{className:`${Kt.item} ${c===g.id?Kt.selected:""}`,onClick:()=>u(g.id),children:[l.jsx(Ty,{size:14}),l.jsx("span",{children:g.name})]},g.id)),a.length===0&&l.jsx("li",{className:Kt.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Kt.footer,children:[l.jsx("button",{className:Kt.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Kt.moveBtn,onClick:d,disabled:!c,children:s.resourceReorderDialog.moveButton})]})]})})},lF="_overlay_1d56g_1",cF="_modal_1d56g_11",uF="_header_1d56g_21",dF="_body_1d56g_37",fF="_table_1d56g_43",hF="_pageInput_1d56g_61",pF="_empty_1d56g_68",mF="_footer_1d56g_74",gF="_cancelBtn_1d56g_82",vF="_saveBtn_1d56g_90",fr={overlay:lF,modal:cF,header:uF,body:dF,table:fF,pageInput:hF,empty:pF,footer:mF,cancelBtn:gF,saveBtn:vF};function yF(e){const t=[],r=n=>{var s;for(const i of n)!i.isFolder&&(!i.children||i.children.length===0)?t.push(i):(s=i.children)!=null&&s.length&&r(i.children)};return r(e),t}const bF=({onClose:e})=>{const t=ae(),{treeData:r,updateNode:n}=ue(),s=yF(r),[i,o]=m.useState(()=>Object.fromEntries(s.map(c=>{var u;return[c.id,String(((u=c.metadata)==null?void 0:u.pageNumber)??"")]}))),a=m.useCallback(()=>{for(const[c,u]of Object.entries(i))u!==""&&n(c,{pageNumber:parseInt(u,10)||void 0});e()},[i,n,e]);return l.jsx("div",{className:fr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:fr.modal,children:[l.jsxs("div",{className:fr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(yr,{size:16})})]}),l.jsx("div",{className:fr.body,children:s.length===0?l.jsx("p",{className:fr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:fr.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:i[c.id]??"",onChange:u=>o(d=>({...d,[c.id]:u.target.value})),className:fr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:fr.footer,children:[l.jsx("button",{className:fr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:fr.saveBtn,onClick:a,children:[l.jsx(jy,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},CF="_container_p2feh_1",SF="_panelHeader_p2feh_10",_F="_panelHeaderLeft_p2feh_19",wF="_panelCollapseBtn_p2feh_27",xF="_titleRow_p2feh_46",TF="_field_p2feh_47",EF="_moveBtn_p2feh_64",AF="_icon_p2feh_84",IF="_nameInput_p2feh_93",kF="_fieldHeader_p2feh_118",DF="_label_p2feh_124",LF="_fieldCount_p2feh_133",OF="_chips_p2feh_170",NF="_chip_p2feh_170",jF="_chipRemove_p2feh_188",PF="_keywordInput_p2feh_202",RF="_input_p2feh_207",FF="_addBtn_p2feh_220",MF="_radioGroup_p2feh_234",BF="_radioLabel_p2feh_239",Ke={container:CF,panelHeader:SF,panelHeaderLeft:_F,panelCollapseBtn:wF,titleRow:xF,field:TF,moveBtn:EF,icon:AF,nameInput:IF,fieldHeader:kF,label:DF,fieldCount:LF,chips:OF,chip:NF,chipRemove:jF,keywordInput:PF,input:RF,addBtn:FF,radioGroup:MF,radioLabel:BF},qF=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var N,B;const{updateNode:s,markDirty:i}=ue(),o=t==="edit",a=ni(e),c=ae(),u=Z(P=>P.relationalFormConfig),d=P=>u==null?void 0:u.find(U=>U.code===P),f=P=>!u||!!d(P),g=(P,U)=>{var ne;return((ne=d(P))==null?void 0:ne.label)||U},[p,b]=m.useState(!0),h=((N=e.metadata)==null?void 0:N.relationalMetadata)??{},[v,y]=m.useState(h.name??e.name??""),[C,S]=m.useState(""),[_,x]=m.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((B=e.metadata)==null?void 0:B.keywords)?e.metadata.keywords:[]),[E,D]=m.useState(!!h.optional);m.useEffect(()=>{var U,ne;const P=((U=e.metadata)==null?void 0:U.relationalMetadata)??{};y(P.name??e.name??""),x(Array.isArray(P.keywords)?P.keywords:Array.isArray((ne=e.metadata)==null?void 0:ne.keywords)?e.metadata.keywords:[]),D(!!P.optional)},[e.id]);const T=()=>{v.trim()&&v!==e.name&&(s(e.id,{name:v.trim()}),i())},j=()=>{const P=C.trim();if(P&&!_.includes(P)){const U=[..._,P];x(U),s(e.id,{keywords:U}),i()}S("")},F=P=>{const U=_.filter(ne=>ne!==P);x(U),s(e.id,{keywords:U}),i()},O=P=>{D(P),s(e.id,{optional:P}),i()};return l.jsxs("div",{className:Ke.container,children:[l.jsxs("div",{className:Ke.panelHeader,children:[l.jsxs("div",{className:Ke.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${a.key}`,children:a.label}),o&&l.jsx("button",{type:"button",className:Ke.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:Ke.panelCollapseBtn,onClick:()=>b(P=>!P),"aria-expanded":p,"aria-label":p?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:p?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:p?l.jsx(bn,{size:15}):l.jsx(Cy,{size:15})})]}),p&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ke.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:Ke.icon}),l.jsx("input",{type:"text",className:Ke.nameInput,value:v,disabled:!o,onChange:P=>y(P.target.value),onBlur:T,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:Ke.field,children:[l.jsx("div",{className:Ke.fieldHeader,children:l.jsxs("label",{className:Ke.label,children:[g("keywords",c.contentEditForm.keywordsLabel),_.length>0&&l.jsx("span",{className:Ke.fieldCount,children:_.length})]})}),_.length>0&&l.jsx("div",{className:Ke.chips,children:_.map(P=>l.jsxs("span",{className:Ke.chip,children:[P,o&&l.jsx("button",{type:"button",className:Ke.chipRemove,onClick:()=>F(P),children:"×"})]},P))}),o&&l.jsxs("div",{className:Ke.keywordInput,children:[l.jsx("input",{type:"text",className:Ke.input,value:C,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:P=>S(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),j())}}),l.jsx("button",{type:"button",className:Ke.addBtn,onClick:j,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Ke.field,children:[l.jsx("label",{className:Ke.label,children:g("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:Ke.radioGroup,children:[l.jsxs("label",{className:Ke.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!0,onChange:()=>O(!0),disabled:!o}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Ke.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!1,onChange:()=>O(!1),disabled:!o}),c.contentEditForm.noOption]})]})]})]}),n]})},$F="_iconBtn_gliz0_1",UF="_editable_gliz0_14",zF="_iconImg_gliz0_26",VF="_placeholder_gliz0_34",HF="_removeBtn_gliz0_41",Cs={iconBtn:$F,editable:UF,iconImg:zF,placeholder:VF,removeBtn:HF},QF=({nodeId:e,value:t,editable:r})=>{const[n,s]=m.useState(!1),{updateNode:i,markDirty:o}=ue(),a=ae(),c=d=>{i(e,{appIcon:d}),o(),s(!1)},u=d=>{d.stopPropagation(),i(e,{appIcon:""}),o()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[Cs.iconBtn,r?Cs.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?a.titleAppIcon.selectAppIconAriaLabel:a.titleAppIcon.appIconAriaLabel,onClick:()=>r&&s(!0),onKeyDown:d=>{r&&(d.key==="Enter"||d.key===" ")&&s(!0)},children:[t?l.jsx("img",{src:t,alt:a.titleAppIcon.appIconAlt,className:Cs.iconImg}):l.jsx("div",{className:Cs.placeholder,children:l.jsx(Mf,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:Cs.removeBtn,onClick:u,"aria-label":a.titleAppIcon.removeIconAriaLabel,children:l.jsx(Co,{size:11})})]}),n&&l.jsx(Vp,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>s(!1)})]})},WF="_courseDetails_1eby7_1",GF="_courseDetailsLoading_1eby7_7",KF="_courseDetailsError_1eby7_7",YF="_detailsCard_1eby7_12",ZF="_unitsCard_1eby7_12",XF="_cardTitle_1eby7_22",JF="_fieldGroup_1eby7_29",e2="_fieldGroupLast_1eby7_33",t2="_fieldLabel_1eby7_37",r2="_fieldValue_1eby7_47",n2="_fieldValueMultiline_1eby7_52",s2="_unitsLabel_1eby7_58",i2="_unitsDescription_1eby7_68",o2="_unitList_1eby7_74",a2="_unitCard_1eby7_80",l2="_unitHeader_1eby7_86",c2="_unitIcon_1eby7_99",u2="_unitTitle_1eby7_111",d2="_unitCount_1eby7_120",f2="_unitBody_1eby7_126",h2="_unitDescription_1eby7_131",p2="_unitKeywords_1eby7_138",m2="_keywordPill_1eby7_145",g2="_unitTopicsRow_1eby7_155",v2="_unitContents_1eby7_167",y2="_contentRow_1eby7_174",b2="_contentIcon_1eby7_180",C2="_contentTitle_1eby7_185",S2="_contentSkills_1eby7_193",_2="_skillPill_1eby7_200",je={courseDetails:WF,courseDetailsLoading:GF,courseDetailsError:KF,detailsCard:YF,unitsCard:ZF,cardTitle:XF,fieldGroup:JF,fieldGroupLast:e2,fieldLabel:t2,fieldValue:r2,fieldValueMultiline:n2,unitsLabel:s2,unitsDescription:i2,unitList:o2,unitCard:a2,unitHeader:l2,unitIcon:c2,unitTitle:u2,unitCount:d2,unitBody:f2,unitDescription:h2,unitKeywords:p2,keywordPill:m2,unitTopicsRow:g2,unitContents:v2,contentRow:y2,contentIcon:b2,contentTitle:C2,contentSkills:S2,skillPill:_2},w2={video:So,pdf:Zs,h5p:vo,scorm:bo,audio:yo,quiz:go,course:Wr,default:Gr};function ma(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const tm=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const s=ae(),i=as(),[o,a]=m.useState(null),[c,u]=m.useState(""),[d,f]=m.useState(null),[g,p]=m.useState({}),b=t==="full";m.useEffect(()=>{let C=!1;return a(null),u(""),f(null),vh(e).then(S=>{if(C)return;const x=(S.children??[]).map(E=>To(E));a(x),u(S.description??""),p(Object.fromEntries(x.map(E=>[E.id,!0]))),n==null||n({totalContents:x.reduce((E,D)=>{var T;return E+(((T=D.children)==null?void 0:T.length)??0)},0)})}).catch(()=>{C||f(s.learningPath.courseDetailsError)}),()=>{C=!0}},[e,s.learningPath.courseDetailsError]);const h=C=>p(S=>({...S,[C]:!S[C]})),v=C=>{var S;return i?ma((S=C.metadata)==null?void 0:S[i.code]):[]},y=C=>(C===1?s.learningPath.contentCountLabel:s.learningPath.contentCountLabelPlural).replace("{count}",String(C));return l.jsx("div",{className:je.courseDetails,children:d?l.jsx("p",{className:je.courseDetailsError,children:d}):o===null?l.jsx("p",{className:je.courseDetailsLoading,children:s.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[b&&l.jsxs("div",{className:je.detailsCard,children:[l.jsx("h3",{className:je.cardTitle,children:s.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:je.fieldGroup,children:[l.jsx("span",{className:je.fieldLabel,children:s.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:je.fieldValue,children:r})]}),l.jsxs("div",{className:je.fieldGroupLast,children:[l.jsx("span",{className:je.fieldLabel,children:s.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:je.fieldValueMultiline,children:c||s.learningPath.noCourseDescriptionPlaceholder})]})]}),o.length===0?l.jsx("p",{className:je.courseDetailsLoading,children:s.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:b?je.unitsCard:void 0,children:[l.jsx("span",{className:je.unitsLabel,children:s.learningPath.unitsSectionLabel}),b&&l.jsx("p",{className:je.unitsDescription,children:s.learningPath.unitsSectionDescription}),l.jsx("div",{className:je.unitList,children:o.map(C=>{var D,T;const S=!!g[C.id],_=(C.children??[]).length,x=ma((D=C.metadata)==null?void 0:D.keywords),E=ma((T=C.metadata)==null?void 0:T.topic);return l.jsxs("div",{className:je.unitCard,children:[l.jsxs("button",{type:"button",className:je.unitHeader,onClick:()=>h(C.id),"aria-expanded":S,children:[S?l.jsx(bn,{size:17}):l.jsx(wl,{size:17}),l.jsx("span",{className:je.unitIcon,children:l.jsx(Rf,{size:16})}),l.jsx("span",{className:je.unitTitle,children:C.name}),b&&l.jsx("span",{className:je.unitCount,children:y(_)})]}),S&&l.jsxs("div",{className:je.unitBody,children:[b&&C.description&&l.jsx("p",{className:je.unitDescription,children:C.description}),b&&x.length>0&&l.jsx("div",{className:je.unitKeywords,children:x.map(j=>l.jsx("span",{className:je.keywordPill,children:j},j))}),b&&E.length>0&&l.jsxs("div",{className:je.unitTopicsRow,children:[l.jsx("span",{className:je.fieldLabel,children:s.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:E.join(", ")})]}),l.jsx("div",{className:je.unitContents,children:(C.children??[]).map(j=>{const F=ni(j),O=w2[F.key]??Gr,N=v(j);return l.jsxs("div",{className:je.contentRow,children:[l.jsx(O,{size:16,className:je.contentIcon}),l.jsx("span",{className:je.contentTitle,children:j.name}),N.length>0&&l.jsx("div",{className:je.contentSkills,children:N.map(B=>l.jsx("span",{className:je.skillPill,children:B},B))})]},j.id)})})]})]},C.id)})})]})]})})},x2="_backToPathButton_42cuj_1",T2="_assessmentTitle_42cuj_15",E2="_slotPills_42cuj_22",A2="_slotPill_42cuj_22",I2="_slotPillHint_42cuj_40",k2="_slotPillPurpose_42cuj_45",D2="_slotPillWarning_42cuj_51",L2="_slotPillPrimary_42cuj_56",O2="_courseCard_42cuj_62",N2="_courseCardHeading_42cuj_72",j2="_courseCardDescription_42cuj_79",P2="_courseNotAdded_42cuj_85",R2="_assessmentExplainer_42cuj_93",F2="_assessmentExplainerHeading_42cuj_107",M2="_leafContentLayout_42cuj_117",B2="_container_42cuj_131",q2="_emptyState_42cuj_140",$2="_titleRow_42cuj_150",U2="_titleRowLp_42cuj_157",z2="_nodeTitle_42cuj_171",V2="_nodeTitleLpRoot_42cuj_193",H2="_nodeTitleSub_42cuj_198",Q2="_courseDetailHeader_42cuj_203",W2="_courseDetailIcon_42cuj_210",G2="_courseDetailTitle_42cuj_222",K2="_courseDetailMeta_42cuj_229",Y2="_formArea_42cuj_234",Z2="_contentListArea_42cuj_238",X2="_contentListAreaLp_42cuj_242",J2="_dropZone_42cuj_246",eM="_reviewComment_42cuj_253",tM="_reviewCommentLabel_42cuj_266",rM="_reviewCommentText_42cuj_272",Ie={backToPathButton:x2,assessmentTitle:T2,slotPills:E2,slotPill:A2,slotPillHint:I2,slotPillPurpose:k2,slotPillWarning:D2,slotPillPrimary:L2,courseCard:O2,courseCardHeading:N2,courseCardDescription:j2,courseNotAdded:P2,assessmentExplainer:R2,assessmentExplainerHeading:F2,leafContentLayout:M2,container:B2,emptyState:q2,titleRow:$2,titleRowLp:U2,nodeTitle:z2,nodeTitleLpRoot:V2,nodeTitleSub:H2,courseDetailHeader:Q2,courseDetailIcon:W2,courseDetailTitle:G2,courseDetailMeta:K2,formArea:Y2,contentListArea:Z2,contentListAreaLp:X2,dropZone:J2,reviewComment:eM,reviewCommentLabel:tM,reviewCommentText:rM},nM=({slot:e,isEditable:t})=>{var p;const r=ae(),n=ue(b=>b.treeData),s=ue(b=>b.selectNode),i=(p=n[0])==null?void 0:p.id,{pre:o,post:a}=Vl(),c=(e==="pre"?o:a).filled,u=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,d=e==="pre"?Ps:yy,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,g=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:Ie.container,children:[l.jsxs("button",{type:"button",className:Ie.backToPathButton,onClick:()=>i&&s(i),children:[l.jsx(_l,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:Ie.assessmentTitle,children:u}),l.jsx("div",{className:Ie.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillHint}`,children:[l.jsx(xc,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillPurpose}`,children:[l.jsx(gy,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillWarning}`,children:[l.jsx(Bf,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${Ie.slotPill} ${Ie.slotPillPrimary}`,children:[l.jsx(xc,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:Ie.formArea,children:[l.jsxs("div",{className:Ie.courseCard,children:[l.jsx("div",{className:Ie.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:Ie.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(ul,{slot:e,isEditable:t}):l.jsx("div",{className:Ie.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:Ie.assessmentExplainer,children:[l.jsxs("div",{className:Ie.assessmentExplainerHeading,children:[l.jsx(d,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:g})]})]})]})},sM="application/vnd.sunbird.questionset",rm="application/vnd.sunbird.question",iM=[sM,rm];function Td(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 oM=({editorMode:e,onToolbarEvent:t})=>{var oe,ge,ve,xe,ye;const r=ae(),[n,s]=m.useState("details"),[i,o]=m.useState([]),[a,c]=m.useState(null),[u,d]=m.useState(!1),[f,g]=m.useState(null),p=m.useRef(null),b=m.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:C,treeData:S,selectNode:_}=ue(),x=Hr(R=>R.activeAssessmentSlot),E=Z(R=>{var M,Y,le,Ce;return((Y=(M=R.editorConfig)==null?void 0:M.context)==null?void 0:Y.contentId)??((Ce=(le=R.editorConfig)==null?void 0:le.context)==null?void 0:Ce.identifier)??""}),D=Z(R=>R.editorProfile.competencyScoped),T=h?nm(S,h):null;m.useEffect(()=>{g(null)},[T==null?void 0:T.identifier]);const j=!!T&&!T.parent,F=!!(T!=null&&T.isFolder),O=T&&iM.includes(T.mimeType??""),N=(T==null?void 0:T.mimeType)===rm,B=T&&!T.isFolder&&!O&&!j,U=D&&F&&lt(T??void 0)?((ve=(ge=(oe=S[0])==null?void 0:oe.children)==null?void 0:ge[0])==null?void 0:ve.id)===(T==null?void 0:T.id)?"pre":"post":D?x:null,ne=Td(T)??(j?Td(S[0]):void 0),H=m.useCallback(()=>{const R=p.current;if(!R||!h)return;const M=R.innerText.trim();clearTimeout(b.current),b.current=setTimeout(()=>{C(h,{name:M})},600)},[h,C]),te=m.useCallback(R=>{t({action:"onFormValueChange",data:R})},[t]),he=m.useCallback((R,M)=>{o(M),t({action:"onFormStatusChange",data:{isValid:R,nodeId:h}})},[t,h]);if(!T)return l.jsx("div",{className:Ie.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(O)return l.jsx(dl,{node:T,editorMode:e,type:"quml",singleQuestion:N});if(D&&B&&T.primaryCategory==="Course"){const R=T.parent?a1(((xe=S[0])==null?void 0:xe.children)??[],T.parent):null,M=(R==null?void 0:R.role)==="pre"?r.learningPath.priorAssessmentLabel:(R==null?void 0:R.role)==="post"?r.learningPath.outcomeAssessmentLabel:(R==null?void 0:R.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String(R.levelNumber)):null,Y=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:Ie.container,children:[l.jsxs("button",{type:"button",className:Ie.backToPathButton,onClick:()=>T.parent&&_(T.parent),children:[l.jsx(_l,{size:14}),M?r.learningPath.backToLevelButton.replace("{label}",M):r.learningPath.backToPathButton]}),l.jsxs("div",{className:Ie.courseDetailHeader,children:[l.jsx("span",{className:Ie.courseDetailIcon,children:l.jsx(Wr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:Ie.courseDetailTitle,children:T.name}),l.jsxs("span",{className:Ie.courseDetailMeta,children:[T.primaryCategory,Y]})]})]}),l.jsx(tm,{courseId:T.identifier,variant:"full",title:T.name,onLoaded:({totalContents:le})=>g(le)},T.identifier)]})}return U?l.jsx(nM,{slot:U,isEditable:e==="edit"}):B?l.jsxs("div",{className:Ie.leafContentLayout,children:[l.jsx(dl,{node:T,editorMode:e,type:"content",layout:"flow"}),l.jsx(qF,{node:T,editorMode:e,onMoveClick:()=>c(T.identifier),reorderDialog:a?l.jsx(aF,{resourceId:a,resourceName:T.name,currentUnitId:T.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:Ie.container,children:[l.jsx(OL,{crumbs:v}),ne&&l.jsxs("div",{className:Ie.reviewComment,role:"alert",children:[l.jsx("span",{className:Ie.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:Ie.reviewCommentText,children:ne})]}),l.jsxs("div",{className:[Ie.titleRow,D?Ie.titleRowLp:""].filter(Boolean).join(" "),children:[j&&h&&l.jsx(QF,{nodeId:h,value:String(T.appIcon??((ye=T.metadata)==null?void 0:ye.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:p,className:[Ie.nodeTitle,D&&j?Ie.nodeTitleLpRoot:"",D&&!j?Ie.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:H,onBlur:H,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:T.name})]}),l.jsx(ML,{activeTab:n,onChange:R=>s(R),errorTabs:i,visibleTabs:j&&!D?void 0:["details"]}),l.jsx("div",{className:Ie.formArea,children:l.jsx(Nj,{nodeMetadata:y,activeTab:n,isRoot:j,isFolder:F,editorMode:e,onFormValueChange:te,onFormStatusChange:he},`${h??"none"}:${j?"root":"node"}`)}),(F||j)&&n==="details"&&l.jsx("div",{className:[Ie.contentListArea,D?Ie.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(GP,{editorMode:e,isRoot:j})}),l.jsx(ZP,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:Ie.dropZone}),u&&l.jsx(bF,{contentId:E,onClose:()=>d(!1)})]})};function nm(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=nm(r.children,t);if(n)return n}}}const sm=Xs((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 i=[...t().allContent,...r];e({allContent:i,totalCount:n,offset:i.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 i=r;if(n&&n!=="all"){const o=n.toLowerCase();i=i.filter(a=>[a.mimeType??"",a.primaryCategory??"",a.contentType??""].join(" ").toLowerCase().includes(o))}if(s&&s.trim()!==""){const o=s.toLowerCase().trim();i=i.filter(a=>(a.name??"").toLowerCase().includes(o))}e({filteredContent:i})}}));function aM(e,t,r,n){const s={primaryCategory:["Course"]};return n&&(s.framework=[n]),!e&&t.length&&r&&(s[r]=t),s}function lM(e,t){if(!(!e||!t))return[...Zp,t,"framework"]}function cM(e,t,r,n,s){return e?t?r&&!n&&s.length===0?"noSkills":null:"noCurriculum":null}const uM=20,dM=[];function im(){var u;const e=Z(d=>d.editorConfig),t=ue(d=>d.selectedNodeId),r=ue(d=>d.treeData),n=m.useCallback(()=>{if(!t||!r.length)return 0;function d(f,g,p=0){var b;for(const h of f){if(h.id===g)return p;if((b=h.children)!=null&&b.length){const v=d(h.children,g,p+1);if(v>=0)return v}}return-1}return Math.max(0,d(r,t))},[t,r])(),s=(u=e==null?void 0:e.config)==null?void 0:u.hierarchy;if(!s)return[...nd];const i=`level${n}`,o=s[i],a=o==null?void 0:o.children,c=a==null?void 0:a.Content;return c!=null&&c.length?c:[...nd]}function fM(){const e=sm(),t=Z(T=>{var j,F;return((F=(j=T.editorConfig)==null?void 0:j.context)==null?void 0:F.channel)??""}),r=im(),n=Z(T=>T.editorProfile),s=Hr(T=>T.activeAssessmentSlot),i=ue(T=>T.activeNodeMeta),o=ue(T=>T.treeData),a=ue(T=>T.treeCache),c=ue(T=>T.selectedNodeId),u=ue(T=>T.getNodeById),d=as(),f=n.competencyScoped?Sh(o[0],a):void 0,g=m.useRef(),p=d&&Array.isArray(i[d.code])?i[d.code]:dM,b=c?u(c):void 0,h=n.competencyScoped&&!!(b!=null&&b.isFolder)&&!!b.parent&&!lt(b),v=cM(n.competencyScoped,f,h,s,p),y=m.useCallback(async(T="",j="all",F={},O=!0,N=!1)=>{var B,P,U,ne,H;e.setLoading(!0);try{if(v){e.setContent([],0);return}let te;if(n.competencyScoped){const ve=aM(s,p,d==null?void 0:d.code,f);te={status:["Live"],...ve}}else te={status:["Live"],primaryCategory:j&&j!=="all"?[j]:r},(B=F==null?void 0:F.board)!=null&&B.length&&(te.board=F.board),(P=F==null?void 0:F.medium)!=null&&P.length&&(te.medium=F.medium),(U=F==null?void 0:F.gradeLevel)!=null&&U.length&&(te.gradeLevel=F.gradeLevel),(ne=F==null?void 0:F.subject)!=null&&ne.length&&(te.subject=F.subject),(H=F==null?void 0:F.primaryCategory)!=null&&H.length&&(te.primaryCategory=F.primaryCategory);const he=O?0:e.offset,{content:oe,count:ge}=await XP({filters:te,query:T,limit:T?50:uM,offset:he,channel:t||void 0,sortBy:N?{name:"asc"}:{lastUpdatedOn:"desc"},fields:lM(n.competencyScoped,d==null?void 0:d.code)});O?e.setContent(oe,ge):e.appendContent(oe,ge)}catch(te){console.error("[useLibrary] load error:",te)}finally{e.setLoading(!1)}},[r,t,n,s,p,d,f,v]);m.useEffect(()=>{clearTimeout(g.current),e.setSearch("")},[f]),m.useEffect(()=>{y()},[t]),m.useEffect(()=>{n.competencyScoped&&y()},[n.competencyScoped,s,p.join("|"),f,c]);const C=m.useCallback(T=>{e.setSearch(T),clearTimeout(g.current),g.current=setTimeout(()=>y(T,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,y]),S=m.useCallback(T=>{e.setFilter(T),y(e.searchQuery,T,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,y]),_=m.useCallback(T=>{e.setAdvancedFilters(T),y(e.searchQuery,e.activeFilter,T,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,y]),x=m.useCallback(()=>{const T=!e.sortAZ;e.setSortAZ(T),y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,T)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,y]),E=m.useCallback(()=>{e.isLoading||y(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,y]),D=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:D,search:C,setFilter:S,applyAdvancedFilters:_,toggleSort:x,loadMore:E,refetch:()=>y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:s,emptyReason:v}}function om(){var a;const e=ae(),t=Z(c=>c.editorProfile.competencyScoped),r=Hr(c=>c.activeAssessmentSlot),n=ue(c=>c.selectedNodeId),s=ue(c=>c.treeData),i=ue(c=>c.getNodeById),o=(a=s[0])==null?void 0:a.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n&&n!==o){const c=i(n);if(c!=null&&c.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",c.name??"")}return e.learningPath.libraryOpenLevelToAdd}const hM="_card_1cmpg_1",pM="_addBtn_1cmpg_17",mM="_dragging_1cmpg_24",gM="_ctIcon_1cmpg_29",vM="_info_1cmpg_33",yM="_name_1cmpg_41",bM="_meta_1cmpg_50",CM="_skillTags_1cmpg_58",SM="_skillTag_1cmpg_58",_M="_addBtnMuted_1cmpg_93",wM="_added_1cmpg_102",xM="_addedBadge_1cmpg_111",Yt={card:hM,addBtn:pM,dragging:mM,ctIcon:gM,info:vM,name:yM,meta:bM,skillTags:CM,skillTag:SM,addBtnMuted:_M,added:wM,addedBadge:xM},TM={video:So,pdf:Zs,h5p:vo,scorm:bo,audio:yo,quiz:go,course:Wr,default:Gr},EM=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var S,_;const i=ae(),o=ni(e),a=TM[o.key]??Gr,c=zl(),u=lD(),d=c&&!s&&u,f=Z(x=>x.editorProfile.competencyScoped),g=as(),p=f&&g?(()=>{const x=e[g.code];return Array.isArray(x)?x:x?[String(x)]:[]})():[],{attributes:b,listeners:h,setNodeRef:v,isDragging:y}=Df({id:e.identifier,disabled:!n||!c||!u,data:{type:"library-item",item:e}}),C=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[Yt.card,y?Yt.dragging:"",s?Yt.added:""].join(" "),"aria-label":e.name,...n?{...b,...h}:{},role:"listitem",onClick:C,children:[l.jsx("span",{className:[`sbx-ct-sq--${o.key}`,Yt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(a,{size:14})}),l.jsxs("div",{className:Yt.info,children:[l.jsx("span",{className:Yt.name,title:e.name,children:e.name}),l.jsxs("span",{className:Yt.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(_=e.organisation)!=null&&_[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),p.length>0&&l.jsx("span",{className:Yt.skillTags,children:p.slice(0,3).map(x=>l.jsx("span",{className:Yt.skillTag,children:x},x))})]}),s&&l.jsx("span",{className:Yt.addedBadge,"aria-label":i.libraryCard.alreadyAddedAriaLabel,title:i.libraryCard.alreadyAddedTitle,children:l.jsx(yn,{size:12})}),!s&&n&&l.jsx("button",{type:"button",className:[Yt.addBtn,!d&&c?Yt.addBtnMuted:""].join(" "),onClick:x=>{x.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!d,"aria-label":i.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?u?i.libraryCard.addToUnitTitle:i.libraryCard.selectUnitToAddTitle:i.libraryCard.draftOnlyTitle,children:l.jsx(Cn,{size:14})})]})},AM="_chips_xhhaq_1",IM="_chip_xhhaq_1",Ed={chips:AM,chip:IM},kM=({filters:e,active:t,onChange:r})=>{const n=ae();return l.jsx("div",{className:Ed.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",Ed.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},DM="_panel_uame3_1",LM="_header_uame3_10",OM="_headerTitle_uame3_19",NM="_closeBtn_uame3_25",jM="_body_uame3_43",PM="_section_uame3_59",RM="_sectionLabel_uame3_65",FM="_chips_uame3_73",MM="_chip_uame3_73",BM="_active_uame3_96",qM="_footer_uame3_102",$M="_resetBtn_uame3_112",UM="_applyBtn_uame3_129",ht={panel:DM,header:LM,headerTitle:OM,closeBtn:NM,body:jM,section:PM,sectionLabel:RM,chips:FM,chip:MM,active:BM,footer:qM,resetBtn:$M,applyBtn:UM},zM=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}],VM=new Set(["board","medium","gradeLevel","subject","topic"]),HM=({local:e,toggle:t})=>{const r=ae(),n=im();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},QM=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const s=ae(),i=Z(C=>C.editorConfig),o=Z(C=>C.searchFormConfig),a=Z(C=>C.contentFramework),c=Z(C=>C.contentTargetFWIds),{organisationFramework:u}=Eo(a??((v=i==null?void 0:i.context)==null?void 0:v.framework),c??((y=i==null?void 0:i.context)==null?void 0:y.targetFWIds)),[d,f]=m.useState(t),g=o!=null&&o.length?o.filter(C=>VM.has(C.code)).map(C=>({key:C.code,label:C.label||C.code})):zM(s);m.useEffect(()=>{f(t)},[t]);const p=(C,S)=>{f(_=>{const x=_[C]??[],E=x.includes(S)?x.filter(D=>D!==S):[...x,S];return{..._,[C]:E}})},b=(u==null?void 0:u.categories)??[],h=C=>{var S;return((S=b.find(_=>_.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(yr,{size:16})})]}),l.jsxs("div",{className:ht.body,children:[g.map(({key:C,label:S})=>{const _=h(C);return _.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:S}),l.jsx("div",{className:ht.chips,children:_.slice(0,20).map(x=>l.jsx("button",{type:"button",className:[ht.chip,(d[C]??[]).includes(x.name)?ht.active:""].join(" "),onClick:()=>p(C,x.name),children:x.name},x.identifier))})]},C):null}),l.jsx(HM,{local:d,toggle:p})]}),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(d),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},WM="_header_1tvk1_10",GM="_headerCourse_1tvk1_20",KM="_courseIcon_1tvk1_25",YM="_titleGroup_1tvk1_37",ZM="_courseMeta_1tvk1_45",XM="_title_1tvk1_37",JM="_headerActions_1tvk1_67",eB="_iconBtn_1tvk1_74",tB="_playerArea_1tvk1_92",rB="_footer_1tvk1_100",nB="_footerCourse_1tvk1_109",sB="_addBtn_1tvk1_115",iB="_addBtnCourse_1tvk1_134",oB="_modalOverlay_1tvk1_159",aB="_modalOverlayCourse_1tvk1_174",lB="_modalPanel_1tvk1_178",cB="_modalPanelCourse_1tvk1_190",gt={header:WM,headerCourse:GM,courseIcon:KM,titleGroup:YM,courseMeta:ZM,title:XM,headerActions:JM,iconBtn:eB,playerArea:tB,footer:rB,footerCourse:nB,addBtn:sB,addBtnCourse:iB,modalOverlay:oB,modalOverlayCourse:aB,modalPanel:lB,modalPanelCourse:cB},uB="application/vnd.sunbird.questionset",dB=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const s=ae(),i=t==="edit",o=Z(g=>g.editorProfile.competencyScoped),a=om();if(!e)return null;const c=o&&e.primaryCategory==="Course",u=[((f=e.organisation)==null?void 0:f[0])??e.channel??"",e.primaryCategory??""].filter(Boolean).join(" • "),d={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 Ur.createPortal(l.jsx("div",{className:[gt.modalOverlay,c?gt.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[gt.modalPanel,c?gt.modalPanelCourse:""].filter(Boolean).join(" "),onClick:g=>g.stopPropagation(),children:[l.jsxs("div",{className:[gt.header,c?gt.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:gt.courseIcon,children:l.jsx(Wr,{size:20})}),l.jsxs("div",{className:gt.titleGroup,children:[l.jsx("span",{className:gt.title,title:e.name,children:e.name}),c&&u&&l.jsx("span",{className:gt.courseMeta,children:u})]}),l.jsx("div",{className:gt.headerActions,children:l.jsx("button",{type:"button",className:gt.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(yr,{size:16})})})]}),l.jsx("div",{className:gt.playerArea,children:c?l.jsx(tm,{courseId:e.identifier}):l.jsx(dl,{node:d,editorMode:"read",type:e.mimeType===uB?"quml":"content"})}),i&&l.jsx("div",{className:[gt.footer,c?gt.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:gt.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Cn,{size:15})," ",a??s.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:gt.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},fB="_dock_2k0x7_1",hB="_header_2k0x7_8",pB="_libraryTargetLabel_2k0x7_18",mB="_headerLeft_2k0x7_28",gB="_headerTitle_2k0x7_36",vB="_count_2k0x7_42",yB="_searchRow_2k0x7_51",bB="_searchWrap_2k0x7_59",CB="_searchIcon_2k0x7_65",SB="_searchInput_2k0x7_74",_B="_filterToggleBtn_2k0x7_92",wB="_filterToggleBtnActive_2k0x7_111",xB="_filterBadge_2k0x7_117",TB="_filters_2k0x7_136",EB="_mainArea_2k0x7_146",AB="_sidePanelOverlay_2k0x7_155",IB="_cardList_2k0x7_164",kB="_skeleton_2k0x7_180",DB="_skeletonIcon_2k0x7_190",LB="_skeletonText_2k0x7_198",OB="_skeletonLine_2k0x7_205",NB="_skeletonLineSm_2k0x7_212",jB="_loadMoreBtn_2k0x7_227",PB="_emptyState_2k0x7_252",RB="_collapseBtn_2k0x7_272",Ue={dock:fB,header:hB,libraryTargetLabel:pB,headerLeft:mB,headerTitle:gB,count:vB,searchRow:yB,searchWrap:bB,searchIcon:CB,searchInput:SB,filterToggleBtn:_B,filterToggleBtnActive:wB,filterBadge:xB,filters:TB,mainArea:EB,sidePanelOverlay:AB,cardList:IB,skeleton:kB,skeletonIcon:DB,skeletonText:LB,skeletonLine:OB,skeletonLineSm:NB,loadMoreBtn:jB,emptyState:PB,collapseBtn:RB},FB=[{label:"Courses",value:"all"}];function MB(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 BB=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ae(),{content:s,isLoading:i,totalCount:o,activeFilter:a,searchQuery:c,sortAZ:u,hasMore:d,search:f,setFilter:g,applyAdvancedFilters:p,toggleSort:b,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=fM(),{addResource:C,selectedNodeId:S,treeData:_,treeCache:x}=ue(),E=Hr(R=>R.setActiveAssessmentSlot),D=Z(R=>R.editorProfile.competencyScoped),T=e==="edit",j=om(),[F,O]=m.useState(!1),[N,B]=m.useState({}),[P,U]=m.useState(null),[ne,H]=m.useState(null),te=m.useMemo(()=>MB(_),[_]),he=m.useCallback(async(R,M)=>{var le,Ce;const Y=(le=_[0])==null?void 0:le.id;if(!(!Y||ne)){if(Fs(((Ce=_[0])==null?void 0:Ce.children)??[],M)){we.error(M==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}H(R.identifier);try{const{qualifies:de,meta:ce}=await bh(R.identifier);if(!de){we.error(n.learningPath.notAssessmentCourseToast.replace("{name}",R.name));return}const Q={...R,...ce};if(C(Q,Y,{isAssessmentCourse:!0,slot:M})===!1){we.error(n.learningPath.bothSlotsFilledToast);return}we.success(n.libraryDock.itemAddedToast.replace("{name}",R.name)),E(null)}catch(de){console.error("[LibraryDock] assessment-course check failed:",de),we.error(n.learningPath.assessmentCheckFailedToast)}finally{H(null)}}},[_,C,E,ne,n]),oe=m.useCallback(R=>{var Ce,de,ce;if(D&&!_h(_[0],x)){we.error(n.learningPath.selectCurriculumFirstToast);return}if(v){he(R,v);return}if(!S){we.error(D?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const M=(Ce=_[0])==null?void 0:Ce.id,Y=ue.getState().getNodeById(S);if(D){const Q=((de=_[0])==null?void 0:de.children)??[],se=Y!=null&&Y.isFolder?Y:Y!=null&&Y.parent?ue.getState().getNodeById(Y.parent):void 0;if(se&&Qa(Q,se)){const Te=(ce=Q[0])==null?void 0:ce.id;we.error(se.id===Te?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===M||!(Y!=null&&Y.isFolder)){we(D?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(Ps,{size:16}),duration:4e3});return}if(C(R,S)===!1){we.error((D?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",R.name));return}we.success(n.libraryDock.itemAddedToast.replace("{name}",R.name))},[v,he,S,C,_,x,n,D]),ge=m.useCallback(R=>{B(R),p(R)},[p]),ve=m.useCallback(R=>{U(R)},[]),xe=m.useCallback(R=>{oe(R),U(null)},[oe]),ye=m.useMemo(()=>Object.values(N).reduce((R,M)=>R+((M==null?void 0:M.length)??0),0),[N]);return l.jsxs("div",{className:Ue.dock,children:[l.jsxs("div",{className:Ue.header,children:[l.jsxs("div",{className:Ue.headerLeft,children:[l.jsx("button",{type:"button",className:Ue.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(Oy,{size:15})}),l.jsx(Iy,{size:16}),l.jsx("span",{className:Ue.headerTitle,children:n.libraryDock.headerTitle}),o>0&&l.jsx("span",{className:Ue.count,children:o})]}),j&&l.jsx("span",{className:Ue.libraryTargetLabel,children:j})]}),l.jsxs("div",{className:Ue.searchRow,children:[l.jsxs("div",{className:Ue.searchWrap,children:[l.jsx(Wi,{size:14,className:Ue.searchIcon}),l.jsx("input",{type:"search",className:Ue.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:R=>f(R.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[Ue.filterToggleBtn,u?Ue.filterToggleBtnActive:""].join(" "),onClick:b,"aria-label":u?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:u?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:u?l.jsx(vy,{size:15}):l.jsx(_y,{size:15})}),l.jsxs("button",{type:"button",className:[Ue.filterToggleBtn,F?Ue.filterToggleBtnActive:""].join(" "),onClick:()=>O(R=>!R),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":F,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(qy,{size:15}),ye>0&&l.jsx("span",{className:Ue.filterBadge,children:ye})]})]}),l.jsx("div",{className:Ue.filters,children:l.jsx(kM,{filters:D?FB:cD,active:a,onChange:g})}),l.jsxs("div",{className:Ue.mainArea,children:[l.jsx("div",{className:Ue.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:i&&s.length===0?Array.from({length:4}).map((R,M)=>l.jsxs("div",{className:Ue.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:Ue.skeletonIcon}),l.jsxs("div",{className:Ue.skeletonText,children:[l.jsx("div",{className:Ue.skeletonLine}),l.jsx("div",{className:Ue.skeletonLineSm})]})]},M)):s.length>0?l.jsxs(l.Fragment,{children:[s.map(R=>l.jsx(EM,{item:R,onAdd:oe,onPreview:ve,isDraggable:T,isAdded:te.has(R.identifier)},R.identifier)),d&&l.jsx("button",{type:"button",className:Ue.loadMoreBtn,onClick:h,disabled:i,"aria-label":n.libraryDock.loadMoreAriaLabel,children:i?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:Ue.emptyState,children:[l.jsx(Wi,{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})]})]})}),F&&l.jsx("div",{className:Ue.sidePanelOverlay,children:l.jsx(QM,{isOpen:F,filters:N,onApply:ge,onClose:()=>O(!1)})}),P&&l.jsx(dB,{content:P,editorMode:e,onAdd:xe,onClose:()=>U(null)})]})]})};function qB(e,t,r,n=El){const s={},i={},o=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),a=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"]),u=new Set(["copyrightYear","compatibilityLevel","version"]);function d(p,b=!1){const h={};for(const[v,y]of Object.entries(p))if(!o.has(v)&&!(b&&a.has(v)))if(c.has(v))Array.isArray(y)?h[v]=y:y!=null&&y!==""?h[v]=[y]:h[v]=[];else if(u.has(v)){const C=Number(y);isNaN(C)||(h[v]=C)}else h[v]=y;return h}function f(p){var h;const b={};for(const v of p.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:C,...S}=y;if(Object.keys(S).length===0)continue;const _=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};b[v.identifier]={name:v.name,..._,...S}}return b}function g(p,b){var _,x;const h=p.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),C=!p.isFolder&&!b;if(b||y||v&&!C){let E;if(y)E={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((_=p.metadata)==null?void 0:_.contentType)??n.unitContentType,primaryCategory:((x=p.metadata)==null?void 0:x.primaryCategory)??n.unitPrimaryCategory,name:p.name,visibility:"Parent",channel:r,...d(p.metadata??{})};else if(b){const{isNew:D,...T}=v??{};E={...d(p.metadata??{},!0),...d(T,!1),name:p.name}}else{const{isNew:D,...T}=v??{};E={name:p.name,visibility:"Parent",...d(T,!0)}}s[h]={metadata:E,objectType:p.objectType||(p.isFolder?"Collection":"Content"),root:b,isNew:y}}const S=p.isFolder?f(p):{};i[h]={name:p.name,children:(p.children??[]).map(E=>E.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:b},(p.children??[]).forEach(E=>g(E,!1))}return e.forEach((p,b)=>g(p,b===0)),{nodesModified:s,hierarchy:i}}function $B(){const[e,t]=m.useState(!1),r=ue(d=>d.treeCache),n=ue(d=>d.treeData),s=Z(d=>d.isDirty),i=Z(d=>d.lastSaved),{setIsDirty:o,setLastSaved:a}=Z(),c=Z(d=>d.editorConfig);return{save:m.useCallback(async()=>{if(!c||e)return;const d=c.context.contentId??c.context.identifier??"";if(!d)return;if(n.length===0){we.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",g=c.context.userId??c.context.uid??"";t(!0);try{const p=Z.getState().editorProfile,{nodesModified:b,hierarchy:h}=qB(n,r,f,p),{identifiers:v}=await Xx(d,b,h,g);v&&Object.keys(v).length>0&&ue.getState().replaceNodeIds(v);const y=new Date().toISOString();a(y),o(!1)}catch(p){console.error("[useSaveHierarchy] save failed:",p),we.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,o,a]),isSaving:e,isDirty:s,lastSaved:i}}const UB={};function zB(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function VB(e,t,r,n,s,i=UB){const o=[],a=(c,u)=>{var d;for(const f of c){const g=u&&!f.parent,p=g?r:f.isFolder?n:null;if(p&&p.length>0){const b={...f.metadata??{},...t[f.id]??{}},v=qp(p,b,i,g,s).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&zB(y.currentValue)).map(y=>y.label);v.length>0&&o.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(d=f.children)!=null&&d.length&&a(f.children,!1)}};return a(e,!0),o}function HB(e){var h,v;const t=Z(y=>y.editorConfig),r=Z(y=>y.setButtonLoader),n=Z(y=>y.validateAllForms),s=Z(y=>y.rootFormConfig),i=Z(y=>y.unitFormConfig),o=ue(y=>y.treeData),a=ue(y=>y.treeCache),c=ue(y=>y.selectNode),u=Z(y=>y.contentFramework),d=Z(y=>y.contentTargetFWIds),{organisationFramework:f,targetFrameworks:g}=Eo(u??((h=t==null?void 0:t.context)==null?void 0:h.framework),d??((v=t==null?void 0:t.context)==null?void 0:v.targetFWIds)),p=m.useCallback(()=>{var x,E,D;const y={editorMode:"edit",objectType:(x=t==null?void 0:t.config)==null?void 0:x.objectType,userFullName:(D=(E=t==null?void 0:t.context)==null?void 0:E.user)==null?void 0:D.fullName},C=VB(o,a,s,i,y,{organisationFramework:f,targetFrameworks:g});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:_}=Z.getState();return C.forEach(T=>_(T.nodeId,!1)),c(S.nodeId),!1},[o,a,s,i,t,c,f,g]);return{runAction:m.useCallback(async(y,C)=>{var x,E,D,T;const S=((x=t==null?void 0:t.context)==null?void 0:x.contentId)??((E=t==null?void 0:t.context)==null?void 0:E.identifier)??"";if(!S)return we.error("No content identifier found."),!1;const _=((D=t==null?void 0:t.context)==null?void 0:D.userId)??((T=t==null?void 0:t.context)==null?void 0:T.uid)??"";try{switch(y){case"sendForReview":return p()?n(o)?(r("saveCollection",!0),await e(),await t1(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 j=(C==null?void 0:C.comment)??"";return await r1(S,j),we.success("Content rejected and sent back to the author"),!0}case"publish":return p()?n(o)?(r("publishCollection",!0),await e(),await Jx(S,_),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(j){console.error(`[useToolbarActions] ${y} failed`,j);const F=y==="sendForReview"?"send for review":y==="reject"?"reject":"publish";return we.error(`Failed to ${F}. Please try again.`),!1}finally{r("saveCollection",!1),r("rejectCollection",!1),r("publishCollection",!1)}},[t,e,r,p,n,o]),checkRequiredFields:p}}const QB="_shell_fu72l_1",WB="_workspace_fu72l_8",GB="_sidebarCollapsed_fu72l_16",KB="_dockCollapsed_fu72l_19",YB="_dock_fu72l_19",ZB="_outline_fu72l_40",XB="_reopenTab_fu72l_45",JB="_outlineHidden_fu72l_79",eq="_editor_fu72l_86",tq="_editorLp_fu72l_92",rq="_dockHidden_fu72l_105",nq="_dockReopenTab_fu72l_112",sq="_dragChip_fu72l_137",iq="_dragChipLabel_fu72l_152",jt={shell:QB,workspace:WB,sidebarCollapsed:GB,dockCollapsed:KB,dock:YB,outline:ZB,reopenTab:XB,outlineHidden:JB,editor:eq,editorLp:tq,dockHidden:rq,dockReopenTab:nq,dragChip:sq,dragChipLabel:iq},oq=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const s=ae(),[i,o]=m.useState(null),[a,c]=m.useState(!1),[u,d]=m.useState(!1),[f,g]=m.useState(!1),{addResource:p,treeData:b,treeCache:h}=ue(),v=Z(H=>H.setFormStatus),y=Z(H=>H.editorProfile.key==="learningPath"),[C,S]=m.useState(!0),_=ue(H=>H.selectedNodeId),{save:x,isSaving:E,isDirty:D,lastSaved:T}=$B(),{runAction:j,checkRequiredFields:F}=HB(x);m.useEffect(()=>{if(!D)return;const H=te=>{te.preventDefault(),te.returnValue=""};return window.addEventListener("beforeunload",H),()=>window.removeEventListener("beforeunload",H)},[D]);const O=uf(Na(ho,{activationConstraint:{distance:8}})),N=m.useCallback(H=>{var he;const te=(he=H.active.data.current)==null?void 0:he.item;te&&o(te)},[]),B=m.useCallback(H=>{var R,M,Y,le,Ce;o(null);const te=(R=H.active.data.current)==null?void 0:R.item;if(!te)return;if(y&&!_h(b[0],h)){we.error(s.learningPath.selectCurriculumFirstToast);return}const he=H.over,oe=(he==null?void 0:he.id)??_??void 0,ge=y?s.learningPath.dropOntoLevelError:s.splitBuilderShell.dropOntoUnitError;if(!oe){we.error(ge);return}const ve=(M=b[0])==null?void 0:M.id;if(oe===ve){we.error(y?s.learningPath.dropOntoPathError:s.splitBuilderShell.dropOntoCourseError);return}const xe=ue.getState().getNodeById(oe);if(!(xe!=null&&xe.isFolder)){we.error(ge);return}if(y&&lt(xe)){const de=(Ce=(le=(Y=b[0])==null?void 0:Y.children)==null?void 0:le[0])==null?void 0:Ce.id;we.error(xe.id===de?s.learningPath.priorSlotFilledToast:s.learningPath.outcomeSlotFilledToast);return}if(!p(te,oe)){we.error((y?s.learningPath.itemAlreadyInPathToast:s.splitBuilderShell.alreadyInCollectionError).replace("{name}",te.name));return}r==null||r(te,oe),we.success((y?s.learningPath.addedToLevelSuccess:s.splitBuilderShell.addedToUnitSuccess).replace("{name}",te.name))},[_,p,b,h,r,s,y]),P=m.useCallback(async H=>{if(H.action==="onFormStatusChange"){const{isValid:te,nodeId:he}=H.data??{},oe=te!==!1;S(oe),he&&v(he,oe);return}if(H.action==="back"&&D&&e==="edit"){g(!0);return}if(H.action==="saveCollection"){if(!C){we.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!F())return;await x(),n==null||n(b),t==null||t(H);return}if(H.action==="sendForReview"||H.action==="reject"||H.action==="publish"){await j(H.action,H.data)&&(t==null||t(H));return}t==null||t(H)},[x,j,F,t,n,b,D,C,e,s]),U=m.useCallback(async()=>{if(!F()){g(!1);return}await x(),g(!1),n==null||n(b),t==null||t({action:"back"})},[x,F,n,t,b]),ne=m.useCallback(()=>{g(!1),t==null||t({action:"back"})},[t]);return l.jsxs(kf,{sensors:O,onDragStart:N,onDragEnd:B,children:[l.jsxs("div",{className:jt.shell,children:[l.jsx(G0,{editorMode:e,isSaving:E,isDirty:D,lastSaved:T,isFormValid:C,onToolbarEvent:P}),l.jsxs("div",{className:[jt.workspace,a?jt.sidebarCollapsed:"",u?jt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[jt.outline,a?jt.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":a,children:l.jsx(AL,{editorMode:e,collapsed:a,onToggleCollapse:()=>c(H=>!H)})}),a&&l.jsx("button",{className:jt.reopenTab,onClick:()=>c(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[jt.editor,y?jt.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:l.jsx(oM,{editorMode:e,onToolbarEvent:P})}),l.jsx("aside",{className:[jt.dock,u?jt.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":u,children:l.jsx(BB,{editorMode:e,collapsed:u,onToggleCollapse:()=>d(H=>!H)})}),u&&l.jsx("button",{className:jt.dockReopenTab,onClick:()=>d(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(fy,{dropAnimation:null,children:i?l.jsx("div",{className:jt.dragChip,children:l.jsx("span",{className:jt.dragChipLabel,children:i.name})}):null}),f&&l.jsx(K0,{onSave:U,onDiscard:ne,onCancel:()=>g(!1),isSaving:E})]})},aq="v1";function lq(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 Ad(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:lq(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 kr(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,i=n.fields.filter(o=>!!o.code).sort((o,a)=>(o.index??0)-(a.index??0));for(const o of i)r.push(Ad(o,s))}else n.code&&r.push(Ad(n));return r}function cq(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 uq(e,t,r="Collection",n=aq){var u,d;const i=(d=(u=(await Re.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:u.result)==null?void 0:d.objectCategoryDefinition,o=(i==null?void 0:i.forms)??{},a=(i==null?void 0:i.objectMetadata)??{},c=a.config??{};return{rootForm:kr(o.create),unitForm:kr(o.unitMetadata),childForm:kr(o.childMetadata),searchForm:kr(o.search??o.searchConfig),relationalForm:kr(o.relationalMetadata),publishChecklist:kr(o.publishchecklist),reviewChecklist:kr(o.review),rfcChecklist:kr(o.requestforchangeschecklist),schemaDefaults:cq(a.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Id(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function dq({config:e,onError:t}){const[r,n]=m.useState(!0),[s,i]=m.useState(null),[o,a]=m.useState(!1),{setEditorConfig:c,setEditorMode:u,setCategoryDefinition:d,setContentFramework:f,setEditorProfile:g}=Z(),{setTreeData:p,selectNode:b}=ue();return m.useEffect(()=>{let h=!1;async function v(){var y,C,S;try{n(!0),i(null),e.apiBaseUrl&&hh(e.apiBaseUrl),c(e),u(e.config.mode),g(ob(e));const _=e.context.contentId??e.context.identifier??"",x=e.context.channel??"";let E;if(x)try{E=(y=await Mp(x))==null?void 0:y.defaultFramework}catch{}let D=!1;if(_){const T=e.config.objectType==="QuestionSet";let{rootNode:j}=T?await Zx(_):await gh(_);if(j&&e.config.primaryCategory==="Learning Path"&&(j=await i1(j)),!h&&(p(j?[j]:[]),j)){b(j.id);const{framework:P,targetFWIds:U}=Id(j.metadata??{},E,e.context);f(P,U),D=!0}const F=e.config.primaryCategory??"Course",O=e.context.channel??"",N=e.config.categoryDefinitionApiVersion??"v1";try{const B=await uq(F,O,e.config.objectType??"Collection",N);if(!h){d(B);const P=((C=B.sourcingSettings)==null?void 0:C.collection)??{},U={};P.maxDepth&&!e.config.maxDepth&&(U.maxDepth=P.maxDepth),P.children&&!e.config.children&&(U.children=P.children),P.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(U.hierarchy={...e.config.hierarchy??{},...P.hierarchy}),Object.keys(U).length>0&&c({...e,config:{...e.config,...U}})}}catch{}}if(!h&&!D){const{framework:T,targetFWIds:j}=Id({},E,e.context);f(T,j)}h||a(!0)}catch(_){if(!h){const x=_ instanceof Error?_:new Error(String(_));i(x),t==null||t(x)}}finally{h||n(!1)}}return v(),()=>{h=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:o}}function fq(){const e=Al(t=>t.setLanguage);m.useEffect(()=>{e(localStorage.getItem(Ba)||"en",{broadcast:!1});const t=n=>{n.key===Ba&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var i;const s=(i=n.detail)==null?void 0:i.lang;s&&e(s,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(qa,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(qa,r)}},[e])}const hq="_root_1itrv_1",pq="_loadingState_1itrv_10",mq="_loadingSpinner_1itrv_20",gq="_errorState_1itrv_34",ws={root:hq,loadingState:pq,loadingSpinner:mq,errorState:gq},vq=new Rm({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function yq({error:e,onRetry:t}){const r=ae();return l.jsxs("div",{className:ws.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 bq extends m.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(yq,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function Cq(e){fq();const t=ae(),{isLoading:r,error:n}=dq({config:e,onError:e.onError}),s=Z(o=>o.editorMode),i=Z(o=>o.editorProfile);return r?l.jsxs("div",{className:ws.loadingState,children:[l.jsx("div",{className:ws.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:ws.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",ws.root,i.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(oq,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const am=e=>l.jsx(bq,{onError:e.onError,children:l.jsxs(Mm,{client:vq,children:[l.jsx(Cq,{...e}),l.jsx(Fg,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),io=Symbol.for("r2wc.reactRender"),kd=Symbol.for("r2wc.shouldRender"),_i=Symbol.for("r2wc.root");function Sq(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _q(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Dd={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[io]()}}),e[io]()}};function wq(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},i=!1,o=function(){var u=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?u.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.'),u.attachShadow({mode:"open"})),u},a=Object.create(HTMLElement.prototype);a.constructor=o;var c=new Proxy(a,{has:function(u,d){return d in e.propTypes||d in a},set:function(u,d,f,g){return i&&(s[d]=!0),typeof d=="symbol"||s[d]||d in u?(e.propTypes&&d in e.propTypes&&Dd.expando(g,d,f),Reflect.set(u,d,f,g)):(Dd.expando(g,d,f),!0)},getOwnPropertyDescriptor:function(u,d){var f=Reflect.getOwnPropertyDescriptor(u,d);if(f)return f;if(d in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return o.prototype=c,a.connectedCallback=function(){this[kd]=!0,this[io]()},a.disconnectedCallback=function(){typeof r.createRoot=="function"?this[_i].unmount():r.unmountComponentAtNode(this)},a[io]=function(){if(this[kd]===!0){var u={};Object.keys(this).forEach(function(g){s[g]!==!1&&(u[g]=this[g])},this),i=!0;const d=n.shadow?this.shadowRoot:this,f=t.createElement(e,u);typeof r.createRoot=="function"?(this[_i]||(this[_i]=r.createRoot(d)),this[_i].render(f)):r.render(f,d),i=!1}},e.propTypes&&(o.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(u){return Sq(u)}):Object.keys(e.propTypes),a.attributeChangedCallback=function(u,d,f){var g=n.dashStyleAttributes?_q(u):u;this[g]=f}),o}var jn={},Ld;function xq(){if(Ld)return jn;Ld=1;var e=Ur;if(process.env.NODE_ENV==="production")jn.createRoot=e.createRoot,jn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;jn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},jn.hydrateRoot=function(r,n,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,s)}finally{t.usingClientEntryPoint=!1}}}return jn}var Tq=xq();const Eq=xl(Tq);function Aq(){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 Iq(e="sb-collection-editor"){if(Aq(),typeof customElements>"u"||customElements.get(e))return;const t=wq(am,m,Eq,{});customElements.define(e,t)}exports.CollectionEditor=am;exports.registerCollectionEditor=Iq;exports.setApiBaseUrl=hh;exports.useEditorStore=Z;exports.useLibraryStore=sm;exports.useTreeStore=ue;