@project-sunbird/collection-editor-react 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/channel.d.ts +2 -0
- package/dist/collection-editor.umd.js +94 -94
- package/dist/hooks/resolveFrameworkIds.test.d.ts +1 -0
- package/dist/hooks/useEditorInit.d.ts +14 -0
- package/dist/index.cjs +94 -94
- package/dist/index.js +4148 -4123
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(me,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("react-dom"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime"],h):(me=typeof globalThis<"u"?globalThis:me||self,h(me.CollectionEditorReact={},me.React,me.ReactDOM,me.jsxRuntime))})(this,function(me,h,Pe,c){"use strict";var rO=Object.defineProperty;var vp=me=>{throw TypeError(me)};var nO=(me,h,Pe)=>h in me?rO(me,h,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):me[h]=Pe;var Yo=(me,h,Pe)=>nO(me,typeof h!="symbol"?h+"":h,Pe),Ol=(me,h,Pe)=>h.has(me)||vp("Cannot "+Pe);var E=(me,h,Pe)=>(Ol(me,h,"read from private field"),Pe?Pe.call(me):h.get(me)),ie=(me,h,Pe)=>h.has(me)?vp("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(me):h.set(me,Pe),Y=(me,h,Pe,c)=>(Ol(me,h,"write to private field"),c?c.call(me,Pe):h.set(me,Pe),Pe),Se=(me,h,Pe)=>(Ol(me,h,"access private method"),Pe);var gi=(me,h,Pe,c)=>({set _(mi){Y(me,h,mi,Pe)},get _(){return E(me,h,c)}});var nn,Pr,qn,lp,dr,on,cp,Un,Fr,zn,dp,an,up,Vn,sn,Hn,Qt,ln,st,Uo,cn,jt,bp,_r,fp,xt,Te,zo,Et,dn,Rn,br,Mr,Vo,Qn,Gn,un,fn,$r,Wn,xe,Zo,Al,Dl,Nl,kl,xl,Ll,Pl,wp,hp,Ho,ur,St,hn,fr,Vr,pp,wr,nr,Ro,gp,hr,mp,Xe,Br,jr,Kn,Yn,qr,Zn,Xn,yp;function mi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ne=mi(h);var eo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_p=(lp=class extends eo{constructor(){super();ie(this,nn);ie(this,Pr);ie(this,qn);Y(this,qn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){E(this,Pr)||this.setEventListener(E(this,qn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Pr))==null||t.call(this),Y(this,Pr,void 0))}setEventListener(t){var r;Y(this,qn,t),(r=E(this,Pr))==null||r.call(this),Y(this,Pr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){E(this,nn)!==t&&(Y(this,nn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof E(this,nn)=="boolean"?E(this,nn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},nn=new WeakMap,Pr=new WeakMap,qn=new WeakMap,lp),yi=new _p,Tp={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ep=(cp=class{constructor(){ie(this,dr,Tp);ie(this,on,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&E(this,on)&&e!==E(this,dr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:E(this,dr),provider:e}),Y(this,dr,e),process.env.NODE_ENV!=="production"&&Y(this,on,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&Y(this,on,!0),E(this,dr).setTimeout(e,t)}clearTimeout(e){E(this,dr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&Y(this,on,!0),E(this,dr).setInterval(e,t)}clearInterval(e){E(this,dr).clearInterval(e)}},dr=new WeakMap,on=new WeakMap,cp),Hr=new Ep;function Ip(e){setTimeout(e,0)}var Op=typeof window>"u"||"Deno"in globalThis;function At(){}function Ap(e,t){return typeof e=="function"?e(t):e}function vi(e){return typeof e=="number"&&e>=0&&e!==1/0}function Fl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tr(e,t){return typeof e=="function"?e(t):e}function Ft(e,t){return typeof e=="function"?e(t):e}function Ml(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:i,stale:s}=e;if(i){if(n){if(t.queryHash!==bi(i,t.options))return!1}else if(!ro(t.queryKey,i))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||a&&!a(t))}function $l(e,t){const{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(to(t.options.mutationKey)!==to(a))return!1}else if(!ro(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function bi(e,t){return((t==null?void 0:t.queryKeyHashFn)||to)(e)}function to(e){return JSON.stringify(e,(t,r)=>Si(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function ro(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ro(e[r],t[r])):!1}var Dp=Object.prototype.hasOwnProperty;function wi(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Bl(e)&&Bl(t);if(!n&&!(Si(e)&&Si(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),s=i.length,l=n?new Array(s):{};let d=0;for(let f=0;f<s;f++){const u=n?f:i[f],m=e[u],g=t[u];if(m===g){l[u]=m,(n?f<a:Dp.call(e,u))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){l[u]=g;continue}const w=wi(m,g,r+1);l[u]=w,w===m&&d++}return a===s&&d===a?e:l}function Ci(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Bl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Si(e){if(!jl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!jl(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Np(e){return new Promise(t=>{Hr.setTimeout(t,e)})}function _i(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return wi(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return wi(e,t)}return t}function kp(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function xp(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Xo=Symbol();function ql(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Xo&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Xo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ul(e,t){return typeof e=="function"?e(...t):!!e}function Lp(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var no=(()=>{let e=()=>Op;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ti(){let e,t;const r=new Promise((o,a)=>{e=o,t=a});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var Pp=Ip;function Fp(){let e=[],t=0,r=s=>{s()},n=s=>{s()},o=Pp;const a=s=>{t?e.push(s):o(()=>{r(s)})},i=()=>{const s=e;e=[],s.length&&o(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||i()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{o=s}}}var dt=Fp(),Mp=(dp=class extends eo{constructor(){super();ie(this,Un,!0);ie(this,Fr);ie(this,zn);Y(this,zn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){E(this,Fr)||this.setEventListener(E(this,zn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Fr))==null||t.call(this),Y(this,Fr,void 0))}setEventListener(t){var r;Y(this,zn,t),(r=E(this,Fr))==null||r.call(this),Y(this,Fr,t(this.setOnline.bind(this)))}setOnline(t){E(this,Un)!==t&&(Y(this,Un,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return E(this,Un)}},Un=new WeakMap,Fr=new WeakMap,zn=new WeakMap,dp),Jo=new Mp;function $p(e){return Math.min(1e3*2**e,3e4)}function zl(e){return(e??"online")==="online"?Jo.isOnline():!0}var Ei=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vl(e){let t=!1,r=0,n;const o=Ti(),a=()=>o.status!=="pending",i=p=>{var y;if(!a()){const v=new Ei(p);m(v),(y=e.onCancel)==null||y.call(e,v)}},s=()=>{t=!0},l=()=>{t=!1},d=()=>yi.isFocused()&&(e.networkMode==="always"||Jo.isOnline())&&e.canRun(),f=()=>zl(e.networkMode)&&e.canRun(),u=p=>{a()||(n==null||n(),o.resolve(p))},m=p=>{a()||(n==null||n(),o.reject(p))},g=()=>new Promise(p=>{var y;n=v=>{(a()||d())&&p(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var p;n=void 0,a()||(p=e.onContinue)==null||p.call(e)}),w=()=>{if(a())return;let p;const y=r===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(u).catch(v=>{var I;if(a())return;const b=e.retry??(no.isServer()?0:3),C=e.retryDelay??$p,S=typeof C=="function"?C(r,v):C,T=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,v);if(t||!T){m(v);return}r++,(I=e.onFail)==null||I.call(e,r,v),Np(S).then(()=>d()?void 0:g()).then(()=>{t?m(v):w()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:s,continueRetry:l,canStart:f,start:()=>(f()?w():g().then(w),o)}}var Hl=(up=class{constructor(){ie(this,an)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vi(this.gcTime)&&Y(this,an,Hr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(no.isServer()?1/0:5*60*1e3))}clearGcTimeout(){E(this,an)!==void 0&&(Hr.clearTimeout(E(this,an)),Y(this,an,void 0))}},an=new WeakMap,up);function Bp(e){return{onFetch:(t,r)=>{var f,u,m,g,w;const n=t.options,o=(m=(u=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:u.fetchMore)==null?void 0:m.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],i=((w=t.state.data)==null?void 0:w.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const d=async()=>{let p=!1;const y=C=>{Lp(C,()=>t.signal,()=>p=!0)},v=ql(t.options,t.fetchOptions),b=async(C,S,T)=>{if(p)return Promise.reject(t.signal.reason);if(S==null&&C.pages.length)return Promise.resolve(C);const k=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:T?"backward":"forward",meta:t.options.meta};return y(N),N})(),x=await v(k),{maxPages:$}=t.options,j=T?xp:kp;return{pages:j(C.pages,x,$),pageParams:j(C.pageParams,S,$)}};if(o&&a.length){const C=o==="backward",S=C?jp:Rl,T={pages:a,pageParams:i},I=S(n,T);s=await b(T,I,C)}else{const C=e??a.length;do{const S=l===0?i[0]??n.initialPageParam:Rl(n,s);if(l>0&&S==null)break;s=await b(s,S),l++}while(l<C)}return s};t.options.persister?t.fetchFn=()=>{var p,y;return(y=(p=t.options).persister)==null?void 0:y.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function Rl(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 jp(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 qp=(fp=class extends Hl{constructor(t){super();ie(this,jt);ie(this,Vn);ie(this,sn);ie(this,Hn);ie(this,Qt);ie(this,ln);ie(this,st);ie(this,Uo);ie(this,cn);Y(this,cn,!1),Y(this,Uo,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,ln,t.client),Y(this,Qt,E(this,ln).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,sn,Wl(this.options)),this.state=t.state??E(this,sn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return E(this,Vn)}get promise(){var t;return(t=E(this,st))==null?void 0:t.promise}setOptions(t){if(this.options={...E(this,Uo),...t},t!=null&&t._type&&Y(this,Vn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Wl(this.options);r.data!==void 0&&(this.setState(Gl(r.data,r.dataUpdatedAt)),Y(this,sn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Qt).remove(this)}setData(t,r){const n=_i(this.state.data,t,this.options);return Se(this,jt,_r).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Se(this,jt,_r).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=E(this,st))==null?void 0:n.promise;return(o=E(this,st))==null||o.cancel(t),r?r.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return E(this,sn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ft(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xo||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Tr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Fl(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,st))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,st))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Qt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(E(this,st)&&(E(this,cn)||Se(this,jt,bp).call(this)?E(this,st).cancel({revert:!0}):E(this,st).cancelRetry()),this.scheduleGc()),E(this,Qt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,jt,_r).call(this,{type:"invalidate"})}async fetch(t,r){var d,f,u,m,g,w,p,y,v,b,C;if(this.state.fetchStatus!=="idle"&&((d=E(this,st))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(E(this,st))return E(this,st).continueRetry(),E(this,st).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(T=>T.options.queryFn);S&&this.setOptions(S.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,cn,!0),n.signal)})},a=()=>{const S=ql(this.options,r),I=(()=>{const k={client:E(this,ln),queryKey:this.queryKey,meta:this.meta};return o(k),k})();return Y(this,cn,!1),this.options.persister?this.options.persister(S,I,this):S(I)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:E(this,ln),state:this.state,fetchFn:a};return o(S),S})(),l=E(this,Vn)==="infinite"?Bp(this.options.pages):this.options.behavior;l==null||l.onFetch(s,this),Y(this,Hn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&Se(this,jt,_r).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta}),Y(this,st,Vl({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof Ei&&S.revert&&this.setState({...E(this,Hn),fetchStatus:"idle"}),n.abort()},onFail:(S,T)=>{Se(this,jt,_r).call(this,{type:"failed",failureCount:S,error:T})},onPause:()=>{Se(this,jt,_r).call(this,{type:"pause"})},onContinue:()=>{Se(this,jt,_r).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await E(this,st).start();if(S===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(S),(g=(m=E(this,Qt).config).onSuccess)==null||g.call(m,S,this),(p=(w=E(this,Qt).config).onSettled)==null||p.call(w,S,this.state.error,this),S}catch(S){if(S instanceof Ei){if(S.silent)return E(this,st).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Se(this,jt,_r).call(this,{type:"error",error:S}),(v=(y=E(this,Qt).config).onError)==null||v.call(y,S,this),(C=(b=E(this,Qt).config).onSettled)==null||C.call(b,this.state.data,S,this),S}finally{this.scheduleGc()}}},Vn=new WeakMap,sn=new WeakMap,Hn=new WeakMap,Qt=new WeakMap,ln=new WeakMap,st=new WeakMap,Uo=new WeakMap,cn=new WeakMap,jt=new WeakSet,bp=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},_r=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ql(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Gl(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Hn,t.manual?o:void 0),o;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),dt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),E(this,Qt).notify({query:this,type:"updated",action:t})})},fp);function Ql(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gl(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Wl(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 Up=(hp=class extends eo{constructor(t,r){super();ie(this,xe);ie(this,xt);ie(this,Te);ie(this,zo);ie(this,Et);ie(this,dn);ie(this,Rn);ie(this,br);ie(this,Mr);ie(this,Vo);ie(this,Qn);ie(this,Gn);ie(this,un);ie(this,fn);ie(this,$r);ie(this,Wn,new Set);this.options=r,Y(this,xt,t),Y(this,Mr,null),Y(this,br,Ti()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Te).addObserver(this),Kl(E(this,Te),this.options)?Se(this,xe,Zo).call(this):this.updateResult(),Se(this,xe,kl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ii(E(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ii(E(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,xe,xl).call(this),Se(this,xe,Ll).call(this),E(this,Te).removeObserver(this)}setOptions(t){const r=this.options,n=E(this,Te);if(this.options=E(this,xt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ft(this.options.enabled,E(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,xe,Pl).call(this),E(this,Te).setOptions(this.options),r._defaulted&&!Ci(this.options,r)&&E(this,xt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Te),observer:this});const o=this.hasListeners();o&&Yl(E(this,Te),n,this.options,r)&&Se(this,xe,Zo).call(this),this.updateResult(),o&&(E(this,Te)!==n||Ft(this.options.enabled,E(this,Te))!==Ft(r.enabled,E(this,Te))||Tr(this.options.staleTime,E(this,Te))!==Tr(r.staleTime,E(this,Te)))&&Se(this,xe,Al).call(this);const a=Se(this,xe,Dl).call(this);o&&(E(this,Te)!==n||Ft(this.options.enabled,E(this,Te))!==Ft(r.enabled,E(this,Te))||a!==E(this,$r))&&Se(this,xe,Nl).call(this,a)}getOptimisticResult(t){const r=E(this,xt).getQueryCache().build(E(this,xt),t),n=this.createResult(r,t);return Vp(this,n)&&(Y(this,Et,n),Y(this,Rn,this.options),Y(this,dn,E(this,Te).state)),n}getCurrentResult(){return E(this,Et)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&E(this,br).status==="pending"&&E(this,br).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){E(this,Wn).add(t)}getCurrentQuery(){return E(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=E(this,xt).defaultQueryOptions(t),n=E(this,xt).getQueryCache().build(E(this,xt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,xe,Zo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Et)))}createResult(t,r){var $;const n=E(this,Te),o=this.options,a=E(this,Et),i=E(this,dn),s=E(this,Rn),d=t!==n?t.state:E(this,zo),{state:f}=t;let u={...f},m=!1,g;if(r._optimisticResults){const j=this.hasListeners(),N=!j&&Kl(t,r),L=j&&Yl(t,n,r,o);(N||L)&&(u={...u,...Ql(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:w,errorUpdatedAt:p,status:y}=u;g=u.data;let v=!1;if(r.placeholderData!==void 0&&g===void 0&&y==="pending"){let j;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(j=a.data,v=!0):j=typeof r.placeholderData=="function"?r.placeholderData(($=E(this,Gn))==null?void 0:$.state.data,E(this,Gn)):r.placeholderData,j!==void 0&&(y="success",g=_i(a==null?void 0:a.data,j,r),m=!0)}if(r.select&&g!==void 0&&!v)if(a&&g===(i==null?void 0:i.data)&&r.select===E(this,Vo))g=E(this,Qn);else try{Y(this,Vo,r.select),g=r.select(g),g=_i(a==null?void 0:a.data,g,r),Y(this,Qn,g),Y(this,Mr,null)}catch(j){Y(this,Mr,j)}E(this,Mr)&&(w=E(this,Mr),g=E(this,Qn),p=Date.now(),y="error");const b=u.fetchStatus==="fetching",C=y==="pending",S=y==="error",T=C&&b,I=g!==void 0,x={status:y,fetchStatus:u.fetchStatus,isPending:C,isSuccess:y==="success",isError:S,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:u.dataUpdatedAt,error:w,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>d.dataUpdateCount||u.errorUpdateCount>d.errorUpdateCount,isFetching:b,isRefetching:b&&!C,isLoadingError:S&&!I,isPaused:u.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&I,isStale:Oi(t,r),refetch:this.refetch,promise:E(this,br),isEnabled:Ft(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=x.data!==void 0,N=x.status==="error"&&!j,L=F=>{N?F.reject(x.error):j&&F.resolve(x.data)},B=()=>{const F=Y(this,br,x.promise=Ti());L(F)},P=E(this,br);switch(P.status){case"pending":t.queryHash===n.queryHash&&L(P);break;case"fulfilled":(N||x.data!==P.value)&&B();break;case"rejected":(!N||x.error!==P.reason)&&B();break}}return x}updateResult(){const t=E(this,Et),r=this.createResult(E(this,Te),this.options);if(Y(this,dn,E(this,Te).state),Y(this,Rn,this.options),E(this,dn).data!==void 0&&Y(this,Gn,E(this,Te)),Ci(r,t))return;Y(this,Et,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!E(this,Wn).size)return!0;const i=new Set(a??E(this,Wn));return this.options.throwOnError&&i.add("error"),Object.keys(E(this,Et)).some(s=>{const l=s;return E(this,Et)[l]!==t[l]&&i.has(l)})};Se(this,xe,wp).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,xe,kl).call(this)}},xt=new WeakMap,Te=new WeakMap,zo=new WeakMap,Et=new WeakMap,dn=new WeakMap,Rn=new WeakMap,br=new WeakMap,Mr=new WeakMap,Vo=new WeakMap,Qn=new WeakMap,Gn=new WeakMap,un=new WeakMap,fn=new WeakMap,$r=new WeakMap,Wn=new WeakMap,xe=new WeakSet,Zo=function(t){Se(this,xe,Pl).call(this);let r=E(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(At)),r},Al=function(){Se(this,xe,xl).call(this);const t=Tr(this.options.staleTime,E(this,Te));if(no.isServer()||E(this,Et).isStale||!vi(t))return;const n=Fl(E(this,Et).dataUpdatedAt,t)+1;Y(this,un,Hr.setTimeout(()=>{E(this,Et).isStale||this.updateResult()},n))},Dl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Te)):this.options.refetchInterval)??!1},Nl=function(t){Se(this,xe,Ll).call(this),Y(this,$r,t),!(no.isServer()||Ft(this.options.enabled,E(this,Te))===!1||!vi(E(this,$r))||E(this,$r)===0)&&Y(this,fn,Hr.setInterval(()=>{(this.options.refetchIntervalInBackground||yi.isFocused())&&Se(this,xe,Zo).call(this)},E(this,$r)))},kl=function(){Se(this,xe,Al).call(this),Se(this,xe,Nl).call(this,Se(this,xe,Dl).call(this))},xl=function(){E(this,un)!==void 0&&(Hr.clearTimeout(E(this,un)),Y(this,un,void 0))},Ll=function(){E(this,fn)!==void 0&&(Hr.clearInterval(E(this,fn)),Y(this,fn,void 0))},Pl=function(){const t=E(this,xt).getQueryCache().build(E(this,xt),this.options);if(t===E(this,Te))return;const r=E(this,Te);Y(this,Te,t),Y(this,zo,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},wp=function(t){dt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(E(this,Et))}),E(this,xt).getQueryCache().notify({query:E(this,Te),type:"observerResultsUpdated"})})},hp);function zp(e,t){return Ft(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ft(t.retryOnMount,e)===!1)}function Kl(e,t){return zp(e,t)||e.state.data!==void 0&&Ii(e,t,t.refetchOnMount)}function Ii(e,t,r){if(Ft(t.enabled,e)!==!1&&Tr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Oi(e,t)}return!1}function Yl(e,t,r,n){return(e!==t||Ft(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Oi(e,r)}function Oi(e,t){return Ft(t.enabled,e)!==!1&&e.isStaleByTime(Tr(t.staleTime,e))}function Vp(e,t){return!Ci(e.getCurrentResult(),t)}var Hp=(pp=class extends Hl{constructor(t){super();ie(this,fr);ie(this,Ho);ie(this,ur);ie(this,St);ie(this,hn);Y(this,Ho,t.client),this.mutationId=t.mutationId,Y(this,St,t.mutationCache),Y(this,ur,[]),this.state=t.state||Rp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,ur).includes(t)||(E(this,ur).push(t),this.clearGcTimeout(),E(this,St).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,ur,E(this,ur).filter(r=>r!==t)),this.scheduleGc(),E(this,St).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,ur).length||(this.state.status==="pending"?this.scheduleGc():E(this,St).remove(this))}continue(){var t;return((t=E(this,hn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,l,d,f,u,m,g,w,p,y,v,b,C,S,T,I,k;const r=()=>{Se(this,fr,Vr).call(this,{type:"continue"})},n={client:E(this,Ho),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,hn,Vl({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,$)=>{Se(this,fr,Vr).call(this,{type:"failed",failureCount:x,error:$})},onPause:()=>{Se(this,fr,Vr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,St).canRun(this)}));const o=this.state.status==="pending",a=!E(this,hn).canStart();try{if(o)r();else{Se(this,fr,Vr).call(this,{type:"pending",variables:t,isPaused:a}),E(this,St).config.onMutate&&await E(this,St).config.onMutate(t,this,n);const $=await((s=(i=this.options).onMutate)==null?void 0:s.call(i,t,n));$!==this.state.context&&Se(this,fr,Vr).call(this,{type:"pending",context:$,variables:t,isPaused:a})}const x=await E(this,hn).start();return await((d=(l=E(this,St).config).onSuccess)==null?void 0:d.call(l,x,t,this.state.context,this,n)),await((u=(f=this.options).onSuccess)==null?void 0:u.call(f,x,t,this.state.context,n)),await((g=(m=E(this,St).config).onSettled)==null?void 0:g.call(m,x,null,this.state.variables,this.state.context,this,n)),await((p=(w=this.options).onSettled)==null?void 0:p.call(w,x,null,t,this.state.context,n)),Se(this,fr,Vr).call(this,{type:"success",data:x}),x}catch(x){try{await((v=(y=E(this,St).config).onError)==null?void 0:v.call(y,x,t,this.state.context,this,n))}catch($){Promise.reject($)}try{await((C=(b=this.options).onError)==null?void 0:C.call(b,x,t,this.state.context,n))}catch($){Promise.reject($)}try{await((T=(S=E(this,St).config).onSettled)==null?void 0:T.call(S,void 0,x,this.state.variables,this.state.context,this,n))}catch($){Promise.reject($)}try{await((k=(I=this.options).onSettled)==null?void 0:k.call(I,void 0,x,t,this.state.context,n))}catch($){Promise.reject($)}throw Se(this,fr,Vr).call(this,{type:"error",error:x}),x}finally{E(this,St).runNext(this)}}},Ho=new WeakMap,ur=new WeakMap,St=new WeakMap,hn=new WeakMap,fr=new WeakSet,Vr=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(()=>{E(this,ur).forEach(n=>{n.onMutationUpdate(t)}),E(this,St).notify({mutation:this,type:"updated",action:t})})},pp);function Rp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qp=(gp=class extends eo{constructor(t={}){super();ie(this,wr);ie(this,nr);ie(this,Ro);this.config=t,Y(this,wr,new Set),Y(this,nr,new Map),Y(this,Ro,0)}build(t,r,n){const o=new Hp({client:t,mutationCache:this,mutationId:++gi(this,Ro)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){E(this,wr).add(t);const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r);n?n.push(t):E(this,nr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,wr).delete(t)){const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&E(this,nr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r),o=n==null?void 0:n.find(a=>a.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=ea(t);if(typeof r=="string"){const o=(n=E(this,nr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dt.batch(()=>{E(this,wr).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,wr).clear(),E(this,nr).clear()})}getAll(){return Array.from(E(this,wr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>$l(r,n))}findAll(t={}){return this.getAll().filter(r=>$l(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(At))))}},wr=new WeakMap,nr=new WeakMap,Ro=new WeakMap,gp);function ea(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Gp=(mp=class extends eo{constructor(t={}){super();ie(this,hr);this.config=t,Y(this,hr,new Map)}build(t,r,n){const o=r.queryKey,a=r.queryHash??bi(o,r);let i=this.get(a);return i||(i=new qp({client:t,queryKey:o,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){E(this,hr).has(t.queryHash)||(E(this,hr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=E(this,hr).get(t.queryHash);r&&(t.destroy(),r===t&&E(this,hr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,hr).get(t)}getAll(){return[...E(this,hr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ml(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Ml(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()})})}},hr=new WeakMap,mp),Wp=(yp=class{constructor(e={}){ie(this,Xe);ie(this,Br);ie(this,jr);ie(this,Kn);ie(this,Yn);ie(this,qr);ie(this,Zn);ie(this,Xn);Y(this,Xe,e.queryCache||new Gp),Y(this,Br,e.mutationCache||new Qp),Y(this,jr,e.defaultOptions||{}),Y(this,Kn,new Map),Y(this,Yn,new Map),Y(this,qr,0)}mount(){gi(this,qr)._++,E(this,qr)===1&&(Y(this,Zn,yi.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onFocus())})),Y(this,Xn,Jo.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onOnline())})))}unmount(){var e,t;gi(this,qr)._--,E(this,qr)===0&&((e=E(this,Zn))==null||e.call(this),Y(this,Zn,void 0),(t=E(this,Xn))==null||t.call(this),Y(this,Xn,void 0))}isFetching(e){return E(this,Xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,Br).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=E(this,Xe).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Tr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return E(this,Xe).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=E(this,Xe).get(n.queryHash),a=o==null?void 0:o.state.data,i=Ap(t,a);if(i!==void 0)return E(this,Xe).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return dt.batch(()=>E(this,Xe).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=E(this,Xe);dt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=E(this,Xe);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(()=>E(this,Xe).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(At).catch(At)}invalidateQueries(e,t={}){return dt.batch(()=>(E(this,Xe).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=dt.batch(()=>E(this,Xe).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let a=o.fetch(void 0,r);return r.throwOnError||(a=a.catch(At)),o.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(At)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=E(this,Xe).build(this,t);return r.isStaleByTime(Tr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(At).catch(At)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(At).catch(At)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Jo.isOnline()?E(this,Br).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Xe)}getMutationCache(){return E(this,Br)}getDefaultOptions(){return E(this,jr)}setDefaultOptions(e){Y(this,jr,e)}setQueryDefaults(e,t){E(this,Kn).set(to(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,Kn).values()],r={};return t.forEach(n=>{ro(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){E(this,Yn).set(to(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,Yn).values()],r={};return t.forEach(n=>{ro(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,jr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Xo&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,jr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,Xe).clear(),E(this,Br).clear()}},Xe=new WeakMap,Br=new WeakMap,jr=new WeakMap,Kn=new WeakMap,Yn=new WeakMap,qr=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,yp),Zl=Ne.createContext(void 0),Kp=e=>{const t=Ne.useContext(Zl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yp=({client:e,children:t})=>(Ne.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Zl.Provider,{value:e,children:t})),Xl=Ne.createContext(!1),Zp=()=>Ne.useContext(Xl);Xl.Provider;function Xp(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Jp=Ne.createContext(Xp()),eg=()=>Ne.useContext(Jp),tg=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Ul(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},rg=e=>{Ne.useEffect(()=>{e.clearReset()},[e])},ng=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||Ul(r,[e.error,n])),og=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ag=(e,t)=>e.isLoading&&e.isFetching&&!t,ig=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Jl=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function sg(e,t,r){var g,w,p,y;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Zp(),o=eg(),a=Kp(),i=a.defaultQueryOptions(e);(w=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||w.call(g,i);const s=a.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const l=e.subscribed!==!1;i._optimisticResults=n?"isRestoring":l?"optimistic":void 0,og(i),tg(i,o,s),rg(o);const d=!a.getQueryCache().get(i.queryHash),[f]=Ne.useState(()=>new t(a,i)),u=f.getOptimisticResult(i),m=!n&&l;if(Ne.useSyncExternalStore(Ne.useCallback(v=>{const b=m?f.subscribe(dt.batchCalls(v)):At;return f.updateResult(),b},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),Ne.useEffect(()=>{f.setOptions(i)},[i,f]),ig(i,u))throw Jl(i,f,o);if(ng({result:u,errorResetBoundary:o,throwOnError:i.throwOnError,query:s,suspense:i.suspense}))throw u.error;if((y=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||y.call(p,i,u),i.experimental_prefetchInRender&&!no.isServer()&&ag(u,n)){const v=d?Jl(i,f,o):s==null?void 0:s.promise;v==null||v.catch(At).finally(()=>{f.updateResult()})}return i.notifyOnChangeProps?u:f.trackResult(u)}function gn(e,t){return sg(e,Up)}let lg={data:""},cg=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||lg},dg=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ug=/\/\*[^]*?\*\/| +/g,ec=/\n+/g,Er=(e,t)=>{let r="",n="",o="";for(let a in e){let i=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+i+";":n+=a[1]=="f"?Er(i,a):a+"{"+Er(i,a[1]=="k"?"":t)+"}":typeof i=="object"?n+=Er(i,t?t.replace(/([^,])+/g,s=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,s):s?s+" "+l:l)):a):i!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Er.p?Er.p(a,i):a+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Ir={},tc=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+tc(e[r]);return t}return e},fg=(e,t,r,n,o)=>{let a=tc(e),i=Ir[a]||(Ir[a]=(l=>{let d=0,f=11;for(;d<l.length;)f=101*f+l.charCodeAt(d++)>>>0;return"go"+f})(a));if(!Ir[i]){let l=a!==e?e:(d=>{let f,u,m=[{}];for(;f=dg.exec(d.replace(ug,""));)f[4]?m.shift():f[3]?(u=f[3].replace(ec," ").trim(),m.unshift(m[0][u]=m[0][u]||{})):m[0][f[1]]=f[2].replace(ec," ").trim();return m[0]})(e);Ir[i]=Er(o?{["@keyframes "+i]:l}:l,r?"":"."+i)}let s=r&&Ir.g;return r&&(Ir.g=Ir[i]),((l,d,f,u)=>{u?d.data=d.data.replace(u,l):d.data.indexOf(l)===-1&&(d.data=f?l+d.data:d.data+l)})(Ir[i],t,n,s),i},hg=(e,t,r)=>e.reduce((n,o,a)=>{let i=t[a];if(i&&i.call){let s=i(r),l=s&&s.props&&s.props.className||/^go/.test(s)&&s;i=l?"."+l:s&&typeof s=="object"?s.props?"":Er(s,""):s===!1?"":s}return n+o+(i??"")},"");function ta(e){let t=this||{},r=e.call?e(t.p):e;return fg(r.unshift?r.raw?hg(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,cg(t.target),t.g,t.o,t.k)}let rc,Ai,Di;ta.bind({g:1});let mr=ta.bind({k:1});function pg(e,t,r,n){Er.p=t,rc=e,Ai=r,Di=n}function Or(e,t){let r=this||{};return function(){let n=arguments;function o(a,i){let s=Object.assign({},a),l=s.className||o.className;r.p=Object.assign({theme:Ai&&Ai()},s),r.o=/go\d/.test(l),s.className=ta.apply(r,n)+(l?" "+l:"");let d=e;return e[0]&&(d=s.as||e,delete s.as),Di&&d[0]&&Di(s),rc(d,s)}return o}}var gg=e=>typeof e=="function",ra=(e,t)=>gg(e)?e(t):e,mg=(()=>{let e=0;return()=>(++e).toString()})(),nc=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),yg=20,Ni="default",oc=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return oc(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+a}))}}},na=[],ac={toasts:[],pausedAt:void 0,settings:{toastLimit:yg}},ar={},ic=(e,t=Ni)=>{ar[t]=oc(ar[t]||ac,e),na.forEach(([r,n])=>{r===t&&n(ar[t])})},sc=e=>Object.keys(ar).forEach(t=>ic(e,t)),vg=e=>Object.keys(ar).find(t=>ar[t].toasts.some(r=>r.id===e)),oa=(e=Ni)=>t=>{ic(t,e)},bg={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},wg=(e={},t=Ni)=>{let[r,n]=h.useState(ar[t]||ac),o=h.useRef(ar[t]);h.useEffect(()=>(o.current!==ar[t]&&n(ar[t]),na.push([t,n]),()=>{let i=na.findIndex(([s])=>s===t);i>-1&&na.splice(i,1)}),[t]);let a=r.toasts.map(i=>{var s,l,d;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((s=e[i.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((l=e[i.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||bg[i.type],style:{...e.style,...(d=e[i.type])==null?void 0:d.style,...i.style}}});return{...r,toasts:a}},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)||mg()}),oo=e=>(t,r)=>{let n=Cg(t,e,r);return oa(n.toasterId||vg(n.id))({type:2,toast:n}),n.id},rt=(e,t)=>oo("blank")(e,t);rt.error=oo("error"),rt.success=oo("success"),rt.loading=oo("loading"),rt.custom=oo("custom"),rt.dismiss=(e,t)=>{let r={type:3,toastId:e};t?oa(t)(r):sc(r)},rt.dismissAll=e=>rt.dismiss(void 0,e),rt.remove=(e,t)=>{let r={type:4,toastId:e};t?oa(t)(r):sc(r)},rt.removeAll=e=>rt.remove(void 0,e),rt.promise=(e,t,r)=>{let n=rt.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let a=t.success?ra(t.success,o):void 0;return a?rt.success(a,{id:n,...r,...r==null?void 0:r.success}):rt.dismiss(n),o}).catch(o=>{let a=t.error?ra(t.error,o):void 0;a?rt.error(a,{id:n,...r,...r==null?void 0:r.error}):rt.dismiss(n)}),e};var Sg=1e3,_g=(e,t="default")=>{let{toasts:r,pausedAt:n}=wg(e,t),o=h.useRef(new Map).current,a=h.useCallback((u,m=Sg)=>{if(o.has(u))return;let g=setTimeout(()=>{o.delete(u),i({type:4,toastId:u})},m);o.set(u,g)},[]);h.useEffect(()=>{if(n)return;let u=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let w=(g.duration||0)+g.pauseDuration-(u-g.createdAt);if(w<0){g.visible&&rt.dismiss(g.id);return}return setTimeout(()=>rt.dismiss(g.id,t),w)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let i=h.useCallback(oa(t),[t]),s=h.useCallback(()=>{i({type:5,time:Date.now()})},[i]),l=h.useCallback((u,m)=>{i({type:1,toast:{id:u,height:m}})},[i]),d=h.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),f=h.useCallback((u,m)=>{let{reverseOrder:g=!1,gutter:w=8,defaultPosition:p}=m||{},y=r.filter(C=>(C.position||p)===(u.position||p)&&C.height),v=y.findIndex(C=>C.id===u.id),b=y.filter((C,S)=>S<v&&C.visible).length;return y.filter(C=>C.visible).slice(...g?[b+1]:[0,b]).reduce((C,S)=>C+(S.height||0)+w,0)},[r]);return h.useEffect(()=>{r.forEach(u=>{if(u.dismissed)a(u.id,u.removeDelay);else{let m=o.get(u.id);m&&(clearTimeout(m),o.delete(u.id))}})},[r,a]),{toasts:r,handlers:{updateHeight:l,startPause:s,endPause:d,calculateOffset:f}}},Tg=mr`
|
|
1
|
+
(function(me,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("react-dom"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime"],h):(me=typeof globalThis<"u"?globalThis:me||self,h(me.CollectionEditorReact={},me.React,me.ReactDOM,me.jsxRuntime))})(this,function(me,h,Pe,c){"use strict";var tO=Object.defineProperty;var bp=me=>{throw TypeError(me)};var rO=(me,h,Pe)=>h in me?tO(me,h,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):me[h]=Pe;var Yo=(me,h,Pe)=>rO(me,typeof h!="symbol"?h+"":h,Pe),El=(me,h,Pe)=>h.has(me)||bp("Cannot "+Pe);var E=(me,h,Pe)=>(El(me,h,"read from private field"),Pe?Pe.call(me):h.get(me)),ie=(me,h,Pe)=>h.has(me)?bp("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(me):h.set(me,Pe),Y=(me,h,Pe,c)=>(El(me,h,"write to private field"),c?c.call(me,Pe):h.set(me,Pe),Pe),Se=(me,h,Pe)=>(El(me,h,"access private method"),Pe);var pi=(me,h,Pe,c)=>({set _(gi){Y(me,h,gi,Pe)},get _(){return E(me,h,c)}});var nn,Pr,qn,cp,dr,on,dp,Un,Fr,Vn,up,an,fp,zn,sn,Hn,Qt,ln,lt,Uo,cn,jt,wp,_r,hp,xt,Te,Vo,Et,dn,Rn,br,Mr,zo,Qn,Gn,un,fn,$r,Wn,xe,Zo,Il,Ol,Al,Dl,Nl,kl,xl,Cp,pp,Ho,ur,St,hn,fr,zr,gp,wr,nr,Ro,mp,hr,yp,Xe,Br,jr,Kn,Yn,qr,Zn,Xn,vp;function gi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ne=gi(h);var eo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Tp=(cp=class extends eo{constructor(){super();ie(this,nn);ie(this,Pr);ie(this,qn);Y(this,qn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){E(this,Pr)||this.setEventListener(E(this,qn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Pr))==null||t.call(this),Y(this,Pr,void 0))}setEventListener(t){var r;Y(this,qn,t),(r=E(this,Pr))==null||r.call(this),Y(this,Pr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){E(this,nn)!==t&&(Y(this,nn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof E(this,nn)=="boolean"?E(this,nn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},nn=new WeakMap,Pr=new WeakMap,qn=new WeakMap,cp),mi=new Tp,Ep={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ip=(dp=class{constructor(){ie(this,dr,Ep);ie(this,on,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&E(this,on)&&e!==E(this,dr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:E(this,dr),provider:e}),Y(this,dr,e),process.env.NODE_ENV!=="production"&&Y(this,on,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&Y(this,on,!0),E(this,dr).setTimeout(e,t)}clearTimeout(e){E(this,dr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&Y(this,on,!0),E(this,dr).setInterval(e,t)}clearInterval(e){E(this,dr).clearInterval(e)}},dr=new WeakMap,on=new WeakMap,dp),Hr=new Ip;function Op(e){setTimeout(e,0)}var Ap=typeof window>"u"||"Deno"in globalThis;function At(){}function Dp(e,t){return typeof e=="function"?e(t):e}function yi(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ll(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tr(e,t){return typeof e=="function"?e(t):e}function Ft(e,t){return typeof e=="function"?e(t):e}function Pl(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:i,stale:s}=e;if(i){if(n){if(t.queryHash!==vi(i,t.options))return!1}else if(!ro(t.queryKey,i))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||a&&!a(t))}function Fl(e,t){const{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(to(t.options.mutationKey)!==to(a))return!1}else if(!ro(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function vi(e,t){return((t==null?void 0:t.queryKeyHashFn)||to)(e)}function to(e){return JSON.stringify(e,(t,r)=>Ci(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function ro(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ro(e[r],t[r])):!1}var Np=Object.prototype.hasOwnProperty;function bi(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Ml(e)&&Ml(t);if(!n&&!(Ci(e)&&Ci(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),s=i.length,l=n?new Array(s):{};let d=0;for(let f=0;f<s;f++){const u=n?f:i[f],m=e[u],g=t[u];if(m===g){l[u]=m,(n?f<a:Np.call(e,u))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){l[u]=g;continue}const w=bi(m,g,r+1);l[u]=w,w===m&&d++}return a===s&&d===a?e:l}function wi(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 Ml(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ci(e){if(!$l(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!$l(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $l(e){return Object.prototype.toString.call(e)==="[object Object]"}function kp(e){return new Promise(t=>{Hr.setTimeout(t,e)})}function Si(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 bi(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 bi(e,t)}return t}function xp(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 Xo=Symbol();function Bl(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Xo&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Xo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jl(e,t){return typeof e=="function"?e(...t):!!e}function Pp(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var no=(()=>{let e=()=>Ap;return{isServer(){return e()},setIsServer(t){e=t}}})();function _i(){let e,t;const r=new Promise((o,a)=>{e=o,t=a});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var Fp=Op;function Mp(){let e=[],t=0,r=s=>{s()},n=s=>{s()},o=Fp;const a=s=>{t?e.push(s):o(()=>{r(s)})},i=()=>{const s=e;e=[],s.length&&o(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||i()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{o=s}}}var ut=Mp(),$p=(up=class extends eo{constructor(){super();ie(this,Un,!0);ie(this,Fr);ie(this,Vn);Y(this,Vn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){E(this,Fr)||this.setEventListener(E(this,Vn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Fr))==null||t.call(this),Y(this,Fr,void 0))}setEventListener(t){var r;Y(this,Vn,t),(r=E(this,Fr))==null||r.call(this),Y(this,Fr,t(this.setOnline.bind(this)))}setOnline(t){E(this,Un)!==t&&(Y(this,Un,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return E(this,Un)}},Un=new WeakMap,Fr=new WeakMap,Vn=new WeakMap,up),Jo=new $p;function Bp(e){return Math.min(1e3*2**e,3e4)}function ql(e){return(e??"online")==="online"?Jo.isOnline():!0}var Ti=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ul(e){let t=!1,r=0,n;const o=_i(),a=()=>o.status!=="pending",i=p=>{var y;if(!a()){const v=new Ti(p);m(v),(y=e.onCancel)==null||y.call(e,v)}},s=()=>{t=!0},l=()=>{t=!1},d=()=>mi.isFocused()&&(e.networkMode==="always"||Jo.isOnline())&&e.canRun(),f=()=>ql(e.networkMode)&&e.canRun(),u=p=>{a()||(n==null||n(),o.resolve(p))},m=p=>{a()||(n==null||n(),o.reject(p))},g=()=>new Promise(p=>{var y;n=v=>{(a()||d())&&p(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var p;n=void 0,a()||(p=e.onContinue)==null||p.call(e)}),w=()=>{if(a())return;let p;const y=r===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(u).catch(v=>{var I;if(a())return;const b=e.retry??(no.isServer()?0:3),C=e.retryDelay??Bp,S=typeof C=="function"?C(r,v):C,T=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,v);if(t||!T){m(v);return}r++,(I=e.onFail)==null||I.call(e,r,v),kp(S).then(()=>d()?void 0:g()).then(()=>{t?m(v):w()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:s,continueRetry:l,canStart:f,start:()=>(f()?w():g().then(w),o)}}var Vl=(fp=class{constructor(){ie(this,an)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yi(this.gcTime)&&Y(this,an,Hr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(no.isServer()?1/0:5*60*1e3))}clearGcTimeout(){E(this,an)!==void 0&&(Hr.clearTimeout(E(this,an)),Y(this,an,void 0))}},an=new WeakMap,fp);function jp(e){return{onFetch:(t,r)=>{var f,u,m,g,w;const n=t.options,o=(m=(u=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:u.fetchMore)==null?void 0:m.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],i=((w=t.state.data)==null?void 0:w.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const d=async()=>{let p=!1;const y=C=>{Pp(C,()=>t.signal,()=>p=!0)},v=Bl(t.options,t.fetchOptions),b=async(C,S,T)=>{if(p)return Promise.reject(t.signal.reason);if(S==null&&C.pages.length)return Promise.resolve(C);const k=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:T?"backward":"forward",meta:t.options.meta};return y(N),N})(),x=await v(k),{maxPages:B}=t.options,q=T?Lp:xp;return{pages:q(C.pages,x,B),pageParams:q(C.pageParams,S,B)}};if(o&&a.length){const C=o==="backward",S=C?qp:zl,T={pages:a,pageParams:i},I=S(n,T);s=await b(T,I,C)}else{const C=e??a.length;do{const S=l===0?i[0]??n.initialPageParam:zl(n,s);if(l>0&&S==null)break;s=await b(s,S),l++}while(l<C)}return s};t.options.persister?t.fetchFn=()=>{var p,y;return(y=(p=t.options).persister)==null?void 0:y.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function zl(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 qp(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 Up=(hp=class extends Vl{constructor(t){super();ie(this,jt);ie(this,zn);ie(this,sn);ie(this,Hn);ie(this,Qt);ie(this,ln);ie(this,lt);ie(this,Uo);ie(this,cn);Y(this,cn,!1),Y(this,Uo,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,ln,t.client),Y(this,Qt,E(this,ln).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,sn,Ql(this.options)),this.state=t.state??E(this,sn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return E(this,zn)}get promise(){var t;return(t=E(this,lt))==null?void 0:t.promise}setOptions(t){if(this.options={...E(this,Uo),...t},t!=null&&t._type&&Y(this,zn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Ql(this.options);r.data!==void 0&&(this.setState(Rl(r.data,r.dataUpdatedAt)),Y(this,sn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Qt).remove(this)}setData(t,r){const n=Si(this.state.data,t,this.options);return Se(this,jt,_r).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Se(this,jt,_r).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=E(this,lt))==null?void 0:n.promise;return(o=E(this,lt))==null||o.cancel(t),r?r.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return E(this,sn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ft(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xo||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Tr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ll(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,lt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,lt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Qt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(E(this,lt)&&(E(this,cn)||Se(this,jt,wp).call(this)?E(this,lt).cancel({revert:!0}):E(this,lt).cancelRetry()),this.scheduleGc()),E(this,Qt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,jt,_r).call(this,{type:"invalidate"})}async fetch(t,r){var d,f,u,m,g,w,p,y,v,b,C;if(this.state.fetchStatus!=="idle"&&((d=E(this,lt))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(E(this,lt))return E(this,lt).continueRetry(),E(this,lt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(T=>T.options.queryFn);S&&this.setOptions(S.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,cn,!0),n.signal)})},a=()=>{const S=Bl(this.options,r),I=(()=>{const k={client:E(this,ln),queryKey:this.queryKey,meta:this.meta};return o(k),k})();return Y(this,cn,!1),this.options.persister?this.options.persister(S,I,this):S(I)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:E(this,ln),state:this.state,fetchFn:a};return o(S),S})(),l=E(this,zn)==="infinite"?jp(this.options.pages):this.options.behavior;l==null||l.onFetch(s,this),Y(this,Hn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&Se(this,jt,_r).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta}),Y(this,lt,Ul({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof Ti&&S.revert&&this.setState({...E(this,Hn),fetchStatus:"idle"}),n.abort()},onFail:(S,T)=>{Se(this,jt,_r).call(this,{type:"failed",failureCount:S,error:T})},onPause:()=>{Se(this,jt,_r).call(this,{type:"pause"})},onContinue:()=>{Se(this,jt,_r).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await E(this,lt).start();if(S===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(S),(g=(m=E(this,Qt).config).onSuccess)==null||g.call(m,S,this),(p=(w=E(this,Qt).config).onSettled)==null||p.call(w,S,this.state.error,this),S}catch(S){if(S instanceof Ti){if(S.silent)return E(this,lt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Se(this,jt,_r).call(this,{type:"error",error:S}),(v=(y=E(this,Qt).config).onError)==null||v.call(y,S,this),(C=(b=E(this,Qt).config).onSettled)==null||C.call(b,this.state.data,S,this),S}finally{this.scheduleGc()}}},zn=new WeakMap,sn=new WeakMap,Hn=new WeakMap,Qt=new WeakMap,ln=new WeakMap,lt=new WeakMap,Uo=new WeakMap,cn=new WeakMap,jt=new WeakSet,wp=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},_r=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Hl(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Rl(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Hn,t.manual?o:void 0),o;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),ut.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),E(this,Qt).notify({query:this,type:"updated",action:t})})},hp);function Hl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ql(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rl(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ql(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 Vp=(pp=class extends eo{constructor(t,r){super();ie(this,xe);ie(this,xt);ie(this,Te);ie(this,Vo);ie(this,Et);ie(this,dn);ie(this,Rn);ie(this,br);ie(this,Mr);ie(this,zo);ie(this,Qn);ie(this,Gn);ie(this,un);ie(this,fn);ie(this,$r);ie(this,Wn,new Set);this.options=r,Y(this,xt,t),Y(this,Mr,null),Y(this,br,_i()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Te).addObserver(this),Gl(E(this,Te),this.options)?Se(this,xe,Zo).call(this):this.updateResult(),Se(this,xe,Dl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ei(E(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ei(E(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,xe,Nl).call(this),Se(this,xe,kl).call(this),E(this,Te).removeObserver(this)}setOptions(t){const r=this.options,n=E(this,Te);if(this.options=E(this,xt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ft(this.options.enabled,E(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,xe,xl).call(this),E(this,Te).setOptions(this.options),r._defaulted&&!wi(this.options,r)&&E(this,xt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Te),observer:this});const o=this.hasListeners();o&&Wl(E(this,Te),n,this.options,r)&&Se(this,xe,Zo).call(this),this.updateResult(),o&&(E(this,Te)!==n||Ft(this.options.enabled,E(this,Te))!==Ft(r.enabled,E(this,Te))||Tr(this.options.staleTime,E(this,Te))!==Tr(r.staleTime,E(this,Te)))&&Se(this,xe,Il).call(this);const a=Se(this,xe,Ol).call(this);o&&(E(this,Te)!==n||Ft(this.options.enabled,E(this,Te))!==Ft(r.enabled,E(this,Te))||a!==E(this,$r))&&Se(this,xe,Al).call(this,a)}getOptimisticResult(t){const r=E(this,xt).getQueryCache().build(E(this,xt),t),n=this.createResult(r,t);return Hp(this,n)&&(Y(this,Et,n),Y(this,Rn,this.options),Y(this,dn,E(this,Te).state)),n}getCurrentResult(){return E(this,Et)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&E(this,br).status==="pending"&&E(this,br).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){E(this,Wn).add(t)}getCurrentQuery(){return E(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=E(this,xt).defaultQueryOptions(t),n=E(this,xt).getQueryCache().build(E(this,xt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,xe,Zo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Et)))}createResult(t,r){var B;const n=E(this,Te),o=this.options,a=E(this,Et),i=E(this,dn),s=E(this,Rn),d=t!==n?t.state:E(this,Vo),{state:f}=t;let u={...f},m=!1,g;if(r._optimisticResults){const q=this.hasListeners(),N=!q&&Gl(t,r),P=q&&Wl(t,n,r,o);(N||P)&&(u={...u,...Hl(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:w,errorUpdatedAt:p,status:y}=u;g=u.data;let v=!1;if(r.placeholderData!==void 0&&g===void 0&&y==="pending"){let q;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(q=a.data,v=!0):q=typeof r.placeholderData=="function"?r.placeholderData((B=E(this,Gn))==null?void 0:B.state.data,E(this,Gn)):r.placeholderData,q!==void 0&&(y="success",g=Si(a==null?void 0:a.data,q,r),m=!0)}if(r.select&&g!==void 0&&!v)if(a&&g===(i==null?void 0:i.data)&&r.select===E(this,zo))g=E(this,Qn);else try{Y(this,zo,r.select),g=r.select(g),g=Si(a==null?void 0:a.data,g,r),Y(this,Qn,g),Y(this,Mr,null)}catch(q){Y(this,Mr,q)}E(this,Mr)&&(w=E(this,Mr),g=E(this,Qn),p=Date.now(),y="error");const b=u.fetchStatus==="fetching",C=y==="pending",S=y==="error",T=C&&b,I=g!==void 0,x={status:y,fetchStatus:u.fetchStatus,isPending:C,isSuccess:y==="success",isError:S,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:u.dataUpdatedAt,error:w,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>d.dataUpdateCount||u.errorUpdateCount>d.errorUpdateCount,isFetching:b,isRefetching:b&&!C,isLoadingError:S&&!I,isPaused:u.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&I,isStale:Ii(t,r),refetch:this.refetch,promise:E(this,br),isEnabled:Ft(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=x.data!==void 0,N=x.status==="error"&&!q,P=F=>{N?F.reject(x.error):q&&F.resolve(x.data)},M=()=>{const F=Y(this,br,x.promise=_i());P(F)},L=E(this,br);switch(L.status){case"pending":t.queryHash===n.queryHash&&P(L);break;case"fulfilled":(N||x.data!==L.value)&&M();break;case"rejected":(!N||x.error!==L.reason)&&M();break}}return x}updateResult(){const t=E(this,Et),r=this.createResult(E(this,Te),this.options);if(Y(this,dn,E(this,Te).state),Y(this,Rn,this.options),E(this,dn).data!==void 0&&Y(this,Gn,E(this,Te)),wi(r,t))return;Y(this,Et,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!E(this,Wn).size)return!0;const i=new Set(a??E(this,Wn));return this.options.throwOnError&&i.add("error"),Object.keys(E(this,Et)).some(s=>{const l=s;return E(this,Et)[l]!==t[l]&&i.has(l)})};Se(this,xe,Cp).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,xe,Dl).call(this)}},xt=new WeakMap,Te=new WeakMap,Vo=new WeakMap,Et=new WeakMap,dn=new WeakMap,Rn=new WeakMap,br=new WeakMap,Mr=new WeakMap,zo=new WeakMap,Qn=new WeakMap,Gn=new WeakMap,un=new WeakMap,fn=new WeakMap,$r=new WeakMap,Wn=new WeakMap,xe=new WeakSet,Zo=function(t){Se(this,xe,xl).call(this);let r=E(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(At)),r},Il=function(){Se(this,xe,Nl).call(this);const t=Tr(this.options.staleTime,E(this,Te));if(no.isServer()||E(this,Et).isStale||!yi(t))return;const n=Ll(E(this,Et).dataUpdatedAt,t)+1;Y(this,un,Hr.setTimeout(()=>{E(this,Et).isStale||this.updateResult()},n))},Ol=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Te)):this.options.refetchInterval)??!1},Al=function(t){Se(this,xe,kl).call(this),Y(this,$r,t),!(no.isServer()||Ft(this.options.enabled,E(this,Te))===!1||!yi(E(this,$r))||E(this,$r)===0)&&Y(this,fn,Hr.setInterval(()=>{(this.options.refetchIntervalInBackground||mi.isFocused())&&Se(this,xe,Zo).call(this)},E(this,$r)))},Dl=function(){Se(this,xe,Il).call(this),Se(this,xe,Al).call(this,Se(this,xe,Ol).call(this))},Nl=function(){E(this,un)!==void 0&&(Hr.clearTimeout(E(this,un)),Y(this,un,void 0))},kl=function(){E(this,fn)!==void 0&&(Hr.clearInterval(E(this,fn)),Y(this,fn,void 0))},xl=function(){const t=E(this,xt).getQueryCache().build(E(this,xt),this.options);if(t===E(this,Te))return;const r=E(this,Te);Y(this,Te,t),Y(this,Vo,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Cp=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(E(this,Et))}),E(this,xt).getQueryCache().notify({query:E(this,Te),type:"observerResultsUpdated"})})},pp);function zp(e,t){return Ft(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ft(t.retryOnMount,e)===!1)}function Gl(e,t){return zp(e,t)||e.state.data!==void 0&&Ei(e,t,t.refetchOnMount)}function Ei(e,t,r){if(Ft(t.enabled,e)!==!1&&Tr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ii(e,t)}return!1}function Wl(e,t,r,n){return(e!==t||Ft(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ii(e,r)}function Ii(e,t){return Ft(t.enabled,e)!==!1&&e.isStaleByTime(Tr(t.staleTime,e))}function Hp(e,t){return!wi(e.getCurrentResult(),t)}var Rp=(gp=class extends Vl{constructor(t){super();ie(this,fr);ie(this,Ho);ie(this,ur);ie(this,St);ie(this,hn);Y(this,Ho,t.client),this.mutationId=t.mutationId,Y(this,St,t.mutationCache),Y(this,ur,[]),this.state=t.state||Qp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,ur).includes(t)||(E(this,ur).push(t),this.clearGcTimeout(),E(this,St).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,ur,E(this,ur).filter(r=>r!==t)),this.scheduleGc(),E(this,St).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,ur).length||(this.state.status==="pending"?this.scheduleGc():E(this,St).remove(this))}continue(){var t;return((t=E(this,hn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,l,d,f,u,m,g,w,p,y,v,b,C,S,T,I,k;const r=()=>{Se(this,fr,zr).call(this,{type:"continue"})},n={client:E(this,Ho),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,hn,Ul({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,B)=>{Se(this,fr,zr).call(this,{type:"failed",failureCount:x,error:B})},onPause:()=>{Se(this,fr,zr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,St).canRun(this)}));const o=this.state.status==="pending",a=!E(this,hn).canStart();try{if(o)r();else{Se(this,fr,zr).call(this,{type:"pending",variables:t,isPaused:a}),E(this,St).config.onMutate&&await E(this,St).config.onMutate(t,this,n);const B=await((s=(i=this.options).onMutate)==null?void 0:s.call(i,t,n));B!==this.state.context&&Se(this,fr,zr).call(this,{type:"pending",context:B,variables:t,isPaused:a})}const x=await E(this,hn).start();return await((d=(l=E(this,St).config).onSuccess)==null?void 0:d.call(l,x,t,this.state.context,this,n)),await((u=(f=this.options).onSuccess)==null?void 0:u.call(f,x,t,this.state.context,n)),await((g=(m=E(this,St).config).onSettled)==null?void 0:g.call(m,x,null,this.state.variables,this.state.context,this,n)),await((p=(w=this.options).onSettled)==null?void 0:p.call(w,x,null,t,this.state.context,n)),Se(this,fr,zr).call(this,{type:"success",data:x}),x}catch(x){try{await((v=(y=E(this,St).config).onError)==null?void 0:v.call(y,x,t,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((C=(b=this.options).onError)==null?void 0:C.call(b,x,t,this.state.context,n))}catch(B){Promise.reject(B)}try{await((T=(S=E(this,St).config).onSettled)==null?void 0:T.call(S,void 0,x,this.state.variables,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((k=(I=this.options).onSettled)==null?void 0:k.call(I,void 0,x,t,this.state.context,n))}catch(B){Promise.reject(B)}throw Se(this,fr,zr).call(this,{type:"error",error:x}),x}finally{E(this,St).runNext(this)}}},Ho=new WeakMap,ur=new WeakMap,St=new WeakMap,hn=new WeakMap,fr=new WeakSet,zr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ut.batch(()=>{E(this,ur).forEach(n=>{n.onMutationUpdate(t)}),E(this,St).notify({mutation:this,type:"updated",action:t})})},gp);function Qp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gp=(mp=class extends eo{constructor(t={}){super();ie(this,wr);ie(this,nr);ie(this,Ro);this.config=t,Y(this,wr,new Set),Y(this,nr,new Map),Y(this,Ro,0)}build(t,r,n){const o=new Rp({client:t,mutationCache:this,mutationId:++pi(this,Ro)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){E(this,wr).add(t);const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r);n?n.push(t):E(this,nr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,wr).delete(t)){const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&E(this,nr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ea(t);if(typeof r=="string"){const n=E(this,nr).get(r),o=n==null?void 0:n.find(a=>a.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=ea(t);if(typeof r=="string"){const o=(n=E(this,nr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ut.batch(()=>{E(this,wr).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,wr).clear(),E(this,nr).clear()})}getAll(){return Array.from(E(this,wr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Fl(r,n))}findAll(t={}){return this.getAll().filter(r=>Fl(t,r))}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return ut.batch(()=>Promise.all(t.map(r=>r.continue().catch(At))))}},wr=new WeakMap,nr=new WeakMap,Ro=new WeakMap,mp);function ea(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Wp=(yp=class extends eo{constructor(t={}){super();ie(this,hr);this.config=t,Y(this,hr,new Map)}build(t,r,n){const o=r.queryKey,a=r.queryHash??vi(o,r);let i=this.get(a);return i||(i=new Up({client:t,queryKey:o,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){E(this,hr).has(t.queryHash)||(E(this,hr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=E(this,hr).get(t.queryHash);r&&(t.destroy(),r===t&&E(this,hr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,hr).get(t)}getAll(){return[...E(this,hr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Pl(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Pl(t,n)):r}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hr=new WeakMap,yp),Kp=(vp=class{constructor(e={}){ie(this,Xe);ie(this,Br);ie(this,jr);ie(this,Kn);ie(this,Yn);ie(this,qr);ie(this,Zn);ie(this,Xn);Y(this,Xe,e.queryCache||new Wp),Y(this,Br,e.mutationCache||new Gp),Y(this,jr,e.defaultOptions||{}),Y(this,Kn,new Map),Y(this,Yn,new Map),Y(this,qr,0)}mount(){pi(this,qr)._++,E(this,qr)===1&&(Y(this,Zn,mi.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onFocus())})),Y(this,Xn,Jo.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onOnline())})))}unmount(){var e,t;pi(this,qr)._--,E(this,qr)===0&&((e=E(this,Zn))==null||e.call(this),Y(this,Zn,void 0),(t=E(this,Xn))==null||t.call(this),Y(this,Xn,void 0))}isFetching(e){return E(this,Xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,Br).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=E(this,Xe).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Tr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return E(this,Xe).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=E(this,Xe).get(n.queryHash),a=o==null?void 0:o.state.data,i=Dp(t,a);if(i!==void 0)return E(this,Xe).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return ut.batch(()=>E(this,Xe).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=E(this,Xe);ut.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=E(this,Xe);return ut.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=ut.batch(()=>E(this,Xe).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(At).catch(At)}invalidateQueries(e,t={}){return ut.batch(()=>(E(this,Xe).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=ut.batch(()=>E(this,Xe).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let a=o.fetch(void 0,r);return r.throwOnError||(a=a.catch(At)),o.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(At)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=E(this,Xe).build(this,t);return r.isStaleByTime(Tr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(At).catch(At)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(At).catch(At)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Jo.isOnline()?E(this,Br).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Xe)}getMutationCache(){return E(this,Br)}getDefaultOptions(){return E(this,jr)}setDefaultOptions(e){Y(this,jr,e)}setQueryDefaults(e,t){E(this,Kn).set(to(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,Kn).values()],r={};return t.forEach(n=>{ro(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){E(this,Yn).set(to(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,Yn).values()],r={};return t.forEach(n=>{ro(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,jr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Xo&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,jr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,Xe).clear(),E(this,Br).clear()}},Xe=new WeakMap,Br=new WeakMap,jr=new WeakMap,Kn=new WeakMap,Yn=new WeakMap,qr=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,vp),Kl=Ne.createContext(void 0),Yp=e=>{const t=Ne.useContext(Kl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Zp=({client:e,children:t})=>(Ne.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Kl.Provider,{value:e,children:t})),Yl=Ne.createContext(!1),Xp=()=>Ne.useContext(Yl);Yl.Provider;function Jp(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eg=Ne.createContext(Jp()),tg=()=>Ne.useContext(eg),rg=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?jl(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},ng=e=>{Ne.useEffect(()=>{e.clearReset()},[e])},og=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||jl(r,[e.error,n])),ag=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ig=(e,t)=>e.isLoading&&e.isFetching&&!t,sg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Zl=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function lg(e,t,r){var g,w,p,y;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Xp(),o=tg(),a=Yp(),i=a.defaultQueryOptions(e);(w=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||w.call(g,i);const s=a.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const l=e.subscribed!==!1;i._optimisticResults=n?"isRestoring":l?"optimistic":void 0,ag(i),rg(i,o,s),ng(o);const d=!a.getQueryCache().get(i.queryHash),[f]=Ne.useState(()=>new t(a,i)),u=f.getOptimisticResult(i),m=!n&&l;if(Ne.useSyncExternalStore(Ne.useCallback(v=>{const b=m?f.subscribe(ut.batchCalls(v)):At;return f.updateResult(),b},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),Ne.useEffect(()=>{f.setOptions(i)},[i,f]),sg(i,u))throw Zl(i,f,o);if(og({result:u,errorResetBoundary:o,throwOnError:i.throwOnError,query:s,suspense:i.suspense}))throw u.error;if((y=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||y.call(p,i,u),i.experimental_prefetchInRender&&!no.isServer()&&ig(u,n)){const v=d?Zl(i,f,o):s==null?void 0:s.promise;v==null||v.catch(At).finally(()=>{f.updateResult()})}return i.notifyOnChangeProps?u:f.trackResult(u)}function gn(e,t){return lg(e,Vp)}let cg={data:""},dg=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||cg},ug=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,fg=/\/\*[^]*?\*\/| +/g,Xl=/\n+/g,Er=(e,t)=>{let r="",n="",o="";for(let a in e){let i=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+i+";":n+=a[1]=="f"?Er(i,a):a+"{"+Er(i,a[1]=="k"?"":t)+"}":typeof i=="object"?n+=Er(i,t?t.replace(/([^,])+/g,s=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,s):s?s+" "+l:l)):a):i!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Er.p?Er.p(a,i):a+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Ir={},Jl=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Jl(e[r]);return t}return e},hg=(e,t,r,n,o)=>{let a=Jl(e),i=Ir[a]||(Ir[a]=(l=>{let d=0,f=11;for(;d<l.length;)f=101*f+l.charCodeAt(d++)>>>0;return"go"+f})(a));if(!Ir[i]){let l=a!==e?e:(d=>{let f,u,m=[{}];for(;f=ug.exec(d.replace(fg,""));)f[4]?m.shift():f[3]?(u=f[3].replace(Xl," ").trim(),m.unshift(m[0][u]=m[0][u]||{})):m[0][f[1]]=f[2].replace(Xl," ").trim();return m[0]})(e);Ir[i]=Er(o?{["@keyframes "+i]:l}:l,r?"":"."+i)}let s=r&&Ir.g;return r&&(Ir.g=Ir[i]),((l,d,f,u)=>{u?d.data=d.data.replace(u,l):d.data.indexOf(l)===-1&&(d.data=f?l+d.data:d.data+l)})(Ir[i],t,n,s),i},pg=(e,t,r)=>e.reduce((n,o,a)=>{let i=t[a];if(i&&i.call){let s=i(r),l=s&&s.props&&s.props.className||/^go/.test(s)&&s;i=l?"."+l:s&&typeof s=="object"?s.props?"":Er(s,""):s===!1?"":s}return n+o+(i??"")},"");function ta(e){let t=this||{},r=e.call?e(t.p):e;return hg(r.unshift?r.raw?pg(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,dg(t.target),t.g,t.o,t.k)}let ec,Oi,Ai;ta.bind({g:1});let mr=ta.bind({k:1});function gg(e,t,r,n){Er.p=t,ec=e,Oi=r,Ai=n}function Or(e,t){let r=this||{};return function(){let n=arguments;function o(a,i){let s=Object.assign({},a),l=s.className||o.className;r.p=Object.assign({theme:Oi&&Oi()},s),r.o=/go\d/.test(l),s.className=ta.apply(r,n)+(l?" "+l:"");let d=e;return e[0]&&(d=s.as||e,delete s.as),Ai&&d[0]&&Ai(s),ec(d,s)}return o}}var mg=e=>typeof e=="function",ra=(e,t)=>mg(e)?e(t):e,yg=(()=>{let e=0;return()=>(++e).toString()})(),tc=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),vg=20,Di="default",rc=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return rc(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+a}))}}},na=[],nc={toasts:[],pausedAt:void 0,settings:{toastLimit:vg}},ar={},oc=(e,t=Di)=>{ar[t]=rc(ar[t]||nc,e),na.forEach(([r,n])=>{r===t&&n(ar[t])})},ac=e=>Object.keys(ar).forEach(t=>oc(e,t)),bg=e=>Object.keys(ar).find(t=>ar[t].toasts.some(r=>r.id===e)),oa=(e=Di)=>t=>{oc(t,e)},wg={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Cg=(e={},t=Di)=>{let[r,n]=h.useState(ar[t]||nc),o=h.useRef(ar[t]);h.useEffect(()=>(o.current!==ar[t]&&n(ar[t]),na.push([t,n]),()=>{let i=na.findIndex(([s])=>s===t);i>-1&&na.splice(i,1)}),[t]);let a=r.toasts.map(i=>{var s,l,d;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((s=e[i.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((l=e[i.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||wg[i.type],style:{...e.style,...(d=e[i.type])==null?void 0:d.style,...i.style}}});return{...r,toasts:a}},Sg=(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)||yg()}),oo=e=>(t,r)=>{let n=Sg(t,e,r);return oa(n.toasterId||bg(n.id))({type:2,toast:n}),n.id},rt=(e,t)=>oo("blank")(e,t);rt.error=oo("error"),rt.success=oo("success"),rt.loading=oo("loading"),rt.custom=oo("custom"),rt.dismiss=(e,t)=>{let r={type:3,toastId:e};t?oa(t)(r):ac(r)},rt.dismissAll=e=>rt.dismiss(void 0,e),rt.remove=(e,t)=>{let r={type:4,toastId:e};t?oa(t)(r):ac(r)},rt.removeAll=e=>rt.remove(void 0,e),rt.promise=(e,t,r)=>{let n=rt.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let a=t.success?ra(t.success,o):void 0;return a?rt.success(a,{id:n,...r,...r==null?void 0:r.success}):rt.dismiss(n),o}).catch(o=>{let a=t.error?ra(t.error,o):void 0;a?rt.error(a,{id:n,...r,...r==null?void 0:r.error}):rt.dismiss(n)}),e};var _g=1e3,Tg=(e,t="default")=>{let{toasts:r,pausedAt:n}=Cg(e,t),o=h.useRef(new Map).current,a=h.useCallback((u,m=_g)=>{if(o.has(u))return;let g=setTimeout(()=>{o.delete(u),i({type:4,toastId:u})},m);o.set(u,g)},[]);h.useEffect(()=>{if(n)return;let u=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let w=(g.duration||0)+g.pauseDuration-(u-g.createdAt);if(w<0){g.visible&&rt.dismiss(g.id);return}return setTimeout(()=>rt.dismiss(g.id,t),w)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let i=h.useCallback(oa(t),[t]),s=h.useCallback(()=>{i({type:5,time:Date.now()})},[i]),l=h.useCallback((u,m)=>{i({type:1,toast:{id:u,height:m}})},[i]),d=h.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),f=h.useCallback((u,m)=>{let{reverseOrder:g=!1,gutter:w=8,defaultPosition:p}=m||{},y=r.filter(C=>(C.position||p)===(u.position||p)&&C.height),v=y.findIndex(C=>C.id===u.id),b=y.filter((C,S)=>S<v&&C.visible).length;return y.filter(C=>C.visible).slice(...g?[b+1]:[0,b]).reduce((C,S)=>C+(S.height||0)+w,0)},[r]);return h.useEffect(()=>{r.forEach(u=>{if(u.dismissed)a(u.id,u.removeDelay);else{let m=o.get(u.id);m&&(clearTimeout(m),o.delete(u.id))}})},[r,a]),{toasts:r,handlers:{updateHeight:l,startPause:s,endPause:d,calculateOffset:f}}},Eg=mr`
|
|
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
|
-
}`,
|
|
9
|
+
}`,Ig=mr`
|
|
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
|
-
}`,
|
|
17
|
+
}`,Og=mr`
|
|
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
|
-
}`,
|
|
25
|
+
}`,Ag=Or("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: ${
|
|
34
|
+
animation: ${Eg} 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: ${
|
|
41
|
+
animation: ${Ig} 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: ${
|
|
54
|
+
animation: ${Og} 0.15s ease-out forwards;
|
|
55
55
|
animation-delay: 180ms;
|
|
56
56
|
transform: rotate(90deg);
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,Dg=mr`
|
|
59
59
|
from {
|
|
60
60
|
transform: rotate(0deg);
|
|
61
61
|
}
|
|
62
62
|
to {
|
|
63
63
|
transform: rotate(360deg);
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,Ng=Or("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: ${
|
|
74
|
-
`,
|
|
73
|
+
animation: ${Dg} 1s linear infinite;
|
|
74
|
+
`,kg=mr`
|
|
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
|
-
}`,
|
|
82
|
+
}`,xg=mr`
|
|
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
|
-
}`,
|
|
96
|
+
}`,Lg=Or("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: ${
|
|
105
|
+
animation: ${kg} 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: ${
|
|
111
|
+
animation: ${xg} 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
|
-
`,Lg=Or("div")`
|
|
124
|
-
position: absolute;
|
|
125
123
|
`,Pg=Or("div")`
|
|
124
|
+
position: absolute;
|
|
125
|
+
`,Fg=Or("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
|
-
`,
|
|
132
|
+
`,Mg=mr`
|
|
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
|
-
}
|
|
140
|
+
}`,$g=Or("div")`
|
|
141
141
|
position: relative;
|
|
142
142
|
transform: scale(0.6);
|
|
143
143
|
opacity: 0.4;
|
|
144
144
|
min-width: 20px;
|
|
145
|
-
animation: ${
|
|
145
|
+
animation: ${Mg} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
146
146
|
forwards;
|
|
147
|
-
|
|
147
|
+
`,Bg=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?Ne.createElement($g,null,t):t:r==="blank"?null:Ne.createElement(Fg,null,Ne.createElement(Ng,{...n}),r!=="loading"&&Ne.createElement(Pg,null,r==="error"?Ne.createElement(Ag,{...n}):Ne.createElement(Lg,{...n})))},jg=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
|
-
`,
|
|
150
|
+
`,qg=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
|
-
`,
|
|
153
|
+
`,Ug="0%{opacity:0;} 100%{opacity:1;}",Vg="0%{opacity:1;} 100%{opacity:0;}",zg=Or("div")`
|
|
154
154
|
display: flex;
|
|
155
155
|
align-items: center;
|
|
156
156
|
background: #fff;
|
|
@@ -162,63 +162,63 @@ to {
|
|
|
162
162
|
pointer-events: auto;
|
|
163
163
|
padding: 8px 10px;
|
|
164
164
|
border-radius: 8px;
|
|
165
|
-
`,
|
|
165
|
+
`,Hg=Or("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
|
-
`,
|
|
172
|
+
`,Rg=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=tc()?[Ug,Vg]:[jg(r),qg(r)];return{animation:t?`${mr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${mr(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Qg=Ne.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Rg(e.position||t||"top-center",e.visible):{opacity:0},a=Ne.createElement(Bg,{toast:e}),i=Ne.createElement(Hg,{...e.ariaProps},ra(e.message,e));return Ne.createElement(zg,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:a,message:i}):Ne.createElement(Ne.Fragment,null,a,i))});gg(Ne.createElement);var Gg=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let a=Ne.useCallback(i=>{if(i){let s=()=>{let l=i.getBoundingClientRect().height;n(e,l)};s(),new MutationObserver(s).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return Ne.createElement("div",{ref:a,className:t,style:r},o)},Wg=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:tc()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Kg=ta`
|
|
173
173
|
z-index: 9999;
|
|
174
174
|
> * {
|
|
175
175
|
pointer-events: auto;
|
|
176
176
|
}
|
|
177
|
-
`,aa=16,
|
|
177
|
+
`,aa=16,Yg=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:a,containerStyle:i,containerClassName:s})=>{let{toasts:l,handlers:d}=Tg(r,a);return Ne.createElement("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:aa,left:aa,right:aa,bottom:aa,pointerEvents:"none",...i},className:s,onMouseEnter:d.startPause,onMouseLeave:d.endPause},l.map(f=>{let u=f.position||t,m=d.calculateOffset(f,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Wg(u,m);return Ne.createElement(Gg,{id:f.id,key:f.id,onHeightUpdate:d.updateHeight,className:f.visible?Kg:"",style:g},f.type==="custom"?ra(f.message,f):o?o(f):Ne.createElement(Qg,{toast:f,position:u}))}))},Ie=rt;function Zg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return h.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const ia=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ni(e){return"nodeType"in e}function Tt(e){var t,r;return e?mn(e)?e:Ni(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ki(e){const{Document:t}=Tt(e);return e instanceof t}function ao(e){return mn(e)?!1:e instanceof Tt(e).HTMLElement}function ic(e){return e instanceof Tt(e).SVGElement}function yn(e){return e?mn(e)?e.document:Ni(e)?ki(e)?e:ao(e)||ic(e)?e.ownerDocument:document:document:document}const Yt=ia?h.useLayoutEffect:h.useEffect;function sa(e){const t=h.useRef(e);return Yt(()=>{t.current=e}),h.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function Xg(){const e=h.useRef(null),t=h.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function io(e,t){t===void 0&&(t=[e]);const r=h.useRef(e);return Yt(()=>{r.current!==e&&(r.current=e)},t),r}function so(e,t){const r=h.useRef();return h.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function la(e){const t=sa(e),r=h.useRef(null),n=h.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function ca(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let xi={};function lo(e,t){return h.useMemo(()=>{if(t)return t;const r=xi[e]==null?0:xi[e]+1;return xi[e]=r,e+"-"+r},[e,t])}function sc(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,i)=>{const s=Object.entries(i);for(const[l,d]of s){const f=a[l];f!=null&&(a[l]=f+e*d)}return a},{...t})}}const vn=sc(1),co=sc(-1);function Jg(e){return"clientX"in e&&"clientY"in e}function da(e){if(!e)return!1;const{KeyboardEvent:t}=Tt(e.target);return t&&e instanceof t}function em(e){if(!e)return!1;const{TouchEvent:t}=Tt(e.target);return t&&e instanceof t}function ua(e){if(em(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 Jg(e)?{x:e.clientX,y:e.clientY}:null}const Ar=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Ar.Translate.toString(e),Ar.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),lc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function tm(e){return e.matches(lc)?e:e.querySelector(lc)}const rm={display:"none"};function nm(e){let{id:t,value:r}=e;return h.createElement("div",{id:t,style:rm},r)}function om(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function am(){const[e,t]=h.useState("");return{announce:h.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const cc=h.createContext(null);function im(e){const t=h.useContext(cc);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function sm(){const[e]=h.useState(()=>new Set),t=h.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[h.useCallback(n=>{let{type:o,event:a}=n;e.forEach(i=>{var s;return(s=i[o])==null?void 0:s.call(i,a)})},[e]),t]}const lm={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
|
-
`},lm={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 cm(e){let{announcements:t=lm,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=sm}=e;const{announce:a,announcement:i}=om(),s=lo("DndLiveRegion"),[l,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),am(h.useMemo(()=>({onDragStart(u){let{active:m}=u;a(t.onDragStart({active:m}))},onDragMove(u){let{active:m,over:g}=u;t.onDragMove&&a(t.onDragMove({active:m,over:g}))},onDragOver(u){let{active:m,over:g}=u;a(t.onDragOver({active:m,over:g}))},onDragEnd(u){let{active:m,over:g}=u;a(t.onDragEnd({active:m,over:g}))},onDragCancel(u){let{active:m,over:g}=u;a(t.onDragCancel({active:m,over:g}))}}),[a,t])),!l)return null;const f=h.createElement(h.Fragment,null,h.createElement(rm,{id:n,value:o.draggable}),h.createElement(nm,{id:s,announcement:i}));return r?Pe.createPortal(f,r):f}var nt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(nt||(nt={}));function fa(){}function Pi(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function fc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return h.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Zt=Object.freeze({x:0,y:0});function hc(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dm(e,t){const r=ua(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function pc(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function um(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function gc(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function mc(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function yc(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 fm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=yc(t,t.left,t.top),a=[];for(const i of n){const{id:s}=i,l=r.get(s);if(l){const d=hc(yc(l),o);a.push({id:s,data:{droppableContainer:i,value:d}})}}return a.sort(pc)},hm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=gc(t),a=[];for(const i of n){const{id:s}=i,l=r.get(s);if(l){const d=gc(l),f=o.reduce((m,g,w)=>m+hc(d[w],g),0),u=Number((f/4).toFixed(4));a.push({id:s,data:{droppableContainer:i,value:u}})}}return a.sort(pc)};function pm(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-n,s=a-r;if(n<o&&r<a){const l=t.width*t.height,d=e.width*e.height,f=i*s,u=f/(l+d-f);return Number(u.toFixed(4))}return 0}const gm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:i}=a,s=r.get(i);if(s){const l=pm(s,t);l>0&&o.push({id:i,data:{droppableContainer:a,value:l}})}}return o.sort(um)};function mm(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function vc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zt}function ym(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((i,s)=>({...i,top:i.top+e*s.y,bottom:i.bottom+e*s.y,left:i.left+e*s.x,right:i.right+e*s.x}),{...r})}}const vm=ym(1);function bc(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function bm(e,t,r){const n=bc(t);if(!n)return e;const{scaleX:o,scaleY:a,x:i,y:s}=n,l=e.left-i-(1-o)*parseFloat(r),d=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=o?e.width/o:e.width,u=a?e.height/a:e.height;return{width:f,height:u,top:d,right:l+f,bottom:d+u,left:l}}const wm={ignoreTransform:!1};function bn(e,t){t===void 0&&(t=wm);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:f}=Tt(e).getComputedStyle(e);d&&(r=bm(r,d,f))}const{top:n,left:o,width:a,height:i,bottom:s,right:l}=r;return{top:n,left:o,width:a,height:i,bottom:s,right:l}}function wc(e){return bn(e,{ignoreTransform:!0})}function Cm(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Sm(e,t){return t===void 0&&(t=Tt(e).getComputedStyle(e)),t.position==="fixed"}function _m(e,t){t===void 0&&(t=Tt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function ha(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(xi(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!ao(o)||lc(o)||r.includes(o))return r;const a=Tt(e).getComputedStyle(o);return o!==e&&_m(o,a)&&r.push(o),Sm(o,a)?r:n(o.parentNode)}return e?n(e):r}function Cc(e){const[t]=ha(e,1);return t??null}function Fi(e){return!ia||!e?null:mn(e)?e:ki(e)?xi(e)||e===yn(e).scrollingElement?window:ao(e)?e:null:null}function Sc(e){return mn(e)?e.scrollX:e.scrollLeft}function _c(e){return mn(e)?e.scrollY:e.scrollTop}function Mi(e){return{x:Sc(e),y:_c(e)}}var ot;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ot||(ot={}));function Tc(e){return!ia||!e?!1:e===document.scrollingElement}function Ec(e){const t={x:0,y:0},r=Tc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:i,isRight:s,maxScroll:n,minScroll:t}}const Tm={x:.2,y:.2};function Em(e,t,r,n,o){let{top:a,left:i,right:s,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Tm);const{isTop:d,isBottom:f,isLeft:u,isRight:m}=Ec(e),g={x:0,y:0},w={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!d&&a<=t.top+p.height?(g.y=ot.Backward,w.y=n*Math.abs((t.top+p.height-a)/p.height)):!f&&l>=t.bottom-p.height&&(g.y=ot.Forward,w.y=n*Math.abs((t.bottom-p.height-l)/p.height)),!m&&s>=t.right-p.width?(g.x=ot.Forward,w.x=n*Math.abs((t.right-p.width-s)/p.width)):!u&&i<=t.left+p.width&&(g.x=ot.Backward,w.x=n*Math.abs((t.left+p.width-i)/p.width)),{direction:g,speed:w}}function Im(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:i}=window;return{top:0,left:0,right:a,bottom:i,width:a,height:i}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Ic(e){return e.reduce((t,r)=>vn(t,Mi(r)),Zt)}function Om(e){return e.reduce((t,r)=>t+Sc(r),0)}function Am(e){return e.reduce((t,r)=>t+_c(r),0)}function Oc(e,t){if(t===void 0&&(t=bn),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);Cc(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Dm=[["x",["left","right"],Om],["y",["top","bottom"],Am]];class $i{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ha(r),o=Ic(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,i,s]of Dm)for(const l of i)Object.defineProperty(this,l,{get:()=>{const d=s(n),f=o[a]-d;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class uo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Nm(e){const{EventTarget:t}=Tt(e);return e instanceof t?e:yn(e)}function Bi(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ut;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ut||(Ut={}));function Ac(e){e.preventDefault()}function km(e){e.stopPropagation()}var _e;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(_e||(_e={}));const Dc={start:[_e.Space,_e.Enter],cancel:[_e.Esc],end:[_e.Space,_e.Enter,_e.Tab]},xm=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case _e.Right:return{...r,x:r.x+25};case _e.Left:return{...r,x:r.x-25};case _e.Down:return{...r,y:r.y+25};case _e.Up:return{...r,y:r.y-25}}};class ji{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new uo(yn(r)),this.windowListeners=new uo(Tt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ut.Resize,this.handleCancel),this.windowListeners.add(Ut.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ut.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Oc(n),r(Zt)}handleKeyDown(t){if(da(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=Dc,coordinateGetter:i=xm,scrollBehavior:s="smooth"}=o,{code:l}=t;if(a.end.includes(l)){this.handleEnd(t);return}if(a.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=n.current,f=d?{x:d.left,y:d.top}:Zt;this.referenceCoordinates||(this.referenceCoordinates=f);const u=i(t,{active:r,context:n.current,currentCoordinates:f});if(u){const m=co(u,f),g={x:0,y:0},{scrollableAncestors:w}=n.current;for(const p of w){const y=t.code,{isTop:v,isRight:b,isLeft:C,isBottom:S,maxScroll:T,minScroll:I}=Ec(p),k=Im(p),x={x:Math.min(y===_e.Right?k.right-k.width/2:k.right,Math.max(y===_e.Right?k.left:k.left+k.width/2,u.x)),y:Math.min(y===_e.Down?k.bottom-k.height/2:k.bottom,Math.max(y===_e.Down?k.top:k.top+k.height/2,u.y))},$=y===_e.Right&&!b||y===_e.Left&&!C,j=y===_e.Down&&!S||y===_e.Up&&!v;if($&&x.x!==u.x){const N=p.scrollLeft+m.x,L=y===_e.Right&&N<=T.x||y===_e.Left&&N>=I.x;if(L&&!m.y){p.scrollTo({left:N,behavior:s});return}L?g.x=p.scrollLeft-N:g.x=y===_e.Right?p.scrollLeft-T.x:p.scrollLeft-I.x,g.x&&p.scrollBy({left:-g.x,behavior:s});break}else if(j&&x.y!==u.y){const N=p.scrollTop+m.y,L=y===_e.Down&&N<=T.y||y===_e.Up&&N>=I.y;if(L&&!m.x){p.scrollTo({top:N,behavior:s});return}L?g.y=p.scrollTop-N:g.y=y===_e.Down?p.scrollTop-T.y:p.scrollTop-I.y,g.y&&p.scrollBy({top:-g.y,behavior:s});break}}this.handleMove(t,vn(co(u,this.referenceCoordinates),g))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ji.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Dc,onActivation:o}=t,{active:a}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Nc(e){return!!(e&&"distance"in e)}function kc(e){return!!(e&&"delay"in e)}class qi{constructor(t,r,n){var o;n===void 0&&(n=Nm(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:i}=a;this.props=t,this.events=r,this.document=yn(i),this.documentListeners=new uo(this.document),this.listeners=new uo(n),this.windowListeners=new uo(Tt(i)),this.initialCoordinates=(o=ua(a))!=null?o:Zt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ut.Resize,this.handleCancel),this.windowListeners.add(Ut.DragStart,Ac),this.windowListeners.add(Ut.VisibilityChange,this.handleCancel),this.windowListeners.add(Ut.ContextMenu,Ac),this.documentListeners.add(Ut.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(kc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Nc(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ut.Click,km,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ut.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:i,options:{activationConstraint:s}}=a;if(!o)return;const l=(r=ua(t))!=null?r:Zt,d=co(o,l);if(!n&&s){if(Nc(s)){if(s.tolerance!=null&&Bi(d,s.tolerance))return this.handleCancel();if(Bi(d,s.distance))return this.handleStart()}if(kc(s)&&Bi(d,s.tolerance))return this.handleCancel();this.handlePending(s,d);return}t.cancelable&&t.preventDefault(),i(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===_e.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Lm={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class pa extends qi{constructor(t){const{event:r}=t,n=yn(r.target);super(t,Lm,n)}}pa.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Pm={move:{name:"mousemove"},end:{name:"mouseup"}};var Ui;(function(e){e[e.RightClick=2]="RightClick"})(Ui||(Ui={}));class Fm extends qi{constructor(t){super(t,Pm,yn(t.event.target))}}Fm.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Ui.RightClick?!1:(n==null||n({event:r}),!0)}}];const zi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Mm extends qi{constructor(t){super(t,zi)}static setup(){return window.addEventListener(zi.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(zi.move.name,t)};function t(){}}}Mm.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var fo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(fo||(fo={}));var ga;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ga||(ga={}));function $m(e){let{acceleration:t,activator:r=fo.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:i=5,order:s=ga.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:f,delta:u,threshold:m}=e;const g=jm({delta:u,disabled:!a}),[w,p]=Zg(),y=h.useRef({x:0,y:0}),v=h.useRef({x:0,y:0}),b=h.useMemo(()=>{switch(r){case fo.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case fo.DraggableRect:return o}},[r,o,l]),C=h.useRef(null),S=h.useCallback(()=>{const I=C.current;if(!I)return;const k=y.current.x*v.current.x,x=y.current.y*v.current.y;I.scrollBy(k,x)},[]),T=h.useMemo(()=>s===ga.TreeOrder?[...d].reverse():d,[s,d]);h.useEffect(()=>{if(!a||!d.length||!b){p();return}for(const I of T){if((n==null?void 0:n(I))===!1)continue;const k=d.indexOf(I),x=f[k];if(!x)continue;const{direction:$,speed:j}=Em(I,x,b,t,m);for(const N of["x","y"])g[N][$[N]]||(j[N]=0,$[N]=0);if(j.x>0||j.y>0){p(),C.current=I,w(S,i),y.current=j,v.current=$;return}}y.current={x:0,y:0},v.current={x:0,y:0},p()},[t,S,n,p,a,i,JSON.stringify(b),JSON.stringify(g),w,d,T,f,JSON.stringify(m)])}const Bm={x:{[ot.Backward]:!1,[ot.Forward]:!1},y:{[ot.Backward]:!1,[ot.Forward]:!1}};function jm(e){let{delta:t,disabled:r}=e;const n=ca(t);return so(o=>{if(r||!n||!o)return Bm;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ot.Backward]:o.x[ot.Backward]||a.x===-1,[ot.Forward]:o.x[ot.Forward]||a.x===1},y:{[ot.Backward]:o.y[ot.Backward]||a.y===-1,[ot.Forward]:o.y[ot.Forward]||a.y===1}}},[r,t,n])}function qm(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return so(o=>{var a;return t==null?null:(a=n??o)!=null?a:null},[n,t])}function Um(e,t){return h.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...a]},[]),[e,t])}var ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ho||(ho={}));var Vi;(function(e){e.Optimized="optimized"})(Vi||(Vi={}));const xc=new Map;function zm(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,i]=h.useState(null),{frequency:s,measure:l,strategy:d}=o,f=h.useRef(e),u=y(),m=io(u),g=h.useCallback(function(v){v===void 0&&(v=[]),!m.current&&i(b=>b===null?v:b.concat(v.filter(C=>!b.includes(C))))},[m]),w=h.useRef(null),p=so(v=>{if(u&&!r)return xc;if(!v||v===xc||f.current!==e||a!=null){const b=new Map;for(let C of e){if(!C)continue;if(a&&a.length>0&&!a.includes(C.id)&&C.rect.current){b.set(C.id,C.rect.current);continue}const S=C.node.current,T=S?new $i(l(S),S):null;C.rect.current=T,T&&b.set(C.id,T)}return b}return v},[e,a,r,u,l]);return h.useEffect(()=>{f.current=e},[e]),h.useEffect(()=>{u||g()},[r,u]),h.useEffect(()=>{a&&a.length>0&&i(null)},[JSON.stringify(a)]),h.useEffect(()=>{u||typeof s!="number"||w.current!==null||(w.current=setTimeout(()=>{g(),w.current=null},s))},[s,u,g,...n]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:a!=null};function y(){switch(d){case ho.Always:return!1;case ho.BeforeDragging:return r;default:return!r}}}function Hi(e,t){return so(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Vm(e,t){return Hi(e,t)}function Hm(e){let{callback:t,disabled:r}=e;const n=sa(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ma(e){let{callback:t,disabled:r}=e;const n=sa(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Rm(e){return new $i(bn(e),e)}function Lc(e,t,r){t===void 0&&(t=Rm);const[n,o]=h.useState(null);function a(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??r)!=null?d:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const i=Hm({callback(l){if(e)for(const d of l){const{type:f,target:u}=d;if(f==="childList"&&u instanceof HTMLElement&&u.contains(e)){a();break}}}}),s=ma({callback:a});return Yt(()=>{a(),e?(s==null||s.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),i==null||i.disconnect())},[e]),n}function Qm(e){const t=Hi(e);return vc(e,t)}const Pc=[];function Gm(e){const t=h.useRef(e),r=so(n=>e?n&&n!==Pc&&e&&t.current&&e.parentNode===t.current.parentNode?n:ha(e):Pc,[e]);return h.useEffect(()=>{t.current=e},[e]),r}function Wm(e){const[t,r]=h.useState(null),n=h.useRef(e),o=h.useCallback(a=>{const i=Fi(a.target);i&&r(s=>s?(s.set(i,Mi(i)),new Map(s)):null)},[]);return h.useEffect(()=>{const a=n.current;if(e!==a){i(a);const s=e.map(l=>{const d=Fi(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Mi(d)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{i(e),i(a)};function i(s){s.forEach(l=>{const d=Fi(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,i)=>vn(a,i),Zt):Ic(e):Zt,[e,t])}function Fc(e,t){t===void 0&&(t=[]);const r=h.useRef(null);return h.useEffect(()=>{r.current=null},t),h.useEffect(()=>{const n=e!==Zt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?co(e,r.current):Zt}function Km(e){h.useEffect(()=>{if(!ia)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Ym(e,t){return h.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=i=>{a(i,t)},r},{}),[e,t])}function Mc(e){return h.useMemo(()=>e?Cm(e):null,[e])}const $c=[];function Zm(e,t){t===void 0&&(t=bn);const[r]=e,n=Mc(r?Tt(r):null),[o,a]=h.useState($c);function i(){a(()=>e.length?e.map(l=>Tc(l)?n:new $i(t(l),l)):$c)}const s=ma({callback:i});return Yt(()=>{s==null||s.disconnect(),i(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),o}function Bc(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ao(t)?t:e}function Xm(e){let{measure:t}=e;const[r,n]=h.useState(null),o=h.useCallback(d=>{for(const{target:f}of d)if(ao(f)){n(u=>{const m=t(f);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),a=ma({callback:o}),i=h.useCallback(d=>{const f=Bc(d);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,l]=la(i);return h.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const Jm=[{sensor:pa,options:{}},{sensor:ji,options:{}}],ey={current:{}},ya={draggable:{measure:wc},droppable:{measure:wc,strategy:ho.WhileDragging,frequency:Vi.Optimized},dragOverlay:{measure:bn}};class po extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const ty={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new po,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fa},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ya,measureDroppableContainers:fa,windowRect:null,measuringScheduled:!1},jc={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fa,draggableNodes:new Map,over:null,measureDroppableContainers:fa},go=h.createContext(jc),qc=h.createContext(ty);function ry(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new po}}}function ny(e,t){switch(t.type){case nt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case nt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case nt.DragEnd:case nt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case nt.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new po(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case nt.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new po(e.droppable.containers);return i.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case nt.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new po(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function oy(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=h.useContext(go),a=ca(n),i=ca(r==null?void 0:r.id);return h.useEffect(()=>{if(!t&&!n&&a&&i!=null){if(!da(a)||document.activeElement===a.target)return;const s=o.get(i);if(!s)return;const{activatorNode:l,node:d}=s;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[l.current,d.current]){if(!f)continue;const u=em(f);if(u){u.focus();break}}})}},[n,t,o,i,a]),null}function Uc(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function ay(e){return h.useMemo(()=>({draggable:{...ya.draggable,...e==null?void 0:e.draggable},droppable:{...ya.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ya.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function iy(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=h.useRef(!1),{x:i,y:s}=typeof o=="boolean"?{x:o,y:o}:o;Yt(()=>{if(!i&&!s||!t){a.current=!1;return}if(a.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const f=r(d),u=vc(f,n);if(i||(u.x=0),s||(u.y=0),a.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const m=Cc(d);m&&m.scrollBy({top:u.y,left:u.x})}},[t,i,s,n,r])}const va=h.createContext({...Zt,scaleX:1,scaleY:1});var Dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Dr||(Dr={}));const zc=h.memo(function(t){var r,n,o,a;let{id:i,accessibility:s,autoScroll:l=!0,children:d,sensors:f=Jm,collisionDetection:u=gm,measuring:m,modifiers:g,...w}=t;const p=h.useReducer(ny,void 0,ry),[y,v]=p,[b,C]=im(),[S,T]=h.useState(Dr.Uninitialized),I=S===Dr.Initialized,{draggable:{active:k,nodes:x,translate:$},droppable:{containers:j}}=y,N=k!=null?x.get(k):null,L=h.useRef({initial:null,translated:null}),B=h.useMemo(()=>{var ct;return k!=null?{id:k,data:(ct=N==null?void 0:N.data)!=null?ct:ey,rect:L}:null},[k,N]),P=h.useRef(null),[F,V]=h.useState(null),[X,ve]=h.useState(null),Ee=io(w,Object.values(w)),Ce=lo("DndDescribedBy",i),ue=h.useMemo(()=>j.getEnabled(),[j]),Q=ay(m),{droppableRects:ne,measureDroppableContainers:te,measuringScheduled:U}=zm(ue,{dragging:I,dependencies:[$.x,$.y],config:Q.droppable}),H=qm(x,k),ae=h.useMemo(()=>X?ua(X):null,[X]),fe=pn(),J=Vm(H,Q.draggable.measure);iy({activeNode:k!=null?x.get(k):null,config:fe.layoutShiftCompensation,initialRect:J,measure:Q.draggable.measure});const oe=Lc(H,Q.draggable.measure,J),Me=Lc(H?H.parentElement:null),Oe=h.useRef({activatorEvent:null,active:null,activeNode:H,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ze=j.getNodeFor((r=Oe.current.over)==null?void 0:r.id),We=Xm({measure:Q.dragOverlay.measure}),Ve=(n=We.nodeRef.current)!=null?n:H,re=I?(o=We.rect)!=null?o:oe:null,Ke=!!(We.nodeRef.current&&We.rect),Re=Qm(Ke?null:oe),He=Mc(Ve?Tt(Ve):null),et=Gm(I?ze??H:null),Gt=Zm(et),It=Uc(g,{transform:{x:$.x-Re.x,y:$.y-Re.y,scaleX:1,scaleY:1},activatorEvent:X,active:B,activeNodeRect:oe,containerNodeRect:Me,draggingNodeRect:re,over:Oe.current.over,overlayNodeRect:We.rect,scrollableAncestors:et,scrollableAncestorRects:Gt,windowRect:He}),K=ae?vn(ae,$):null,ge=Wm(et),we=Fc(ge),Wt=Fc(ge,[oe]),_=vn(It,we),A=re?vm(re,It):null,D=B&&A?u({active:B,collisionRect:A,droppableRects:ne,droppableContainers:ue,pointerCoordinates:K}):null,z=mc(D,"id"),[q,G]=h.useState(null),R=Ke?It:vn(It,Wt),ee=mm(R,(a=q==null?void 0:q.rect)!=null?a:null,oe),ye=h.useRef(null),Ye=h.useCallback((ct,_t)=>{let{sensor:Ot,options:or}=_t;if(P.current==null)return;const Kt=x.get(P.current);if(!Kt)return;const qt=ct.nativeEvent,pr=new Ot({active:P.current,activeNode:Kt,event:qt,options:or,context:Oe,onAbort(pt){if(!x.get(pt))return;const{onDragAbort:gr}=Ee.current,Sr={id:pt};gr==null||gr(Sr),b({type:"onDragAbort",event:Sr})},onPending(pt,Ur,gr,Sr){if(!x.get(pt))return;const{onDragPending:Wo}=Ee.current,zr={id:pt,constraint:Ur,initialCoordinates:gr,offset:Sr};Wo==null||Wo(zr),b({type:"onDragPending",event:zr})},onStart(pt){const Ur=P.current;if(Ur==null)return;const gr=x.get(Ur);if(!gr)return;const{onDragStart:Sr}=Ee.current,Go={activatorEvent:qt,active:{id:Ur,data:gr.data,rect:L}};Pe.unstable_batchedUpdates(()=>{Sr==null||Sr(Go),T(Dr.Initializing),v({type:nt.DragStart,initialCoordinates:pt,active:Ur}),b({type:"onDragStart",event:Go}),V(ye.current),ve(qt)})},onMove(pt){v({type:nt.DragMove,coordinates:pt})},onEnd:Jn(nt.DragEnd),onCancel:Jn(nt.DragCancel)});ye.current=pr;function Jn(pt){return async function(){const{active:gr,collisions:Sr,over:Go,scrollAdjustedTranslate:Wo}=Oe.current;let zr=null;if(gr&&Wo){const{cancelDrop:Ko}=Ee.current;zr={activatorEvent:qt,active:gr,collisions:Sr,delta:Wo,over:Go},pt===nt.DragEnd&&typeof Ko=="function"&&await Promise.resolve(Ko(zr))&&(pt=nt.DragCancel)}P.current=null,Pe.unstable_batchedUpdates(()=>{v({type:pt}),T(Dr.Uninitialized),G(null),V(null),ve(null),ye.current=null;const Ko=pt===nt.DragEnd?"onDragEnd":"onDragCancel";if(zr){const Il=Ee.current[Ko];Il==null||Il(zr),b({type:Ko,event:zr})}})}}},[x]),Lt=h.useCallback((ct,_t)=>(Ot,or)=>{const Kt=Ot.nativeEvent,qt=x.get(or);if(P.current!==null||!qt||Kt.dndKit||Kt.defaultPrevented)return;const pr={active:qt};ct(Ot,_t.options,pr)===!0&&(Kt.dndKit={capturedBy:_t.sensor},P.current=or,Ye(Ot,_t))},[x,Ye]),Pt=Um(f,Lt);Km(f),Yt(()=>{oe&&S===Dr.Initializing&&T(Dr.Initialized)},[oe,S]),h.useEffect(()=>{const{onDragMove:ct}=Ee.current,{active:_t,activatorEvent:Ot,collisions:or,over:Kt}=Oe.current;if(!_t||!Ot)return;const qt={active:_t,activatorEvent:Ot,collisions:or,delta:{x:_.x,y:_.y},over:Kt};Pe.unstable_batchedUpdates(()=>{ct==null||ct(qt),b({type:"onDragMove",event:qt})})},[_.x,_.y]),h.useEffect(()=>{const{active:ct,activatorEvent:_t,collisions:Ot,droppableContainers:or,scrollAdjustedTranslate:Kt}=Oe.current;if(!ct||P.current==null||!_t||!Kt)return;const{onDragOver:qt}=Ee.current,pr=or.get(z),Jn=pr&&pr.rect.current?{id:pr.id,rect:pr.rect.current,data:pr.data,disabled:pr.disabled}:null,pt={active:ct,activatorEvent:_t,collisions:Ot,delta:{x:Kt.x,y:Kt.y},over:Jn};Pe.unstable_batchedUpdates(()=>{G(Jn),qt==null||qt(pt),b({type:"onDragOver",event:pt})})},[z]),Yt(()=>{Oe.current={activatorEvent:X,active:B,activeNode:H,collisionRect:A,collisions:D,droppableRects:ne,draggableNodes:x,draggingNode:Ve,draggingNodeRect:re,droppableContainers:j,over:q,scrollableAncestors:et,scrollAdjustedTranslate:_},L.current={initial:re,translated:A}},[B,H,D,A,x,Ve,re,ne,j,q,et,_]),$m({...fe,delta:$,draggingRect:A,pointerCoordinates:K,scrollableAncestors:et,scrollableAncestorRects:Gt});const Cr=h.useMemo(()=>({active:B,activeNode:H,activeNodeRect:oe,activatorEvent:X,collisions:D,containerNodeRect:Me,dragOverlay:We,draggableNodes:x,droppableContainers:j,droppableRects:ne,over:q,measureDroppableContainers:te,scrollableAncestors:et,scrollableAncestorRects:Gt,measuringConfiguration:Q,measuringScheduled:U,windowRect:He}),[B,H,oe,X,D,Me,We,x,j,ne,q,te,et,Gt,Q,U,He]),Qo=h.useMemo(()=>({activatorEvent:X,activators:Pt,active:B,activeNodeRect:oe,ariaDescribedById:{draggable:Ce},dispatch:v,draggableNodes:x,over:q,measureDroppableContainers:te}),[X,Pt,B,oe,v,Ce,x,q,te]);return h.createElement(uc.Provider,{value:C},h.createElement(go.Provider,{value:Qo},h.createElement(qc.Provider,{value:Cr},h.createElement(va.Provider,{value:ee},d)),h.createElement(oy,{disabled:(s==null?void 0:s.restoreFocus)===!1})),h.createElement(cm,{...s,hiddenTextDescribedById:Ce}));function pn(){const ct=(F==null?void 0:F.autoScrollEnabled)===!1,_t=typeof l=="object"?l.enabled===!1:l===!1,Ot=I&&!ct&&!_t;return typeof l=="object"?{...l,enabled:Ot}:{enabled:Ot}}}),sy=h.createContext(null),Vc="button",ly="Draggable";function Hc(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=lo(ly),{activators:i,activatorEvent:s,active:l,activeNodeRect:d,ariaDescribedById:f,draggableNodes:u,over:m}=h.useContext(go),{role:g=Vc,roleDescription:w="draggable",tabIndex:p=0}=o??{},y=(l==null?void 0:l.id)===t,v=h.useContext(y?va:sy),[b,C]=la(),[S,T]=la(),I=Ym(i,t),k=io(r);Yt(()=>(u.set(t,{id:t,key:a,node:b,activatorNode:S,data:k}),()=>{const $=u.get(t);$&&$.key===a&&u.delete(t)}),[u,t]);const x=h.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":n,"aria-pressed":y&&g===Vc?!0:void 0,"aria-roledescription":w,"aria-describedby":f.draggable}),[n,g,p,y,w,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:d,attributes:x,isDragging:y,listeners:n?void 0:I,node:b,over:m,setNodeRef:C,setActivatorNodeRef:T,transform:v}}function Rc(){return h.useContext(qc)}const cy="Droppable",dy={timeout:25};function uy(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=lo(cy),{active:i,dispatch:s,over:l,measureDroppableContainers:d}=h.useContext(go),f=h.useRef({disabled:r}),u=h.useRef(!1),m=h.useRef(null),g=h.useRef(null),{disabled:w,updateMeasurementsFor:p,timeout:y}={...dy,...o},v=io(p??n),b=h.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),g.current=null},y)},[y]),C=ma({callback:b,disabled:w||!i}),S=h.useCallback((x,$)=>{C&&($&&(C.unobserve($),u.current=!1),x&&C.observe(x))},[C]),[T,I]=la(S),k=io(t);return h.useEffect(()=>{!C||!T.current||(C.disconnect(),u.current=!1,C.observe(T.current))},[T,C]),h.useEffect(()=>(s({type:nt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:T,rect:m,data:k}}),()=>s({type:nt.UnregisterDroppable,key:a,id:n})),[n]),h.useEffect(()=>{r!==f.current.disabled&&(s({type:nt.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:i,rect:m,isOver:(l==null?void 0:l.id)===n,node:T,over:l,setNodeRef:I}}function fy(e){let{animation:t,children:r}=e;const[n,o]=h.useState(null),[a,i]=h.useState(null),s=ca(r);return!r&&!n&&s&&o(s),Yt(()=>{if(!a)return;const l=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(l==null||d==null){o(null);return}Promise.resolve(t(d,a)).then(()=>{o(null)})},[t,n,a]),h.createElement(h.Fragment,null,r,n?h.cloneElement(n,{ref:i}):null)}const hy={x:0,y:0,scaleX:1,scaleY:1};function py(e){let{children:t}=e;return h.createElement(go.Provider,{value:jc},h.createElement(va.Provider,{value:hy},t))}const gy={position:"fixed",touchAction:"none"},my=e=>da(e)?"transform 250ms ease":void 0,yy=h.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:a,className:i,rect:s,style:l,transform:d,transition:f=my}=e;if(!s)return null;const u=o?d:{...d,scaleX:1,scaleY:1},m={...gy,width:s.width,height:s.height,top:s.top,left:s.left,transform:Ar.Transform.toString(u),transformOrigin:o&&n?dm(n,s):void 0,transition:typeof f=="function"?f(n):f,...l};return h.createElement(r,{className:i,style:m,ref:t},a)}),vy={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Ar.Transform.toString(t)},{transform:Ar.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:a,className:i}=e;if(a!=null&&a.active)for(const[s,l]of Object.entries(a.active))l!==void 0&&(o[s]=r.node.style.getPropertyValue(s),r.node.style.setProperty(s,l));if(a!=null&&a.dragOverlay)for(const[s,l]of Object.entries(a.dragOverlay))l!==void 0&&n.node.style.setProperty(s,l);return i!=null&&i.active&&r.node.classList.add(i.active),i!=null&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[l,d]of Object.entries(o))r.node.style.setProperty(l,d);i!=null&&i.active&&r.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function by(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return sa((a,i)=>{if(t===null)return;const s=r.get(a);if(!s)return;const l=s.node.current;if(!l)return;const d=Bc(i);if(!d)return;const{transform:f}=Tt(i).getComputedStyle(i),u=bc(f);if(!u)return;const m=typeof t=="function"?t:wy(t);return Oc(l,o.draggable.measure),m({active:{id:a,data:s.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:u})})}function wy(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...vy,...e};return a=>{let{active:i,dragOverlay:s,transform:l,...d}=a;if(!t)return;const f={x:s.rect.left-i.rect.left,y:s.rect.top-i.rect.top},u={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/s.rect.height:1},m={x:l.x-f.x,y:l.y-f.y,...u},g=o({...d,active:i,dragOverlay:s,transform:{initial:l,final:m}}),[w]=g,p=g[g.length-1];if(JSON.stringify(w)===JSON.stringify(p))return;const y=n==null?void 0:n({active:i,dragOverlay:s,...d}),v=s.node.animate(g,{duration:t,easing:r,fill:"forwards"});return new Promise(b=>{v.onfinish=()=>{y==null||y(),b()}})}}let Qc=0;function Cy(e){return h.useMemo(()=>{if(e!=null)return Qc++,Qc},[e])}const Sy=h.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:a,modifiers:i,wrapperElement:s="div",className:l,zIndex:d=999}=e;const{activatorEvent:f,active:u,activeNodeRect:m,containerNodeRect:g,draggableNodes:w,droppableContainers:p,dragOverlay:y,over:v,measuringConfiguration:b,scrollableAncestors:C,scrollableAncestorRects:S,windowRect:T}=Rc(),I=h.useContext(va),k=Cy(u==null?void 0:u.id),x=Uc(i,{activatorEvent:f,active:u,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:y.rect,over:v,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:S,transform:I,windowRect:T}),$=Hi(m),j=by({config:n,draggableNodes:w,droppableContainers:p,measuringConfiguration:b}),N=$?y.setRef:void 0;return h.createElement(py,null,h.createElement(fy,{animation:j},u&&k?h.createElement(yy,{key:k,id:u.id,ref:N,as:s,activatorEvent:f,adjustScale:t,className:l,transition:a,rect:$,style:{zIndex:d,...o},transform:x},r):null))});/**
|
|
181
|
+
`},cm={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 dm(e){let{announcements:t=cm,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=lm}=e;const{announce:a,announcement:i}=am(),s=lo("DndLiveRegion"),[l,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),im(h.useMemo(()=>({onDragStart(u){let{active:m}=u;a(t.onDragStart({active:m}))},onDragMove(u){let{active:m,over:g}=u;t.onDragMove&&a(t.onDragMove({active:m,over:g}))},onDragOver(u){let{active:m,over:g}=u;a(t.onDragOver({active:m,over:g}))},onDragEnd(u){let{active:m,over:g}=u;a(t.onDragEnd({active:m,over:g}))},onDragCancel(u){let{active:m,over:g}=u;a(t.onDragCancel({active:m,over:g}))}}),[a,t])),!l)return null;const f=h.createElement(h.Fragment,null,h.createElement(nm,{id:n,value:o.draggable}),h.createElement(om,{id:s,announcement:i}));return r?Pe.createPortal(f,r):f}var nt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(nt||(nt={}));function fa(){}function Li(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function dc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return h.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Zt=Object.freeze({x:0,y:0});function uc(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function um(e,t){const r=ua(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function fc(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function fm(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function hc(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function pc(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function gc(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 hm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=gc(t,t.left,t.top),a=[];for(const i of n){const{id:s}=i,l=r.get(s);if(l){const d=uc(gc(l),o);a.push({id:s,data:{droppableContainer:i,value:d}})}}return a.sort(fc)},pm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=hc(t),a=[];for(const i of n){const{id:s}=i,l=r.get(s);if(l){const d=hc(l),f=o.reduce((m,g,w)=>m+uc(d[w],g),0),u=Number((f/4).toFixed(4));a.push({id:s,data:{droppableContainer:i,value:u}})}}return a.sort(fc)};function gm(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-n,s=a-r;if(n<o&&r<a){const l=t.width*t.height,d=e.width*e.height,f=i*s,u=f/(l+d-f);return Number(u.toFixed(4))}return 0}const mm=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:i}=a,s=r.get(i);if(s){const l=gm(s,t);l>0&&o.push({id:i,data:{droppableContainer:a,value:l}})}}return o.sort(fm)};function ym(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function mc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zt}function vm(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((i,s)=>({...i,top:i.top+e*s.y,bottom:i.bottom+e*s.y,left:i.left+e*s.x,right:i.right+e*s.x}),{...r})}}const bm=vm(1);function yc(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 wm(e,t,r){const n=yc(t);if(!n)return e;const{scaleX:o,scaleY:a,x:i,y:s}=n,l=e.left-i-(1-o)*parseFloat(r),d=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=o?e.width/o:e.width,u=a?e.height/a:e.height;return{width:f,height:u,top:d,right:l+f,bottom:d+u,left:l}}const Cm={ignoreTransform:!1};function bn(e,t){t===void 0&&(t=Cm);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:f}=Tt(e).getComputedStyle(e);d&&(r=wm(r,d,f))}const{top:n,left:o,width:a,height:i,bottom:s,right:l}=r;return{top:n,left:o,width:a,height:i,bottom:s,right:l}}function vc(e){return bn(e,{ignoreTransform:!0})}function Sm(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function _m(e,t){return t===void 0&&(t=Tt(e).getComputedStyle(e)),t.position==="fixed"}function Tm(e,t){t===void 0&&(t=Tt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function ha(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(ki(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!ao(o)||ic(o)||r.includes(o))return r;const a=Tt(e).getComputedStyle(o);return o!==e&&Tm(o,a)&&r.push(o),_m(o,a)?r:n(o.parentNode)}return e?n(e):r}function bc(e){const[t]=ha(e,1);return t??null}function Pi(e){return!ia||!e?null:mn(e)?e:Ni(e)?ki(e)||e===yn(e).scrollingElement?window:ao(e)?e:null:null}function wc(e){return mn(e)?e.scrollX:e.scrollLeft}function Cc(e){return mn(e)?e.scrollY:e.scrollTop}function Fi(e){return{x:wc(e),y:Cc(e)}}var ot;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ot||(ot={}));function Sc(e){return!ia||!e?!1:e===document.scrollingElement}function _c(e){const t={x:0,y:0},r=Sc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:i,isRight:s,maxScroll:n,minScroll:t}}const Em={x:.2,y:.2};function Im(e,t,r,n,o){let{top:a,left:i,right:s,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Em);const{isTop:d,isBottom:f,isLeft:u,isRight:m}=_c(e),g={x:0,y:0},w={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!d&&a<=t.top+p.height?(g.y=ot.Backward,w.y=n*Math.abs((t.top+p.height-a)/p.height)):!f&&l>=t.bottom-p.height&&(g.y=ot.Forward,w.y=n*Math.abs((t.bottom-p.height-l)/p.height)),!m&&s>=t.right-p.width?(g.x=ot.Forward,w.x=n*Math.abs((t.right-p.width-s)/p.width)):!u&&i<=t.left+p.width&&(g.x=ot.Backward,w.x=n*Math.abs((t.left+p.width-i)/p.width)),{direction:g,speed:w}}function Om(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:i}=window;return{top:0,left:0,right:a,bottom:i,width:a,height:i}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Tc(e){return e.reduce((t,r)=>vn(t,Fi(r)),Zt)}function Am(e){return e.reduce((t,r)=>t+wc(r),0)}function Dm(e){return e.reduce((t,r)=>t+Cc(r),0)}function Ec(e,t){if(t===void 0&&(t=bn),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);bc(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Nm=[["x",["left","right"],Am],["y",["top","bottom"],Dm]];class Mi{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ha(r),o=Tc(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,i,s]of Nm)for(const l of i)Object.defineProperty(this,l,{get:()=>{const d=s(n),f=o[a]-d;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class uo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function km(e){const{EventTarget:t}=Tt(e);return e instanceof t?e:yn(e)}function $i(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ut;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ut||(Ut={}));function Ic(e){e.preventDefault()}function xm(e){e.stopPropagation()}var _e;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(_e||(_e={}));const Oc={start:[_e.Space,_e.Enter],cancel:[_e.Esc],end:[_e.Space,_e.Enter,_e.Tab]},Lm=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case _e.Right:return{...r,x:r.x+25};case _e.Left:return{...r,x:r.x-25};case _e.Down:return{...r,y:r.y+25};case _e.Up:return{...r,y:r.y-25}}};class Bi{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new uo(yn(r)),this.windowListeners=new uo(Tt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ut.Resize,this.handleCancel),this.windowListeners.add(Ut.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ut.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Ec(n),r(Zt)}handleKeyDown(t){if(da(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=Oc,coordinateGetter:i=Lm,scrollBehavior:s="smooth"}=o,{code:l}=t;if(a.end.includes(l)){this.handleEnd(t);return}if(a.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=n.current,f=d?{x:d.left,y:d.top}:Zt;this.referenceCoordinates||(this.referenceCoordinates=f);const u=i(t,{active:r,context:n.current,currentCoordinates:f});if(u){const m=co(u,f),g={x:0,y:0},{scrollableAncestors:w}=n.current;for(const p of w){const y=t.code,{isTop:v,isRight:b,isLeft:C,isBottom:S,maxScroll:T,minScroll:I}=_c(p),k=Om(p),x={x:Math.min(y===_e.Right?k.right-k.width/2:k.right,Math.max(y===_e.Right?k.left:k.left+k.width/2,u.x)),y:Math.min(y===_e.Down?k.bottom-k.height/2:k.bottom,Math.max(y===_e.Down?k.top:k.top+k.height/2,u.y))},B=y===_e.Right&&!b||y===_e.Left&&!C,q=y===_e.Down&&!S||y===_e.Up&&!v;if(B&&x.x!==u.x){const N=p.scrollLeft+m.x,P=y===_e.Right&&N<=T.x||y===_e.Left&&N>=I.x;if(P&&!m.y){p.scrollTo({left:N,behavior:s});return}P?g.x=p.scrollLeft-N:g.x=y===_e.Right?p.scrollLeft-T.x:p.scrollLeft-I.x,g.x&&p.scrollBy({left:-g.x,behavior:s});break}else if(q&&x.y!==u.y){const N=p.scrollTop+m.y,P=y===_e.Down&&N<=T.y||y===_e.Up&&N>=I.y;if(P&&!m.x){p.scrollTo({top:N,behavior:s});return}P?g.y=p.scrollTop-N:g.y=y===_e.Down?p.scrollTop-T.y:p.scrollTop-I.y,g.y&&p.scrollBy({top:-g.y,behavior:s});break}}this.handleMove(t,vn(co(u,this.referenceCoordinates),g))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Bi.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Oc,onActivation:o}=t,{active:a}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Ac(e){return!!(e&&"distance"in e)}function Dc(e){return!!(e&&"delay"in e)}class ji{constructor(t,r,n){var o;n===void 0&&(n=km(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:i}=a;this.props=t,this.events=r,this.document=yn(i),this.documentListeners=new uo(this.document),this.listeners=new uo(n),this.windowListeners=new uo(Tt(i)),this.initialCoordinates=(o=ua(a))!=null?o:Zt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ut.Resize,this.handleCancel),this.windowListeners.add(Ut.DragStart,Ic),this.windowListeners.add(Ut.VisibilityChange,this.handleCancel),this.windowListeners.add(Ut.ContextMenu,Ic),this.documentListeners.add(Ut.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Dc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Ac(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ut.Click,xm,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ut.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:i,options:{activationConstraint:s}}=a;if(!o)return;const l=(r=ua(t))!=null?r:Zt,d=co(o,l);if(!n&&s){if(Ac(s)){if(s.tolerance!=null&&$i(d,s.tolerance))return this.handleCancel();if($i(d,s.distance))return this.handleStart()}if(Dc(s)&&$i(d,s.tolerance))return this.handleCancel();this.handlePending(s,d);return}t.cancelable&&t.preventDefault(),i(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===_e.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Pm={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class pa extends ji{constructor(t){const{event:r}=t,n=yn(r.target);super(t,Pm,n)}}pa.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Fm={move:{name:"mousemove"},end:{name:"mouseup"}};var qi;(function(e){e[e.RightClick=2]="RightClick"})(qi||(qi={}));class Mm extends ji{constructor(t){super(t,Fm,yn(t.event.target))}}Mm.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===qi.RightClick?!1:(n==null||n({event:r}),!0)}}];const Ui={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class $m extends ji{constructor(t){super(t,Ui)}static setup(){return window.addEventListener(Ui.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ui.move.name,t)};function t(){}}}$m.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var fo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(fo||(fo={}));var ga;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ga||(ga={}));function Bm(e){let{acceleration:t,activator:r=fo.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:i=5,order:s=ga.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:f,delta:u,threshold:m}=e;const g=qm({delta:u,disabled:!a}),[w,p]=Xg(),y=h.useRef({x:0,y:0}),v=h.useRef({x:0,y:0}),b=h.useMemo(()=>{switch(r){case fo.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case fo.DraggableRect:return o}},[r,o,l]),C=h.useRef(null),S=h.useCallback(()=>{const I=C.current;if(!I)return;const k=y.current.x*v.current.x,x=y.current.y*v.current.y;I.scrollBy(k,x)},[]),T=h.useMemo(()=>s===ga.TreeOrder?[...d].reverse():d,[s,d]);h.useEffect(()=>{if(!a||!d.length||!b){p();return}for(const I of T){if((n==null?void 0:n(I))===!1)continue;const k=d.indexOf(I),x=f[k];if(!x)continue;const{direction:B,speed:q}=Im(I,x,b,t,m);for(const N of["x","y"])g[N][B[N]]||(q[N]=0,B[N]=0);if(q.x>0||q.y>0){p(),C.current=I,w(S,i),y.current=q,v.current=B;return}}y.current={x:0,y:0},v.current={x:0,y:0},p()},[t,S,n,p,a,i,JSON.stringify(b),JSON.stringify(g),w,d,T,f,JSON.stringify(m)])}const jm={x:{[ot.Backward]:!1,[ot.Forward]:!1},y:{[ot.Backward]:!1,[ot.Forward]:!1}};function qm(e){let{delta:t,disabled:r}=e;const n=ca(t);return so(o=>{if(r||!n||!o)return jm;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ot.Backward]:o.x[ot.Backward]||a.x===-1,[ot.Forward]:o.x[ot.Forward]||a.x===1},y:{[ot.Backward]:o.y[ot.Backward]||a.y===-1,[ot.Forward]:o.y[ot.Forward]||a.y===1}}},[r,t,n])}function Um(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return so(o=>{var a;return t==null?null:(a=n??o)!=null?a:null},[n,t])}function Vm(e,t){return h.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...a]},[]),[e,t])}var ho;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ho||(ho={}));var Vi;(function(e){e.Optimized="optimized"})(Vi||(Vi={}));const Nc=new Map;function zm(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,i]=h.useState(null),{frequency:s,measure:l,strategy:d}=o,f=h.useRef(e),u=y(),m=io(u),g=h.useCallback(function(v){v===void 0&&(v=[]),!m.current&&i(b=>b===null?v:b.concat(v.filter(C=>!b.includes(C))))},[m]),w=h.useRef(null),p=so(v=>{if(u&&!r)return Nc;if(!v||v===Nc||f.current!==e||a!=null){const b=new Map;for(let C of e){if(!C)continue;if(a&&a.length>0&&!a.includes(C.id)&&C.rect.current){b.set(C.id,C.rect.current);continue}const S=C.node.current,T=S?new Mi(l(S),S):null;C.rect.current=T,T&&b.set(C.id,T)}return b}return v},[e,a,r,u,l]);return h.useEffect(()=>{f.current=e},[e]),h.useEffect(()=>{u||g()},[r,u]),h.useEffect(()=>{a&&a.length>0&&i(null)},[JSON.stringify(a)]),h.useEffect(()=>{u||typeof s!="number"||w.current!==null||(w.current=setTimeout(()=>{g(),w.current=null},s))},[s,u,g,...n]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:a!=null};function y(){switch(d){case ho.Always:return!1;case ho.BeforeDragging:return r;default:return!r}}}function zi(e,t){return so(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Hm(e,t){return zi(e,t)}function Rm(e){let{callback:t,disabled:r}=e;const n=sa(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ma(e){let{callback:t,disabled:r}=e;const n=sa(t),o=h.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return h.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Qm(e){return new Mi(bn(e),e)}function kc(e,t,r){t===void 0&&(t=Qm);const[n,o]=h.useState(null);function a(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??r)!=null?d:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const i=Rm({callback(l){if(e)for(const d of l){const{type:f,target:u}=d;if(f==="childList"&&u instanceof HTMLElement&&u.contains(e)){a();break}}}}),s=ma({callback:a});return Yt(()=>{a(),e?(s==null||s.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),i==null||i.disconnect())},[e]),n}function Gm(e){const t=zi(e);return mc(e,t)}const xc=[];function Wm(e){const t=h.useRef(e),r=so(n=>e?n&&n!==xc&&e&&t.current&&e.parentNode===t.current.parentNode?n:ha(e):xc,[e]);return h.useEffect(()=>{t.current=e},[e]),r}function Km(e){const[t,r]=h.useState(null),n=h.useRef(e),o=h.useCallback(a=>{const i=Pi(a.target);i&&r(s=>s?(s.set(i,Fi(i)),new Map(s)):null)},[]);return h.useEffect(()=>{const a=n.current;if(e!==a){i(a);const s=e.map(l=>{const d=Pi(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Fi(d)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),n.current=e}return()=>{i(e),i(a)};function i(s){s.forEach(l=>{const d=Pi(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,i)=>vn(a,i),Zt):Tc(e):Zt,[e,t])}function Lc(e,t){t===void 0&&(t=[]);const r=h.useRef(null);return h.useEffect(()=>{r.current=null},t),h.useEffect(()=>{const n=e!==Zt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?co(e,r.current):Zt}function Ym(e){h.useEffect(()=>{if(!ia)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Zm(e,t){return h.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=i=>{a(i,t)},r},{}),[e,t])}function Pc(e){return h.useMemo(()=>e?Sm(e):null,[e])}const Fc=[];function Xm(e,t){t===void 0&&(t=bn);const[r]=e,n=Pc(r?Tt(r):null),[o,a]=h.useState(Fc);function i(){a(()=>e.length?e.map(l=>Sc(l)?n:new Mi(t(l),l)):Fc)}const s=ma({callback:i});return Yt(()=>{s==null||s.disconnect(),i(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),o}function Mc(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ao(t)?t:e}function Jm(e){let{measure:t}=e;const[r,n]=h.useState(null),o=h.useCallback(d=>{for(const{target:f}of d)if(ao(f)){n(u=>{const m=t(f);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),a=ma({callback:o}),i=h.useCallback(d=>{const f=Mc(d);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,l]=la(i);return h.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}const ey=[{sensor:pa,options:{}},{sensor:Bi,options:{}}],ty={current:{}},ya={draggable:{measure:vc},droppable:{measure:vc,strategy:ho.WhileDragging,frequency:Vi.Optimized},dragOverlay:{measure:bn}};class po extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const ry={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new po,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fa},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ya,measureDroppableContainers:fa,windowRect:null,measuringScheduled:!1},$c={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fa,draggableNodes:new Map,over:null,measureDroppableContainers:fa},go=h.createContext($c),Bc=h.createContext(ry);function ny(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new po}}}function oy(e,t){switch(t.type){case nt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case nt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case nt.DragEnd:case nt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case nt.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new po(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case nt.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new po(e.droppable.containers);return i.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case nt.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new po(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function ay(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=h.useContext(go),a=ca(n),i=ca(r==null?void 0:r.id);return h.useEffect(()=>{if(!t&&!n&&a&&i!=null){if(!da(a)||document.activeElement===a.target)return;const s=o.get(i);if(!s)return;const{activatorNode:l,node:d}=s;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[l.current,d.current]){if(!f)continue;const u=tm(f);if(u){u.focus();break}}})}},[n,t,o,i,a]),null}function jc(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function iy(e){return h.useMemo(()=>({draggable:{...ya.draggable,...e==null?void 0:e.draggable},droppable:{...ya.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ya.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function sy(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=h.useRef(!1),{x:i,y:s}=typeof o=="boolean"?{x:o,y:o}:o;Yt(()=>{if(!i&&!s||!t){a.current=!1;return}if(a.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const f=r(d),u=mc(f,n);if(i||(u.x=0),s||(u.y=0),a.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const m=bc(d);m&&m.scrollBy({top:u.y,left:u.x})}},[t,i,s,n,r])}const va=h.createContext({...Zt,scaleX:1,scaleY:1});var Dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Dr||(Dr={}));const qc=h.memo(function(t){var r,n,o,a;let{id:i,accessibility:s,autoScroll:l=!0,children:d,sensors:f=ey,collisionDetection:u=mm,measuring:m,modifiers:g,...w}=t;const p=h.useReducer(oy,void 0,ny),[y,v]=p,[b,C]=sm(),[S,T]=h.useState(Dr.Uninitialized),I=S===Dr.Initialized,{draggable:{active:k,nodes:x,translate:B},droppable:{containers:q}}=y,N=k!=null?x.get(k):null,P=h.useRef({initial:null,translated:null}),M=h.useMemo(()=>{var dt;return k!=null?{id:k,data:(dt=N==null?void 0:N.data)!=null?dt:ty,rect:P}:null},[k,N]),L=h.useRef(null),[F,z]=h.useState(null),[X,ve]=h.useState(null),Ee=io(w,Object.values(w)),Ce=lo("DndDescribedBy",i),ue=h.useMemo(()=>q.getEnabled(),[q]),Q=iy(m),{droppableRects:ne,measureDroppableContainers:te,measuringScheduled:U}=zm(ue,{dragging:I,dependencies:[B.x,B.y],config:Q.droppable}),H=Um(x,k),ae=h.useMemo(()=>X?ua(X):null,[X]),fe=pn(),J=Hm(H,Q.draggable.measure);sy({activeNode:k!=null?x.get(k):null,config:fe.layoutShiftCompensation,initialRect:J,measure:Q.draggable.measure});const oe=kc(H,Q.draggable.measure,J),Me=kc(H?H.parentElement:null),Oe=h.useRef({activatorEvent:null,active:null,activeNode:H,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:q,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ve=q.getNodeFor((r=Oe.current.over)==null?void 0:r.id),We=Jm({measure:Q.dragOverlay.measure}),ze=(n=We.nodeRef.current)!=null?n:H,re=I?(o=We.rect)!=null?o:oe:null,Ke=!!(We.nodeRef.current&&We.rect),Re=Gm(Ke?null:oe),He=Pc(ze?Tt(ze):null),et=Wm(I?Ve??H:null),Gt=Xm(et),It=jc(g,{transform:{x:B.x-Re.x,y:B.y-Re.y,scaleX:1,scaleY:1},activatorEvent:X,active:M,activeNodeRect:oe,containerNodeRect:Me,draggingNodeRect:re,over:Oe.current.over,overlayNodeRect:We.rect,scrollableAncestors:et,scrollableAncestorRects:Gt,windowRect:He}),K=ae?vn(ae,B):null,ge=Km(et),we=Lc(ge),Wt=Lc(ge,[oe]),_=vn(It,we),A=re?bm(re,It):null,D=M&&A?u({active:M,collisionRect:A,droppableRects:ne,droppableContainers:ue,pointerCoordinates:K}):null,V=pc(D,"id"),[j,G]=h.useState(null),R=Ke?It:vn(It,Wt),ee=ym(R,(a=j==null?void 0:j.rect)!=null?a:null,oe),ye=h.useRef(null),Ye=h.useCallback((dt,_t)=>{let{sensor:Ot,options:or}=_t;if(L.current==null)return;const Kt=x.get(L.current);if(!Kt)return;const qt=dt.nativeEvent,pr=new Ot({active:L.current,activeNode:Kt,event:qt,options:or,context:Oe,onAbort(pt){if(!x.get(pt))return;const{onDragAbort:gr}=Ee.current,Sr={id:pt};gr==null||gr(Sr),b({type:"onDragAbort",event:Sr})},onPending(pt,Ur,gr,Sr){if(!x.get(pt))return;const{onDragPending:Wo}=Ee.current,Vr={id:pt,constraint:Ur,initialCoordinates:gr,offset:Sr};Wo==null||Wo(Vr),b({type:"onDragPending",event:Vr})},onStart(pt){const Ur=L.current;if(Ur==null)return;const gr=x.get(Ur);if(!gr)return;const{onDragStart:Sr}=Ee.current,Go={activatorEvent:qt,active:{id:Ur,data:gr.data,rect:P}};Pe.unstable_batchedUpdates(()=>{Sr==null||Sr(Go),T(Dr.Initializing),v({type:nt.DragStart,initialCoordinates:pt,active:Ur}),b({type:"onDragStart",event:Go}),z(ye.current),ve(qt)})},onMove(pt){v({type:nt.DragMove,coordinates:pt})},onEnd:Jn(nt.DragEnd),onCancel:Jn(nt.DragCancel)});ye.current=pr;function Jn(pt){return async function(){const{active:gr,collisions:Sr,over:Go,scrollAdjustedTranslate:Wo}=Oe.current;let Vr=null;if(gr&&Wo){const{cancelDrop:Ko}=Ee.current;Vr={activatorEvent:qt,active:gr,collisions:Sr,delta:Wo,over:Go},pt===nt.DragEnd&&typeof Ko=="function"&&await Promise.resolve(Ko(Vr))&&(pt=nt.DragCancel)}L.current=null,Pe.unstable_batchedUpdates(()=>{v({type:pt}),T(Dr.Uninitialized),G(null),z(null),ve(null),ye.current=null;const Ko=pt===nt.DragEnd?"onDragEnd":"onDragCancel";if(Vr){const Tl=Ee.current[Ko];Tl==null||Tl(Vr),b({type:Ko,event:Vr})}})}}},[x]),Lt=h.useCallback((dt,_t)=>(Ot,or)=>{const Kt=Ot.nativeEvent,qt=x.get(or);if(L.current!==null||!qt||Kt.dndKit||Kt.defaultPrevented)return;const pr={active:qt};dt(Ot,_t.options,pr)===!0&&(Kt.dndKit={capturedBy:_t.sensor},L.current=or,Ye(Ot,_t))},[x,Ye]),Pt=Vm(f,Lt);Ym(f),Yt(()=>{oe&&S===Dr.Initializing&&T(Dr.Initialized)},[oe,S]),h.useEffect(()=>{const{onDragMove:dt}=Ee.current,{active:_t,activatorEvent:Ot,collisions:or,over:Kt}=Oe.current;if(!_t||!Ot)return;const qt={active:_t,activatorEvent:Ot,collisions:or,delta:{x:_.x,y:_.y},over:Kt};Pe.unstable_batchedUpdates(()=>{dt==null||dt(qt),b({type:"onDragMove",event:qt})})},[_.x,_.y]),h.useEffect(()=>{const{active:dt,activatorEvent:_t,collisions:Ot,droppableContainers:or,scrollAdjustedTranslate:Kt}=Oe.current;if(!dt||L.current==null||!_t||!Kt)return;const{onDragOver:qt}=Ee.current,pr=or.get(V),Jn=pr&&pr.rect.current?{id:pr.id,rect:pr.rect.current,data:pr.data,disabled:pr.disabled}:null,pt={active:dt,activatorEvent:_t,collisions:Ot,delta:{x:Kt.x,y:Kt.y},over:Jn};Pe.unstable_batchedUpdates(()=>{G(Jn),qt==null||qt(pt),b({type:"onDragOver",event:pt})})},[V]),Yt(()=>{Oe.current={activatorEvent:X,active:M,activeNode:H,collisionRect:A,collisions:D,droppableRects:ne,draggableNodes:x,draggingNode:ze,draggingNodeRect:re,droppableContainers:q,over:j,scrollableAncestors:et,scrollAdjustedTranslate:_},P.current={initial:re,translated:A}},[M,H,D,A,x,ze,re,ne,q,j,et,_]),Bm({...fe,delta:B,draggingRect:A,pointerCoordinates:K,scrollableAncestors:et,scrollableAncestorRects:Gt});const Cr=h.useMemo(()=>({active:M,activeNode:H,activeNodeRect:oe,activatorEvent:X,collisions:D,containerNodeRect:Me,dragOverlay:We,draggableNodes:x,droppableContainers:q,droppableRects:ne,over:j,measureDroppableContainers:te,scrollableAncestors:et,scrollableAncestorRects:Gt,measuringConfiguration:Q,measuringScheduled:U,windowRect:He}),[M,H,oe,X,D,Me,We,x,q,ne,j,te,et,Gt,Q,U,He]),Qo=h.useMemo(()=>({activatorEvent:X,activators:Pt,active:M,activeNodeRect:oe,ariaDescribedById:{draggable:Ce},dispatch:v,draggableNodes:x,over:j,measureDroppableContainers:te}),[X,Pt,M,oe,v,Ce,x,j,te]);return h.createElement(cc.Provider,{value:C},h.createElement(go.Provider,{value:Qo},h.createElement(Bc.Provider,{value:Cr},h.createElement(va.Provider,{value:ee},d)),h.createElement(ay,{disabled:(s==null?void 0:s.restoreFocus)===!1})),h.createElement(dm,{...s,hiddenTextDescribedById:Ce}));function pn(){const dt=(F==null?void 0:F.autoScrollEnabled)===!1,_t=typeof l=="object"?l.enabled===!1:l===!1,Ot=I&&!dt&&!_t;return typeof l=="object"?{...l,enabled:Ot}:{enabled:Ot}}}),ly=h.createContext(null),Uc="button",cy="Draggable";function Vc(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=lo(cy),{activators:i,activatorEvent:s,active:l,activeNodeRect:d,ariaDescribedById:f,draggableNodes:u,over:m}=h.useContext(go),{role:g=Uc,roleDescription:w="draggable",tabIndex:p=0}=o??{},y=(l==null?void 0:l.id)===t,v=h.useContext(y?va:ly),[b,C]=la(),[S,T]=la(),I=Zm(i,t),k=io(r);Yt(()=>(u.set(t,{id:t,key:a,node:b,activatorNode:S,data:k}),()=>{const B=u.get(t);B&&B.key===a&&u.delete(t)}),[u,t]);const x=h.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":n,"aria-pressed":y&&g===Uc?!0:void 0,"aria-roledescription":w,"aria-describedby":f.draggable}),[n,g,p,y,w,f.draggable]);return{active:l,activatorEvent:s,activeNodeRect:d,attributes:x,isDragging:y,listeners:n?void 0:I,node:b,over:m,setNodeRef:C,setActivatorNodeRef:T,transform:v}}function zc(){return h.useContext(Bc)}const dy="Droppable",uy={timeout:25};function fy(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=lo(dy),{active:i,dispatch:s,over:l,measureDroppableContainers:d}=h.useContext(go),f=h.useRef({disabled:r}),u=h.useRef(!1),m=h.useRef(null),g=h.useRef(null),{disabled:w,updateMeasurementsFor:p,timeout:y}={...uy,...o},v=io(p??n),b=h.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),g.current=null},y)},[y]),C=ma({callback:b,disabled:w||!i}),S=h.useCallback((x,B)=>{C&&(B&&(C.unobserve(B),u.current=!1),x&&C.observe(x))},[C]),[T,I]=la(S),k=io(t);return h.useEffect(()=>{!C||!T.current||(C.disconnect(),u.current=!1,C.observe(T.current))},[T,C]),h.useEffect(()=>(s({type:nt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:T,rect:m,data:k}}),()=>s({type:nt.UnregisterDroppable,key:a,id:n})),[n]),h.useEffect(()=>{r!==f.current.disabled&&(s({type:nt.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:i,rect:m,isOver:(l==null?void 0:l.id)===n,node:T,over:l,setNodeRef:I}}function hy(e){let{animation:t,children:r}=e;const[n,o]=h.useState(null),[a,i]=h.useState(null),s=ca(r);return!r&&!n&&s&&o(s),Yt(()=>{if(!a)return;const l=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(l==null||d==null){o(null);return}Promise.resolve(t(d,a)).then(()=>{o(null)})},[t,n,a]),h.createElement(h.Fragment,null,r,n?h.cloneElement(n,{ref:i}):null)}const py={x:0,y:0,scaleX:1,scaleY:1};function gy(e){let{children:t}=e;return h.createElement(go.Provider,{value:$c},h.createElement(va.Provider,{value:py},t))}const my={position:"fixed",touchAction:"none"},yy=e=>da(e)?"transform 250ms ease":void 0,vy=h.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:a,className:i,rect:s,style:l,transform:d,transition:f=yy}=e;if(!s)return null;const u=o?d:{...d,scaleX:1,scaleY:1},m={...my,width:s.width,height:s.height,top:s.top,left:s.left,transform:Ar.Transform.toString(u),transformOrigin:o&&n?um(n,s):void 0,transition:typeof f=="function"?f(n):f,...l};return h.createElement(r,{className:i,style:m,ref:t},a)}),by={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Ar.Transform.toString(t)},{transform:Ar.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:a,className:i}=e;if(a!=null&&a.active)for(const[s,l]of Object.entries(a.active))l!==void 0&&(o[s]=r.node.style.getPropertyValue(s),r.node.style.setProperty(s,l));if(a!=null&&a.dragOverlay)for(const[s,l]of Object.entries(a.dragOverlay))l!==void 0&&n.node.style.setProperty(s,l);return i!=null&&i.active&&r.node.classList.add(i.active),i!=null&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[l,d]of Object.entries(o))r.node.style.setProperty(l,d);i!=null&&i.active&&r.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function wy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return sa((a,i)=>{if(t===null)return;const s=r.get(a);if(!s)return;const l=s.node.current;if(!l)return;const d=Mc(i);if(!d)return;const{transform:f}=Tt(i).getComputedStyle(i),u=yc(f);if(!u)return;const m=typeof t=="function"?t:Cy(t);return Ec(l,o.draggable.measure),m({active:{id:a,data:s.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:u})})}function Cy(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...by,...e};return a=>{let{active:i,dragOverlay:s,transform:l,...d}=a;if(!t)return;const f={x:s.rect.left-i.rect.left,y:s.rect.top-i.rect.top},u={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/s.rect.height:1},m={x:l.x-f.x,y:l.y-f.y,...u},g=o({...d,active:i,dragOverlay:s,transform:{initial:l,final:m}}),[w]=g,p=g[g.length-1];if(JSON.stringify(w)===JSON.stringify(p))return;const y=n==null?void 0:n({active:i,dragOverlay:s,...d}),v=s.node.animate(g,{duration:t,easing:r,fill:"forwards"});return new Promise(b=>{v.onfinish=()=>{y==null||y(),b()}})}}let Hc=0;function Sy(e){return h.useMemo(()=>{if(e!=null)return Hc++,Hc},[e])}const _y=h.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:a,modifiers:i,wrapperElement:s="div",className:l,zIndex:d=999}=e;const{activatorEvent:f,active:u,activeNodeRect:m,containerNodeRect:g,draggableNodes:w,droppableContainers:p,dragOverlay:y,over:v,measuringConfiguration:b,scrollableAncestors:C,scrollableAncestorRects:S,windowRect:T}=zc(),I=h.useContext(va),k=Sy(u==null?void 0:u.id),x=jc(i,{activatorEvent:f,active:u,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:y.rect,over:v,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:S,transform:I,windowRect:T}),B=zi(m),q=wy({config:n,draggableNodes:w,droppableContainers:p,measuringConfiguration:b}),N=B?y.setRef:void 0;return h.createElement(gy,null,h.createElement(hy,{animation:q},u&&k?h.createElement(vy,{key:k,id:u.id,ref:N,as:s,activatorEvent:f,adjustScale:t,className:l,transition:a,rect:B,style:{zIndex:d,...o},transform:x},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
|
|
186
|
+
*/const Ty=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rc=(...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
|
|
191
|
+
*/var Ey={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
|
|
196
|
+
*/const Iy=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:i,...s},l)=>h.createElement("svg",{ref:l,...Ey,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Rc("lucide",o),...s},[...i.map(([d,f])=>h.createElement(d,f)),...Array.isArray(a)?a:[a]]));/**
|
|
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 se=(e,t)=>{const r=h.forwardRef(({className:n,...o},a)=>h.createElement(
|
|
201
|
+
*/const se=(e,t)=>{const r=h.forwardRef(({className:n,...o},a)=>h.createElement(Iy,{ref:a,iconNode:t,className:Rc(`lucide-${Ty(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
|
|
202
202
|
* @license lucide-react v0.400.0 - ISC
|
|
203
203
|
*
|
|
204
204
|
* This source code is licensed under the ISC license.
|
|
205
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const
|
|
206
|
+
*/const Oy=se("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
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
|
|
211
|
+
*/const Ay=se("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"}]]);/**
|
|
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
|
|
216
|
+
*/const Dy=se("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"}]]);/**
|
|
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
|
|
221
|
+
*/const Ny=se("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"}]]);/**
|
|
222
222
|
* @license lucide-react v0.400.0 - ISC
|
|
223
223
|
*
|
|
224
224
|
* This source code is licensed under the ISC license.
|
|
@@ -233,42 +233,42 @@ to {
|
|
|
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
|
|
236
|
+
*/const Qc=se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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
|
|
241
|
+
*/const ky=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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
|
|
246
|
+
*/const Gc=se("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"}]]);/**
|
|
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
|
|
251
|
+
*/const Hi=se("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"}]]);/**
|
|
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
|
|
256
|
+
*/const xy=se("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"}]]);/**
|
|
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
|
|
261
|
+
*/const Ly=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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
|
|
266
|
+
*/const Py=se("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"}]]);/**
|
|
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
|
|
271
|
+
*/const Wc=se("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"}]]);/**
|
|
272
272
|
* @license lucide-react v0.400.0 - ISC
|
|
273
273
|
*
|
|
274
274
|
* This source code is licensed under the ISC license.
|
|
@@ -283,52 +283,52 @@ to {
|
|
|
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
|
|
286
|
+
*/const Fy=se("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"}]]);/**
|
|
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
|
|
291
|
+
*/const Kc=se("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"}]]);/**
|
|
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
|
|
296
|
+
*/const My=se("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"}]]);/**
|
|
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
|
|
301
|
+
*/const $y=se("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"}]]);/**
|
|
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
|
|
306
|
+
*/const Yc=se("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"}]]);/**
|
|
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
|
|
311
|
+
*/const By=se("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"}]]);/**
|
|
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
|
|
316
|
+
*/const Zc=se("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"}]]);/**
|
|
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
|
|
321
|
+
*/const Ri=se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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
|
|
326
|
+
*/const Qi=se("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"}]]);/**
|
|
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
|
|
331
|
+
*/const jy=se("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"}]]);/**
|
|
332
332
|
* @license lucide-react v0.400.0 - ISC
|
|
333
333
|
*
|
|
334
334
|
* This source code is licensed under the ISC license.
|
|
@@ -338,27 +338,27 @@ to {
|
|
|
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
|
|
341
|
+
*/const Gi=se("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"}]]);/**
|
|
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
|
|
346
|
+
*/const Wi=se("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"}]]);/**
|
|
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
|
|
351
|
+
*/const qy=se("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"}]]);/**
|
|
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
|
|
356
|
+
*/const Uy=se("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"}]]);/**
|
|
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
|
|
361
|
+
*/const Vy=se("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"}]]);/**
|
|
362
362
|
* @license lucide-react v0.400.0 - ISC
|
|
363
363
|
*
|
|
364
364
|
* This source code is licensed under the ISC license.
|
|
@@ -373,87 +373,87 @@ to {
|
|
|
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
|
|
376
|
+
*/const Xc=se("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"}]]);/**
|
|
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
|
|
381
|
+
*/const Jc=se("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"}]]);/**
|
|
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
|
|
386
|
+
*/const Hy=se("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"}]]);/**
|
|
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
|
|
391
|
+
*/const Ry=se("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"}]]);/**
|
|
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
|
|
396
|
+
*/const Qy=se("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"}]]);/**
|
|
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
|
|
401
|
+
*/const Ki=se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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
|
|
406
|
+
*/const Gy=se("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
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
|
|
411
|
+
*/const Wy=se("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"}]]);/**
|
|
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
|
|
416
|
+
*/const Ky=se("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"}]]);/**
|
|
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
|
|
421
|
+
*/const Yy=se("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"}]]);/**
|
|
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
|
|
426
|
+
*/const Yi=se("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"}]]);/**
|
|
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
|
|
431
|
+
*/const Zy=se("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"}]]);/**
|
|
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
|
|
436
|
+
*/const Zi=se("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"}]]);/**
|
|
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
|
|
441
|
+
*/const Xy=se("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"}]]);/**
|
|
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
|
|
446
|
+
*/const Jy=se("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"}]]);/**
|
|
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
|
|
451
|
+
*/const Xi=se("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"}]]);/**
|
|
452
452
|
* @license lucide-react v0.400.0 - ISC
|
|
453
453
|
*
|
|
454
454
|
* This source code is licensed under the ISC license.
|
|
455
455
|
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/const yr=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),
|
|
456
|
+
*/const yr=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ev={},ed=e=>{let t;const r=new Set,n=(f,u)=>{const m=typeof f=="function"?f(t):f;if(!Object.is(m,t)){const g=t;t=u??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(w=>w(t,g))}},o=()=>t,l={setState:n,getState:o,getInitialState:()=>d,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(ev?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,o,l);return l},tv=e=>e?ed(e):ed;function td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ji={exports:{}},es={},Ca={exports:{}},ts={};/**
|
|
457
457
|
* @license React
|
|
458
458
|
* use-sync-external-store-shim.production.js
|
|
459
459
|
*
|
|
@@ -461,7 +461,7 @@ to {
|
|
|
461
461
|
*
|
|
462
462
|
* This source code is licensed under the MIT license found in the
|
|
463
463
|
* LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/var
|
|
464
|
+
*/var rd;function rv(){if(rd)return ts;rd=1;var e=h;function t(u,m){return u===m&&(u!==0||1/u===1/m)||u!==u&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(u,m){var g=m(),w=n({inst:{value:g,getSnapshot:m}}),p=w[0].inst,y=w[1];return a(function(){p.value=g,p.getSnapshot=m,l(p)&&y({inst:p})},[u,g,m]),o(function(){return l(p)&&y({inst:p}),u(function(){l(p)&&y({inst:p})})},[u]),i(g),g}function l(u){var m=u.getSnapshot;u=u.value;try{var g=m();return!r(u,g)}catch{return!0}}function d(u,m){return m()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:s;return ts.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,ts}var rs={};/**
|
|
465
465
|
* @license React
|
|
466
466
|
* use-sync-external-store-shim.development.js
|
|
467
467
|
*
|
|
@@ -469,7 +469,7 @@ to {
|
|
|
469
469
|
*
|
|
470
470
|
* This source code is licensed under the MIT license found in the
|
|
471
471
|
* LICENSE file in the root directory of this source tree.
|
|
472
|
-
*/var
|
|
472
|
+
*/var nd;function nv(){return nd||(nd=1,process.env.NODE_ENV!=="production"&&function(){function e(g,w){return g===w&&(g!==0||1/g===1/w)||g!==g&&w!==w}function t(g,w){f||o.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=w();if(!u){var y=w();a(p,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}y=i({inst:{value:p,getSnapshot:w}});var v=y[0].inst,b=y[1];return l(function(){v.value=p,v.getSnapshot=w,r(v)&&b({inst:v})},[g,p,w]),s(function(){return r(v)&&b({inst:v}),g(function(){r(v)&&b({inst:v})})},[g]),d(p),p}function r(g){var w=g.getSnapshot;g=g.value;try{var p=w();return!a(g,p)}catch{return!0}}function n(g,w){return w()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,a=typeof Object.is=="function"?Object.is:e,i=o.useState,s=o.useEffect,l=o.useLayoutEffect,d=o.useDebugValue,f=!1,u=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;rs.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),rs}var od;function ns(){return od||(od=1,process.env.NODE_ENV==="production"?Ca.exports=rv():Ca.exports=nv()),Ca.exports}/**
|
|
473
473
|
* @license React
|
|
474
474
|
* use-sync-external-store-shim/with-selector.production.js
|
|
475
475
|
*
|
|
@@ -477,7 +477,7 @@ to {
|
|
|
477
477
|
*
|
|
478
478
|
* This source code is licensed under the MIT license found in the
|
|
479
479
|
* LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/var
|
|
480
|
+
*/var ad;function ov(){if(ad)return es;ad=1;var e=h,t=ns();function r(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return es.useSyncExternalStoreWithSelector=function(d,f,u,m,g){var w=a(null);if(w.current===null){var p={hasValue:!1,value:null};w.current=p}else p=w.current;w=s(function(){function v(I){if(!b){if(b=!0,C=I,I=m(I),g!==void 0&&p.hasValue){var k=p.value;if(g(k,I))return S=k}return S=I}if(k=S,n(C,I))return k;var x=m(I);return g!==void 0&&g(k,x)?(C=I,k):(C=I,S=x)}var b=!1,C,S,T=u===void 0?null:u;return[function(){return v(f())},T===null?void 0:function(){return v(T())}]},[f,u,m,g]);var y=o(d,w[0],w[1]);return i(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},es}var os={};/**
|
|
481
481
|
* @license React
|
|
482
482
|
* use-sync-external-store-shim/with-selector.development.js
|
|
483
483
|
*
|
|
@@ -485,22 +485,22 @@ to {
|
|
|
485
485
|
*
|
|
486
486
|
* This source code is licensed under the MIT license found in the
|
|
487
487
|
* LICENSE file in the root directory of this source tree.
|
|
488
|
-
*/var ld;function ov(){return ld||(ld=1,process.env.NODE_ENV!=="production"&&function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,r=os(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;as.useSyncExternalStoreWithSelector=function(d,f,u,m,g){var w=a(null);if(w.current===null){var p={hasValue:!1,value:null};w.current=p}else p=w.current;w=s(function(){function v(I){if(!b){if(b=!0,C=I,I=m(I),g!==void 0&&p.hasValue){var k=p.value;if(g(k,I))return S=k}return S=I}if(k=S,n(C,I))return k;var x=m(I);return g!==void 0&&g(k,x)?(C=I,k):(C=I,S=x)}var b=!1,C,S,T=u===void 0?null:u;return[function(){return v(f())},T===null?void 0:function(){return v(T())}]},[f,u,m,g]);var y=o(d,w[0],w[1]);return i(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),as}process.env.NODE_ENV==="production"?es.exports=nv():es.exports=ov();var av=es.exports;const iv=nd(av),cd={},{useDebugValue:sv}=h,{useSyncExternalStoreWithSelector:lv}=iv;let dd=!1;const cv=e=>e;function dv(e,t=cv,r){(cd?"production":void 0)!=="production"&&r&&!dd&&(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"),dd=!0);const n=lv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return sv(n),n}const ud=e=>{(cd?"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"?ev(e):e,r=(n,o)=>dv(t,n,o);return Object.assign(r,t),r},yo=e=>e?ud(e):ud,ce=yo(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=ce.getState().formStatusMapper,n=[...t];for(;n.length>0;){const o=n.shift();if(r[o.id]===!1)return!1;o.children&&n.push(...o.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),uv=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:ce},Symbol.toStringTag,{value:"Module"}));function Rr(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function fd(e,t,r=0){var n;for(const o of e){if(o.id===t)return r;if((n=o.children)!=null&&n.length){const a=fd(o.children,t,r+1);if(a>=0)return a}}return-1}const fv=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function hd(e,t,r){return e.map(n=>{if(n.id===t){const o=r.metadata??{},a={};for(const i of fv)i in r&&(a[i]=r[i]);return{...n,...r,metadata:{...n.metadata??{},...a,...o}}}return n.children&&n.children.length>0?{...n,children:hd(n.children,t,r)}:n})}function Sa(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:Sa(n.children,t,r)}:n)}function is(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?is(r.children,t):[]}))}function pd(e,t,r,n){return e.map(o=>{if(o.id===t){const a=[...o.children??[]],[i]=a.splice(r,1);return a.splice(n,0,i),{...o,children:a}}return o.children&&o.children.length>0?{...o,children:pd(o.children,t,r,n)}:o})}function gd(e,t){return e.map(r=>{const n=t[r.id]??r.id,o=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:o,children:r.children?gd(r.children,t):[]}})}function hv(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 pv(e,t){const r=Rr(e,t);if(!r)return[];const n=[];let o=r;for(;o;)n.unshift({id:o.id,name:o.name}),o=o.parent?Rr(e,o.parent):void 0;return n}const Ae=yo((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var o;const n=((o=r[0])==null?void 0:o.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:o,getBreadcrumb:a}=t(),i=Rr(n,r),s=a(r),l={...(i==null?void 0:i.metadata)??{},...o[r]??{}};ce.getState().setNodeFlags({isFolder:(i==null?void 0:i.isFolder)??!1,isRoot:!(i!=null&&i.parent),isQuml:!1}),e({selectedNodeId:r,breadcrumb:s,activeNodeMeta:l})},updateNode:(r,n)=>{e(o=>({treeData:hd(o.treeData,r,n),treeCache:{...o.treeCache,[r]:{...o.treeCache[r]??{},...n}}})),t().markDirty()},addNode:(r,n)=>{var d,f;const o=t(),a=((f=(d=ce.getState().editorConfig)==null?void 0:d.config)==null?void 0:f.maxDepth)??4,i=fd(o.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const s="temp-"+Math.random().toString(36).slice(2),l={id:s,identifier:s,name:"Untitled Unit",isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:s,name:"Untitled Unit",visibility:"Parent"}};return e(u=>({treeData:Sa(u.treeData,r,l),treeCache:{...u.treeCache,[s]:{...l.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(s),0),s},deleteNode:r=>{e(n=>({treeData:is(n.treeData,r),selectedNodeId:n.selectedNodeId===r?null:n.selectedNodeId}))},reorderChildren:(r,n,o)=>{e(a=>({treeData:pd(a.treeData,r,n,o)}))},moveNode:(r,n,o)=>{e(a=>{const i=Rr(a.treeData,r);if(!i)return a;let s=is(a.treeData,r);return s=Sa(s,o,{...i,parent:o}),{treeData:s}}),t().markDirty()},addResource:(r,n)=>{var f,u,m;const o=ce.getState().editorConfig,a=((f=o==null?void 0:o.config)==null?void 0:f.allowContentUnderRoot)??!1,i=(u=t().treeData[0])==null?void 0:u.id;if(!a&&n===i||Rr(t().treeData,r.identifier))return!1;const s=((m=o==null?void 0:o.config)==null?void 0:m.maxContentsLimit)??1200;if(hv(t().treeData)>=s)return!1;const d={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:r};return e(g=>({treeData:Sa(g.treeData,n,d)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=ce.getState();r==="edit"&&n(!0)},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const o=gd(n.treeData,r),a={};for(const[s,l]of Object.entries(n.treeCache)){const d=r[s]??s,{isNew:f,...u}=l;a[d]=u}const i=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:o,treeCache:a,selectedNodeId:i}})},getNodeById:r=>Rr(t().treeData,r),getChildrenOf:r=>{const n=Rr(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>pv(t().treeData,r)})),gv=yo(e=>({activeModal:null,modalData:{},openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}})})),mv={spin:"_spin_1ah4d_9"},ss={contextualEditor:{emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},languageSelector:{ariaLabel:"Select language"},collectionEditor:{errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},breadcrumb:{nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},tabBar:{detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},contentEditForm:{moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},titleAppIcon:{selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},unitContentList:{removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},contentRow:{dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},csvUpload:{invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},manageCollaborators:{saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},sparkMetaForm:{shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},appIconField:{requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},appIconPickerModal:{dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},chipGroupField:{addPlaceholder:"Add…",addButtonLabel:"Add"},dateTimeField:{requiredError:"{field} is required"},dialcodeInputField:{requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},keywordSuggestField:{requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},licenseSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select license…"},multiSelectField:{requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},nestedSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select…"},radioField:{requiredError:"{field} is required"},selectField:{requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},textField:{requiredError:"{field} is required",maxLengthError:"Max {max} characters"},assetBrowser:{dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},resourceReorderDialog:{dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},assignPageNumber:{dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},confirmDialog:{confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},publishChecklist:{publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",noButton:"No",yesButton:"Yes"},qualityParamsModal:{reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},unsavedChangesModal:{title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},filterChips:{contentTypeFiltersAriaLabel:"Content type filters"},libraryCard:{alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added"},libraryDock:{selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter"},libraryFilterPanel:{boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},libraryPreviewPanel:{contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},outlineTree:{maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},treeNode:{expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},contentPlayer:{mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},dialcodePanel:{title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},progressStatus:{unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},splitBuilderShell:{dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},topbar:{draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},reviewCommentModal:{closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},confirmReviewModal:{closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},generateQRModal:{closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},chip:{remove:"Remove"},dropZone:{dropHere:"Drop here"},spinner:{loading:"Loading"}},yv={contextualEditor:{emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},languageSelector:{ariaLabel:"اختيار اللغة"},collectionEditor:{errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},breadcrumb:{nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},tabBar:{detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},contentEditForm:{moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},titleAppIcon:{selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},unitContentList:{removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},contentRow:{dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},csvUpload:{invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},manageCollaborators:{saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},sparkMetaForm:{shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},appIconField:{requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},appIconPickerModal:{dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},chipGroupField:{addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},dateTimeField:{requiredError:"{field} مطلوب"},dialcodeInputField:{requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},keywordSuggestField:{requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},licenseSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},multiSelectField:{requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},nestedSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},radioField:{requiredError:"{field} مطلوب"},selectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},textField:{requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},assetBrowser:{dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},resourceReorderDialog:{dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},assignPageNumber:{dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},confirmDialog:{confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},publishChecklist:{publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},qualityParamsModal:{reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},unsavedChangesModal:{title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},filterChips:{contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},libraryCard:{alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},libraryDock:{selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},libraryFilterPanel:{boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},libraryPreviewPanel:{contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},outlineTree:{maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},treeNode:{expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},contentPlayer:{mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},dialcodePanel:{title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},progressStatus:{unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},splitBuilderShell:{dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},topbar:{draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},reviewCommentModal:{closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},confirmReviewModal:{closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},generateQRModal:{closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},chip:{remove:"إزالة"},dropZone:{dropHere:"أفلت هنا"},spinner:{loading:"جارٍ التحميل"}},vv={contextualEditor:{emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},languageSelector:{ariaLabel:"Sélectionner la langue"},collectionEditor:{errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},breadcrumb:{nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},tabBar:{detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},contentEditForm:{moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},titleAppIcon:{selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},unitContentList:{removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},contentRow:{dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},csvUpload:{invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},manageCollaborators:{saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},sparkMetaForm:{shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},appIconField:{requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},appIconPickerModal:{dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},chipGroupField:{addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},dateTimeField:{requiredError:"{field} est requis"},dialcodeInputField:{requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},keywordSuggestField:{requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},licenseSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},multiSelectField:{requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},nestedSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},radioField:{requiredError:"{field} est requis"},selectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},textField:{requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},assetBrowser:{dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},resourceReorderDialog:{dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},assignPageNumber:{dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},confirmDialog:{confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},publishChecklist:{publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",noButton:"Non",yesButton:"Oui"},qualityParamsModal:{reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},unsavedChangesModal:{title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},filterChips:{contentTypeFiltersAriaLabel:"Filtres par type de contenu"},libraryCard:{alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté"},libraryDock:{selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre"},libraryFilterPanel:{boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},libraryPreviewPanel:{contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},outlineTree:{maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},treeNode:{expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},contentPlayer:{mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},dialcodePanel:{title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},progressStatus:{unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},splitBuilderShell:{dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},topbar:{draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},reviewCommentModal:{closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},confirmReviewModal:{closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},generateQRModal:{closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},chip:{remove:"Supprimer"},dropZone:{dropHere:"Déposer ici"},spinner:{loading:"Chargement"}},bv={contextualEditor:{emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},languageSelector:{ariaLabel:"Selecionar idioma"},collectionEditor:{errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},breadcrumb:{nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},tabBar:{detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},contentEditForm:{moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},titleAppIcon:{selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},unitContentList:{removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},contentRow:{dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},csvUpload:{invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},manageCollaborators:{saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},sparkMetaForm:{shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},appIconField:{requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},appIconPickerModal:{dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},chipGroupField:{addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},dateTimeField:{requiredError:"{field} é obrigatório"},dialcodeInputField:{requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},keywordSuggestField:{requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},licenseSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},multiSelectField:{requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},nestedSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},radioField:{requiredError:"{field} é obrigatório"},selectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},textField:{requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},assetBrowser:{dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},resourceReorderDialog:{dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},assignPageNumber:{dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},confirmDialog:{confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},publishChecklist:{publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",noButton:"Não",yesButton:"Sim"},qualityParamsModal:{reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},unsavedChangesModal:{title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},filterChips:{contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},libraryCard:{alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado"},libraryDock:{selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente"},libraryFilterPanel:{boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},libraryPreviewPanel:{contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},outlineTree:{maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},treeNode:{expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},contentPlayer:{mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},dialcodePanel:{title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},progressStatus:{unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},splitBuilderShell:{dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},topbar:{draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},reviewCommentModal:{closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},confirmReviewModal:{closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},generateQRModal:{closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},chip:{remove:"Remover"},dropZone:{dropHere:"Solte aqui"},spinner:{loading:"Carregando"}},wv=["en","ar","fr","pt"],Cv=["ar"],Sv={en:ss,ar:yv,fr:vv,pt:bv};function md(e,t){const r={...e};for(const n of Object.keys(t)){const o=e[n],a=t[n];o&&a&&typeof o=="object"&&typeof a=="object"&&!Array.isArray(o)&&!Array.isArray(a)?r[n]=md(o,a):a!==void 0&&(r[n]=a)}return r}function yd(e){const t=Sv[e];return!t||e==="en"?ss:md(ss,t)}function _v(e){return Cv.includes(e)}const ls="app-language",cs="app-language-change",_a=yo(e=>({lang:"en",labelConfig:yd("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:yd(t)}),localStorage.setItem(ls,t),document.documentElement.setAttribute("dir",_v(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(cs,{detail:{lang:t}}))}}));function le(){return _a(e=>e.labelConfig)}const Tv=({size:e=16,color:t="currentColor"})=>{const r=le();return c.jsx("svg",{className:mv.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:c.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},$e=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:o,children:a,className:i,type:s="button"})=>c.jsxs("button",{type:s,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${i??""}`,onClick:o,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?c.jsx(Tv,{size:14}):null,a]}),ds={languageSelector:"_languageSelector_vmwcn_1",languageBtn:"_languageBtn_vmwcn_10",active:"_active_vmwcn_24"},Ev={en:"EN",ar:"AR",fr:"FR",pt:"PT"},Iv=()=>{const e=le(),t=_a(n=>n.lang),r=_a(n=>n.setLanguage);return c.jsx("div",{className:ds.languageSelector,role:"group","aria-label":e.languageSelector.ariaLabel,children:wv.map(n=>c.jsx("button",{type:"button",className:`${ds.languageBtn} ${t===n?ds.active:""}`,onClick:()=>r(n),"aria-pressed":t===n,children:Ev[n]},n))})},Fe={overlay:"_overlay_w9xez_1",modal:"_modal_w9xez_11",modalHeader:"_modalHeader_w9xez_23",modalHeaderClose:"_modalHeaderClose_w9xez_33",modalBody:"_modalBody_w9xez_51",modalFooter:"_modalFooter_w9xez_58",checkRow:"_checkRow_w9xez_65",formGroup:"_formGroup_w9xez_108",textarea:"_textarea_w9xez_119",sliderGroup:"_sliderGroup_w9xez_140",sliderValue:"_sliderValue_w9xez_152",sliderLabels:"_sliderLabels_w9xez_160",sectionTitle:"_sectionTitle_w9xez_168"},Ov=({contentId:e,onConfirm:t,onCancel:r})=>{const n=le(),o=ce(u=>{var m,g;return(g=(m=u.editorConfig)==null?void 0:m.config)==null?void 0:g.objectType})||"Content",a=ce(u=>u.publishChecklist)??[],[i,s]=h.useState({}),l=a.every(u=>i[u.code]),d=a.length===0||l,f=()=>{t()};return c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",o]}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:a.length===0?c.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",o,"?"]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:Fe.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(u=>c.jsxs("label",{className:Fe.checkRow,children:[c.jsx("input",{type:"checkbox",checked:!!i[u.code],onChange:m=>s(g=>({...g,[u.code]:m.target.checked}))}),c.jsx("span",{children:u.label})]},u.code))]})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),c.jsx($e,{variant:"primary",onClick:f,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},Av=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const o=le(),[a,i]=h.useState(""),[s,l]=h.useState(7),d=t==="approve",f=d?o.qualityParamsModal.reviewQualityTitle:o.qualityParamsModal.rejectContentTitle,u=!d&&a.trim().length===0,m=()=>{d?r(a.trim(),s):r(a.trim())};return c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsx("span",{id:"quality-modal-title",children:f}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:n,"aria-label":o.qualityParamsModal.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:d?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:Fe.formGroup,children:[c.jsx("label",{htmlFor:"quality-score",children:o.qualityParamsModal.qualityScoreLabel}),c.jsxs("div",{className:Fe.sliderGroup,children:[c.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:s,onChange:g=>l(Number(g.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":s}),c.jsx("span",{className:Fe.sliderValue,children:s})]}),c.jsxs("div",{className:Fe.sliderLabels,children:[c.jsx("span",{children:o.qualityParamsModal.scorePoorLabel}),c.jsx("span",{children:o.qualityParamsModal.scoreExcellentLabel})]})]}),c.jsxs("div",{className:Fe.formGroup,children:[c.jsxs("label",{htmlFor:"quality-comment",children:[o.qualityParamsModal.commentLabel," ",c.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:o.qualityParamsModal.optionalLabel})]}),c.jsx("textarea",{id:"quality-comment",className:Fe.textarea,placeholder:o.qualityParamsModal.commentPlaceholder,value:a,onChange:g=>i(g.target.value),rows:4})]})]}):c.jsxs("div",{className:Fe.formGroup,children:[c.jsxs("label",{htmlFor:"reject-reason",children:[o.qualityParamsModal.rejectionReasonLabel," ",c.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:"reject-reason",className:Fe.textarea,placeholder:o.qualityParamsModal.rejectReasonPlaceholder,value:a,onChange:g=>i(g.target.value),rows:5,required:!0,"aria-required":"true"}),a.trim().length===0&&c.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:o.qualityParamsModal.rejectionRequiredMessage})]})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:n,children:o.qualityParamsModal.cancelButton}),c.jsx($e,{variant:d?"primary":"danger",onClick:m,disabled:u,children:d?o.qualityParamsModal.approveButton:o.qualityParamsModal.rejectButton})]})]})})};function vd(e,t){return function(){return e.apply(t,arguments)}}const{toString:Dv}=Object.prototype,{getPrototypeOf:_n}=Object,{iterator:vo,toStringTag:bd}=Symbol,Ta=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),bo=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Ta(r,t))return!0;r=_n(r)}return!1},Nv=(e,t)=>e!=null&&bo(e,t)?e[t]:void 0,us=(e=>t=>{const r=Dv.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xt=e=>(e=e.toLowerCase(),t=>us(t)===e),Ea=e=>t=>typeof t===e,{isArray:Qr}=Array,Tn=Ea("undefined");function En(e){return e!==null&&!Tn(e)&&e.constructor!==null&&!Tn(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wd=Xt("ArrayBuffer");function kv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&wd(e.buffer),t}const xv=Ea("string"),Dt=Ea("function"),Cd=Ea("number"),In=e=>e!==null&&typeof e=="object",Lv=e=>e===!0||e===!1,Ia=e=>{if(!In(e))return!1;const t=_n(e);return(t===null||t===Object.prototype||_n(t)===null)&&!bo(e,bd)&&!bo(e,vo)},Pv=e=>{if(!In(e)||En(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Fv=Xt("Date"),Mv=Xt("File"),$v=e=>!!(e&&typeof e.uri<"u"),Bv=e=>e&&typeof e.getParts<"u",jv=Xt("Blob"),qv=Xt("FileList"),Uv=e=>In(e)&&Dt(e.pipe);function zv(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Sd=zv(),_d=typeof Sd.FormData<"u"?Sd.FormData:void 0,Vv=e=>{if(!e)return!1;if(_d&&e instanceof _d)return!0;const t=_n(e);if(!t||t===Object.prototype||!Dt(e.append))return!1;const r=us(e);return r==="formdata"||r==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"},Hv=Xt("URLSearchParams"),[Rv,Qv,Gv,Wv]=["ReadableStream","Request","Response","Headers"].map(Xt),Kv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Qr(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(En(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let s;for(n=0;n<i;n++)s=a[n],t.call(null,e[s],s,e)}}function Td(e,t){if(En(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const Gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ed=e=>!Tn(e)&&e!==Gr;function fs(...e){const{caseless:t,skipUndefined:r}=Ed(this)&&this||{},n={},o=(a,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=t&&typeof i=="string"&&Td(n,i)||i,l=Ta(n,s)?n[s]:void 0;Ia(l)&&Ia(a)?n[s]=fs(l,a):Ia(a)?n[s]=fs({},a):Qr(a)?n[s]=a.slice():(!r||!Tn(a))&&(n[s]=a)};for(let a=0,i=e.length;a<i;a++){const s=e[a];if(!s||En(s)||(wo(s,o),typeof s!="object"||Qr(s)))continue;const l=Object.getOwnPropertySymbols(s);for(let d=0;d<l.length;d++){const f=l[d];sb.call(s,f)&&o(s[f],f)}}return n}const Yv=(e,t,r,{allOwnKeys:n}={})=>(wo(t,(o,a)=>{r&&Dt(o)?Object.defineProperty(e,a,{__proto__:null,value:vd(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Zv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xv=(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)},Jv=(e,t,r,n)=>{let o,a,i;const s={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],(!n||n(i,e,t))&&!s[i]&&(t[i]=e[i],s[i]=!0);e=r!==!1&&_n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},eb=(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},tb=e=>{if(!e)return null;if(Qr(e))return e;let t=e.length;if(!Cd(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},rb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_n(Uint8Array)),nb=(e,t)=>{const n=(e&&e[vo]).call(e);let o;for(;(o=n.next())&&!o.done;){const a=o.value;t.call(e,a[0],a[1])}},ob=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ab=Xt("HTMLFormElement"),ib=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),{propertyIsEnumerable:sb}=Object.prototype,lb=Xt("RegExp"),Id=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};wo(r,(o,a)=>{let i;(i=t(o,a,e))!==!1&&(n[a]=i||o)}),Object.defineProperties(e,n)},cb=e=>{Id(e,(t,r)=>{if(Dt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Dt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},db=(e,t)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return Qr(e)?n(e):n(String(e).split(t)),r},ub=()=>{},fb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function hb(e){return!!(e&&Dt(e.append)&&e[bd]==="FormData"&&e[vo])}const pb=e=>{const t=new WeakSet,r=n=>{if(In(n)){if(t.has(n))return;if(En(n))return n;if(!("toJSON"in n)){t.add(n);const o=Qr(n)?[]:{};return wo(n,(a,i)=>{const s=r(a);!Tn(s)&&(o[i]=s)}),t.delete(n),o}}return n};return r(e)},gb=Xt("AsyncFunction"),mb=e=>e&&(In(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),Od=((e,t)=>e?setImmediate:t?((r,n)=>(Gr.addEventListener("message",({source:o,data:a})=>{o===Gr&&a===r&&n.length&&n.shift()()},!1),o=>{n.push(o),Gr.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Dt(Gr.postMessage)),yb=typeof queueMicrotask<"u"?queueMicrotask.bind(Gr):typeof process<"u"&&process.nextTick||Od,Ad=e=>e!=null&&Dt(e[vo]),O={isArray:Qr,isArrayBuffer:wd,isBuffer:En,isFormData:Vv,isArrayBufferView:kv,isString:xv,isNumber:Cd,isBoolean:Lv,isObject:In,isPlainObject:Ia,isEmptyObject:Pv,isReadableStream:Rv,isRequest:Qv,isResponse:Gv,isHeaders:Wv,isUndefined:Tn,isDate:Fv,isFile:Mv,isReactNativeBlob:$v,isReactNative:Bv,isBlob:jv,isRegExp:lb,isFunction:Dt,isStream:Uv,isURLSearchParams:Hv,isTypedArray:rb,isFileList:qv,forEach:wo,merge:fs,extend:Yv,trim:Kv,stripBOM:Zv,inherits:Xv,toFlatObject:Jv,kindOf:us,kindOfTest:Xt,endsWith:eb,toArray:tb,forEachEntry:nb,matchAll:ob,isHTMLForm:ab,hasOwnProperty:Ta,hasOwnProp:Ta,hasOwnInPrototypeChain:bo,getSafeProp:Nv,reduceDescriptors:Id,freezeMethods:cb,toObjectSet:db,toCamelCase:ib,noop:ub,toFiniteNumber:fb,findKey:Td,global:Gr,isContextDefined:Ed,isSpecCompliantForm:hb,toJSONObject:pb,isAsyncFn:gb,isThenable:mb,setImmediate:Od,asap:yb,isIterable:Ad,isSafeIterable:e=>e!=null&&bo(e,vo)&&Ad(e)},vb=O.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bb=e=>{const t={};let r,n,o;return e&&e.split(`
|
|
489
|
-
`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&
|
|
490
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Nd]=this[Nd]={accessors:{}}).accessors,o=this.prototype;function a(i){const s=Co(i);n[s]||(Ab(o,i),n[s]=!0)}return O.isArray(t)?t.forEach(a):a(t),this}};gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(gt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),O.freezeMethods(gt);const Db="[REDACTED ****]";function Nb(e){if(O.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(O.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function kb(e,t){const r=new Set(t.map(a=>String(a).toLowerCase())),n=[],o=a=>{if(a===null||typeof a!="object"||O.isBuffer(a))return a;if(n.indexOf(a)!==-1)return;a instanceof gt&&(a=a.toJSON()),n.push(a);let i;if(O.isArray(a))i=[],a.forEach((s,l)=>{const d=o(s);O.isUndefined(d)||(i[l]=d)});else{if(!O.isPlainObject(a)&&Nb(a))return n.pop(),a;i=Object.create(null);for(const[s,l]of Object.entries(a)){const d=r.has(s.toLowerCase())?Db:o(l);O.isUndefined(d)||(i[s]=d)}}return n.pop(),i};return o(e)}let Z=class Cp extends Error{static from(t,r,n,o,a,i){const s=new Cp(t.message,r||t.code,n,o,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),i&&Object.assign(s,i),s}constructor(t,r,n,o,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),a&&(this.response=a,this.status=a.status)}toJSON(){const t=this.config,r=t&&O.hasOwnProp(t,"redact")?t.redact:void 0,n=O.isArray(r)&&r.length>0?kb(t,r):O.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};Z.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Z.ERR_BAD_OPTION="ERR_BAD_OPTION",Z.ECONNABORTED="ECONNABORTED",Z.ETIMEDOUT="ETIMEDOUT",Z.ECONNREFUSED="ECONNREFUSED",Z.ERR_NETWORK="ERR_NETWORK",Z.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Z.ERR_DEPRECATED="ERR_DEPRECATED",Z.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Z.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Z.ERR_CANCELED="ERR_CANCELED",Z.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Z.ERR_INVALID_URL="ERR_INVALID_URL",Z.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const xb=null,kd=100;function gs(e){return O.isPlainObject(e)||O.isArray(e)}function xd(e){return O.endsWith(e,"[]")?e.slice(0,-2):e}function ms(e,t,r){return e?e.concat(t).map(function(o,a){return o=xd(o),!r&&a?"["+o+"]":o}).join(r?".":""):t}function Lb(e){return O.isArray(e)&&!e.some(gs)}const Pb=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function Aa(e,t,r){if(!O.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=O.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,C){return!O.isUndefined(C[b])});const n=r.metaTokens,o=r.visitor||w,a=r.dots,i=r.indexes,s=r.Blob||typeof Blob<"u"&&Blob,l=r.maxDepth===void 0?kd:r.maxDepth,d=s&&O.isSpecCompliantForm(t),f=[];if(!O.isFunction(o))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(O.isDate(v))return v.toISOString();if(O.isBoolean(v))return v.toString();if(!d&&O.isBlob(v))throw new Z("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(v)||O.isTypedArray(v)?d&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function m(v){if(v>l)throw new Z("Object is too deeply nested ("+v+" levels). Max depth: "+l,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(v,b){if(l===1/0)return JSON.stringify(v);const C=[];return JSON.stringify(v,function(T,I){if(!O.isObject(I))return I;for(;C.length&&C[C.length-1]!==this;)C.pop();return C.push(I),m(b+C.length-1),I})}function w(v,b,C){let S=v;if(O.isReactNative(t)&&O.isReactNativeBlob(v))return t.append(ms(C,b,a),u(v)),!1;if(v&&!C&&typeof v=="object"){if(O.endsWith(b,"{}"))b=n?b:b.slice(0,-2),v=g(v,1);else if(O.isArray(v)&&Lb(v)||(O.isFileList(v)||O.endsWith(b,"[]"))&&(S=O.toArray(v)))return b=xd(b),S.forEach(function(I,k){!(O.isUndefined(I)||I===null)&&t.append(i===!0?ms([b],k,a):i===null?b:b+"[]",u(I))}),!1}return gs(v)?!0:(t.append(ms(C,b,a),u(v)),!1)}const p=Object.assign(Pb,{defaultVisitor:w,convertValue:u,isVisitable:gs});function y(v,b,C=0){if(!O.isUndefined(v)){if(m(C),f.indexOf(v)!==-1)throw new Error("Circular reference detected in "+b.join("."));f.push(v),O.forEach(v,function(T,I){(!(O.isUndefined(T)||T===null)&&o.call(t,T,O.isString(I)?I.trim():I,b,p))===!0&&y(T,b?b.concat(I):[I],C+1)}),f.pop()}}if(!O.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Ld(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function ys(e,t){this._pairs=[],e&&Aa(e,this,t)}const Pd=ys.prototype;Pd.append=function(t,r){this._pairs.push([t,r])},Pd.toString=function(t){const r=t?function(n){return t.call(this,n,Ld)}:Ld;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Fb(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Fd(e,t,r){if(!t)return e;const n=O.isFunction(r)?{serialize:r}:r,o=O.getSafeProp(n,"encode")||Fb,a=O.getSafeProp(n,"serialize");let i;if(a?i=a(t,n):i=O.isURLSearchParams(t)?t.toString():new ys(t,n).toString(o),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Md{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){O.forEach(this.handlers,function(n){n!==null&&t(n)})}}const vs={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Mb={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ys,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},bs=typeof window<"u"&&typeof document<"u",ws=typeof navigator=="object"&&navigator||void 0,$b=bs&&(!ws||["ReactNative","NativeScript","NS"].indexOf(ws.product)<0),Bb=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jb=bs&&window.location.href||"http://localhost",ut={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:bs,hasStandardBrowserEnv:$b,hasStandardBrowserWebWorkerEnv:Bb,navigator:ws,origin:jb},Symbol.toStringTag,{value:"Module"})),...Mb};function qb(e,t){return Aa(e,new ut.classes.URLSearchParams,{visitor:function(r,n,o,a){return ut.isNode&&O.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}const $d=kd;function Bd(e){if(e>$d)throw new Z("FormData field is too deeply nested ("+e+" levels). Max depth: "+$d,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ub(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)Bd(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function zb(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n<o;n++)a=r[n],t[a]=e[a];return t}function jd(e){function t(r,n,o,a){Bd(a);let i=r[a++];if(i==="__proto__")return!0;const s=Number.isFinite(+i),l=a>=r.length;return i=!i&&O.isArray(o)?o.length:i,l?(O.hasOwnProp(o,i)?o[i]=O.isArray(o[i])?o[i].concat(n):[o[i],n]:o[i]=n,!s):((!O.hasOwnProp(o,i)||!O.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],a)&&O.isArray(o[i])&&(o[i]=zb(o[i])),!s)}if(O.isFormData(e)&&O.isFunction(e.entries)){const r={};return O.forEachEntry(e,(n,o)=>{t(Ub(n),o,r,0)}),r}return null}const On=(e,t)=>e!=null&&O.hasOwnProp(e,t)?e[t]:void 0;function Vb(e,t,r){if(O.isString(e))try{return(t||JSON.parse)(e),O.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const So={transitional:vs,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,a=O.isObject(t);if(a&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return o?JSON.stringify(jd(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t)||O.isReadableStream(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){const l=On(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return qb(t,l).toString();if((s=O.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=On(this,"env"),f=d&&d.FormData;return Aa(s?{"files[]":t}:t,f&&new f,l)}}return a||o?(r.setContentType("application/json",!1),Vb(t)):t}],transformResponse:[function(t){const r=On(this,"transitional")||So.transitional,n=r&&r.forcedJSONParsing,o=On(this,"responseType"),a=o==="json";if(O.isResponse(t)||O.isReadableStream(t))return t;if(t&&O.isString(t)&&(n&&!o||a)){const s=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t,On(this,"parseReviver"))}catch(l){if(s)throw l.name==="SyntaxError"?Z.from(l,Z.ERR_BAD_RESPONSE,this,null,On(this,"response")):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ut.classes.FormData,Blob:ut.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch","query"],e=>{So.headers[e]={}});function Cs(e,t){const r=this||So,n=t||r,o=gt.from(n.headers);let a=n.data;return O.forEach(e,function(s){a=s.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function qd(e){return!!(e&&e.__CANCEL__)}let _o=class extends Z{constructor(t,r,n){super(t??"canceled",Z.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ud(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Z("Request failed with status code "+r.status,r.status>=400&&r.status<500?Z.ERR_BAD_REQUEST:Z.ERR_BAD_RESPONSE,r.config,r.request,r))}function Hb(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Rb(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,a=0,i;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),f=n[a];i||(i=d),r[o]=l,n[o]=d;let u=a,m=0;for(;u!==o;)m+=r[u++],u=u%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),d-i<t)return;const g=f&&d-f;return g?Math.round(m*1e3/g):void 0}}function Qb(e,t){let r=0,n=1e3/t,o,a;const i=(d,f=Date.now())=>{r=f,o=null,a&&(clearTimeout(a),a=null),e(...d)};return[(...d)=>{const f=Date.now(),u=f-r;u>=n?i(d,f):(o=d,a||(a=setTimeout(()=>{a=null,i(o)},n-u)))},()=>o&&i(o)]}const Da=(e,t,r=3)=>{let n=0;const o=Rb(50,250);return Qb(a=>{if(!a||typeof a.loaded!="number")return;const i=a.loaded,s=a.lengthComputable?a.total:void 0,l=s!=null?Math.min(i,s):i,d=Math.max(0,l-n),f=o(d);n=Math.max(n,l);const u={loaded:l,total:s,progress:s?l/s:void 0,bytes:d,rate:f||void 0,estimated:f&&s?(s-l)/f:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(u)},r)},zd=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Vd=e=>(...t)=>O.asap(()=>e(...t)),Gb=ut.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ut.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ut.origin),ut.navigator&&/(msie|trident)/i.test(ut.navigator.userAgent)):()=>!0,Wb=ut.hasStandardBrowserEnv?{write(e,t,r,n,o,a,i){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];O.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),O.isString(n)&&s.push(`path=${n}`),O.isString(o)&&s.push(`domain=${o}`),a===!0&&s.push("secure"),O.isString(i)&&s.push(`SameSite=${i}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(o!==-1&&n.slice(0,o)===e)return decodeURIComponent(n.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Kb(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Yb(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Zb=/^https?:(?!\/\/)/i,Xb=/[\t\n\r]/g;function Jb(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function ew(e){return Jb(e).replace(Xb,"")}function Hd(e,t){if(typeof e=="string"&&Zb.test(ew(e)))throw new Z('Invalid URL: missing "//" after protocol',Z.ERR_INVALID_URL,t)}function Rd(e,t,r,n){Hd(t,n);let o=!Kb(t);return e&&(o||r===!1)?(Hd(e,n),Yb(e,t)):t}const Qd=e=>e instanceof gt?{...e}:e;function Wr(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(f,u,m,g){return O.isPlainObject(f)&&O.isPlainObject(u)?O.merge.call({caseless:g},f,u):O.isPlainObject(u)?O.merge({},u):O.isArray(u)?u.slice():u}function o(f,u,m,g){if(O.isUndefined(u)){if(!O.isUndefined(f))return n(void 0,f,m,g)}else return n(f,u,m,g)}function a(f,u){if(!O.isUndefined(u))return n(void 0,u)}function i(f,u){if(O.isUndefined(u)){if(!O.isUndefined(f))return n(void 0,f)}else return n(void 0,u)}function s(f){const u=O.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!O.isUndefined(u))if(O.isPlainObject(u)){if(O.hasOwnProp(u,f))return u[f]}else return;const m=O.hasOwnProp(e,"transitional")?e.transitional:void 0;if(O.isPlainObject(m)&&O.hasOwnProp(m,f))return m[f]}function l(f,u,m){if(O.hasOwnProp(t,m))return n(f,u);if(O.hasOwnProp(e,m))return n(void 0,f)}const d={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:l,headers:(f,u,m)=>o(Qd(f),Qd(u),m,!0)};return O.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const m=O.hasOwnProp(d,u)?d[u]:o,g=O.hasOwnProp(e,u)?e[u]:void 0,w=O.hasOwnProp(t,u)?t[u]:void 0,p=m(g,w,u);O.isUndefined(p)&&m!==l||(r[u]=p)}),O.hasOwnProp(t,"validateStatus")&&O.isUndefined(t.validateStatus)&&s("validateStatusUndefinedResolves")===!1&&(O.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const tw=["content-type","content-length"];function rw(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{tw.includes(n.toLowerCase())&&e.set(n,o)})}const nw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Gd(e){const t=Wr({},e),r=m=>O.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let o=r("withXSRFToken");const a=r("xsrfHeaderName"),i=r("xsrfCookieName");let s=r("headers");const l=r("auth"),d=r("baseURL"),f=r("allowAbsoluteUrls"),u=r("url");if(t.headers=s=gt.from(s),t.url=Fd(Rd(d,u,f,t),r("params"),r("paramsSerializer")),l){const m=O.getSafeProp(l,"username")||"",g=O.getSafeProp(l,"password")||"";s.set("Authorization","Basic "+btoa(m+":"+(g?nw(g):"")))}if(O.isFormData(n)&&(ut.hasStandardBrowserEnv||ut.hasStandardBrowserWebWorkerEnv||O.isReactNative(n)?s.setContentType(void 0):O.isFunction(n.getHeaders)&&rw(s,n.getHeaders(),r("formDataHeaderPolicy"))),ut.hasStandardBrowserEnv&&(O.isFunction(o)&&(o=o(t)),o===!0||o==null&&Gb(t.url))){const g=a&&i&&Wb.read(i);g&&s.set(a,g)}return t}const ow=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Gd(e);let a=o.data;const i=gt.from(o.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:d}=o,f,u,m,g,w;function p(){g&&g(),w&&w(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function v(){if(!y)return;const C=gt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),T={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:C,config:e,request:y};Ud(function(k){r(k),p()},function(k){n(k),p()},T),y=null}"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(v)},y.onabort=function(){y&&(n(new Z("Request aborted",Z.ECONNABORTED,e,y)),p(),y=null)},y.onerror=function(S){const T=S&&S.message?S.message:"Network Error",I=new Z(T,Z.ERR_NETWORK,e,y);I.event=S||null,n(I),p(),y=null},y.ontimeout=function(){let S=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||vs;o.timeoutErrorMessage&&(S=o.timeoutErrorMessage),n(new Z(S,T.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,e,y)),p(),y=null},a===void 0&&i.setContentType(null),"setRequestHeader"in y&&O.forEach(Dd(i),function(S,T){y.setRequestHeader(T,S)}),O.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),s&&s!=="json"&&(y.responseType=o.responseType),d&&([m,w]=Da(d,!0),y.addEventListener("progress",m)),l&&y.upload&&([u,g]=Da(l),y.upload.addEventListener("progress",u),y.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=C=>{y&&(n(!C||C.type?new _o(null,e,y):C),y.abort(),p(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const b=Hb(o.url);if(b&&!ut.protocols.includes(b)){n(new Z("Unsupported protocol "+b+":",Z.ERR_BAD_REQUEST,e));return}y.send(a||null)})},aw=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(l){if(!n){n=!0,i();const d=l instanceof Error?l:this.reason;r.abort(d instanceof Z?d:new _o(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,o(new Z(`timeout of ${t}ms exceeded`,Z.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>O.asap(i),s},iw=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},sw=async function*(e,t){for await(const r of lw(e))yield*iw(r,t)},lw=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Wd=(e,t,r,n)=>{const o=sw(e,t);let a=0,i,s=l=>{i||(i=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:d,value:f}=await o.next();if(d){s(),l.close();return}let u=f.byteLength;if(r){let m=a+=u;r(m)}l.enqueue(new Uint8Array(f))}catch(d){throw s(d),d}},cancel(l){return s(l),o.return()}},{highWaterMark:2})},Na=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cw=(e,t,r)=>t+2<r&&Na(e.charCodeAt(t+1))&&Na(e.charCodeAt(t+2));function dw(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let i=n.length;const s=n.length;for(let g=0;g<s;g++)if(n.charCodeAt(g)===37&&g+2<s){const w=n.charCodeAt(g+1),p=n.charCodeAt(g+2);Na(w)&&Na(p)&&(i-=2,g+=2)}let l=0,d=s-1;const f=g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100);d>=0&&(n.charCodeAt(d)===61?(l++,d--):f(d)&&(l++,d-=3)),l===1&&d>=0&&(n.charCodeAt(d)===61||f(d))&&l++;const m=Math.floor(i/4)*3-(l||0);return m>0?m:0}let a=0;for(let i=0,s=n.length;i<s;i++){const l=n.charCodeAt(i);if(l===37&&cw(n,i,s))a+=1,i+=2;else if(l<128)a+=1;else if(l<2048)a+=2;else if(l>=55296&&l<=56319&&i+1<s){const d=n.charCodeAt(i+1);d>=56320&&d<=57343?(a+=4,i++):a+=3}else a+=3}return a}const Ss="1.18.0",Kd=64*1024,{isFunction:ka}=O,uw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Yd=e=>{if(!O.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Zd=(e,...t)=>{try{return!!e(...t)}catch{return!1}},fw=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},hw=e=>{const t=O.global!==void 0&&O.global!==null?O.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=O.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:a,Response:i}=e,s=o?ka(o):typeof fetch=="function",l=ka(a),d=ka(i);if(!s)return!1;const f=s&&ka(r),u=s&&(typeof n=="function"?(v=>b=>v.encode(b))(new n):async v=>new Uint8Array(await new a(v).arrayBuffer())),m=l&&f&&Zd(()=>{let v=!1;const b=new a(ut.origin,{body:new r,method:"POST",get duplex(){return v=!0,"half"}}),C=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),v&&!C}),g=d&&f&&Zd(()=>O.isReadableStream(new i("").body)),w={stream:g&&(v=>v.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!w[v]&&(w[v]=(b,C)=>{let S=b&&b[v];if(S)return S.call(b);throw new Z(`Response type '${v}' is not supported`,Z.ERR_NOT_SUPPORT,C)})});const p=async v=>{if(v==null)return 0;if(O.isBlob(v))return v.size;if(O.isSpecCompliantForm(v))return(await new a(ut.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(O.isArrayBufferView(v)||O.isArrayBuffer(v))return v.byteLength;if(O.isURLSearchParams(v)&&(v=v+""),O.isString(v))return(await u(v)).byteLength},y=async(v,b)=>{const C=O.toFiniteNumber(v.getContentLength());return C??p(b)};return async v=>{let{url:b,method:C,data:S,signal:T,cancelToken:I,timeout:k,onDownloadProgress:x,onUploadProgress:$,responseType:j,headers:N,withCredentials:L="same-origin",fetchOptions:B,maxContentLength:P,maxBodyLength:F}=Gd(v);const V=O.isNumber(P)&&P>-1,X=O.isNumber(F)&&F>-1,ve=H=>O.hasOwnProp(v,H)?v[H]:void 0;let Ee=o||fetch;j=j?(j+"").toLowerCase():"text";let Ce=aw([T,I&&I.toAbortSignal()],k),ue=null;const Q=Ce&&Ce.unsubscribe&&(()=>{Ce.unsubscribe()});let ne,te=null;const U=()=>new Z("Request body larger than maxBodyLength limit",Z.ERR_BAD_REQUEST,v,ue);try{let H;const ae=ve("auth");if(ae){const re=O.getSafeProp(ae,"username")||"",Ke=O.getSafeProp(ae,"password")||"";H={username:re,password:Ke}}if(fw(b)){const re=new URL(b,ut.origin);if(!H&&(re.username||re.password)){const Ke=Yd(re.username),Re=Yd(re.password);H={username:Ke,password:Re}}(re.username||re.password)&&(re.username="",re.password="",b=re.href)}if(H&&(N.delete("authorization"),N.set("Authorization","Basic "+btoa(uw((H.username||"")+":"+(H.password||""))))),V&&typeof b=="string"&&b.startsWith("data:")&&dw(b)>P)throw new Z("maxContentLength size of "+P+" exceeded",Z.ERR_BAD_RESPONSE,v,ue);if(X&&C!=="get"&&C!=="head"){const re=await p(S);if(typeof re=="number"&&isFinite(re)&&(ne=re,re>F))throw U()}const fe=X&&(O.isReadableStream(S)||O.isStream(S)),J=(re,Ke,Re)=>Wd(re,Kd,He=>{if(X&&He>F)throw te=U();Ke&&Ke(He)},Re);if(m&&C!=="get"&&C!=="head"&&($||fe)){if(ne=ne??await y(N,S),ne!==0||fe){let re=new a(b,{method:"POST",body:S,duplex:"half"}),Ke;if(O.isFormData(S)&&(Ke=re.headers.get("content-type"))&&N.setContentType(Ke),re.body){const[Re,He]=$&&zd(ne,Da(Vd($)))||[];S=J(re.body,Re,He)}}}else if(fe&&!l&&f&&C!=="get"&&C!=="head")S=J(S);else if(fe&&l&&!m&&C!=="get"&&C!=="head")throw new Z("Stream request bodies are not supported by the current fetch implementation",Z.ERR_NOT_SUPPORT,v,ue);O.isString(L)||(L=L?"include":"omit");const oe=l&&"credentials"in a.prototype;if(O.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/"+Ss,!1);const Me={...B,signal:Ce,method:C.toUpperCase(),headers:Dd(N.normalize()),body:S,duplex:"half",credentials:oe?L:void 0};ue=l&&new a(b,Me);let Oe=await(l?Ee(ue,B):Ee(b,Me));const ze=gt.from(Oe.headers);if(V){const re=O.toFiniteNumber(ze.getContentLength());if(re!=null&&re>P)throw new Z("maxContentLength size of "+P+" exceeded",Z.ERR_BAD_RESPONSE,v,ue)}const We=g&&(j==="stream"||j==="response");if(g&&Oe.body&&(x||V||We&&Q)){const re={};["status","statusText","headers"].forEach(It=>{re[It]=Oe[It]});const Ke=O.toFiniteNumber(ze.getContentLength()),[Re,He]=x&&zd(Ke,Da(Vd(x),!0))||[];let et=0;const Gt=It=>{if(V&&(et=It,et>P))throw new Z("maxContentLength size of "+P+" exceeded",Z.ERR_BAD_RESPONSE,v,ue);Re&&Re(It)};Oe=new i(Wd(Oe.body,Kd,Gt,()=>{He&&He(),Q&&Q()}),re)}j=j||"text";let Ve=await w[O.findKey(w,j)||"text"](Oe,v);if(V&&!g&&!We){let re;if(Ve!=null&&(typeof Ve.byteLength=="number"?re=Ve.byteLength:typeof Ve.size=="number"?re=Ve.size:typeof Ve=="string"&&(re=typeof n=="function"?new n().encode(Ve).byteLength:Ve.length)),typeof re=="number"&&re>P)throw new Z("maxContentLength size of "+P+" exceeded",Z.ERR_BAD_RESPONSE,v,ue)}return!We&&Q&&Q(),await new Promise((re,Ke)=>{Ud(re,Ke,{data:Ve,headers:gt.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:v,request:ue})})}catch(H){if(Q&&Q(),Ce&&Ce.aborted&&Ce.reason instanceof Z){const ae=Ce.reason;throw ae.config=v,ue&&(ae.request=ue),H!==ae&&(ae.cause=H),ae}throw te?(ue&&!te.request&&(te.request=ue),te):H instanceof Z?(ue&&!H.request&&(H.request=ue),H):H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new Z("Network Error",Z.ERR_NETWORK,v,ue,H&&H.response),{cause:H.cause||H}):Z.from(H,H&&H.code,v,ue,H&&H.response)}}},pw=new Map,Xd=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,a=[n,o,r];let i=a.length,s=i,l,d,f=pw;for(;s--;)l=a[s],d=f.get(l),d===void 0&&f.set(l,d=s?new Map:hw(t)),f=d;return d};Xd();const _s={http:xb,xhr:ow,fetch:{get:Xd}};O.forEach(_s,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Jd=e=>`- ${e}`,gw=e=>O.isFunction(e)||e===null||e===!1;function mw(e,t){e=O.isArray(e)?e:[e];const{length:r}=e;let n,o;const a={};for(let i=0;i<r;i++){n=e[i];let s;if(o=n,!gw(n)&&(o=_s[(s=String(n)).toLowerCase()],o===void 0))throw new Z(`Unknown adapter '${s}'`);if(o&&(O.isFunction(o)||(o=o.get(t))))break;a[s||"#"+i]=o}if(!o){const i=Object.entries(a).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=r?i.length>1?`since :
|
|
491
|
-
`+i.map(
|
|
492
|
-
`):" "+
|
|
488
|
+
*/var id;function av(){return id||(id=1,process.env.NODE_ENV!=="production"&&function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,r=ns(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;os.useSyncExternalStoreWithSelector=function(d,f,u,m,g){var w=a(null);if(w.current===null){var p={hasValue:!1,value:null};w.current=p}else p=w.current;w=s(function(){function v(I){if(!b){if(b=!0,C=I,I=m(I),g!==void 0&&p.hasValue){var k=p.value;if(g(k,I))return S=k}return S=I}if(k=S,n(C,I))return k;var x=m(I);return g!==void 0&&g(k,x)?(C=I,k):(C=I,S=x)}var b=!1,C,S,T=u===void 0?null:u;return[function(){return v(f())},T===null?void 0:function(){return v(T())}]},[f,u,m,g]);var y=o(d,w[0],w[1]);return i(function(){p.hasValue=!0,p.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),os}process.env.NODE_ENV==="production"?Ji.exports=ov():Ji.exports=av();var iv=Ji.exports;const sv=td(iv),sd={},{useDebugValue:lv}=h,{useSyncExternalStoreWithSelector:cv}=sv;let ld=!1;const dv=e=>e;function uv(e,t=dv,r){(sd?"production":void 0)!=="production"&&r&&!ld&&(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"),ld=!0);const n=cv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return lv(n),n}const cd=e=>{(sd?"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"?tv(e):e,r=(n,o)=>uv(t,n,o);return Object.assign(r,t),r},yo=e=>e?cd(e):cd,le=yo(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=le.getState().formStatusMapper,n=[...t];for(;n.length>0;){const o=n.shift();if(r[o.id]===!1)return!1;o.children&&n.push(...o.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),fv=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:le},Symbol.toStringTag,{value:"Module"}));function Rr(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function dd(e,t,r=0){var n;for(const o of e){if(o.id===t)return r;if((n=o.children)!=null&&n.length){const a=dd(o.children,t,r+1);if(a>=0)return a}}return-1}const hv=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function ud(e,t,r){return e.map(n=>{if(n.id===t){const o=r.metadata??{},a={};for(const i of hv)i in r&&(a[i]=r[i]);return{...n,...r,metadata:{...n.metadata??{},...a,...o}}}return n.children&&n.children.length>0?{...n,children:ud(n.children,t,r)}:n})}function Sa(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:Sa(n.children,t,r)}:n)}function as(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?as(r.children,t):[]}))}function fd(e,t,r,n){return e.map(o=>{if(o.id===t){const a=[...o.children??[]],[i]=a.splice(r,1);return a.splice(n,0,i),{...o,children:a}}return o.children&&o.children.length>0?{...o,children:fd(o.children,t,r,n)}:o})}function hd(e,t){return e.map(r=>{const n=t[r.id]??r.id,o=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:o,children:r.children?hd(r.children,t):[]}})}function pv(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 gv(e,t){const r=Rr(e,t);if(!r)return[];const n=[];let o=r;for(;o;)n.unshift({id:o.id,name:o.name}),o=o.parent?Rr(e,o.parent):void 0;return n}const Ae=yo((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var o;const n=((o=r[0])==null?void 0:o.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:o,getBreadcrumb:a}=t(),i=Rr(n,r),s=a(r),l={...(i==null?void 0:i.metadata)??{},...o[r]??{}};le.getState().setNodeFlags({isFolder:(i==null?void 0:i.isFolder)??!1,isRoot:!(i!=null&&i.parent),isQuml:!1}),e({selectedNodeId:r,breadcrumb:s,activeNodeMeta:l})},updateNode:(r,n)=>{e(o=>({treeData:ud(o.treeData,r,n),treeCache:{...o.treeCache,[r]:{...o.treeCache[r]??{},...n}}})),t().markDirty()},addNode:(r,n)=>{var d,f;const o=t(),a=((f=(d=le.getState().editorConfig)==null?void 0:d.config)==null?void 0:f.maxDepth)??4,i=dd(o.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const s="temp-"+Math.random().toString(36).slice(2),l={id:s,identifier:s,name:"Untitled Unit",isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:s,name:"Untitled Unit",visibility:"Parent"}};return e(u=>({treeData:Sa(u.treeData,r,l),treeCache:{...u.treeCache,[s]:{...l.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(s),0),s},deleteNode:r=>{e(n=>({treeData:as(n.treeData,r),selectedNodeId:n.selectedNodeId===r?null:n.selectedNodeId}))},reorderChildren:(r,n,o)=>{e(a=>({treeData:fd(a.treeData,r,n,o)}))},moveNode:(r,n,o)=>{e(a=>{const i=Rr(a.treeData,r);if(!i)return a;let s=as(a.treeData,r);return s=Sa(s,o,{...i,parent:o}),{treeData:s}}),t().markDirty()},addResource:(r,n)=>{var f,u,m;const o=le.getState().editorConfig,a=((f=o==null?void 0:o.config)==null?void 0:f.allowContentUnderRoot)??!1,i=(u=t().treeData[0])==null?void 0:u.id;if(!a&&n===i||Rr(t().treeData,r.identifier))return!1;const s=((m=o==null?void 0:o.config)==null?void 0:m.maxContentsLimit)??1200;if(pv(t().treeData)>=s)return!1;const d={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:r};return e(g=>({treeData:Sa(g.treeData,n,d)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=le.getState();r==="edit"&&n(!0)},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const o=hd(n.treeData,r),a={};for(const[s,l]of Object.entries(n.treeCache)){const d=r[s]??s,{isNew:f,...u}=l;a[d]=u}const i=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:o,treeCache:a,selectedNodeId:i}})},getNodeById:r=>Rr(t().treeData,r),getChildrenOf:r=>{const n=Rr(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>gv(t().treeData,r)})),mv=yo(e=>({activeModal:null,modalData:{},openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}})})),yv={spin:"_spin_1ah4d_9"},is={contextualEditor:{emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},languageSelector:{ariaLabel:"Select language"},collectionEditor:{errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},breadcrumb:{nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},tabBar:{detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},contentEditForm:{moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},titleAppIcon:{selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},unitContentList:{removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},contentRow:{dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},csvUpload:{invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},manageCollaborators:{saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},sparkMetaForm:{shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},appIconField:{requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},appIconPickerModal:{dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},chipGroupField:{addPlaceholder:"Add…",addButtonLabel:"Add"},dateTimeField:{requiredError:"{field} is required"},dialcodeInputField:{requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},keywordSuggestField:{requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},licenseSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select license…"},multiSelectField:{requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},nestedSelectField:{requiredError:"{field} is required",selectPlaceholder:"Select…"},radioField:{requiredError:"{field} is required"},selectField:{requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},textField:{requiredError:"{field} is required",maxLengthError:"Max {max} characters"},assetBrowser:{dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},resourceReorderDialog:{dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},assignPageNumber:{dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},confirmDialog:{confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},publishChecklist:{publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",noButton:"No",yesButton:"Yes"},qualityParamsModal:{reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},unsavedChangesModal:{title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},filterChips:{contentTypeFiltersAriaLabel:"Content type filters"},libraryCard:{alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added"},libraryDock:{selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter"},libraryFilterPanel:{boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},libraryPreviewPanel:{contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},outlineTree:{maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},treeNode:{expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},contentPlayer:{mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},dialcodePanel:{title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},progressStatus:{unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},splitBuilderShell:{dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},topbar:{draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},reviewCommentModal:{closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},confirmReviewModal:{closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},generateQRModal:{closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},chip:{remove:"Remove"},dropZone:{dropHere:"Drop here"},spinner:{loading:"Loading"}},vv={contextualEditor:{emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},languageSelector:{ariaLabel:"اختيار اللغة"},collectionEditor:{errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},breadcrumb:{nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},tabBar:{detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},contentEditForm:{moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},titleAppIcon:{selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},unitContentList:{removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},contentRow:{dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},csvUpload:{invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},manageCollaborators:{saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},sparkMetaForm:{shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},appIconField:{requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},appIconPickerModal:{dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},chipGroupField:{addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},dateTimeField:{requiredError:"{field} مطلوب"},dialcodeInputField:{requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},keywordSuggestField:{requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},licenseSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},multiSelectField:{requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},nestedSelectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},radioField:{requiredError:"{field} مطلوب"},selectField:{requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},textField:{requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},assetBrowser:{dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},resourceReorderDialog:{dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},assignPageNumber:{dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},confirmDialog:{confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},publishChecklist:{publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},qualityParamsModal:{reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},unsavedChangesModal:{title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},filterChips:{contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},libraryCard:{alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},libraryDock:{selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},libraryFilterPanel:{boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},libraryPreviewPanel:{contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},outlineTree:{maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},treeNode:{expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},contentPlayer:{mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},dialcodePanel:{title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},progressStatus:{unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},splitBuilderShell:{dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},topbar:{draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},reviewCommentModal:{closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},confirmReviewModal:{closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},generateQRModal:{closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},chip:{remove:"إزالة"},dropZone:{dropHere:"أفلت هنا"},spinner:{loading:"جارٍ التحميل"}},bv={contextualEditor:{emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},languageSelector:{ariaLabel:"Sélectionner la langue"},collectionEditor:{errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},breadcrumb:{nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},tabBar:{detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},contentEditForm:{moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},titleAppIcon:{selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},unitContentList:{removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},contentRow:{dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},csvUpload:{invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},manageCollaborators:{saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},sparkMetaForm:{shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},appIconField:{requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},appIconPickerModal:{dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},chipGroupField:{addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},dateTimeField:{requiredError:"{field} est requis"},dialcodeInputField:{requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},keywordSuggestField:{requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},licenseSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},multiSelectField:{requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},nestedSelectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},radioField:{requiredError:"{field} est requis"},selectField:{requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},textField:{requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},assetBrowser:{dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},resourceReorderDialog:{dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},assignPageNumber:{dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},confirmDialog:{confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},publishChecklist:{publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",noButton:"Non",yesButton:"Oui"},qualityParamsModal:{reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},unsavedChangesModal:{title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},filterChips:{contentTypeFiltersAriaLabel:"Filtres par type de contenu"},libraryCard:{alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté"},libraryDock:{selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre"},libraryFilterPanel:{boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},libraryPreviewPanel:{contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},outlineTree:{maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},treeNode:{expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},contentPlayer:{mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},dialcodePanel:{title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},progressStatus:{unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},splitBuilderShell:{dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},topbar:{draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},reviewCommentModal:{closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},confirmReviewModal:{closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},generateQRModal:{closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},chip:{remove:"Supprimer"},dropZone:{dropHere:"Déposer ici"},spinner:{loading:"Chargement"}},wv={contextualEditor:{emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},languageSelector:{ariaLabel:"Selecionar idioma"},collectionEditor:{errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},breadcrumb:{nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},tabBar:{detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},contentEditForm:{moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},titleAppIcon:{selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},unitContentList:{removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},contentRow:{dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},csvUpload:{invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},manageCollaborators:{saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},sparkMetaForm:{shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},appIconField:{requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},appIconPickerModal:{dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},chipGroupField:{addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},dateTimeField:{requiredError:"{field} é obrigatório"},dialcodeInputField:{requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},keywordSuggestField:{requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},licenseSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},multiSelectField:{requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},nestedSelectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},radioField:{requiredError:"{field} é obrigatório"},selectField:{requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},textField:{requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},assetBrowser:{dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},resourceReorderDialog:{dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},assignPageNumber:{dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},confirmDialog:{confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},publishChecklist:{publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",noButton:"Não",yesButton:"Sim"},qualityParamsModal:{reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},unsavedChangesModal:{title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},filterChips:{contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},libraryCard:{alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado"},libraryDock:{selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente"},libraryFilterPanel:{boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},libraryPreviewPanel:{contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},outlineTree:{maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},treeNode:{expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},contentPlayer:{mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},dialcodePanel:{title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},progressStatus:{unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},splitBuilderShell:{dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},topbar:{draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},reviewCommentModal:{closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},confirmReviewModal:{closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},generateQRModal:{closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},chip:{remove:"Remover"},dropZone:{dropHere:"Solte aqui"},spinner:{loading:"Carregando"}},Cv=["ar"],Sv={en:is,ar:vv,fr:bv,pt:wv};function pd(e,t){const r={...e};for(const n of Object.keys(t)){const o=e[n],a=t[n];o&&a&&typeof o=="object"&&typeof a=="object"&&!Array.isArray(o)&&!Array.isArray(a)?r[n]=pd(o,a):a!==void 0&&(r[n]=a)}return r}function gd(e){const t=Sv[e];return!t||e==="en"?is:pd(is,t)}function _v(e){return Cv.includes(e)}const ss="app-language",ls="app-language-change",md=yo(e=>({lang:"en",labelConfig:gd("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:gd(t)}),localStorage.setItem(ss,t),document.documentElement.setAttribute("dir",_v(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(ls,{detail:{lang:t}}))}}));function ce(){return md(e=>e.labelConfig)}const Tv=({size:e=16,color:t="currentColor"})=>{const r=ce();return c.jsx("svg",{className:yv.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:c.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},$e=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:o,children:a,className:i,type:s="button"})=>c.jsxs("button",{type:s,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${i??""}`,onClick:o,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?c.jsx(Tv,{size:14}):null,a]}),Fe={overlay:"_overlay_w9xez_1",modal:"_modal_w9xez_11",modalHeader:"_modalHeader_w9xez_23",modalHeaderClose:"_modalHeaderClose_w9xez_33",modalBody:"_modalBody_w9xez_51",modalFooter:"_modalFooter_w9xez_58",checkRow:"_checkRow_w9xez_65",formGroup:"_formGroup_w9xez_108",textarea:"_textarea_w9xez_119",sliderGroup:"_sliderGroup_w9xez_140",sliderValue:"_sliderValue_w9xez_152",sliderLabels:"_sliderLabels_w9xez_160",sectionTitle:"_sectionTitle_w9xez_168"},Ev=({contentId:e,onConfirm:t,onCancel:r})=>{const n=ce(),o=le(u=>{var m,g;return(g=(m=u.editorConfig)==null?void 0:m.config)==null?void 0:g.objectType})||"Content",a=le(u=>u.publishChecklist)??[],[i,s]=h.useState({}),l=a.every(u=>i[u.code]),d=a.length===0||l,f=()=>{t()};return c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",o]}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:a.length===0?c.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",o,"?"]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:Fe.sectionTitle,children:n.publishChecklist.checklistInstructions}),a.map(u=>c.jsxs("label",{className:Fe.checkRow,children:[c.jsx("input",{type:"checkbox",checked:!!i[u.code],onChange:m=>s(g=>({...g,[u.code]:m.target.checked}))}),c.jsx("span",{children:u.label})]},u.code))]})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),c.jsx($e,{variant:"primary",onClick:f,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},Iv=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const o=ce(),[a,i]=h.useState(""),[s,l]=h.useState(7),d=t==="approve",f=d?o.qualityParamsModal.reviewQualityTitle:o.qualityParamsModal.rejectContentTitle,u=!d&&a.trim().length===0,m=()=>{d?r(a.trim(),s):r(a.trim())};return c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsx("span",{id:"quality-modal-title",children:f}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:n,"aria-label":o.qualityParamsModal.closeAriaLabel,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:d?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:Fe.formGroup,children:[c.jsx("label",{htmlFor:"quality-score",children:o.qualityParamsModal.qualityScoreLabel}),c.jsxs("div",{className:Fe.sliderGroup,children:[c.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:s,onChange:g=>l(Number(g.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":s}),c.jsx("span",{className:Fe.sliderValue,children:s})]}),c.jsxs("div",{className:Fe.sliderLabels,children:[c.jsx("span",{children:o.qualityParamsModal.scorePoorLabel}),c.jsx("span",{children:o.qualityParamsModal.scoreExcellentLabel})]})]}),c.jsxs("div",{className:Fe.formGroup,children:[c.jsxs("label",{htmlFor:"quality-comment",children:[o.qualityParamsModal.commentLabel," ",c.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:o.qualityParamsModal.optionalLabel})]}),c.jsx("textarea",{id:"quality-comment",className:Fe.textarea,placeholder:o.qualityParamsModal.commentPlaceholder,value:a,onChange:g=>i(g.target.value),rows:4})]})]}):c.jsxs("div",{className:Fe.formGroup,children:[c.jsxs("label",{htmlFor:"reject-reason",children:[o.qualityParamsModal.rejectionReasonLabel," ",c.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:"reject-reason",className:Fe.textarea,placeholder:o.qualityParamsModal.rejectReasonPlaceholder,value:a,onChange:g=>i(g.target.value),rows:5,required:!0,"aria-required":"true"}),a.trim().length===0&&c.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:o.qualityParamsModal.rejectionRequiredMessage})]})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:n,children:o.qualityParamsModal.cancelButton}),c.jsx($e,{variant:d?"primary":"danger",onClick:m,disabled:u,children:d?o.qualityParamsModal.approveButton:o.qualityParamsModal.rejectButton})]})]})})};function yd(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ov}=Object.prototype,{getPrototypeOf:_n}=Object,{iterator:vo,toStringTag:vd}=Symbol,_a=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),bo=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),_a(r,t))return!0;r=_n(r)}return!1},Av=(e,t)=>e!=null&&bo(e,t)?e[t]:void 0,cs=(e=>t=>{const r=Ov.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xt=e=>(e=e.toLowerCase(),t=>cs(t)===e),Ta=e=>t=>typeof t===e,{isArray:Qr}=Array,Tn=Ta("undefined");function En(e){return e!==null&&!Tn(e)&&e.constructor!==null&&!Tn(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bd=Xt("ArrayBuffer");function Dv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bd(e.buffer),t}const Nv=Ta("string"),Dt=Ta("function"),wd=Ta("number"),In=e=>e!==null&&typeof e=="object",kv=e=>e===!0||e===!1,Ea=e=>{if(!In(e))return!1;const t=_n(e);return(t===null||t===Object.prototype||_n(t)===null)&&!bo(e,vd)&&!bo(e,vo)},xv=e=>{if(!In(e)||En(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Lv=Xt("Date"),Pv=Xt("File"),Fv=e=>!!(e&&typeof e.uri<"u"),Mv=e=>e&&typeof e.getParts<"u",$v=Xt("Blob"),Bv=Xt("FileList"),jv=e=>In(e)&&Dt(e.pipe);function qv(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Cd=qv(),Sd=typeof Cd.FormData<"u"?Cd.FormData:void 0,Uv=e=>{if(!e)return!1;if(Sd&&e instanceof Sd)return!0;const t=_n(e);if(!t||t===Object.prototype||!Dt(e.append))return!1;const r=cs(e);return r==="formdata"||r==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"},Vv=Xt("URLSearchParams"),[zv,Hv,Rv,Qv]=["ReadableStream","Request","Response","Headers"].map(Xt),Gv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Qr(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(En(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let s;for(n=0;n<i;n++)s=a[n],t.call(null,e[s],s,e)}}function _d(e,t){if(En(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const Gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Td=e=>!Tn(e)&&e!==Gr;function ds(...e){const{caseless:t,skipUndefined:r}=Td(this)&&this||{},n={},o=(a,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=t&&typeof i=="string"&&_d(n,i)||i,l=_a(n,s)?n[s]:void 0;Ea(l)&&Ea(a)?n[s]=ds(l,a):Ea(a)?n[s]=ds({},a):Qr(a)?n[s]=a.slice():(!r||!Tn(a))&&(n[s]=a)};for(let a=0,i=e.length;a<i;a++){const s=e[a];if(!s||En(s)||(wo(s,o),typeof s!="object"||Qr(s)))continue;const l=Object.getOwnPropertySymbols(s);for(let d=0;d<l.length;d++){const f=l[d];ab.call(s,f)&&o(s[f],f)}}return n}const Wv=(e,t,r,{allOwnKeys:n}={})=>(wo(t,(o,a)=>{r&&Dt(o)?Object.defineProperty(e,a,{__proto__:null,value:yd(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Kv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Yv=(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)},Zv=(e,t,r,n)=>{let o,a,i;const s={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],(!n||n(i,e,t))&&!s[i]&&(t[i]=e[i],s[i]=!0);e=r!==!1&&_n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Xv=(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},Jv=e=>{if(!e)return null;if(Qr(e))return e;let t=e.length;if(!wd(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},eb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_n(Uint8Array)),tb=(e,t)=>{const n=(e&&e[vo]).call(e);let o;for(;(o=n.next())&&!o.done;){const a=o.value;t.call(e,a[0],a[1])}},rb=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},nb=Xt("HTMLFormElement"),ob=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),{propertyIsEnumerable:ab}=Object.prototype,ib=Xt("RegExp"),Ed=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};wo(r,(o,a)=>{let i;(i=t(o,a,e))!==!1&&(n[a]=i||o)}),Object.defineProperties(e,n)},sb=e=>{Ed(e,(t,r)=>{if(Dt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Dt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},lb=(e,t)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return Qr(e)?n(e):n(String(e).split(t)),r},cb=()=>{},db=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ub(e){return!!(e&&Dt(e.append)&&e[vd]==="FormData"&&e[vo])}const fb=e=>{const t=new WeakSet,r=n=>{if(In(n)){if(t.has(n))return;if(En(n))return n;if(!("toJSON"in n)){t.add(n);const o=Qr(n)?[]:{};return wo(n,(a,i)=>{const s=r(a);!Tn(s)&&(o[i]=s)}),t.delete(n),o}}return n};return r(e)},hb=Xt("AsyncFunction"),pb=e=>e&&(In(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),Id=((e,t)=>e?setImmediate:t?((r,n)=>(Gr.addEventListener("message",({source:o,data:a})=>{o===Gr&&a===r&&n.length&&n.shift()()},!1),o=>{n.push(o),Gr.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Dt(Gr.postMessage)),gb=typeof queueMicrotask<"u"?queueMicrotask.bind(Gr):typeof process<"u"&&process.nextTick||Id,Od=e=>e!=null&&Dt(e[vo]),O={isArray:Qr,isArrayBuffer:bd,isBuffer:En,isFormData:Uv,isArrayBufferView:Dv,isString:Nv,isNumber:wd,isBoolean:kv,isObject:In,isPlainObject:Ea,isEmptyObject:xv,isReadableStream:zv,isRequest:Hv,isResponse:Rv,isHeaders:Qv,isUndefined:Tn,isDate:Lv,isFile:Pv,isReactNativeBlob:Fv,isReactNative:Mv,isBlob:$v,isRegExp:ib,isFunction:Dt,isStream:jv,isURLSearchParams:Vv,isTypedArray:eb,isFileList:Bv,forEach:wo,merge:ds,extend:Wv,trim:Gv,stripBOM:Kv,inherits:Yv,toFlatObject:Zv,kindOf:cs,kindOfTest:Xt,endsWith:Xv,toArray:Jv,forEachEntry:tb,matchAll:rb,isHTMLForm:nb,hasOwnProperty:_a,hasOwnProp:_a,hasOwnInPrototypeChain:bo,getSafeProp:Av,reduceDescriptors:Ed,freezeMethods:sb,toObjectSet:lb,toCamelCase:ob,noop:cb,toFiniteNumber:db,findKey:_d,global:Gr,isContextDefined:Td,isSpecCompliantForm:ub,toJSONObject:fb,isAsyncFn:hb,isThenable:pb,setImmediate:Id,asap:gb,isIterable:Od,isSafeIterable:e=>e!=null&&bo(e,vo)&&Od(e)},mb=O.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),yb=e=>{const t={};let r,n,o;return e&&e.split(`
|
|
489
|
+
`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&mb[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function vb(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 bb=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),wb=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function us(e,t){return O.isArray(e)?e.map(r=>us(r,t)):vb(String(e).replace(t,""))}const Cb=e=>us(e,bb),Sb=e=>us(e,wb);function Ad(e){const t=Object.create(null);return O.forEach(e.toJSON(),(r,n)=>{t[n]=Sb(r)}),t}const Dd=Symbol("internals");function Co(e){return e&&String(e).trim().toLowerCase()}function Ia(e){return e===!1||e==null?e:O.isArray(e)?e.map(Ia):Cb(String(e))}function _b(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 Tb=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function fs(e,t,r,n,o){if(O.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!O.isString(t)){if(O.isString(n))return t.indexOf(n)!==-1;if(O.isRegExp(n))return n.test(t)}}function Eb(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Ib(e,t){const r=O.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(o,a,i){return this[n].call(this,t,o,a,i)},configurable:!0})})}let gt=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function a(s,l,d){const f=Co(l);if(!f)return;const u=O.findKey(o,f);(!u||o[u]===void 0||d===!0||d===void 0&&o[u]!==!1)&&(o[u||l]=Ia(s))}const i=(s,l)=>O.forEach(s,(d,f)=>a(d,f,l));if(O.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(O.isString(t)&&(t=t.trim())&&!Tb(t))i(yb(t),r);else if(O.isObject(t)&&O.isSafeIterable(t)){let s=Object.create(null),l,d;for(const f of t){if(!O.isArray(f))throw new TypeError("Object iterator must return a key-value pair");d=f[0],O.hasOwnProp(s,d)?(l=s[d],s[d]=O.isArray(l)?[...l,f[1]]:[l,f[1]]):s[d]=f[1]}i(s,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=Co(t),t){const n=O.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return _b(o);if(O.isFunction(r))return r.call(this,o,n);if(O.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Co(t),t){const n=O.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||fs(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function a(i){if(i=Co(i),i){const s=O.findKey(n,i);s&&(!r||fs(n,n[s],s,r))&&(delete n[s],o=!0)}}return O.isArray(t)?t.forEach(a):a(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const a=r[n];(!t||fs(this,this[a],a,t,!0))&&(delete this[a],o=!0)}return o}normalize(t){const r=this,n={};return O.forEach(this,(o,a)=>{const i=O.findKey(n,a);if(i){r[i]=Ia(o),delete r[a];return}const s=t?Eb(a):String(a).trim();s!==a&&delete r[a],r[s]=Ia(o),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return O.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&O.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
490
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Dd]=this[Dd]={accessors:{}}).accessors,o=this.prototype;function a(i){const s=Co(i);n[s]||(Ib(o,i),n[s]=!0)}return O.isArray(t)?t.forEach(a):a(t),this}};gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(gt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),O.freezeMethods(gt);const Ob="[REDACTED ****]";function Ab(e){if(O.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(O.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Db(e,t){const r=new Set(t.map(a=>String(a).toLowerCase())),n=[],o=a=>{if(a===null||typeof a!="object"||O.isBuffer(a))return a;if(n.indexOf(a)!==-1)return;a instanceof gt&&(a=a.toJSON()),n.push(a);let i;if(O.isArray(a))i=[],a.forEach((s,l)=>{const d=o(s);O.isUndefined(d)||(i[l]=d)});else{if(!O.isPlainObject(a)&&Ab(a))return n.pop(),a;i=Object.create(null);for(const[s,l]of Object.entries(a)){const d=r.has(s.toLowerCase())?Ob:o(l);O.isUndefined(d)||(i[s]=d)}}return n.pop(),i};return o(e)}let Z=class Sp extends Error{static from(t,r,n,o,a,i){const s=new Sp(t.message,r||t.code,n,o,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),i&&Object.assign(s,i),s}constructor(t,r,n,o,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),a&&(this.response=a,this.status=a.status)}toJSON(){const t=this.config,r=t&&O.hasOwnProp(t,"redact")?t.redact:void 0,n=O.isArray(r)&&r.length>0?Db(t,r):O.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};Z.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Z.ERR_BAD_OPTION="ERR_BAD_OPTION",Z.ECONNABORTED="ECONNABORTED",Z.ETIMEDOUT="ETIMEDOUT",Z.ECONNREFUSED="ECONNREFUSED",Z.ERR_NETWORK="ERR_NETWORK",Z.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Z.ERR_DEPRECATED="ERR_DEPRECATED",Z.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Z.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Z.ERR_CANCELED="ERR_CANCELED",Z.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Z.ERR_INVALID_URL="ERR_INVALID_URL",Z.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Nb=null,Nd=100;function hs(e){return O.isPlainObject(e)||O.isArray(e)}function kd(e){return O.endsWith(e,"[]")?e.slice(0,-2):e}function ps(e,t,r){return e?e.concat(t).map(function(o,a){return o=kd(o),!r&&a?"["+o+"]":o}).join(r?".":""):t}function kb(e){return O.isArray(e)&&!e.some(hs)}const xb=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function Oa(e,t,r){if(!O.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=O.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,C){return!O.isUndefined(C[b])});const n=r.metaTokens,o=r.visitor||w,a=r.dots,i=r.indexes,s=r.Blob||typeof Blob<"u"&&Blob,l=r.maxDepth===void 0?Nd:r.maxDepth,d=s&&O.isSpecCompliantForm(t),f=[];if(!O.isFunction(o))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(O.isDate(v))return v.toISOString();if(O.isBoolean(v))return v.toString();if(!d&&O.isBlob(v))throw new Z("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(v)||O.isTypedArray(v)?d&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function m(v){if(v>l)throw new Z("Object is too deeply nested ("+v+" levels). Max depth: "+l,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(v,b){if(l===1/0)return JSON.stringify(v);const C=[];return JSON.stringify(v,function(T,I){if(!O.isObject(I))return I;for(;C.length&&C[C.length-1]!==this;)C.pop();return C.push(I),m(b+C.length-1),I})}function w(v,b,C){let S=v;if(O.isReactNative(t)&&O.isReactNativeBlob(v))return t.append(ps(C,b,a),u(v)),!1;if(v&&!C&&typeof v=="object"){if(O.endsWith(b,"{}"))b=n?b:b.slice(0,-2),v=g(v,1);else if(O.isArray(v)&&kb(v)||(O.isFileList(v)||O.endsWith(b,"[]"))&&(S=O.toArray(v)))return b=kd(b),S.forEach(function(I,k){!(O.isUndefined(I)||I===null)&&t.append(i===!0?ps([b],k,a):i===null?b:b+"[]",u(I))}),!1}return hs(v)?!0:(t.append(ps(C,b,a),u(v)),!1)}const p=Object.assign(xb,{defaultVisitor:w,convertValue:u,isVisitable:hs});function y(v,b,C=0){if(!O.isUndefined(v)){if(m(C),f.indexOf(v)!==-1)throw new Error("Circular reference detected in "+b.join("."));f.push(v),O.forEach(v,function(T,I){(!(O.isUndefined(T)||T===null)&&o.call(t,T,O.isString(I)?I.trim():I,b,p))===!0&&y(T,b?b.concat(I):[I],C+1)}),f.pop()}}if(!O.isObject(e))throw new TypeError("data must be an object");return y(e),t}function xd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function gs(e,t){this._pairs=[],e&&Oa(e,this,t)}const Ld=gs.prototype;Ld.append=function(t,r){this._pairs.push([t,r])},Ld.toString=function(t){const r=t?function(n){return t.call(this,n,xd)}:xd;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Lb(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Pd(e,t,r){if(!t)return e;const n=O.isFunction(r)?{serialize:r}:r,o=O.getSafeProp(n,"encode")||Lb,a=O.getSafeProp(n,"serialize");let i;if(a?i=a(t,n):i=O.isURLSearchParams(t)?t.toString():new gs(t,n).toString(o),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Fd{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){O.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ms={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Pb={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:gs,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ys=typeof window<"u"&&typeof document<"u",vs=typeof navigator=="object"&&navigator||void 0,Fb=ys&&(!vs||["ReactNative","NativeScript","NS"].indexOf(vs.product)<0),Mb=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$b=ys&&window.location.href||"http://localhost",ft={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ys,hasStandardBrowserEnv:Fb,hasStandardBrowserWebWorkerEnv:Mb,navigator:vs,origin:$b},Symbol.toStringTag,{value:"Module"})),...Pb};function Bb(e,t){return Oa(e,new ft.classes.URLSearchParams,{visitor:function(r,n,o,a){return ft.isNode&&O.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}const Md=Nd;function $d(e){if(e>Md)throw new Z("FormData field is too deeply nested ("+e+" levels). Max depth: "+Md,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function jb(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)$d(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function qb(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n<o;n++)a=r[n],t[a]=e[a];return t}function Bd(e){function t(r,n,o,a){$d(a);let i=r[a++];if(i==="__proto__")return!0;const s=Number.isFinite(+i),l=a>=r.length;return i=!i&&O.isArray(o)?o.length:i,l?(O.hasOwnProp(o,i)?o[i]=O.isArray(o[i])?o[i].concat(n):[o[i],n]:o[i]=n,!s):((!O.hasOwnProp(o,i)||!O.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],a)&&O.isArray(o[i])&&(o[i]=qb(o[i])),!s)}if(O.isFormData(e)&&O.isFunction(e.entries)){const r={};return O.forEachEntry(e,(n,o)=>{t(jb(n),o,r,0)}),r}return null}const On=(e,t)=>e!=null&&O.hasOwnProp(e,t)?e[t]:void 0;function Ub(e,t,r){if(O.isString(e))try{return(t||JSON.parse)(e),O.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const So={transitional:ms,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,a=O.isObject(t);if(a&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return o?JSON.stringify(Bd(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t)||O.isReadableStream(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){const l=On(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return Bb(t,l).toString();if((s=O.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=On(this,"env"),f=d&&d.FormData;return Oa(s?{"files[]":t}:t,f&&new f,l)}}return a||o?(r.setContentType("application/json",!1),Ub(t)):t}],transformResponse:[function(t){const r=On(this,"transitional")||So.transitional,n=r&&r.forcedJSONParsing,o=On(this,"responseType"),a=o==="json";if(O.isResponse(t)||O.isReadableStream(t))return t;if(t&&O.isString(t)&&(n&&!o||a)){const s=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t,On(this,"parseReviver"))}catch(l){if(s)throw l.name==="SyntaxError"?Z.from(l,Z.ERR_BAD_RESPONSE,this,null,On(this,"response")):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch","query"],e=>{So.headers[e]={}});function bs(e,t){const r=this||So,n=t||r,o=gt.from(n.headers);let a=n.data;return O.forEach(e,function(s){a=s.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function jd(e){return!!(e&&e.__CANCEL__)}let _o=class extends Z{constructor(t,r,n){super(t??"canceled",Z.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function qd(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 Vb(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function zb(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,a=0,i;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),f=n[a];i||(i=d),r[o]=l,n[o]=d;let u=a,m=0;for(;u!==o;)m+=r[u++],u=u%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),d-i<t)return;const g=f&&d-f;return g?Math.round(m*1e3/g):void 0}}function Hb(e,t){let r=0,n=1e3/t,o,a;const i=(d,f=Date.now())=>{r=f,o=null,a&&(clearTimeout(a),a=null),e(...d)};return[(...d)=>{const f=Date.now(),u=f-r;u>=n?i(d,f):(o=d,a||(a=setTimeout(()=>{a=null,i(o)},n-u)))},()=>o&&i(o)]}const Aa=(e,t,r=3)=>{let n=0;const o=zb(50,250);return Hb(a=>{if(!a||typeof a.loaded!="number")return;const i=a.loaded,s=a.lengthComputable?a.total:void 0,l=s!=null?Math.min(i,s):i,d=Math.max(0,l-n),f=o(d);n=Math.max(n,l);const u={loaded:l,total:s,progress:s?l/s:void 0,bytes:d,rate:f||void 0,estimated:f&&s?(s-l)/f:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(u)},r)},Ud=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Vd=e=>(...t)=>O.asap(()=>e(...t)),Rb=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,Qb=ft.hasStandardBrowserEnv?{write(e,t,r,n,o,a,i){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];O.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),O.isString(n)&&s.push(`path=${n}`),O.isString(o)&&s.push(`domain=${o}`),a===!0&&s.push("secure"),O.isString(i)&&s.push(`SameSite=${i}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(o!==-1&&n.slice(0,o)===e)return decodeURIComponent(n.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Gb(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Wb(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Kb=/^https?:(?!\/\/)/i,Yb=/[\t\n\r]/g;function Zb(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Xb(e){return Zb(e).replace(Yb,"")}function zd(e,t){if(typeof e=="string"&&Kb.test(Xb(e)))throw new Z('Invalid URL: missing "//" after protocol',Z.ERR_INVALID_URL,t)}function Hd(e,t,r,n){zd(t,n);let o=!Gb(t);return e&&(o||r===!1)?(zd(e,n),Wb(e,t)):t}const Rd=e=>e instanceof gt?{...e}:e;function Wr(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(f,u,m,g){return O.isPlainObject(f)&&O.isPlainObject(u)?O.merge.call({caseless:g},f,u):O.isPlainObject(u)?O.merge({},u):O.isArray(u)?u.slice():u}function o(f,u,m,g){if(O.isUndefined(u)){if(!O.isUndefined(f))return n(void 0,f,m,g)}else return n(f,u,m,g)}function a(f,u){if(!O.isUndefined(u))return n(void 0,u)}function i(f,u){if(O.isUndefined(u)){if(!O.isUndefined(f))return n(void 0,f)}else return n(void 0,u)}function s(f){const u=O.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!O.isUndefined(u))if(O.isPlainObject(u)){if(O.hasOwnProp(u,f))return u[f]}else return;const m=O.hasOwnProp(e,"transitional")?e.transitional:void 0;if(O.isPlainObject(m)&&O.hasOwnProp(m,f))return m[f]}function l(f,u,m){if(O.hasOwnProp(t,m))return n(f,u);if(O.hasOwnProp(e,m))return n(void 0,f)}const d={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:l,headers:(f,u,m)=>o(Rd(f),Rd(u),m,!0)};return O.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const m=O.hasOwnProp(d,u)?d[u]:o,g=O.hasOwnProp(e,u)?e[u]:void 0,w=O.hasOwnProp(t,u)?t[u]:void 0,p=m(g,w,u);O.isUndefined(p)&&m!==l||(r[u]=p)}),O.hasOwnProp(t,"validateStatus")&&O.isUndefined(t.validateStatus)&&s("validateStatusUndefinedResolves")===!1&&(O.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const Jb=["content-type","content-length"];function ew(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{Jb.includes(n.toLowerCase())&&e.set(n,o)})}const tw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Qd(e){const t=Wr({},e),r=m=>O.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let o=r("withXSRFToken");const a=r("xsrfHeaderName"),i=r("xsrfCookieName");let s=r("headers");const l=r("auth"),d=r("baseURL"),f=r("allowAbsoluteUrls"),u=r("url");if(t.headers=s=gt.from(s),t.url=Pd(Hd(d,u,f,t),r("params"),r("paramsSerializer")),l){const m=O.getSafeProp(l,"username")||"",g=O.getSafeProp(l,"password")||"";s.set("Authorization","Basic "+btoa(m+":"+(g?tw(g):"")))}if(O.isFormData(n)&&(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv||O.isReactNative(n)?s.setContentType(void 0):O.isFunction(n.getHeaders)&&ew(s,n.getHeaders(),r("formDataHeaderPolicy"))),ft.hasStandardBrowserEnv&&(O.isFunction(o)&&(o=o(t)),o===!0||o==null&&Rb(t.url))){const g=a&&i&&Qb.read(i);g&&s.set(a,g)}return t}const rw=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Qd(e);let a=o.data;const i=gt.from(o.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:d}=o,f,u,m,g,w;function p(){g&&g(),w&&w(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function v(){if(!y)return;const C=gt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),T={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:C,config:e,request:y};qd(function(k){r(k),p()},function(k){n(k),p()},T),y=null}"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(v)},y.onabort=function(){y&&(n(new Z("Request aborted",Z.ECONNABORTED,e,y)),p(),y=null)},y.onerror=function(S){const T=S&&S.message?S.message:"Network Error",I=new Z(T,Z.ERR_NETWORK,e,y);I.event=S||null,n(I),p(),y=null},y.ontimeout=function(){let S=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||ms;o.timeoutErrorMessage&&(S=o.timeoutErrorMessage),n(new Z(S,T.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,e,y)),p(),y=null},a===void 0&&i.setContentType(null),"setRequestHeader"in y&&O.forEach(Ad(i),function(S,T){y.setRequestHeader(T,S)}),O.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),s&&s!=="json"&&(y.responseType=o.responseType),d&&([m,w]=Aa(d,!0),y.addEventListener("progress",m)),l&&y.upload&&([u,g]=Aa(l),y.upload.addEventListener("progress",u),y.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=C=>{y&&(n(!C||C.type?new _o(null,e,y):C),y.abort(),p(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const b=Vb(o.url);if(b&&!ft.protocols.includes(b)){n(new Z("Unsupported protocol "+b+":",Z.ERR_BAD_REQUEST,e));return}y.send(a||null)})},nw=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(l){if(!n){n=!0,i();const d=l instanceof Error?l:this.reason;r.abort(d instanceof Z?d:new _o(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,o(new Z(`timeout of ${t}ms exceeded`,Z.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>O.asap(i),s},ow=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},aw=async function*(e,t){for await(const r of iw(e))yield*ow(r,t)},iw=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()}},Gd=(e,t,r,n)=>{const o=aw(e,t);let a=0,i,s=l=>{i||(i=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:d,value:f}=await o.next();if(d){s(),l.close();return}let u=f.byteLength;if(r){let m=a+=u;r(m)}l.enqueue(new Uint8Array(f))}catch(d){throw s(d),d}},cancel(l){return s(l),o.return()}},{highWaterMark:2})},Da=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,sw=(e,t,r)=>t+2<r&&Da(e.charCodeAt(t+1))&&Da(e.charCodeAt(t+2));function lw(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let i=n.length;const s=n.length;for(let g=0;g<s;g++)if(n.charCodeAt(g)===37&&g+2<s){const w=n.charCodeAt(g+1),p=n.charCodeAt(g+2);Da(w)&&Da(p)&&(i-=2,g+=2)}let l=0,d=s-1;const f=g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100);d>=0&&(n.charCodeAt(d)===61?(l++,d--):f(d)&&(l++,d-=3)),l===1&&d>=0&&(n.charCodeAt(d)===61||f(d))&&l++;const m=Math.floor(i/4)*3-(l||0);return m>0?m:0}let a=0;for(let i=0,s=n.length;i<s;i++){const l=n.charCodeAt(i);if(l===37&&sw(n,i,s))a+=1,i+=2;else if(l<128)a+=1;else if(l<2048)a+=2;else if(l>=55296&&l<=56319&&i+1<s){const d=n.charCodeAt(i+1);d>=56320&&d<=57343?(a+=4,i++):a+=3}else a+=3}return a}const ws="1.18.0",Wd=64*1024,{isFunction:Na}=O,cw=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Kd=e=>{if(!O.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Yd=(e,...t)=>{try{return!!e(...t)}catch{return!1}},dw=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},uw=e=>{const t=O.global!==void 0&&O.global!==null?O.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=O.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:a,Response:i}=e,s=o?Na(o):typeof fetch=="function",l=Na(a),d=Na(i);if(!s)return!1;const f=s&&Na(r),u=s&&(typeof n=="function"?(v=>b=>v.encode(b))(new n):async v=>new Uint8Array(await new a(v).arrayBuffer())),m=l&&f&&Yd(()=>{let v=!1;const b=new a(ft.origin,{body:new r,method:"POST",get duplex(){return v=!0,"half"}}),C=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),v&&!C}),g=d&&f&&Yd(()=>O.isReadableStream(new i("").body)),w={stream:g&&(v=>v.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!w[v]&&(w[v]=(b,C)=>{let S=b&&b[v];if(S)return S.call(b);throw new Z(`Response type '${v}' is not supported`,Z.ERR_NOT_SUPPORT,C)})});const p=async v=>{if(v==null)return 0;if(O.isBlob(v))return v.size;if(O.isSpecCompliantForm(v))return(await new a(ft.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(O.isArrayBufferView(v)||O.isArrayBuffer(v))return v.byteLength;if(O.isURLSearchParams(v)&&(v=v+""),O.isString(v))return(await u(v)).byteLength},y=async(v,b)=>{const C=O.toFiniteNumber(v.getContentLength());return C??p(b)};return async v=>{let{url:b,method:C,data:S,signal:T,cancelToken:I,timeout:k,onDownloadProgress:x,onUploadProgress:B,responseType:q,headers:N,withCredentials:P="same-origin",fetchOptions:M,maxContentLength:L,maxBodyLength:F}=Qd(v);const z=O.isNumber(L)&&L>-1,X=O.isNumber(F)&&F>-1,ve=H=>O.hasOwnProp(v,H)?v[H]:void 0;let Ee=o||fetch;q=q?(q+"").toLowerCase():"text";let Ce=nw([T,I&&I.toAbortSignal()],k),ue=null;const Q=Ce&&Ce.unsubscribe&&(()=>{Ce.unsubscribe()});let ne,te=null;const U=()=>new Z("Request body larger than maxBodyLength limit",Z.ERR_BAD_REQUEST,v,ue);try{let H;const ae=ve("auth");if(ae){const re=O.getSafeProp(ae,"username")||"",Ke=O.getSafeProp(ae,"password")||"";H={username:re,password:Ke}}if(dw(b)){const re=new URL(b,ft.origin);if(!H&&(re.username||re.password)){const Ke=Kd(re.username),Re=Kd(re.password);H={username:Ke,password:Re}}(re.username||re.password)&&(re.username="",re.password="",b=re.href)}if(H&&(N.delete("authorization"),N.set("Authorization","Basic "+btoa(cw((H.username||"")+":"+(H.password||""))))),z&&typeof b=="string"&&b.startsWith("data:")&&lw(b)>L)throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue);if(X&&C!=="get"&&C!=="head"){const re=await p(S);if(typeof re=="number"&&isFinite(re)&&(ne=re,re>F))throw U()}const fe=X&&(O.isReadableStream(S)||O.isStream(S)),J=(re,Ke,Re)=>Gd(re,Wd,He=>{if(X&&He>F)throw te=U();Ke&&Ke(He)},Re);if(m&&C!=="get"&&C!=="head"&&(B||fe)){if(ne=ne??await y(N,S),ne!==0||fe){let re=new a(b,{method:"POST",body:S,duplex:"half"}),Ke;if(O.isFormData(S)&&(Ke=re.headers.get("content-type"))&&N.setContentType(Ke),re.body){const[Re,He]=B&&Ud(ne,Aa(Vd(B)))||[];S=J(re.body,Re,He)}}}else if(fe&&!l&&f&&C!=="get"&&C!=="head")S=J(S);else if(fe&&l&&!m&&C!=="get"&&C!=="head")throw new Z("Stream request bodies are not supported by the current fetch implementation",Z.ERR_NOT_SUPPORT,v,ue);O.isString(P)||(P=P?"include":"omit");const oe=l&&"credentials"in a.prototype;if(O.isFormData(S)){const re=N.getContentType();re&&/^multipart\/form-data/i.test(re)&&!/boundary=/i.test(re)&&N.delete("content-type")}N.set("User-Agent","axios/"+ws,!1);const Me={...M,signal:Ce,method:C.toUpperCase(),headers:Ad(N.normalize()),body:S,duplex:"half",credentials:oe?P:void 0};ue=l&&new a(b,Me);let Oe=await(l?Ee(ue,M):Ee(b,Me));const Ve=gt.from(Oe.headers);if(z){const re=O.toFiniteNumber(Ve.getContentLength());if(re!=null&&re>L)throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue)}const We=g&&(q==="stream"||q==="response");if(g&&Oe.body&&(x||z||We&&Q)){const re={};["status","statusText","headers"].forEach(It=>{re[It]=Oe[It]});const Ke=O.toFiniteNumber(Ve.getContentLength()),[Re,He]=x&&Ud(Ke,Aa(Vd(x),!0))||[];let et=0;const Gt=It=>{if(z&&(et=It,et>L))throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue);Re&&Re(It)};Oe=new i(Gd(Oe.body,Wd,Gt,()=>{He&&He(),Q&&Q()}),re)}q=q||"text";let ze=await w[O.findKey(w,q)||"text"](Oe,v);if(z&&!g&&!We){let re;if(ze!=null&&(typeof ze.byteLength=="number"?re=ze.byteLength:typeof ze.size=="number"?re=ze.size:typeof ze=="string"&&(re=typeof n=="function"?new n().encode(ze).byteLength:ze.length)),typeof re=="number"&&re>L)throw new Z("maxContentLength size of "+L+" exceeded",Z.ERR_BAD_RESPONSE,v,ue)}return!We&&Q&&Q(),await new Promise((re,Ke)=>{qd(re,Ke,{data:ze,headers:gt.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:v,request:ue})})}catch(H){if(Q&&Q(),Ce&&Ce.aborted&&Ce.reason instanceof Z){const ae=Ce.reason;throw ae.config=v,ue&&(ae.request=ue),H!==ae&&(ae.cause=H),ae}throw te?(ue&&!te.request&&(te.request=ue),te):H instanceof Z?(ue&&!H.request&&(H.request=ue),H):H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new Z("Network Error",Z.ERR_NETWORK,v,ue,H&&H.response),{cause:H.cause||H}):Z.from(H,H&&H.code,v,ue,H&&H.response)}}},fw=new Map,Zd=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,a=[n,o,r];let i=a.length,s=i,l,d,f=fw;for(;s--;)l=a[s],d=f.get(l),d===void 0&&f.set(l,d=s?new Map:uw(t)),f=d;return d};Zd();const Cs={http:Nb,xhr:rw,fetch:{get:Zd}};O.forEach(Cs,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Xd=e=>`- ${e}`,hw=e=>O.isFunction(e)||e===null||e===!1;function pw(e,t){e=O.isArray(e)?e:[e];const{length:r}=e;let n,o;const a={};for(let i=0;i<r;i++){n=e[i];let s;if(o=n,!hw(n)&&(o=Cs[(s=String(n)).toLowerCase()],o===void 0))throw new Z(`Unknown adapter '${s}'`);if(o&&(O.isFunction(o)||(o=o.get(t))))break;a[s||"#"+i]=o}if(!o){const i=Object.entries(a).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=r?i.length>1?`since :
|
|
491
|
+
`+i.map(Xd).join(`
|
|
492
|
+
`):" "+Xd(i[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o}const Jd={getAdapter:pw,adapters:Cs};function Ss(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _o(null,e)}function eu(e){return Ss(e),e.headers=gt.from(e.headers),e.data=bs.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Jd.getAdapter(e.adapter||So.adapter,e)(e).then(function(n){Ss(e),e.response=n;try{n.data=bs.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=gt.from(n.headers),n},function(n){if(!jd(n)&&(Ss(e),n&&n.response)){e.response=n.response;try{n.response.data=bs.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=gt.from(n.response.headers)}return Promise.reject(n)})}const ka={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ka[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const tu={};ka.transitional=function(t,r,n){function o(a,i){return"[Axios v"+ws+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,s)=>{if(t===!1)throw new Z(o(i," has been removed"+(r?" in "+r:"")),Z.ERR_DEPRECATED);return r&&!tu[i]&&(tu[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,i,s):!0}},ka.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function gw(e,t,r){if(typeof e!="object")throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const a=n[o],i=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(i){const s=e[a],l=s===void 0||i(s,a,e);if(l!==!0)throw new Z("option "+a+" must be "+l,Z.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Z("Unknown option "+a,Z.ERR_BAD_OPTION)}}const xa={assertOptions:gw,validators:ka},mt=xa.validators;let Kr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Fd,response:new Fd}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=(()=>{if(!o.stack)return"";const i=o.stack.indexOf(`
|
|
493
493
|
`);return i===-1?"":o.stack.slice(i+1)})();try{if(!n.stack)n.stack=a;else if(a){const i=a.indexOf(`
|
|
494
494
|
`),s=i===-1?-1:a.indexOf(`
|
|
495
495
|
`,i+1),l=s===-1?"":a.slice(s+1);String(n.stack).endsWith(l)||(n.stack+=`
|
|
496
|
-
`+a)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Wr(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:a}=r;n!==void 0&&La.assertOptions(n,{silentJSONParsing:mt.transitional(mt.boolean),forcedJSONParsing:mt.transitional(mt.boolean),clarifyTimeoutError:mt.transitional(mt.boolean),legacyInterceptorReqResOrdering:mt.transitional(mt.boolean),advertiseZstdAcceptEncoding:mt.transitional(mt.boolean),validateStatusUndefinedResolves:mt.transitional(mt.boolean)},!1),o!=null&&(O.isFunction(o)?r.paramsSerializer={serialize:o}:La.assertOptions(o,{encode:mt.function,serialize:mt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),La.assertOptions(r,{baseUrl:mt.spelling("baseURL"),withXsrfToken:mt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&O.merge(a.common,a[r.method]);a&&O.forEach(["delete","get","head","post","put","patch","query","common"],w=>{delete a[w]}),r.headers=gt.concat(i,a);const s=[];let l=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(r)===!1)return;l=l&&p.synchronous;const y=r.transitional||vs;y&&y.legacyInterceptorReqResOrdering?s.unshift(p.fulfilled,p.rejected):s.push(p.fulfilled,p.rejected)});const d=[];this.interceptors.response.forEach(function(p){d.push(p.fulfilled,p.rejected)});let f,u=0,m;if(!l){const w=[tu.bind(this),void 0];for(w.unshift(...s),w.push(...d),m=w.length,f=Promise.resolve(r);u<m;)f=f.then(w[u++],w[u++]);return f}m=s.length;let g=r;for(;u<m;){const w=s[u++],p=s[u++];try{g=w(g)}catch(y){p.call(this,y);break}}try{f=tu.call(this,g)}catch(w){return Promise.reject(w)}for(u=0,m=d.length;u<m;)f=f.then(d[u++],d[u++]);return f}getUri(t){t=Wr(this.defaults,t);const r=Rd(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Fd(r,t.params,t.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(t){Kr.prototype[t]=function(r,n){return this.request(Wr(n||{},{method:t,url:r,data:n&&O.hasOwnProp(n,"data")?n.data:void 0}))}}),O.forEach(["post","put","patch","query"],function(t){function r(n){return function(a,i,s){return this.request(Wr(s||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Kr.prototype[t]=r(),t!=="query"&&(Kr.prototype[t+"Form"]=r(!0))});let vw=class Sp{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const n=this;this.promise.then(o=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](o);n._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{n.subscribe(s),a=s}).then(o);return i.cancel=function(){n.unsubscribe(a)},i},t(function(a,i,s){n.reason||(n.reason=new _o(a,i,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sp(function(o){t=o}),cancel:t}}};function bw(e){return function(r){return e.apply(null,r)}}function ww(e){return O.isObject(e)&&e.isAxiosError===!0}const Es={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(Es).forEach(([e,t])=>{Es[t]=e});function nu(e){const t=new Kr(e),r=vd(Kr.prototype.request,t);return O.extend(r,Kr.prototype,t,{allOwnKeys:!0}),O.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return nu(Wr(e,o))},r}const Je=nu(So);Je.Axios=Kr,Je.CanceledError=_o,Je.CancelToken=vw,Je.isCancel=qd,Je.VERSION=Ss,Je.toFormData=Aa,Je.AxiosError=Z,Je.Cancel=Je.CanceledError,Je.all=function(t){return Promise.all(t)},Je.spread=bw,Je.isAxiosError=ww,Je.mergeConfig=Wr,Je.AxiosHeaders=gt,Je.formToJSON=e=>jd(O.isHTMLForm(e)?new FormData(e):e),Je.getAdapter=eu.getAdapter,Je.HttpStatusCode=Es,Je.default=Je;const{Axios:ck,AxiosError:dk,CanceledError:uk,isCancel:fk,CancelToken:hk,VERSION:pk,all:gk,Cancel:mk,isAxiosError:yk,spread:vk,toFormData:bk,AxiosHeaders:wk,HttpStatusCode:Ck,formToJSON:Sk,getAdapter:_k,mergeConfig:Tk,create:Ek}=Je;let Is="";function ou(e){Is=e}const ke=Je.create({timeout:3e4});ke.interceptors.request.use(async e=>{var o;const{useEditorStore:t}=await Promise.resolve().then(()=>uv),n=(o=t.getState().editorConfig)==null?void 0:o.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),Is&&(e.baseURL=Is),e});const au=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function Cw(e,t={}){var l,d,f,u;const n={"organisations.roles":[((l=t.objectType)==null?void 0:l.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const o=e.includes("@"),a=/^\d{10,}$/.test(e.trim()),i={filters:n,fields:au,offset:0,limit:t.limit??200};return o?n.email=e.trim():a?n.phone=e.trim():i.query=e,((u=(f=(d=(await ke.post("/action/user/v1/search",{request:i},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:d.result)==null?void 0:f.response)==null?void 0:u.content)??[]}async function Sw(e){var r,n,o;return e.length?((o=(n=(r=(await ke.post("/action/user/v1/search",{request:{filters:{userId:e},fields:au,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:o.content)??[]:[]}async function _w(e){var r,n;return((n=(r=(await ke.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const iu="/portal";async function su(e){var n,o,a,i,s,l,d;const t=await ke.get(`${iu}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.questionset;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((l=(s=t.data)==null?void 0:s.params)==null?void 0:l.err)||((d=t.data)==null?void 0:d.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${f}`)}return r}async function Tw(e){var r,n;return e.length?((n=(r=(await ke.post(`${iu}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Os(e,t){const r=e??{},n=r.identifier??"",o=r.objectType??"",a=r.mimeType??"",i=r.children,s=Array.isArray(i)?i.map(d=>Os(d,n)):[],l=a==="application/vnd.ekstep.content-collection"||o.toLowerCase().includes("unit")||o.toLowerCase().includes("textbook")||o.toLowerCase().includes("collection")||o.toLowerCase().includes("course")||o.toLowerCase().includes("lesson")||r.visibility==="Parent"||a==="application/vnd.sunbird.questionset"&&s.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:o,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:l,children:s,metadata:r,parent:t}}async function lu(e){var o,a,i,s,l,d,f;const t=await ke.get(`/action/content/v3/hierarchy/${e}`,{params:{mode:"edit"}}),r=(a=(o=t.data)==null?void 0:o.result)==null?void 0:a.content;if(!r||!r.identifier){const u=((s=(i=t.data)==null?void 0:i.params)==null?void 0:s.errmsg)||((d=(l=t.data)==null?void 0:l.params)==null?void 0:d.err)||((f=t.data)==null?void 0:f.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${u}`)}const n=Os(r);return{content:r,rootNode:n}}async function Ew(e){const t=await su(e),r=Os(t);return{content:t,rootNode:r}}async function Iw(e,t,r,n){var a;return((a=(await ke.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:a.result)??{}}async function Ow(e,t=""){await ke.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function Aw(e){var r,n;return(n=(r=(await ke.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function Dw(e){await ke.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function Nw(e,t){await ke.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function kw(e,t){await ke.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const De={container:"_container_r27rp_1",header:"_header_r27rp_13",title:"_title_r27rp_22",closeBtn:"_closeBtn_r27rp_29",body:"_body_r27rp_45",label:"_label_r27rp_54",searchSection:"_searchSection_r27rp_62",searchRow:"_searchRow_r27rp_68",searchInput:"_searchInput_r27rp_74",searchSpinner:"_searchSpinner_r27rp_89",resultsList:"_resultsList_r27rp_105",resultItem:"_resultItem_r27rp_118",userInfo:"_userInfo_r27rp_133",userName:"_userName_r27rp_141",userEmail:"_userEmail_r27rp_150",userOrg:"_userOrg_r27rp_158",noResults:"_noResults_r27rp_167",collabSection:"_collabSection_r27rp_174",sectionTitle:"_sectionTitle_r27rp_179",badge:"_badge_r27rp_189",emptyCollab:"_emptyCollab_r27rp_203",collabList:"_collabList_r27rp_214",collabItem:"_collabItem_r27rp_223",userAvatar:"_userAvatar_r27rp_237",error:"_error_r27rp_251",success:"_success_r27rp_257",footer:"_footer_r27rp_263"},xw=({contentId:e,onClose:t})=>{var $,j;const r=le(),n=ce(N=>N.editorConfig),o=($=n==null?void 0:n.context)==null?void 0:$.channel,a=(j=n==null?void 0:n.config)==null?void 0:j.objectType,[i,s]=h.useState(""),[l,d]=h.useState([]),[f,u]=h.useState(!1),[m,g]=h.useState([]),[w,p]=h.useState(!1),[y,v]=h.useState(""),[b,C]=h.useState(!1),S=h.useRef(null);h.useEffect(()=>{let N=!1;return(async()=>{try{const L=await Aw(e),B=(L==null?void 0:L.collaborators)??[];if(!B.length)return;const P=await Sw(B);if(N)return;const F=B.map(V=>P.find(X=>X.identifier===V)??{identifier:V,firstName:V});g(F)}catch{}})(),()=>{N=!0}},[e]),h.useEffect(()=>{S.current&&clearTimeout(S.current);const N=i.trim();if(N.length<2){d([]);return}return S.current=setTimeout(async()=>{u(!0);try{const L=await Cw(N,{rootOrgId:o,objectType:a}),B=new Set(m.map(P=>P.identifier));d(L.filter(P=>!B.has(P.identifier)))}catch{d([])}finally{u(!1)}},300),()=>{S.current&&clearTimeout(S.current)}},[i,m,o,a]);const T=h.useCallback(N=>{g(L=>L.find(B=>B.identifier===N.identifier)?L:[...L,N]),d(L=>L.filter(B=>B.identifier!==N.identifier)),C(!1)},[]),I=h.useCallback(N=>{g(L=>L.filter(B=>B.identifier!==N)),C(!1)},[]),k=h.useCallback(async()=>{p(!0),v(""),C(!1);try{await kw(e,m.map(N=>N.identifier)),C(!0)}catch{v(r.manageCollaborators.saveFailed)}finally{p(!1)}},[e,m,r.manageCollaborators.saveFailed]),x=N=>`${N.firstName}${N.lastName?` ${N.lastName}`:""}`;return c.jsxs("div",{className:De.container,children:[c.jsxs("div",{className:De.header,children:[c.jsx("h2",{className:De.title,children:r.manageCollaborators.title}),c.jsx("button",{className:De.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:De.body,children:[c.jsxs("div",{className:De.searchSection,children:[c.jsx("label",{className:De.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),c.jsxs("div",{className:De.searchRow,children:[c.jsx("input",{id:"collab-search",type:"text",className:De.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:i,onChange:N=>s(N.target.value)}),f&&c.jsx("span",{className:De.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),l.length>0&&c.jsx("ul",{className:De.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:l.map(N=>{var L,B,P,F;return c.jsxs("li",{className:De.resultItem,role:"option","aria-selected":"false",children:[c.jsxs("div",{className:De.userInfo,children:[c.jsx("span",{className:De.userName,children:x(N)}),N.email&&c.jsx("span",{className:De.userEmail,children:N.email}),(((B=(L=N.organisations)==null?void 0:L[0])==null?void 0:B.orgName)??N.rootOrgName)&&c.jsx("span",{className:De.userOrg,children:((F=(P=N.organisations)==null?void 0:P[0])==null?void 0:F.orgName)??N.rootOrgName})]}),c.jsx($e,{variant:"primary",size:"sm",onClick:()=>T(N),children:r.manageCollaborators.add})]},N.identifier)})}),i.trim().length>=2&&!f&&l.length===0&&c.jsx("p",{className:De.noResults,children:r.manageCollaborators.noUsersFound})]}),c.jsxs("div",{className:De.collabSection,children:[c.jsxs("h3",{className:De.sectionTitle,children:[r.manageCollaborators.currentCollaborators,m.length>0&&c.jsx("span",{className:De.badge,children:m.length})]}),m.length===0?c.jsx("p",{className:De.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):c.jsx("ul",{className:De.collabList,children:m.map(N=>{var L,B,P,F;return c.jsxs("li",{className:De.collabItem,children:[c.jsx("div",{className:De.userAvatar,"aria-hidden":"true",children:x(N).charAt(0).toUpperCase()}),c.jsxs("div",{className:De.userInfo,children:[c.jsx("span",{className:De.userName,children:x(N)}),N.email&&c.jsx("span",{className:De.userEmail,children:N.email}),(((B=(L=N.organisations)==null?void 0:L[0])==null?void 0:B.orgName)??N.rootOrgName)&&c.jsx("span",{className:De.userOrg,children:((F=(P=N.organisations)==null?void 0:P[0])==null?void 0:F.orgName)??N.rootOrgName})]}),c.jsx($e,{variant:"danger",size:"sm",onClick:()=>I(N.identifier),children:r.manageCollaborators.remove})]},N.identifier)})})]}),y&&c.jsx("p",{className:De.error,role:"alert",children:y}),b&&c.jsx("p",{className:De.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),c.jsxs("div",{className:De.footer,children:[c.jsx($e,{variant:"ghost",onClick:t,disabled:w,children:r.manageCollaborators.cancel}),c.jsx($e,{variant:"primary",isLoading:w,onClick:k,children:r.manageCollaborators.save})]})]})};async function Lw(e){return(await ke.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function Pw(e,t){var o;const n=((o=(await ke.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:o.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function Fw(e){var n;const r=((n=(await ke.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const de={topbar:"_topbar_zj8wk_1",left:"_left_zj8wk_15",right:"_right_zj8wk_23",backBtn:"_backBtn_zj8wk_30",title:"_title_zj8wk_49",statusChip:"_statusChip_zj8wk_61",savedIndicator:"_savedIndicator_zj8wk_73",unsaved:"_unsaved_zj8wk_83",iconBtn:"_iconBtn_zj8wk_88",iconBtnLabel:"_iconBtnLabel_zj8wk_115",qrDropdown:"_qrDropdown_zj8wk_119",qrMenu:"_qrMenu_zj8wk_123",reviewBtns:"_reviewBtns_zj8wk_158",sourcingBtns:"_sourcingBtns_zj8wk_167",modalOverlay:"_modalOverlay_zj8wk_176",sbOverlay:"_sbOverlay_zj8wk_186",sbModal:"_sbModal_zj8wk_196",sbModalHeader:"_sbModalHeader_zj8wk_207",sbModalTitle:"_sbModalTitle_zj8wk_215",sbModalClose:"_sbModalClose_zj8wk_222",sbModalBody:"_sbModalBody_zj8wk_235",sbLabel:"_sbLabel_zj8wk_242",sbTextarea:"_sbTextarea_zj8wk_249",sbError:"_sbError_zj8wk_266",sbModalFooter:"_sbModalFooter_zj8wk_273"};function Mw(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function $w(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const Bw=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:o="primary",onConfirm:a,onCancel:i})=>{const s=le(),[l,d]=h.useState(""),f=e.toLowerCase().replace(/\s+/g,"-");return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${f}-title`,children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:`${f}-title`,className:de.sbModalTitle,children:e}),c.jsx("button",{className:de.sbModalClose,onClick:i,"aria-label":s.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:de.sbModalBody,children:[c.jsxs("label",{className:de.sbLabel,htmlFor:`${f}-comment`,children:[t," ",c.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:`${f}-comment`,className:de.sbTextarea,placeholder:r,value:l,onChange:u=>d(u.target.value),rows:4,required:!0,"aria-required":"true"}),l.trim().length===0&&c.jsx("p",{className:de.sbError,children:s.reviewCommentModal.fillCommentsError})]}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:i,children:s.reviewCommentModal.cancelButton}),c.jsx($e,{variant:o,onClick:()=>a(l.trim()),disabled:l.trim().length===0,children:n})]})]})})},jw=({onConfirm:e,onCancel:t})=>{const r=le(),[n,o]=h.useState(!1);return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:"review-confirm-title",className:de.sbModalTitle,children:r.confirmReviewModal.title}),c.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsx("div",{className:de.sbModalBody,children:c.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[c.jsx("input",{type:"checkbox",checked:n,onChange:a=>o(a.target.checked),style:{marginTop:2}}),c.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",c.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",c.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),c.jsx($e,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},qw=({onConfirm:e,onCancel:t})=>{const r=le(),[n,o]=h.useState(""),a=parseInt(n,10),i=!isNaN(a)&&a>=2&&a<=250;return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:"genqr-title",className:de.sbModalTitle,children:r.generateQRModal.title}),c.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:de.sbModalBody,children:[c.jsxs("label",{className:de.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",c.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:de.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:s=>o(s.target.value)}),n&&!i&&c.jsx("p",{className:de.sbError,children:r.generateQRModal.countRangeError})]}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),c.jsx($e,{variant:"primary",onClick:()=>e(a),disabled:!i,children:r.generateQRModal.generateButton})]})]})})},Uw=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:o=!0,onToolbarEvent:a})=>{var ae,fe;const i=le(),l=Ae(J=>J.treeData)[0],d=(l==null?void 0:l.name)??i.contextualEditor.untitledPlaceholder,f=$w(((ae=l==null?void 0:l.metadata)==null?void 0:ae.status)??(l==null?void 0:l.status),i.topbar.draftStatusFallback),u=ce(J=>{var oe,Me,Oe,ze;return((Me=(oe=J.editorConfig)==null?void 0:oe.context)==null?void 0:Me.contentId)??((ze=(Oe=J.editorConfig)==null?void 0:Oe.context)==null?void 0:ze.identifier)??""}),{activeModal:m,modalData:g,closeModal:w,openModal:p}=gv(),y=ce(J=>J.buttonLoaders),v=ce(J=>J.categoryMeta),b=!v||v.schemaDefaults.generateDIALCodes!=="No",[C,S]=h.useState(!1),[T,I]=h.useState(!1),[k,x]=h.useState(!1),$=h.useRef(null),[j,N]=h.useState(!1);h.useEffect(()=>{if(!k)return;const J=oe=>{var Me;(Me=$.current)!=null&&Me.contains(oe.target)||x(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[k]);const[L,B]=h.useState(!1),[P,F]=h.useState(!1),{updateNode:V}=Ae(),X=(fe=l==null?void 0:l.metadata)==null?void 0:fe.qrCodeProcessId,ve=h.useCallback(async J=>{if(u){N(!1),B(!0);try{const{processId:oe,reservedDialcodes:Me}=await Pw(u,J);oe&&l&&V(l.id,{qrCodeProcessId:oe,reservedDialcodes:Me}),Ie.success(i.topbar.qrGenerationStartedToast)}catch{Ie.error(i.topbar.qrGenerationFailedToast)}finally{B(!1)}}},[u,l,V,i]),Ee=h.useCallback(async()=>{if(!X){Ie.error(i.topbar.qrCodesNotGeneratedToast);return}F(!0);try{const J=await Fw(X);if(J.status==="in-process"){Ie(i.topbar.qrGenerationInProgressToast,{icon:c.jsx(Qi,{size:16})});return}const oe=J.url;if(!oe){Ie.error(i.topbar.qrCodesNotReadyToast);return}const Me=await fetch(oe).then(He=>He.blob()),Oe=await new Promise(He=>{const et=new FileReader;et.onloadend=()=>He(et.result),et.readAsDataURL(Me)}),ze=(l==null?void 0:l.metadata)??{},We=He=>Array.isArray(He)?He.join("_"):typeof He=="string"?He:"",Ve=[u,We(ze.medium),We(ze.gradeLevel),We(ze.subject)].filter(Boolean),re=new Date().toISOString().replace(/[:.]/g,"-"),Ke=`${Ve.join("_")}_${re}.zip`,Re=document.createElement("a");Re.href=Oe,Re.download=Ke,Re.style.display="none",document.body.appendChild(Re),Re.click(),document.body.removeChild(Re),Ie.success(i.topbar.qrCodesDownloadedToast)}catch{Ie.error(i.topbar.qrCodesDownloadFailedToast)}finally{F(!1)}},[X,l,u,i]),Ce=e==="edit",ue=e==="review",Q=e==="sourcingreview",ne=e==="read",te=h.useCallback((J,oe)=>{a({action:J,data:oe})},[a]),U=h.useCallback(()=>{w(),te("publish")},[w,te]),H=h.useCallback((J,oe)=>{const Me=g==null?void 0:g.action;w(),Me==="approve"?te("sourcingApprove",{comment:J,score:oe}):te("reject",{comment:J})},[w,te,g]);return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:de.topbar,role:"banner",children:[c.jsxs("div",{className:de.left,children:[c.jsx("button",{className:de.backBtn,onClick:()=>te("back"),"aria-label":i.topbar.backAriaLabel,type:"button",children:c.jsx(Iy,{size:18})}),c.jsx("h1",{className:de.title,title:d,children:d}),c.jsx("span",{className:`sbx-chip ${de.statusChip}`,"aria-label":`${i.topbar.statusAriaLabelPrefix} ${f}`,children:f})]}),c.jsxs("div",{className:de.right,children:[c.jsx(Iv,{}),t?c.jsx("span",{className:de.savedIndicator,"aria-live":"polite",children:i.topbar.savingIndicator}):r&&Ce?c.jsx("span",{className:`${de.savedIndicator} ${de.unsaved}`,"aria-live":"polite",children:i.topbar.unsavedIndicator}):n?c.jsxs("span",{className:de.savedIndicator,"aria-live":"polite",children:[c.jsx(wn,{size:14,"aria-hidden":"true"}),i.topbar.savedIndicatorPrefix," ",Mw(n)]}):null,!ne&&!ue&&!Q&&f!=="Review"&&c.jsx("span",{title:o?void 0:i.topbar.fillRequiredFieldsTooltip,children:c.jsx($e,{variant:"ghost",size:"sm",onClick:()=>te("saveCollection"),disabled:!o,children:i.topbar.saveAsDraftButton})}),Ce&&c.jsxs(c.Fragment,{children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>I(!0),disabled:y.saveCollection,isLoading:y.saveCollection,children:[c.jsx(Qy,{size:14,"aria-hidden":"true"})," ",i.topbar.sendForReviewButton]}),c.jsx("button",{className:de.iconBtn,onClick:()=>p("manageCollaborators"),"aria-label":i.topbar.collaboratorsLabel,title:i.topbar.collaboratorsLabel,type:"button",children:c.jsx(Xy,{size:16,"aria-hidden":"true"})}),b&&c.jsxs("div",{className:de.qrDropdown,ref:$,children:[c.jsxs("button",{className:de.iconBtn,onClick:()=>x(J=>!J),"aria-label":i.topbar.qrCodesLabel,title:i.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":k,children:[c.jsx(ed,{size:16,"aria-hidden":"true"}),c.jsx("span",{className:de.iconBtnLabel,children:i.topbar.qrCodesLabel}),c.jsx(Cn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),k&&c.jsxs("div",{className:de.qrMenu,role:"menu",children:[c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{x(!1),N(!0)},disabled:L,children:[c.jsx(ed,{size:14}),L?i.topbar.generatingEllipsis:i.topbar.generateQrCodesMenuItem]}),c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{x(!1),Ee()},disabled:P||!X,children:[c.jsx(Ly,{size:14}),P?i.topbar.downloadingEllipsis:i.topbar.downloadQrCodesMenuItem]})]})]})]}),ue&&c.jsxs("div",{className:de.reviewBtns,children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("publishChecklist"),disabled:y.publishCollection,isLoading:y.publishCollection,children:[c.jsx(Kc,{size:14,"aria-hidden":"true"})," ",i.topbar.publishButton]}),c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>S(!0),disabled:y.rejectCollection,isLoading:y.rejectCollection,children:[c.jsx(td,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]}),Q&&c.jsxs("div",{className:de.sourcingBtns,children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"approve"}),children:[c.jsx(Gy,{size:14,"aria-hidden":"true"})," ",i.topbar.approveButton]}),c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"reject"}),children:[c.jsx(td,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&c.jsx(Ov,{contentId:u,onConfirm:U,onCancel:w}),m==="qualityParams"&&c.jsx(Av,{contentId:u,action:(g==null?void 0:g.action)??"reject",onConfirm:H,onCancel:w}),m==="manageCollaborators"&&c.jsx("div",{className:de.modalOverlay,role:"dialog","aria-modal":"true",children:c.jsx(xw,{contentId:u,onClose:w})}),T&&c.jsx(jw,{onConfirm:()=>{I(!1),te("sendForReview")},onCancel:()=>I(!1)}),C&&c.jsx(Bw,{titleText:i.topbar.requestChangesTitle,labelText:i.topbar.changesRequestedLabel,placeholderText:i.topbar.describeChangesPlaceholder,submitLabel:i.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:J=>{S(!1),te("reject",{comment:J})},onCancel:()=>S(!1)}),j&&c.jsx(qw,{onConfirm:ve,onCancel:()=>N(!1)})]})},zw=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const o=le();return Pe.createPortal(c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsx("span",{id:"unsaved-title",children:o.unsavedChangesModal.title}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:r,"aria-label":o.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:c.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:o.unsavedChangesModal.bodyMessage})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:r,disabled:n,children:o.unsavedChangesModal.cancelButton}),c.jsx($e,{variant:"danger",onClick:t,disabled:n,children:o.unsavedChangesModal.discardButton}),c.jsx($e,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:o.unsavedChangesModal.saveButton})]})]})}),document.body)};var Vw=os();const cu=h.createContext(null);function Nt(){const e=h.useContext(cu);if(e===null)throw new Error("No Tree Api Provided");return e}const du=h.createContext(null);function Hw(){const e=h.useContext(du);if(e===null)throw new Error("Provide a NodesContext");return e}const uu=h.createContext(null);function Rw(){const e=h.useContext(uu);if(e===null)throw new Error("Provide a DnDContext");return e}const fu=h.createContext(0);function hu(){h.useContext(fu)}function Pa(e,t,r){return Math.max(Math.min(e,r),t)}function pu(e){return e&&e.isLeaf}function gu(e){return e&&e.isInternal&&!e.isOpen}function mu(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const yu=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},vu=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function As(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=As(r,t);if(n)return n}return null}function Fa(e,t){if(t(e),e.children)for(let r of e.children)Fa(r,t)}function bu(e){const t=Cu(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Qw(t,n);break}r==null||r.focus()}function wu(e){const t=Cu(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Gw(t,n);break}r==null||r.focus()}function Qw(e,t){return t+1<e.length?e[t+1]:e[0]}function Gw(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Cu(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function To(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function An(e){return typeof e=="string"?e:e.id}function Ww(e,...t){if(e)return e(...t)}function Su(e){return new Promise((t,r)=>{let n=0;function o(){n+=1,n===100&&r(),e()?t():setTimeout(o,10)}o()})}function _u(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function Tu(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const Kw=Object.freeze(Object.defineProperty({__proto__:null,access:To,bound:Pa,dfs:As,focusNextElement:bu,focusPrevElement:wu,getInsertIndex:_u,getInsertParentId:Tu,identify:An,indexOf:vu,isClosed:gu,isDescendant:yu,isItem:pu,isOpenWithEmptyChildren:mu,safeRun:Ww,waitFor:Su,walk:Fa},Symbol.toStringTag,{value:"Module"})),Yw={display:"flex",alignItems:"center",zIndex:1},Zw={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Xw={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Jw=h.memo(function({top:t,left:r,indent:n}){const o={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return c.jsxs("div",{style:Object.assign(Object.assign({},Yw),o),children:[c.jsx("div",{style:Object.assign({},Xw)}),c.jsx("div",{style:Object.assign({},Zw)})]})});function eC({node:e,attrs:t,innerRef:r,children:n}){return c.jsx("div",Object.assign({},t,{ref:r,onFocus:o=>o.stopPropagation(),onClick:e.handleClick,children:n}))}function tC(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(nC,Object.assign({},e)):c.jsx(rC,Object.assign({},e))]})}function rC(e){return c.jsx(c.Fragment,{children:c.jsx("span",{children:e.node.data.name})})}function nC({node:e}){const t=h.useRef();return h.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),c.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const Eo="__REACT_ARBORIST_INTERNAL_ROOT__";function Eu(e){var t;function r(a,i,s){const l=e.accessId(a),d=new Io({tree:e,data:a,level:i,parent:s,id:l,children:null,isDraggable:e.isDraggable(a),rowIndex:null}),f=e.accessChildren(a);return f&&(d.children=f.map(u=>r(u,i+1,d))),d}const n=new Io({tree:e,id:Eo,data:{id:Eo},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),o=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=o.map(a=>r(a,0,n)),n}class Io{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===Eo}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new Io(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Ds(e){return{type:"EDIT",id:e}}function oC(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function Dn(e){return{type:"FOCUS",id:e}}function aC(){return{type:"TREE_BLUR"}}function iC(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 Ns={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 sC(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:Iu(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:Iu(e.unfiltered,t)}):e}const Nn=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Nr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:An(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(An)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(An)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:An(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:An(e)})};function lC(e=Nn().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const kn={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function cC(e=Nn().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return Nn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const dC={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},uC=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},fC=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function Ou({offset:e,mouse:t,id:r,dragIds:n,isDragging:o}){return c.jsxs(hC,{isDragging:o,children:[c.jsx(pC,{offset:e,children:c.jsx(mC,{id:r,dragIds:n})}),c.jsx(gC,{mouse:t,count:n.length})]})}const hC=h.memo(function(t){return t.isDragging?c.jsx("div",{style:dC,children:t.children}):null});function pC(e){return c.jsx("div",{className:"row preview",style:uC(e.offset),children:e.children})}function gC(e){const{count:t,mouse:r}=e;return t>1?c.jsx("div",{className:"selected-count",style:fC(r),children:t}):null}const mC=h.memo(function(t){const r=Nt(),n=r.get(t.id);return n?c.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function ks(){return ks=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},ks.apply(null,arguments)}function Au(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xs(e,t){return xs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},xs(e,t)}function yC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,xs(e,t)}var Du=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function vC(e,t){return!!(e===t||Du(e)&&Du(t))}function bC(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!vC(e[r],t[r]))return!1;return!0}function Ls(e,t){t===void 0&&(t=bC);var r,n=[],o,a=!1;function i(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return a&&r===this&&t(s,n)||(o=e.apply(this,s),a=!0,r=this,n=s),o}return i}var wC=typeof performance=="object"&&typeof performance.now=="function",Nu=wC?function(){return performance.now()}:function(){return Date.now()};function ku(e){cancelAnimationFrame(e.id)}function CC(e,t){var r=Nu();function n(){Nu()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Ps=-1;function xu(e){if(e===void 0&&(e=!1),Ps===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ps=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ps}var xn=null;function Lu(e){if(e===void 0&&(e=!1),xn===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?xn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?xn="negative":xn="positive-ascending"),document.body.removeChild(t),xn}return xn}process.env.NODE_ENV;var SC=150,_C=function(t,r){return t},Ma=null,$a=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Ma=new WeakSet,$a=new WeakSet);function Pu(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return t=function(u){yC(m,u);function m(w){var p;return p=u.call(this,w)||this,p._instanceProps=l(p.props,Au(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:Au(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=Ls(function(y,v,b,C){return p.props.onItemsRendered({overscanStartIndex:y,overscanStopIndex:v,visibleStartIndex:b,visibleStopIndex:C})}),p._callOnScroll=void 0,p._callOnScroll=Ls(function(y,v,b){return p.props.onScroll({scrollDirection:y,scrollOffset:v,scrollUpdateWasRequested:b})}),p._getItemStyle=void 0,p._getItemStyle=function(y){var v=p.props,b=v.direction,C=v.itemSize,S=v.layout,T=p._getItemStyleCache(d&&C,d&&S,d&&b),I;if(T.hasOwnProperty(y))I=T[y];else{var k=r(p.props,y,p._instanceProps),x=o(p.props,y,p._instanceProps),$=b==="horizontal"||S==="horizontal",j=b==="rtl",N=$?k:0;T[y]=I={position:"absolute",left:j?void 0:N,right:j?N:void 0,top:$?0:k,height:$?"100%":x,width:$?x:"100%"}}return I},p._getItemStyleCache=void 0,p._getItemStyleCache=Ls(function(y,v,b){return{}}),p._onScrollHorizontal=function(y){var v=y.currentTarget,b=v.clientWidth,C=v.scrollLeft,S=v.scrollWidth;p.setState(function(T){if(T.scrollOffset===C)return null;var I=p.props.direction,k=C;if(I==="rtl")switch(Lu()){case"negative":k=-C;break;case"positive-descending":k=S-b-C;break}return k=Math.max(0,Math.min(k,S-b)),{isScrolling:!0,scrollDirection:T.scrollOffset<k?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(y){var v=y.currentTarget,b=v.clientHeight,C=v.scrollHeight,S=v.scrollTop;p.setState(function(T){if(T.scrollOffset===S)return null;var I=Math.max(0,Math.min(S,C-b));return{isScrolling:!0,scrollDirection:T.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(y){var v=p.props.outerRef;p._outerRef=y,typeof v=="function"?v(y):v!=null&&typeof v=="object"&&v.hasOwnProperty("current")&&(v.current=y)},p._resetIsScrollingDebounced=function(){p._resetIsScrollingTimeoutId!==null&&ku(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=CC(p._resetIsScrolling,SC)},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}m.getDerivedStateFromProps=function(p,y){return TC(p,y),f(p),null};var g=m.prototype;return g.scrollTo=function(p){p=Math.max(0,p),this.setState(function(y){return y.scrollOffset===p?null:{scrollDirection:y.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(p,y){y===void 0&&(y="auto");var v=this.props,b=v.itemCount,C=v.layout,S=this.state.scrollOffset;p=Math.max(0,Math.min(p,b-1));var T=0;if(this._outerRef){var I=this._outerRef;C==="vertical"?T=I.scrollWidth>I.clientWidth?xu():0:T=I.scrollHeight>I.clientHeight?xu():0}this.scrollTo(a(this.props,p,y,S,this._instanceProps,T))},g.componentDidMount=function(){var p=this.props,y=p.direction,v=p.initialScrollOffset,b=p.layout;if(typeof v=="number"&&this._outerRef!=null){var C=this._outerRef;y==="horizontal"||b==="horizontal"?C.scrollLeft=v:C.scrollTop=v}this._callPropsCallbacks()},g.componentDidUpdate=function(){var p=this.props,y=p.direction,v=p.layout,b=this.state,C=b.scrollOffset,S=b.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var T=this._outerRef;if(y==="horizontal"||v==="horizontal")if(y==="rtl")switch(Lu()){case"negative":T.scrollLeft=-C;break;case"positive-ascending":T.scrollLeft=C;break;default:var I=T.clientWidth,k=T.scrollWidth;T.scrollLeft=k-I-C;break}else T.scrollLeft=C;else T.scrollTop=C}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ku(this._resetIsScrollingTimeoutId)},g.render=function(){var p=this.props,y=p.children,v=p.className,b=p.direction,C=p.height,S=p.innerRef,T=p.innerElementType,I=p.innerTagName,k=p.itemCount,x=p.itemData,$=p.itemKey,j=$===void 0?_C:$,N=p.layout,L=p.outerElementType,B=p.outerTagName,P=p.style,F=p.useIsScrolling,V=p.width,X=this.state.isScrolling,ve=b==="horizontal"||N==="horizontal",Ee=ve?this._onScrollHorizontal:this._onScrollVertical,Ce=this._getRangeToRender(),ue=Ce[0],Q=Ce[1],ne=[];if(k>0)for(var te=ue;te<=Q;te++)ne.push(h.createElement(y,{data:x,key:j(te,x),index:te,isScrolling:F?X:void 0,style:this._getItemStyle(te)}));var U=n(this.props,this._instanceProps);return h.createElement(L||B||"div",{className:v,onScroll:Ee,ref:this._outerRefSetter,style:ks({position:"relative",height:C,width:V,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},P)},h.createElement(T||I||"div",{children:ne,ref:S,style:{height:ve?"100%":U,pointerEvents:X?"none":void 0,width:ve?U:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var p=this.props.itemCount;if(p>0){var y=this._getRangeToRender(),v=y[0],b=y[1],C=y[2],S=y[3];this._callOnItemsRendered(v,b,C,S)}}if(typeof this.props.onScroll=="function"){var T=this.state,I=T.scrollDirection,k=T.scrollOffset,x=T.scrollUpdateWasRequested;this._callOnScroll(I,k,x)}},g._getRangeToRender=function(){var p=this.props,y=p.itemCount,v=p.overscanCount,b=this.state,C=b.isScrolling,S=b.scrollDirection,T=b.scrollOffset;if(y===0)return[0,0,0,0];var I=i(this.props,T,this._instanceProps),k=s(this.props,I,T,this._instanceProps),x=!C||S==="backward"?Math.max(1,v):1,$=!C||S==="forward"?Math.max(1,v):1;return[Math.max(0,I-x),Math.max(0,Math.min(y-1,k+$)),I,k]},m}(h.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var TC=function(t,r){var n=t.children,o=t.direction,a=t.height,i=t.layout,s=t.innerTagName,l=t.outerTagName,d=t.width,f=r.instance;if(process.env.NODE_ENV!=="production"){(s!=null||l!=null)&&$a&&!$a.has(f)&&($a.add(f),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var u=o==="horizontal"||i==="horizontal";switch(o){case"horizontal":case"vertical":Ma&&!Ma.has(f)&&(Ma.add(f),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+i+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(u&&typeof d!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(d===null?"null":typeof d)+'" was specified.'));if(!u&&typeof a!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(a===null?"null":typeof a)+'" was specified.'))}},EC=50,Ln=function(t,r,n){var o=t,a=o.itemSize,i=n.itemMetadataMap,s=n.lastMeasuredIndex;if(r>s){var l=0;if(s>=0){var d=i[s];l=d.offset+d.size}for(var f=s+1;f<=r;f++){var u=a(f);i[f]={offset:l,size:u},l+=u}n.lastMeasuredIndex=r}return i[r]},IC=function(t,r,n){var o=r.itemMetadataMap,a=r.lastMeasuredIndex,i=a>0?o[a].offset:0;return i>=n?Fu(t,r,a,0,n):OC(t,r,Math.max(0,a),n)},Fu=function(t,r,n,o,a){for(;o<=n;){var i=o+Math.floor((n-o)/2),s=Ln(t,i,r).offset;if(s===a)return i;s<a?o=i+1:s>a&&(n=i-1)}return o>0?o-1:0},OC=function(t,r,n,o){for(var a=t.itemCount,i=1;n<a&&Ln(t,n,r).offset<o;)n+=i,i*=2;return Fu(t,r,Math.min(n,a-1),Math.floor(n/2),o)},Mu=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,a=r.estimatedItemSize,i=r.lastMeasuredIndex,s=0;if(i>=n&&(i=n-1),i>=0){var l=o[i];s=l.offset+l.size}var d=n-i-1,f=d*a;return s+f},AC=Pu({getItemOffset:function(t,r,n){return Ln(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Mu,getOffsetForIndexAndAlignment:function(t,r,n,o,a,i){var s=t.direction,l=t.height,d=t.layout,f=t.width,u=s==="horizontal"||d==="horizontal",m=u?f:l,g=Ln(t,r,a),w=Mu(t,a),p=Math.max(0,Math.min(w-m,g.offset)),y=Math.max(0,g.offset-m+g.size+i);switch(n==="smart"&&(o>=y-m&&o<=p+m?n="auto":n="center"),n){case"start":return p;case"end":return y;case"center":return Math.round(y+(p-y)/2);case"auto":default:return o>=y&&o<=p?o:o<y?y:p}},getStartIndexForOffset:function(t,r,n){return IC(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var a=t.direction,i=t.height,s=t.itemCount,l=t.layout,d=t.width,f=a==="horizontal"||l==="horizontal",u=f?d:i,m=Ln(t,r,o),g=n+u,w=m.offset+m.size,p=r;p<s-1&&w<g;)p++,w+=Ln(t,p,o).size;return p},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:o||EC,lastMeasuredIndex:-1};return r.resetAfterIndex=function(i,s){s===void 0&&(s=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,i-1),r._getItemStyleCache(-1),s&&r.forceUpdate()},a},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),DC=Pu({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,o,a,i){var s=t.direction,l=t.height,d=t.itemCount,f=t.itemSize,u=t.layout,m=t.width,g=s==="horizontal"||u==="horizontal",w=g?m:l,p=Math.max(0,d*f-w),y=Math.min(p,r*f),v=Math.max(0,r*f-w+f+i);switch(n==="smart"&&(o>=v-w&&o<=y+w?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(w/2)?0:b>p+Math.floor(w/2)?p:b}case"auto":default:return o>=v&&o<=y?o:o<v?v:y}},getStartIndexForOffset:function(t,r){var n=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/o)))},getStopIndexForStartIndex:function(t,r,n){var o=t.direction,a=t.height,i=t.itemCount,s=t.itemSize,l=t.layout,d=t.width,f=o==="horizontal"||l==="horizontal",u=r*s,m=f?d:a,g=Math.ceil((m+n-u)/s);return Math.max(0,Math.min(i-1,r+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function NC(){var e,t;const r=Nt(),o=Rw().cursor;if(!o||o.type!=="line")return null;const a=r.indent,i=r.rowTopPosition(o.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),s=a*o.level,l=r.renderCursor;return c.jsx(l,{top:i,left:s,indent:a})}var kC=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const xC=h.forwardRef(function(t,r){const{children:n}=t,o=kC(t,["children"]),a=Nt();return c.jsxs("div",Object.assign({ref:r},o,{onClick:i=>{i.currentTarget===i.target&&a.deselectAll()},children:[c.jsx(LC,{}),n]}))}),LC=()=>{const e=Nt();return c.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:c.jsx(NC,{})})};var PC=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const FC=h.forwardRef(function(t,r){var n,o,a,i,{style:s}=t,l=PC(t,["style"]);const d=Nt(),f=(o=(n=d.props.padding)!==null&&n!==void 0?n:d.props.paddingTop)!==null&&o!==void 0?o:0,u=(i=(a=d.props.padding)!==null&&a!==void 0?a:d.props.paddingBottom)!==null&&i!==void 0?i:0;return c.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+f+u}px`})},l))});var $u=h.createContext({dragDropManager:void 0}),zt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(zt||(zt={}));function he(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var a;if(t===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;a=new Error(t.replace(/%s/g,function(){return n[i++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}var Fs="dnd-core/INIT_COORDS",Ba="dnd-core/BEGIN_DRAG",Ms="dnd-core/PUBLISH_DRAG_SOURCE",ja="dnd-core/HOVER",qa="dnd-core/DROP",Ua="dnd-core/END_DRAG";function Bu(e,t){return{type:Fs,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function za(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?za=function(r){return typeof r}:za=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},za(e)}function MC(e,t,r){return t.split(".").reduce(function(n,o){return n&&n[o]?n[o]:r||null},e)}function $C(e,t){return e.filter(function(r){return r!==t})}function ju(e){return za(e)==="object"}function BC(e,t){var r=new Map,n=function(i){r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(a,i){a===1&&o.push(i)}),o}function jC(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var qC={type:Fs,payload:{clientOffset:null,sourceClientOffset:null}};function UC(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},o=n.publishSource,a=o===void 0?!0:o,i=n.clientOffset,s=n.getSourceClientOffset,l=e.getMonitor(),d=e.getRegistry();e.dispatch(Bu(i)),zC(r,l,d);var f=RC(r,l);if(f===null){e.dispatch(qC);return}var u=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");VC(s),u=s(f)}e.dispatch(Bu(i,u));var m=d.getSource(f),g=m.beginDrag(l,f);if(g!=null){HC(g),d.pinSource(f);var w=d.getSourceType(f);return{type:Ba,payload:{itemType:w,item:g,sourceId:f,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!a}}}}}function zC(e,t,r){he(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){he(r.getSource(n),"Expected sourceIds to be registered.")})}function VC(e){he(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function HC(e){he(ju(e),"Item must be an object.")}function RC(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 QC(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Ms}}}function $s(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function GC(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.clientOffset;WC(r);var a=r.slice(0),i=e.getMonitor(),s=e.getRegistry();KC(a,i,s);var l=i.getItemType();return YC(a,s,l),ZC(a,i,s),{type:ja,payload:{targetIds:a,clientOffset:o||null}}}}function WC(e){he(Array.isArray(e),"Expected targetIds to be an array.")}function KC(e,t,r){he(t.isDragging(),"Cannot call hover while not dragging."),he(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];he(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");var a=r.getTarget(o);he(a,"Expected targetIds to be registered.")}}function YC(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n],a=t.getTargetType(o);$s(a,r)||e.splice(n,1)}}function ZC(e,t,r){e.forEach(function(n){var o=r.getTarget(n);o.hover(t,n)})}function qu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Uu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qu(Object(r),!0).forEach(function(n){XC(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 XC(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JC(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),o=e.getRegistry();eS(n);var a=nS(n);a.forEach(function(i,s){var l=tS(i,s,o,n),d={type:qa,payload:{dropResult:Uu(Uu({},r),l)}};e.dispatch(d)})}}function eS(e){he(e.isDragging(),"Cannot call drop while not dragging."),he(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function tS(e,t,r,n){var o=r.getTarget(e),a=o?o.drop(n,e):void 0;return rS(a),typeof a>"u"&&(a=t===0?{}:n.getDropResult()),a}function rS(e){he(typeof e>"u"||ju(e),"Drop result must either be an object or undefined.")}function nS(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function oS(e){return function(){var r=e.getMonitor(),n=e.getRegistry();aS(r);var o=r.getSourceId();if(o!=null){var a=n.getSource(o,!0);a.endDrag(r,o),n.unpinSource()}return{type:Ua}}}function aS(e){he(e.isDragging(),"Cannot call endDrag while not dragging.")}function iS(e){return{beginDrag:UC(e),publishDragSource:QC(e),hover:GC(e),drop:JC(e),endDrag:oS(e)}}function sS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lS(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 cS(e,t,r){return t&&lS(e.prototype,t),e}function Oo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var dS=function(){function e(t,r){var n=this;sS(this,e),Oo(this,"store",void 0),Oo(this,"monitor",void 0),Oo(this,"backend",void 0),Oo(this,"isSetUp",!1),Oo(this,"handleRefCountChange",function(){var o=n.store.getState().refCount>0;n.backend&&(o&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!o&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return cS(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function o(i){return function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];var f=i.apply(r,l);typeof f<"u"&&n(f)}}var a=iS(this);return Object.keys(a).reduce(function(i,s){var l=a[s];return i[s]=o(l),i},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e}();function Vt(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 zu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Vu=function(){return Math.random().toString(36).substring(7).split("").join(".")},Hu={INIT:"@@redux/INIT"+Vu(),REPLACE:"@@redux/REPLACE"+Vu()};function uS(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 fS(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(gS(e))return"date";if(pS(e))return"error";var r=hS(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 hS(e){return typeof e.constructor=="function"?e.constructor.name:null}function pS(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function gS(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Pn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=fS(e)),t}function Ru(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Vt(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"?Vt(1):"Expected the enhancer to be a function. Instead, received: '"+Pn(r)+"'");return r(Ru)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Vt(2):"Expected the root reducer to be a function. Instead, received: '"+Pn(e)+"'");var o=e,a=t,i=[],s=i,l=!1;function d(){s===i&&(s=i.slice())}function f(){if(l)throw new Error(process.env.NODE_ENV==="production"?Vt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function u(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?Vt(4):"Expected the listener to be a function. Instead, received: '"+Pn(p)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?Vt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var y=!0;return d(),s.push(p),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?Vt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d();var b=s.indexOf(p);s.splice(b,1),i=null}}}function m(p){if(!uS(p))throw new Error(process.env.NODE_ENV==="production"?Vt(7):"Actions must be plain objects. Instead, the actual type was: '"+Pn(p)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof p.type>"u")throw new Error(process.env.NODE_ENV==="production"?Vt(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"?Vt(9):"Reducers may not dispatch actions.");try{l=!0,a=o(a,p)}finally{l=!1}for(var y=i=s,v=0;v<y.length;v++){var b=y[v];b()}return p}function g(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?Vt(10):"Expected the nextReducer to be a function. Instead, received: '"+Pn(p));o=p,m({type:Hu.REPLACE})}function w(){var p,y=u;return p={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?Vt(11):"Expected the observer to be an object. Instead, received: '"+Pn(b)+"'");function C(){b.next&&b.next(f())}C();var S=y(C);return{unsubscribe:S}}},p[zu]=function(){return this},p}return m({type:Hu.INIT}),n={dispatch:m,subscribe:u,getState:f,replaceReducer:g},n[zu]=w,n}var mS=function(t,r){return t===r};function yS(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function vS(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mS;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Qu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Gu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qu(Object(r),!0).forEach(function(n){bS(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 bS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wu={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function wS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wu,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Fs:case Ba:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case ja:return yS(e.clientOffset,r.clientOffset)?e:Gu(Gu({},e),{},{clientOffset:r.clientOffset});case Ua:case qa:return Wu;default:return e}}var Bs="dnd-core/ADD_SOURCE",js="dnd-core/ADD_TARGET",qs="dnd-core/REMOVE_SOURCE",Va="dnd-core/REMOVE_TARGET";function CS(e){return{type:Bs,payload:{sourceId:e}}}function SS(e){return{type:js,payload:{targetId:e}}}function _S(e){return{type:qs,payload:{sourceId:e}}}function TS(e){return{type:Va,payload:{targetId:e}}}function Ku(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ku(Object(r),!0).forEach(function(n){ES(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ku(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ES(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var IS={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function OS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:IS,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ba:return Ht(Ht({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ms:return Ht(Ht({},e),{},{isSourcePublic:!0});case ja:return Ht(Ht({},e),{},{targetIds:r.targetIds});case Va:return e.targetIds.indexOf(r.targetId)===-1?e:Ht(Ht({},e),{},{targetIds:$C(e.targetIds,r.targetId)});case qa:return Ht(Ht({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ua:return Ht(Ht({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function AS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Bs:case js:return e+1;case qs:case Va:return e-1;default:return e}}var Ha=[],Us=[];Ha.__IS_NONE__=!0,Us.__IS_ALL__=!0;function DS(e,t){if(e===Ha)return!1;if(e===Us||typeof t>"u")return!0;var r=jC(t,e);return r.length>0}function NS(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case ja:break;case Bs:case js:case Va:case qs:return Ha;case Ba:case Ms:case Ua:case qa:default:return Us}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,o=t.prevTargetIds,a=o===void 0?[]:o,i=BC(n,a),s=i.length>0||!vS(n,a);if(!s)return Ha;var l=a[a.length-1],d=n[n.length-1];return l!==d&&(l&&i.push(l),d&&i.push(d)),i}function kS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Yu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Zu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yu(Object(r),!0).forEach(function(n){xS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:NS(e.dirtyHandlerIds,{type:t.type,payload:Zu(Zu({},t.payload),{},{prevTargetIds:MC(e,"dragOperation.targetIds",[])})}),dragOffset:wS(e.dragOffset,t),refCount:AS(e.refCount,t),dragOperation:OS(e.dragOperation,t),stateId:kS(e.stateId)}}function PS(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Xu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function FS(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:Xu(PS(t,n),r)}function MS(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:Xu(t,r)}function $S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jS(e,t,r){return t&&BS(e.prototype,t),e}function Ju(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var qS=function(){function e(t,r){$S(this,e),Ju(this,"store",void 0),Ju(this,"registry",void 0),this.store=t,this.registry=r}return jS(e,[{key:"subscribeToStateChange",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},a=o.handlerIds;he(typeof r=="function","listener must be a function."),he(typeof a>"u"||Array.isArray(a),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId,s=function(){var d=n.store.getState(),f=d.stateId;try{var u=f===i||f===i+1&&!DS(d.dirtyHandlerIds,a);u||r()}finally{i=f}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;he(typeof r=="function","listener must be a function.");var o=this.store.getState().dragOffset,a=function(){var s=n.store.getState().dragOffset;s!==o&&(o=s,r())};return this.store.subscribe(a)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return he(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(he(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();return $s(o,a)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(he(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var o=this.registry.getSourceType(r),a=this.getItemType();return o!==a?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var o=n.shallow;if(!this.isDragging())return!1;var a=this.registry.getTargetType(r),i=this.getItemType();if(i&&!$s(a,i))return!1;var s=this.getTargetIds();if(!s.length)return!1;var l=s.indexOf(r);return o?l===s.length-1:l>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return FS(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return MS(this.store.getState().dragOffset)}}]),e}(),US=0;function zS(){return US++}function Ra(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ra=function(r){return typeof r}:Ra=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ra(e)}function VS(e){he(typeof e.canDrag=="function","Expected canDrag to be a function."),he(typeof e.beginDrag=="function","Expected beginDrag to be a function."),he(typeof e.endDrag=="function","Expected endDrag to be a function.")}function HS(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 zs(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return zs(r,!1)});return}he(typeof e=="string"||Ra(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const ef=typeof global<"u"?global:self,tf=ef.MutationObserver||ef.WebKitMutationObserver;function rf(e){return function(){const r=setTimeout(o,0),n=setInterval(o,50);function o(){clearTimeout(r),clearInterval(n),e()}}}function RS(e){let t=1;const r=new tf(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const QS=typeof tf=="function"?RS:rf;class GS{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,o=t.length-this.index;n<o;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=QS(this.flush),this.requestErrorThrow=rf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class WS{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 KS{create(t){const r=this.freeTasks,n=r.length?r.pop():new WS(this.onError,o=>r[r.length]=o);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const nf=new GS,YS=new KS(nf.registerPendingError);function ZS(e){nf.enqueueTask(YS.create(e))}function XS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function e_(e,t,r){return t&&JS(e.prototype,t),e}function Fn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t_(e,t){return a_(e)||o_(e,t)||n_(e,t)||r_()}function r_(){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
|
|
498
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h_(e,t){if(e){if(typeof e=="string")return lf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lf(e,t)}}function lf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function g_(e){if(Array.isArray(e))return e}function m_(e,t){if(e==null)return{};var r=y_(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y_(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var cf=0,Qa=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),v_=h.memo(function(t){var r=t.children,n=m_(t,d_),o=b_(n),a=u_(o,2),i=a[0],s=a[1];return h.useEffect(function(){if(s){var l=df();return++cf,function(){--cf===0&&(l[Qa]=null)}}},[]),c.jsx($u.Provider,Object.assign({value:i},{children:r}),void 0)});function b_(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=w_(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function w_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:df(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[Qa]||(o[Qa]={dragDropManager:l_(e,t,r,n)}),o[Qa]}function df(){return typeof global<"u"?global:window}function C_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function __(e,t,r){return t&&S_(e.prototype,t),e}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Vs=!1,Hs=!1,T_=function(){function e(t){C_(this,e),uf(this,"internalMonitor",void 0),uf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return __(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){he(!Vs,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Vs=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Vs=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;he(!Hs,"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 Hs=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Hs=!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 E_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I_(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 O_(e,t,r){return t&&I_(e.prototype,t),e}function ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Rs=!1,A_=function(){function e(t){E_(this,e),ff(this,"internalMonitor",void 0),ff(this,"targetId",null),this.internalMonitor=t.getMonitor()}return O_(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(!Rs,"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 Rs=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Rs=!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 D_(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 N_(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!h.isValidElement(t)){var n=t;return e(n,r),n}var o=t;D_(o);var a=r?function(i){return e(i,r)}:e;return k_(o,a)}}function hf(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var o=N_(n);t[r]=function(){return o}}}),t}function pf(e,t){typeof e=="function"?e(t):e.current=t}function k_(e,t){var r=e.ref;return he(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:function(o){pf(r,o),pf(t,o)}}):h.cloneElement(e,{ref:t})}function Ga(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ga=function(r){return typeof r}:Ga=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ga(e)}function Qs(e){return e!==null&&Ga(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Gs(e,t,r,n){var o=void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var d=a[l];if(!s(d))return!1;var f=e[d],u=t[d];if(o=void 0,o===!1||o===void 0&&f!==u)return!1}return!0}function x_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L_(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 P_(e,t,r){return t&&L_(e.prototype,t),e}function yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F_=function(){function e(t){var r=this;x_(this,e),yt(this,"hooks",hf({dragSource:function(o,a){r.clearDragSource(),r.dragSourceOptions=a||null,Qs(o)?r.dragSourceRef=o:r.dragSourceNode=o,r.reconnectDragSource()},dragPreview:function(o,a){r.clearDragPreview(),r.dragPreviewOptions=a||null,Qs(o)?r.dragPreviewRef=o:r.dragPreviewNode=o,r.reconnectDragPreview()}})),yt(this,"handlerId",null),yt(this,"dragSourceRef",null),yt(this,"dragSourceNode",void 0),yt(this,"dragSourceOptionsInternal",null),yt(this,"dragSourceUnsubscribe",void 0),yt(this,"dragPreviewRef",null),yt(this,"dragPreviewNode",void 0),yt(this,"dragPreviewOptionsInternal",null),yt(this,"dragPreviewUnsubscribe",void 0),yt(this,"lastConnectedHandlerId",null),yt(this,"lastConnectedDragSource",null),yt(this,"lastConnectedDragSourceOptions",null),yt(this,"lastConnectedDragPreview",null),yt(this,"lastConnectedDragPreviewOptions",null),yt(this,"backend",void 0),this.backend=t}return P_(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!Gs(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Gs(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 M_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function B_(e,t,r){return t&&$_(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 j_=function(){function e(t){var r=this;M_(this,e),ir(this,"hooks",hf({dropTarget:function(o,a){r.clearDropTarget(),r.dropTargetOptions=a,Qs(o)?r.dropTargetRef=o:r.dropTargetNode=o,r.reconnect()}})),ir(this,"handlerId",null),ir(this,"dropTargetRef",null),ir(this,"dropTargetNode",void 0),ir(this,"dropTargetOptionsInternal",null),ir(this,"unsubscribeDropTarget",void 0),ir(this,"lastConnectedHandlerId",null),ir(this,"lastConnectedDropTarget",null),ir(this,"lastConnectedDropTargetOptions",null),ir(this,"backend",void 0),this.backend=t}return B_(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!Gs(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 q_(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function U_(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}var Yr=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Wa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Wa=function(r){return typeof r}:Wa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Wa(e)}function z_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H_(e,t,r){return t&&V_(e.prototype,t),e}function Ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var R_=function(){function e(t,r,n){z_(this,e),Ws(this,"spec",void 0),Ws(this,"monitor",void 0),Ws(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return H_(e,[{key:"beginDrag",value:function(){var r,n=this.spec,o=this.monitor,a=null;return Wa(n.item)==="object"?a=n.item:typeof n.item=="function"?a=n.item(o):a={},(r=a)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var o=this.spec,a=this.monitor,i=o.isDragging;return i?i(a):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,o=this.connector,a=r.end;a&&a(n.getItem(),n),o.reconnect()}}]),e}();function Q_(e,t,r){var n=h.useMemo(function(){return new R_(e,t,r)},[t,r]);return h.useEffect(function(){n.spec=e},[e]),n}function Zr(){var e=h.useContext($u),t=e.dragDropManager;return he(t!=null,"Expected drag drop context"),t}function G_(e){return h.useMemo(function(){var t=e.type;return he(t!=null,"spec.type must be defined"),t},[e])}function W_(e,t){return X_(e)||Z_(e,t)||Y_(e,t)||K_()}function K_(){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
|
|
500
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
501
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
502
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
503
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
504
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
505
|
-
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Ya(Mn,xf,{exposeProperties:{text:function(t,r){return Ys(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Mn);function oT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aT(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 iT(e,t,r){return t&&aT(e.prototype,t),e}function Ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sT=function(){function e(t){oT(this,e),Ff(this,"item",void 0),Ff(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return iT(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var o={};Object.keys(this.config.exposeProperties).forEach(function(a){o[a]={value:n.config.exposeProperties[a](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,o)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();function lT(e,t){var r=new sT(Zs[e]);return r.loadDataTransfer(t),r}function Xs(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Zs).filter(function(r){var n=Zs[r].matchesTypes;return n.some(function(o){return t.indexOf(o)>-1})})[0]||null}function cT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dT(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 uT(e,t,r){return t&&dT(e.prototype,t),e}function Js(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fT=function(){function e(t,r){cT(this,e),Js(this,"ownerDocument",null),Js(this,"globalContext",void 0),Js(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return uT(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e}();function Mf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $f(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mf(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pT(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 gT(e,t,r){return t&&pT(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 mT=function(){function e(t,r,n){var o=this;hT(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(a){var i=o.sourceNodes.get(a);return i&&Df(i)||null}),be(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),be(this,"isNodeInDocument",function(a){return!!(a&&o.document&&o.document.body&&o.document.body.contains(a))}),be(this,"endDragIfSourceWasRemovedFromDOM",function(){var a=o.currentDragSourceNode;a==null||o.isNodeInDocument(a)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),be(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),be(this,"handleTopDragStart",function(a){if(!a.defaultPrevented){var i=o.dragStartSourceIds;o.dragStartSourceIds=null;var s=Ka(a);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:s});var l=a.dataTransfer,d=Xs(l);if(o.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var f=o.monitor.getSourceId(),u=o.sourceNodes.get(f),m=o.sourcePreviewNodes.get(f)||u;if(m){var g=o.getCurrentSourcePreviewNodeOptions(),w=g.anchorX,p=g.anchorY,y=g.offsetX,v=g.offsetY,b={anchorX:w,anchorY:p},C={offsetX:y,offsetY:v},S=nT(u,m,s,b,C);l.setDragImage(m,S.x,S.y)}}try{l==null||l.setData("application/json",{})}catch{}o.setCurrentDragSourceNode(a.target);var T=o.getCurrentSourcePreviewNodeOptions(),I=T.captureDraggingState;I?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(d)o.beginDragNativeItem(d);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}}}),be(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),be(this,"handleTopDragEnterCapture",function(a){o.dragEnterTargetIds=[];var i=o.enterLeaveCounter.enter(a.target);if(!(!i||o.monitor.isDragging())){var s=a.dataTransfer,l=Xs(s);l&&o.beginDragNativeItem(l,s)}}),be(this,"handleTopDragEnter",function(a){var i=o.dragEnterTargetIds;if(o.dragEnterTargetIds=[],!!o.monitor.isDragging()){o.altKeyPressed=a.altKey,i.length>0&&o.actions.hover(i,{clientOffset:Ka(a)});var s=i.some(function(l){return o.monitor.canDropOnTarget(l)});s&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=o.getCurrentDropEffect()))}}),be(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),be(this,"handleTopDragOver",function(a){var i=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}o.altKeyPressed=a.altKey,o.lastClientOffset=Ka(a),o.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(i||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}));var s=(i||[]).some(function(l){return o.monitor.canDropOnTarget(l)});s?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))}),be(this,"handleTopDragLeaveCapture",function(a){o.isDraggingNativeItem()&&a.preventDefault();var i=o.enterLeaveCounter.leave(a.target);i&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),be(this,"handleTopDropCapture",function(a){if(o.dropTargetIds=[],o.isDraggingNativeItem()){var i;a.preventDefault(),(i=o.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else Xs(a.dataTransfer)&&a.preventDefault();o.enterLeaveCounter.reset()}),be(this,"handleTopDrop",function(a){var i=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(i,{clientOffset:Ka(a)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),be(this,"handleSelectStart",function(a){var i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))}),this.options=new fT(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new K0(this.isNodeInDocument)}return gT(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,o){var a=this;return this.sourcePreviewNodeOptions.set(r,o),this.sourcePreviewNodes.set(r,n),function(){a.sourcePreviewNodes.delete(r),a.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,o){var a=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,o);var i=function(d){return a.handleDragStart(d,r)},s=function(d){return a.handleSelectStart(d)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),function(){a.sourceNodes.delete(r),a.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var o=this,a=function(d){return o.handleDragEnter(d,r)},i=function(d){return o.handleDragOver(d,r)},s=function(d){return o.handleDrop(d,r)};return n.addEventListener("dragenter",a),n.addEventListener("dragover",i),n.addEventListener("drop",s),function(){n.removeEventListener("dragenter",a),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return $f({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return $f({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Pf).some(function(n){return Pf[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=lT(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var o=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var a;return(a=n.rootElement)===null||a===void 0?void 0:a.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},o)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e}(),Za;function yT(){return Za||(Za=new Image,Za.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Za}var vT=function(t,r,n){return new mT(t,r,n)};function bT(e,t){return typeof e=="function"?e(t):e??"NODE"}function wT(e){return e.isDraggable&&!e.isEditing}function CT(e){const t=Nt(),r=t.selectedIds,[n,o,a]=S0(()=>({canDrag:()=>wT(e),type:bT(t.props.dragType,e),item:()=>{const i=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(kn.dragStart(e.id,i)),{id:e.id,dragIds:i,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(kn.dragEnd())}}),[r,e,t.props.dragType]);return h.useEffect(()=>{a(yT())},[a]),o}function ST(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),o=t.y-Math.round(r.y),a=r.height,i=o<a/2,s=!i,l=a/4,d=o>l&&o<a-l;return{x:n,inTopHalf:i,inBottomHalf:s,inMiddle:d,atTop:!d&&i,atBottom:!d&&s}}function _T(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 Xa(e,t){return{parentId:e||null,index:t}}function $n(e,t){return{type:"line",index:e,level:t}}function TT(e){return{type:"highlight",id:e}}function el(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const o=((r=n.parent)===null||r===void 0?void 0:r.id)||null,a=vu(n)+1;return{parentId:o,index:a}}function Bf(e){var t;const r=ST(e.element,e.offset),n=e.indent,o=Math.round(Math.max(0,r.x-n)/n),{node:a,nextNode:i,prevNode:s}=e,[l,d]=_T(a,s,i,r);if(a&&a.isInternal&&r.inMiddle)return{drop:Xa(a.id,null),cursor:TT(a.id)};if(!l)return{drop:Xa((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:$n(0,0)};if(pu(l)){const f=Pa(o,(d==null?void 0:d.level)||0,l.level);return{drop:el(l,f),cursor:$n(l.rowIndex+1,f)}}if(gu(l)){const f=Pa(o,(d==null?void 0:d.level)||0,l.level);return{drop:el(l,f),cursor:$n(l.rowIndex+1,f)}}if(mu(l)){const f=Pa(o,0,l.level+1);return f>l.level?{drop:Xa(l.id,0),cursor:$n(l.rowIndex+1,f)}:{drop:el(l,f),cursor:$n(l.rowIndex+1,f)}}return{drop:Xa(l==null?void 0:l.id,0),cursor:$n(l.rowIndex+1,l.level+1)}}function ET(e,t){const r=Nt(),[n,o]=_f(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(a,i)=>{const s=i.getClientOffset();if(!e.current||!s)return;const{cursor:l,drop:d}=Bf({element:e.current,offset:s,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch(kn.hovering(d.parentId,d.index)),i.canDrop()?l&&r.showCursor(l):r.hideCursor()},drop:(a,i)=>{if(!i.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return o}function IT(e){const t=Nt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return h.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const jf=h.memo(function({index:t,style:r}){hu(),Hw();const n=Nt(),o=IT(t),a=h.useRef(null),i=CT(o),s=ET(a,o),l=h.useCallback(p=>{a.current=p,s(p)},[s]),d=n.indent*o.level,f=h.useMemo(()=>({paddingLeft:d}),[d]),u=h.useMemo(()=>{var p,y;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((y=(p=n.props.padding)!==null&&p!==void 0?p:n.props.paddingTop)!==null&&y!==void 0?y:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),m={role:"treeitem","aria-level":o.level+1,"aria-selected":o.isSelected,"aria-expanded":o.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};h.useEffect(()=>{var p;!o.isEditing&&o.isFocused&&((p=a.current)===null||p===void 0||p.focus({preventScroll:!0}))},[o.isEditing,o.isFocused,a.current]);const g=n.renderNode,w=n.renderRow;return c.jsx(w,{node:o,innerRef:l,attrs:m,children:c.jsx(g,{node:o,tree:n,style:f,dragHandle:i})})});let tl="",qf=null;function Uf(){hu();const e=Nt();return c.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const o=Array.from(e.selectedIds);if(o.length>1){let a=e.mostRecentNode;for(;a&&a.isSelected;)a=a.nextSibling;a||(a=e.lastNode),e.focus(a,{scroll:!1}),e.delete(Array.from(o))}else{const a=e.focusedNode;if(a){const i=a.nextSibling,s=a.parent;e.focus(i||s,{scroll:!1}),e.delete(a)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),bu(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),wu(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const o=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const a=e.focusedNode;a?a.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const o=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const a=e.focusedNode;a?a.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const o=e.focusedNode;if(!o)return;o.isInternal&&o.isOpen?e.focus(e.nextNode):o.isInternal&&e.open(o.id);return}if(t.key==="ArrowLeft"){const o=e.focusedNode;if(!o||o.isRoot)return;o.isInternal&&o.isOpen?e.close(o.id):!((r=o.parent)===null||r===void 0)&&r.isRoot||e.focus(o.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const o=e.focusedNode;if(!o||!o.isEditable||!e.props.onRename)return;setTimeout(()=>{o&&e.edit(o)});return}if(t.key===" "){t.preventDefault();const o=e.focusedNode;if(!o)return;o.isLeaf?(o.select(),o.activate()):o.toggle();return}if(t.key==="*"){const o=e.focusedNode;if(!o)return;e.openSiblings(o);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(qf),tl+=t.key,qf=setTimeout(()=>{tl=""},600);const n=e.visibleNodes.find(o=>{const a=o.data.name;return typeof a=="string"?a.toLowerCase().startsWith(tl):!1});n&&e.focus(n.id)},children:c.jsx(OT,{})})}function OT(){var e,t;const r=Nt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:o=>{var a;return((a=r.visibleNodes[o])===null||a===void 0?void 0:a.id)||o},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:xC,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:FC,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?c.jsx(AC,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:jf})):c.jsx(DC,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:jf}))}function zf(e){return e.isFiltered?DT(e.root,e.isMatch.bind(e)):AT(e.root)}function AT(e){const t=[];function r(n){var o;n.level>=0&&t.push(n),n.isOpen&&((o=n.children)===null||o===void 0||o.forEach(r))}return r(e),t.forEach(Vf),t}function DT(e,t){const r={},n=[];function o(i){if(!i.isRoot&&t(i)){r[i.id]=!0;let l=i.parent;for(;l;)r[l.id]=!0,l=l.parent}if(i.children)for(let l of i.children)o(l)}function a(i){var s;i.level>=0&&r[i.id]&&n.push(i),i.isOpen&&((s=i.children)===null||s===void 0||s.forEach(a))}return o(e),a(e),n.forEach(Vf),n}function Vf(e,t){e.rowIndex=t}const Hf=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var rl=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(f){try{d(n.next(f))}catch(u){i(u)}}function l(f){try{d(n.throw(f))}catch(u){i(u)}}function d(f){f.done?a(f.value):o(f.value).then(s,l)}d((n=n.apply(e,t||[])).next())})};const{safeRun:vt}=Kw;class Do{constructor(t,r,n,o){this.store=t,this.props=r,this.list=n,this.listEl=o,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=a=>{const i=this.props.rowHeight;if(typeof i=="function"){const s=this.at(a);return s?i(s):this.rowHeight}return i??24},this.rowTopPosition=a=>{if(typeof this.props.rowHeight!="function")return a*this.rowHeight;const i=this.getRowOffsets(),s=Math.max(0,Math.min(a,i.length-1));return i[s]},this.redrawList=(a=0)=>{this.rowOffsets=null;const i=this.list.current;i&&"resetAfterIndex"in i&&i.resetAfterIndex(Math.max(0,a))},this.root=Eu(this),this.visibleNodes=zf(this),this.idToIndex=Hf(this.visibleNodes)}update(t){this.props=t,this.root=Eu(this),this.visibleNodes=zf(this),this.idToIndex=Hf(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:(n,o)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(o.toLocaleLowerCase());return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=To(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=To(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof Io)return t.id;const r=this.props.idAccessor||"id";return To(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const o=(n=this.indexOf(t))!==null&&n!==void 0?n:0,a=this.indexOf(r);if(a===null)return[];const i=Math.min(o,a),s=Math.max(o,a);return this.visibleNodes.slice(i,s+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return rl(this,arguments,void 0,function*(t={}){var r,n;const o=t.parentId===void 0?Tu(this):t.parentId,a=(r=t.index)!==null&&r!==void 0?r:_u(this),i=(n=t.type)!==null&&n!==void 0?n:"leaf",s=yield vt(this.props.onCreate,{type:i,parentId:o,index:a,parentNode:this.get(o)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(t){return rl(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(i=>this.identify(i)),o=n.map(i=>this.get(i)).filter(i=>!!i),a=o.length?Math.min(...o.map(i=>{var s;return(s=i.rowIndex)!==null&&s!==void 0?s:0})):0;yield vt(this.props.onDelete,{nodes:o,ids:n}),this.redrawList(a)})}edit(t){var r,n;const o=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(o),this.dispatch(Ds(o)),this.redrawList((n=(r=this.get(o))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(a=>{Do.editPromise=a})}submit(t,r){return rl(this,void 0,void 0,function*(){var n,o;if(!t)return;const a=this.identify(t);yield vt(this.props.onRename,{id:a,name:r,node:this.get(a)}),this.dispatch(Ds(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Ds(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&vt(this.props.onActivate,r)}resolveEdit(t){const r=Do.editPromise;r&&r(t),Do.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(Dn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&vt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,a=this.visibleStopIndex-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i>n?i=n:i=Math.max(n-a,0),this.focus(this.at(i))}pageDown(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex,a=o-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i<o?i=o:i=Math.min(i+a,this.visibleNodes.length-1),this.focus(this.at(i))}select(t,r={}){var n;if(!t)return;const o=r.focus!==!1,a=this.identify(t);o&&this.dispatch(Dn(a)),!((n=this.get(a))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[a],anchor:a,mostRecent:a}),this.scrollTo(a,r.align),this.focusedNode&&o&&vt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Nr.remove(r)),vt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const o=r.focus!==!1;o&&this.dispatch(Dn(n.id)),n.isSelectable&&(this.dispatch(Nr.add(n.id)),this.dispatch(Nr.anchor(n.id)),this.dispatch(Nr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&o&&vt(this.props.onFocus,this.focusedNode),vt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(Dn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:o,mostRecent:a}=this.state.nodes.selection,i=this.filterSelectableNodes(this.nodesBetween(o,this.identifyNull(n)));this.dispatch(Nr.remove(this.nodesBetween(o,a))),this.dispatch(Nr.add(i)),this.dispatch(Nr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&vt(this.props.onFocus,this.focusedNode),vt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const o=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:o,anchor:(t=o[0])!==null&&t!==void 0?t:null,mostRecent:(r=o[o.length-1])!==null&&r!==void 0?r:null}),this.dispatch(Dn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&vt(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(i=>this.identify(i))),o=this.identifyNull(t.anchor),a=this.identifyNull(t.mostRecent);this.dispatch(Nr.set({ids:n,anchor:o,mostRecent:a})),vt(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,o=this.props.disableDrop;for(const a of n)if(!a||!r||a.isInternal&&yu(r,a))return!1;return typeof o=="function"?!o({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof o=="string"?!r.data[o]:typeof o=="boolean"?!o:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;vt(this.props.onMove,{dragIds:n,parentId:t===Eo?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(kn.cursor({type:"none"}))}showCursor(t){this.dispatch(kn.cursor(t))}open(t,r=!0){var n,o;const a=this.identifyNull(t);a&&(this.isOpen(a)||(this.dispatch(Ns.open(a,this.isFiltered)),r&&this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),vt(this.props.onToggle,a)))}close(t,r=!0){var n,o;const a=this.identifyNull(t);a&&this.isOpen(a)&&(this.dispatch(Ns.close(a,this.isFiltered)),r&&this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),vt(this.props.onToggle,a))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=As(this.root,r);let o=n==null?void 0:n.parent;for(;o;)this.open(o.id,!1),o=o.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let o of r.children)o.isInternal&&(n?this.close(o.id,!1):this.open(o.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){Fa(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){Fa(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),Su(()=>n in this.idToIndex).then(()=>{var o;const a=this.idToIndex[n];a!==void 0&&((o=this.list.current)===null||o===void 0||o.scrollToItem(a,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,o;if(!t)return!1;if(t===Eo)return!0;const a=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(o=this.state.nodes.open.unfiltered[t])!==null&&o!==void 0?o:a}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!To(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:o}=this.state.nodes.drag;return r===n&&o===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(Dn(t.id))}onBlur(){this.dispatch(aC())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Uf}get renderRow(){return this.props.renderRow||eC}get renderNode(){return this.props.children||tC}get renderDragPreview(){return this.props.renderDragPreview||Ou}get renderCursor(){return this.props.renderCursor||Jw}}function bt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var NT=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rf=NT,nl=()=>Math.random().toString(36).substring(7).split("").join("."),kT={INIT:`@@redux/INIT${nl()}`,REPLACE:`@@redux/REPLACE${nl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${nl()}`},Xr=kT;function Qf(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function xT(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(FT(e))return"date";if(PT(e))return"error";const r=LT(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 LT(e){return typeof e.constructor=="function"?e.constructor.name:null}function PT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function FT(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=xT(e)),t}function Gf(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?bt(2):`Expected the root reducer to be a function. Instead, received: '${kr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?bt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?bt(1):`Expected the enhancer to be a function. Instead, received: '${kr(r)}'`);return r(Gf)(e,t)}let n=e,o=t,a=new Map,i=a,s=0,l=!1;function d(){i===a&&(i=new Map,a.forEach((y,v)=>{i.set(v,y)}))}function f(){if(l)throw new Error(process.env.NODE_ENV==="production"?bt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?bt(4):`Expected the listener to be a function. Instead, received: '${kr(y)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?bt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let v=!0;d();const b=s++;return i.set(b,y),function(){if(v){if(l)throw new Error(process.env.NODE_ENV==="production"?bt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,d(),i.delete(b),a=null}}}function m(y){if(!Qf(y))throw new Error(process.env.NODE_ENV==="production"?bt(7):`Actions must be plain objects. Instead, the actual type was: '${kr(y)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof y.type>"u")throw new Error(process.env.NODE_ENV==="production"?bt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof y.type!="string")throw new Error(process.env.NODE_ENV==="production"?bt(17):`Action "type" property must be a string. Instead, the actual type was: '${kr(y.type)}'. Value was: '${y.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?bt(9):"Reducers may not dispatch actions.");try{l=!0,o=n(o,y)}finally{l=!1}return(a=i).forEach(b=>{b()}),y}function g(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?bt(10):`Expected the nextReducer to be a function. Instead, received: '${kr(y)}`);n=y,m({type:Xr.REPLACE})}function w(){const y=u;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?bt(11):`Expected the observer to be an object. Instead, received: '${kr(v)}'`);function b(){const S=v;S.next&&S.next(f())}return b(),{unsubscribe:y(b)}},[Rf](){return this}}}return m({type:Xr.INIT}),{dispatch:m,subscribe:u,getState:f,replaceReducer:g,[Rf]:w}}function Wf(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function MT(e,t,r,n){const o=Object.keys(t),a=r&&r.type===Xr.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Qf(e))return`The ${a} has unexpected type of "${kr(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const i=Object.keys(e).filter(s=>!t.hasOwnProperty(s)&&!n[s]);if(i.forEach(s=>{n[s]=!0}),!(r&&r.type===Xr.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${a}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function $T(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Xr.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?bt(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Xr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?bt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Xr.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function Kf(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const s=t[i];process.env.NODE_ENV!=="production"&&typeof e[s]>"u"&&Wf(`No reducer provided for key "${s}"`),typeof e[s]=="function"&&(r[s]=e[s])}const n=Object.keys(r);let o;process.env.NODE_ENV!=="production"&&(o={});let a;try{$T(r)}catch(i){a=i}return function(s={},l){if(a)throw a;if(process.env.NODE_ENV!=="production"){const u=MT(s,r,l,o);u&&Wf(u)}let d=!1;const f={};for(let u=0;u<n.length;u++){const m=n[u],g=r[m],w=s[m],p=g(w,l);if(typeof p>"u"){const y=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?bt(14):`When called with an action of type ${y?`"${String(y)}"`:"(unknown type)"}, the slice reducer for key "${m}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}f[m]=p,d=d||p!==w}return d=d||n.length!==Object.keys(s).length,d?f:s}}function BT(e=Nn().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const jT=Kf({nodes:Kf({focus:iC,edit:oC,open:sC,selection:lC,drag:BT}),dnd:cC}),qT=Nn();function UT({treeProps:e,imperativeHandle:t,children:r}){const n=h.useRef(null),o=h.useRef(null),a=h.useRef(Gf(jT,Nn(e))),i=Vw.useSyncExternalStore(a.current.subscribe,a.current.getState,()=>qT),s=h.useMemo(()=>new Do(a.current,e,n,o),[]),l=h.useRef(0);return h.useMemo(()=>{l.current+=1,s.update(e)},Object.values(e)),h.useMemo(()=>{l.current+=1,s.update(s.props)},[i.nodes.open]),h.useImperativeHandle(t,()=>s),h.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),h.useEffect(()=>{s.props.searchTerm||a.current.dispatch(Ns.clear(!0))},[s.props.searchTerm]),c.jsx(cu.Provider,{value:s,children:c.jsx(fu.Provider,{value:l.current,children:c.jsx(du.Provider,{value:i.nodes,children:c.jsx(uu.Provider,{value:i.dnd,children:c.jsx(v_,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||vT,options:{rootElement:s.props.dndRootElement||void 0}},{children:r}))})})})})}function zT(){const e=Nt(),[,t]=_f(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const o=n.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:a,drop:i}=Bf({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});i&&e.dispatch(kn.hovering(i.parentId,i.index)),n.canDrop()?a&&e.showCursor(a):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function VT(e){return zT(),e.children}function HT(){const t=Nt().props.renderContainer||Uf;return c.jsx(c.Fragment,{children:c.jsx(t,{})})}function RT(){const e=Nt(),{offset:t,mouse:r,item:n,isDragging:o}=V0(i=>({offset:i.getSourceClientOffset(),mouse:i.getClientOffset(),item:i.getItem(),isDragging:i.isDragging()})),a=e.props.renderDragPreview||Ou;return c.jsx(a,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:o})}function QT(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",o=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:a=>a[n],getChildren:typeof o=="function"?o:a=>a[o],childrenKey:typeof o=="string"?o:"children"}}class GT{constructor(t,r={}){this.accessors=QT(r),this.root=WT(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const o=this.find(t,n);if(o)return o}return null}return null}}function WT(e,t){const r=new Yf({},null,t,"ROOT");return r.children=e.map(n=>ol(n,r,t)),r}function ol(e,t,r){const n=new Yf(e,t,r),o=r.getChildren(e);return o&&(n.children=o.map(a=>ol(a,n,r))),n}class Yf{constructor(t,r,n,o){this.data=t,this.parent=r,this.accessors=n,this.id=o??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,o;const a=ol(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,a);const i=this.accessors.childrenKey,s=this.data;s[i]=(o=s[i])!==null&&o!==void 0?o:[],s[i].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let KT=0;function YT(e,t={}){const[r,n]=h.useState(e),o=t.idAccessor,a=t.childrenAccessor,i=h.useMemo(()=>new GT(r,{idAccessor:o,childrenAccessor:a}),[r,o,a]),s=w=>{for(const p of w.dragIds)i.move({id:p,parentId:w.parentId,index:w.index});n(i.data)},l=({name:w,id:p})=>{i.update({id:p,changes:{name:w}}),n(i.data)},d=typeof o=="string"?o:"id",f=typeof a=="string"?a:"children";return[r,{onMove:s,onRename:l,onCreate:({parentId:w,index:p,type:y})=>{if(typeof o=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(y==="internal"&&typeof a=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const v={[d]:`simple-tree-id-${KT++}`,name:""};return y==="internal"&&(v[f]=[]),i.create({parentId:w,index:p,data:v}),n(i.data),v},onDelete:w=>{w.ids.forEach(p=>i.drop({id:p})),n(i.data)}}]}function ZT(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]=YT(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function XT(e,t){const r=ZT(e);return c.jsxs(UT,{treeProps:r,imperativeHandle:t,children:[c.jsx(VT,{children:c.jsx(HT,{})}),c.jsx(RT,{})]})}const JT=h.forwardRef(XT);function al(){return Ae(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function e1(){return Ae(e=>{var o;if(!e.selectedNodeId)return!1;const t=(o=e.treeData[0])==null?void 0:o.id,r=a=>{var i;for(const s of a){if(s.id===e.selectedNodeId)return s;if((i=s.children)!=null&&i.length){const l=r(s.children);if(l)return l}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Zf={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",default:"#6B7280"},Xf={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",default:"File"},Jf=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],t1=[{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 r1(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 Ja(e){const t=r1(e);return{key:t,color:Zf[t]??Zf.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:Xf[t]??Xf.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const kt={row:"_row_i3qt2_1",grip:"_grip_i3qt2_16",menuBtn:"_menuBtn_i3qt2_19",selected:"_selected_i3qt2_23",title:"_title_i3qt2_28",dropTarget:"_dropTarget_i3qt2_33",toggle:"_toggle_i3qt2_50",ctIcon:"_ctIcon_i3qt2_65",folderIcon:"_folderIcon_i3qt2_77",renameInput:"_renameInput_i3qt2_92",dropHere:"_dropHere_i3qt2_101",menuWrap:"_menuWrap_i3qt2_111",menu:"_menu_i3qt2_19",dangerItem:"_dangerItem_i3qt2_163"},n1={video:Ji,pdf:ba,h5p:Gi,scorm:Ki,audio:Wi,quiz:Ri,default:Sn},o1=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[o,a]=h.useState(!1),[i,s]=h.useState(!1),[l,d]=h.useState(e.data.name),f=h.useRef(null),u=le(),m=n==="edit",g=al(),w=Ja(e.data),p=n1[w.key]??Sn,y=e.isSelected,v=e.level===0,b=e.data.isFolder??(e.children&&e.children.length>0),C=v?Dy:b?Fy:p;h.useEffect(()=>{if(!o)return;const I=k=>{var x;(x=f.current)!=null&&x.contains(k.target)||a(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[o]);const S=h.useCallback(()=>{l.trim()&&e.submit(l.trim()),s(!1)},[l,e]),T=h.useCallback(I=>{I.key==="Enter"&&S(),I.key==="Escape"&&(d(e.data.name),s(!1))},[S,e.data.name]);return c.jsxs("div",{className:[kt.row,y?kt.selected:"",e.state.isOver&&b?kt.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":b?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":b?!e.isClosed:void 0,children:[m&&c.jsx("span",{ref:r,className:kt.grip,"aria-hidden":"true",children:c.jsx(Xc,{size:14})}),c.jsx("button",{className:kt.toggle,onClick:I=>{I.stopPropagation(),e.toggle()},"aria-label":e.isClosed?u.treeNode.expandAriaLabel:u.treeNode.collapseAriaLabel,style:{visibility:b?"visible":"hidden"},children:e.isClosed?c.jsx(Wc,{size:14}):c.jsx(Cn,{size:14})}),c.jsx("span",{className:`${kt.ctIcon} ${v||b?kt.folderIcon:w.bgClass}`,"aria-hidden":"true",children:c.jsx(C,{size:12})}),i?c.jsx("input",{className:kt.renameInput,value:l,autoFocus:!0,onChange:I=>d(I.target.value),onBlur:S,onKeyDown:T,onClick:I=>I.stopPropagation()}):c.jsx("span",{className:kt.title,title:e.data.name,onDoubleClick:()=>m&&s(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&b&&c.jsx("span",{className:kt.dropHere,"aria-hidden":"true",children:u.treeNode.dropHereLabel}),m&&c.jsxs("div",{className:kt.menuWrap,ref:f,children:[c.jsx("button",{className:kt.menuBtn,onClick:I=>{I.stopPropagation(),a(k=>!k)},"aria-label":u.treeNode.nodeOptionsAriaLabel,children:c.jsx(Yc,{size:14})}),o&&c.jsxs("div",{className:kt.menu,role:"menu",children:[c.jsxs("button",{role:"menuitem",onClick:()=>{s(!0),a(!1)},children:[c.jsx(zy,{size:13})," ",u.treeNode.renameMenuItem]}),b&&g&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),a(!1)},children:[c.jsx(Zc,{size:13})," ",u.treeNode.addSubunitMenuItem]}),e.data.parent&&g&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),a(!1)},children:[c.jsx(mo,{size:13})," ",u.treeNode.addSiblingMenuItem]}),c.jsxs("button",{role:"menuitem",className:kt.dangerItem,onClick:()=>{e.tree.delete(e.id),a(!1)},children:[c.jsx(Zi,{size:13})," ",u.treeNode.deleteMenuItem]})]})]})]})};async function a1(e,t){var a,i;const n=((a=(await ke.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:a.result)??{},o=((i=n.content)==null?void 0:i.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!o)throw new Error("Could not obtain an upload URL");return o}async function i1(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 s1(e,t){var s;const r=await a1(e,t.name),n=await i1(r,t),o=new FormData;return o.append("fileUrl",n),o.append("mimeType",t.type||"text/csv"),{processId:(((s=(await ke.post(`/action/collection/v1/import/${e}`,o)).data)==null?void 0:s.result)??{}).processId??""}}async function l1(e){var r;return((r=(await ke.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function eh(e){var n,o,a;const r=(a=(o=(n=(await ke.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:o.collection)==null?void 0:a.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function c1(e){return eh(e)}const Le={container:"_container_jr3ij_1",header:"_header_jr3ij_13",title:"_title_jr3ij_22",closeBtn:"_closeBtn_jr3ij_29",body:"_body_jr3ij_45",dropZone:"_dropZone_jr3ij_54",dragOver:"_dragOver_jr3ij_67",hasFile:"_hasFile_jr3ij_72",hiddenInput:"_hiddenInput_jr3ij_78",fileInfo:"_fileInfo_jr3ij_82",fileIcon:"_fileIcon_jr3ij_89",fileName:"_fileName_jr3ij_93",fileSize:"_fileSize_jr3ij_100",dropHint:"_dropHint_jr3ij_105",dropIcon:"_dropIcon_jr3ij_112",dropText:"_dropText_jr3ij_117",dropSubtext:"_dropSubtext_jr3ij_124",sampleLink:"_sampleLink_jr3ij_130",statusBar:"_statusBar_jr3ij_145",status_uploading:"_status_uploading_jr3ij_154",status_processing:"_status_processing_jr3ij_154",status_done:"_status_done_jr3ij_159",status_error:"_status_error_jr3ij_164",successDetail:"_successDetail_jr3ij_170",spinner:"_spinner_jr3ij_175",spin:"_spin_jr3ij_175",errorMsg:"_errorMsg_jr3ij_191",failedSection:"_failedSection_jr3ij_197",failedTitle:"_failedTitle_jr3ij_203",tableWrap:"_tableWrap_jr3ij_213",failedTable:"_failedTable_jr3ij_219",reasonCell:"_reasonCell_jr3ij_244",footer:"_footer_jr3ij_248"},d1=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const o=le(),[a,i]=h.useState(null),[s,l]=h.useState(!1),[d,f]=h.useState("idle"),[u,m]=h.useState(""),[g,w]=h.useState([]),[p,y]=h.useState(null),v=h.useRef(null),b=h.useRef(null),C=h.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[]);h.useEffect(()=>()=>C(),[C]);const S=N=>N.name.toLowerCase().endsWith(".csv")?N.size>50*1024*1024?(m(o.csvUpload.fileTooLarge),!1):!0:(m(o.csvUpload.invalidFileType),!1),T=h.useCallback(N=>{m(""),w([]),y(null),f("idle"),S(N)&&i(N)},[]),I=h.useCallback(N=>{N.preventDefault(),l(!1);const L=N.dataTransfer.files[0];L&&T(L)},[T]),k=h.useCallback(N=>{var B;const L=(B=N.target.files)==null?void 0:B[0];L&&T(L),N.target.value=""},[T]),x=h.useCallback(async()=>{try{const N=await c1(e),L=document.createElement("a");L.href=N,L.download="sample_hierarchy.csv",L.target="_blank",L.click()}catch{m(o.csvUpload.downloadSampleFailed)}},[e,o.csvUpload.downloadSampleFailed]),$=h.useCallback(async()=>{if(a){f("uploading"),m(""),w([]);try{const{processId:N}=await s1(e,a);if(!N){f("done"),y(null),setTimeout(t,1500);return}f("processing"),b.current=setInterval(async()=>{try{const L=await l1(N);L.status==="COMPLETED"?(C(),f("done"),y(L.successCount??null),L.failedRecords&&L.failedRecords.length>0?w(L.failedRecords):setTimeout(t,1500)):L.status==="FAILED"&&(C(),f("error"),m(o.csvUpload.processingFailed),L.failedRecords&&w(L.failedRecords))}catch{C(),f("error"),m(o.csvUpload.connectionLost)}},2e3)}catch{f("error"),m(o.csvUpload.uploadFailed)}}},[e,a,t,C,o.csvUpload.processingFailed,o.csvUpload.connectionLost,o.csvUpload.uploadFailed]),j={idle:"",uploading:o.csvUpload.statusUploading,processing:o.csvUpload.statusProcessing,done:o.csvUpload.statusDone,error:o.csvUpload.statusError};return c.jsxs("div",{className:Le.container,children:[c.jsxs("div",{className:Le.header,children:[c.jsx("h2",{className:Le.title,children:n==="update"?o.csvUpload.titleUpdate:o.csvUpload.titleCreate}),c.jsx("button",{className:Le.closeBtn,onClick:r,"aria-label":o.csvUpload.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:Le.body,children:[c.jsxs("div",{className:`${Le.dropZone} ${s?Le.dragOver:""} ${a?Le.hasFile:""}`,onDragEnter:N=>{N.preventDefault(),l(!0)},onDragOver:N=>{N.preventDefault(),l(!0)},onDragLeave:N=>{N.preventDefault(),l(!1)},onDrop:I,onClick:()=>{var N;return(N=v.current)==null?void 0:N.click()},role:"button",tabIndex:0,"aria-label":o.csvUpload.dropZoneAriaLabel,onKeyDown:N=>{var L;return N.key==="Enter"&&((L=v.current)==null?void 0:L.click())},children:[c.jsx("input",{ref:v,type:"file",accept:".csv",className:Le.hiddenInput,onChange:k,"aria-hidden":"true"}),a?c.jsxs("div",{className:Le.fileInfo,children:[c.jsx(ba,{size:24,className:Le.fileIcon}),c.jsx("span",{className:Le.fileName,children:a.name}),c.jsxs("span",{className:Le.fileSize,children:["(",(a.size/1024).toFixed(1)," KB)"]})]}):c.jsxs("div",{className:Le.dropHint,children:[c.jsx(Xi,{size:32,className:Le.dropIcon}),c.jsx("p",{className:Le.dropText,children:o.csvUpload.dropText}),c.jsx("p",{className:Le.dropSubtext,children:o.csvUpload.dropSubtext})]})]}),c.jsx("button",{className:Le.sampleLink,onClick:x,type:"button",children:o.csvUpload.downloadSample}),d!=="idle"&&c.jsxs("div",{className:`${Le.statusBar} ${Le[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&c.jsx("span",{className:Le.spinner,"aria-hidden":"true"}),j[d],d==="done"&&p!==null&&c.jsx("span",{className:Le.successDetail,children:o.csvUpload.itemsImportedSuffix.replace("{count}",String(p))})]}),u&&c.jsx("p",{className:Le.errorMsg,role:"alert",children:u}),g.length>0&&c.jsxs("div",{className:Le.failedSection,children:[c.jsx("h4",{className:Le.failedTitle,children:o.csvUpload.failedRowsTitle.replace("{count}",String(g.length))}),c.jsx("div",{className:Le.tableWrap,children:c.jsxs("table",{className:Le.failedTable,children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:o.csvUpload.rowHeader}),c.jsx("th",{children:o.csvUpload.nameHeader}),c.jsx("th",{children:o.csvUpload.reasonHeader})]})}),c.jsx("tbody",{children:g.map((N,L)=>c.jsxs("tr",{children:[c.jsx("td",{children:N.rowNumber??L+1}),c.jsx("td",{children:N.name??"—"}),c.jsx("td",{className:Le.reasonCell,children:N.reason??o.csvUpload.unknownError})]},L))})]})})]})]}),c.jsxs("div",{className:Le.footer,children:[c.jsx($e,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:o.csvUpload.cancel}),c.jsx($e,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!a||d==="done",onClick:$,children:d==="done"?o.csvUpload.uploaded:o.csvUpload.upload})]})]})},sr={container:"_container_1y30m_1",header:"_header_1y30m_8",headerActions:"_headerActions_1y30m_19",iconBtn:"_iconBtn_1y30m_25",menuWrap:"_menuWrap_1y30m_43",dropdownMenu:"_dropdownMenu_1y30m_47",treeWrapper:"_treeWrapper_1y30m_79",csvModal:"_csvModal_1y30m_95",footer:"_footer_1y30m_105"},u1=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var ue;const n=le(),o=h.useRef(null),a=h.useRef(null),i=h.useRef(null),[s,l]=h.useState(400),[d,f]=h.useState(!1),[u,m]=h.useState(!1),[g,w]=h.useState("create"),{treeData:p,selectedNodeId:y,selectNode:v,addNode:b,deleteNode:C,reorderChildren:S,moveNode:T,setTreeData:I}=Ae(),k=e==="edit",x=al(),$=k&&x,j=(((ue=p[0])==null?void 0:ue.children)??[]).some(Q=>Q.isFolder),N=ce(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)??""}),L=ce(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});h.useEffect(()=>{const Q=a.current;if(!Q)return;const ne=new ResizeObserver(()=>{l(Q.clientHeight||400)});return ne.observe(Q),l(Q.clientHeight||400),()=>ne.disconnect()},[]),h.useEffect(()=>{if(!d)return;const Q=ne=>{var te;(te=i.current)!=null&&te.contains(ne.target)||f(!1)};return document.addEventListener("mousedown",Q),()=>document.removeEventListener("mousedown",Q)},[d]);const B=h.useCallback(Q=>{Q.length>0&&v(Q[0].data.id)},[v]),P=h.useCallback(({parentId:Q,index:ne,dragIds:te})=>{if(!Q)return;const U=te[0],H=il(p,U);if(!H)return;const ae=H.parent;if(ae===Q){const fe=il(p,Q);if(!(fe!=null&&fe.children))return;const J=fe.children.findIndex(oe=>oe.id===U);if(J<0)return;S(Q,J,ne>J?ne-1:ne)}else T(U,ae??"",Q)},[p,S,T]),F=h.useCallback(({ids:Q})=>{Q.forEach(ne=>C(ne))},[C]),V=h.useCallback(({parentId:Q})=>{var U;const ne=Q??((U=p[0])==null?void 0:U.id)??"";if(!ne)return{id:crypto.randomUUID()};const te=b(ne,"unit");return te?{id:te}:(Ie.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[b,p,n]),X=h.useCallback(()=>{var ne;const Q=(ne=p[0])==null?void 0:ne.id;Q&&(b(Q,"unit")||Ie.error(n.outlineTree.maxDepthReachedToast))},[p,b,n]),ve=h.useCallback(()=>{y&&(b(y,"subunit")||Ie.error(n.outlineTree.maxDepthReachedToast))},[y,b,n]),Ee=h.useCallback(async()=>{if(f(!1),!!N)try{const Q=await eh(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{Ie.error(n.outlineTree.downloadCsvFailedToast)}},[N,n]),Ce=h.useCallback(async()=>{if(m(!1),!!N)try{const{rootNode:Q}=await lu(N);I([Q]),Ie.success(n.outlineTree.outlineRefreshedToast)}catch{Ie.error(n.outlineTree.outlineRefreshFailedToast)}},[N,I,n]);return c.jsxs("div",{className:sr.container,children:[c.jsx("div",{className:sr.header,children:c.jsxs("div",{className:sr.headerActions,children:[k&&c.jsxs("div",{className:sr.menuWrap,ref:i,children:[c.jsx("button",{type:"button",className:sr.iconBtn,onClick:()=>f(Q=>!Q),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:c.jsx(Yc,{size:15})}),d&&c.jsx("div",{className:sr.dropdownMenu,role:"menu",children:L&&c.jsxs(c.Fragment,{children:[c.jsx("button",{role:"menuitem",type:"button",disabled:j,title:j?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{f(!1),w("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!j,title:j?void 0:n.outlineTree.noFoldersYetTitle,onClick:Ee,children:n.outlineTree.downloadFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!j,title:j?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{f(!1),w("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})})]}),r&&c.jsx("button",{type:"button",className:sr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?c.jsx(qy,{size:15}):c.jsx(jy,{size:15})})]})}),c.jsx("div",{className:sr.treeWrapper,ref:a,children:c.jsx(JT,{ref:o,data:p,idAccessor:"id",childrenAccessor:"children",onSelect:B,onMove:k?P:void 0,onDelete:k?F:void 0,onCreate:k?V:void 0,disableEdit:!k,disableDrop:!k,selection:y??void 0,rowHeight:40,indent:20,paddingBottom:16,height:s,width:"100%",children:Q=>c.jsx(o1,{...Q,editorMode:e})})}),k&&c.jsxs("div",{className:sr.footer,children:[c.jsxs($e,{variant:"ghost",size:"sm",onClick:X,disabled:!$,children:[c.jsx(mo,{size:14})," ",n.outlineTree.addUnitButton]}),c.jsxs($e,{variant:"ghost",size:"sm",onClick:ve,disabled:!$||!y,children:[c.jsx(Zc,{size:14})," ",n.outlineTree.addSubunitButton]})]}),u&&c.jsx("div",{className:sr.csvModal,children:c.jsx(d1,{contentId:N,mode:g,onComplete:Ce,onClose:()=>m(!1)})})]})};function il(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=il(r.children,t);if(n)return n}}}const No={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},f1=({crumbs:e})=>{const t=Ae(n=>n.selectNode),r=le();return e.length?c.jsxs("nav",{className:No.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[c.jsx("button",{className:No.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:c.jsx($y,{size:13})}),e.map((n,o)=>c.jsxs(h.Fragment,{children:[c.jsx(Wc,{size:13,className:No.sep}),o<e.length-1?c.jsx("button",{className:No.crumb,onClick:()=>t(n.id),children:n.name}):c.jsx("span",{className:No.current,children:n.name})]},n.id))]}):null},ko={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},h1=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const o=le(),a=[{id:"details",label:o.tabBar.detailsTab},{id:"audience",label:o.tabBar.audienceCurriculumTab},{id:"licensing",label:o.tabBar.licensingTab}],i=n?a.filter(s=>n.includes(s.id)):a;return c.jsx("div",{className:ko.tabBar,role:"tablist","aria-label":o.tabBar.metadataSectionsAriaLabel,children:i.map(s=>c.jsxs("button",{role:"tab","aria-selected":e===s.id,"aria-controls":`panel-${s.id}`,className:[ko.tab,e===s.id?ko.active:"",r.includes(s.id)?ko.error:""].join(" "),onClick:()=>t(s.id),children:[s.label,r.includes(s.id)&&c.jsx("span",{className:ko.errorDot,"aria-label":o.tabBar.hasErrorsAriaLabel})]},s.id))})};var xo=e=>e.type==="checkbox",Jr=e=>e instanceof Date,ft=e=>e==null;const th=e=>typeof e=="object";var Qe=e=>!ft(e)&&!Array.isArray(e)&&th(e)&&!Jr(e),sl=e=>Qe(e)&&e.target?xo(e.target)?e.target.checked:e.target.value:e,rh=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),nh=e=>{const t=e.constructor&&e.constructor.prototype;return Qe(t)&&t.hasOwnProperty("isPrototypeOf")},ei=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ze(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(ei&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Qe(e)&&nh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=Ze(e[o]));return n}const xr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Jt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},er={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ll="form",oh="root",ah=["__proto__","constructor","prototype"];var Lo=e=>/^\w*$/.test(e),qe=e=>e===void 0,ti=e=>e.split(/[.[\]'"]/g).filter(Boolean),W=(e,t,r)=>{if(!t||!Qe(e))return r;const n=Lo(t)?[t]:ti(t);if(n.some(a=>ah.includes(a)))return r;const o=n.reduce((a,i)=>ft(a)?void 0:a[i],e);return qe(o)||o===e?qe(e[t])?r:e[t]:o},Mt=e=>typeof e=="boolean",wt=e=>typeof e=="function",Be=(e,t,r)=>{let n=-1;const o=Lo(t)?[t]:ti(t),a=o.length,i=a-1;for(;++n<a;){const s=o[n];let l=r;if(n!==i){const d=e[s];l=Qe(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(ah.includes(s))return;e[s]=l,e=e[s]}};const cl=h.createContext(null);cl.displayName="HookFormControlContext";const dl=()=>h.useContext(cl);var ih=(e,t,r,n=!0)=>{const o={};for(const a in e)Object.defineProperty(o,a,{get:()=>{const i=a;return t._proxyFormState[i]!==Jt.all&&(t._proxyFormState[i]=!n||Jt.all),r&&(r[i]=!0),e[i]}});return o};const ul=ei?h.useLayoutEffect:h.useEffect;function p1(e){const t=dl(),{control:r=t,disabled:n,name:o,exact:a}=e||{},[i,s]=h.useState(()=>({...r._formState,defaultValues:r._defaultValues})),l=h.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ul(()=>r._subscribe({name:o,formState:l.current,exact:a,callback:d=>{!n&&s({...r._formState,...d,defaultValues:r._defaultValues})}}),[o,n,a]),h.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),h.useMemo(()=>ih(i,r,l.current,!1),[i,r])}var Ct=e=>typeof e=="string",fl=(e,t,r,n,o)=>Ct(e)?(n&&t.watch.add(e),W(r,e,o)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),W(r,a))):(n&&(t.watchAll=!0),r),hl=e=>ft(e)||!th(e);const sh=(e,t)=>t.length===0&&!Array.isArray(e)&&!nh(e);function $t(e,t,r=new WeakMap){if(e===t)return!0;if(hl(e)||hl(t))return Object.is(e,t);if(Jr(e)&&Jr(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(sh(e,n)||sh(t,o))return Object.is(e,t);const a=r.get(e);if(a&&a.has(t))return!0;a?a.add(t):r.set(e,new WeakSet([t]));for(const i of n){const s=e[i];if(!(i in t))return!1;if(i!=="ref"){const l=t[i];if(Jr(s)&&Jr(l)||(Qe(s)||Array.isArray(s))&&(Qe(l)||Array.isArray(l))?!$t(s,l,r):!Object.is(s,l))return!1}}return!0}function g1(e){const t=dl(),{control:r=t,name:n,defaultValue:o,disabled:a,exact:i,compute:s}=e||{},l=h.useRef(o),d=h.useRef(s),f=h.useRef(void 0),u=h.useRef(r),m=h.useRef(n);d.current=s;const[g,w]=h.useState(()=>{const S=r._getWatch(n,l.current);return d.current?d.current(S):S}),p=h.useCallback(S=>{const T=fl(n,r._names,S||r._formValues,!1,l.current);return d.current?d.current(T):T},[r._formValues,r._names,n]),y=h.useCallback(S=>{if(!a){const T=fl(n,r._names,S||r._formValues,!1,l.current);if(d.current){const I=d.current(T);$t(I,f.current)||(w(I),f.current=I)}else w(T)}},[r._formValues,r._names,a,n]);ul(()=>((u.current!==r||!$t(m.current,n))&&(u.current=r,m.current=n,y()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:S=>{y(S.values)}})),[r,i,n,y]),h.useEffect(()=>r._removeUnmounted());const v=u.current!==r,b=m.current,C=h.useMemo(()=>{if(a)return null;const S=!v&&!$t(b,n);return v||S?p():null},[a,v,n,b,p]);return C!==null?C:g}function ri(e){const t=dl(),{name:r,disabled:n,control:o=t,shouldUnregister:a,defaultValue:i,exact:s=!0}=e,l=rh(o._names.array,r),d=h.useMemo(()=>W(o._formValues,r,W(o._defaultValues,r,i)),[o,r,i]),f=g1({control:o,name:r,defaultValue:d,exact:s}),u=p1({control:o,name:r,exact:s}),m=h.useRef(e),g=h.useRef(null),w=h.useRef(o.register(r,{...e.rules,value:f,...Mt(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const p=h.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!W(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!W(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!W(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!W(u.validatingFields,r)},error:{enumerable:!0,get:()=>W(u.errors,r)}}),[u,r]),y=h.useCallback(S=>{const T=sl(S);return W(o._fields,r)||(w.current=o.register(r,{...m.current.rules,value:T})),w.current.onChange({target:{value:sl(S),name:r},type:xr.CHANGE})},[r,o]),v=h.useCallback(()=>w.current.onBlur({target:{value:W(o._formValues,r),name:r},type:xr.BLUR}),[r,o._formValues]),b=h.useCallback(S=>{S&&(g.current={focus:()=>wt(S.focus)&&S.focus(),select:()=>wt(S.select)&&S.select(),setCustomValidity:I=>wt(S.setCustomValidity)&&S.setCustomValidity(I),reportValidity:()=>wt(S.reportValidity)&&S.reportValidity()});const T=W(o._fields,r);T&&T._f&&S&&(T._f.ref=g.current)},[o._fields,r]),C=h.useMemo(()=>({name:r,value:f,...Mt(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:y,onBlur:v,ref:b}),[r,n,u.disabled,y,v,b,f]);return h.useEffect(()=>{const S=o._options.shouldUnregister||a;o.register(r,{...m.current.rules,...Mt(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(I,k)=>{const x=W(o._fields,I);x&&x._f&&(x._f.mount=k)};if(T(r,!0),S){const I=Ze(W(a?o._defaultValues:o._options.values||o._defaultValues,r,W(o._options.defaultValues,r,m.current.defaultValue)));Be(o._defaultValues,r,I),qe(W(o._formValues,r))&&Be(o._formValues,r,I)}if(!l&&o.register(r),g.current){const I=W(o._fields,r);I&&I._f&&(I._f.ref=g.current)}return()=>{(l?S&&!o._state.action:S)?o.unregister(r):T(r,!1)}},[r,o,l,a]),h.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),h.useMemo(()=>({field:C,formState:u,fieldState:p}),[C,u,p])}const pl=h.createContext(null);pl.displayName="HookFormContext";const tr=()=>h.useContext(pl),m1=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:a,setValue:i,setValues:s,trigger:l,formState:d,resetField:f,reset:u,handleSubmit:m,unregister:g,control:w,register:p,setFocus:y,subscribe:v})=>{const b=h.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:a,setValue:i,setValues:s,trigger:l,formState:d,resetField:f,reset:u,handleSubmit:m,unregister:g,control:w,register:p,setFocus:y,subscribe:v}),[a,w,d,n,r,m,p,u,f,o,y,i,s,v,l,g,t]);return h.createElement(pl.Provider,{value:b},h.createElement(cl.Provider,{value:b.control},e))};var y1=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},lh=e=>Array.isArray(e)?e.filter(Boolean):[],ni=e=>Array.isArray(e)?e:[e],ch=()=>{let e=[];return{get observers(){return e},next:o=>{for(const a of e)a.next&&a.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(a=>a!==o)}}),unsubscribe:()=>{e=[]}}};function dh(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],a=t[n];if(o&&Qe(o)&&a){const i=dh(o,a);Qe(i)&&(r[n]=i)}else e[n]&&(r[n]=a)}return r}var at=e=>Qe(e)&&!Object.keys(e).length,gl=e=>e.type==="file",oi=e=>{if(!ei)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},uh=e=>e.type==="select-multiple",ml=e=>e.type==="radio",v1=e=>ml(e)||xo(e),yl=e=>oi(e)&&e.isConnected;function b1(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(ft(e)){e=void 0;break}e=e[t[n]],n++}return e}function w1(e){for(const t in e)if(e.hasOwnProperty(t)&&!qe(e[t]))return!1;return!0}function tt(e,t){if(Ct(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Lo(t)?[t]:ti(t),n=r.length===1?e:b1(e,r),o=r.length-1,a=r[o];return n&&delete n[a],o!==0&&(Qe(n)&&at(n)||Array.isArray(n)&&w1(n))&&tt(e,r.slice(0,-1)),e}var C1=e=>{for(const t in e)if(wt(e[t]))return!0;return!1};function fh(e){return Array.isArray(e)||Qe(e)&&!C1(e)}function vl(e,t={}){for(const r in e){const n=e[r];fh(n)?(t[r]=Array.isArray(n)?[]:{},vl(n,t[r])):qe(n)||(t[r]=!0)}return t}function bl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>bl(r));return t.some(r=>r!==void 0)?t:void 0}if(Qe(e)){const t={};for(const r in e){const n=bl(e[r]);qe(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function en(e,t,r){r||(r=vl(t));for(const n in e){const o=e[n];if(fh(o))qe(t)||hl(r[n])?r[n]=vl(o,Array.isArray(o)?[]:{}):en(o,ft(t)?{}:t[n],r[n]);else{const a=t[n];r[n]=!$t(o,a)}}return bl(r)||{}}const hh={value:!1,isValid:!1},ph={value:!0,isValid:!0};var gh=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!qe(e[0].attributes.value)?qe(e[0].value)||e[0].value===""?ph:{value:e[0].value,isValid:!0}:ph:hh}return hh},mh=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>qe(e)?e:t?e===""?NaN:e&&+e:r&&Ct(e)?new Date(e):n?n(e):e;const yh={isValid:!1,value:null};var vh=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,yh):yh;function bh(e){const t=e.ref;return gl(t)?t.files:ml(t)?vh(e.refs).value:uh(t)?[...t.selectedOptions].map(({value:r})=>r):xo(t)?gh(e.refs).value:mh(qe(t.value)?e.ref.value:t.value,e)}var S1=(e,t,r,n)=>{const o={};for(const a of e){const i=W(t,a);i&&Be(o,a,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},ai=e=>e instanceof RegExp,Po=e=>qe(e)?e:ai(e)?e.source:Qe(e)?ai(e.value)?e.value.source:e.value:e,wh=e=>({isOnSubmit:!e||e===Jt.onSubmit,isOnBlur:e===Jt.onBlur,isOnChange:e===Jt.onChange,isOnAll:e===Jt.all,isOnTouch:e===Jt.onTouched});const Ch="AsyncFunction";var _1=e=>!!e&&!!e.validate&&!!(wt(e.validate)&&e.validate.constructor.name===Ch||Qe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Ch)),T1=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),wl=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Fo=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const a=W(e,o);if(a){const{_f:i,...s}=a;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Fo(s,t))break}else if(Qe(s)&&Fo(s,t))break}}};function Sh(e,t,r){const n=W(e,r);if(n||Lo(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),i=W(t,a),s=W(e,a);if(i&&!Array.isArray(i)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};o.pop()}return{name:r}}var E1=(e,t,r,n)=>{r(e);const{name:o,...a}=e;return at(a)||n&&Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(i=>t[i]===(!n||Jt.all))},I1=(e,t,r)=>!e||!t||e===t||ni(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),O1=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,A1=(e,t)=>!lh(W(e,t)).length&&tt(e,t),_h=(e,t,r)=>{const n=W(e,r),o=Array.isArray(n)?n:[];return Be(o,oh,t[r]),Be(e,r,o),e};function Th(e,t,r="validate"){if(Ct(e)||Array.isArray(e)&&e.every(Ct)||Mt(e)&&!e)return{type:r,message:Ct(e)?e:"",ref:t}}var Bn=e=>Qe(e)&&!ai(e)?e:{value:e,message:""},Eh=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:d,minLength:f,min:u,max:m,pattern:g,validate:w,name:p,valueAsNumber:y,mount:v}=e._f,b=W(r,p);if(!v||t.has(p))return{};const C=s?s[0]:i,S=L=>{if(o&&C.reportValidity){const B=Mt(L)?"":L||"";s?s.forEach(P=>P.setCustomValidity(B)):C.setCustomValidity(B),C.reportValidity()}},T={},I=ml(i),k=xo(i),x=I||k,$=(y||gl(i))&&qe(i.value)&&qe(b)||oi(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,j=y1.bind(null,p,n,T),N=(L,B,P,F=er.maxLength,V=er.minLength)=>{const X=L?B:P;T[p]={type:L?F:V,message:X,ref:i,...j(L?F:V,X)}};if(a?!Array.isArray(b)||!b.length:l&&(!x&&($||ft(b))||Mt(b)&&!b||k&&!gh(s).isValid||I&&!vh(s).isValid)){const{value:L,message:B}=Ct(l)?{value:!!l,message:l}:Bn(l);if(L&&(T[p]={type:er.required,message:B,ref:C,...j(er.required,B)},!n))return S(B),T}if(!$&&(!ft(u)||!ft(m))){let L,B;const P=Bn(m),F=Bn(u);if(!ft(b)&&!isNaN(b)){const V=i.valueAsNumber||b&&+b;ft(P.value)||(L=V>P.value),ft(F.value)||(B=V<F.value)}else{const V=i.valueAsDate||new Date(b),X=Ce=>new Date(new Date().toDateString()+" "+Ce),ve=i.type=="time",Ee=i.type=="week";Ct(P.value)&&b&&(L=ve?X(b)>X(P.value):Ee?b>P.value:V>new Date(P.value)),Ct(F.value)&&b&&(B=ve?X(b)<X(F.value):Ee?b<F.value:V<new Date(F.value))}if((L||B)&&(N(!!L,P.message,F.message,er.max,er.min),!n))return S(T[p].message),T}if((d||f)&&!$&&(Ct(b)||a&&Array.isArray(b))){const L=Bn(d),B=Bn(f),P=!ft(L.value)&&b.length>+L.value,F=!ft(B.value)&&b.length<+B.value;if((P||F)&&(N(P,L.message,B.message),!n))return S(T[p].message),T}if(g&&!$&&Ct(b)){const{value:L,message:B}=Bn(g);if(ai(L)&&!b.match(L)&&(T[p]={type:er.pattern,message:B,ref:i,...j(er.pattern,B)},!n))return S(B),T}if(w){if(wt(w)){const L=await w(b,r),B=Th(L,C);if(B&&(T[p]={...B,...j(er.validate,B.message)},!n))return S(B.message),T}else if(Qe(w)){let L={};for(const B in w){if(!at(L)&&!n)break;const P=Th(await w[B](b,r),C,B);P&&(L={...P,...j(B,P.message)},S(P.message),n&&(T[p]=L))}if(!at(L)&&(T[p]={ref:C,...L},!n))return T}}return S(!0),T};const D1={mode:Jt.onSubmit,reValidateMode:Jt.onChange,shouldFocusError:!0},Ih={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function N1(e={}){let t={...D1,...e},r={...Ze(Ih),isLoading:wt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=Qe(t.defaultValues)||Qe(t.values)?Ze(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ze(o),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,d=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...f};let m={...u};const g={array:ch(),state:ch()},w=t.criteriaMode===Jt.all,p=_=>A=>{clearTimeout(d),d=setTimeout(_,A)},y=async _=>{if(!i.keepIsValid&&!t.disabled&&(u.isValid||m.isValid||_)){let A;t.resolver?(A=at((await j()).errors),v()):A=await B({fields:n,onlyCheckValid:!0,eventType:xr.VALID}),A!==r.isValid&&g.state.next({isValid:A})}},v=(_,A)=>{!t.disabled&&(u.isValidating||u.validatingFields||m.isValidating||m.validatingFields)&&((_||Array.from(s.mount)).forEach(D=>{D&&(A?Be(r.validatingFields,D,A):tt(r.validatingFields,D))}),g.state.next({validatingFields:r.validatingFields,isValidating:!at(r.validatingFields)}))},b=()=>{r.dirtyFields=en(o,a)},C=(_,A=[],D,z,q=!0,G=!0)=>{if(z&&D&&!t.disabled){if(i.action=!0,G&&Array.isArray(W(n,_))){const R=D(W(n,_),z.argA,z.argB);q&&Be(n,_,R)}if(G&&Array.isArray(W(r.errors,_))){const R=D(W(r.errors,_),z.argA,z.argB);q&&Be(r.errors,_,R),A1(r.errors,_)}if((u.touchedFields||m.touchedFields)&&G&&Array.isArray(W(r.touchedFields,_))){const R=D(W(r.touchedFields,_),z.argA,z.argB);q&&Be(r.touchedFields,_,R)}(u.dirtyFields||m.dirtyFields)&&b(),g.state.next({name:_,isDirty:F(_,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Be(a,_,A)},S=(_,A)=>{Be(r.errors,_,A),r.errors={...r.errors},g.state.next({errors:r.errors})},T=_=>{r.errors=_,g.state.next({errors:r.errors,isValid:!1})},I=_=>{const A=Lo(_)?[_]:ti(_);let D=a,z=o;for(let q=0;q<A.length-1;q++){const G=A[q];if(D=ft(D)?D:D[G],z=ft(z)?z:z[G],D===null&&z!==null)return!0}return!1},k=(_,A,D,z)=>{const q=W(n,_);if(q){if(I(_))return;const G=qe(W(a,_)),R=W(a,_,qe(D)?W(o,_):D);qe(R)||z&&z.defaultChecked||A?Be(a,_,A?R:bh(q._f)):ve(_,R),i.mount&&!i.action&&(y(),G&&r.isDirty&&(u.isDirty||m.isDirty)&&(F()||(r.isDirty=!1,g.state.next({...r}))),e.shouldUnregister&&G&&!qe(W(a,_))&&wl(_,s)&&(i.watch=!0))}},x=(_,A,D,z,q)=>{let G=!1,R=!1;const ee={name:_};if(!t.disabled){if(!D||z){(u.isDirty||m.isDirty)&&(R=r.isDirty,r.isDirty=ee.isDirty=F(),G=R!==ee.isDirty);const ye=$t(W(o,_),A);R=!!W(r.dirtyFields,_),ye!==r.isDirty?r.dirtyFields=en(o,a):ye?tt(r.dirtyFields,_):Be(r.dirtyFields,_,!0),ee.dirtyFields=r.dirtyFields,G=G||(u.dirtyFields||m.dirtyFields)&&R!==!ye}if(D){const ye=W(r.touchedFields,_);ye||(Be(r.touchedFields,_,D),ee.touchedFields=r.touchedFields,G=G||(u.touchedFields||m.touchedFields)&&ye!==D)}G&&q&&g.state.next(ee)}return G?ee:{}},$=(_,A,D,z)=>{const q=W(r.errors,_),G=(u.isValid||m.isValid)&&Mt(A)&&r.isValid!==A;if(t.delayError&&D?(l=p(()=>S(_,D)),l(t.delayError)):(clearTimeout(d),l=null,D?Be(r.errors,_,D):tt(r.errors,_),r.errors={...r.errors}),(D?!$t(q,D):q)||!at(z)||G){const R={...z,...G&&Mt(A)?{isValid:A}:{},errors:r.errors,name:_};r={...r,...R},g.state.next(R)}},j=async _=>(v(_,!0),await t.resolver(a,t.context,S1(_||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),N=async _=>{const{errors:A}=await j(_);if(v(_),_){for(const D of _){const z=W(A,D);z?s.array.has(D)&&Qe(z)&&!Object.keys(z).some(q=>!Number.isNaN(Number(q)))?_h(r.errors,{[D]:z},D):Be(r.errors,D,z):tt(r.errors,D)}r.errors={...r.errors}}else r.errors=A;return A},L=async({name:_,eventType:A})=>{if(e.validate){const D=await e.validate({formValues:a,formState:r,name:_,eventType:A});if(Qe(D))for(const z in D){const q=D[z];q&&J(`${ll}.${z}`,{message:Ct(q.message)?q.message:"",type:q.type||er.validate})}else Ct(D)||!D?J(ll,{message:D||"",type:er.validate}):fe(ll);return D}return!0},B=async({fields:_,onlyCheckValid:A,name:D,eventType:z,context:q={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(q.runRootValidation=!0,!await L({name:D,eventType:z})&&(q.valid=!1,A)))return q.valid;for(const G in _){const R=_[G];if(R){const{_f:ee,...ye}=R;if(ee){const Ye=s.array.has(ee.name),Lt=R._f&&_1(R._f),Pt=u.validatingFields||u.isValidating||m.validatingFields||m.isValidating;Lt&&Pt&&v([ee.name],!0);const Cr=await Eh(R,s.disabled,a,w,t.shouldUseNativeValidation&&!A,Ye);if(Lt&&Pt&&v([ee.name]),Cr[ee.name]&&(q.valid=!1,A)||(!A&&(W(Cr,ee.name)?Ye?_h(r.errors,Cr,ee.name):Be(r.errors,ee.name,Cr[ee.name]):tt(r.errors,ee.name)),e.shouldUseNativeValidation&&Cr[ee.name]))break}!at(ye)&&await B({context:q,onlyCheckValid:A,fields:ye,name:G,eventType:z})}}return q.valid},P=()=>{for(const _ of s.unMount){const A=W(n,_);A&&(A._f.refs?A._f.refs.every(D=>!yl(D)):!yl(A._f.ref))&&ze(_)}s.unMount=new Set},F=(_,A)=>!t.disabled&&(_&&A&&Be(a,_,A),!$t(H(),o)),V=(_,A,D)=>fl(_,s,{...i.mount?a:qe(A)?o:Ct(_)?{[_]:A}:A},D,A),X=_=>lh(W(i.mount?a:o,_,t.shouldUnregister?W(o,_,[]):[])),ve=(_,A,D={},z=!1)=>{const q=W(n,_);let G=A;if(q){const R=q._f;R&&(!R.disabled&&Be(a,_,mh(A,R)),G=oi(R.ref)&&ft(A)?"":A,uh(R.ref)?[...R.ref.options].forEach(ee=>ee.selected=G.includes(ee.value)):R.refs?xo(R.ref)?R.refs.forEach(ee=>{(!ee.defaultChecked||!ee.disabled)&&(Array.isArray(G)?ee.checked=!!G.find(ye=>ye===ee.value):ee.checked=G===ee.value||!!G)}):R.refs.forEach(ee=>ee.checked=ee.value===G):gl(R.ref)?R.ref.value="":(R.ref.value=G,R.ref.type||g.state.next({name:_,values:z?a:Ze(a)})))}(D.shouldDirty||D.shouldTouch)&&x(_,G,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&U(_)},Ee=(_,A,D,z=!1)=>{for(const q in A){if(!A.hasOwnProperty(q))return;const G=A[q],R=_+"."+q,ee=W(n,R);(s.array.has(_)||Qe(G)||ee&&!ee._f)&&!Jr(G)?Ee(R,G,D,z):ve(R,G,D,z)}},Ce=(_,A,D,z)=>{const q=W(n,_),G=s.array.has(_),R=z?A:Ze(A),ee=W(a,_),ye=$t(ee,R);if(ye||Be(a,_,R),G)g.array.next({name:_,values:z?a:Ze(a)}),(u.isDirty||u.dirtyFields||m.isDirty||m.dirtyFields)&&D.shouldDirty&&(b(),g.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:F(_,R)}));else{const Ye=Array.isArray(R)&&!R.length||at(R);!q||q._f||ft(R)||Ye?ve(_,R,D,z):Ee(_,R,D,z)}if(!ye){const Ye=wl(_,s),Lt=z?a:Ze(a);g.state.next({...Ye&&r,name:i.mount||Ye?_:void 0,values:Lt})}},ue=(_,A,D={})=>Ce(_,A,D,!1),Q=(_,A={})=>{const D=wt(_)?_(a):_;if(!$t(a,D)){a={...a,...D};for(const z of s.mount)Ce(z,W(D,z),A,!0);g.state.next({...r,name:void 0,type:void 0,values:a}),A.shouldValidate&&y()}},ne=async _=>{i.mount=!0;const A=_.target;let D=A.name,z=!0;const q=W(n,D),G=ye=>{z=Number.isNaN(ye)||Jr(ye)&&isNaN(ye.getTime())||$t(ye,W(a,D,ye))},R=wh(t.mode),ee=wh(t.reValidateMode);if(q){let ye,Ye;const Lt=A.type?bh(q._f):sl(_),Pt=_.type===xr.BLUR||_.type===xr.FOCUS_OUT,Cr=!T1(q._f)&&!e.validate&&!t.resolver&&!W(r.errors,D)&&!q._f.deps||O1(Pt,W(r.touchedFields,D),r.isSubmitted,ee,R),Qo=wl(D,s,Pt);Be(a,D,Lt),Pt?(!A||!A.readOnly)&&(q._f.onBlur&&q._f.onBlur(_),l&&l(0)):q._f.onChange&&q._f.onChange(_);const pn=x(D,Lt,Pt),ct=!at(pn)||Qo;if(!Pt&&g.state.next({name:D,type:_.type,values:Ze(a)}),Cr)return(u.isValid||m.isValid)&&(t.mode==="onBlur"?Pt&&y():Pt||y()),ct&&g.state.next({name:D,...Qo?{}:pn});if(!t.resolver&&e.validate&&await L({name:D,eventType:_.type}),!Pt&&Qo&&g.state.next({...r}),t.resolver){const{errors:_t}=await j([D]);if(v([D]),G(Lt),!z){!at(pn)&&g.state.next(pn);return}const Ot=Sh(r.errors,n,D),or=Sh(_t,n,Ot.name||D);ye=or.error,D=or.name,Ye=at(_t)}else v([D],!0),ye=(await Eh(q,s.disabled,a,w,t.shouldUseNativeValidation))[D],v([D]),G(Lt),z&&(ye?Ye=!1:(u.isValid||m.isValid)&&(Ye=await B({fields:n,onlyCheckValid:!0,name:D,eventType:_.type})));z&&(q._f.deps&&(!Array.isArray(q._f.deps)||q._f.deps.length>0)&&U(q._f.deps),$(D,Ye,ye,pn))}},te=(_,A)=>{if(W(r.errors,A)&&_.focus)return _.focus(),1},U=async(_,A={})=>{let D,z;const q=ni(_);if(t.resolver){const G=await N(qe(_)?_:q);D=at(G),z=_?!q.some(R=>W(G,R)):D}else _?(z=(await Promise.all(q.map(async G=>{const R=W(n,G);return await B({fields:R&&R._f?{[G]:R}:R,eventType:xr.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&y()):z=D=await B({fields:n,name:_,eventType:xr.TRIGGER});return g.state.next({...!Ct(_)||(u.isValid||m.isValid)&&D!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:D}:{},errors:r.errors}),A.shouldFocus&&!z&&Fo(n,te,_?q:s.mount),z},H=(_,A)=>{let D={...i.mount?a:o};return A&&(D=dh(A.dirtyFields?r.dirtyFields:r.touchedFields,D)),qe(_)?D:Ct(_)?W(D,_):_.map(z=>W(D,z))},ae=(_,A)=>({invalid:!!W((A||r).errors,_),isDirty:!!W((A||r).dirtyFields,_),error:W((A||r).errors,_),isValidating:!!W(r.validatingFields,_),isTouched:!!W((A||r).touchedFields,_)}),fe=_=>{const A=_?ni(_):void 0;A==null||A.forEach(D=>tt(r.errors,D)),A?A.forEach(D=>{g.state.next({name:D,errors:r.errors})}):g.state.next({errors:{}})},J=(_,A,D)=>{const z=(W(n,_,{_f:{}})._f||{}).ref,q=W(r.errors,_)||{},{ref:G,message:R,type:ee,...ye}=q;Be(r.errors,_,{...ye,...A,ref:z}),g.state.next({name:_,errors:r.errors,isValid:!1}),D&&D.shouldFocus&&z&&z.focus&&z.focus()},oe=(_,A)=>wt(_)?g.state.subscribe({next:D=>"values"in D&&_(D.values||V(void 0,A),D)}):V(_,A,!0),Me=_=>g.state.subscribe({next:A=>{if(I1(_.name,A.name,_.exact)&&E1(A,_.formState||u,K,_.reRenderRoot)){const D={...a};_.callback({values:D,...r,...A,defaultValues:o})}}}).unsubscribe,Oe=_=>(i.mount=!0,m={...m,..._.formState},Me({..._,formState:{...f,..._.formState}})),ze=(_,A={})=>{for(const D of _?ni(_):s.mount)s.mount.delete(D),s.array.delete(D),A.keepValue||(tt(n,D),tt(a,D)),!A.keepError&&tt(r.errors,D),!A.keepDirty&&tt(r.dirtyFields,D),!A.keepTouched&&tt(r.touchedFields,D),!A.keepIsValidating&&tt(r.validatingFields,D),!t.shouldUnregister&&!A.keepDefaultValue&&tt(o,D);g.state.next({values:Ze(a)}),g.state.next({...r,...A.keepDirty?{isDirty:F()}:{}}),!A.keepIsValid&&y()},We=({disabled:_,name:A})=>{if(Mt(_)&&i.mount||_||s.disabled.has(A)){const q=s.disabled.has(A)!==!!_;_?s.disabled.add(A):s.disabled.delete(A),q&&i.mount&&!i.action&&y()}},Ve=(_,A={})=>{let D=W(n,_);const z=Mt(A.disabled)||Mt(t.disabled),q=!s.registerName.has(_)&&D&&D._f&&!D._f.mount;return Be(n,_,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:_}},name:_,mount:!0,...A}}),s.mount.add(_),D&&!q?We({disabled:Mt(A.disabled)?A.disabled:t.disabled,name:_}):k(_,!0,A.value),{...z?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:Po(A.min),max:Po(A.max),minLength:Po(A.minLength),maxLength:Po(A.maxLength),pattern:Po(A.pattern)}:{},name:_,onChange:ne,onBlur:ne,ref:G=>{if(G){s.registerName.add(_),Ve(_,A),s.registerName.delete(_),D=W(n,_);const R=qe(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,ee=v1(R),ye=D._f.refs||[];if(ee?ye.find(Ye=>Ye===R):R===D._f.ref)return;Be(n,_,{_f:{...D._f,...ee?{refs:[...ye.filter(yl),R,...Array.isArray(W(o,_))?[{}]:[]],ref:{type:R.type,name:_}}:{ref:R}}}),k(_,!1,void 0,R)}else D=W(n,_,{}),D._f&&(D._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(rh(s.array,_)&&i.action)&&s.unMount.add(_)}}},re=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Fo(n,te,s.mount),Ke=_=>{Mt(_)&&(g.state.next({disabled:_}),Fo(n,(A,D)=>{const z=W(n,D);z&&(A.disabled=z._f.disabled||_,Array.isArray(z._f.refs)&&z._f.refs.forEach(q=>{q.disabled=z._f.disabled||_}))},0,!1))},Re=(_,A)=>async D=>{let z;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let q=Ze(a);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:R}=await j();v(),r.errors=G,q=Ze(R)}else await B({fields:n,eventType:xr.SUBMIT});if(s.disabled.size)for(const G of s.disabled)tt(q,G);if(tt(r.errors,oh),at(r.errors)){g.state.next({errors:{}});try{await _(q,D)}catch(G){z=G}}else A&&await A({...r.errors},D),re(),setTimeout(re);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:at(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},He=(_,A={})=>{W(n,_)&&(qe(A.defaultValue)?ue(_,Ze(W(o,_))):(ue(_,A.defaultValue),Be(o,_,Ze(A.defaultValue))),A.keepTouched||tt(r.touchedFields,_),A.keepDirty||(tt(r.dirtyFields,_),r.isDirty=A.defaultValue?F(_,Ze(W(o,_))):F()),A.keepError||(tt(r.errors,_),u.isValid&&y()),g.state.next({...r}))},et=(_,A={})=>{const D=_?Ze(_):o,z=Ze(D),q=at(_),G=z;if(A.keepDefaultValues||(o=D),!A.keepValues){if(A.keepDirtyValues){const R=new Set([...s.mount,...Object.keys(en(o,a))]);for(const ee of Array.from(R)){const ye=W(r.dirtyFields,ee),Ye=W(a,ee),Lt=W(G,ee);ye&&!qe(Ye)?Be(G,ee,Ye):!ye&&!qe(Lt)&&ue(ee,Lt)}}else{if(ei&&qe(_))for(const R of s.mount){const ee=W(n,R);if(ee&&ee._f){const ye=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(oi(ye)){const Ye=ye.closest("form");if(Ye){Ye.reset();break}}}}if(A.keepFieldsRef)for(const R of s.mount)ue(R,W(G,R));else n={}}if(t.shouldUnregister){if(a=A.keepDefaultValues?Ze(o):{},A.keepFieldsRef)for(const R of s.mount)Be(a,R,W(G,R))}else a=Ze(G);g.array.next({values:{...G}}),g.state.next({values:{...G}})}s={mount:A.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!u.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!at(G),i.watch=!!t.shouldUnregister,i.keepIsValid=!!A.keepIsValid,i.action=!1,A.keepErrors||(r.errors={}),g.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:q?!1:A.keepDirty?r.isDirty:A.keepValues?F():!!(A.keepDefaultValues&&!$t(_,o)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:q?{}:A.keepDirtyValues?A.keepDefaultValues&&a?en(o,a):r.dirtyFields:A.keepDefaultValues&&_?en(o,_):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Gt=(_,A)=>et(wt(_)?_(a):_,{...t.resetOptions,...A}),It=(_,A={})=>{const D=W(n,_),z=D&&D._f;if(z){const q=z.refs?z.refs[0]:z.ref;q.focus&&setTimeout(()=>{q.focus(),A.shouldSelect&&wt(q.select)&&q.select()})}},K=_=>{r={...r,..._}},Wt={control:{register:Ve,unregister:ze,getFieldState:ae,handleSubmit:Re,setError:J,_subscribe:Me,_runSchema:j,_updateIsValidating:v,_focusError:re,_getWatch:V,_getDirty:F,_setValid:y,_setFieldArray:C,_setDisabledField:We,_setErrors:T,_getFieldArray:X,_reset:et,_resetDefaultValues:()=>wt(t.defaultValues)&&t.defaultValues().then(_=>{Gt(_,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:Ke,_subjects:g,_proxyFormState:u,get _fields(){return n},get _formValues(){return a},get _state(){return i},set _state(_){i=_},get _defaultValues(){return o},get _names(){return s},set _names(_){s=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:Oe,trigger:U,register:Ve,handleSubmit:Re,watch:oe,setValue:ue,setValues:Q,getValues:H,reset:Gt,resetField:He,resetDefaultValues:(_,A={})=>{if(o=Ze(_),!A.keepDirty){const D=en(o,a);r.dirtyFields=D,r.isDirty=!at(D)}A.keepIsValid||y(),g.state.next({...r,defaultValues:o})},clearErrors:fe,unregister:ze,setError:J,setFocus:It,getFieldState:ae};return{...Wt,formControl:Wt}}function k1(e={}){const t=h.useRef(void 0),r=h.useRef(void 0),n=h.useRef(e.formControl),[o,a]=h.useState(()=>({...Ze(Ih),isLoading:wt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:wt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!wt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=N1(e);t.current={...l,formState:o}}const i=t.current.control;return i._options=e,ul(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return a(l=>({...l,isReady:!0})),i._formState.isReady=!0,s},[i]),h.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),h.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),h.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),h.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),h.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==o.isDirty&&i._subjects.state.next({isDirty:s})}},[i,o.isDirty]),h.useEffect(()=>{var s;e.values&&!$t(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),r.current=e.values,a(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),h.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=h.useMemo(()=>ih(o,i),[i,o]),t.current}async function Oh(e){var r,n;return(n=(r=(await ke.get(`/api/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function x1(e){var r,n;return((n=(r=(await ke.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function Ah(e,t){const r=gn({queryKey:["framework",e],queryFn:()=>Oh(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],o=gn({queryKey:["framework",n],queryFn:()=>Oh(n),enabled:!!n,staleTime:5*60*1e3}),a=o.data?[o.data]:[];return{organisationFramework:r.data,targetFrameworks:a,isLoading:r.isLoading||o.isLoading}}function L1(e,t,r){const n=e??[],o=new Set(n.map(f=>f.type).filter(Boolean)),a=(t??[]).filter(f=>!o.has(f)),{data:i}=gn({queryKey:["framework-search",a.sort().join(","),r],queryFn:()=>x1({type:a,systemDefault:"Yes"}),enabled:a.length>0,staleTime:10*60*1e3}),s=t&&t.length?n.filter(f=>f.type&&t.includes(f.type)):n,l=[...(i??[]).map(f=>({label:f.name,value:f.identifier})),...s.map(f=>({label:f.name,value:f.identifier}))],d=new Set;return l.filter(f=>d.has(f.value)?!1:(d.add(f.value),!0))}async function P1(e){var r,n;return(n=(r=(await ke.get(`/api/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function F1(e){var r,n,o,a,i,s;const t=gn({queryKey:["channel",e],queryFn:()=>P1(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(o=t.data)==null?void 0:o.frameworks,collectionAdditionalCategories:(a=t.data)==null?void 0:a.collectionAdditionalCategories,contentAdditionalCategories:(i=t.data)==null?void 0:i.contentAdditionalCategories,defaultLicense:(s=t.data)==null?void 0:s.defaultLicense,isLoading:t.isLoading}}function M1(e){const{data:t}=gn({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>_w(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const $1={"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."}},B1=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"},j1={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},q1={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"},Cl={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},Dh=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function Nh(e,t,r,n,o={}){if(!(e!=null&&e.length))return eE(t,n,r);const a=new Map;for(const s of e){const l=s.code;l&&!a.has(l)&&a.set(l,s)}const i=new Set;return e.filter(s=>{if(n&&(s.code==="dialCode"||s.code==="dialcode")||s.visible===!1)return!1;const l=s.code;return i.has(l)?!1:(i.add(l),!0)}).map(s=>{const l=s.code??"",d=G1(s),f=W1(s,r,t,a,o),u=t[l],m=z1(l,kh(u,d),d,t,o),g={code:l,label:s.label??l,inputType:d,required:!!(s.required===!0||Array.isArray(s.validations)&&s.validations.some(w=>w.type==="required")),editable:U1(l,s.editable!==!1,o),placeholder:s.placeholder,maxLength:s.maxLength,options:R1(f,m,d,r),depends:s.depends,tab:Q1(s),section:s.section,defaultValue:s.defaultValue??s.default,currentValue:m};if(l==="dialcodes"){const w=t.dialcodeRequired==="Yes";return{...g,required:w,visible:w}}return g})}function U1(e,t,r){var a;const n=r.editorMode??"edit";if(!B1.has(n))return t!==!1;const o=(a=r.editableFields)==null?void 0:a[n];return!!(o&&o.includes(e))}function z1(e,t,r,n,o){const a=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return a?o.defaultLicense??"":t;case"copyright":return a&&o.channelName?o.channelName:t;case"copyrightYear":return a?String(new Date().getFullYear()):t;case"author":case"creator":return a&&o.userFullName?o.userFullName:t;case"instructions":{const i=n.instructions;return i&&typeof i=="object"&&!Array.isArray(i)?i.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!a)return t;const i=n.timeLimits,s=i==null?void 0:i[e];return s!=null&&s!==""?V1(Number(s)):t}default:return t}}function V1(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),o=a=>String(a).padStart(2,"0");return n>0?`${o(n)}:${o(r)}:${o(t)}`:`${o(r)}:${o(t)}`}function H1(e){var n,o,a;const t=new Map,r=i=>i==null?void 0:i.forEach(s=>{s.identifier&&t.set(s.identifier,s.name),s.name&&t.set(s.name,s.name)});return(o=(n=e.organisationFramework)==null?void 0:n.categories)==null||o.forEach(i=>r(i.terms)),(a=e.targetFrameworks)==null||a.forEach(i=>{var s;return(s=i.categories)==null?void 0:s.forEach(l=>r(l.terms))}),t}function R1(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const o=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!o.length)return e;const a=e?[...e]:[],i=new Set(a.map(l=>l.value)),s=H1(n);for(const l of o){const d=String(l);i.has(d)||(a.push({label:s.get(d)??d,value:d}),i.add(d))}return a}function Q1(e){const t=e.section;if(t){if(ii[t])return ii[t];const n=j1[t];if(n&&ii[n])return ii[n]}const r=e.code??"";return q1[r]??"details"}function kh(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function G1(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 W1(e,t,r,n,o){const a=e.code??"";if(a==="maxQuestions"){const d=o.childCount??0;if(d>0)return Array.from({length:d},(f,u)=>({label:String(u+1),value:String(u+1)}))}const i=e.range;if(Array.isArray(i)&&i.length)return typeof i[0]=="string"?i.map(d=>({label:d,value:d})):i.map(d=>({label:d.name,value:d.identifier}));const s=e.enum;if(s!=null&&s.length)return s.map(d=>({label:d,value:d}));if(a==="framework")return t.orgFrameworks;if(a==="additionalCategories"){const f=(o.objectType??"")==="QuestionSet"?o.contentAdditionalCategories??o.collectionAdditionalCategories:o.collectionAdditionalCategories??o.contentAdditionalCategories,u=(f&&f.length?f:o.contextAdditionalCategories)??t.channelAdditionalCategories;return u!=null&&u.length?X1(u).map(m=>({label:m,value:m})):void 0}const l=e.sourceCategory??Cl[a];if(l)return xh(a,l,e,t,r,n)}function K1(e,t){return Dh.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function Y1(e,t){return Dh.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function Sl(e,t,r){var a,i,s,l,d;const n=(i=(a=e.organisationFramework)==null?void 0:a.categories)==null?void 0:i.find(f=>f.code===t),o=(d=(l=(s=e.targetFrameworks)==null?void 0:s[0])==null?void 0:l.categories)==null?void 0:d.find(f=>f.code===t);return r?(o==null?void 0:o.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(o==null?void 0:o.terms)??[]}function Z1(e){const t=new Set,r=[];for(const n of e){const o=n.identifier??n.name;o&&!t.has(o)&&(t.add(o),r.push(n))}return r}function X1(e){return Array.from(new Set(e))}function J1(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function xh(e,t,r,n,o,a){const i=K1(e,r),s=Y1(e,r),l=p=>({label:p.name,value:i?p.identifier:p.name}),d=r.depends;if(!(d!=null&&d.length))return Sl(n,t,s).map(l);const f=d.flatMap(p=>J1(o[p])).map(String);if(!f.length)return[];const u=[];for(const p of d){const y=a.get(p),v=(y==null?void 0:y.sourceCategory)??Cl[p]??p;u.push(...Sl(n,v,s))}const g=u.filter(p=>f.includes(String(p.name))||f.includes(String(p.identifier))||f.includes(String(p.code))).flatMap(p=>p.associations??[]).filter(p=>String(p.category??"").toLowerCase()===t.toLowerCase()),w=Z1(g);return w.length?w.map(l):Sl(n,t,s).map(l)}function Mo(e,t){const r=Cl[e];if(r)return xh(e,r,{},t,{},new Map)}function ht(e,t,r){return kh(e[t],r)}function eE(e,t,r){var o;const n=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:ht(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:ht(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:ht(e,"keywords","chips")}];return t&&(n.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:ht(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:ht(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:ht(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Mo("subjectIds",r),currentValue:ht(e,"subjectIds","multiselect")}),n.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:ht(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Mo("targetBoardIds",r),currentValue:ht(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:Mo("targetMediumIds",r),currentValue:ht(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:Mo("targetGradeLevelIds",r),currentValue:ht(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:Mo("targetSubjectIds",r),currentValue:ht(e,"targetSubjectIds","multiselect")}),n.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:ht(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:ht(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:ht(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:ht(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:ht(e,"license","select")})),n}const tE=["allowECM","levels","setPeriod","instances"];function Lh(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function rE(e,t={}){const r={...e};for(const a of tE)delete r[a];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Lh(n)});const o=e.instances;return o!=null&&o!==""&&(r.instances={label:o}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function nE(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?Lh(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function oE(e,t){const{watch:r,setValue:n}=e,o=h.useRef(!1);h.useEffect(()=>{const a=r((i,{name:s})=>{var l;if(!(!s||o.current)){o.current=!0;try{const d=new Set([s]);let f=!0;for(;f;){f=!1;for(const u of t)d.has(u.code)||(l=u.depends)!=null&&l.some(m=>d.has(m))&&(n(u.code,u.inputType==="multiselect"||u.inputType==="chips"?[]:"",{shouldDirty:!0}),d.add(u.code),f=!0)}}finally{o.current=!1}}});return()=>a.unsubscribe()},[r,n,t])}const jn={section:"_section_ylgu8_1",header:"_header_ylgu8_11",title:"_title_ylgu8_17",description:"_description_ylgu8_24",divider:"_divider_ylgu8_30",fields:"_fields_ylgu8_36"},aE=({title:e,description:t,children:r})=>c.jsxs("div",{className:jn.section,children:[c.jsxs("div",{className:jn.header,children:[c.jsx("h3",{className:jn.title,children:e}),t&&c.jsx("p",{className:jn.description,children:t})]}),c.jsx("hr",{className:jn.divider}),c.jsx("div",{className:jn.fields,children:r})]}),M={field:"_field_1s288_1",fullWidth:"_fullWidth_1s288_7",label:"_label_1s288_11",required:"_required_1s288_19",input:"_input_1s288_24",textarea:"_textarea_1s288_45",inputError:"_inputError_1s288_50",error:"_error_1s288_54",selectBtn:"_selectBtn_1s288_59",selectOpen:"_selectOpen_1s288_83",placeholder:"_placeholder_1s288_87",selectedVal:"_selectedVal_1s288_91",chevronUp:"_chevronUp_1s288_95",dropdown:"_dropdown_1s288_100",option:"_option_1s288_116",optionSelected:"_optionSelected_1s288_134",noOpts:"_noOpts_1s288_139",chipGroup:"_chipGroup_1s288_146",chipInput:"_chipInput_1s288_158",addChipBtn:"_addChipBtn_1s288_167",radioGroup:"_radioGroup_1s288_184",radioLabel:"_radioLabel_1s288_191",iconWrap:"_iconWrap_1s288_199",iconPreview:"_iconPreview_1s288_214",iconPlaceholder:"_iconPlaceholder_1s288_220",removeIconBtn:"_removeIconBtn_1s288_233",tagChip:"_tagChip_1s288_252",tagChipRemove:"_tagChipRemove_1s288_264",nestedSelectRow:"_nestedSelectRow_1s288_278",dialcodeRow:"_dialcodeRow_1s288_287",validateBtn:"_validateBtn_1s288_293",dialcodeValid:"_dialcodeValid_1s288_315",dialcodeSpinner:"_dialcodeSpinner_1s288_325"},Ph=({name:e,label:t,required:r,disabled:n,multiline:o,maxLength:a,placeholder:i})=>{const s=le(),{register:l,formState:{errors:d}}=tr(),f=d[e],u={required:r?s.textField.requiredError.replace("{field}",t):!1,maxLength:a?{value:a,message:s.textField.maxLengthError.replace("{max}",String(a))}:void 0};return c.jsxs("div",{className:[M.field,o?M.fullWidth:""].join(" "),children:[c.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:M.required,children:"*"})]}),o?c.jsx("textarea",{id:e,className:[M.input,M.textarea,f?M.inputError:""].join(" "),disabled:n,placeholder:i,rows:3,...l(e,u)}):c.jsx("input",{id:e,type:"text",className:[M.input,f?M.inputError:""].join(" "),disabled:n,placeholder:i,...l(e,u)}),f&&c.jsx("span",{className:M.error,children:String(f.message)})]})},iE=({name:e,label:t,options:r,required:n,disabled:o})=>{var y;const a=le(),[i,s]=h.useState(!1),l=h.useRef(null),{register:d,watch:f,setValue:u,formState:{errors:m}}=tr(),g=f(e),w=((y=r.find(v=>v.value===g))==null?void 0:y.label)??a.selectField.selectPlaceholder,p=m[e];return h.useEffect(()=>{if(!i)return;const v=b=>{var C;(C=l.current)!=null&&C.contains(b.target)||s(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]),c.jsxs("div",{className:M.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:M.label,children:[t,n&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsx("input",{type:"hidden",...d(e,{required:n?a.selectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:o,className:[M.selectBtn,p?M.inputError:"",i?M.selectOpen:""].join(" "),onClick:()=>s(v=>!v),children:[c.jsx("span",{className:g?M.selectedVal:M.placeholder,children:w}),c.jsx(Cn,{size:14,className:i?M.chevronUp:""})]}),i&&c.jsxs("div",{className:M.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[M.option,g===v.value?M.optionSelected:""].join(" "),onClick:()=>{u(e,v.value,{shouldDirty:!0,shouldValidate:!0}),s(!1)},children:[c.jsx("span",{children:v.label}),g===v.value&&c.jsx(wn,{size:13})]},v.value)),!r.length&&c.jsx("span",{className:M.noOpts,children:a.selectField.noOptionsMessage})]}),p&&c.jsx("span",{className:M.error,children:String(p.message)})]})},sE=({name:e,label:t,options:r,required:n,disabled:o})=>{const a=le(),[i,s]=h.useState(!1),l=h.useRef(null),{register:d,watch:f,setValue:u,formState:{errors:m}}=tr(),g=f(e)??[],w=m[e],p=g.length?`${g.length} ${a.multiSelectField.selectedCountSuffix}`:a.multiSelectField.selectPlaceholder;h.useEffect(()=>{if(!i)return;const v=b=>{var C;(C=l.current)!=null&&C.contains(b.target)||s(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]);const y=v=>{const b=g.includes(v)?g.filter(C=>C!==v):[...g,v];u(e,b,{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:M.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:M.label,children:[t,n&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsx("input",{type:"hidden",...d(e,{required:n?a.multiSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:o,className:[M.selectBtn,w?M.inputError:"",i?M.selectOpen:""].join(" "),onClick:()=>s(v=>!v),children:[c.jsx("span",{className:g.length?M.selectedVal:M.placeholder,children:p}),c.jsx(Cn,{size:14,className:i?M.chevronUp:""})]}),i&&c.jsxs("div",{className:M.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[M.option,g.includes(v.value)?M.optionSelected:""].join(" "),onClick:()=>y(v.value),children:[c.jsx(wn,{size:13,style:{opacity:g.includes(v.value)?1:0}}),c.jsx("span",{children:v.label})]},v.value)),!r.length&&c.jsx("span",{className:M.noOpts,children:a.multiSelectField.noOptionsMessage})]}),w&&c.jsx("span",{className:M.error,children:String(w.message)})]})},lE=({name:e,label:t,required:r,disabled:n,placeholder:o})=>{const a=le(),i=o??a.chipGroupField.addPlaceholder,[s,l]=h.useState(""),[d,f]=h.useState(!1),u=h.useRef(null),{watch:m,setValue:g,formState:{errors:w}}=tr(),p=m(e)??[],y=w[e],v=()=>{const C=s.trim();C&&!p.includes(C)&&g(e,[...p,C],{shouldDirty:!0}),l(""),f(!1)},b=C=>g(e,p.filter(S=>S!==C),{shouldDirty:!0});return c.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[c.jsxs("label",{className:M.label,children:[t,r&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsxs("div",{className:M.chipGroup,children:[p.map(C=>c.jsxs("span",{className:"sbx-chip filled",children:[C,!n&&c.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>b(C),"aria-label":`Remove ${C}`,children:"×"})]},C)),!n&&(d?c.jsx("input",{ref:u,autoFocus:!0,className:M.chipInput,value:s,onChange:C=>l(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),v()),C.key==="Escape"&&(l(""),f(!1))},onBlur:v,placeholder:i}):c.jsxs("button",{type:"button",className:M.addChipBtn,onClick:()=>{f(!0),setTimeout(()=>{var C;return(C=u.current)==null?void 0:C.focus()},50)},children:[c.jsx(mo,{size:12})," ",a.chipGroupField.addButtonLabel]}))]}),y&&c.jsx("span",{className:M.error,children:String(y.message)})]})},cE=({name:e,label:t,options:r,required:n,disabled:o})=>{const a=le(),{register:i,formState:{errors:s}}=tr(),l=s[e];return c.jsxs("div",{className:M.field,children:[c.jsxs("label",{className:M.label,children:[t,n&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsx("div",{className:M.radioGroup,children:r.map(d=>c.jsxs("label",{className:M.radioLabel,children:[c.jsx("input",{type:"radio",value:d.value,disabled:o,...i(e,{required:n?a.radioField.requiredError.replace("{field}",t):!1})}),d.label]},d.value))}),l&&c.jsx("span",{className:M.error,children:String(l.message)})]})};async function dE(e,t,r,n){var i,s;const a=(s=(i=(await ke.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:i.result)==null?void 0:s.node_id;if(!a)throw new Error("Asset creation failed: no node_id returned");return a}async function uE(e,t){var o,a;const n=(a=(o=(await ke.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)==null?void 0:a.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function fE(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 hE(e,t,r){var i,s;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const a=(s=(i=(await ke.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:i.result)==null?void 0:s.content_url;if(!a)throw new Error("Asset finalize failed: no content_url returned");return a}const pe={overlay:"_overlay_ga6eh_1",modal:"_modal_ga6eh_12",header:"_header_ga6eh_24",title:"_title_ga6eh_33",closeBtn:"_closeBtn_ga6eh_39",tabs:"_tabs_ga6eh_57",tab:"_tab_ga6eh_57",activeTab:"_activeTab_ga6eh_83",body:"_body_ga6eh_88",searchWrap:"_searchWrap_ga6eh_99",searchIcon:"_searchIcon_ga6eh_104",searchInput:"_searchInput_ga6eh_113",grid:"_grid_ga6eh_132",imgCell:"_imgCell_ga6eh_148",imgCellSelected:"_imgCellSelected_ga6eh_166",thumb:"_thumb_ga6eh_171",noThumb:"_noThumb_ga6eh_177",checkBadge:"_checkBadge_ga6eh_183",loadMoreBtn:"_loadMoreBtn_ga6eh_198",loadingRow:"_loadingRow_ga6eh_220",empty:"_empty_ga6eh_230",spinner:"_spinner_ga6eh_237",uploadArea:"_uploadArea_ga6eh_247",dropZone:"_dropZone_ga6eh_256",uploadIcon:"_uploadIcon_ga6eh_277",dropText:"_dropText_ga6eh_281",dropSubtext:"_dropSubtext_ga6eh_288",uploadPreview:"_uploadPreview_ga6eh_294",hiddenInput:"_hiddenInput_ga6eh_301",fileName:"_fileName_ga6eh_305",errorText:"_errorText_ga6eh_311",footer:"_footer_ga6eh_318",cancelBtn:"_cancelBtn_ga6eh_328",confirmBtn:"_confirmBtn_ga6eh_345"},Fh=18,Mh=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const o=le(),[a,i]=h.useState("my"),[s,l]=h.useState(""),[d,f]=h.useState([]),[u,m]=h.useState(0),[g,w]=h.useState(!1),[p,y]=h.useState(null),[v,b]=h.useState(0),[C,S]=h.useState(null),[T,I]=h.useState(""),[k,x]=h.useState(!1),[$,j]=h.useState(""),N=h.useRef(null),L=ce(U=>{var H,ae;return((ae=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ae.channel)??""}),B=ce(U=>{var H,ae;return((ae=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ae.uid)??""}),P=ce(U=>{var H,ae,fe;return((fe=(ae=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ae.cloudStorage)==null?void 0:fe.presigned_headers)??{}}),F=ce(U=>{var H,ae,fe;return((fe=(ae=(H=U.editorConfig)==null?void 0:H.config)==null?void 0:ae.assetConfig)==null?void 0:fe.size)??1*1024*1024}),V=ce(U=>{var H,ae,fe;return((fe=(ae=(H=U.editorConfig)==null?void 0:H.config)==null?void 0:ae.assetConfig)==null?void 0:fe.accepted)??"image/png,image/jpeg"}),X=h.useCallback(async(U,H,ae=!1)=>{var fe;w(!0);try{const J={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};a==="my"&&B&&(J.createdBy=B),L&&(J.channel=L);const Me=((fe=(await ke.post("/action/composite/v3/search",{request:{filters:J,query:U,limit:Fh,offset:H,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:fe.result)??{},Oe=Me.content??[];m(Me.count??0),f(ze=>ae?[...ze,...Oe]:Oe)}catch{}finally{w(!1)}},[a,B,L]);h.useEffect(()=>{a!=="upload"&&(f([]),b(0),X(s,0))},[a]);const ve=h.useRef(),Ee=U=>{l(U),clearTimeout(ve.current),ve.current=setTimeout(()=>{f([]),b(0),X(U,0)},400)},Ce=()=>{const U=v+Fh;b(U),X(s,U,!0)},ue=()=>{const U=(p==null?void 0:p.artifactUrl)??(p==null?void 0:p.appIcon)??(p==null?void 0:p.downloadUrl)??"";U&&r(U)};h.useEffect(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);const Q=U=>{var fe;const H=(fe=U.target.files)==null?void 0:fe[0];if(U.target.value="",!H)return;const ae=V.split(",").map(J=>J.trim());if(!ae.includes(H.type)){const J=ae.map(oe=>oe.replace("image/","").toUpperCase()).join(", ");j(o.appIconPickerModal.invalidFileTypeError.replace("{types}",J));return}if(H.size>F){const J=(F/1048576).toFixed(0);j(o.appIconPickerModal.fileTooLargeError.replace("{size}",J));return}T&&URL.revokeObjectURL(T),S(H),I(URL.createObjectURL(H)),j("")},ne=async()=>{if(C){x(!0),j("");try{const U=await dE(C.name.split(".").slice(0,-1).join(".")||C.name,C.type,B,L),H=await uE(U,C.name);await fE(H,C,P);const ae=H.split("?")[0],fe=await hE(U,ae,C.type);r(fe)}catch(U){j(U instanceof Error?U.message:o.appIconPickerModal.uploadFailedError)}finally{x(!1)}}},te=d.length<u;return c.jsx("div",{className:pe.overlay,role:"dialog","aria-modal":"true","aria-label":o.appIconPickerModal.dialogAriaLabel,children:c.jsxs("div",{className:pe.modal,children:[c.jsxs("div",{className:pe.header,children:[c.jsx("span",{className:pe.title,children:o.appIconPickerModal.title}),c.jsx("button",{className:pe.closeBtn,onClick:n,"aria-label":o.appIconPickerModal.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:pe.tabs,role:"tablist",children:[c.jsx("button",{role:"tab","aria-selected":a==="my",className:`${pe.tab} ${a==="my"?pe.activeTab:""}`,onClick:()=>i("my"),children:o.appIconPickerModal.myImagesTab}),c.jsx("button",{role:"tab","aria-selected":a==="all",className:`${pe.tab} ${a==="all"?pe.activeTab:""}`,onClick:()=>i("all"),children:o.appIconPickerModal.allImagesTab}),c.jsxs("button",{role:"tab","aria-selected":a==="upload",className:`${pe.tab} ${a==="upload"?pe.activeTab:""}`,onClick:()=>i("upload"),children:[c.jsx(Xi,{size:13,style:{marginRight:4}}),o.appIconPickerModal.uploadTab]})]}),c.jsx("div",{className:pe.body,children:a!=="upload"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:pe.searchWrap,children:[c.jsx(Yi,{size:14,className:pe.searchIcon}),c.jsx("input",{type:"search",className:pe.searchInput,placeholder:o.appIconPickerModal.searchPlaceholder,value:s,onChange:U=>Ee(U.target.value)})]}),g&&d.length===0?c.jsxs("div",{className:pe.loadingRow,children:[c.jsx(wa,{size:20,className:pe.spinner}),c.jsx("span",{children:o.appIconPickerModal.loadingText})]}):d.length===0?c.jsx("div",{className:pe.empty,children:o.appIconPickerModal.noImagesFound}):c.jsx("div",{className:pe.grid,children:d.map(U=>{const H=U.appIcon??U.artifactUrl??U.downloadUrl??"",ae=(p==null?void 0:p.identifier)===U.identifier;return c.jsxs("button",{type:"button",className:`${pe.imgCell} ${ae?pe.imgCellSelected:""}`,onClick:()=>y(U),title:U.name,children:[H?c.jsx("img",{src:H,alt:U.name,className:pe.thumb}):c.jsx("div",{className:pe.noThumb,children:o.appIconPickerModal.noThumbnailText}),ae&&c.jsx("div",{className:pe.checkBadge,children:c.jsx(wn,{size:12})})]},U.identifier)})}),te&&!g&&c.jsx("button",{className:pe.loadMoreBtn,onClick:Ce,children:o.appIconPickerModal.loadMoreButton}),g&&d.length>0&&c.jsx("div",{className:pe.loadingRow,children:c.jsx(wa,{size:16,className:pe.spinner})})]}):c.jsxs("div",{className:pe.uploadArea,children:[c.jsx("div",{className:pe.dropZone,onClick:()=>{var 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:T?c.jsx("img",{src:T,alt:o.appIconPickerModal.previewAlt,className:pe.uploadPreview}):c.jsxs(c.Fragment,{children:[c.jsx(Xi,{size:32,className:pe.uploadIcon}),c.jsx("p",{className:pe.dropText,children:o.appIconPickerModal.dropZoneText}),c.jsx("p",{className:pe.dropSubtext,children:o.appIconPickerModal.acceptedTypesInfo.replace("{types}",V.split(",").map(U=>U.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(F/(1024*1024)).toFixed(0))})]})}),c.jsx("input",{ref:N,type:"file",accept:V,className:pe.hiddenInput,onChange:Q}),C&&c.jsx("p",{className:pe.fileName,children:C.name}),$&&c.jsx("p",{className:pe.errorText,children:$})]})}),c.jsxs("div",{className:pe.footer,children:[c.jsx("button",{className:pe.cancelBtn,onClick:n,children:o.appIconPickerModal.cancelButton}),a==="upload"?c.jsx("button",{className:pe.confirmBtn,disabled:!C||k,onClick:ne,children:k?c.jsxs(c.Fragment,{children:[c.jsx(wa,{size:14,className:pe.spinner})," ",o.appIconPickerModal.uploadingText]}):o.appIconPickerModal.uploadAndUseButton}):c.jsx("button",{className:pe.confirmBtn,disabled:!p,onClick:ue,children:o.appIconPickerModal.useSelectedButton})]})]})})},pE=({name:e,label:t,nodeId:r,required:n,disabled:o})=>{const a=le(),[i,s]=h.useState(!1),{watch:l,setValue:d,register:f,formState:{errors:u}}=tr(),m=l(e),g=u[e],w=y=>{d(e,y,{shouldDirty:!0,shouldValidate:!0}),s(!1)},p=()=>{d(e,"",{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:M.field,children:[c.jsxs("label",{className:M.label,children:[t,n&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsx("input",{type:"hidden",...f(e,{required:n?a.appIconField.requiredError.replace("{field}",t):!1})}),c.jsx("div",{className:M.iconWrap,role:"button",tabIndex:o?-1:0,"aria-label":a.appIconField.selectIconAriaLabel,onClick:()=>!o&&s(!0),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&!o&&s(!0)},children:m?c.jsx("img",{src:m,alt:a.appIconField.iconAlt,className:M.iconPreview}):c.jsxs("div",{className:M.iconPlaceholder,children:[c.jsx(Jc,{size:20}),c.jsx("span",{children:a.appIconField.selectIconLabel})]})}),m&&!o&&c.jsxs("button",{type:"button",className:M.removeIconBtn,onClick:p,"aria-label":a.appIconField.removeIconAriaLabel,children:[c.jsx(Zi,{size:13}),c.jsx("span",{children:a.appIconField.removeLabel})]}),g&&c.jsx("span",{className:M.error,children:String(g.message)}),i&&c.jsx(Mh,{nodeId:r,currentValue:m,onSelect:w,onClose:()=>s(!1)})]})},gE=({name:e,label:t,required:r,disabled:n})=>{const o=le(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ri({name:e,control:a,rules:{required:r?o.dateTimeField.requiredError.replace("{field}",t):!1}});return c.jsxs("div",{className:M.field,children:[c.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsx("input",{id:e,type:"datetime-local",className:[M.input,s?M.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:i.onChange,onBlur:i.onBlur,ref:i.ref}),s&&c.jsx("span",{className:M.error,children:String(s.message)})]})},mE=({name:e,label:t,required:r,disabled:n})=>{const o=le(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ri({name:e,control:a,rules:{required:r?o.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[l,d]=h.useState(""),f=h.useRef(null),u=i.value??[],m=y=>{const v=y.trim();!v||u.includes(v)||i.onChange([...u,v])},g=y=>{i.onChange(u.filter(v=>v!==y))},w=y=>{y.key==="Enter"||y.key===","?(y.preventDefault(),m(l),d("")):y.key==="Backspace"&&l===""&&u.length>0&&g(u[u.length-1])},p=()=>{l.trim()&&(m(l),d("")),i.onBlur()};return c.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[c.jsxs("label",{className:M.label,children:[t,r&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsxs("div",{className:[M.chipGroup,s?M.inputError:""].join(" "),onClick:()=>{var y;return!n&&((y=f.current)==null?void 0:y.focus())},style:{cursor:n?"not-allowed":"text"},children:[u.map(y=>c.jsxs("span",{className:M.tagChip,children:[y,!n&&c.jsx("button",{type:"button",className:M.tagChipRemove,onClick:v=>{v.stopPropagation(),g(y)},"aria-label":`Remove ${y}`,children:c.jsx(yr,{size:11})})]},y)),!n&&c.jsx("input",{ref:f,className:M.chipInput,value:l,onChange:y=>d(y.target.value),onKeyDown:w,onBlur:p,placeholder:u.length===0?o.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),s&&c.jsx("span",{className:M.error,children:String(s.message)})]})},yE=({name:e,label:t,levels:r,required:n,disabled:o})=>{const a=le(),{control:i}=tr(),{field:s,fieldState:{error:l}}=ri({name:e,control:i,rules:{required:n?a.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=s.value??{},f=(u,m,g)=>{const w={};for(let p=0;p<m;p++)w[r[p].code]=d[r[p].code]??"";w[u]=g;for(let p=m+1;p<r.length;p++)w[r[p].code]="";s.onChange(w)};return c.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[c.jsxs("label",{className:M.label,children:[t,n&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsx("div",{className:M.nestedSelectRow,children:r.map((u,m)=>{const g=m>0&&!d[r[m-1].code];return c.jsxs("div",{className:M.field,style:{flex:1},children:[c.jsx("label",{className:M.label,htmlFor:`${e}_${u.code}`,children:u.label}),c.jsxs("select",{id:`${e}_${u.code}`,className:[M.input,l?M.inputError:""].join(" "),disabled:o||g,value:d[u.code]??"",onChange:w=>f(u.code,m,w.target.value),onBlur:s.onBlur,children:[c.jsx("option",{value:"",children:a.nestedSelectField.selectPlaceholder}),u.options.map(w=>c.jsx("option",{value:w.value,children:w.label},w.value))]})]},u.code)})}),l&&c.jsx("span",{className:M.error,children:String(l.message)})]})},$h=[{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"}],vE=({name:e,label:t,required:r,disabled:n})=>{const o=le(),[a,i]=h.useState(!1),s=h.useRef(null),{register:l,watch:d,setValue:f,formState:{errors:u}}=tr(),m=d(e),g=$h.find(y=>y.value===m),w=(g==null?void 0:g.label)??o.licenseSelectField.selectPlaceholder,p=u[e];return h.useEffect(()=>{if(!a)return;const y=v=>{var b;(b=s.current)!=null&&b.contains(v.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]),c.jsxs("div",{className:M.field,ref:s,style:{position:"relative"},children:[c.jsxs("label",{className:M.label,children:[t,r&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsx("input",{type:"hidden",...l(e,{required:r?o.licenseSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:n,className:[M.selectBtn,p?M.inputError:"",a?M.selectOpen:""].join(" "),onClick:()=>i(y=>!y),"aria-haspopup":"listbox","aria-expanded":a,children:[c.jsx("span",{className:m?M.selectedVal:M.placeholder,children:w}),c.jsx(Cn,{size:14,className:a?M.chevronUp:""})]}),a&&c.jsx("div",{className:M.dropdown,role:"listbox",children:$h.map(y=>c.jsxs("button",{type:"button",role:"option","aria-selected":m===y.value,className:[M.option,m===y.value?M.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[c.jsx("span",{children:y.label}),m===y.value&&c.jsx(wn,{size:13})]},y.value))}),p&&c.jsx("span",{className:M.error,children:String(p.message)})]})},bE=({name:e,label:t,required:r,disabled:n})=>{const o=le(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ri({name:e,control:a,rules:{required:r?o.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[l,d]=h.useState("idle"),[f,u]=h.useState(""),m=async()=>{const w=(i.value??"").trim();if(!w){d("invalid"),u(o.dialcodeInputField.enterCodeMessage);return}d("loading"),u("");try{const p=await Lw(w),y=p==null?void 0:p.result,v=y==null?void 0:y.dialcodes;Array.isArray(v)&&v.length>0?(d("valid"),u(o.dialcodeInputField.validMessage)):(d("invalid"),u(o.dialcodeInputField.notFoundMessage))}catch{d("invalid"),u(o.dialcodeInputField.validationFailedMessage)}},g=()=>l==="loading"?c.jsx(wa,{size:16,className:M.dialcodeSpinner}):l==="valid"?c.jsx(Kc,{size:16,color:"var(--sbx-success, #2e7d32)"}):l==="invalid"?c.jsx(ky,{size:16,color:"var(--sbx-error)"}):null;return c.jsxs("div",{className:M.field,children:[c.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:M.required,children:"*"})]}),c.jsxs("div",{className:M.dialcodeRow,children:[c.jsx("input",{id:e,type:"text",className:[M.input,s?M.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:w=>{i.onChange(w),d("idle"),u("")},onBlur:i.onBlur,ref:i.ref,placeholder:o.dialcodeInputField.placeholderExample,style:{flex:1}}),c.jsx("button",{type:"button",className:M.validateBtn,onClick:m,disabled:n||l==="loading","aria-label":o.dialcodeInputField.validateAriaLabel,children:l==="loading"?o.dialcodeInputField.validatingLabel:o.dialcodeInputField.validateButtonLabel}),g()]}),s&&c.jsx("span",{className:M.error,children:String(s.message)}),!s&&f&&c.jsx("span",{className:l==="valid"?M.dialcodeValid:M.error,children:f})]})},_l={form:"_form_szqex_1",ungrouped:"_ungrouped_szqex_7",noFields:"_noFields_szqex_18"},wE=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:o,onFormValueChange:a,onFormStatusChange:i})=>{var We,Ve,re,Ke,Re,He,et,Gt,It;const s=le(),l=ce(K=>K.editorConfig),d=ce(K=>K.rootFormConfig),f=ce(K=>K.unitFormConfig),u=ce(K=>K.categoryMeta),m=ce(K=>K.contentFramework),g=ce(K=>K.contentTargetFWIds),{organisationFramework:w,targetFrameworks:p,isLoading:y}=Ah(m??((We=l==null?void 0:l.context)==null?void 0:We.framework),g??((Ve=l==null?void 0:l.context)==null?void 0:Ve.targetFWIds)),{frameworks:v,collectionAdditionalCategories:b,contentAdditionalCategories:C,defaultLicense:S,name:T}=F1((re=l==null?void 0:l.context)==null?void 0:re.channel),I=M1(((Ke=l==null?void 0:l.context)==null?void 0:Ke.userId)??((Re=l==null?void 0:l.context)==null?void 0:Re.uid)),k=L1(v,(He=u==null?void 0:u.frameworkMetadata)==null?void 0:He.orgFWType,(et=l==null?void 0:l.context)==null?void 0:et.channel),x={organisationFramework:w,targetFrameworks:p,orgFrameworks:k,channelAdditionalCategories:b},$=Ae(K=>K.selectedNodeId),j=Ae(K=>K.treeData),N=Ae(K=>K.treeCache),L=$?N[$]??{}:{},B={...e,...L},P=h.useMemo(()=>{var ge;if(!$)return 0;const K=[...j];for(;K.length;){const we=K.shift();if(we.id===$)return((ge=we.children)==null?void 0:ge.length)??0;we.children&&K.push(...we.children)}return 0},[j,$]),F=(l==null?void 0:l.config)??{},V=(l==null?void 0:l.context)??{},X={editorMode:o,editableFields:F.editableFields,objectType:F.objectType,setDefaultCopyRight:F.setDefaultCopyRight===!0,defaultLicense:V.defaultLicense??S,contextAdditionalCategories:V.additionalCategories,userFullName:((Gt=V.user)==null?void 0:Gt.fullName)??I,channelName:T,collectionAdditionalCategories:b,contentAdditionalCategories:C,childCount:P},ve=r?d:f,Ee=ve||(((It=l==null?void 0:l.config.hierarchy)==null?void 0:It.formConfig)??[]),Ce=Nh(Ee,B,x,r,X),ue=Ce.filter(K=>K.tab===t&&K.inputType!=="appIcon"&&K.visible!==!1),Q=k1({mode:"onChange",defaultValues:Object.fromEntries(Ce.map(K=>{const ge=["multiselect","chips","keywords","tagsinput"],we=["nestedselect"];return ge.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??[]]:we.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??{}]:[K.code,K.currentValue??K.defaultValue??""]}))});oE(Q,Ce);const{updateNode:ne}=Ae(),te=h.useRef(Ce);te.current=Ce;const U=h.useRef($);U.current=$;const H=h.useRef(a);H.current=a;const ae=h.useRef(i);ae.current=i;const fe=h.useRef(typeof B.shuffle=="boolean"?B.shuffle:void 0),J=h.useRef(B.name??"");J.current=B.name??"";const oe=h.useRef(o);oe.current=o;const Me=["review","read","sourcingreview","orgreview"];h.useEffect(()=>{const K=U.current;if(K){const ge=Object.fromEntries(te.current.filter(we=>we.currentValue!==void 0&&we.currentValue!==null).map(we=>[we.code,we.currentValue]));Object.keys(ge).length>0&&ne(K,ge)}Q.trigger().then(()=>{const ge=Q.formState.errors,we=te.current,Wt=Array.from(new Set(Object.keys(ge).map(_=>{var A;return(A=we.find(D=>D.code===_))==null?void 0:A.tab}).filter(Boolean)));ae.current(Object.keys(ge).length===0,Wt)})},[]),h.useEffect(()=>{const K=Q.watch((ge,{name:we})=>{const Wt=U.current;if(!Wt)return;const _=te.current,A=new Set(_.map(q=>q.code));if(we&&A.has(we)){let q=Q.getValues(we);we==="dialcodes"&&(q=Array.isArray(q)?q:q?[q]:[]),we==="shuffle"&&(q===!0&&fe.current===!1&&Ie(s.sparkMetaForm.shuffleEnabledMessage,{icon:c.jsx(Qi,{size:16})}),fe.current=q);const G=nE(we,q);G&&(ne(Wt,G),H.current(G))}else if(!we){const q=Q.getValues(),G=Object.fromEntries(Object.entries(q).filter(([ee])=>A.has(ee))),R=rE(G,{isReview:Me.includes(oe.current),nodeTitle:J.current});Object.keys(R).length>0&&(ne(Wt,R),H.current(R))}const D=Q.formState.errors,z=Array.from(new Set(Object.keys(D).map(q=>{var G;return(G=_.find(R=>R.code===q))==null?void 0:G.tab}).filter(Boolean)));ae.current(Object.keys(D).length===0,z)});return()=>K.unsubscribe()},[Q]),h.useEffect(()=>{for(const K of["author","creator","copyright","copyrightYear","license"]){const ge=te.current.find(Wt=>Wt.code===K);if(!ge||ge.currentValue===void 0||ge.currentValue===null||ge.currentValue==="")continue;const we=Q.getValues(K);(we==null||we==="")&&Q.setValue(K,ge.currentValue,{shouldDirty:!1})}},[I,T,Q]);const Oe=ue.reduce((K,ge)=>{const we=K[K.length-1];return we&&we.section===ge.section?we.fields.push(ge):K.push({section:ge.section,fields:[ge]}),K},[]),ze=K=>{const ge={key:K.code,name:K.code,label:K.label,required:K.required,disabled:K.editable===!1};switch(K.inputType){case"textarea":return c.jsx(Ph,{...ge,multiline:!0,maxLength:K.maxLength});case"select":return c.jsx(iE,{...ge,options:K.options??[]});case"multiselect":return c.jsx(sE,{...ge,options:K.options??[]});case"chips":return c.jsx(lE,{...ge});case"radio":return c.jsx(cE,{...ge,options:K.options??[]});case"appIcon":return c.jsx(pE,{...ge,nodeId:$??""});case"datepicker":case"datetime":return c.jsx(gE,{...ge});case"keywords":case"tagsinput":return c.jsx(mE,{...ge});case"nestedselect":return c.jsx(yE,{...ge,levels:K.levels??[]});case"license":return c.jsx(vE,{...ge});case"dialcode":return c.jsx(bE,{...ge});default:return c.jsx(Ph,{...ge,maxLength:K.maxLength})}};return c.jsx(m1,{...Q,children:c.jsxs("div",{className:_l.form,children:[Oe.map((K,ge)=>{const we=K.section?$1[K.section]:void 0;return we?c.jsx(aE,{title:we.title,description:we.description,children:K.fields.map(ze)},K.section??ge):c.jsx("div",{className:_l.ungrouped,children:K.fields.map(ze)},ge)}),ue.length===0&&!y&&c.jsx("p",{className:_l.noFields,children:s.sparkMetaForm.noFieldsMessage})]})})};function Bh(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function CE(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function si(e){return e!==null&&e>=0}function SE(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 _E(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const jh=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=Bh(t,n,r),i=t[o],s=a[o];return!s||!i?null:{x:s.left-i.left,y:s.top-i.top,scaleX:s.width/i.width,scaleY:s.height/i.height}},li={scaleX:1,scaleY:1},TE=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:a,overIndex:i}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(o===r){const d=a[i];return d?{x:0,y:r<i?d.top+d.height-(s.top+s.height):d.top-s.top,...li}:null}const l=EE(a,o,r);return o>r&&o<=i?{x:0,y:-s.height-l,...li}:o<r&&o>=i?{x:0,y:s.height+l,...li}:{x:0,y:0,...li}};function EE(e,t,r){const n=e[t],o=e[t-1],a=e[t+1];return n?r<t?o?n.top-(o.top+o.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const qh="Sortable",Uh=h.createContext({activeIndex:-1,containerId:qh,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:jh,disabled:{draggable:!1,droppable:!1}});function IE(e){let{children:t,id:r,items:n,strategy:o=jh,disabled:a=!1}=e;const{active:i,dragOverlay:s,droppableRects:l,over:d,measureDroppableContainers:f}=Rc(),u=lo(qh,r),m=s.rect!==null,g=h.useMemo(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),w=i!=null,p=i?g.indexOf(i.id):-1,y=d?g.indexOf(d.id):-1,v=h.useRef(g),b=!SE(g,v.current),C=y!==-1&&p===-1||b,S=_E(a);Yt(()=>{b&&w&&f(g)},[b,g,w,f]),h.useEffect(()=>{v.current=g},[g]);const T=h.useMemo(()=>({activeIndex:p,containerId:u,disabled:S,disableTransforms:C,items:g,overIndex:y,useDragOverlay:m,sortedRects:CE(g,l),strategy:o}),[p,u,S.draggable,S.droppable,C,g,y,l,m,o]);return h.createElement(Uh.Provider,{value:T},t)}const OE=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Bh(r,n,o).indexOf(t)},AE=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:i,previousItems:s,previousContainerId:l,transition:d}=e;return!d||!n||s!==a&&o===i?!1:r?!0:i!==o&&t===l},DE={duration:200,easing:"ease"},zh="transform",NE=Ar.Transition.toString({property:zh,duration:0,easing:"linear"}),kE={roleDescription:"sortable"};function xE(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,i]=h.useState(null),s=h.useRef(r);return Yt(()=>{if(!t&&r!==s.current&&n.current){const l=o.current;if(l){const d=bn(n.current,{ignoreTransform:!0}),f={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(f.x||f.y)&&i(f)}}r!==s.current&&(s.current=r)},[t,r,n,o]),h.useEffect(()=>{a&&i(null)},[a]),a}function LE(e){let{animateLayoutChanges:t=AE,attributes:r,disabled:n,data:o,getNewIndex:a=OE,id:i,strategy:s,resizeObserverConfig:l,transition:d=DE}=e;const{items:f,containerId:u,activeIndex:m,disabled:g,disableTransforms:w,sortedRects:p,overIndex:y,useDragOverlay:v,strategy:b}=h.useContext(Uh),C=PE(n,g),S=f.indexOf(i),T=h.useMemo(()=>({sortable:{containerId:u,index:S,items:f},...o}),[u,o,S,f]),I=h.useMemo(()=>f.slice(f.indexOf(i)),[f,i]),{rect:k,node:x,isOver:$,setNodeRef:j}=uy({id:i,data:T,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:N,activatorEvent:L,activeNodeRect:B,attributes:P,setNodeRef:F,listeners:V,isDragging:X,over:ve,setActivatorNodeRef:Ee,transform:Ce}=Hc({id:i,data:T,attributes:{...kE,...r},disabled:C.draggable}),ue=Yg(j,F),Q=!!N,ne=Q&&!w&&si(m)&&si(y),te=!v&&X,U=te&&ne?Ce:null,ae=ne?U??(s??b)({rects:p,activeNodeRect:B,activeIndex:m,overIndex:y,index:S}):null,fe=si(m)&&si(y)?a({id:i,items:f,activeIndex:m,overIndex:y}):S,J=N==null?void 0:N.id,oe=h.useRef({activeId:J,items:f,newIndex:fe,containerId:u}),Me=f!==oe.current.items,Oe=t({active:N,containerId:u,isDragging:X,isSorting:Q,id:i,index:S,items:f,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:d,wasDragging:oe.current.activeId!=null}),ze=xE({disabled:!Oe,index:S,node:x,rect:k});return h.useEffect(()=>{Q&&oe.current.newIndex!==fe&&(oe.current.newIndex=fe),u!==oe.current.containerId&&(oe.current.containerId=u),f!==oe.current.items&&(oe.current.items=f)},[Q,fe,u,f]),h.useEffect(()=>{if(J===oe.current.activeId)return;if(J&&!oe.current.activeId){oe.current.activeId=J;return}const Ve=setTimeout(()=>{oe.current.activeId=J},50);return()=>clearTimeout(Ve)},[J]),{active:N,activeIndex:m,attributes:P,data:T,rect:k,index:S,newIndex:fe,items:f,isOver:$,isSorting:Q,isDragging:X,listeners:V,node:x,overIndex:y,over:ve,setNodeRef:ue,setActivatorNodeRef:Ee,setDroppableNodeRef:j,setDraggableNodeRef:F,transform:ze??ae,transition:We()};function We(){if(ze||Me&&oe.current.newIndex===S)return NE;if(!(te&&!da(L)||!d)&&(Q||Oe))return Ar.Transition.toString({...d,property:zh})}}function PE(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function ci(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const FE=[_e.Down,_e.Right,_e.Up,_e.Left],ME=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:s}}=t;if(FE.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];a.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const m=o.get(u.id);if(m)switch(e.code){case _e.Down:n.top<m.top&&l.push(u);break;case _e.Up:n.top>m.top&&l.push(u);break;case _e.Left:n.left>m.left&&l.push(u);break;case _e.Right:n.left<m.left&&l.push(u);break}});const d=hm({collisionRect:n,droppableRects:o,droppableContainers:l});let f=mc(d,"id");if(f===(i==null?void 0:i.id)&&d.length>1&&(f=d[1].id),f!=null){const u=a.get(r.id),m=a.get(f),g=m?o.get(m.id):null,w=m==null?void 0:m.node.current;if(w&&g&&u&&m){const y=ha(w).some((I,k)=>s[k]!==I),v=Vh(u,m),b=$E(u,m),C=y||!v?{x:0,y:0}:{x:b?n.width-g.width:0,y:b?n.height-g.height:0},S={x:g.left,y:g.top};return C.x&&C.y?S:co(S,C)}}}};function Vh(e,t){return!ci(e)||!ci(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function $E(e,t){return!ci(e)||!ci(t)||!Vh(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const tn={row:"_row_11nth_1",removeBtn:"_removeBtn_11nth_14",grip:"_grip_11nth_17",ctIcon:"_ctIcon_11nth_34",info:"_info_11nth_38",name:"_name_11nth_46",meta:"_meta_11nth_55"},BE={video:Ji,pdf:ba,h5p:Gi,scorm:Ki,audio:Wi,quiz:Ri,default:Sn},jE=({item:e,onRemove:t,isEditable:r})=>{const n=le(),o=Ja(e),a=BE[o.key]??Sn,{attributes:i,listeners:s,setNodeRef:l,transform:d,transition:f,isDragging:u}=LE({id:e.id,disabled:!r}),m={transform:Ar.Transform.toString(d),transition:f,opacity:u?.5:1};return c.jsxs("div",{ref:l,style:m,className:tn.row,role:"listitem",children:[r&&c.jsx("span",{className:tn.grip,...i,...s,"aria-label":n.contentRow.dragToReorderAriaLabel,children:c.jsx(Xc,{size:15})}),c.jsx("span",{className:[`sbx-ct-sq--${o.key}`,tn.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(a,{size:14})}),c.jsxs("div",{className:tn.info,children:[c.jsx("span",{className:tn.name,title:e.name,children:e.name}),c.jsx("span",{className:tn.meta,children:o.label})]}),c.jsx("span",{className:`sbx-ct-badge--${o.key}`,children:o.label}),r&&c.jsx("button",{type:"button",className:tn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:c.jsx(yr,{size:14})})]})},rn={container:"_container_lzvke_1",header:"_header_lzvke_7",heading:"_heading_lzvke_13",count:"_count_lzvke_21",list:"_list_lzvke_30",emptyState:"_emptyState_lzvke_36",addRow:"_addRow_lzvke_52"},qE=({editorMode:e})=>{const t=le(),{selectedNodeId:r,getChildrenOf:n,reorderChildren:o,deleteNode:a}=Ae(),i=r?n(r):[],s=e==="edit",l=fc(Pi(pa,{activationConstraint:{distance:5}}),Pi(ji,{coordinateGetter:ME})),d=h.useCallback(u=>{const{active:m,over:g}=u;if(!g||m.id===g.id||!r)return;const w=Ae.getState().getChildrenOf(r),p=w.findIndex(v=>v.id===m.id),y=w.findIndex(v=>v.id===g.id);p<0||y<0||o(r,p,y)},[r,o]),f=h.useCallback(u=>{window.confirm(t.unitContentList.removeConfirm)&&a(u)},[a,t.unitContentList.removeConfirm]);return r?c.jsxs("div",{className:rn.container,children:[c.jsxs("div",{className:rn.header,children:[c.jsx("span",{className:rn.heading,children:t.unitContentList.heading}),c.jsx("span",{className:rn.count,children:i.length})]}),i.length>0?c.jsx(zc,{sensors:l,collisionDetection:fm,onDragEnd:d,children:c.jsx(IE,{items:i.map(u=>u.id),strategy:TE,children:c.jsx("div",{className:rn.list,role:"list",children:i.map(u=>c.jsx(jE,{item:u,onRemove:f,isEditable:s},u.id))})})}):c.jsxs("div",{className:rn.emptyState,children:[c.jsx("p",{children:t.unitContentList.emptyTitle}),c.jsx("span",{children:t.unitContentList.emptyHint})]}),s&&c.jsxs("button",{className:rn.addRow,type:"button","aria-label":t.unitContentList.addContentAriaLabel,children:[c.jsx(mo,{size:14})," ",t.unitContentList.addContent]})]}):null},Hh={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},UE=({isActive:e,label:t,nodeId:r,className:n})=>{const o=le(),a=t??o.dropZone.dropHere;return c.jsx("div",{className:`${Hh.dropZone} ${e?Hh.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":a,role:"region",children:c.jsx("span",{children:a})})};async function zE(e){var i;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((i=(await ke.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"]}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:i.result)??{},o=new Set(["count","facets"]);return{content:Object.entries(n).filter(([s])=>!o.has(s)).flatMap(([,s])=>Array.isArray(s)?s:[]),count:n.count??0}}async function VE(e){var r,n;return(n=(r=(await ke.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Rh="application/vnd.sunbird.question";function Qh(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Gh(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const o=Gh(n,t,e);if(o)return o}return null}function HE(e,t){const r=Gh(e,t);if(!r)return null;const{question:n,parent:o}=r,a={...e,children:[n],childNodes:[t],shuffle:o==null?void 0:o.shuffle,showSolutions:(o==null?void 0:o.showSolutions)??"No",showFeedback:(o==null?void 0:o.showFeedback)??"No"};return(o==null?void 0:o.shuffle)===!0?a.maxScore=1:n.qType==="SA"?delete a.maxScore:n.maxScore!=null&&(a.maxScore=n.maxScore),a}function RE(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return gn({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await su(e),o=f=>{if(!f)return[];const u=f.mimeType===Rh&&f.identifier?[f.identifier]:[],m=(f.children??[]).flatMap(o);return[...u,...m]},a=o(n),i=new Map;a.length&&(await Tw(a)).forEach(u=>{const m=u.identifier;m&&i.set(m,u)});const s=f=>{if(!f)return f;if(f.mimeType===Rh&&f.identifier){const u=i.get(f.identifier)??f,m=u.outcomeDeclaration;return m!=null&&m.maxScore||(u.outcomeDeclaration={...m??{},maxScore:Qh(u)}),u}return Array.isArray(f.children)&&(f.children=f.children.map(u=>s(u))),f},l=s(n),d=l.outcomeDeclaration;return d!=null&&d.maxScore||(l.outcomeDeclaration={...d??{},maxScore:Qh(l)}),l}})}const Wh="/assets/quml-player/sunbird-quml-player.js",QE="/assets/quml-player/styles.css",Kh="sunbird-quml-player";function GE(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const lt=class lt{constructor(){Yo(this,"eventHandlers",new WeakMap)}loadScript(){return lt.scriptLoaded||customElements.get(Kh)?(lt.scriptLoaded=!0,Promise.resolve()):(lt.scriptLoading||(lt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Wh,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{lt.scriptLoaded=!0,lt.scriptLoading=void 0,t()},n.onerror=()=>{lt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Wh}`))},document.body.appendChild(n)})),lt.scriptLoading)}loadStyles(){if(lt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){lt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=QE,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),lt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),lt.stylesLoaded=!1}async createConfig(t,r,n){var a,i,s;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((a=r==null?void 0:r.pdata)==null?void 0:a.id)??"sunbird.portal",ver:((i=r==null?void 0:r.pdata)==null?void 0:i.ver)??"1.0",pid:((s=r==null?void 0:r.pdata)==null?void 0:s.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:GE(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Kh);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const o=i=>r==null?void 0:r(i),a=i=>n==null?void 0:n(i.detail);t.addEventListener("playerEvent",o),t.addEventListener("telemetryEvent",a),this.eventHandlers.set(t,{player:o,telemetry:a})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};Yo(lt,"scriptLoaded",!1),Yo(lt,"scriptLoading"),Yo(lt,"stylesLoaded",!1);let di=lt;const ui=new di,je={contentPlayerRoot:"_contentPlayerRoot_r6xk8_1",flowLayout:"_flowLayout_r6xk8_9",stage:"_stage_r6xk8_13",aspectRatio:"_aspectRatio_r6xk8_16",playerHeader:"_playerHeader_r6xk8_32",playerHeaderThumb:"_playerHeaderThumb_r6xk8_46",playerHeaderTitle:"_playerHeaderTitle_r6xk8_56",typeBadge:"_typeBadge_r6xk8_66",typeDot:"_typeDot_r6xk8_105",playerFrame:"_playerFrame_r6xk8_125",coverOverlay:"_coverOverlay_r6xk8_133",coverHidden:"_coverHidden_r6xk8_145",coverThumb:"_coverThumb_r6xk8_150",coverPlayRing:"_coverPlayRing_r6xk8_159",coverPlayIcon:"_coverPlayIcon_r6xk8_172",coverLabel:"_coverLabel_r6xk8_181",coverSkeleton:"_coverSkeleton_r6xk8_187",playerWrapper:"_playerWrapper_r6xk8_213",infoStrip:"_infoStrip_r6xk8_223",infoChip:"_infoChip_r6xk8_239",infoChipLabel:"_infoChipLabel_r6xk8_258",infoChipIcon:"_infoChipIcon_r6xk8_267",playerError:"_playerError_r6xk8_273",playerErrorIcon:"_playerErrorIcon_r6xk8_287",playerErrorMsg:"_playerErrorMsg_r6xk8_292",qumlRoot:"_qumlRoot_r6xk8_299"},WE="application/vnd.sunbird.questionset";function KE(e,t){const r=new Map,n=a=>{for(const i of a)r.set(i.id,i),i.children&&n(i.children)};n(e);let o=r.get(t);for(;o;){if(o.mimeType===WE)return o.identifier;o=o.parent?r.get(o.parent):void 0}return null}const YE=[{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 ZE(e){return YE.find(t=>t.mimes.includes(e))??{key:"other"}}function XE(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 JE={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},eI={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},tI={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},rI="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Tl(e){for(const[t,r]of Object.entries(JE))if(r.includes(e))return t;return"default-player"}function nI(e,t,r){var a;const n=r==null?void 0:r.context,o=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((a=n==null?void 0:n.pdata)==null?void 0:a.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/sunbird-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:o==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function oI(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 aI(e,t,r=100){await oI(eI[t]??""),!customElements.get(e)&&await new Promise((n,o)=>{let a=0;const i=setInterval(()=>{a++,customElements.get(e)?(clearInterval(i),n()):a>=r&&(clearInterval(i),o(new Error(`Custom element <${e}> did not register`)))},100)})}const iI=[{key:"author",icon:Zy},{key:"license",icon:Hy},{key:"language",icon:My},{key:"gradeLevel",icon:Ry},{key:"subject",icon:Ay},{key:"contentType",icon:Ky}];function sI(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 lI({node:e}){const t=le(),r=e.metadata??{},n=iI.flatMap(o=>{const a=r[o.key];if(!a)return[];const i=Array.isArray(a)?a.join(", "):String(a);return i?[{...o,label:sI(o.key,t),val:i}]:[]});return n.length?c.jsx("div",{className:je.infoStrip,children:n.map(o=>c.jsxs("div",{className:je.infoChip,children:[o.icon&&c.jsx(o.icon,{size:13,className:je.infoChipIcon}),c.jsx("span",{className:je.infoChipLabel,children:o.label}),o.val]},o.key))}):null}function Yh({node:e,hidden:t}){var o;const r=le(),n=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return c.jsx("div",{className:`${je.coverOverlay} ${t?je.coverHidden:""}`,children:n?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:n,alt:e.name,className:je.coverThumb}),c.jsx("div",{className:je.coverPlayRing,children:c.jsx("div",{className:je.coverPlayIcon})}),c.jsx("span",{className:je.coverLabel,children:r.contentPlayer.loadingPreview})]}):c.jsx("div",{className:je.coverSkeleton})})}function Zh({message:e}){return c.jsxs("div",{className:je.playerError,children:[c.jsx(Yy,{size:28,className:je.playerErrorIcon}),c.jsx("span",{className:je.playerErrorMsg,children:e})]})}function cI({mimeType:e}){const t=le(),r=ZE(e);return c.jsxs("span",{className:je.typeBadge,"data-type":r.key,children:[c.jsx("span",{className:je.typeDot}),XE(r.key,t)]})}const El=({node:e,editorMode:t,type:r,singleQuestion:n,layout:o="fill"})=>{var i;if(r==="quml")return c.jsx(uI,{node:e,editorMode:t,singleQuestion:!!n});const a=e.appIcon??((i=e.metadata)==null?void 0:i.appIcon);return c.jsxs("div",{className:`${je.contentPlayerRoot} ${o==="flow"?je.flowLayout:""}`,children:[c.jsxs("div",{className:je.stage,children:[c.jsxs("div",{className:je.playerHeader,children:[a&&c.jsx("img",{src:a,alt:"",className:je.playerHeaderThumb}),c.jsx("span",{className:je.playerHeaderTitle,children:e.name}),c.jsx(cI,{mimeType:e.mimeType??""})]}),c.jsx(dI,{node:e})]}),c.jsx(lI,{node:e})]})};function dI({node:e}){var v;const t=le(),r=ce(b=>b.editorConfig),[n,o]=h.useState(()=>Tl(e.mimeType??"")),[a,i]=h.useState(!1),[s,l]=h.useState(null),[d,f]=h.useState(e.metadata??{}),[u,m]=h.useState(!1),g=h.useRef(null),w=h.useRef(null),p=((v=r==null?void 0:r.config)==null?void 0:v.previewCdnUrl)??rI;h.useEffect(()=>{let b=!1;return m(!1),i(!1),l(null),f(e.metadata??{}),o(Tl(e.mimeType??"")),VE(e.identifier).then(C=>{if(b)return;const S={...e.metadata??{},...C};f(S);const T=C.mimeType??e.mimeType??"";o(Tl(T)),m(!0)}).catch(()=>{b||m(!0)}),()=>{b=!0}},[e.identifier]);const y=nI(e,d,r);return h.useEffect(()=>{if(!u||n!=="default-player")return;const b=g.current;if(!b)return;b.src=p;const C=()=>{try{const T=b.contentWindow;if(typeof(T==null?void 0:T.initializePreview)!="function"){l(t.contentPlayer.previewPlayerUnavailable);return}T.initializePreview(y),setTimeout(()=>i(!0),300)}catch(T){console.error("[ContentPlayer] initializePreview failed",T),l(t.contentPlayer.failedToInitializePlayer)}},S=()=>l(t.contentPlayer.previewPlayerLoadFailed);return b.addEventListener("load",C),b.addEventListener("error",S),()=>{b.removeEventListener("load",C),b.removeEventListener("error",S),b.src=""}},[e.identifier,n,p,u,t]),h.useEffect(()=>{if(!u||n==="default-player")return;const b=w.current;if(!b)return;const C=tI[n];if(!C)return;const S=y;aI(C,n).then(()=>{if(!w.current)return;if(!customElements.get(C)){o("default-player");return}const T=document.createElement(C);T.setAttribute("player-config",JSON.stringify(S)),T.addEventListener("playerEvent",()=>{}),T.addEventListener("telemetryEvent",()=>{}),b.innerHTML="",b.appendChild(T),setTimeout(()=>{try{T.playerConfig=S}catch{}i(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),o("default-player")})},[e.identifier,n,u]),c.jsxs("div",{className:je.aspectRatio,children:[s?c.jsx(Zh,{message:s}):c.jsx(Yh,{node:e,hidden:a}),n==="default-player"?c.jsx("iframe",{ref:g,id:"contentPlayer",title:e.name,className:je.playerFrame,name:"contentPlayer",allowFullScreen:!0}):c.jsx("div",{ref:w,className:je.playerFrame})]})}function uI({node:e,editorMode:t,singleQuestion:r}){const n=le(),o=ce(g=>g.editorConfig),a=Ae(g=>g.treeData),i=h.useRef(null),s=r?KE(a,e.id):e.identifier,{data:l,isLoading:d,error:f}=RE(s??"",{enabled:!!s}),u=h.useMemo(()=>l?r?HE(l,e.identifier):l:null,[l,r,e.identifier]);h.useEffect(()=>{const g=i.current;if(!g||!u)return;let w=null,p=!1;return(async()=>{try{const y=await ui.createConfig(u,o==null?void 0:o.context,{mode:t==="edit"?"edit":"play"});if(p||!i.current)return;const v=ui.createElement(y);w=v,ui.attachEventListeners(v,b=>console.debug("[QumlPlayer] playerEvent",b.detail),b=>console.debug("[QumlPlayer] telemetryEvent",b)),g.innerHTML="",g.appendChild(v)}catch(y){console.error("[QumlPlayer] failed to initialize",y)}})(),()=>{p=!0,w&&(ui.removeEventListeners(w),w.remove()),di.unloadStyles()}},[u,o,t,r]);const m=f?`${n.contentPlayer.unableToLoadQuestionset} ${f.message}`:r&&!s?n.contentPlayer.parentQuestionsetNotResolved:r&&l&&!u?n.contentPlayer.questionNotFoundInQuestionset:null;return c.jsxs("div",{className:je.qumlRoot,children:[m?c.jsx(Zh,{message:m}):d||!u?c.jsx(Yh,{node:e,hidden:!1}):null,c.jsx("div",{ref:i,className:je.playerWrapper})]})}const Rt={overlay:"_overlay_ifddx_1",modal:"_modal_ifddx_11",header:"_header_ifddx_21",body:"_body_ifddx_37",hint:"_hint_ifddx_43",list:"_list_ifddx_49",item:"_item_ifddx_55",selected:"_selected_ifddx_68",empty:"_empty_ifddx_73",footer:"_footer_ifddx_79",cancelBtn:"_cancelBtn_ifddx_87",moveBtn:"_moveBtn_ifddx_95"};function fI(e,t,r){const n=[],o=a=>{var i;for(const s of a)s.isFolder&&s.id!==r&&s.id!==t&&n.push(s),(i=s.children)!=null&&i.length&&o(s.children)};return o(e),n}const hI=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var u;const o=le(),{treeData:a,moveNode:i}=Ae(),s=fI(a,((u=a[0])==null?void 0:u.id)??"",r),[l,d]=h.useState(null),f=()=>{l&&(i(e,r,l),n())};return c.jsx("div",{className:Rt.overlay,role:"dialog","aria-label":o.resourceReorderDialog.dialogAriaLabel,children:c.jsxs("div",{className:Rt.modal,children:[c.jsxs("div",{className:Rt.header,children:[c.jsxs("span",{children:[o.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),c.jsx("button",{onClick:n,"aria-label":o.resourceReorderDialog.closeAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsxs("div",{className:Rt.body,children:[c.jsx("p",{className:Rt.hint,children:o.resourceReorderDialog.selectUnitHint}),c.jsxs("ul",{className:Rt.list,children:[s.map(m=>c.jsxs("li",{className:`${Rt.item} ${l===m.id?Rt.selected:""}`,onClick:()=>d(m.id),children:[c.jsx(Py,{size:14}),c.jsx("span",{children:m.name})]},m.id)),s.length===0&&c.jsx("li",{className:Rt.empty,children:o.resourceReorderDialog.noUnitsAvailable})]})]}),c.jsxs("div",{className:Rt.footer,children:[c.jsx("button",{className:Rt.cancelBtn,onClick:n,children:o.resourceReorderDialog.cancelButton}),c.jsx("button",{className:Rt.moveBtn,onClick:f,disabled:!l,children:o.resourceReorderDialog.moveButton})]})]})})},lr={overlay:"_overlay_16at9_1",modal:"_modal_16at9_11",header:"_header_16at9_21",body:"_body_16at9_37",table:"_table_16at9_43",pageInput:"_pageInput_16at9_61",empty:"_empty_16at9_68",footer:"_footer_16at9_74",cancelBtn:"_cancelBtn_16at9_82",saveBtn:"_saveBtn_16at9_90"};function pI(e){const t=[],r=n=>{var o;for(const a of n)!a.isFolder&&(!a.children||a.children.length===0)?t.push(a):(o=a.children)!=null&&o.length&&r(a.children)};return r(e),t}const gI=({onClose:e})=>{const t=le(),{treeData:r,updateNode:n}=Ae(),o=pI(r),[a,i]=h.useState(()=>Object.fromEntries(o.map(l=>{var d;return[l.id,String(((d=l.metadata)==null?void 0:d.pageNumber)??"")]}))),s=h.useCallback(()=>{for(const[l,d]of Object.entries(a))d!==""&&n(l,{pageNumber:parseInt(d,10)||void 0});e()},[a,n,e]);return c.jsx("div",{className:lr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:c.jsxs("div",{className:lr.modal,children:[c.jsxs("div",{className:lr.header,children:[c.jsx("span",{children:t.assignPageNumber.title}),c.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsx("div",{className:lr.body,children:o.length===0?c.jsx("p",{className:lr.empty,children:t.assignPageNumber.emptyState}):c.jsxs("table",{className:lr.table,children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),c.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),c.jsx("tbody",{children:o.map(l=>c.jsxs("tr",{children:[c.jsx("td",{children:l.name}),c.jsx("td",{children:c.jsx("input",{type:"number",min:1,value:a[l.id]??"",onChange:d=>i(f=>({...f,[l.id]:d.target.value})),className:lr.pageInput})})]},l.id))})]})}),c.jsxs("div",{className:lr.footer,children:[c.jsx("button",{className:lr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),c.jsxs("button",{className:lr.saveBtn,onClick:s,children:[c.jsx(Vy,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},Ge={container:"_container_1a7t2_1",panelHeader:"_panelHeader_1a7t2_10",panelHeaderLeft:"_panelHeaderLeft_1a7t2_19",panelCollapseBtn:"_panelCollapseBtn_1a7t2_27",titleRow:"_titleRow_1a7t2_46",field:"_field_1a7t2_47",moveBtn:"_moveBtn_1a7t2_64",icon:"_icon_1a7t2_84",nameInput:"_nameInput_1a7t2_93",fieldHeader:"_fieldHeader_1a7t2_118",label:"_label_1a7t2_124",fieldCount:"_fieldCount_1a7t2_133",chips:"_chips_1a7t2_170",chip:"_chip_1a7t2_170",chipRemove:"_chipRemove_1a7t2_188",keywordInput:"_keywordInput_1a7t2_202",input:"_input_1a7t2_207",addBtn:"_addBtn_1a7t2_220",radioGroup:"_radioGroup_1a7t2_234",radioLabel:"_radioLabel_1a7t2_239"},mI=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var L,B;const{updateNode:o,markDirty:a}=Ae(),i=t==="edit",s=Ja(e),l=le(),d=ce(P=>P.relationalFormConfig),f=P=>d==null?void 0:d.find(F=>F.code===P),u=P=>!d||!!f(P),m=(P,F)=>{var V;return((V=f(P))==null?void 0:V.label)||F},[g,w]=h.useState(!0),p=((L=e.metadata)==null?void 0:L.relationalMetadata)??{},[y,v]=h.useState(p.name??e.name??""),[b,C]=h.useState(""),[S,T]=h.useState(Array.isArray(p.keywords)?p.keywords:Array.isArray((B=e.metadata)==null?void 0:B.keywords)?e.metadata.keywords:[]),[I,k]=h.useState(!!p.optional);h.useEffect(()=>{var F,V;const P=((F=e.metadata)==null?void 0:F.relationalMetadata)??{};v(P.name??e.name??""),T(Array.isArray(P.keywords)?P.keywords:Array.isArray((V=e.metadata)==null?void 0:V.keywords)?e.metadata.keywords:[]),k(!!P.optional)},[e.id]);const x=()=>{y.trim()&&y!==e.name&&(o(e.id,{name:y.trim()}),a())},$=()=>{const P=b.trim();if(P&&!S.includes(P)){const F=[...S,P];T(F),o(e.id,{keywords:F}),a()}C("")},j=P=>{const F=S.filter(V=>V!==P);T(F),o(e.id,{keywords:F}),a()},N=P=>{k(P),o(e.id,{optional:P}),a()};return c.jsxs("div",{className:Ge.container,children:[c.jsxs("div",{className:Ge.panelHeader,children:[c.jsxs("div",{className:Ge.panelHeaderLeft,children:[c.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),i&&c.jsx("button",{type:"button",className:Ge.moveBtn,onClick:r,children:l.contentEditForm.moveToAnotherUnitButton})]}),c.jsx("button",{type:"button",className:Ge.panelCollapseBtn,onClick:()=>w(P=>!P),"aria-expanded":g,"aria-label":g?l.contentEditForm.collapseMetadataPanelAriaLabel:l.contentEditForm.expandMetadataPanelAriaLabel,title:g?l.contentEditForm.collapseTitle:l.contentEditForm.expandTitle,children:g?c.jsx(Cn,{size:15}):c.jsx(Ny,{size:15})})]}),g&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:Ge.titleRow,children:[e.appIcon&&c.jsx("img",{src:e.appIcon,alt:l.contentEditForm.iconAlt,className:Ge.icon}),c.jsx("input",{type:"text",className:Ge.nameInput,value:y,disabled:!i,onChange:P=>v(P.target.value),onBlur:x,placeholder:l.contentEditForm.contentNamePlaceholder})]}),u("keywords")&&c.jsxs("div",{className:Ge.field,children:[c.jsx("div",{className:Ge.fieldHeader,children:c.jsxs("label",{className:Ge.label,children:[m("keywords",l.contentEditForm.keywordsLabel),S.length>0&&c.jsx("span",{className:Ge.fieldCount,children:S.length})]})}),S.length>0&&c.jsx("div",{className:Ge.chips,children:S.map(P=>c.jsxs("span",{className:Ge.chip,children:[P,i&&c.jsx("button",{type:"button",className:Ge.chipRemove,onClick:()=>j(P),children:"×"})]},P))}),i&&c.jsxs("div",{className:Ge.keywordInput,children:[c.jsx("input",{type:"text",className:Ge.input,value:b,placeholder:l.contentEditForm.addKeywordPlaceholder,onChange:P=>C(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),$())}}),c.jsx("button",{type:"button",className:Ge.addBtn,onClick:$,children:l.contentEditForm.addButton})]})]}),u("optional")&&c.jsxs("div",{className:Ge.field,children:[c.jsx("label",{className:Ge.label,children:m("optional",l.contentEditForm.optionalInCollectionLabel)}),c.jsxs("div",{className:Ge.radioGroup,children:[c.jsxs("label",{className:Ge.radioLabel,children:[c.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:I===!0,onChange:()=>N(!0),disabled:!i}),l.contentEditForm.yesOption]}),c.jsxs("label",{className:Ge.radioLabel,children:[c.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:I===!1,onChange:()=>N(!1),disabled:!i}),l.contentEditForm.noOption]})]})]})]}),n]})},$o={iconBtn:"_iconBtn_vl14u_1",editable:"_editable_vl14u_14",iconImg:"_iconImg_vl14u_26",placeholder:"_placeholder_vl14u_34",removeBtn:"_removeBtn_vl14u_41"},yI=({nodeId:e,value:t,editable:r})=>{const[n,o]=h.useState(!1),{updateNode:a,markDirty:i}=Ae(),s=le(),l=f=>{a(e,{appIcon:f}),i(),o(!1)},d=f=>{f.stopPropagation(),a(e,{appIcon:""}),i()};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:[$o.iconBtn,r?$o.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?s.titleAppIcon.selectAppIconAriaLabel:s.titleAppIcon.appIconAriaLabel,onClick:()=>r&&o(!0),onKeyDown:f=>{r&&(f.key==="Enter"||f.key===" ")&&o(!0)},children:[t?c.jsx("img",{src:t,alt:s.titleAppIcon.appIconAlt,className:$o.iconImg}):c.jsx("div",{className:$o.placeholder,children:c.jsx(Jc,{size:18})}),t&&r&&c.jsx("button",{type:"button",className:$o.removeBtn,onClick:d,"aria-label":s.titleAppIcon.removeIconAriaLabel,children:c.jsx(Zi,{size:11})})]}),n&&c.jsx(Mh,{nodeId:e,currentValue:t,onSelect:l,onClose:()=>o(!1)})]})},rr={leafContentLayout:"_leafContentLayout_1lchu_1",container:"_container_1lchu_15",emptyState:"_emptyState_1lchu_24",titleRow:"_titleRow_1lchu_34",nodeTitle:"_nodeTitle_1lchu_50",formArea:"_formArea_1lchu_72",contentListArea:"_contentListArea_1lchu_76",dropZone:"_dropZone_1lchu_81",reviewComment:"_reviewComment_1lchu_88",reviewCommentLabel:"_reviewCommentLabel_1lchu_101",reviewCommentText:"_reviewCommentText_1lchu_107"},vI="application/vnd.sunbird.questionset",Xh="application/vnd.sunbird.question",bI=[vI,Xh];function Jh(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 wI=({editorMode:e,onToolbarEvent:t})=>{var B;const r=le(),[n,o]=h.useState("details"),[a,i]=h.useState([]),[s,l]=h.useState(null),[d,f]=h.useState(!1),u=h.useRef(null),m=h.useRef(),{selectedNodeId:g,breadcrumb:w,activeNodeMeta:p,updateNode:y,treeData:v}=Ae(),b=ce(P=>{var F,V,X,ve;return((V=(F=P.editorConfig)==null?void 0:F.context)==null?void 0:V.contentId)??((ve=(X=P.editorConfig)==null?void 0:X.context)==null?void 0:ve.identifier)??""}),C=g?ep(v,g):null,S=!!C&&!C.parent,T=!!(C!=null&&C.isFolder),I=C&&bI.includes(C.mimeType??""),k=(C==null?void 0:C.mimeType)===Xh,x=C&&!C.isFolder&&!I&&!S,$=Jh(C)??(S?Jh(v[0]):void 0),j=h.useCallback(()=>{const P=u.current;if(!P||!g)return;const F=P.innerText.trim();clearTimeout(m.current),m.current=setTimeout(()=>{y(g,{name:F})},600)},[g,y]),N=h.useCallback(P=>{t({action:"onFormValueChange",data:P})},[t]),L=h.useCallback((P,F)=>{i(F),t({action:"onFormStatusChange",data:{isValid:P,nodeId:g}})},[t,g]);return C?I?c.jsx(El,{node:C,editorMode:e,type:"quml",singleQuestion:k}):x?c.jsxs("div",{className:rr.leafContentLayout,children:[c.jsx(El,{node:C,editorMode:e,type:"content",layout:"flow"}),c.jsx(mI,{node:C,editorMode:e,onMoveClick:()=>l(C.identifier),reorderDialog:s?c.jsx(hI,{resourceId:s,resourceName:C.name,currentUnitId:C.parent??"",onClose:()=>l(null)}):null})]}):c.jsxs("div",{className:rr.container,children:[c.jsx(f1,{crumbs:w}),$&&c.jsxs("div",{className:rr.reviewComment,role:"alert",children:[c.jsx("span",{className:rr.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),c.jsx("span",{className:rr.reviewCommentText,children:$})]}),c.jsxs("div",{className:rr.titleRow,children:[S&&g&&c.jsx(yI,{nodeId:g,value:String(C.appIcon??((B=C.metadata)==null?void 0:B.appIcon)??""),editable:e==="edit"}),c.jsx("div",{ref:u,className:rr.nodeTitle,contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:j,onBlur:j,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:C.name})]}),c.jsx(h1,{activeTab:n,onChange:P=>o(P),errorTabs:a,visibleTabs:S?void 0:["details"]}),c.jsx("div",{className:rr.formArea,children:c.jsx(wE,{nodeMetadata:p,activeTab:n,isRoot:S,isFolder:T,editorMode:e,onFormValueChange:N,onFormStatusChange:L},`${g??"none"}:${S?"root":"node"}`)}),(T||S)&&n==="details"&&c.jsx("div",{className:rr.contentListArea,children:c.jsx(qE,{editorMode:e})}),c.jsx(UE,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:g??void 0,className:rr.dropZone}),d&&c.jsx(gI,{contentId:b,onClose:()=>f(!1)})]}):c.jsx("div",{className:rr.emptyState,children:c.jsx("p",{children:r.contextualEditor.emptyStateMessage})})};function ep(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=ep(r.children,t);if(n)return n}}}const tp=yo((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const a=[...t().allContent,...r];e({allContent:a,totalCount:n,offset:a.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:o}=t();let a=r;if(n&&n!=="all"){const i=n.toLowerCase();a=a.filter(s=>[s.mimeType??"",s.primaryCategory??"",s.contentType??""].join(" ").toLowerCase().includes(i))}if(o&&o.trim()!==""){const i=o.toLowerCase().trim();a=a.filter(s=>(s.name??"").toLowerCase().includes(i))}e({filteredContent:a})}})),CI=20;function rp(){var d;const e=ce(f=>f.editorConfig),t=Ae(f=>f.selectedNodeId),r=Ae(f=>f.treeData),n=h.useCallback(()=>{if(!t||!r.length)return 0;function f(u,m,g=0){var w;for(const p of u){if(p.id===m)return g;if((w=p.children)!=null&&w.length){const y=f(p.children,m,g+1);if(y>=0)return y}}return-1}return Math.max(0,f(r,t))},[t,r])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...Jf];const a=`level${n}`,i=o[a],s=i==null?void 0:i.children,l=s==null?void 0:s.Content;return l!=null&&l.length?l:[...Jf]}function SI(){const e=tp(),t=ce(u=>{var m,g;return((g=(m=u.editorConfig)==null?void 0:m.context)==null?void 0:g.channel)??""}),r=rp(),n=h.useRef(),o=h.useCallback(async(u="",m="all",g={},w=!0,p=!1)=>{var y,v,b,C,S;e.setLoading(!0);try{const T={status:["Live"],primaryCategory:m&&m!=="all"?[m]:r};(y=g==null?void 0:g.board)!=null&&y.length&&(T.board=g.board),(v=g==null?void 0:g.medium)!=null&&v.length&&(T.medium=g.medium),(b=g==null?void 0:g.gradeLevel)!=null&&b.length&&(T.gradeLevel=g.gradeLevel),(C=g==null?void 0:g.subject)!=null&&C.length&&(T.subject=g.subject),(S=g==null?void 0:g.primaryCategory)!=null&&S.length&&(T.primaryCategory=g.primaryCategory);const I=w?0:e.offset,{content:k,count:x}=await zE({filters:T,query:u,limit:u?50:CI,offset:I,channel:t||void 0,sortBy:p?{name:"asc"}:{lastUpdatedOn:"desc"}});w?e.setContent(k,x):e.appendContent(k,x)}catch(T){console.error("[useLibrary] load error:",T)}finally{e.setLoading(!1)}},[r,t]);h.useEffect(()=>{o()},[t]);const a=h.useCallback(u=>{e.setSearch(u),clearTimeout(n.current),n.current=setTimeout(()=>o(u,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,o]),i=h.useCallback(u=>{e.setFilter(u),o(e.searchQuery,u,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,o]),s=h.useCallback(u=>{e.setAdvancedFilters(u),o(e.searchQuery,e.activeFilter,u,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,o]),l=h.useCallback(()=>{const u=!e.sortAZ;e.setSortAZ(u),o(e.searchQuery,e.activeFilter,e.advancedFilters,!0,u)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,o]),d=h.useCallback(()=>{e.isLoading||o(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,o]),f=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:f,search:a,setFilter:i,applyAdvancedFilters:s,toggleSort:l,loadMore:d,refetch:()=>o(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ)}}const cr={card:"_card_jzciw_1",addBtn:"_addBtn_jzciw_17",dragging:"_dragging_jzciw_24",ctIcon:"_ctIcon_jzciw_29",info:"_info_jzciw_33",name:"_name_jzciw_41",meta:"_meta_jzciw_50",addBtnMuted:"_addBtnMuted_jzciw_78",added:"_added_jzciw_87",addedBadge:"_addedBadge_jzciw_96"},_I={video:Ji,pdf:ba,h5p:Gi,scorm:Ki,audio:Wi,quiz:Ri,default:Sn},TI=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:o})=>{var y,v;const a=le(),i=Ja(e),s=_I[i.key]??Sn,l=al(),d=e1(),f=l&&!o&&d,{attributes:u,listeners:m,setNodeRef:g,isDragging:w}=Hc({id:e.identifier,disabled:!n||!l||!d,data:{type:"library-item",item:e}}),p=()=>{r&&r(e)};return c.jsxs("div",{ref:g,className:[cr.card,w?cr.dragging:"",o?cr.added:""].join(" "),"aria-label":e.name,...n?{...u,...m}:{},role:"listitem",onClick:p,children:[c.jsx("span",{className:[`sbx-ct-sq--${i.key}`,cr.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(s,{size:14})}),c.jsxs("div",{className:cr.info,children:[c.jsx("span",{className:cr.name,title:e.name,children:e.name}),c.jsxs("span",{className:cr.meta,children:[((y=e.organisation)==null?void 0:y[0])??e.channel??"",(v=e.organisation)!=null&&v[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]})]}),o&&c.jsx("span",{className:cr.addedBadge,"aria-label":a.libraryCard.alreadyAddedAriaLabel,title:a.libraryCard.alreadyAddedTitle,children:c.jsx(wn,{size:12})}),!o&&n&&c.jsx("button",{type:"button",className:[cr.addBtn,!f&&l?cr.addBtnMuted:""].join(" "),onClick:b=>{b.stopPropagation(),t(e)},disabled:!l,"aria-disabled":!f,"aria-label":a.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:l?d?a.libraryCard.addToUnitTitle:a.libraryCard.selectUnitToAddTitle:a.libraryCard.draftOnlyTitle,children:c.jsx(mo,{size:14})})]})},np={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},EI=({filters:e,active:t,onChange:r})=>{const n=le();return c.jsx("div",{className:np.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(o=>c.jsx("button",{type:"button",role:"radio","aria-checked":t===o.value,className:["sbx-chip",t===o.value?"filled":"outline",np.chip].join(" "),onClick:()=>r(o.value),children:o.label},o.value))})},it={panel:"_panel_1cl11_1",header:"_header_1cl11_10",headerTitle:"_headerTitle_1cl11_19",closeBtn:"_closeBtn_1cl11_25",body:"_body_1cl11_43",section:"_section_1cl11_59",sectionLabel:"_sectionLabel_1cl11_65",chips:"_chips_1cl11_73",chip:"_chip_1cl11_73",active:"_active_1cl11_96",footer:"_footer_1cl11_102",resetBtn:"_resetBtn_1cl11_112",applyBtn:"_applyBtn_1cl11_129"},II=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}],OI=new Set(["board","medium","gradeLevel","subject","topic"]),AI=({local:e,toggle:t})=>{const r=le(),n=rp();return n.length?c.jsxs("div",{className:it.section,children:[c.jsx("div",{className:it.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),c.jsx("div",{className:it.chips,children:n.map(o=>c.jsx("button",{type:"button",className:[it.chip,(e.primaryCategory??[]).includes(o)?it.active:""].join(" "),onClick:()=>t("primaryCategory",o),children:o},o))})]}):null},DI=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var y,v;const o=le(),a=ce(b=>b.editorConfig),i=ce(b=>b.searchFormConfig),s=ce(b=>b.contentFramework),l=ce(b=>b.contentTargetFWIds),{organisationFramework:d}=Ah(s??((y=a==null?void 0:a.context)==null?void 0:y.framework),l??((v=a==null?void 0:a.context)==null?void 0:v.targetFWIds)),[f,u]=h.useState(t),m=i!=null&&i.length?i.filter(b=>OI.has(b.code)).map(b=>({key:b.code,label:b.label||b.code})):II(o);h.useEffect(()=>{u(t)},[t]);const g=(b,C)=>{u(S=>{const T=S[b]??[],I=T.includes(C)?T.filter(k=>k!==C):[...T,C];return{...S,[b]:I}})},w=(d==null?void 0:d.categories)??[],p=b=>{var C;return((C=w.find(S=>S.code===b))==null?void 0:C.terms)??[]};return e?c.jsxs("div",{className:it.panel,role:"dialog","aria-label":o.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[c.jsxs("div",{className:it.header,children:[c.jsx("span",{className:it.headerTitle,children:o.libraryFilterPanel.filtersHeaderTitle}),c.jsx("button",{type:"button",className:it.closeBtn,onClick:n,"aria-label":o.libraryFilterPanel.closeFiltersAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsxs("div",{className:it.body,children:[m.map(({key:b,label:C})=>{const S=p(b);return S.length?c.jsxs("div",{className:it.section,children:[c.jsx("div",{className:it.sectionLabel,children:C}),c.jsx("div",{className:it.chips,children:S.slice(0,20).map(T=>c.jsx("button",{type:"button",className:[it.chip,(f[b]??[]).includes(T.name)?it.active:""].join(" "),onClick:()=>g(b,T.name),children:T.name},T.identifier))})]},b):null}),c.jsx(AI,{local:f,toggle:g})]}),c.jsxs("div",{className:it.footer,children:[c.jsx("button",{type:"button",className:it.resetBtn,onClick:()=>u({}),children:o.libraryFilterPanel.resetButton}),c.jsx("button",{type:"button",className:it.applyBtn,onClick:()=>{r(f),n()},children:o.libraryFilterPanel.applyButton})]})]}):null},vr={header:"_header_6qdpu_10",title:"_title_6qdpu_20",headerActions:"_headerActions_6qdpu_31",iconBtn:"_iconBtn_6qdpu_38",playerArea:"_playerArea_6qdpu_56",footer:"_footer_6qdpu_64",addBtn:"_addBtn_6qdpu_73",modalOverlay:"_modalOverlay_6qdpu_92",modalPanel:"_modalPanel_6qdpu_103"},NI="application/vnd.sunbird.questionset",kI=({content:e,editorMode:t,onAdd:r,onClose:n})=>{const o=le(),a=t==="edit";if(!e)return null;const i={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return Pe.createPortal(c.jsx("div",{className:vr.modalOverlay,role:"dialog","aria-modal":"true","aria-label":o.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:c.jsxs("div",{className:vr.modalPanel,onClick:s=>s.stopPropagation(),children:[c.jsxs("div",{className:vr.header,children:[c.jsx("span",{className:vr.title,title:e.name,children:e.name}),c.jsx("div",{className:vr.headerActions,children:c.jsx("button",{type:"button",className:vr.iconBtn,onClick:n,"aria-label":o.libraryPreviewPanel.closePreviewAriaLabel,children:c.jsx(yr,{size:16})})})]}),c.jsx("div",{className:vr.playerArea,children:c.jsx(El,{node:i,editorMode:"read",type:e.mimeType===NI?"quml":"content"})}),a&&c.jsx("div",{className:vr.footer,children:c.jsx("button",{type:"button",className:vr.addBtn,onClick:()=>r(e),children:o.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},Ue={dock:"_dock_1lpg0_1",header:"_header_1lpg0_8",headerLeft:"_headerLeft_1lpg0_17",headerTitle:"_headerTitle_1lpg0_24",count:"_count_1lpg0_30",searchRow:"_searchRow_1lpg0_39",searchWrap:"_searchWrap_1lpg0_47",searchIcon:"_searchIcon_1lpg0_53",searchInput:"_searchInput_1lpg0_62",filterToggleBtn:"_filterToggleBtn_1lpg0_80",filterToggleBtnActive:"_filterToggleBtnActive_1lpg0_99",filterBadge:"_filterBadge_1lpg0_105",filters:"_filters_1lpg0_124",mainArea:"_mainArea_1lpg0_134",sidePanelOverlay:"_sidePanelOverlay_1lpg0_143",cardList:"_cardList_1lpg0_152",skeleton:"_skeleton_1lpg0_168",skeletonIcon:"_skeletonIcon_1lpg0_178",skeletonText:"_skeletonText_1lpg0_186",skeletonLine:"_skeletonLine_1lpg0_193",skeletonLineSm:"_skeletonLineSm_1lpg0_200",loadMoreBtn:"_loadMoreBtn_1lpg0_215",emptyState:"_emptyState_1lpg0_240",collapseBtn:"_collapseBtn_1lpg0_260"};function xI(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 LI=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=le(),{content:o,isLoading:a,totalCount:i,activeFilter:s,searchQuery:l,sortAZ:d,hasMore:f,search:u,setFilter:m,applyAdvancedFilters:g,toggleSort:w,loadMore:p}=SI(),{addResource:y,selectedNodeId:v,treeData:b}=Ae(),C=e==="edit",[S,T]=h.useState(!1),[I,k]=h.useState({}),[x,$]=h.useState(null),j=h.useMemo(()=>xI(b),[b]),N=h.useCallback(V=>{var Ee;if(!v){Ie.error(n.libraryDock.selectUnitFirstToast);return}const X=(Ee=b[0])==null?void 0:Ee.id;if(v===X){Ie(n.libraryDock.selectUnitFromOutlineToast,{icon:c.jsx(Qi,{size:16}),duration:4e3});return}if(y(V,v)===!1){Ie.error(n.libraryDock.itemAlreadyAddedToast.replace("{name}",V.name));return}Ie.success(n.libraryDock.itemAddedToast.replace("{name}",V.name))},[v,y,b,n]),L=h.useCallback(V=>{k(V),g(V)},[g]),B=h.useCallback(V=>{$(V)},[]),P=h.useCallback(V=>{N(V),$(null)},[N]),F=h.useMemo(()=>Object.values(I).reduce((V,X)=>V+((X==null?void 0:X.length)??0),0),[I]);return c.jsxs("div",{className:Ue.dock,children:[c.jsx("div",{className:Ue.header,children:c.jsxs("div",{className:Ue.headerLeft,children:[c.jsx("button",{type:"button",className:Ue.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:c.jsx(Uy,{size:15})}),c.jsx(By,{size:16}),c.jsx("span",{className:Ue.headerTitle,children:n.libraryDock.headerTitle}),i>0&&c.jsx("span",{className:Ue.count,children:i})]})}),c.jsxs("div",{className:Ue.searchRow,children:[c.jsxs("div",{className:Ue.searchWrap,children:[c.jsx(Yi,{size:14,className:Ue.searchIcon}),c.jsx("input",{type:"search",className:Ue.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:l,onChange:V=>u(V.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),c.jsx("button",{type:"button",className:[Ue.filterToggleBtn,d?Ue.filterToggleBtnActive:""].join(" "),onClick:w,"aria-label":d?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:d?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:d?c.jsx(Oy,{size:15}):c.jsx(xy,{size:15})}),c.jsxs("button",{type:"button",className:[Ue.filterToggleBtn,S?Ue.filterToggleBtnActive:""].join(" "),onClick:()=>T(V=>!V),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":S,title:n.libraryDock.advancedFiltersTitle,children:[c.jsx(Wy,{size:15}),F>0&&c.jsx("span",{className:Ue.filterBadge,children:F})]})]}),c.jsx("div",{className:Ue.filters,children:c.jsx(EI,{filters:t1,active:s,onChange:m})}),c.jsxs("div",{className:Ue.mainArea,children:[c.jsx("div",{className:Ue.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:a&&o.length===0?Array.from({length:4}).map((V,X)=>c.jsxs("div",{className:Ue.skeleton,"aria-hidden":"true",children:[c.jsx("div",{className:Ue.skeletonIcon}),c.jsxs("div",{className:Ue.skeletonText,children:[c.jsx("div",{className:Ue.skeletonLine}),c.jsx("div",{className:Ue.skeletonLineSm})]})]},X)):o.length>0?c.jsxs(c.Fragment,{children:[o.map(V=>c.jsx(TI,{item:V,onAdd:N,onPreview:B,isDraggable:C,isAdded:j.has(V.identifier)},V.identifier)),f&&c.jsx("button",{type:"button",className:Ue.loadMoreBtn,onClick:p,disabled:a,"aria-label":n.libraryDock.loadMoreAriaLabel,children:a?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):c.jsxs("div",{className:Ue.emptyState,children:[c.jsx(Yi,{size:24}),c.jsx("p",{children:n.libraryDock.noContentFound}),c.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})}),S&&c.jsx("div",{className:Ue.sidePanelOverlay,children:c.jsx(DI,{isOpen:S,filters:I,onApply:L,onClose:()=>T(!1)})}),x&&c.jsx(kI,{content:x,editorMode:e,onAdd:P,onClose:()=>$(null)})]})]})};function PI(e,t,r){const n={},o={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),s=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","dialcodes"]),l=new Set(["copyrightYear","compatibilityLevel","version"]);function d(m,g=!1){const w={};for(const[p,y]of Object.entries(m))if(!a.has(p)&&!(g&&i.has(p)))if(s.has(p))Array.isArray(y)?w[p]=y:y!=null&&y!==""?w[p]=[y]:w[p]=[];else if(l.has(p)){const v=Number(y);isNaN(v)||(w[p]=v)}else w[p]=y;return w}function f(m){var w;const g={};for(const p of m.children??[]){if(p.isFolder)continue;const y=t[p.identifier];if(!y)continue;const{isNew:v,...b}=y;if(Object.keys(b).length===0)continue;const C=((w=p.metadata)==null?void 0:w.relationalMetadata)??{};g[p.identifier]={name:p.name,...C,...b}}return g}function u(m,g){var C,S;const w=m.identifier,p=t[w],y=w.startsWith("temp-")||!!(p!=null&&p.isNew),v=!m.isFolder&&!g;if(g||y||p&&!v){let T;if(y)T={mimeType:"application/vnd.ekstep.content-collection",code:w,contentType:((C=m.metadata)==null?void 0:C.contentType)??"CourseUnit",primaryCategory:((S=m.metadata)==null?void 0:S.primaryCategory)??"Course Unit",name:m.name,visibility:"Parent",channel:r,...d(m.metadata??{})};else if(g){const{isNew:I,...k}=p??{};T={...d(m.metadata??{},!0),...d(k,!1),name:m.name}}else{const{isNew:I,...k}=p??{};T={name:m.name,visibility:"Parent",...d(k,!0)}}n[w]={metadata:T,objectType:m.objectType||(m.isFolder?"Collection":"Content"),root:g,isNew:y}}const b=m.isFolder?f(m):{};o[w]={name:m.name,children:(m.children??[]).map(T=>T.identifier),...Object.keys(b).length>0?{relationalMetadata:b}:{},root:g},(m.children??[]).forEach(T=>u(T,!1))}return e.forEach((m,g)=>u(m,g===0)),{nodesModified:n,hierarchy:o}}function FI(){const[e,t]=h.useState(!1),r=Ae(f=>f.treeCache),n=Ae(f=>f.treeData),o=ce(f=>f.isDirty),a=ce(f=>f.lastSaved),{setIsDirty:i,setLastSaved:s}=ce(),l=ce(f=>f.editorConfig);return{save:h.useCallback(async()=>{if(!l||e)return;const f=l.context.contentId??l.context.identifier??"";if(!f)return;const u=l.context.channel??"",m=l.context.userId??l.context.uid??"";t(!0);try{const{nodesModified:g,hierarchy:w}=PI(n,r,u),{identifiers:p}=await Iw(f,g,w,m);p&&Object.keys(p).length>0&&Ae.getState().replaceNodeIds(p);const y=new Date().toISOString();s(y),i(!1)}catch(g){console.error("[useSaveHierarchy] save failed:",g),Ie.error("Failed to save. Please try again.")}finally{t(!1)}},[l,e,n,r,i,s]),isSaving:e,isDirty:o,lastSaved:a}}const MI={};function $I(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function BI(e,t,r,n,o){const a=[],i=(s,l)=>{var d;for(const f of s){const u=l&&!f.parent,m=u?r:f.isFolder?n:null;if(m&&m.length>0){const g={...f.metadata??{},...t[f.id]??{}},p=Nh(m,g,MI,u,o).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&$I(y.currentValue)).map(y=>y.label);p.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:p})}(d=f.children)!=null&&d.length&&i(f.children,!1)}};return i(e,!0),a}function jI(e){const t=ce(u=>u.editorConfig),r=ce(u=>u.setButtonLoader),n=ce(u=>u.validateAllForms),o=ce(u=>u.rootFormConfig),a=ce(u=>u.unitFormConfig),i=Ae(u=>u.treeData),s=Ae(u=>u.treeCache),l=Ae(u=>u.selectNode),d=h.useCallback(()=>{var p,y,v;const u={editorMode:"edit",objectType:(p=t==null?void 0:t.config)==null?void 0:p.objectType,userFullName:(v=(y=t==null?void 0:t.context)==null?void 0:y.user)==null?void 0:v.fullName},m=BI(i,s,o,a,u);if(m.length===0)return!0;const g=m[0];Ie.error(`"${g.nodeName}": please fill required field${g.missing.length>1?"s":""} — ${g.missing.join(", ")}`);const{setFormStatus:w}=ce.getState();return m.forEach(b=>w(b.nodeId,!1)),l(g.nodeId),!1},[i,s,o,a,t,l]);return{runAction:h.useCallback(async(u,m)=>{var p,y,v,b;const g=((p=t==null?void 0:t.context)==null?void 0:p.contentId)??((y=t==null?void 0:t.context)==null?void 0:y.identifier)??"";if(!g)return Ie.error("No content identifier found."),!1;const w=((v=t==null?void 0:t.context)==null?void 0:v.userId)??((b=t==null?void 0:t.context)==null?void 0:b.uid)??"";try{switch(u){case"sendForReview":return d()?n(i)?(r("saveCollection",!0),await e(),await Dw(g),Ie.success("Content sent for review"),!0):(Ie.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{r("rejectCollection",!0);const C=(m==null?void 0:m.comment)??"";return await Nw(g,C),Ie.success("Content rejected and sent back to the author"),!0}case"publish":return d()?n(i)?(r("publishCollection",!0),await e(),await Ow(g,w),Ie.success("Content published successfully"),!0):(Ie.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(C){console.error(`[useToolbarActions] ${u} failed`,C);const S=u==="sendForReview"?"send for review":u==="reject"?"reject":"publish";return Ie.error(`Failed to ${S}. Please try again.`),!1}finally{r("saveCollection",!1),r("rejectCollection",!1),r("publishCollection",!1)}},[t,e,r,d,n,i]),checkRequiredFields:d}}const Bt={shell:"_shell_90fon_1",workspace:"_workspace_90fon_8",sidebarCollapsed:"_sidebarCollapsed_90fon_16",dockCollapsed:"_dockCollapsed_90fon_19",dock:"_dock_90fon_19",outline:"_outline_90fon_40",reopenTab:"_reopenTab_90fon_45",outlineHidden:"_outlineHidden_90fon_79",editor:"_editor_90fon_86",dockHidden:"_dockHidden_90fon_101",dockReopenTab:"_dockReopenTab_90fon_108",dragChip:"_dragChip_90fon_133",dragChipLabel:"_dragChipLabel_90fon_148"},qI=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const o=le(),[a,i]=h.useState(null),[s,l]=h.useState(!1),[d,f]=h.useState(!1),[u,m]=h.useState(!1),{addResource:g,treeData:w}=Ae(),p=ce(F=>F.setFormStatus),[y,v]=h.useState(!0),b=Ae(F=>F.selectedNodeId),{save:C,isSaving:S,isDirty:T,lastSaved:I}=FI(),{runAction:k,checkRequiredFields:x}=jI(C);h.useEffect(()=>{if(!T)return;const F=V=>{V.preventDefault(),V.returnValue=""};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[T]);const $=fc(Pi(pa,{activationConstraint:{distance:8}})),j=h.useCallback(F=>{var X;const V=(X=F.active.data.current)==null?void 0:X.item;V&&i(V)},[]),N=h.useCallback(F=>{var ue,Q;i(null);const V=(ue=F.active.data.current)==null?void 0:ue.item;if(!V)return;const X=F.over,ve=(X==null?void 0:X.id)??b??void 0;if(!ve){Ie.error(o.splitBuilderShell.dropOntoUnitError);return}const Ee=(Q=w[0])==null?void 0:Q.id;if(ve===Ee){Ie.error(o.splitBuilderShell.dropOntoCourseError);return}if(!g(V,ve)){Ie.error(o.splitBuilderShell.alreadyInCollectionError.replace("{name}",V.name));return}r==null||r(V,ve),Ie.success(o.splitBuilderShell.addedToUnitSuccess.replace("{name}",V.name))},[b,g,r,o]),L=h.useCallback(async F=>{if(F.action==="onFormStatusChange"){const{isValid:V,nodeId:X}=F.data??{},ve=V!==!1;v(ve),X&&p(X,ve);return}if(F.action==="back"&&T&&e==="edit"){m(!0);return}if(F.action==="saveCollection"){if(!y){Ie.error(o.splitBuilderShell.fillRequiredMetadataError);return}if(!x())return;await C(),n==null||n(w),t==null||t(F);return}if(F.action==="sendForReview"||F.action==="reject"||F.action==="publish"){await k(F.action,F.data)&&(t==null||t(F));return}t==null||t(F)},[C,k,x,t,n,w,T,y,e,o]),B=h.useCallback(async()=>{if(!x()){m(!1);return}await C(),m(!1),n==null||n(w),t==null||t({action:"back"})},[C,x,n,t,w]),P=h.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return c.jsxs(zc,{sensors:$,onDragStart:j,onDragEnd:N,children:[c.jsxs("div",{className:Bt.shell,children:[c.jsx(Uw,{editorMode:e,isSaving:S,isDirty:T,lastSaved:I,isFormValid:y,onToolbarEvent:L}),c.jsxs("div",{className:[Bt.workspace,s?Bt.sidebarCollapsed:"",d?Bt.dockCollapsed:""].filter(Boolean).join(" "),children:[c.jsx("aside",{className:[Bt.outline,s?Bt.outlineHidden:""].join(" "),"aria-label":o.splitBuilderShell.outlineAriaLabel,"aria-hidden":s,children:c.jsx(u1,{editorMode:e,collapsed:s,onToggleCollapse:()=>l(F=>!F)})}),s&&c.jsx("button",{className:Bt.reopenTab,onClick:()=>l(!1),title:o.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),c.jsx("main",{className:Bt.editor,role:"main","aria-label":o.splitBuilderShell.editorAriaLabel,children:c.jsx(wI,{editorMode:e,onToolbarEvent:L})}),c.jsx("aside",{className:[Bt.dock,d?Bt.dockHidden:""].filter(Boolean).join(" "),"aria-label":o.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:c.jsx(LI,{editorMode:e,collapsed:d,onToggleCollapse:()=>f(F=>!F)})}),d&&c.jsx("button",{className:Bt.dockReopenTab,onClick:()=>f(!1),title:o.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),c.jsx(Sy,{dropAnimation:null,children:a?c.jsx("div",{className:Bt.dragChip,children:c.jsx("span",{className:Bt.dragChipLabel,children:a.name})}):null}),u&&c.jsx(zw,{onSave:B,onDiscard:P,onCancel:()=>m(!1),isSaving:S})]})},UI="v1";function zI(e){const t=e.validations,r=t==null?void 0:t.find(o=>o.type==="maxlength"||o.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function op(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:zI(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function Lr(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const o=n.name??void 0,a=n.fields.filter(i=>!!i.code).sort((i,s)=>(i.index??0)-(s.index??0));for(const i of a)r.push(op(i,o))}else n.code&&r.push(op(n));return r}function VI(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,o]of Object.entries(t))o&&"default"in o&&(r[n]=o.default);return r}async function HI(e,t,r="Collection",n=UI){var d,f;const a=(f=(d=(await ke.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:d.result)==null?void 0:f.objectCategoryDefinition,i=(a==null?void 0:a.forms)??{},s=(a==null?void 0:a.objectMetadata)??{},l=s.config??{};return{rootForm:Lr(i.create),unitForm:Lr(i.unitMetadata),childForm:Lr(i.childMetadata),searchForm:Lr(i.search??i.searchConfig),relationalForm:Lr(i.relationalMetadata),publishChecklist:Lr(i.publishchecklist),reviewChecklist:Lr(i.review),rfcChecklist:Lr(i.requestforchangeschecklist),schemaDefaults:VI(s.schema),frameworkMetadata:l.frameworkMetadata??{},sourcingSettings:l.sourcingSettings??{}}}function RI({config:e,onError:t}){const[r,n]=h.useState(!0),[o,a]=h.useState(null),[i,s]=h.useState(!1),{setEditorConfig:l,setEditorMode:d,setCategoryDefinition:f,setContentFramework:u}=ce(),{setTreeData:m,selectNode:g}=Ae();return h.useEffect(()=>{let w=!1;async function p(){var y,v;try{n(!0),a(null),e.apiBaseUrl&&ou(e.apiBaseUrl),l(e),d(e.config.mode);const b=e.context.contentId??e.context.identifier??"";if(b){const C=e.config.objectType==="QuestionSet",{rootNode:S}=C?await Ew(b):await lu(b);if(!w&&(m(S?[S]:[]),S)){g(S.id);const $=S.metadata??{},j=$.framework??e.context.framework??null,N=$.targetFWIds??e.context.targetFWIds??null;u(j,N)}const T=e.config.primaryCategory??"Course",I=e.context.channel??"",k=e.config.categoryDefinitionApiVersion??"v1";try{const x=await HI(T,I,e.config.objectType??"Collection",k);if(!w){f(x);const $=((y=x.sourcingSettings)==null?void 0:y.collection)??{},j={};$.maxDepth&&!e.config.maxDepth&&(j.maxDepth=$.maxDepth),$.children&&!e.config.children&&(j.children=$.children),$.hierarchy&&!((v=e.config.hierarchy)!=null&&v.level1)&&(j.hierarchy={...e.config.hierarchy??{},...$.hierarchy}),Object.keys(j).length>0&&l({...e,config:{...e.config,...j}})}}catch{}}w||s(!0)}catch(b){if(!w){const C=b instanceof Error?b:new Error(String(b));a(C),t==null||t(C)}}finally{w||n(!1)}}return p(),()=>{w=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:o,isReady:i}}function QI(){const e=_a(t=>t.setLanguage);h.useEffect(()=>{e(localStorage.getItem(ls)||"en",{broadcast:!1});const t=n=>{n.key===ls&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var a;const o=(a=n.detail)==null?void 0:a.lang;o&&e(o,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(cs,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(cs,r)}},[e])}const Bo={root:"_root_qcpw6_1",loadingState:"_loadingState_qcpw6_10",loadingSpinner:"_loadingSpinner_qcpw6_20",errorState:"_errorState_qcpw6_34"},GI=new Wp({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function WI({error:e,onRetry:t}){const r=le();return c.jsxs("div",{className:Bo.errorState,children:[c.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),c.jsx("p",{children:e.message}),c.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class KI extends h.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?c.jsx(WI,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function YI(e){QI();const t=le(),{isLoading:r,error:n}=RI({config:e,onError:e.onError}),o=ce(a=>a.editorMode);return r?c.jsxs("div",{className:Bo.loadingState,children:[c.jsx("div",{className:Bo.loadingSpinner}),c.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?c.jsxs("div",{className:Bo.errorState,children:[c.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),c.jsx("p",{children:n.message})]}):c.jsx("div",{className:`sb-split-builder ${Bo.root}`,children:c.jsx(qI,{editorMode:o,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const ap=e=>c.jsx(KI,{onError:e.onError,children:c.jsxs(Yp,{client:GI,children:[c.jsx(YI,{...e}),c.jsx(Kg,{position:"top-right",toastOptions:{duration:3e3}})]})}),fi=Symbol.for("r2wc.reactRender"),ip=Symbol.for("r2wc.shouldRender"),hi=Symbol.for("r2wc.root");function ZI(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function XI(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var sp={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[fi]()}}),e[fi]()}};function JI(e,t,r,n={}){var o={isConnected:"isConnected"in HTMLElement.prototype},a=!1,i=function(){var d=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?d.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),d.attachShadow({mode:"open"})),d},s=Object.create(HTMLElement.prototype);s.constructor=i;var l=new Proxy(s,{has:function(d,f){return f in e.propTypes||f in s},set:function(d,f,u,m){return a&&(o[f]=!0),typeof f=="symbol"||o[f]||f in d?(e.propTypes&&f in e.propTypes&&sp.expando(m,f,u),Reflect.set(d,f,u,m)):(sp.expando(m,f,u),!0)},getOwnPropertyDescriptor:function(d,f){var u=Reflect.getOwnPropertyDescriptor(d,f);if(u)return u;if(f in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return i.prototype=l,s.connectedCallback=function(){this[ip]=!0,this[fi]()},s.disconnectedCallback=function(){typeof r.createRoot=="function"?this[hi].unmount():r.unmountComponentAtNode(this)},s[fi]=function(){if(this[ip]===!0){var d={};Object.keys(this).forEach(function(m){o[m]!==!1&&(d[m]=this[m])},this),a=!0;const f=n.shadow?this.shadowRoot:this,u=t.createElement(e,d);typeof r.createRoot=="function"?(this[hi]||(this[hi]=r.createRoot(f)),this[hi].render(u)):r.render(u,f),a=!1}},e.propTypes&&(i.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return ZI(d)}):Object.keys(e.propTypes),s.attributeChangedCallback=function(d,f,u){var m=n.dashStyleAttributes?XI(d):d;this[m]=u}),i}var jo={},qo=Pe;if(process.env.NODE_ENV==="production")jo.createRoot=qo.createRoot,jo.hydrateRoot=qo.hydrateRoot;else{var pi=qo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;jo.createRoot=function(e,t){pi.usingClientEntryPoint=!0;try{return qo.createRoot(e,t)}finally{pi.usingClientEntryPoint=!1}},jo.hydrateRoot=function(e,t,r){pi.usingClientEntryPoint=!0;try{return qo.hydrateRoot(e,t,r)}finally{pi.usingClientEntryPoint=!1}}}function eO(){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 tO(e="sb-collection-editor"){if(eO(),typeof customElements>"u"||customElements.get(e))return;const t=JI(ap,h,jo,{});customElements.define(e,t)}me.CollectionEditor=ap,me.registerCollectionEditor=tO,me.setApiBaseUrl=ou,me.useEditorStore=ce,me.useLibraryStore=tp,me.useTreeStore=Ae,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
|
|
496
|
+
`+a)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Wr(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:a}=r;n!==void 0&&xa.assertOptions(n,{silentJSONParsing:mt.transitional(mt.boolean),forcedJSONParsing:mt.transitional(mt.boolean),clarifyTimeoutError:mt.transitional(mt.boolean),legacyInterceptorReqResOrdering:mt.transitional(mt.boolean),advertiseZstdAcceptEncoding:mt.transitional(mt.boolean),validateStatusUndefinedResolves:mt.transitional(mt.boolean)},!1),o!=null&&(O.isFunction(o)?r.paramsSerializer={serialize:o}:xa.assertOptions(o,{encode:mt.function,serialize:mt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),xa.assertOptions(r,{baseUrl:mt.spelling("baseURL"),withXsrfToken:mt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&O.merge(a.common,a[r.method]);a&&O.forEach(["delete","get","head","post","put","patch","query","common"],w=>{delete a[w]}),r.headers=gt.concat(i,a);const s=[];let l=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(r)===!1)return;l=l&&p.synchronous;const y=r.transitional||ms;y&&y.legacyInterceptorReqResOrdering?s.unshift(p.fulfilled,p.rejected):s.push(p.fulfilled,p.rejected)});const d=[];this.interceptors.response.forEach(function(p){d.push(p.fulfilled,p.rejected)});let f,u=0,m;if(!l){const w=[eu.bind(this),void 0];for(w.unshift(...s),w.push(...d),m=w.length,f=Promise.resolve(r);u<m;)f=f.then(w[u++],w[u++]);return f}m=s.length;let g=r;for(;u<m;){const w=s[u++],p=s[u++];try{g=w(g)}catch(y){p.call(this,y);break}}try{f=eu.call(this,g)}catch(w){return Promise.reject(w)}for(u=0,m=d.length;u<m;)f=f.then(d[u++],d[u++]);return f}getUri(t){t=Wr(this.defaults,t);const r=Hd(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Pd(r,t.params,t.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(t){Kr.prototype[t]=function(r,n){return this.request(Wr(n||{},{method:t,url:r,data:n&&O.hasOwnProp(n,"data")?n.data:void 0}))}}),O.forEach(["post","put","patch","query"],function(t){function r(n){return function(a,i,s){return this.request(Wr(s||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Kr.prototype[t]=r(),t!=="query"&&(Kr.prototype[t+"Form"]=r(!0))});let mw=class _p{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const n=this;this.promise.then(o=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](o);n._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{n.subscribe(s),a=s}).then(o);return i.cancel=function(){n.unsubscribe(a)},i},t(function(a,i,s){n.reason||(n.reason=new _o(a,i,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new _p(function(o){t=o}),cancel:t}}};function yw(e){return function(r){return e.apply(null,r)}}function vw(e){return O.isObject(e)&&e.isAxiosError===!0}const _s={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(_s).forEach(([e,t])=>{_s[t]=e});function ru(e){const t=new Kr(e),r=yd(Kr.prototype.request,t);return O.extend(r,Kr.prototype,t,{allOwnKeys:!0}),O.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return ru(Wr(e,o))},r}const Je=ru(So);Je.Axios=Kr,Je.CanceledError=_o,Je.CancelToken=mw,Je.isCancel=jd,Je.VERSION=ws,Je.toFormData=Oa,Je.AxiosError=Z,Je.Cancel=Je.CanceledError,Je.all=function(t){return Promise.all(t)},Je.spread=yw,Je.isAxiosError=vw,Je.mergeConfig=Wr,Je.AxiosHeaders=gt,Je.formToJSON=e=>Bd(O.isHTMLForm(e)?new FormData(e):e),Je.getAdapter=Jd.getAdapter,Je.HttpStatusCode=_s,Je.default=Je;const{Axios:ak,AxiosError:ik,CanceledError:sk,isCancel:lk,CancelToken:ck,VERSION:dk,all:uk,Cancel:fk,isAxiosError:hk,spread:pk,toFormData:gk,AxiosHeaders:mk,HttpStatusCode:yk,formToJSON:vk,getAdapter:bk,mergeConfig:wk,create:Ck}=Je;let Ts="";function nu(e){Ts=e}const ke=Je.create({timeout:3e4});ke.interceptors.request.use(async e=>{var o;const{useEditorStore:t}=await Promise.resolve().then(()=>fv),n=(o=t.getState().editorConfig)==null?void 0:o.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),Ts&&(e.baseURL=Ts),e});const ou=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function bw(e,t={}){var l,d,f,u;const n={"organisations.roles":[((l=t.objectType)==null?void 0:l.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const o=e.includes("@"),a=/^\d{10,}$/.test(e.trim()),i={filters:n,fields:ou,offset:0,limit:t.limit??200};return o?n.email=e.trim():a?n.phone=e.trim():i.query=e,((u=(f=(d=(await ke.post("/action/user/v1/search",{request:i},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:d.result)==null?void 0:f.response)==null?void 0:u.content)??[]}async function ww(e){var r,n,o;return e.length?((o=(n=(r=(await ke.post("/action/user/v1/search",{request:{filters:{userId:e},fields:ou,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:o.content)??[]:[]}async function Cw(e){var r,n;return((n=(r=(await ke.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const au="/portal";async function iu(e){var n,o,a,i,s,l,d;const t=await ke.get(`${au}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(n=t.data)==null?void 0:n.result)==null?void 0:o.questionset;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((l=(s=t.data)==null?void 0:s.params)==null?void 0:l.err)||((d=t.data)==null?void 0:d.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${f}`)}return r}async function Sw(e){var r,n;return e.length?((n=(r=(await ke.post(`${au}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Es(e,t){const r=e??{},n=r.identifier??"",o=r.objectType??"",a=r.mimeType??"",i=r.children,s=Array.isArray(i)?i.map(d=>Es(d,n)):[],l=a==="application/vnd.ekstep.content-collection"||o.toLowerCase().includes("unit")||o.toLowerCase().includes("textbook")||o.toLowerCase().includes("collection")||o.toLowerCase().includes("course")||o.toLowerCase().includes("lesson")||r.visibility==="Parent"||a==="application/vnd.sunbird.questionset"&&s.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:o,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:l,children:s,metadata:r,parent:t}}async function su(e){var o,a,i,s,l,d,f;const t=await ke.get(`/action/content/v3/hierarchy/${e}`,{params:{mode:"edit"}}),r=(a=(o=t.data)==null?void 0:o.result)==null?void 0:a.content;if(!r||!r.identifier){const u=((s=(i=t.data)==null?void 0:i.params)==null?void 0:s.errmsg)||((d=(l=t.data)==null?void 0:l.params)==null?void 0:d.err)||((f=t.data)==null?void 0:f.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${u}`)}const n=Es(r);return{content:r,rootNode:n}}async function _w(e){const t=await iu(e),r=Es(t);return{content:t,rootNode:r}}async function Tw(e,t,r,n){var a;return((a=(await ke.patch("/action/content/v3/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:a.result)??{}}async function Ew(e,t=""){await ke.post(`/action/content/v3/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function Iw(e){var r,n;return(n=(r=(await ke.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function Ow(e){await ke.post(`/action/content/v3/review/${e}`,{request:{content:{}}})}async function Aw(e,t){await ke.post(`/action/content/v3/reject/${e}`,{request:{content:{rejectComment:t}}})}async function Dw(e,t){await ke.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const De={container:"_container_r27rp_1",header:"_header_r27rp_13",title:"_title_r27rp_22",closeBtn:"_closeBtn_r27rp_29",body:"_body_r27rp_45",label:"_label_r27rp_54",searchSection:"_searchSection_r27rp_62",searchRow:"_searchRow_r27rp_68",searchInput:"_searchInput_r27rp_74",searchSpinner:"_searchSpinner_r27rp_89",resultsList:"_resultsList_r27rp_105",resultItem:"_resultItem_r27rp_118",userInfo:"_userInfo_r27rp_133",userName:"_userName_r27rp_141",userEmail:"_userEmail_r27rp_150",userOrg:"_userOrg_r27rp_158",noResults:"_noResults_r27rp_167",collabSection:"_collabSection_r27rp_174",sectionTitle:"_sectionTitle_r27rp_179",badge:"_badge_r27rp_189",emptyCollab:"_emptyCollab_r27rp_203",collabList:"_collabList_r27rp_214",collabItem:"_collabItem_r27rp_223",userAvatar:"_userAvatar_r27rp_237",error:"_error_r27rp_251",success:"_success_r27rp_257",footer:"_footer_r27rp_263"},Nw=({contentId:e,onClose:t})=>{var B,q;const r=ce(),n=le(N=>N.editorConfig),o=(B=n==null?void 0:n.context)==null?void 0:B.channel,a=(q=n==null?void 0:n.config)==null?void 0:q.objectType,[i,s]=h.useState(""),[l,d]=h.useState([]),[f,u]=h.useState(!1),[m,g]=h.useState([]),[w,p]=h.useState(!1),[y,v]=h.useState(""),[b,C]=h.useState(!1),S=h.useRef(null);h.useEffect(()=>{let N=!1;return(async()=>{try{const P=await Iw(e),M=(P==null?void 0:P.collaborators)??[];if(!M.length)return;const L=await ww(M);if(N)return;const F=M.map(z=>L.find(X=>X.identifier===z)??{identifier:z,firstName:z});g(F)}catch{}})(),()=>{N=!0}},[e]),h.useEffect(()=>{S.current&&clearTimeout(S.current);const N=i.trim();if(N.length<2){d([]);return}return S.current=setTimeout(async()=>{u(!0);try{const P=await bw(N,{rootOrgId:o,objectType:a}),M=new Set(m.map(L=>L.identifier));d(P.filter(L=>!M.has(L.identifier)))}catch{d([])}finally{u(!1)}},300),()=>{S.current&&clearTimeout(S.current)}},[i,m,o,a]);const T=h.useCallback(N=>{g(P=>P.find(M=>M.identifier===N.identifier)?P:[...P,N]),d(P=>P.filter(M=>M.identifier!==N.identifier)),C(!1)},[]),I=h.useCallback(N=>{g(P=>P.filter(M=>M.identifier!==N)),C(!1)},[]),k=h.useCallback(async()=>{p(!0),v(""),C(!1);try{await Dw(e,m.map(N=>N.identifier)),C(!0)}catch{v(r.manageCollaborators.saveFailed)}finally{p(!1)}},[e,m,r.manageCollaborators.saveFailed]),x=N=>`${N.firstName}${N.lastName?` ${N.lastName}`:""}`;return c.jsxs("div",{className:De.container,children:[c.jsxs("div",{className:De.header,children:[c.jsx("h2",{className:De.title,children:r.manageCollaborators.title}),c.jsx("button",{className:De.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:De.body,children:[c.jsxs("div",{className:De.searchSection,children:[c.jsx("label",{className:De.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),c.jsxs("div",{className:De.searchRow,children:[c.jsx("input",{id:"collab-search",type:"text",className:De.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:i,onChange:N=>s(N.target.value)}),f&&c.jsx("span",{className:De.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),l.length>0&&c.jsx("ul",{className:De.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:l.map(N=>{var P,M,L,F;return c.jsxs("li",{className:De.resultItem,role:"option","aria-selected":"false",children:[c.jsxs("div",{className:De.userInfo,children:[c.jsx("span",{className:De.userName,children:x(N)}),N.email&&c.jsx("span",{className:De.userEmail,children:N.email}),(((M=(P=N.organisations)==null?void 0:P[0])==null?void 0:M.orgName)??N.rootOrgName)&&c.jsx("span",{className:De.userOrg,children:((F=(L=N.organisations)==null?void 0:L[0])==null?void 0:F.orgName)??N.rootOrgName})]}),c.jsx($e,{variant:"primary",size:"sm",onClick:()=>T(N),children:r.manageCollaborators.add})]},N.identifier)})}),i.trim().length>=2&&!f&&l.length===0&&c.jsx("p",{className:De.noResults,children:r.manageCollaborators.noUsersFound})]}),c.jsxs("div",{className:De.collabSection,children:[c.jsxs("h3",{className:De.sectionTitle,children:[r.manageCollaborators.currentCollaborators,m.length>0&&c.jsx("span",{className:De.badge,children:m.length})]}),m.length===0?c.jsx("p",{className:De.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):c.jsx("ul",{className:De.collabList,children:m.map(N=>{var P,M,L,F;return c.jsxs("li",{className:De.collabItem,children:[c.jsx("div",{className:De.userAvatar,"aria-hidden":"true",children:x(N).charAt(0).toUpperCase()}),c.jsxs("div",{className:De.userInfo,children:[c.jsx("span",{className:De.userName,children:x(N)}),N.email&&c.jsx("span",{className:De.userEmail,children:N.email}),(((M=(P=N.organisations)==null?void 0:P[0])==null?void 0:M.orgName)??N.rootOrgName)&&c.jsx("span",{className:De.userOrg,children:((F=(L=N.organisations)==null?void 0:L[0])==null?void 0:F.orgName)??N.rootOrgName})]}),c.jsx($e,{variant:"danger",size:"sm",onClick:()=>I(N.identifier),children:r.manageCollaborators.remove})]},N.identifier)})})]}),y&&c.jsx("p",{className:De.error,role:"alert",children:y}),b&&c.jsx("p",{className:De.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),c.jsxs("div",{className:De.footer,children:[c.jsx($e,{variant:"ghost",onClick:t,disabled:w,children:r.manageCollaborators.cancel}),c.jsx($e,{variant:"primary",isLoading:w,onClick:k,children:r.manageCollaborators.save})]})]})};async function kw(e){return(await ke.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function xw(e,t){var o;const n=((o=(await ke.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:o.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function Lw(e){var n;const r=((n=(await ke.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const de={topbar:"_topbar_zj8wk_1",left:"_left_zj8wk_15",right:"_right_zj8wk_23",backBtn:"_backBtn_zj8wk_30",title:"_title_zj8wk_49",statusChip:"_statusChip_zj8wk_61",savedIndicator:"_savedIndicator_zj8wk_73",unsaved:"_unsaved_zj8wk_83",iconBtn:"_iconBtn_zj8wk_88",iconBtnLabel:"_iconBtnLabel_zj8wk_115",qrDropdown:"_qrDropdown_zj8wk_119",qrMenu:"_qrMenu_zj8wk_123",reviewBtns:"_reviewBtns_zj8wk_158",sourcingBtns:"_sourcingBtns_zj8wk_167",modalOverlay:"_modalOverlay_zj8wk_176",sbOverlay:"_sbOverlay_zj8wk_186",sbModal:"_sbModal_zj8wk_196",sbModalHeader:"_sbModalHeader_zj8wk_207",sbModalTitle:"_sbModalTitle_zj8wk_215",sbModalClose:"_sbModalClose_zj8wk_222",sbModalBody:"_sbModalBody_zj8wk_235",sbLabel:"_sbLabel_zj8wk_242",sbTextarea:"_sbTextarea_zj8wk_249",sbError:"_sbError_zj8wk_266",sbModalFooter:"_sbModalFooter_zj8wk_273"};function Pw(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function Fw(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const Mw=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:o="primary",onConfirm:a,onCancel:i})=>{const s=ce(),[l,d]=h.useState(""),f=e.toLowerCase().replace(/\s+/g,"-");return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${f}-title`,children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:`${f}-title`,className:de.sbModalTitle,children:e}),c.jsx("button",{className:de.sbModalClose,onClick:i,"aria-label":s.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:de.sbModalBody,children:[c.jsxs("label",{className:de.sbLabel,htmlFor:`${f}-comment`,children:[t," ",c.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("textarea",{id:`${f}-comment`,className:de.sbTextarea,placeholder:r,value:l,onChange:u=>d(u.target.value),rows:4,required:!0,"aria-required":"true"}),l.trim().length===0&&c.jsx("p",{className:de.sbError,children:s.reviewCommentModal.fillCommentsError})]}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:i,children:s.reviewCommentModal.cancelButton}),c.jsx($e,{variant:o,onClick:()=>a(l.trim()),disabled:l.trim().length===0,children:n})]})]})})},$w=({onConfirm:e,onCancel:t})=>{const r=ce(),[n,o]=h.useState(!1);return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:"review-confirm-title",className:de.sbModalTitle,children:r.confirmReviewModal.title}),c.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsx("div",{className:de.sbModalBody,children:c.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[c.jsx("input",{type:"checkbox",checked:n,onChange:a=>o(a.target.checked),style:{marginTop:2}}),c.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",c.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",c.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),c.jsx($e,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},Bw=({onConfirm:e,onCancel:t})=>{const r=ce(),[n,o]=h.useState(""),a=parseInt(n,10),i=!isNaN(a)&&a>=2&&a<=250;return c.jsx("div",{className:de.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:c.jsxs("div",{className:de.sbModal,children:[c.jsxs("div",{className:de.sbModalHeader,children:[c.jsx("span",{id:"genqr-title",className:de.sbModalTitle,children:r.generateQRModal.title}),c.jsx("button",{className:de.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),c.jsxs("div",{className:de.sbModalBody,children:[c.jsxs("label",{className:de.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",c.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),c.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:de.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:s=>o(s.target.value)}),n&&!i&&c.jsx("p",{className:de.sbError,children:r.generateQRModal.countRangeError})]}),c.jsxs("div",{className:de.sbModalFooter,children:[c.jsx($e,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),c.jsx($e,{variant:"primary",onClick:()=>e(a),disabled:!i,children:r.generateQRModal.generateButton})]})]})})},jw=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:o=!0,onToolbarEvent:a})=>{var ae,fe;const i=ce(),l=Ae(J=>J.treeData)[0],d=(l==null?void 0:l.name)??i.contextualEditor.untitledPlaceholder,f=Fw(((ae=l==null?void 0:l.metadata)==null?void 0:ae.status)??(l==null?void 0:l.status),i.topbar.draftStatusFallback),u=le(J=>{var oe,Me,Oe,Ve;return((Me=(oe=J.editorConfig)==null?void 0:oe.context)==null?void 0:Me.contentId)??((Ve=(Oe=J.editorConfig)==null?void 0:Oe.context)==null?void 0:Ve.identifier)??""}),{activeModal:m,modalData:g,closeModal:w,openModal:p}=mv(),y=le(J=>J.buttonLoaders),v=le(J=>J.categoryMeta),b=!v||v.schemaDefaults.generateDIALCodes!=="No",[C,S]=h.useState(!1),[T,I]=h.useState(!1),[k,x]=h.useState(!1),B=h.useRef(null),[q,N]=h.useState(!1);h.useEffect(()=>{if(!k)return;const J=oe=>{var Me;(Me=B.current)!=null&&Me.contains(oe.target)||x(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[k]);const[P,M]=h.useState(!1),[L,F]=h.useState(!1),{updateNode:z}=Ae(),X=(fe=l==null?void 0:l.metadata)==null?void 0:fe.qrCodeProcessId,ve=h.useCallback(async J=>{if(u){N(!1),M(!0);try{const{processId:oe,reservedDialcodes:Me}=await xw(u,J);oe&&l&&z(l.id,{qrCodeProcessId:oe,reservedDialcodes:Me}),Ie.success(i.topbar.qrGenerationStartedToast)}catch{Ie.error(i.topbar.qrGenerationFailedToast)}finally{M(!1)}}},[u,l,z,i]),Ee=h.useCallback(async()=>{if(!X){Ie.error(i.topbar.qrCodesNotGeneratedToast);return}F(!0);try{const J=await Lw(X);if(J.status==="in-process"){Ie(i.topbar.qrGenerationInProgressToast,{icon:c.jsx(Ri,{size:16})});return}const oe=J.url;if(!oe){Ie.error(i.topbar.qrCodesNotReadyToast);return}const Me=await fetch(oe).then(He=>He.blob()),Oe=await new Promise(He=>{const et=new FileReader;et.onloadend=()=>He(et.result),et.readAsDataURL(Me)}),Ve=(l==null?void 0:l.metadata)??{},We=He=>Array.isArray(He)?He.join("_"):typeof He=="string"?He:"",ze=[u,We(Ve.medium),We(Ve.gradeLevel),We(Ve.subject)].filter(Boolean),re=new Date().toISOString().replace(/[:.]/g,"-"),Ke=`${ze.join("_")}_${re}.zip`,Re=document.createElement("a");Re.href=Oe,Re.download=Ke,Re.style.display="none",document.body.appendChild(Re),Re.click(),document.body.removeChild(Re),Ie.success(i.topbar.qrCodesDownloadedToast)}catch{Ie.error(i.topbar.qrCodesDownloadFailedToast)}finally{F(!1)}},[X,l,u,i]),Ce=e==="edit",ue=e==="review",Q=e==="sourcingreview",ne=e==="read",te=h.useCallback((J,oe)=>{a({action:J,data:oe})},[a]),U=h.useCallback(()=>{w(),te("publish")},[w,te]),H=h.useCallback((J,oe)=>{const Me=g==null?void 0:g.action;w(),Me==="approve"?te("sourcingApprove",{comment:J,score:oe}):te("reject",{comment:J})},[w,te,g]);return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:de.topbar,role:"banner",children:[c.jsxs("div",{className:de.left,children:[c.jsx("button",{className:de.backBtn,onClick:()=>te("back"),"aria-label":i.topbar.backAriaLabel,type:"button",children:c.jsx(Oy,{size:18})}),c.jsx("h1",{className:de.title,title:d,children:d}),c.jsx("span",{className:`sbx-chip ${de.statusChip}`,"aria-label":`${i.topbar.statusAriaLabelPrefix} ${f}`,children:f})]}),c.jsxs("div",{className:de.right,children:[t?c.jsx("span",{className:de.savedIndicator,"aria-live":"polite",children:i.topbar.savingIndicator}):r&&Ce?c.jsx("span",{className:`${de.savedIndicator} ${de.unsaved}`,"aria-live":"polite",children:i.topbar.unsavedIndicator}):n?c.jsxs("span",{className:de.savedIndicator,"aria-live":"polite",children:[c.jsx(wn,{size:14,"aria-hidden":"true"}),i.topbar.savedIndicatorPrefix," ",Pw(n)]}):null,!ne&&!ue&&!Q&&f!=="Review"&&c.jsx("span",{title:o?void 0:i.topbar.fillRequiredFieldsTooltip,children:c.jsx($e,{variant:"ghost",size:"sm",onClick:()=>te("saveCollection"),disabled:!o,children:i.topbar.saveAsDraftButton})}),Ce&&c.jsxs(c.Fragment,{children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>I(!0),disabled:y.saveCollection,isLoading:y.saveCollection,children:[c.jsx(Gy,{size:14,"aria-hidden":"true"})," ",i.topbar.sendForReviewButton]}),c.jsx("button",{className:de.iconBtn,onClick:()=>p("manageCollaborators"),"aria-label":i.topbar.collaboratorsLabel,title:i.topbar.collaboratorsLabel,type:"button",children:c.jsx(Jy,{size:16,"aria-hidden":"true"})}),b&&c.jsxs("div",{className:de.qrDropdown,ref:B,children:[c.jsxs("button",{className:de.iconBtn,onClick:()=>x(J=>!J),"aria-label":i.topbar.qrCodesLabel,title:i.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":k,children:[c.jsx(Xc,{size:16,"aria-hidden":"true"}),c.jsx("span",{className:de.iconBtnLabel,children:i.topbar.qrCodesLabel}),c.jsx(Cn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),k&&c.jsxs("div",{className:de.qrMenu,role:"menu",children:[c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{x(!1),N(!0)},disabled:P,children:[c.jsx(Xc,{size:14}),P?i.topbar.generatingEllipsis:i.topbar.generateQrCodesMenuItem]}),c.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{x(!1),Ee()},disabled:L||!X,children:[c.jsx(Py,{size:14}),L?i.topbar.downloadingEllipsis:i.topbar.downloadQrCodesMenuItem]})]})]})]}),ue&&c.jsxs("div",{className:de.reviewBtns,children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("publishChecklist"),disabled:y.publishCollection,isLoading:y.publishCollection,children:[c.jsx(Gc,{size:14,"aria-hidden":"true"})," ",i.topbar.publishButton]}),c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>S(!0),disabled:y.rejectCollection,isLoading:y.rejectCollection,children:[c.jsx(Jc,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]}),Q&&c.jsxs("div",{className:de.sourcingBtns,children:[c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"approve"}),children:[c.jsx(Wy,{size:14,"aria-hidden":"true"})," ",i.topbar.approveButton]}),c.jsxs($e,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"reject"}),children:[c.jsx(Jc,{size:14,"aria-hidden":"true"})," ",i.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&c.jsx(Ev,{contentId:u,onConfirm:U,onCancel:w}),m==="qualityParams"&&c.jsx(Iv,{contentId:u,action:(g==null?void 0:g.action)??"reject",onConfirm:H,onCancel:w}),m==="manageCollaborators"&&c.jsx("div",{className:de.modalOverlay,role:"dialog","aria-modal":"true",children:c.jsx(Nw,{contentId:u,onClose:w})}),T&&c.jsx($w,{onConfirm:()=>{I(!1),te("sendForReview")},onCancel:()=>I(!1)}),C&&c.jsx(Mw,{titleText:i.topbar.requestChangesTitle,labelText:i.topbar.changesRequestedLabel,placeholderText:i.topbar.describeChangesPlaceholder,submitLabel:i.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:J=>{S(!1),te("reject",{comment:J})},onCancel:()=>S(!1)}),q&&c.jsx(Bw,{onConfirm:ve,onCancel:()=>N(!1)})]})},qw=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const o=ce();return Pe.createPortal(c.jsx("div",{className:Fe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:c.jsxs("div",{className:Fe.modal,children:[c.jsxs("div",{className:Fe.modalHeader,children:[c.jsx("span",{id:"unsaved-title",children:o.unsavedChangesModal.title}),c.jsx("button",{className:Fe.modalHeaderClose,onClick:r,"aria-label":o.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),c.jsx("div",{className:Fe.modalBody,children:c.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:o.unsavedChangesModal.bodyMessage})}),c.jsxs("div",{className:Fe.modalFooter,children:[c.jsx($e,{variant:"ghost",onClick:r,disabled:n,children:o.unsavedChangesModal.cancelButton}),c.jsx($e,{variant:"danger",onClick:t,disabled:n,children:o.unsavedChangesModal.discardButton}),c.jsx($e,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:o.unsavedChangesModal.saveButton})]})]})}),document.body)};var Uw=ns();const lu=h.createContext(null);function Nt(){const e=h.useContext(lu);if(e===null)throw new Error("No Tree Api Provided");return e}const cu=h.createContext(null);function Vw(){const e=h.useContext(cu);if(e===null)throw new Error("Provide a NodesContext");return e}const du=h.createContext(null);function zw(){const e=h.useContext(du);if(e===null)throw new Error("Provide a DnDContext");return e}const uu=h.createContext(0);function fu(){h.useContext(uu)}function La(e,t,r){return Math.max(Math.min(e,r),t)}function hu(e){return e&&e.isLeaf}function pu(e){return e&&e.isInternal&&!e.isOpen}function gu(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const mu=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},yu=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Is(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Is(r,t);if(n)return n}return null}function Pa(e,t){if(t(e),e.children)for(let r of e.children)Pa(r,t)}function vu(e){const t=wu(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Hw(t,n);break}r==null||r.focus()}function bu(e){const t=wu(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Rw(t,n);break}r==null||r.focus()}function Hw(e,t){return t+1<e.length?e[t+1]:e[0]}function Rw(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function wu(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function To(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function An(e){return typeof e=="string"?e:e.id}function Qw(e,...t){if(e)return e(...t)}function Cu(e){return new Promise((t,r)=>{let n=0;function o(){n+=1,n===100&&r(),e()?t():setTimeout(o,10)}o()})}function Su(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 _u(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const Gw=Object.freeze(Object.defineProperty({__proto__:null,access:To,bound:La,dfs:Is,focusNextElement:vu,focusPrevElement:bu,getInsertIndex:Su,getInsertParentId:_u,identify:An,indexOf:yu,isClosed:pu,isDescendant:mu,isItem:hu,isOpenWithEmptyChildren:gu,safeRun:Qw,waitFor:Cu,walk:Pa},Symbol.toStringTag,{value:"Module"})),Ww={display:"flex",alignItems:"center",zIndex:1},Kw={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Yw={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Zw=h.memo(function({top:t,left:r,indent:n}){const o={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return c.jsxs("div",{style:Object.assign(Object.assign({},Ww),o),children:[c.jsx("div",{style:Object.assign({},Yw)}),c.jsx("div",{style:Object.assign({},Kw)})]})});function Xw({node:e,attrs:t,innerRef:r,children:n}){return c.jsx("div",Object.assign({},t,{ref:r,onFocus:o=>o.stopPropagation(),onClick:e.handleClick,children:n}))}function Jw(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(tC,Object.assign({},e)):c.jsx(eC,Object.assign({},e))]})}function eC(e){return c.jsx(c.Fragment,{children:c.jsx("span",{children:e.node.data.name})})}function tC({node:e}){const t=h.useRef();return h.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),c.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const Eo="__REACT_ARBORIST_INTERNAL_ROOT__";function Tu(e){var t;function r(a,i,s){const l=e.accessId(a),d=new Io({tree:e,data:a,level:i,parent:s,id:l,children:null,isDraggable:e.isDraggable(a),rowIndex:null}),f=e.accessChildren(a);return f&&(d.children=f.map(u=>r(u,i+1,d))),d}const n=new Io({tree:e,id:Eo,data:{id:Eo},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),o=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=o.map(a=>r(a,0,n)),n}class Io{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===Eo}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new Io(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Os(e){return{type:"EDIT",id:e}}function rC(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function Dn(e){return{type:"FOCUS",id:e}}function nC(){return{type:"TREE_BLUR"}}function oC(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 As={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 Eu(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 aC(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:Eu(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:Eu(e.unfiltered,t)}):e}const Nn=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Nr={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:An(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(An)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(An)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:An(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:An(e)})};function iC(e=Nn().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const kn={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function sC(e=Nn().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return Nn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const lC={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},cC=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},dC=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function Iu({offset:e,mouse:t,id:r,dragIds:n,isDragging:o}){return c.jsxs(uC,{isDragging:o,children:[c.jsx(fC,{offset:e,children:c.jsx(pC,{id:r,dragIds:n})}),c.jsx(hC,{mouse:t,count:n.length})]})}const uC=h.memo(function(t){return t.isDragging?c.jsx("div",{style:lC,children:t.children}):null});function fC(e){return c.jsx("div",{className:"row preview",style:cC(e.offset),children:e.children})}function hC(e){const{count:t,mouse:r}=e;return t>1?c.jsx("div",{className:"selected-count",style:dC(r),children:t}):null}const pC=h.memo(function(t){const r=Nt(),n=r.get(t.id);return n?c.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function Ds(){return Ds=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},Ds.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 Ns(e,t){return Ns=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ns(e,t)}function gC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ns(e,t)}var Au=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function mC(e,t){return!!(e===t||Au(e)&&Au(t))}function yC(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!mC(e[r],t[r]))return!1;return!0}function ks(e,t){t===void 0&&(t=yC);var r,n=[],o,a=!1;function i(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return a&&r===this&&t(s,n)||(o=e.apply(this,s),a=!0,r=this,n=s),o}return i}var vC=typeof performance=="object"&&typeof performance.now=="function",Du=vC?function(){return performance.now()}:function(){return Date.now()};function Nu(e){cancelAnimationFrame(e.id)}function bC(e,t){var r=Du();function n(){Du()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var xs=-1;function ku(e){if(e===void 0&&(e=!1),xs===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),xs=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return xs}var xn=null;function xu(e){if(e===void 0&&(e=!1),xn===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?xn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?xn="negative":xn="positive-ascending"),document.body.removeChild(t),xn}return xn}process.env.NODE_ENV;var wC=150,CC=function(t,r){return t},Fa=null,Ma=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Fa=new WeakSet,Ma=new WeakSet);function Lu(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return t=function(u){gC(m,u);function m(w){var p;return p=u.call(this,w)||this,p._instanceProps=l(p.props,Ou(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:Ou(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=ks(function(y,v,b,C){return p.props.onItemsRendered({overscanStartIndex:y,overscanStopIndex:v,visibleStartIndex:b,visibleStopIndex:C})}),p._callOnScroll=void 0,p._callOnScroll=ks(function(y,v,b){return p.props.onScroll({scrollDirection:y,scrollOffset:v,scrollUpdateWasRequested:b})}),p._getItemStyle=void 0,p._getItemStyle=function(y){var v=p.props,b=v.direction,C=v.itemSize,S=v.layout,T=p._getItemStyleCache(d&&C,d&&S,d&&b),I;if(T.hasOwnProperty(y))I=T[y];else{var k=r(p.props,y,p._instanceProps),x=o(p.props,y,p._instanceProps),B=b==="horizontal"||S==="horizontal",q=b==="rtl",N=B?k:0;T[y]=I={position:"absolute",left:q?void 0:N,right:q?N:void 0,top:B?0:k,height:B?"100%":x,width:B?x:"100%"}}return I},p._getItemStyleCache=void 0,p._getItemStyleCache=ks(function(y,v,b){return{}}),p._onScrollHorizontal=function(y){var v=y.currentTarget,b=v.clientWidth,C=v.scrollLeft,S=v.scrollWidth;p.setState(function(T){if(T.scrollOffset===C)return null;var I=p.props.direction,k=C;if(I==="rtl")switch(xu()){case"negative":k=-C;break;case"positive-descending":k=S-b-C;break}return k=Math.max(0,Math.min(k,S-b)),{isScrolling:!0,scrollDirection:T.scrollOffset<k?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(y){var v=y.currentTarget,b=v.clientHeight,C=v.scrollHeight,S=v.scrollTop;p.setState(function(T){if(T.scrollOffset===S)return null;var I=Math.max(0,Math.min(S,C-b));return{isScrolling:!0,scrollDirection:T.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(y){var v=p.props.outerRef;p._outerRef=y,typeof v=="function"?v(y):v!=null&&typeof v=="object"&&v.hasOwnProperty("current")&&(v.current=y)},p._resetIsScrollingDebounced=function(){p._resetIsScrollingTimeoutId!==null&&Nu(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=bC(p._resetIsScrolling,wC)},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}m.getDerivedStateFromProps=function(p,y){return SC(p,y),f(p),null};var g=m.prototype;return g.scrollTo=function(p){p=Math.max(0,p),this.setState(function(y){return y.scrollOffset===p?null:{scrollDirection:y.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(p,y){y===void 0&&(y="auto");var v=this.props,b=v.itemCount,C=v.layout,S=this.state.scrollOffset;p=Math.max(0,Math.min(p,b-1));var T=0;if(this._outerRef){var I=this._outerRef;C==="vertical"?T=I.scrollWidth>I.clientWidth?ku():0:T=I.scrollHeight>I.clientHeight?ku():0}this.scrollTo(a(this.props,p,y,S,this._instanceProps,T))},g.componentDidMount=function(){var p=this.props,y=p.direction,v=p.initialScrollOffset,b=p.layout;if(typeof v=="number"&&this._outerRef!=null){var C=this._outerRef;y==="horizontal"||b==="horizontal"?C.scrollLeft=v:C.scrollTop=v}this._callPropsCallbacks()},g.componentDidUpdate=function(){var p=this.props,y=p.direction,v=p.layout,b=this.state,C=b.scrollOffset,S=b.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var T=this._outerRef;if(y==="horizontal"||v==="horizontal")if(y==="rtl")switch(xu()){case"negative":T.scrollLeft=-C;break;case"positive-ascending":T.scrollLeft=C;break;default:var I=T.clientWidth,k=T.scrollWidth;T.scrollLeft=k-I-C;break}else T.scrollLeft=C;else T.scrollTop=C}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Nu(this._resetIsScrollingTimeoutId)},g.render=function(){var p=this.props,y=p.children,v=p.className,b=p.direction,C=p.height,S=p.innerRef,T=p.innerElementType,I=p.innerTagName,k=p.itemCount,x=p.itemData,B=p.itemKey,q=B===void 0?CC:B,N=p.layout,P=p.outerElementType,M=p.outerTagName,L=p.style,F=p.useIsScrolling,z=p.width,X=this.state.isScrolling,ve=b==="horizontal"||N==="horizontal",Ee=ve?this._onScrollHorizontal:this._onScrollVertical,Ce=this._getRangeToRender(),ue=Ce[0],Q=Ce[1],ne=[];if(k>0)for(var te=ue;te<=Q;te++)ne.push(h.createElement(y,{data:x,key:q(te,x),index:te,isScrolling:F?X:void 0,style:this._getItemStyle(te)}));var U=n(this.props,this._instanceProps);return h.createElement(P||M||"div",{className:v,onScroll:Ee,ref:this._outerRefSetter,style:Ds({position:"relative",height:C,width:z,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},L)},h.createElement(T||I||"div",{children:ne,ref:S,style:{height:ve?"100%":U,pointerEvents:X?"none":void 0,width:ve?U:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var p=this.props.itemCount;if(p>0){var y=this._getRangeToRender(),v=y[0],b=y[1],C=y[2],S=y[3];this._callOnItemsRendered(v,b,C,S)}}if(typeof this.props.onScroll=="function"){var T=this.state,I=T.scrollDirection,k=T.scrollOffset,x=T.scrollUpdateWasRequested;this._callOnScroll(I,k,x)}},g._getRangeToRender=function(){var p=this.props,y=p.itemCount,v=p.overscanCount,b=this.state,C=b.isScrolling,S=b.scrollDirection,T=b.scrollOffset;if(y===0)return[0,0,0,0];var I=i(this.props,T,this._instanceProps),k=s(this.props,I,T,this._instanceProps),x=!C||S==="backward"?Math.max(1,v):1,B=!C||S==="forward"?Math.max(1,v):1;return[Math.max(0,I-x),Math.max(0,Math.min(y-1,k+B)),I,k]},m}(h.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var SC=function(t,r){var n=t.children,o=t.direction,a=t.height,i=t.layout,s=t.innerTagName,l=t.outerTagName,d=t.width,f=r.instance;if(process.env.NODE_ENV!=="production"){(s!=null||l!=null)&&Ma&&!Ma.has(f)&&(Ma.add(f),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var u=o==="horizontal"||i==="horizontal";switch(o){case"horizontal":case"vertical":Fa&&!Fa.has(f)&&(Fa.add(f),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+i+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(u&&typeof d!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(d===null?"null":typeof d)+'" was specified.'));if(!u&&typeof a!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(a===null?"null":typeof a)+'" was specified.'))}},_C=50,Ln=function(t,r,n){var o=t,a=o.itemSize,i=n.itemMetadataMap,s=n.lastMeasuredIndex;if(r>s){var l=0;if(s>=0){var d=i[s];l=d.offset+d.size}for(var f=s+1;f<=r;f++){var u=a(f);i[f]={offset:l,size:u},l+=u}n.lastMeasuredIndex=r}return i[r]},TC=function(t,r,n){var o=r.itemMetadataMap,a=r.lastMeasuredIndex,i=a>0?o[a].offset:0;return i>=n?Pu(t,r,a,0,n):EC(t,r,Math.max(0,a),n)},Pu=function(t,r,n,o,a){for(;o<=n;){var i=o+Math.floor((n-o)/2),s=Ln(t,i,r).offset;if(s===a)return i;s<a?o=i+1:s>a&&(n=i-1)}return o>0?o-1:0},EC=function(t,r,n,o){for(var a=t.itemCount,i=1;n<a&&Ln(t,n,r).offset<o;)n+=i,i*=2;return Pu(t,r,Math.min(n,a-1),Math.floor(n/2),o)},Fu=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,a=r.estimatedItemSize,i=r.lastMeasuredIndex,s=0;if(i>=n&&(i=n-1),i>=0){var l=o[i];s=l.offset+l.size}var d=n-i-1,f=d*a;return s+f},IC=Lu({getItemOffset:function(t,r,n){return Ln(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Fu,getOffsetForIndexAndAlignment:function(t,r,n,o,a,i){var s=t.direction,l=t.height,d=t.layout,f=t.width,u=s==="horizontal"||d==="horizontal",m=u?f:l,g=Ln(t,r,a),w=Fu(t,a),p=Math.max(0,Math.min(w-m,g.offset)),y=Math.max(0,g.offset-m+g.size+i);switch(n==="smart"&&(o>=y-m&&o<=p+m?n="auto":n="center"),n){case"start":return p;case"end":return y;case"center":return Math.round(y+(p-y)/2);case"auto":default:return o>=y&&o<=p?o:o<y?y:p}},getStartIndexForOffset:function(t,r,n){return TC(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var a=t.direction,i=t.height,s=t.itemCount,l=t.layout,d=t.width,f=a==="horizontal"||l==="horizontal",u=f?d:i,m=Ln(t,r,o),g=n+u,w=m.offset+m.size,p=r;p<s-1&&w<g;)p++,w+=Ln(t,p,o).size;return p},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:o||_C,lastMeasuredIndex:-1};return r.resetAfterIndex=function(i,s){s===void 0&&(s=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,i-1),r._getItemStyleCache(-1),s&&r.forceUpdate()},a},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),OC=Lu({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,o,a,i){var s=t.direction,l=t.height,d=t.itemCount,f=t.itemSize,u=t.layout,m=t.width,g=s==="horizontal"||u==="horizontal",w=g?m:l,p=Math.max(0,d*f-w),y=Math.min(p,r*f),v=Math.max(0,r*f-w+f+i);switch(n==="smart"&&(o>=v-w&&o<=y+w?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(w/2)?0:b>p+Math.floor(w/2)?p:b}case"auto":default:return o>=v&&o<=y?o:o<v?v:y}},getStartIndexForOffset:function(t,r){var n=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/o)))},getStopIndexForStartIndex:function(t,r,n){var o=t.direction,a=t.height,i=t.itemCount,s=t.itemSize,l=t.layout,d=t.width,f=o==="horizontal"||l==="horizontal",u=r*s,m=f?d:a,g=Math.ceil((m+n-u)/s);return Math.max(0,Math.min(i-1,r+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function AC(){var e,t;const r=Nt(),o=zw().cursor;if(!o||o.type!=="line")return null;const a=r.indent,i=r.rowTopPosition(o.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),s=a*o.level,l=r.renderCursor;return c.jsx(l,{top:i,left:s,indent:a})}var DC=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const NC=h.forwardRef(function(t,r){const{children:n}=t,o=DC(t,["children"]),a=Nt();return c.jsxs("div",Object.assign({ref:r},o,{onClick:i=>{i.currentTarget===i.target&&a.deselectAll()},children:[c.jsx(kC,{}),n]}))}),kC=()=>{const e=Nt();return c.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:c.jsx(AC,{})})};var xC=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const LC=h.forwardRef(function(t,r){var n,o,a,i,{style:s}=t,l=xC(t,["style"]);const d=Nt(),f=(o=(n=d.props.padding)!==null&&n!==void 0?n:d.props.paddingTop)!==null&&o!==void 0?o:0,u=(i=(a=d.props.padding)!==null&&a!==void 0?a:d.props.paddingBottom)!==null&&i!==void 0?i:0;return c.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+f+u}px`})},l))});var Mu=h.createContext({dragDropManager:void 0}),Vt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Vt||(Vt={}));function he(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var a;if(t===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;a=new Error(t.replace(/%s/g,function(){return n[i++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}var Ls="dnd-core/INIT_COORDS",$a="dnd-core/BEGIN_DRAG",Ps="dnd-core/PUBLISH_DRAG_SOURCE",Ba="dnd-core/HOVER",ja="dnd-core/DROP",qa="dnd-core/END_DRAG";function $u(e,t){return{type:Ls,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Ua(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ua=function(r){return typeof r}:Ua=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ua(e)}function PC(e,t,r){return t.split(".").reduce(function(n,o){return n&&n[o]?n[o]:r||null},e)}function FC(e,t){return e.filter(function(r){return r!==t})}function Bu(e){return Ua(e)==="object"}function MC(e,t){var r=new Map,n=function(i){r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(a,i){a===1&&o.push(i)}),o}function $C(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var BC={type:Ls,payload:{clientOffset:null,sourceClientOffset:null}};function jC(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},o=n.publishSource,a=o===void 0?!0:o,i=n.clientOffset,s=n.getSourceClientOffset,l=e.getMonitor(),d=e.getRegistry();e.dispatch($u(i)),qC(r,l,d);var f=zC(r,l);if(f===null){e.dispatch(BC);return}var u=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");UC(s),u=s(f)}e.dispatch($u(i,u));var m=d.getSource(f),g=m.beginDrag(l,f);if(g!=null){VC(g),d.pinSource(f);var w=d.getSourceType(f);return{type:$a,payload:{itemType:w,item:g,sourceId:f,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!a}}}}}function qC(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 UC(e){he(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function VC(e){he(Bu(e),"Item must be an object.")}function zC(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 HC(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Ps}}}function Fs(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function RC(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.clientOffset;QC(r);var a=r.slice(0),i=e.getMonitor(),s=e.getRegistry();GC(a,i,s);var l=i.getItemType();return WC(a,s,l),KC(a,i,s),{type:Ba,payload:{targetIds:a,clientOffset:o||null}}}}function QC(e){he(Array.isArray(e),"Expected targetIds to be an array.")}function GC(e,t,r){he(t.isDragging(),"Cannot call hover while not dragging."),he(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var o=e[n];he(e.lastIndexOf(o)===n,"Expected targetIds to be unique in the passed array.");var a=r.getTarget(o);he(a,"Expected targetIds to be registered.")}}function WC(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n],a=t.getTargetType(o);Fs(a,r)||e.splice(n,1)}}function KC(e,t,r){e.forEach(function(n){var o=r.getTarget(n);o.hover(t,n)})}function ju(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function qu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ju(Object(r),!0).forEach(function(n){YC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ju(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YC(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZC(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),o=e.getRegistry();XC(n);var a=tS(n);a.forEach(function(i,s){var l=JC(i,s,o,n),d={type:ja,payload:{dropResult:qu(qu({},r),l)}};e.dispatch(d)})}}function XC(e){he(e.isDragging(),"Cannot call drop while not dragging."),he(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function JC(e,t,r,n){var o=r.getTarget(e),a=o?o.drop(n,e):void 0;return eS(a),typeof a>"u"&&(a=t===0?{}:n.getDropResult()),a}function eS(e){he(typeof e>"u"||Bu(e),"Drop result must either be an object or undefined.")}function tS(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function rS(e){return function(){var r=e.getMonitor(),n=e.getRegistry();nS(r);var o=r.getSourceId();if(o!=null){var a=n.getSource(o,!0);a.endDrag(r,o),n.unpinSource()}return{type:qa}}}function nS(e){he(e.isDragging(),"Cannot call endDrag while not dragging.")}function oS(e){return{beginDrag:jC(e),publishDragSource:HC(e),hover:RC(e),drop:ZC(e),endDrag:rS(e)}}function aS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iS(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 sS(e,t,r){return t&&iS(e.prototype,t),e}function Oo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var lS=function(){function e(t,r){var n=this;aS(this,e),Oo(this,"store",void 0),Oo(this,"monitor",void 0),Oo(this,"backend",void 0),Oo(this,"isSetUp",!1),Oo(this,"handleRefCountChange",function(){var o=n.store.getState().refCount>0;n.backend&&(o&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!o&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return sS(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function o(i){return function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];var f=i.apply(r,l);typeof f<"u"&&n(f)}}var a=oS(this);return Object.keys(a).reduce(function(i,s){var l=a[s];return i[s]=o(l),i},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e}();function zt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Uu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Vu=function(){return Math.random().toString(36).substring(7).split("").join(".")},zu={INIT:"@@redux/INIT"+Vu(),REPLACE:"@@redux/REPLACE"+Vu()};function cS(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 dS(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(hS(e))return"date";if(fS(e))return"error";var r=uS(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 uS(e){return typeof e.constructor=="function"?e.constructor.name:null}function fS(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function hS(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Pn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=dS(e)),t}function Hu(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?zt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?zt(1):"Expected the enhancer to be a function. Instead, received: '"+Pn(r)+"'");return r(Hu)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?zt(2):"Expected the root reducer to be a function. Instead, received: '"+Pn(e)+"'");var o=e,a=t,i=[],s=i,l=!1;function d(){s===i&&(s=i.slice())}function f(){if(l)throw new Error(process.env.NODE_ENV==="production"?zt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function u(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?zt(4):"Expected the listener to be a function. Instead, received: '"+Pn(p)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?zt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var y=!0;return d(),s.push(p),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?zt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d();var b=s.indexOf(p);s.splice(b,1),i=null}}}function m(p){if(!cS(p))throw new Error(process.env.NODE_ENV==="production"?zt(7):"Actions must be plain objects. Instead, the actual type was: '"+Pn(p)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof p.type>"u")throw new Error(process.env.NODE_ENV==="production"?zt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(l)throw new Error(process.env.NODE_ENV==="production"?zt(9):"Reducers may not dispatch actions.");try{l=!0,a=o(a,p)}finally{l=!1}for(var y=i=s,v=0;v<y.length;v++){var b=y[v];b()}return p}function g(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?zt(10):"Expected the nextReducer to be a function. Instead, received: '"+Pn(p));o=p,m({type:zu.REPLACE})}function w(){var p,y=u;return p={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?zt(11):"Expected the observer to be an object. Instead, received: '"+Pn(b)+"'");function C(){b.next&&b.next(f())}C();var S=y(C);return{unsubscribe:S}}},p[Uu]=function(){return this},p}return m({type:zu.INIT}),n={dispatch:m,subscribe:u,getState:f,replaceReducer:g},n[Uu]=w,n}var pS=function(t,r){return t===r};function gS(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function mS(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pS;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 Ru(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ru(Object(r),!0).forEach(function(n){yS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ru(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yS(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={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function vS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gu,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ls:case $a:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ba:return gS(e.clientOffset,r.clientOffset)?e:Qu(Qu({},e),{},{clientOffset:r.clientOffset});case qa:case ja:return Gu;default:return e}}var Ms="dnd-core/ADD_SOURCE",$s="dnd-core/ADD_TARGET",Bs="dnd-core/REMOVE_SOURCE",Va="dnd-core/REMOVE_TARGET";function bS(e){return{type:Ms,payload:{sourceId:e}}}function wS(e){return{type:$s,payload:{targetId:e}}}function CS(e){return{type:Bs,payload:{sourceId:e}}}function SS(e){return{type:Va,payload:{targetId:e}}}function Wu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wu(Object(r),!0).forEach(function(n){_S(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 _S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var TS={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function ES(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:TS,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case $a:return Ht(Ht({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Ps:return Ht(Ht({},e),{},{isSourcePublic:!0});case Ba:return Ht(Ht({},e),{},{targetIds:r.targetIds});case Va:return e.targetIds.indexOf(r.targetId)===-1?e:Ht(Ht({},e),{},{targetIds:FC(e.targetIds,r.targetId)});case ja:return Ht(Ht({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case qa:return Ht(Ht({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function IS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ms:case $s:return e+1;case Bs:case Va:return e-1;default:return e}}var za=[],js=[];za.__IS_NONE__=!0,js.__IS_ALL__=!0;function OS(e,t){if(e===za)return!1;if(e===js||typeof t>"u")return!0;var r=$C(t,e);return r.length>0}function AS(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ba:break;case Ms:case $s:case Va:case Bs:return za;case $a:case Ps:case qa:case ja:default:return js}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,o=t.prevTargetIds,a=o===void 0?[]:o,i=MC(n,a),s=i.length>0||!mS(n,a);if(!s)return za;var l=a[a.length-1],d=n[n.length-1];return l!==d&&(l&&i.push(l),d&&i.push(d)),i}function DS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Ku(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Yu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ku(Object(r),!0).forEach(function(n){NS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ku(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:AS(e.dirtyHandlerIds,{type:t.type,payload:Yu(Yu({},t.payload),{},{prevTargetIds:PC(e,"dragOperation.targetIds",[])})}),dragOffset:vS(e.dragOffset,t),refCount:IS(e.refCount,t),dragOperation:ES(e.dragOperation,t),stateId:DS(e.stateId)}}function xS(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Zu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function LS(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:Zu(xS(t,n),r)}function PS(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:Zu(t,r)}function FS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $S(e,t,r){return t&&MS(e.prototype,t),e}function Xu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var BS=function(){function e(t,r){FS(this,e),Xu(this,"store",void 0),Xu(this,"registry",void 0),this.store=t,this.registry=r}return $S(e,[{key:"subscribeToStateChange",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},a=o.handlerIds;he(typeof r=="function","listener must be a function."),he(typeof a>"u"||Array.isArray(a),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId,s=function(){var d=n.store.getState(),f=d.stateId;try{var u=f===i||f===i+1&&!OS(d.dirtyHandlerIds,a);u||r()}finally{i=f}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;he(typeof r=="function","listener must be a function.");var o=this.store.getState().dragOffset,a=function(){var s=n.store.getState().dragOffset;s!==o&&(o=s,r())};return this.store.subscribe(a)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return he(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(he(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();return Fs(o,a)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(he(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var o=this.registry.getSourceType(r),a=this.getItemType();return o!==a?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var o=n.shallow;if(!this.isDragging())return!1;var a=this.registry.getTargetType(r),i=this.getItemType();if(i&&!Fs(a,i))return!1;var s=this.getTargetIds();if(!s.length)return!1;var l=s.indexOf(r);return o?l===s.length-1:l>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return LS(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return PS(this.store.getState().dragOffset)}}]),e}(),jS=0;function qS(){return jS++}function Ha(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ha=function(r){return typeof r}:Ha=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ha(e)}function US(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 VS(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 qs(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return qs(r,!1)});return}he(typeof e=="string"||Ha(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Ju=typeof global<"u"?global:self,ef=Ju.MutationObserver||Ju.WebKitMutationObserver;function tf(e){return function(){const r=setTimeout(o,0),n=setInterval(o,50);function o(){clearTimeout(r),clearInterval(n),e()}}}function zS(e){let t=1;const r=new ef(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const HS=typeof ef=="function"?zS:tf;class RS{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,o=t.length-this.index;n<o;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=HS(this.flush),this.requestErrorThrow=tf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class QS{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 GS{create(t){const r=this.freeTasks,n=r.length?r.pop():new QS(this.onError,o=>r[r.length]=o);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const rf=new RS,WS=new GS(rf.registerPendingError);function KS(e){rf.enqueueTask(WS.create(e))}function YS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZS(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 XS(e,t,r){return t&&ZS(e.prototype,t),e}function Fn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JS(e,t){return n_(e)||r_(e,t)||t_(e,t)||e_()}function e_(){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 t_(e,t){if(e){if(typeof e=="string")return nf(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 nf(e,t)}}function nf(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 r_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function n_(e){if(Array.isArray(e))return e}function o_(e){var t=qS().toString();switch(e){case Vt.SOURCE:return"S".concat(t);case Vt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function of(e){switch(e[0]){case"S":return Vt.SOURCE;case"T":return Vt.TARGET;default:he(!1,"Cannot parse handler ID: ".concat(e))}}function af(e,t){var r=e.entries(),n=!1;do{var o=r.next(),a=o.done,i=JS(o.value,2),s=i[1];if(s===t)return!0;n=!!a}while(!n);return!1}var a_=function(){function e(t){YS(this,e),Fn(this,"types",new Map),Fn(this,"dragSources",new Map),Fn(this,"dropTargets",new Map),Fn(this,"pinnedSourceId",null),Fn(this,"pinnedSource",null),Fn(this,"store",void 0),this.store=t}return XS(e,[{key:"addSource",value:function(r,n){qs(r),US(n);var o=this.addHandler(Vt.SOURCE,r,n);return this.store.dispatch(bS(o)),o}},{key:"addTarget",value:function(r,n){qs(r,!0),VS(n);var o=this.addHandler(Vt.TARGET,r,n);return this.store.dispatch(wS(o)),o}},{key:"containsHandler",value:function(r){return af(this.dragSources,r)||af(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;he(this.isSourceId(r),"Expected a valid source ID.");var o=n&&r===this.pinnedSourceId,a=o?this.pinnedSource:this.dragSources.get(r);return a}},{key:"getTarget",value:function(r){return he(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return he(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return he(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=of(r);return n===Vt.SOURCE}},{key:"isTargetId",value:function(r){var n=of(r);return n===Vt.TARGET}},{key:"removeSource",value:function(r){var n=this;he(this.getSource(r),"Expected an existing source."),this.store.dispatch(CS(r)),KS(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(SS(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);he(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){he(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,o){var a=o_(r);return this.types.set(a,n),r===Vt.SOURCE?this.dragSources.set(a,o):r===Vt.TARGET&&this.dropTargets.set(a,o),a}}]),e}();function i_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=s_(n),a=new BS(o,new a_(o)),i=new lS(o,a),s=e(i,t,r);return i.receiveBackend(s),i}function s_(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Hu(kS,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var l_=["children"];function c_(e,t){return h_(e)||f_(e,t)||u_(e,t)||d_()}function d_(){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 u_(e,t){if(e){if(typeof e=="string")return sf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sf(e,t)}}function sf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function h_(e){if(Array.isArray(e))return e}function p_(e,t){if(e==null)return{};var r=g_(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function g_(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var lf=0,Ra=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),m_=h.memo(function(t){var r=t.children,n=p_(t,l_),o=y_(n),a=c_(o,2),i=a[0],s=a[1];return h.useEffect(function(){if(s){var l=cf();return++lf,function(){--lf===0&&(l[Ra]=null)}}},[]),c.jsx(Mu.Provider,Object.assign({value:i},{children:r}),void 0)});function y_(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=v_(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function v_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:cf(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[Ra]||(o[Ra]={dragDropManager:i_(e,t,r,n)}),o[Ra]}function cf(){return typeof global<"u"?global:window}function b_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w_(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 C_(e,t,r){return t&&w_(e.prototype,t),e}function df(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Us=!1,Vs=!1,S_=function(){function e(t){b_(this,e),df(this,"internalMonitor",void 0),df(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return C_(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){he(!Us,"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 Us=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Us=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;he(!Vs,"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 Vs=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Vs=!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 __(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E_(e,t,r){return t&&T_(e.prototype,t),e}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zs=!1,I_=function(){function e(t){__(this,e),uf(this,"internalMonitor",void 0),uf(this,"targetId",null),this.internalMonitor=t.getMonitor()}return E_(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(!zs,"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 zs=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{zs=!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 O_(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 A_(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!h.isValidElement(t)){var n=t;return e(n,r),n}var o=t;O_(o);var a=r?function(i){return e(i,r)}:e;return D_(o,a)}}function ff(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var o=A_(n);t[r]=function(){return o}}}),t}function hf(e,t){typeof e=="function"?e(t):e.current=t}function D_(e,t){var r=e.ref;return he(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:function(o){hf(r,o),hf(t,o)}}):h.cloneElement(e,{ref:t})}function Qa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qa=function(r){return typeof r}:Qa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qa(e)}function Hs(e){return e!==null&&Qa(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Rs(e,t,r,n){var o=void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var d=a[l];if(!s(d))return!1;var f=e[d],u=t[d];if(o=void 0,o===!1||o===void 0&&f!==u)return!1}return!0}function N_(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 x_(e,t,r){return t&&k_(e.prototype,t),e}function yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var L_=function(){function e(t){var r=this;N_(this,e),yt(this,"hooks",ff({dragSource:function(o,a){r.clearDragSource(),r.dragSourceOptions=a||null,Hs(o)?r.dragSourceRef=o:r.dragSourceNode=o,r.reconnectDragSource()},dragPreview:function(o,a){r.clearDragPreview(),r.dragPreviewOptions=a||null,Hs(o)?r.dragPreviewRef=o:r.dragPreviewNode=o,r.reconnectDragPreview()}})),yt(this,"handlerId",null),yt(this,"dragSourceRef",null),yt(this,"dragSourceNode",void 0),yt(this,"dragSourceOptionsInternal",null),yt(this,"dragSourceUnsubscribe",void 0),yt(this,"dragPreviewRef",null),yt(this,"dragPreviewNode",void 0),yt(this,"dragPreviewOptionsInternal",null),yt(this,"dragPreviewUnsubscribe",void 0),yt(this,"lastConnectedHandlerId",null),yt(this,"lastConnectedDragSource",null),yt(this,"lastConnectedDragSourceOptions",null),yt(this,"lastConnectedDragPreview",null),yt(this,"lastConnectedDragPreviewOptions",null),yt(this,"backend",void 0),this.backend=t}return x_(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!Rs(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Rs(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 P_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F_(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 M_(e,t,r){return t&&F_(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 $_=function(){function e(t){var r=this;P_(this,e),ir(this,"hooks",ff({dropTarget:function(o,a){r.clearDropTarget(),r.dropTargetOptions=a,Hs(o)?r.dropTargetRef=o:r.dropTargetNode=o,r.reconnect()}})),ir(this,"handlerId",null),ir(this,"dropTargetRef",null),ir(this,"dropTargetNode",void 0),ir(this,"dropTargetOptionsInternal",null),ir(this,"unsubscribeDropTarget",void 0),ir(this,"lastConnectedHandlerId",null),ir(this,"lastConnectedDropTarget",null),ir(this,"lastConnectedDropTargetOptions",null),ir(this,"backend",void 0),this.backend=t}return M_(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!Rs(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 B_(e,t,r){var n=r.getRegistry(),o=n.addTarget(e,t);return[o,function(){return n.removeTarget(o)}]}function j_(e,t,r){var n=r.getRegistry(),o=n.addSource(e,t);return[o,function(){return n.removeSource(o)}]}var Yr=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Ga(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ga=function(r){return typeof r}:Ga=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ga(e)}function q_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U_(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 V_(e,t,r){return t&&U_(e.prototype,t),e}function Qs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var z_=function(){function e(t,r,n){q_(this,e),Qs(this,"spec",void 0),Qs(this,"monitor",void 0),Qs(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return V_(e,[{key:"beginDrag",value:function(){var r,n=this.spec,o=this.monitor,a=null;return Ga(n.item)==="object"?a=n.item:typeof n.item=="function"?a=n.item(o):a={},(r=a)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var o=this.spec,a=this.monitor,i=o.isDragging;return i?i(a):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,o=this.connector,a=r.end;a&&a(n.getItem(),n),o.reconnect()}}]),e}();function H_(e,t,r){var n=h.useMemo(function(){return new z_(e,t,r)},[t,r]);return h.useEffect(function(){n.spec=e},[e]),n}function Zr(){var e=h.useContext(Mu),t=e.dragDropManager;return he(t!=null,"Expected drag drop context"),t}function R_(e){return h.useMemo(function(){var t=e.type;return he(t!=null,"spec.type must be defined"),t},[e])}function Q_(e,t){return Y_(e)||K_(e,t)||W_(e,t)||G_()}function G_(){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 W_(e,t){if(e){if(typeof e=="string")return pf(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 pf(e,t)}}function pf(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 K_(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function Y_(e){if(Array.isArray(e))return e}function Z_(e,t,r){var n=Zr(),o=H_(e,t,r),a=R_(e);Yr(function(){if(a!=null){var s=j_(a,o,n),l=Q_(s,2),d=l[0],f=l[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),f}},[n,t,r,o,a])}function X_(e){return r0(e)||t0(e)||e0(e)||J_()}function J_(){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 e0(e,t){if(e){if(typeof e=="string")return Gs(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 Gs(e,t)}}function t0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r0(e){if(Array.isArray(e))return Gs(e)}function Gs(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 gf(e,t){var r=X_(t||[]);return t==null&&typeof e!="function"&&r.push(e),h.useMemo(function(){return typeof e=="function"?e():e},r)}function n0(){var e=Zr();return h.useMemo(function(){return new S_(e)},[e])}function o0(e,t){var r=Zr(),n=h.useMemo(function(){return new L_(r.getBackend())},[r]);return Yr(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),Yr(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var a0=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;o--!==0;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r};const i0=td(a0);function s0(e,t){return u0(e)||d0(e,t)||c0(e,t)||l0()}function l0(){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 c0(e,t){if(e){if(typeof e=="string")return mf(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 mf(e,t)}}function mf(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 d0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function u0(e){if(Array.isArray(e))return e}function yf(e,t,r){var n=h.useState(function(){return t(e)}),o=s0(n,2),a=o[0],i=o[1],s=h.useCallback(function(){var l=t(e);i0(a,l)||(i(l),r&&r())},[a,e,r]);return Yr(s),[a,s]}function f0(e,t){return m0(e)||g0(e,t)||p0(e,t)||h0()}function h0(){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 p0(e,t){if(e){if(typeof e=="string")return vf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vf(e,t)}}function vf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function m0(e){if(Array.isArray(e))return e}function y0(e,t,r){var n=yf(e,t,r),o=f0(n,2),a=o[0],i=o[1];return Yr(function(){var l=e.getHandlerId();if(l!=null)return e.subscribeToStateChange(i,{handlerIds:[l]})},[e,i]),a}function bf(e,t,r){return y0(t,e||function(){return{}},function(){return r.reconnect()})}function v0(e){return h.useMemo(function(){return e.hooks.dragSource()},[e])}function b0(e){return h.useMemo(function(){return e.hooks.dragPreview()},[e])}function w0(e,t){var r=gf(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=n0(),o=o0(r.options,r.previewOptions);return Z_(r,n,o),[bf(r.collect,n,o),v0(o),b0(o)]}function C0(e){var t=e.accept;return h.useMemo(function(){return he(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function S0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _0(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 T0(e,t,r){return t&&_0(e.prototype,t),e}function wf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var E0=function(){function e(t,r){S0(this,e),wf(this,"spec",void 0),wf(this,"monitor",void 0),this.spec=t,this.monitor=r}return T0(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 I0(e,t){var r=h.useMemo(function(){return new E0(e,t)},[t]);return h.useEffect(function(){r.spec=e},[e]),r}function O0(e,t){return k0(e)||N0(e,t)||D0(e,t)||A0()}function A0(){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 D0(e,t){if(e){if(typeof e=="string")return Cf(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 Cf(e,t)}}function Cf(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 N0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function k0(e){if(Array.isArray(e))return e}function x0(e,t,r){var n=Zr(),o=I0(e,t),a=C0(e);Yr(function(){var s=B_(a,o,n),l=O0(s,2),d=l[0],f=l[1];return t.receiveHandlerId(d),r.receiveHandlerId(d),f},[n,t,o,r,a.map(function(i){return i.toString()}).join("|")])}function L0(){var e=Zr();return h.useMemo(function(){return new I_(e)},[e])}function P0(e){var t=Zr(),r=h.useMemo(function(){return new $_(t.getBackend())},[t]);return Yr(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function F0(e){return h.useMemo(function(){return e.hooks.dropTarget()},[e])}function Sf(e,t){var r=gf(e,t),n=L0(),o=P0(r.options);return x0(r,n,o),[bf(r.collect,n,o),F0(o)]}function M0(e,t){return q0(e)||j0(e,t)||B0(e,t)||$0()}function $0(){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 B0(e,t){if(e){if(typeof e=="string")return _f(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 _f(e,t)}}function _f(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 j0(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,s;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(l){a=!0,s=l}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function q0(e){if(Array.isArray(e))return e}function U0(e){var t=Zr(),r=t.getMonitor(),n=yf(r,e),o=M0(n,2),a=o[0],i=o[1];return h.useEffect(function(){return r.subscribeToOffsetChange(i)}),h.useEffect(function(){return r.subscribeToStateChange(i)}),a}function Tf(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function V0(e,t){return e.filter(function(r){return r!==t})}function z0(e,t){var r=new Set,n=function(i){return r.add(i)};e.forEach(n),t.forEach(n);var o=[];return r.forEach(function(a){return o.push(a)}),o}function H0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R0(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 Q0(e,t,r){return t&&R0(e.prototype,t),e}function Ef(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var G0=function(){function e(t){H0(this,e),Ef(this,"entered",[]),Ef(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return Q0(e,[{key:"enter",value:function(r){var n=this,o=this.entered.length,a=function(s){return n.isNodeInDocument(s)&&(!s.contains||s.contains(r))};return this.entered=z0(this.entered.filter(a),[r]),o===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=V0(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),W0=Tf(function(){return/firefox/i.test(navigator.userAgent)}),If=Tf(function(){return!!window.safari});function K0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y0(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 Z0(e,t,r){return t&&Y0(e.prototype,t),e}function Ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Of=function(){function e(t,r){K0(this,e),Ao(this,"xs",void 0),Ao(this,"ys",void 0),Ao(this,"c1s",void 0),Ao(this,"c2s",void 0),Ao(this,"c3s",void 0);for(var n=t.length,o=[],a=0;a<n;a++)o.push(a);o.sort(function(x,B){return t[x]<t[B]?-1:1});for(var i=[],s=[],l,d,f=0;f<n-1;f++)l=t[f+1]-t[f],d=r[f+1]-r[f],i.push(l),s.push(d/l);for(var u=[s[0]],m=0;m<i.length-1;m++){var g=s[m],w=s[m+1];if(g*w<=0)u.push(0);else{l=i[m];var p=i[m+1],y=l+p;u.push(3*y/((y+p)/g+(y+l)/w))}}u.push(s[s.length-1]);for(var v=[],b=[],C,S=0;S<u.length-1;S++){C=s[S];var T=u[S],I=1/i[S],k=T+u[S+1]-C-C;v.push((C-T-k)*I),b.push(k*I*I)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=v,this.c3s=b}return Z0(e,[{key:"interpolate",value:function(r){var n=this.xs,o=this.ys,a=this.c1s,i=this.c2s,s=this.c3s,l=n.length-1;if(r===n[l])return o[l];for(var d=0,f=s.length-1,u;d<=f;){u=Math.floor(.5*(d+f));var m=n[u];if(m<r)d=u+1;else if(m>r)f=u-1;else return o[u]}l=Math.max(0,f);var g=r-n[l],w=g*g;return o[l]+a[l]*g+i[l]*w+s[l]*g*w}}]),e}(),X0=1;function Af(e){var t=e.nodeType===X0?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function Wa(e){return{x:e.clientX,y:e.clientY}}function J0(e){var t;return e.nodeName==="IMG"&&(W0()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function eT(e,t,r,n){var o=e?t.width:r,a=e?t.height:n;return If()&&e&&(a/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:a}}function tT(e,t,r,n,o){var a=J0(t),i=a?e:t,s=Af(i),l={x:r.x-s.x,y:r.y-s.y},d=e.offsetWidth,f=e.offsetHeight,u=n.anchorX,m=n.anchorY,g=eT(a,t,d,f),w=g.dragPreviewWidth,p=g.dragPreviewHeight,y=function(){var k=new Of([0,.5,1],[l.y,l.y/f*p,l.y+p-f]),x=k.interpolate(m);return If()&&a&&(x+=(window.devicePixelRatio-1)*p),x},v=function(){var k=new Of([0,.5,1],[l.x,l.x/d*w,l.x+w-d]);return k.interpolate(u)},b=o.offsetX,C=o.offsetY,S=b===0||b,T=C===0||C;return{x:S?b:v(),y:T?C:y()}}var Df="__NATIVE_FILE__",Nf="__NATIVE_URL__",kf="__NATIVE_TEXT__",xf="__NATIVE_HTML__";const Lf=Object.freeze(Object.defineProperty({__proto__:null,FILE:Df,HTML:xf,TEXT:kf,URL:Nf},Symbol.toStringTag,{value:"Module"}));function Ws(e,t,r){var n=t.reduce(function(o,a){return o||e.getData(a)},"");return n??r}var Mn;function Ka(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ks=(Mn={},Ka(Mn,Df,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Ka(Mn,xf,{exposeProperties:{html:function(t,r){return Ws(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Ka(Mn,Nf,{exposeProperties:{urls:function(t,r){return Ws(t,r,"").split(`
|
|
505
|
+
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Ka(Mn,kf,{exposeProperties:{text:function(t,r){return Ws(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Mn);function rT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nT(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 oT(e,t,r){return t&&nT(e.prototype,t),e}function Pf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var aT=function(){function e(t){rT(this,e),Pf(this,"item",void 0),Pf(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return oT(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var o={};Object.keys(this.config.exposeProperties).forEach(function(a){o[a]={value:n.config.exposeProperties[a](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,o)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();function iT(e,t){var r=new aT(Ks[e]);return r.loadDataTransfer(t),r}function Ys(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ks).filter(function(r){var n=Ks[r].matchesTypes;return n.some(function(o){return t.indexOf(o)>-1})})[0]||null}function sT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lT(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 cT(e,t,r){return t&&lT(e.prototype,t),e}function Zs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var dT=function(){function e(t,r){sT(this,e),Zs(this,"ownerDocument",null),Zs(this,"globalContext",void 0),Zs(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return cT(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 Ff(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ff(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hT(e,t,r){return t&&fT(e.prototype,t),e}function 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 pT=function(){function e(t,r,n){var o=this;uT(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(a){var i=o.sourceNodes.get(a);return i&&Af(i)||null}),be(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),be(this,"isNodeInDocument",function(a){return!!(a&&o.document&&o.document.body&&o.document.body.contains(a))}),be(this,"endDragIfSourceWasRemovedFromDOM",function(){var a=o.currentDragSourceNode;a==null||o.isNodeInDocument(a)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),be(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),be(this,"handleTopDragStart",function(a){if(!a.defaultPrevented){var i=o.dragStartSourceIds;o.dragStartSourceIds=null;var s=Wa(a);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:s});var l=a.dataTransfer,d=Ys(l);if(o.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var f=o.monitor.getSourceId(),u=o.sourceNodes.get(f),m=o.sourcePreviewNodes.get(f)||u;if(m){var g=o.getCurrentSourcePreviewNodeOptions(),w=g.anchorX,p=g.anchorY,y=g.offsetX,v=g.offsetY,b={anchorX:w,anchorY:p},C={offsetX:y,offsetY:v},S=tT(u,m,s,b,C);l.setDragImage(m,S.x,S.y)}}try{l==null||l.setData("application/json",{})}catch{}o.setCurrentDragSourceNode(a.target);var T=o.getCurrentSourcePreviewNodeOptions(),I=T.captureDraggingState;I?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(d)o.beginDragNativeItem(d);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}}}),be(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),be(this,"handleTopDragEnterCapture",function(a){o.dragEnterTargetIds=[];var i=o.enterLeaveCounter.enter(a.target);if(!(!i||o.monitor.isDragging())){var s=a.dataTransfer,l=Ys(s);l&&o.beginDragNativeItem(l,s)}}),be(this,"handleTopDragEnter",function(a){var i=o.dragEnterTargetIds;if(o.dragEnterTargetIds=[],!!o.monitor.isDragging()){o.altKeyPressed=a.altKey,i.length>0&&o.actions.hover(i,{clientOffset:Wa(a)});var s=i.some(function(l){return o.monitor.canDropOnTarget(l)});s&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=o.getCurrentDropEffect()))}}),be(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),be(this,"handleTopDragOver",function(a){var i=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}o.altKeyPressed=a.altKey,o.lastClientOffset=Wa(a),o.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(i||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null}));var s=(i||[]).some(function(l){return o.monitor.canDropOnTarget(l)});s?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))}),be(this,"handleTopDragLeaveCapture",function(a){o.isDraggingNativeItem()&&a.preventDefault();var i=o.enterLeaveCounter.leave(a.target);i&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),be(this,"handleTopDropCapture",function(a){if(o.dropTargetIds=[],o.isDraggingNativeItem()){var i;a.preventDefault(),(i=o.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else Ys(a.dataTransfer)&&a.preventDefault();o.enterLeaveCounter.reset()}),be(this,"handleTopDrop",function(a){var i=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(i,{clientOffset:Wa(a)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),be(this,"handleSelectStart",function(a){var i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))}),this.options=new dT(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new G0(this.isNodeInDocument)}return hT(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,o){var a=this;return this.sourcePreviewNodeOptions.set(r,o),this.sourcePreviewNodes.set(r,n),function(){a.sourcePreviewNodes.delete(r),a.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,o){var a=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,o);var i=function(d){return a.handleDragStart(d,r)},s=function(d){return a.handleSelectStart(d)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),function(){a.sourceNodes.delete(r),a.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var o=this,a=function(d){return o.handleDragEnter(d,r)},i=function(d){return o.handleDragOver(d,r)},s=function(d){return o.handleDrop(d,r)};return n.addEventListener("dragenter",a),n.addEventListener("dragover",i),n.addEventListener("drop",s),function(){n.removeEventListener("dragenter",a),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Mf({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 Mf({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Lf).some(function(n){return Lf[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=iT(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var o=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var a;return(a=n.rootElement)===null||a===void 0?void 0:a.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},o)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e}(),Ya;function gT(){return Ya||(Ya=new Image,Ya.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ya}var mT=function(t,r,n){return new pT(t,r,n)};function yT(e,t){return typeof e=="function"?e(t):e??"NODE"}function vT(e){return e.isDraggable&&!e.isEditing}function bT(e){const t=Nt(),r=t.selectedIds,[n,o,a]=w0(()=>({canDrag:()=>vT(e),type:yT(t.props.dragType,e),item:()=>{const i=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(kn.dragStart(e.id,i)),{id:e.id,dragIds:i,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(kn.dragEnd())}}),[r,e,t.props.dragType]);return h.useEffect(()=>{a(gT())},[a]),o}function wT(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),o=t.y-Math.round(r.y),a=r.height,i=o<a/2,s=!i,l=a/4,d=o>l&&o<a-l;return{x:n,inTopHalf:i,inBottomHalf:s,inMiddle:d,atTop:!d&&i,atBottom:!d&&s}}function CT(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function Za(e,t){return{parentId:e||null,index:t}}function $n(e,t){return{type:"line",index:e,level:t}}function ST(e){return{type:"highlight",id:e}}function Xs(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const o=((r=n.parent)===null||r===void 0?void 0:r.id)||null,a=yu(n)+1;return{parentId:o,index:a}}function $f(e){var t;const r=wT(e.element,e.offset),n=e.indent,o=Math.round(Math.max(0,r.x-n)/n),{node:a,nextNode:i,prevNode:s}=e,[l,d]=CT(a,s,i,r);if(a&&a.isInternal&&r.inMiddle)return{drop:Za(a.id,null),cursor:ST(a.id)};if(!l)return{drop:Za((t=d==null?void 0:d.parent)===null||t===void 0?void 0:t.id,0),cursor:$n(0,0)};if(hu(l)){const f=La(o,(d==null?void 0:d.level)||0,l.level);return{drop:Xs(l,f),cursor:$n(l.rowIndex+1,f)}}if(pu(l)){const f=La(o,(d==null?void 0:d.level)||0,l.level);return{drop:Xs(l,f),cursor:$n(l.rowIndex+1,f)}}if(gu(l)){const f=La(o,0,l.level+1);return f>l.level?{drop:Za(l.id,0),cursor:$n(l.rowIndex+1,f)}:{drop:Xs(l,f),cursor:$n(l.rowIndex+1,f)}}return{drop:Za(l==null?void 0:l.id,0),cursor:$n(l.rowIndex+1,l.level+1)}}function _T(e,t){const r=Nt(),[n,o]=Sf(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(a,i)=>{const s=i.getClientOffset();if(!e.current||!s)return;const{cursor:l,drop:d}=$f({element:e.current,offset:s,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});d&&r.dispatch(kn.hovering(d.parentId,d.index)),i.canDrop()?l&&r.showCursor(l):r.hideCursor()},drop:(a,i)=>{if(!i.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return o}function TT(e){const t=Nt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return h.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Bf=h.memo(function({index:t,style:r}){fu(),Vw();const n=Nt(),o=TT(t),a=h.useRef(null),i=bT(o),s=_T(a,o),l=h.useCallback(p=>{a.current=p,s(p)},[s]),d=n.indent*o.level,f=h.useMemo(()=>({paddingLeft:d}),[d]),u=h.useMemo(()=>{var p,y;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((y=(p=n.props.padding)!==null&&p!==void 0?p:n.props.paddingTop)!==null&&y!==void 0?y:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),m={role:"treeitem","aria-level":o.level+1,"aria-selected":o.isSelected,"aria-expanded":o.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};h.useEffect(()=>{var p;!o.isEditing&&o.isFocused&&((p=a.current)===null||p===void 0||p.focus({preventScroll:!0}))},[o.isEditing,o.isFocused,a.current]);const g=n.renderNode,w=n.renderRow;return c.jsx(w,{node:o,innerRef:l,attrs:m,children:c.jsx(g,{node:o,tree:n,style:f,dragHandle:i})})});let Js="",jf=null;function qf(){fu();const e=Nt();return c.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const o=Array.from(e.selectedIds);if(o.length>1){let a=e.mostRecentNode;for(;a&&a.isSelected;)a=a.nextSibling;a||(a=e.lastNode),e.focus(a,{scroll:!1}),e.delete(Array.from(o))}else{const a=e.focusedNode;if(a){const i=a.nextSibling,s=a.parent;e.focus(i||s,{scroll:!1}),e.delete(a)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),vu(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),bu(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const o=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const a=e.focusedNode;a?a.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const o=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(o);return}else{if(!o)return;const a=e.focusedNode;a?a.isSelected?e.selectContiguous(o):e.selectMulti(o):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const o=e.focusedNode;if(!o)return;o.isInternal&&o.isOpen?e.focus(e.nextNode):o.isInternal&&e.open(o.id);return}if(t.key==="ArrowLeft"){const o=e.focusedNode;if(!o||o.isRoot)return;o.isInternal&&o.isOpen?e.close(o.id):!((r=o.parent)===null||r===void 0)&&r.isRoot||e.focus(o.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const o=e.focusedNode;if(!o||!o.isEditable||!e.props.onRename)return;setTimeout(()=>{o&&e.edit(o)});return}if(t.key===" "){t.preventDefault();const o=e.focusedNode;if(!o)return;o.isLeaf?(o.select(),o.activate()):o.toggle();return}if(t.key==="*"){const o=e.focusedNode;if(!o)return;e.openSiblings(o);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(jf),Js+=t.key,jf=setTimeout(()=>{Js=""},600);const n=e.visibleNodes.find(o=>{const a=o.data.name;return typeof a=="string"?a.toLowerCase().startsWith(Js):!1});n&&e.focus(n.id)},children:c.jsx(ET,{})})}function ET(){var e,t;const r=Nt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:o=>{var a;return((a=r.visibleNodes[o])===null||a===void 0?void 0:a.id)||o},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:NC,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:LC,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?c.jsx(IC,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Bf})):c.jsx(OC,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Bf}))}function Uf(e){return e.isFiltered?OT(e.root,e.isMatch.bind(e)):IT(e.root)}function IT(e){const t=[];function r(n){var o;n.level>=0&&t.push(n),n.isOpen&&((o=n.children)===null||o===void 0||o.forEach(r))}return r(e),t.forEach(Vf),t}function OT(e,t){const r={},n=[];function o(i){if(!i.isRoot&&t(i)){r[i.id]=!0;let l=i.parent;for(;l;)r[l.id]=!0,l=l.parent}if(i.children)for(let l of i.children)o(l)}function a(i){var s;i.level>=0&&r[i.id]&&n.push(i),i.isOpen&&((s=i.children)===null||s===void 0||s.forEach(a))}return o(e),a(e),n.forEach(Vf),n}function Vf(e,t){e.rowIndex=t}const zf=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var el=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(f){try{d(n.next(f))}catch(u){i(u)}}function l(f){try{d(n.throw(f))}catch(u){i(u)}}function d(f){f.done?a(f.value):o(f.value).then(s,l)}d((n=n.apply(e,t||[])).next())})};const{safeRun:vt}=Gw;class Do{constructor(t,r,n,o){this.store=t,this.props=r,this.list=n,this.listEl=o,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=a=>{const i=this.props.rowHeight;if(typeof i=="function"){const s=this.at(a);return s?i(s):this.rowHeight}return i??24},this.rowTopPosition=a=>{if(typeof this.props.rowHeight!="function")return a*this.rowHeight;const i=this.getRowOffsets(),s=Math.max(0,Math.min(a,i.length-1));return i[s]},this.redrawList=(a=0)=>{this.rowOffsets=null;const i=this.list.current;i&&"resetAfterIndex"in i&&i.resetAfterIndex(Math.max(0,a))},this.root=Tu(this),this.visibleNodes=Uf(this),this.idToIndex=zf(this.visibleNodes)}update(t){this.props=t,this.root=Tu(this),this.visibleNodes=Uf(this),this.idToIndex=zf(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:(n,o)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(o.toLocaleLowerCase());return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=To(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=To(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof Io)return t.id;const r=this.props.idAccessor||"id";return To(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const o=(n=this.indexOf(t))!==null&&n!==void 0?n:0,a=this.indexOf(r);if(a===null)return[];const i=Math.min(o,a),s=Math.max(o,a);return this.visibleNodes.slice(i,s+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return el(this,arguments,void 0,function*(t={}){var r,n;const o=t.parentId===void 0?_u(this):t.parentId,a=(r=t.index)!==null&&r!==void 0?r:Su(this),i=(n=t.type)!==null&&n!==void 0?n:"leaf",s=yield vt(this.props.onCreate,{type:i,parentId:o,index:a,parentNode:this.get(o)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(t){return el(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(i=>this.identify(i)),o=n.map(i=>this.get(i)).filter(i=>!!i),a=o.length?Math.min(...o.map(i=>{var s;return(s=i.rowIndex)!==null&&s!==void 0?s:0})):0;yield vt(this.props.onDelete,{nodes:o,ids:n}),this.redrawList(a)})}edit(t){var r,n;const o=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(o),this.dispatch(Os(o)),this.redrawList((n=(r=this.get(o))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(a=>{Do.editPromise=a})}submit(t,r){return el(this,void 0,void 0,function*(){var n,o;if(!t)return;const a=this.identify(t);yield vt(this.props.onRename,{id:a,name:r,node:this.get(a)}),this.dispatch(Os(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Os(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&vt(this.props.onActivate,r)}resolveEdit(t){const r=Do.editPromise;r&&r(t),Do.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(Dn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&vt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,a=this.visibleStopIndex-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i>n?i=n:i=Math.max(n-a,0),this.focus(this.at(i))}pageDown(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex,a=o-n;let i=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;i<o?i=o:i=Math.min(i+a,this.visibleNodes.length-1),this.focus(this.at(i))}select(t,r={}){var n;if(!t)return;const o=r.focus!==!1,a=this.identify(t);o&&this.dispatch(Dn(a)),!((n=this.get(a))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[a],anchor:a,mostRecent:a}),this.scrollTo(a,r.align),this.focusedNode&&o&&vt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Nr.remove(r)),vt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const o=r.focus!==!1;o&&this.dispatch(Dn(n.id)),n.isSelectable&&(this.dispatch(Nr.add(n.id)),this.dispatch(Nr.anchor(n.id)),this.dispatch(Nr.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&o&&vt(this.props.onFocus,this.focusedNode),vt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(Dn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:o,mostRecent:a}=this.state.nodes.selection,i=this.filterSelectableNodes(this.nodesBetween(o,this.identifyNull(n)));this.dispatch(Nr.remove(this.nodesBetween(o,a))),this.dispatch(Nr.add(i)),this.dispatch(Nr.mostRecent(n))}this.scrollTo(n),this.focusedNode&&vt(this.props.onFocus,this.focusedNode),vt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const o=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:o,anchor:(t=o[0])!==null&&t!==void 0?t:null,mostRecent:(r=o[o.length-1])!==null&&r!==void 0?r:null}),this.dispatch(Dn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&vt(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(i=>this.identify(i))),o=this.identifyNull(t.anchor),a=this.identifyNull(t.mostRecent);this.dispatch(Nr.set({ids:n,anchor:o,mostRecent:a})),vt(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,o=this.props.disableDrop;for(const a of n)if(!a||!r||a.isInternal&&mu(r,a))return!1;return typeof o=="function"?!o({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof o=="string"?!r.data[o]:typeof o=="boolean"?!o:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;vt(this.props.onMove,{dragIds:n,parentId:t===Eo?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(kn.cursor({type:"none"}))}showCursor(t){this.dispatch(kn.cursor(t))}open(t,r=!0){var n,o;const a=this.identifyNull(t);a&&(this.isOpen(a)||(this.dispatch(As.open(a,this.isFiltered)),r&&this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),vt(this.props.onToggle,a)))}close(t,r=!0){var n,o;const a=this.identifyNull(t);a&&this.isOpen(a)&&(this.dispatch(As.close(a,this.isFiltered)),r&&this.redrawList((o=(n=this.get(a))===null||n===void 0?void 0:n.rowIndex)!==null&&o!==void 0?o:0),vt(this.props.onToggle,a))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=Is(this.root,r);let o=n==null?void 0:n.parent;for(;o;)this.open(o.id,!1),o=o.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let o of r.children)o.isInternal&&(n?this.close(o.id,!1):this.open(o.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){Pa(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){Pa(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),Cu(()=>n in this.idToIndex).then(()=>{var o;const a=this.idToIndex[n];a!==void 0&&((o=this.list.current)===null||o===void 0||o.scrollToItem(a,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,o;if(!t)return!1;if(t===Eo)return!0;const a=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(o=this.state.nodes.open.unfiltered[t])!==null&&o!==void 0?o:a}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!To(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:o}=this.state.nodes.drag;return r===n&&o===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(Dn(t.id))}onBlur(){this.dispatch(nC())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||qf}get renderRow(){return this.props.renderRow||Xw}get renderNode(){return this.props.children||Jw}get renderDragPreview(){return this.props.renderDragPreview||Iu}get renderCursor(){return this.props.renderCursor||Zw}}function bt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var AT=typeof Symbol=="function"&&Symbol.observable||"@@observable",Hf=AT,tl=()=>Math.random().toString(36).substring(7).split("").join("."),DT={INIT:`@@redux/INIT${tl()}`,REPLACE:`@@redux/REPLACE${tl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${tl()}`},Xr=DT;function Rf(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 NT(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(LT(e))return"date";if(xT(e))return"error";const r=kT(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 kT(e){return typeof e.constructor=="function"?e.constructor.name:null}function xT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function LT(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=NT(e)),t}function Qf(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?bt(2):`Expected the root reducer to be a function. Instead, received: '${kr(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?bt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?bt(1):`Expected the enhancer to be a function. Instead, received: '${kr(r)}'`);return r(Qf)(e,t)}let n=e,o=t,a=new Map,i=a,s=0,l=!1;function d(){i===a&&(i=new Map,a.forEach((y,v)=>{i.set(v,y)}))}function f(){if(l)throw new Error(process.env.NODE_ENV==="production"?bt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?bt(4):`Expected the listener to be a function. Instead, received: '${kr(y)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?bt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let v=!0;d();const b=s++;return i.set(b,y),function(){if(v){if(l)throw new Error(process.env.NODE_ENV==="production"?bt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,d(),i.delete(b),a=null}}}function m(y){if(!Rf(y))throw new Error(process.env.NODE_ENV==="production"?bt(7):`Actions must be plain objects. Instead, the actual type was: '${kr(y)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof y.type>"u")throw new Error(process.env.NODE_ENV==="production"?bt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof y.type!="string")throw new Error(process.env.NODE_ENV==="production"?bt(17):`Action "type" property must be a string. Instead, the actual type was: '${kr(y.type)}'. Value was: '${y.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?bt(9):"Reducers may not dispatch actions.");try{l=!0,o=n(o,y)}finally{l=!1}return(a=i).forEach(b=>{b()}),y}function g(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?bt(10):`Expected the nextReducer to be a function. Instead, received: '${kr(y)}`);n=y,m({type:Xr.REPLACE})}function w(){const y=u;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?bt(11):`Expected the observer to be an object. Instead, received: '${kr(v)}'`);function b(){const S=v;S.next&&S.next(f())}return b(),{unsubscribe:y(b)}},[Hf](){return this}}}return m({type:Xr.INIT}),{dispatch:m,subscribe:u,getState:f,replaceReducer:g,[Hf]:w}}function Gf(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function PT(e,t,r,n){const o=Object.keys(t),a=r&&r.type===Xr.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Rf(e))return`The ${a} has unexpected type of "${kr(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const i=Object.keys(e).filter(s=>!t.hasOwnProperty(s)&&!n[s]);if(i.forEach(s=>{n[s]=!0}),!(r&&r.type===Xr.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${a}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function FT(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Xr.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?bt(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Xr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?bt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Xr.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function Wf(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const s=t[i];process.env.NODE_ENV!=="production"&&typeof e[s]>"u"&&Gf(`No reducer provided for key "${s}"`),typeof e[s]=="function"&&(r[s]=e[s])}const n=Object.keys(r);let o;process.env.NODE_ENV!=="production"&&(o={});let a;try{FT(r)}catch(i){a=i}return function(s={},l){if(a)throw a;if(process.env.NODE_ENV!=="production"){const u=PT(s,r,l,o);u&&Gf(u)}let d=!1;const f={};for(let u=0;u<n.length;u++){const m=n[u],g=r[m],w=s[m],p=g(w,l);if(typeof p>"u"){const y=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?bt(14):`When called with an action of type ${y?`"${String(y)}"`:"(unknown type)"}, the slice reducer for key "${m}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}f[m]=p,d=d||p!==w}return d=d||n.length!==Object.keys(s).length,d?f:s}}function MT(e=Nn().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const $T=Wf({nodes:Wf({focus:oC,edit:rC,open:aC,selection:iC,drag:MT}),dnd:sC}),BT=Nn();function jT({treeProps:e,imperativeHandle:t,children:r}){const n=h.useRef(null),o=h.useRef(null),a=h.useRef(Qf($T,Nn(e))),i=Uw.useSyncExternalStore(a.current.subscribe,a.current.getState,()=>BT),s=h.useMemo(()=>new Do(a.current,e,n,o),[]),l=h.useRef(0);return h.useMemo(()=>{l.current+=1,s.update(e)},Object.values(e)),h.useMemo(()=>{l.current+=1,s.update(s.props)},[i.nodes.open]),h.useImperativeHandle(t,()=>s),h.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),h.useEffect(()=>{s.props.searchTerm||a.current.dispatch(As.clear(!0))},[s.props.searchTerm]),c.jsx(lu.Provider,{value:s,children:c.jsx(uu.Provider,{value:l.current,children:c.jsx(cu.Provider,{value:i.nodes,children:c.jsx(du.Provider,{value:i.dnd,children:c.jsx(m_,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||mT,options:{rootElement:s.props.dndRootElement||void 0}},{children:r}))})})})})}function qT(){const e=Nt(),[,t]=Sf(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const o=n.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:a,drop:i}=$f({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});i&&e.dispatch(kn.hovering(i.parentId,i.index)),n.canDrop()?a&&e.showCursor(a):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function UT(e){return qT(),e.children}function VT(){const t=Nt().props.renderContainer||qf;return c.jsx(c.Fragment,{children:c.jsx(t,{})})}function zT(){const e=Nt(),{offset:t,mouse:r,item:n,isDragging:o}=U0(i=>({offset:i.getSourceClientOffset(),mouse:i.getClientOffset(),item:i.getItem(),isDragging:i.isDragging()})),a=e.props.renderDragPreview||Iu;return c.jsx(a,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:o})}function HT(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",o=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:a=>a[n],getChildren:typeof o=="function"?o:a=>a[o],childrenKey:typeof o=="string"?o:"children"}}class RT{constructor(t,r={}){this.accessors=HT(r),this.root=QT(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const o=this.find(t,n);if(o)return o}return null}return null}}function QT(e,t){const r=new Kf({},null,t,"ROOT");return r.children=e.map(n=>rl(n,r,t)),r}function rl(e,t,r){const n=new Kf(e,t,r),o=r.getChildren(e);return o&&(n.children=o.map(a=>rl(a,n,r))),n}class Kf{constructor(t,r,n,o){this.data=t,this.parent=r,this.accessors=n,this.id=o??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,o;const a=rl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,a);const i=this.accessors.childrenKey,s=this.data;s[i]=(o=s[i])!==null&&o!==void 0?o:[],s[i].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let GT=0;function WT(e,t={}){const[r,n]=h.useState(e),o=t.idAccessor,a=t.childrenAccessor,i=h.useMemo(()=>new RT(r,{idAccessor:o,childrenAccessor:a}),[r,o,a]),s=w=>{for(const p of w.dragIds)i.move({id:p,parentId:w.parentId,index:w.index});n(i.data)},l=({name:w,id:p})=>{i.update({id:p,changes:{name:w}}),n(i.data)},d=typeof o=="string"?o:"id",f=typeof a=="string"?a:"children";return[r,{onMove:s,onRename:l,onCreate:({parentId:w,index:p,type:y})=>{if(typeof o=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(y==="internal"&&typeof a=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const v={[d]:`simple-tree-id-${GT++}`,name:""};return y==="internal"&&(v[f]=[]),i.create({parentId:w,index:p,data:v}),n(i.data),v},onDelete:w=>{w.ids.forEach(p=>i.drop({id:p})),n(i.data)}}]}function KT(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]=WT(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function YT(e,t){const r=KT(e);return c.jsxs(jT,{treeProps:r,imperativeHandle:t,children:[c.jsx(UT,{children:c.jsx(VT,{})}),c.jsx(zT,{})]})}const ZT=h.forwardRef(YT);function nl(){return Ae(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function XT(){return Ae(e=>{var o;if(!e.selectedNodeId)return!1;const t=(o=e.treeData[0])==null?void 0:o.id,r=a=>{var i;for(const s of a){if(s.id===e.selectedNodeId)return s;if((i=s.children)!=null&&i.length){const l=r(s.children);if(l)return l}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Yf={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",default:"#6B7280"},Zf={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",default:"File"},Xf=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource"],JT=[{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 e1(e){const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":"default"}function Xa(e){const t=e1(e);return{key:t,color:Yf[t]??Yf.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:Zf[t]??Zf.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const kt={row:"_row_i3qt2_1",grip:"_grip_i3qt2_16",menuBtn:"_menuBtn_i3qt2_19",selected:"_selected_i3qt2_23",title:"_title_i3qt2_28",dropTarget:"_dropTarget_i3qt2_33",toggle:"_toggle_i3qt2_50",ctIcon:"_ctIcon_i3qt2_65",folderIcon:"_folderIcon_i3qt2_77",renameInput:"_renameInput_i3qt2_92",dropHere:"_dropHere_i3qt2_101",menuWrap:"_menuWrap_i3qt2_111",menu:"_menu_i3qt2_19",dangerItem:"_dangerItem_i3qt2_163"},t1={video:Xi,pdf:ba,h5p:Qi,scorm:Wi,audio:Gi,quiz:Hi,default:Sn},r1=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[o,a]=h.useState(!1),[i,s]=h.useState(!1),[l,d]=h.useState(e.data.name),f=h.useRef(null),u=ce(),m=n==="edit",g=nl(),w=Xa(e.data),p=t1[w.key]??Sn,y=e.isSelected,v=e.level===0,b=e.data.isFolder??(e.children&&e.children.length>0),C=v?Ny:b?My:p;h.useEffect(()=>{if(!o)return;const I=k=>{var x;(x=f.current)!=null&&x.contains(k.target)||a(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[o]);const S=h.useCallback(()=>{l.trim()&&e.submit(l.trim()),s(!1)},[l,e]),T=h.useCallback(I=>{I.key==="Enter"&&S(),I.key==="Escape"&&(d(e.data.name),s(!1))},[S,e.data.name]);return c.jsxs("div",{className:[kt.row,y?kt.selected:"",e.state.isOver&&b?kt.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":b?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":b?!e.isClosed:void 0,children:[m&&c.jsx("span",{ref:r,className:kt.grip,"aria-hidden":"true",children:c.jsx(Yc,{size:14})}),c.jsx("button",{className:kt.toggle,onClick:I=>{I.stopPropagation(),e.toggle()},"aria-label":e.isClosed?u.treeNode.expandAriaLabel:u.treeNode.collapseAriaLabel,style:{visibility:b?"visible":"hidden"},children:e.isClosed?c.jsx(Qc,{size:14}):c.jsx(Cn,{size:14})}),c.jsx("span",{className:`${kt.ctIcon} ${v||b?kt.folderIcon:w.bgClass}`,"aria-hidden":"true",children:c.jsx(C,{size:12})}),i?c.jsx("input",{className:kt.renameInput,value:l,autoFocus:!0,onChange:I=>d(I.target.value),onBlur:S,onKeyDown:T,onClick:I=>I.stopPropagation()}):c.jsx("span",{className:kt.title,title:e.data.name,onDoubleClick:()=>m&&s(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&b&&c.jsx("span",{className:kt.dropHere,"aria-hidden":"true",children:u.treeNode.dropHereLabel}),m&&c.jsxs("div",{className:kt.menuWrap,ref:f,children:[c.jsx("button",{className:kt.menuBtn,onClick:I=>{I.stopPropagation(),a(k=>!k)},"aria-label":u.treeNode.nodeOptionsAriaLabel,children:c.jsx(Wc,{size:14})}),o&&c.jsxs("div",{className:kt.menu,role:"menu",children:[c.jsxs("button",{role:"menuitem",onClick:()=>{s(!0),a(!1)},children:[c.jsx(zy,{size:13})," ",u.treeNode.renameMenuItem]}),b&&g&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),a(!1)},children:[c.jsx(Kc,{size:13})," ",u.treeNode.addSubunitMenuItem]}),e.data.parent&&g&&c.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),a(!1)},children:[c.jsx(mo,{size:13})," ",u.treeNode.addSiblingMenuItem]}),c.jsxs("button",{role:"menuitem",className:kt.dangerItem,onClick:()=>{e.tree.delete(e.id),a(!1)},children:[c.jsx(Yi,{size:13})," ",u.treeNode.deleteMenuItem]})]})]})]})};async function n1(e,t){var a,i;const n=((a=(await ke.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:a.result)??{},o=((i=n.content)==null?void 0:i.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!o)throw new Error("Could not obtain an upload URL");return o}async function o1(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 a1(e,t){var s;const r=await n1(e,t.name),n=await o1(r,t),o=new FormData;return o.append("fileUrl",n),o.append("mimeType",t.type||"text/csv"),{processId:(((s=(await ke.post(`/action/collection/v1/import/${e}`,o)).data)==null?void 0:s.result)??{}).processId??""}}async function i1(e){var r;return((r=(await ke.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Jf(e){var n,o,a;const r=(a=(o=(n=(await ke.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:o.collection)==null?void 0:a.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function s1(e){return Jf(e)}const Le={container:"_container_jr3ij_1",header:"_header_jr3ij_13",title:"_title_jr3ij_22",closeBtn:"_closeBtn_jr3ij_29",body:"_body_jr3ij_45",dropZone:"_dropZone_jr3ij_54",dragOver:"_dragOver_jr3ij_67",hasFile:"_hasFile_jr3ij_72",hiddenInput:"_hiddenInput_jr3ij_78",fileInfo:"_fileInfo_jr3ij_82",fileIcon:"_fileIcon_jr3ij_89",fileName:"_fileName_jr3ij_93",fileSize:"_fileSize_jr3ij_100",dropHint:"_dropHint_jr3ij_105",dropIcon:"_dropIcon_jr3ij_112",dropText:"_dropText_jr3ij_117",dropSubtext:"_dropSubtext_jr3ij_124",sampleLink:"_sampleLink_jr3ij_130",statusBar:"_statusBar_jr3ij_145",status_uploading:"_status_uploading_jr3ij_154",status_processing:"_status_processing_jr3ij_154",status_done:"_status_done_jr3ij_159",status_error:"_status_error_jr3ij_164",successDetail:"_successDetail_jr3ij_170",spinner:"_spinner_jr3ij_175",spin:"_spin_jr3ij_175",errorMsg:"_errorMsg_jr3ij_191",failedSection:"_failedSection_jr3ij_197",failedTitle:"_failedTitle_jr3ij_203",tableWrap:"_tableWrap_jr3ij_213",failedTable:"_failedTable_jr3ij_219",reasonCell:"_reasonCell_jr3ij_244",footer:"_footer_jr3ij_248"},l1=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const o=ce(),[a,i]=h.useState(null),[s,l]=h.useState(!1),[d,f]=h.useState("idle"),[u,m]=h.useState(""),[g,w]=h.useState([]),[p,y]=h.useState(null),v=h.useRef(null),b=h.useRef(null),C=h.useCallback(()=>{b.current!==null&&(clearInterval(b.current),b.current=null)},[]);h.useEffect(()=>()=>C(),[C]);const S=N=>N.name.toLowerCase().endsWith(".csv")?N.size>50*1024*1024?(m(o.csvUpload.fileTooLarge),!1):!0:(m(o.csvUpload.invalidFileType),!1),T=h.useCallback(N=>{m(""),w([]),y(null),f("idle"),S(N)&&i(N)},[]),I=h.useCallback(N=>{N.preventDefault(),l(!1);const P=N.dataTransfer.files[0];P&&T(P)},[T]),k=h.useCallback(N=>{var M;const P=(M=N.target.files)==null?void 0:M[0];P&&T(P),N.target.value=""},[T]),x=h.useCallback(async()=>{try{const N=await s1(e),P=document.createElement("a");P.href=N,P.download="sample_hierarchy.csv",P.target="_blank",P.click()}catch{m(o.csvUpload.downloadSampleFailed)}},[e,o.csvUpload.downloadSampleFailed]),B=h.useCallback(async()=>{if(a){f("uploading"),m(""),w([]);try{const{processId:N}=await a1(e,a);if(!N){f("done"),y(null),setTimeout(t,1500);return}f("processing"),b.current=setInterval(async()=>{try{const P=await i1(N);P.status==="COMPLETED"?(C(),f("done"),y(P.successCount??null),P.failedRecords&&P.failedRecords.length>0?w(P.failedRecords):setTimeout(t,1500)):P.status==="FAILED"&&(C(),f("error"),m(o.csvUpload.processingFailed),P.failedRecords&&w(P.failedRecords))}catch{C(),f("error"),m(o.csvUpload.connectionLost)}},2e3)}catch{f("error"),m(o.csvUpload.uploadFailed)}}},[e,a,t,C,o.csvUpload.processingFailed,o.csvUpload.connectionLost,o.csvUpload.uploadFailed]),q={idle:"",uploading:o.csvUpload.statusUploading,processing:o.csvUpload.statusProcessing,done:o.csvUpload.statusDone,error:o.csvUpload.statusError};return c.jsxs("div",{className:Le.container,children:[c.jsxs("div",{className:Le.header,children:[c.jsx("h2",{className:Le.title,children:n==="update"?o.csvUpload.titleUpdate:o.csvUpload.titleCreate}),c.jsx("button",{className:Le.closeBtn,onClick:r,"aria-label":o.csvUpload.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:Le.body,children:[c.jsxs("div",{className:`${Le.dropZone} ${s?Le.dragOver:""} ${a?Le.hasFile:""}`,onDragEnter:N=>{N.preventDefault(),l(!0)},onDragOver:N=>{N.preventDefault(),l(!0)},onDragLeave:N=>{N.preventDefault(),l(!1)},onDrop:I,onClick:()=>{var N;return(N=v.current)==null?void 0:N.click()},role:"button",tabIndex:0,"aria-label":o.csvUpload.dropZoneAriaLabel,onKeyDown:N=>{var P;return N.key==="Enter"&&((P=v.current)==null?void 0:P.click())},children:[c.jsx("input",{ref:v,type:"file",accept:".csv",className:Le.hiddenInput,onChange:k,"aria-hidden":"true"}),a?c.jsxs("div",{className:Le.fileInfo,children:[c.jsx(ba,{size:24,className:Le.fileIcon}),c.jsx("span",{className:Le.fileName,children:a.name}),c.jsxs("span",{className:Le.fileSize,children:["(",(a.size/1024).toFixed(1)," KB)"]})]}):c.jsxs("div",{className:Le.dropHint,children:[c.jsx(Zi,{size:32,className:Le.dropIcon}),c.jsx("p",{className:Le.dropText,children:o.csvUpload.dropText}),c.jsx("p",{className:Le.dropSubtext,children:o.csvUpload.dropSubtext})]})]}),c.jsx("button",{className:Le.sampleLink,onClick:x,type:"button",children:o.csvUpload.downloadSample}),d!=="idle"&&c.jsxs("div",{className:`${Le.statusBar} ${Le[`status_${d}`]}`,role:"status","aria-live":"polite",children:[d==="processing"&&c.jsx("span",{className:Le.spinner,"aria-hidden":"true"}),q[d],d==="done"&&p!==null&&c.jsx("span",{className:Le.successDetail,children:o.csvUpload.itemsImportedSuffix.replace("{count}",String(p))})]}),u&&c.jsx("p",{className:Le.errorMsg,role:"alert",children:u}),g.length>0&&c.jsxs("div",{className:Le.failedSection,children:[c.jsx("h4",{className:Le.failedTitle,children:o.csvUpload.failedRowsTitle.replace("{count}",String(g.length))}),c.jsx("div",{className:Le.tableWrap,children:c.jsxs("table",{className:Le.failedTable,children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:o.csvUpload.rowHeader}),c.jsx("th",{children:o.csvUpload.nameHeader}),c.jsx("th",{children:o.csvUpload.reasonHeader})]})}),c.jsx("tbody",{children:g.map((N,P)=>c.jsxs("tr",{children:[c.jsx("td",{children:N.rowNumber??P+1}),c.jsx("td",{children:N.name??"—"}),c.jsx("td",{className:Le.reasonCell,children:N.reason??o.csvUpload.unknownError})]},P))})]})})]})]}),c.jsxs("div",{className:Le.footer,children:[c.jsx($e,{variant:"ghost",onClick:r,disabled:d==="uploading"||d==="processing",children:o.csvUpload.cancel}),c.jsx($e,{variant:"primary",isLoading:d==="uploading"||d==="processing",disabled:!a||d==="done",onClick:B,children:d==="done"?o.csvUpload.uploaded:o.csvUpload.upload})]})]})},sr={container:"_container_1y30m_1",header:"_header_1y30m_8",headerActions:"_headerActions_1y30m_19",iconBtn:"_iconBtn_1y30m_25",menuWrap:"_menuWrap_1y30m_43",dropdownMenu:"_dropdownMenu_1y30m_47",treeWrapper:"_treeWrapper_1y30m_79",csvModal:"_csvModal_1y30m_95",footer:"_footer_1y30m_105"},c1=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var ue;const n=ce(),o=h.useRef(null),a=h.useRef(null),i=h.useRef(null),[s,l]=h.useState(400),[d,f]=h.useState(!1),[u,m]=h.useState(!1),[g,w]=h.useState("create"),{treeData:p,selectedNodeId:y,selectNode:v,addNode:b,deleteNode:C,reorderChildren:S,moveNode:T,setTreeData:I}=Ae(),k=e==="edit",x=nl(),B=k&&x,q=(((ue=p[0])==null?void 0:ue.children)??[]).some(Q=>Q.isFolder),N=le(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)??""}),P=le(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});h.useEffect(()=>{const Q=a.current;if(!Q)return;const ne=new ResizeObserver(()=>{l(Q.clientHeight||400)});return ne.observe(Q),l(Q.clientHeight||400),()=>ne.disconnect()},[]),h.useEffect(()=>{if(!d)return;const Q=ne=>{var te;(te=i.current)!=null&&te.contains(ne.target)||f(!1)};return document.addEventListener("mousedown",Q),()=>document.removeEventListener("mousedown",Q)},[d]);const M=h.useCallback(Q=>{Q.length>0&&v(Q[0].data.id)},[v]),L=h.useCallback(({parentId:Q,index:ne,dragIds:te})=>{if(!Q)return;const U=te[0],H=ol(p,U);if(!H)return;const ae=H.parent;if(ae===Q){const fe=ol(p,Q);if(!(fe!=null&&fe.children))return;const J=fe.children.findIndex(oe=>oe.id===U);if(J<0)return;S(Q,J,ne>J?ne-1:ne)}else T(U,ae??"",Q)},[p,S,T]),F=h.useCallback(({ids:Q})=>{Q.forEach(ne=>C(ne))},[C]),z=h.useCallback(({parentId:Q})=>{var U;const ne=Q??((U=p[0])==null?void 0:U.id)??"";if(!ne)return{id:crypto.randomUUID()};const te=b(ne,"unit");return te?{id:te}:(Ie.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[b,p,n]),X=h.useCallback(()=>{var ne;const Q=(ne=p[0])==null?void 0:ne.id;Q&&(b(Q,"unit")||Ie.error(n.outlineTree.maxDepthReachedToast))},[p,b,n]),ve=h.useCallback(()=>{y&&(b(y,"subunit")||Ie.error(n.outlineTree.maxDepthReachedToast))},[y,b,n]),Ee=h.useCallback(async()=>{if(f(!1),!!N)try{const Q=await Jf(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{Ie.error(n.outlineTree.downloadCsvFailedToast)}},[N,n]),Ce=h.useCallback(async()=>{if(m(!1),!!N)try{const{rootNode:Q}=await su(N);I([Q]),Ie.success(n.outlineTree.outlineRefreshedToast)}catch{Ie.error(n.outlineTree.outlineRefreshFailedToast)}},[N,I,n]);return c.jsxs("div",{className:sr.container,children:[c.jsx("div",{className:sr.header,children:c.jsxs("div",{className:sr.headerActions,children:[k&&c.jsxs("div",{className:sr.menuWrap,ref:i,children:[c.jsx("button",{type:"button",className:sr.iconBtn,onClick:()=>f(Q=>!Q),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":d,children:c.jsx(Wc,{size:15})}),d&&c.jsx("div",{className:sr.dropdownMenu,role:"menu",children:P&&c.jsxs(c.Fragment,{children:[c.jsx("button",{role:"menuitem",type:"button",disabled:q,title:q?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{f(!1),w("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!q,title:q?void 0:n.outlineTree.noFoldersYetTitle,onClick:Ee,children:n.outlineTree.downloadFoldersCsvButton}),c.jsx("button",{role:"menuitem",type:"button",disabled:!q,title:q?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{f(!1),w("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})})]}),r&&c.jsx("button",{type:"button",className:sr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?c.jsx(Uy,{size:15}):c.jsx(qy,{size:15})})]})}),c.jsx("div",{className:sr.treeWrapper,ref:a,children:c.jsx(ZT,{ref:o,data:p,idAccessor:"id",childrenAccessor:"children",onSelect:M,onMove:k?L:void 0,onDelete:k?F:void 0,onCreate:k?z:void 0,disableEdit:!k,disableDrop:!k,selection:y??void 0,rowHeight:40,indent:20,paddingBottom:16,height:s,width:"100%",children:Q=>c.jsx(r1,{...Q,editorMode:e})})}),k&&c.jsxs("div",{className:sr.footer,children:[c.jsxs($e,{variant:"ghost",size:"sm",onClick:X,disabled:!B,children:[c.jsx(mo,{size:14})," ",n.outlineTree.addUnitButton]}),c.jsxs($e,{variant:"ghost",size:"sm",onClick:ve,disabled:!B||!y,children:[c.jsx(Kc,{size:14})," ",n.outlineTree.addSubunitButton]})]}),u&&c.jsx("div",{className:sr.csvModal,children:c.jsx(l1,{contentId:N,mode:g,onComplete:Ce,onClose:()=>m(!1)})})]})};function ol(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=ol(r.children,t);if(n)return n}}}const No={breadcrumb:"_breadcrumb_zd1aj_1",crumb:"_crumb_zd1aj_10",sep:"_sep_zd1aj_26",current:"_current_zd1aj_31"},d1=({crumbs:e})=>{const t=Ae(n=>n.selectNode),r=ce();return e.length?c.jsxs("nav",{className:No.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[c.jsx("button",{className:No.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:c.jsx(By,{size:13})}),e.map((n,o)=>c.jsxs(h.Fragment,{children:[c.jsx(Qc,{size:13,className:No.sep}),o<e.length-1?c.jsx("button",{className:No.crumb,onClick:()=>t(n.id),children:n.name}):c.jsx("span",{className:No.current,children:n.name})]},n.id))]}):null},ko={tabBar:"_tabBar_qhks1_1",tab:"_tab_qhks1_1",active:"_active_qhks1_29",error:"_error_qhks1_35",errorDot:"_errorDot_qhks1_39"},u1=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const o=ce(),a=[{id:"details",label:o.tabBar.detailsTab},{id:"audience",label:o.tabBar.audienceCurriculumTab},{id:"licensing",label:o.tabBar.licensingTab}],i=n?a.filter(s=>n.includes(s.id)):a;return c.jsx("div",{className:ko.tabBar,role:"tablist","aria-label":o.tabBar.metadataSectionsAriaLabel,children:i.map(s=>c.jsxs("button",{role:"tab","aria-selected":e===s.id,"aria-controls":`panel-${s.id}`,className:[ko.tab,e===s.id?ko.active:"",r.includes(s.id)?ko.error:""].join(" "),onClick:()=>t(s.id),children:[s.label,r.includes(s.id)&&c.jsx("span",{className:ko.errorDot,"aria-label":o.tabBar.hasErrorsAriaLabel})]},s.id))})};var xo=e=>e.type==="checkbox",Jr=e=>e instanceof Date,ht=e=>e==null;const eh=e=>typeof e=="object";var Qe=e=>!ht(e)&&!Array.isArray(e)&&eh(e)&&!Jr(e),al=e=>Qe(e)&&e.target?xo(e.target)?e.target.checked:e.target.value:e,th=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),rh=e=>{const t=e.constructor&&e.constructor.prototype;return Qe(t)&&t.hasOwnProperty("isPrototypeOf")},Ja=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ze(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ja&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Qe(e)&&rh(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=Ze(e[o]));return n}const xr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Jt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},er={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},il="form",nh="root",oh=["__proto__","constructor","prototype"];var Lo=e=>/^\w*$/.test(e),qe=e=>e===void 0,ei=e=>e.split(/[.[\]'"]/g).filter(Boolean),W=(e,t,r)=>{if(!t||!Qe(e))return r;const n=Lo(t)?[t]:ei(t);if(n.some(a=>oh.includes(a)))return r;const o=n.reduce((a,i)=>ht(a)?void 0:a[i],e);return qe(o)||o===e?qe(e[t])?r:e[t]:o},Mt=e=>typeof e=="boolean",wt=e=>typeof e=="function",Be=(e,t,r)=>{let n=-1;const o=Lo(t)?[t]:ei(t),a=o.length,i=a-1;for(;++n<a;){const s=o[n];let l=r;if(n!==i){const d=e[s];l=Qe(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(oh.includes(s))return;e[s]=l,e=e[s]}};const sl=h.createContext(null);sl.displayName="HookFormControlContext";const ll=()=>h.useContext(sl);var ah=(e,t,r,n=!0)=>{const o={};for(const a in e)Object.defineProperty(o,a,{get:()=>{const i=a;return t._proxyFormState[i]!==Jt.all&&(t._proxyFormState[i]=!n||Jt.all),r&&(r[i]=!0),e[i]}});return o};const cl=Ja?h.useLayoutEffect:h.useEffect;function f1(e){const t=ll(),{control:r=t,disabled:n,name:o,exact:a}=e||{},[i,s]=h.useState(()=>({...r._formState,defaultValues:r._defaultValues})),l=h.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return cl(()=>r._subscribe({name:o,formState:l.current,exact:a,callback:d=>{!n&&s({...r._formState,...d,defaultValues:r._defaultValues})}}),[o,n,a]),h.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),h.useMemo(()=>ah(i,r,l.current,!1),[i,r])}var Ct=e=>typeof e=="string",dl=(e,t,r,n,o)=>Ct(e)?(n&&t.watch.add(e),W(r,e,o)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),W(r,a))):(n&&(t.watchAll=!0),r),ul=e=>ht(e)||!eh(e);const ih=(e,t)=>t.length===0&&!Array.isArray(e)&&!rh(e);function $t(e,t,r=new WeakMap){if(e===t)return!0;if(ul(e)||ul(t))return Object.is(e,t);if(Jr(e)&&Jr(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(ih(e,n)||ih(t,o))return Object.is(e,t);const a=r.get(e);if(a&&a.has(t))return!0;a?a.add(t):r.set(e,new WeakSet([t]));for(const i of n){const s=e[i];if(!(i in t))return!1;if(i!=="ref"){const l=t[i];if(Jr(s)&&Jr(l)||(Qe(s)||Array.isArray(s))&&(Qe(l)||Array.isArray(l))?!$t(s,l,r):!Object.is(s,l))return!1}}return!0}function h1(e){const t=ll(),{control:r=t,name:n,defaultValue:o,disabled:a,exact:i,compute:s}=e||{},l=h.useRef(o),d=h.useRef(s),f=h.useRef(void 0),u=h.useRef(r),m=h.useRef(n);d.current=s;const[g,w]=h.useState(()=>{const S=r._getWatch(n,l.current);return d.current?d.current(S):S}),p=h.useCallback(S=>{const T=dl(n,r._names,S||r._formValues,!1,l.current);return d.current?d.current(T):T},[r._formValues,r._names,n]),y=h.useCallback(S=>{if(!a){const T=dl(n,r._names,S||r._formValues,!1,l.current);if(d.current){const I=d.current(T);$t(I,f.current)||(w(I),f.current=I)}else w(T)}},[r._formValues,r._names,a,n]);cl(()=>((u.current!==r||!$t(m.current,n))&&(u.current=r,m.current=n,y()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:S=>{y(S.values)}})),[r,i,n,y]),h.useEffect(()=>r._removeUnmounted());const v=u.current!==r,b=m.current,C=h.useMemo(()=>{if(a)return null;const S=!v&&!$t(b,n);return v||S?p():null},[a,v,n,b,p]);return C!==null?C:g}function ti(e){const t=ll(),{name:r,disabled:n,control:o=t,shouldUnregister:a,defaultValue:i,exact:s=!0}=e,l=th(o._names.array,r),d=h.useMemo(()=>W(o._formValues,r,W(o._defaultValues,r,i)),[o,r,i]),f=h1({control:o,name:r,defaultValue:d,exact:s}),u=f1({control:o,name:r,exact:s}),m=h.useRef(e),g=h.useRef(null),w=h.useRef(o.register(r,{...e.rules,value:f,...Mt(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const p=h.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!W(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!W(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!W(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!W(u.validatingFields,r)},error:{enumerable:!0,get:()=>W(u.errors,r)}}),[u,r]),y=h.useCallback(S=>{const T=al(S);return W(o._fields,r)||(w.current=o.register(r,{...m.current.rules,value:T})),w.current.onChange({target:{value:al(S),name:r},type:xr.CHANGE})},[r,o]),v=h.useCallback(()=>w.current.onBlur({target:{value:W(o._formValues,r),name:r},type:xr.BLUR}),[r,o._formValues]),b=h.useCallback(S=>{S&&(g.current={focus:()=>wt(S.focus)&&S.focus(),select:()=>wt(S.select)&&S.select(),setCustomValidity:I=>wt(S.setCustomValidity)&&S.setCustomValidity(I),reportValidity:()=>wt(S.reportValidity)&&S.reportValidity()});const T=W(o._fields,r);T&&T._f&&S&&(T._f.ref=g.current)},[o._fields,r]),C=h.useMemo(()=>({name:r,value:f,...Mt(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:y,onBlur:v,ref:b}),[r,n,u.disabled,y,v,b,f]);return h.useEffect(()=>{const S=o._options.shouldUnregister||a;o.register(r,{...m.current.rules,...Mt(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(I,k)=>{const x=W(o._fields,I);x&&x._f&&(x._f.mount=k)};if(T(r,!0),S){const I=Ze(W(a?o._defaultValues:o._options.values||o._defaultValues,r,W(o._options.defaultValues,r,m.current.defaultValue)));Be(o._defaultValues,r,I),qe(W(o._formValues,r))&&Be(o._formValues,r,I)}if(!l&&o.register(r),g.current){const I=W(o._fields,r);I&&I._f&&(I._f.ref=g.current)}return()=>{(l?S&&!o._state.action:S)?o.unregister(r):T(r,!1)}},[r,o,l,a]),h.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),h.useMemo(()=>({field:C,formState:u,fieldState:p}),[C,u,p])}const fl=h.createContext(null);fl.displayName="HookFormContext";const tr=()=>h.useContext(fl),p1=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:a,setValue:i,setValues:s,trigger:l,formState:d,resetField:f,reset:u,handleSubmit:m,unregister:g,control:w,register:p,setFocus:y,subscribe:v})=>{const b=h.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:a,setValue:i,setValues:s,trigger:l,formState:d,resetField:f,reset:u,handleSubmit:m,unregister:g,control:w,register:p,setFocus:y,subscribe:v}),[a,w,d,n,r,m,p,u,f,o,y,i,s,v,l,g,t]);return h.createElement(fl.Provider,{value:b},h.createElement(sl.Provider,{value:b.control},e))};var g1=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},sh=e=>Array.isArray(e)?e.filter(Boolean):[],ri=e=>Array.isArray(e)?e:[e],lh=()=>{let e=[];return{get observers(){return e},next:o=>{for(const a of e)a.next&&a.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(a=>a!==o)}}),unsubscribe:()=>{e=[]}}};function ch(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],a=t[n];if(o&&Qe(o)&&a){const i=ch(o,a);Qe(i)&&(r[n]=i)}else e[n]&&(r[n]=a)}return r}var at=e=>Qe(e)&&!Object.keys(e).length,hl=e=>e.type==="file",ni=e=>{if(!Ja)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},dh=e=>e.type==="select-multiple",pl=e=>e.type==="radio",m1=e=>pl(e)||xo(e),gl=e=>ni(e)&&e.isConnected;function y1(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(ht(e)){e=void 0;break}e=e[t[n]],n++}return e}function v1(e){for(const t in e)if(e.hasOwnProperty(t)&&!qe(e[t]))return!1;return!0}function tt(e,t){if(Ct(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Lo(t)?[t]:ei(t),n=r.length===1?e:y1(e,r),o=r.length-1,a=r[o];return n&&delete n[a],o!==0&&(Qe(n)&&at(n)||Array.isArray(n)&&v1(n))&&tt(e,r.slice(0,-1)),e}var b1=e=>{for(const t in e)if(wt(e[t]))return!0;return!1};function uh(e){return Array.isArray(e)||Qe(e)&&!b1(e)}function ml(e,t={}){for(const r in e){const n=e[r];uh(n)?(t[r]=Array.isArray(n)?[]:{},ml(n,t[r])):qe(n)||(t[r]=!0)}return t}function yl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>yl(r));return t.some(r=>r!==void 0)?t:void 0}if(Qe(e)){const t={};for(const r in e){const n=yl(e[r]);qe(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function en(e,t,r){r||(r=ml(t));for(const n in e){const o=e[n];if(uh(o))qe(t)||ul(r[n])?r[n]=ml(o,Array.isArray(o)?[]:{}):en(o,ht(t)?{}:t[n],r[n]);else{const a=t[n];r[n]=!$t(o,a)}}return yl(r)||{}}const fh={value:!1,isValid:!1},hh={value:!0,isValid:!0};var ph=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!qe(e[0].attributes.value)?qe(e[0].value)||e[0].value===""?hh:{value:e[0].value,isValid:!0}:hh:fh}return fh},gh=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>qe(e)?e:t?e===""?NaN:e&&+e:r&&Ct(e)?new Date(e):n?n(e):e;const mh={isValid:!1,value:null};var yh=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,mh):mh;function vh(e){const t=e.ref;return hl(t)?t.files:pl(t)?yh(e.refs).value:dh(t)?[...t.selectedOptions].map(({value:r})=>r):xo(t)?ph(e.refs).value:gh(qe(t.value)?e.ref.value:t.value,e)}var w1=(e,t,r,n)=>{const o={};for(const a of e){const i=W(t,a);i&&Be(o,a,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},oi=e=>e instanceof RegExp,Po=e=>qe(e)?e:oi(e)?e.source:Qe(e)?oi(e.value)?e.value.source:e.value:e,bh=e=>({isOnSubmit:!e||e===Jt.onSubmit,isOnBlur:e===Jt.onBlur,isOnChange:e===Jt.onChange,isOnAll:e===Jt.all,isOnTouch:e===Jt.onTouched});const wh="AsyncFunction";var C1=e=>!!e&&!!e.validate&&!!(wt(e.validate)&&e.validate.constructor.name===wh||Qe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===wh)),S1=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),vl=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Fo=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const a=W(e,o);if(a){const{_f:i,...s}=a;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Fo(s,t))break}else if(Qe(s)&&Fo(s,t))break}}};function Ch(e,t,r){const n=W(e,r);if(n||Lo(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),i=W(t,a),s=W(e,a);if(i&&!Array.isArray(i)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};o.pop()}return{name:r}}var _1=(e,t,r,n)=>{r(e);const{name:o,...a}=e;return at(a)||n&&Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(i=>t[i]===(!n||Jt.all))},T1=(e,t,r)=>!e||!t||e===t||ri(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),E1=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,I1=(e,t)=>!sh(W(e,t)).length&&tt(e,t),Sh=(e,t,r)=>{const n=W(e,r),o=Array.isArray(n)?n:[];return Be(o,nh,t[r]),Be(e,r,o),e};function _h(e,t,r="validate"){if(Ct(e)||Array.isArray(e)&&e.every(Ct)||Mt(e)&&!e)return{type:r,message:Ct(e)?e:"",ref:t}}var Bn=e=>Qe(e)&&!oi(e)?e:{value:e,message:""},Th=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:d,minLength:f,min:u,max:m,pattern:g,validate:w,name:p,valueAsNumber:y,mount:v}=e._f,b=W(r,p);if(!v||t.has(p))return{};const C=s?s[0]:i,S=P=>{if(o&&C.reportValidity){const M=Mt(P)?"":P||"";s?s.forEach(L=>L.setCustomValidity(M)):C.setCustomValidity(M),C.reportValidity()}},T={},I=pl(i),k=xo(i),x=I||k,B=(y||hl(i))&&qe(i.value)&&qe(b)||ni(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,q=g1.bind(null,p,n,T),N=(P,M,L,F=er.maxLength,z=er.minLength)=>{const X=P?M:L;T[p]={type:P?F:z,message:X,ref:i,...q(P?F:z,X)}};if(a?!Array.isArray(b)||!b.length:l&&(!x&&(B||ht(b))||Mt(b)&&!b||k&&!ph(s).isValid||I&&!yh(s).isValid)){const{value:P,message:M}=Ct(l)?{value:!!l,message:l}:Bn(l);if(P&&(T[p]={type:er.required,message:M,ref:C,...q(er.required,M)},!n))return S(M),T}if(!B&&(!ht(u)||!ht(m))){let P,M;const L=Bn(m),F=Bn(u);if(!ht(b)&&!isNaN(b)){const z=i.valueAsNumber||b&&+b;ht(L.value)||(P=z>L.value),ht(F.value)||(M=z<F.value)}else{const z=i.valueAsDate||new Date(b),X=Ce=>new Date(new Date().toDateString()+" "+Ce),ve=i.type=="time",Ee=i.type=="week";Ct(L.value)&&b&&(P=ve?X(b)>X(L.value):Ee?b>L.value:z>new Date(L.value)),Ct(F.value)&&b&&(M=ve?X(b)<X(F.value):Ee?b<F.value:z<new Date(F.value))}if((P||M)&&(N(!!P,L.message,F.message,er.max,er.min),!n))return S(T[p].message),T}if((d||f)&&!B&&(Ct(b)||a&&Array.isArray(b))){const P=Bn(d),M=Bn(f),L=!ht(P.value)&&b.length>+P.value,F=!ht(M.value)&&b.length<+M.value;if((L||F)&&(N(L,P.message,M.message),!n))return S(T[p].message),T}if(g&&!B&&Ct(b)){const{value:P,message:M}=Bn(g);if(oi(P)&&!b.match(P)&&(T[p]={type:er.pattern,message:M,ref:i,...q(er.pattern,M)},!n))return S(M),T}if(w){if(wt(w)){const P=await w(b,r),M=_h(P,C);if(M&&(T[p]={...M,...q(er.validate,M.message)},!n))return S(M.message),T}else if(Qe(w)){let P={};for(const M in w){if(!at(P)&&!n)break;const L=_h(await w[M](b,r),C,M);L&&(P={...L,...q(M,L.message)},S(L.message),n&&(T[p]=P))}if(!at(P)&&(T[p]={ref:C,...P},!n))return T}}return S(!0),T};const O1={mode:Jt.onSubmit,reValidateMode:Jt.onChange,shouldFocusError:!0},Eh={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function A1(e={}){let t={...O1,...e},r={...Ze(Eh),isLoading:wt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=Qe(t.defaultValues)||Qe(t.values)?Ze(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ze(o),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,d=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...f};let m={...u};const g={array:lh(),state:lh()},w=t.criteriaMode===Jt.all,p=_=>A=>{clearTimeout(d),d=setTimeout(_,A)},y=async _=>{if(!i.keepIsValid&&!t.disabled&&(u.isValid||m.isValid||_)){let A;t.resolver?(A=at((await q()).errors),v()):A=await M({fields:n,onlyCheckValid:!0,eventType:xr.VALID}),A!==r.isValid&&g.state.next({isValid:A})}},v=(_,A)=>{!t.disabled&&(u.isValidating||u.validatingFields||m.isValidating||m.validatingFields)&&((_||Array.from(s.mount)).forEach(D=>{D&&(A?Be(r.validatingFields,D,A):tt(r.validatingFields,D))}),g.state.next({validatingFields:r.validatingFields,isValidating:!at(r.validatingFields)}))},b=()=>{r.dirtyFields=en(o,a)},C=(_,A=[],D,V,j=!0,G=!0)=>{if(V&&D&&!t.disabled){if(i.action=!0,G&&Array.isArray(W(n,_))){const R=D(W(n,_),V.argA,V.argB);j&&Be(n,_,R)}if(G&&Array.isArray(W(r.errors,_))){const R=D(W(r.errors,_),V.argA,V.argB);j&&Be(r.errors,_,R),I1(r.errors,_)}if((u.touchedFields||m.touchedFields)&&G&&Array.isArray(W(r.touchedFields,_))){const R=D(W(r.touchedFields,_),V.argA,V.argB);j&&Be(r.touchedFields,_,R)}(u.dirtyFields||m.dirtyFields)&&b(),g.state.next({name:_,isDirty:F(_,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Be(a,_,A)},S=(_,A)=>{Be(r.errors,_,A),r.errors={...r.errors},g.state.next({errors:r.errors})},T=_=>{r.errors=_,g.state.next({errors:r.errors,isValid:!1})},I=_=>{const A=Lo(_)?[_]:ei(_);let D=a,V=o;for(let j=0;j<A.length-1;j++){const G=A[j];if(D=ht(D)?D:D[G],V=ht(V)?V:V[G],D===null&&V!==null)return!0}return!1},k=(_,A,D,V)=>{const j=W(n,_);if(j){if(I(_))return;const G=qe(W(a,_)),R=W(a,_,qe(D)?W(o,_):D);qe(R)||V&&V.defaultChecked||A?Be(a,_,A?R:vh(j._f)):ve(_,R),i.mount&&!i.action&&(y(),G&&r.isDirty&&(u.isDirty||m.isDirty)&&(F()||(r.isDirty=!1,g.state.next({...r}))),e.shouldUnregister&&G&&!qe(W(a,_))&&vl(_,s)&&(i.watch=!0))}},x=(_,A,D,V,j)=>{let G=!1,R=!1;const ee={name:_};if(!t.disabled){if(!D||V){(u.isDirty||m.isDirty)&&(R=r.isDirty,r.isDirty=ee.isDirty=F(),G=R!==ee.isDirty);const ye=$t(W(o,_),A);R=!!W(r.dirtyFields,_),ye!==r.isDirty?r.dirtyFields=en(o,a):ye?tt(r.dirtyFields,_):Be(r.dirtyFields,_,!0),ee.dirtyFields=r.dirtyFields,G=G||(u.dirtyFields||m.dirtyFields)&&R!==!ye}if(D){const ye=W(r.touchedFields,_);ye||(Be(r.touchedFields,_,D),ee.touchedFields=r.touchedFields,G=G||(u.touchedFields||m.touchedFields)&&ye!==D)}G&&j&&g.state.next(ee)}return G?ee:{}},B=(_,A,D,V)=>{const j=W(r.errors,_),G=(u.isValid||m.isValid)&&Mt(A)&&r.isValid!==A;if(t.delayError&&D?(l=p(()=>S(_,D)),l(t.delayError)):(clearTimeout(d),l=null,D?Be(r.errors,_,D):tt(r.errors,_),r.errors={...r.errors}),(D?!$t(j,D):j)||!at(V)||G){const R={...V,...G&&Mt(A)?{isValid:A}:{},errors:r.errors,name:_};r={...r,...R},g.state.next(R)}},q=async _=>(v(_,!0),await t.resolver(a,t.context,w1(_||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),N=async _=>{const{errors:A}=await q(_);if(v(_),_){for(const D of _){const V=W(A,D);V?s.array.has(D)&&Qe(V)&&!Object.keys(V).some(j=>!Number.isNaN(Number(j)))?Sh(r.errors,{[D]:V},D):Be(r.errors,D,V):tt(r.errors,D)}r.errors={...r.errors}}else r.errors=A;return A},P=async({name:_,eventType:A})=>{if(e.validate){const D=await e.validate({formValues:a,formState:r,name:_,eventType:A});if(Qe(D))for(const V in D){const j=D[V];j&&J(`${il}.${V}`,{message:Ct(j.message)?j.message:"",type:j.type||er.validate})}else Ct(D)||!D?J(il,{message:D||"",type:er.validate}):fe(il);return D}return!0},M=async({fields:_,onlyCheckValid:A,name:D,eventType:V,context:j={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(j.runRootValidation=!0,!await P({name:D,eventType:V})&&(j.valid=!1,A)))return j.valid;for(const G in _){const R=_[G];if(R){const{_f:ee,...ye}=R;if(ee){const Ye=s.array.has(ee.name),Lt=R._f&&C1(R._f),Pt=u.validatingFields||u.isValidating||m.validatingFields||m.isValidating;Lt&&Pt&&v([ee.name],!0);const Cr=await Th(R,s.disabled,a,w,t.shouldUseNativeValidation&&!A,Ye);if(Lt&&Pt&&v([ee.name]),Cr[ee.name]&&(j.valid=!1,A)||(!A&&(W(Cr,ee.name)?Ye?Sh(r.errors,Cr,ee.name):Be(r.errors,ee.name,Cr[ee.name]):tt(r.errors,ee.name)),e.shouldUseNativeValidation&&Cr[ee.name]))break}!at(ye)&&await M({context:j,onlyCheckValid:A,fields:ye,name:G,eventType:V})}}return j.valid},L=()=>{for(const _ of s.unMount){const A=W(n,_);A&&(A._f.refs?A._f.refs.every(D=>!gl(D)):!gl(A._f.ref))&&Ve(_)}s.unMount=new Set},F=(_,A)=>!t.disabled&&(_&&A&&Be(a,_,A),!$t(H(),o)),z=(_,A,D)=>dl(_,s,{...i.mount?a:qe(A)?o:Ct(_)?{[_]:A}:A},D,A),X=_=>sh(W(i.mount?a:o,_,t.shouldUnregister?W(o,_,[]):[])),ve=(_,A,D={},V=!1)=>{const j=W(n,_);let G=A;if(j){const R=j._f;R&&(!R.disabled&&Be(a,_,gh(A,R)),G=ni(R.ref)&&ht(A)?"":A,dh(R.ref)?[...R.ref.options].forEach(ee=>ee.selected=G.includes(ee.value)):R.refs?xo(R.ref)?R.refs.forEach(ee=>{(!ee.defaultChecked||!ee.disabled)&&(Array.isArray(G)?ee.checked=!!G.find(ye=>ye===ee.value):ee.checked=G===ee.value||!!G)}):R.refs.forEach(ee=>ee.checked=ee.value===G):hl(R.ref)?R.ref.value="":(R.ref.value=G,R.ref.type||g.state.next({name:_,values:V?a:Ze(a)})))}(D.shouldDirty||D.shouldTouch)&&x(_,G,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&U(_)},Ee=(_,A,D,V=!1)=>{for(const j in A){if(!A.hasOwnProperty(j))return;const G=A[j],R=_+"."+j,ee=W(n,R);(s.array.has(_)||Qe(G)||ee&&!ee._f)&&!Jr(G)?Ee(R,G,D,V):ve(R,G,D,V)}},Ce=(_,A,D,V)=>{const j=W(n,_),G=s.array.has(_),R=V?A:Ze(A),ee=W(a,_),ye=$t(ee,R);if(ye||Be(a,_,R),G)g.array.next({name:_,values:V?a:Ze(a)}),(u.isDirty||u.dirtyFields||m.isDirty||m.dirtyFields)&&D.shouldDirty&&(b(),g.state.next({name:_,dirtyFields:r.dirtyFields,isDirty:F(_,R)}));else{const Ye=Array.isArray(R)&&!R.length||at(R);!j||j._f||ht(R)||Ye?ve(_,R,D,V):Ee(_,R,D,V)}if(!ye){const Ye=vl(_,s),Lt=V?a:Ze(a);g.state.next({...Ye&&r,name:i.mount||Ye?_:void 0,values:Lt})}},ue=(_,A,D={})=>Ce(_,A,D,!1),Q=(_,A={})=>{const D=wt(_)?_(a):_;if(!$t(a,D)){a={...a,...D};for(const V of s.mount)Ce(V,W(D,V),A,!0);g.state.next({...r,name:void 0,type:void 0,values:a}),A.shouldValidate&&y()}},ne=async _=>{i.mount=!0;const A=_.target;let D=A.name,V=!0;const j=W(n,D),G=ye=>{V=Number.isNaN(ye)||Jr(ye)&&isNaN(ye.getTime())||$t(ye,W(a,D,ye))},R=bh(t.mode),ee=bh(t.reValidateMode);if(j){let ye,Ye;const Lt=A.type?vh(j._f):al(_),Pt=_.type===xr.BLUR||_.type===xr.FOCUS_OUT,Cr=!S1(j._f)&&!e.validate&&!t.resolver&&!W(r.errors,D)&&!j._f.deps||E1(Pt,W(r.touchedFields,D),r.isSubmitted,ee,R),Qo=vl(D,s,Pt);Be(a,D,Lt),Pt?(!A||!A.readOnly)&&(j._f.onBlur&&j._f.onBlur(_),l&&l(0)):j._f.onChange&&j._f.onChange(_);const pn=x(D,Lt,Pt),dt=!at(pn)||Qo;if(!Pt&&g.state.next({name:D,type:_.type,values:Ze(a)}),Cr)return(u.isValid||m.isValid)&&(t.mode==="onBlur"?Pt&&y():Pt||y()),dt&&g.state.next({name:D,...Qo?{}:pn});if(!t.resolver&&e.validate&&await P({name:D,eventType:_.type}),!Pt&&Qo&&g.state.next({...r}),t.resolver){const{errors:_t}=await q([D]);if(v([D]),G(Lt),!V){!at(pn)&&g.state.next(pn);return}const Ot=Ch(r.errors,n,D),or=Ch(_t,n,Ot.name||D);ye=or.error,D=or.name,Ye=at(_t)}else v([D],!0),ye=(await Th(j,s.disabled,a,w,t.shouldUseNativeValidation))[D],v([D]),G(Lt),V&&(ye?Ye=!1:(u.isValid||m.isValid)&&(Ye=await M({fields:n,onlyCheckValid:!0,name:D,eventType:_.type})));V&&(j._f.deps&&(!Array.isArray(j._f.deps)||j._f.deps.length>0)&&U(j._f.deps),B(D,Ye,ye,pn))}},te=(_,A)=>{if(W(r.errors,A)&&_.focus)return _.focus(),1},U=async(_,A={})=>{let D,V;const j=ri(_);if(t.resolver){const G=await N(qe(_)?_:j);D=at(G),V=_?!j.some(R=>W(G,R)):D}else _?(V=(await Promise.all(j.map(async G=>{const R=W(n,G);return await M({fields:R&&R._f?{[G]:R}:R,eventType:xr.TRIGGER})}))).every(Boolean),!(!V&&!r.isValid)&&y()):V=D=await M({fields:n,name:_,eventType:xr.TRIGGER});return g.state.next({...!Ct(_)||(u.isValid||m.isValid)&&D!==r.isValid?{}:{name:_},...t.resolver||!_?{isValid:D}:{},errors:r.errors}),A.shouldFocus&&!V&&Fo(n,te,_?j:s.mount),V},H=(_,A)=>{let D={...i.mount?a:o};return A&&(D=ch(A.dirtyFields?r.dirtyFields:r.touchedFields,D)),qe(_)?D:Ct(_)?W(D,_):_.map(V=>W(D,V))},ae=(_,A)=>({invalid:!!W((A||r).errors,_),isDirty:!!W((A||r).dirtyFields,_),error:W((A||r).errors,_),isValidating:!!W(r.validatingFields,_),isTouched:!!W((A||r).touchedFields,_)}),fe=_=>{const A=_?ri(_):void 0;A==null||A.forEach(D=>tt(r.errors,D)),A?A.forEach(D=>{g.state.next({name:D,errors:r.errors})}):g.state.next({errors:{}})},J=(_,A,D)=>{const V=(W(n,_,{_f:{}})._f||{}).ref,j=W(r.errors,_)||{},{ref:G,message:R,type:ee,...ye}=j;Be(r.errors,_,{...ye,...A,ref:V}),g.state.next({name:_,errors:r.errors,isValid:!1}),D&&D.shouldFocus&&V&&V.focus&&V.focus()},oe=(_,A)=>wt(_)?g.state.subscribe({next:D=>"values"in D&&_(D.values||z(void 0,A),D)}):z(_,A,!0),Me=_=>g.state.subscribe({next:A=>{if(T1(_.name,A.name,_.exact)&&_1(A,_.formState||u,K,_.reRenderRoot)){const D={...a};_.callback({values:D,...r,...A,defaultValues:o})}}}).unsubscribe,Oe=_=>(i.mount=!0,m={...m,..._.formState},Me({..._,formState:{...f,..._.formState}})),Ve=(_,A={})=>{for(const D of _?ri(_):s.mount)s.mount.delete(D),s.array.delete(D),A.keepValue||(tt(n,D),tt(a,D)),!A.keepError&&tt(r.errors,D),!A.keepDirty&&tt(r.dirtyFields,D),!A.keepTouched&&tt(r.touchedFields,D),!A.keepIsValidating&&tt(r.validatingFields,D),!t.shouldUnregister&&!A.keepDefaultValue&&tt(o,D);g.state.next({values:Ze(a)}),g.state.next({...r,...A.keepDirty?{isDirty:F()}:{}}),!A.keepIsValid&&y()},We=({disabled:_,name:A})=>{if(Mt(_)&&i.mount||_||s.disabled.has(A)){const j=s.disabled.has(A)!==!!_;_?s.disabled.add(A):s.disabled.delete(A),j&&i.mount&&!i.action&&y()}},ze=(_,A={})=>{let D=W(n,_);const V=Mt(A.disabled)||Mt(t.disabled),j=!s.registerName.has(_)&&D&&D._f&&!D._f.mount;return Be(n,_,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:_}},name:_,mount:!0,...A}}),s.mount.add(_),D&&!j?We({disabled:Mt(A.disabled)?A.disabled:t.disabled,name:_}):k(_,!0,A.value),{...V?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:Po(A.min),max:Po(A.max),minLength:Po(A.minLength),maxLength:Po(A.maxLength),pattern:Po(A.pattern)}:{},name:_,onChange:ne,onBlur:ne,ref:G=>{if(G){s.registerName.add(_),ze(_,A),s.registerName.delete(_),D=W(n,_);const R=qe(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,ee=m1(R),ye=D._f.refs||[];if(ee?ye.find(Ye=>Ye===R):R===D._f.ref)return;Be(n,_,{_f:{...D._f,...ee?{refs:[...ye.filter(gl),R,...Array.isArray(W(o,_))?[{}]:[]],ref:{type:R.type,name:_}}:{ref:R}}}),k(_,!1,void 0,R)}else D=W(n,_,{}),D._f&&(D._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(th(s.array,_)&&i.action)&&s.unMount.add(_)}}},re=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Fo(n,te,s.mount),Ke=_=>{Mt(_)&&(g.state.next({disabled:_}),Fo(n,(A,D)=>{const V=W(n,D);V&&(A.disabled=V._f.disabled||_,Array.isArray(V._f.refs)&&V._f.refs.forEach(j=>{j.disabled=V._f.disabled||_}))},0,!1))},Re=(_,A)=>async D=>{let V;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let j=Ze(a);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:R}=await q();v(),r.errors=G,j=Ze(R)}else await M({fields:n,eventType:xr.SUBMIT});if(s.disabled.size)for(const G of s.disabled)tt(j,G);if(tt(r.errors,nh),at(r.errors)){g.state.next({errors:{}});try{await _(j,D)}catch(G){V=G}}else A&&await A({...r.errors},D),re(),setTimeout(re);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:at(r.errors)&&!V,submitCount:r.submitCount+1,errors:r.errors}),V)throw V},He=(_,A={})=>{W(n,_)&&(qe(A.defaultValue)?ue(_,Ze(W(o,_))):(ue(_,A.defaultValue),Be(o,_,Ze(A.defaultValue))),A.keepTouched||tt(r.touchedFields,_),A.keepDirty||(tt(r.dirtyFields,_),r.isDirty=A.defaultValue?F(_,Ze(W(o,_))):F()),A.keepError||(tt(r.errors,_),u.isValid&&y()),g.state.next({...r}))},et=(_,A={})=>{const D=_?Ze(_):o,V=Ze(D),j=at(_),G=V;if(A.keepDefaultValues||(o=D),!A.keepValues){if(A.keepDirtyValues){const R=new Set([...s.mount,...Object.keys(en(o,a))]);for(const ee of Array.from(R)){const ye=W(r.dirtyFields,ee),Ye=W(a,ee),Lt=W(G,ee);ye&&!qe(Ye)?Be(G,ee,Ye):!ye&&!qe(Lt)&&ue(ee,Lt)}}else{if(Ja&&qe(_))for(const R of s.mount){const ee=W(n,R);if(ee&&ee._f){const ye=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(ni(ye)){const Ye=ye.closest("form");if(Ye){Ye.reset();break}}}}if(A.keepFieldsRef)for(const R of s.mount)ue(R,W(G,R));else n={}}if(t.shouldUnregister){if(a=A.keepDefaultValues?Ze(o):{},A.keepFieldsRef)for(const R of s.mount)Be(a,R,W(G,R))}else a=Ze(G);g.array.next({values:{...G}}),g.state.next({values:{...G}})}s={mount:A.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!u.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!at(G),i.watch=!!t.shouldUnregister,i.keepIsValid=!!A.keepIsValid,i.action=!1,A.keepErrors||(r.errors={}),g.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:j?!1:A.keepDirty?r.isDirty:A.keepValues?F():!!(A.keepDefaultValues&&!$t(_,o)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:j?{}:A.keepDirtyValues?A.keepDefaultValues&&a?en(o,a):r.dirtyFields:A.keepDefaultValues&&_?en(o,_):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Gt=(_,A)=>et(wt(_)?_(a):_,{...t.resetOptions,...A}),It=(_,A={})=>{const D=W(n,_),V=D&&D._f;if(V){const j=V.refs?V.refs[0]:V.ref;j.focus&&setTimeout(()=>{j.focus(),A.shouldSelect&&wt(j.select)&&j.select()})}},K=_=>{r={...r,..._}},Wt={control:{register:ze,unregister:Ve,getFieldState:ae,handleSubmit:Re,setError:J,_subscribe:Me,_runSchema:q,_updateIsValidating:v,_focusError:re,_getWatch:z,_getDirty:F,_setValid:y,_setFieldArray:C,_setDisabledField:We,_setErrors:T,_getFieldArray:X,_reset:et,_resetDefaultValues:()=>wt(t.defaultValues)&&t.defaultValues().then(_=>{Gt(_,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:Ke,_subjects:g,_proxyFormState:u,get _fields(){return n},get _formValues(){return a},get _state(){return i},set _state(_){i=_},get _defaultValues(){return o},get _names(){return s},set _names(_){s=_},get _formState(){return r},get _options(){return t},set _options(_){t={...t,..._}}},subscribe:Oe,trigger:U,register:ze,handleSubmit:Re,watch:oe,setValue:ue,setValues:Q,getValues:H,reset:Gt,resetField:He,resetDefaultValues:(_,A={})=>{if(o=Ze(_),!A.keepDirty){const D=en(o,a);r.dirtyFields=D,r.isDirty=!at(D)}A.keepIsValid||y(),g.state.next({...r,defaultValues:o})},clearErrors:fe,unregister:Ve,setError:J,setFocus:It,getFieldState:ae};return{...Wt,formControl:Wt}}function D1(e={}){const t=h.useRef(void 0),r=h.useRef(void 0),n=h.useRef(e.formControl),[o,a]=h.useState(()=>({...Ze(Eh),isLoading:wt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:wt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!wt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=A1(e);t.current={...l,formState:o}}const i=t.current.control;return i._options=e,cl(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return a(l=>({...l,isReady:!0})),i._formState.isReady=!0,s},[i]),h.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),h.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),h.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),h.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),h.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==o.isDirty&&i._subjects.state.next({isDirty:s})}},[i,o.isDirty]),h.useEffect(()=>{var s;e.values&&!$t(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),r.current=e.values,a(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),h.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=h.useMemo(()=>ah(o,i),[i,o]),t.current}async function Ih(e){var r,n;return(n=(r=(await ke.get(`/api/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function N1(e){var r,n;return((n=(r=(await ke.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function Oh(e,t){const r=gn({queryKey:["framework",e],queryFn:()=>Ih(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],o=gn({queryKey:["framework",n],queryFn:()=>Ih(n),enabled:!!n,staleTime:5*60*1e3}),a=o.data?[o.data]:[];return{organisationFramework:r.data,targetFrameworks:a,isLoading:r.isLoading||o.isLoading}}function k1(e,t,r){const n=e??[],o=new Set(n.map(f=>f.type).filter(Boolean)),a=(t??[]).filter(f=>!o.has(f)),{data:i}=gn({queryKey:["framework-search",a.sort().join(","),r],queryFn:()=>N1({type:a,systemDefault:"Yes"}),enabled:a.length>0,staleTime:10*60*1e3}),s=t&&t.length?n.filter(f=>f.type&&t.includes(f.type)):n,l=[...(i??[]).map(f=>({label:f.name,value:f.identifier})),...s.map(f=>({label:f.name,value:f.identifier}))],d=new Set;return l.filter(f=>d.has(f.value)?!1:(d.add(f.value),!0))}async function Ah(e){var r,n;return(n=(r=(await ke.get(`/api/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function x1(e){var r,n,o,a,i,s,l;const t=gn({queryKey:["channel",e],queryFn:()=>Ah(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(o=t.data)==null?void 0:o.frameworks,collectionAdditionalCategories:(a=t.data)==null?void 0:a.collectionAdditionalCategories,contentAdditionalCategories:(i=t.data)==null?void 0:i.contentAdditionalCategories,defaultLicense:(s=t.data)==null?void 0:s.defaultLicense,defaultFramework:(l=t.data)==null?void 0:l.defaultFramework,isLoading:t.isLoading}}function L1(e){const{data:t}=gn({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>Cw(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const P1={"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."}},F1=new Set(["review","read","sourcingreview","orgreview"]),ai={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},M1={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},$1={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"},bl={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},Dh=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function Nh(e,t,r,n,o={}){if(!(e!=null&&e.length))return J1(t,n,r);const a=new Map;for(const s of e){const l=s.code;l&&!a.has(l)&&a.set(l,s)}const i=new Set;return e.filter(s=>{if(n&&(s.code==="dialCode"||s.code==="dialcode")||s.visible===!1)return!1;const l=s.code;return i.has(l)?!1:(i.add(l),!0)}).map(s=>{const l=s.code??"",d=H1(s),f=R1(s,r,t,a,o),u=t[l],m=j1(l,kh(u,d),d,t,o),g={code:l,label:s.label??l,inputType:d,required:!!(s.required===!0||Array.isArray(s.validations)&&s.validations.some(w=>w.type==="required")),editable:B1(l,s.editable!==!1,o),placeholder:s.placeholder,maxLength:s.maxLength,options:V1(f,m,d,r),depends:s.depends,tab:z1(s),section:s.section,defaultValue:s.defaultValue??s.default,currentValue:m};if(l==="dialcodes"){const w=t.dialcodeRequired==="Yes";return{...g,required:w,visible:w}}return g})}function B1(e,t,r){var a;const n=r.editorMode??"edit";if(!F1.has(n))return t!==!1;const o=(a=r.editableFields)==null?void 0:a[n];return!!(o&&o.includes(e))}function j1(e,t,r,n,o){const a=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return a?o.defaultLicense??"":t;case"copyright":return a&&o.channelName?o.channelName:t;case"copyrightYear":return a?String(new Date().getFullYear()):t;case"author":case"creator":return a&&o.userFullName?o.userFullName:t;case"instructions":{const i=n.instructions;return i&&typeof i=="object"&&!Array.isArray(i)?i.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!a)return t;const i=n.timeLimits,s=i==null?void 0:i[e];return s!=null&&s!==""?q1(Number(s)):t}default:return t}}function q1(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),o=a=>String(a).padStart(2,"0");return n>0?`${o(n)}:${o(r)}:${o(t)}`:`${o(r)}:${o(t)}`}function U1(e){var n,o,a;const t=new Map,r=i=>i==null?void 0:i.forEach(s=>{s.identifier&&t.set(s.identifier,s.name),s.name&&t.set(s.name,s.name)});return(o=(n=e.organisationFramework)==null?void 0:n.categories)==null||o.forEach(i=>r(i.terms)),(a=e.targetFrameworks)==null||a.forEach(i=>{var s;return(s=i.categories)==null?void 0:s.forEach(l=>r(l.terms))}),t}function V1(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const o=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!o.length)return e;const a=e?[...e]:[],i=new Set(a.map(l=>l.value)),s=U1(n);for(const l of o){const d=String(l);i.has(d)||(a.push({label:s.get(d)??d,value:d}),i.add(d))}return a}function z1(e){const t=e.section;if(t){if(ai[t])return ai[t];const n=M1[t];if(n&&ai[n])return ai[n]}const r=e.code??"";return $1[r]??"details"}function kh(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function H1(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 R1(e,t,r,n,o){const a=e.code??"";if(a==="maxQuestions"){const d=o.childCount??0;if(d>0)return Array.from({length:d},(f,u)=>({label:String(u+1),value:String(u+1)}))}const i=e.range;if(Array.isArray(i)&&i.length)return typeof i[0]=="string"?i.map(d=>({label:d,value:d})):i.map(d=>({label:d.name,value:d.identifier}));const s=e.enum;if(s!=null&&s.length)return s.map(d=>({label:d,value:d}));if(a==="framework")return t.orgFrameworks;if(a==="additionalCategories"){const f=(o.objectType??"")==="QuestionSet"?o.contentAdditionalCategories??o.collectionAdditionalCategories:o.collectionAdditionalCategories??o.contentAdditionalCategories,u=(f&&f.length?f:o.contextAdditionalCategories)??t.channelAdditionalCategories;return u!=null&&u.length?K1(u).map(m=>({label:m,value:m})):void 0}const l=e.sourceCategory??bl[a];if(l)return xh(a,l,e,t,r,n)}function Q1(e,t){return Dh.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function G1(e,t){return Dh.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function wl(e,t,r){var a,i,s,l,d;const n=(i=(a=e.organisationFramework)==null?void 0:a.categories)==null?void 0:i.find(f=>f.code===t),o=(d=(l=(s=e.targetFrameworks)==null?void 0:s[0])==null?void 0:l.categories)==null?void 0:d.find(f=>f.code===t);return r?(o==null?void 0:o.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(o==null?void 0:o.terms)??[]}function W1(e){const t=new Set,r=[];for(const n of e){const o=n.identifier??n.name;o&&!t.has(o)&&(t.add(o),r.push(n))}return r}function K1(e){return Array.from(new Set(e))}function Y1(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function xh(e,t,r,n,o,a){const i=Q1(e,r),s=G1(e,r),l=p=>({label:p.name,value:i?p.identifier:p.name}),d=r.depends;if(!(d!=null&&d.length))return wl(n,t,s).map(l);const f=d.flatMap(p=>Y1(o[p])).map(String);if(!f.length)return[];const u=[];for(const p of d){const y=a.get(p),v=(y==null?void 0:y.sourceCategory)??bl[p]??p;u.push(...wl(n,v,s))}const g=u.filter(p=>f.includes(String(p.name))||f.includes(String(p.identifier))||f.includes(String(p.code))).flatMap(p=>p.associations??[]).filter(p=>String(p.category??"").toLowerCase()===t.toLowerCase()),w=W1(g);return w.length?w.map(l):wl(n,t,s).map(l)}function Mo(e,t){const r=bl[e];if(r)return xh(e,r,{},t,{},new Map)}function it(e,t,r){return kh(e[t],r)}const Z1=["board","medium","gradeLevel","subject"];function X1(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>Z1.includes(n.code)):!0}function J1(e,t,r){var a,i;const n=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:it(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:it(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:it(e,"keywords","chips")}];if(!t)return n;const o=X1(r);if(n.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:it(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:it(e,"additionalCategories","multiselect"),options:(a=r.channelAdditionalCategories)==null?void 0:a.map(s=>({label:s,value:s}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:it(e,"framework","select")}),o)n.push({code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Mo("subjectIds",r),currentValue:it(e,"subjectIds","multiselect")});else for(const s of((i=r.organisationFramework)==null?void 0:i.categories)??[])n.push({code:s.code,label:s.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(s.terms??[]).map(l=>({label:l.name,value:l.name})),currentValue:it(e,s.code,"multiselect")});return n.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:it(e,"audience","multiselect")}),o&&n.push({code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Mo("targetBoardIds",r),currentValue:it(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:Mo("targetMediumIds",r),currentValue:it(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:Mo("targetGradeLevelIds",r),currentValue:it(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:Mo("targetSubjectIds",r),currentValue:it(e,"targetSubjectIds","multiselect")}),n.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:it(e,"license","select")}),n}const eE=["allowECM","levels","setPeriod","instances"];function Lh(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function tE(e,t={}){const r={...e};for(const a of eE)delete r[a];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Lh(n)});const o=e.instances;return o!=null&&o!==""&&(r.instances={label:o}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function rE(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?Lh(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function nE(e,t){const{watch:r,setValue:n}=e,o=h.useRef(!1);h.useEffect(()=>{const a=r((i,{name:s})=>{var l;if(!(!s||o.current)){o.current=!0;try{const d=new Set([s]);let f=!0;for(;f;){f=!1;for(const u of t)d.has(u.code)||(l=u.depends)!=null&&l.some(m=>d.has(m))&&(n(u.code,u.inputType==="multiselect"||u.inputType==="chips"?[]:"",{shouldDirty:!0}),d.add(u.code),f=!0)}}finally{o.current=!1}}});return()=>a.unsubscribe()},[r,n,t])}const jn={section:"_section_ylgu8_1",header:"_header_ylgu8_11",title:"_title_ylgu8_17",description:"_description_ylgu8_24",divider:"_divider_ylgu8_30",fields:"_fields_ylgu8_36"},oE=({title:e,description:t,children:r})=>c.jsxs("div",{className:jn.section,children:[c.jsxs("div",{className:jn.header,children:[c.jsx("h3",{className:jn.title,children:e}),t&&c.jsx("p",{className:jn.description,children:t})]}),c.jsx("hr",{className:jn.divider}),c.jsx("div",{className:jn.fields,children:r})]}),$={field:"_field_1s288_1",fullWidth:"_fullWidth_1s288_7",label:"_label_1s288_11",required:"_required_1s288_19",input:"_input_1s288_24",textarea:"_textarea_1s288_45",inputError:"_inputError_1s288_50",error:"_error_1s288_54",selectBtn:"_selectBtn_1s288_59",selectOpen:"_selectOpen_1s288_83",placeholder:"_placeholder_1s288_87",selectedVal:"_selectedVal_1s288_91",chevronUp:"_chevronUp_1s288_95",dropdown:"_dropdown_1s288_100",option:"_option_1s288_116",optionSelected:"_optionSelected_1s288_134",noOpts:"_noOpts_1s288_139",chipGroup:"_chipGroup_1s288_146",chipInput:"_chipInput_1s288_158",addChipBtn:"_addChipBtn_1s288_167",radioGroup:"_radioGroup_1s288_184",radioLabel:"_radioLabel_1s288_191",iconWrap:"_iconWrap_1s288_199",iconPreview:"_iconPreview_1s288_214",iconPlaceholder:"_iconPlaceholder_1s288_220",removeIconBtn:"_removeIconBtn_1s288_233",tagChip:"_tagChip_1s288_252",tagChipRemove:"_tagChipRemove_1s288_264",nestedSelectRow:"_nestedSelectRow_1s288_278",dialcodeRow:"_dialcodeRow_1s288_287",validateBtn:"_validateBtn_1s288_293",dialcodeValid:"_dialcodeValid_1s288_315",dialcodeSpinner:"_dialcodeSpinner_1s288_325"},Ph=({name:e,label:t,required:r,disabled:n,multiline:o,maxLength:a,placeholder:i})=>{const s=ce(),{register:l,formState:{errors:d}}=tr(),f=d[e],u={required:r?s.textField.requiredError.replace("{field}",t):!1,maxLength:a?{value:a,message:s.textField.maxLengthError.replace("{max}",String(a))}:void 0};return c.jsxs("div",{className:[$.field,o?$.fullWidth:""].join(" "),children:[c.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),o?c.jsx("textarea",{id:e,className:[$.input,$.textarea,f?$.inputError:""].join(" "),disabled:n,placeholder:i,rows:3,...l(e,u)}):c.jsx("input",{id:e,type:"text",className:[$.input,f?$.inputError:""].join(" "),disabled:n,placeholder:i,...l(e,u)}),f&&c.jsx("span",{className:$.error,children:String(f.message)})]})},aE=({name:e,label:t,options:r,required:n,disabled:o})=>{var y;const a=ce(),[i,s]=h.useState(!1),l=h.useRef(null),{register:d,watch:f,setValue:u,formState:{errors:m}}=tr(),g=f(e),w=((y=r.find(v=>v.value===g))==null?void 0:y.label)??a.selectField.selectPlaceholder,p=m[e];return h.useEffect(()=>{if(!i)return;const v=b=>{var C;(C=l.current)!=null&&C.contains(b.target)||s(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]),c.jsxs("div",{className:$.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...d(e,{required:n?a.selectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:o,className:[$.selectBtn,p?$.inputError:"",i?$.selectOpen:""].join(" "),onClick:()=>s(v=>!v),children:[c.jsx("span",{className:g?$.selectedVal:$.placeholder,children:w}),c.jsx(Cn,{size:14,className:i?$.chevronUp:""})]}),i&&c.jsxs("div",{className:$.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[$.option,g===v.value?$.optionSelected:""].join(" "),onClick:()=>{u(e,v.value,{shouldDirty:!0,shouldValidate:!0}),s(!1)},children:[c.jsx("span",{children:v.label}),g===v.value&&c.jsx(wn,{size:13})]},v.value)),!r.length&&c.jsx("span",{className:$.noOpts,children:a.selectField.noOptionsMessage})]}),p&&c.jsx("span",{className:$.error,children:String(p.message)})]})},iE=({name:e,label:t,options:r,required:n,disabled:o})=>{const a=ce(),[i,s]=h.useState(!1),l=h.useRef(null),{register:d,watch:f,setValue:u,formState:{errors:m}}=tr(),g=f(e)??[],w=m[e],p=g.length?`${g.length} ${a.multiSelectField.selectedCountSuffix}`:a.multiSelectField.selectPlaceholder;h.useEffect(()=>{if(!i)return;const v=b=>{var C;(C=l.current)!=null&&C.contains(b.target)||s(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]);const y=v=>{const b=g.includes(v)?g.filter(C=>C!==v):[...g,v];u(e,b,{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:$.field,ref:l,style:{position:"relative"},children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...d(e,{required:n?a.multiSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:o,className:[$.selectBtn,w?$.inputError:"",i?$.selectOpen:""].join(" "),onClick:()=>s(v=>!v),children:[c.jsx("span",{className:g.length?$.selectedVal:$.placeholder,children:p}),c.jsx(Cn,{size:14,className:i?$.chevronUp:""})]}),i&&c.jsxs("div",{className:$.dropdown,children:[r.map(v=>c.jsxs("button",{type:"button",className:[$.option,g.includes(v.value)?$.optionSelected:""].join(" "),onClick:()=>y(v.value),children:[c.jsx(wn,{size:13,style:{opacity:g.includes(v.value)?1:0}}),c.jsx("span",{children:v.label})]},v.value)),!r.length&&c.jsx("span",{className:$.noOpts,children:a.multiSelectField.noOptionsMessage})]}),w&&c.jsx("span",{className:$.error,children:String(w.message)})]})},sE=({name:e,label:t,required:r,disabled:n,placeholder:o})=>{const a=ce(),i=o??a.chipGroupField.addPlaceholder,[s,l]=h.useState(""),[d,f]=h.useState(!1),u=h.useRef(null),{watch:m,setValue:g,formState:{errors:w}}=tr(),p=m(e)??[],y=w[e],v=()=>{const C=s.trim();C&&!p.includes(C)&&g(e,[...p,C],{shouldDirty:!0}),l(""),f(!1)},b=C=>g(e,p.filter(S=>S!==C),{shouldDirty:!0});return c.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[c.jsxs("label",{className:$.label,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsxs("div",{className:$.chipGroup,children:[p.map(C=>c.jsxs("span",{className:"sbx-chip filled",children:[C,!n&&c.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>b(C),"aria-label":`Remove ${C}`,children:"×"})]},C)),!n&&(d?c.jsx("input",{ref:u,autoFocus:!0,className:$.chipInput,value:s,onChange:C=>l(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),v()),C.key==="Escape"&&(l(""),f(!1))},onBlur:v,placeholder:i}):c.jsxs("button",{type:"button",className:$.addChipBtn,onClick:()=>{f(!0),setTimeout(()=>{var C;return(C=u.current)==null?void 0:C.focus()},50)},children:[c.jsx(mo,{size:12})," ",a.chipGroupField.addButtonLabel]}))]}),y&&c.jsx("span",{className:$.error,children:String(y.message)})]})},lE=({name:e,label:t,options:r,required:n,disabled:o})=>{const a=ce(),{register:i,formState:{errors:s}}=tr(),l=s[e];return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("div",{className:$.radioGroup,children:r.map(d=>c.jsxs("label",{className:$.radioLabel,children:[c.jsx("input",{type:"radio",value:d.value,disabled:o,...i(e,{required:n?a.radioField.requiredError.replace("{field}",t):!1})}),d.label]},d.value))}),l&&c.jsx("span",{className:$.error,children:String(l.message)})]})};async function cE(e,t,r,n){var i,s;const a=(s=(i=(await ke.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:i.result)==null?void 0:s.node_id;if(!a)throw new Error("Asset creation failed: no node_id returned");return a}async function dE(e,t){var o,a;const n=(a=(o=(await ke.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)==null?void 0:a.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function uE(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 fE(e,t,r){var i,s;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const a=(s=(i=(await ke.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:i.result)==null?void 0:s.content_url;if(!a)throw new Error("Asset finalize failed: no content_url returned");return a}const pe={overlay:"_overlay_ga6eh_1",modal:"_modal_ga6eh_12",header:"_header_ga6eh_24",title:"_title_ga6eh_33",closeBtn:"_closeBtn_ga6eh_39",tabs:"_tabs_ga6eh_57",tab:"_tab_ga6eh_57",activeTab:"_activeTab_ga6eh_83",body:"_body_ga6eh_88",searchWrap:"_searchWrap_ga6eh_99",searchIcon:"_searchIcon_ga6eh_104",searchInput:"_searchInput_ga6eh_113",grid:"_grid_ga6eh_132",imgCell:"_imgCell_ga6eh_148",imgCellSelected:"_imgCellSelected_ga6eh_166",thumb:"_thumb_ga6eh_171",noThumb:"_noThumb_ga6eh_177",checkBadge:"_checkBadge_ga6eh_183",loadMoreBtn:"_loadMoreBtn_ga6eh_198",loadingRow:"_loadingRow_ga6eh_220",empty:"_empty_ga6eh_230",spinner:"_spinner_ga6eh_237",uploadArea:"_uploadArea_ga6eh_247",dropZone:"_dropZone_ga6eh_256",uploadIcon:"_uploadIcon_ga6eh_277",dropText:"_dropText_ga6eh_281",dropSubtext:"_dropSubtext_ga6eh_288",uploadPreview:"_uploadPreview_ga6eh_294",hiddenInput:"_hiddenInput_ga6eh_301",fileName:"_fileName_ga6eh_305",errorText:"_errorText_ga6eh_311",footer:"_footer_ga6eh_318",cancelBtn:"_cancelBtn_ga6eh_328",confirmBtn:"_confirmBtn_ga6eh_345"},Fh=18,Mh=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const o=ce(),[a,i]=h.useState("my"),[s,l]=h.useState(""),[d,f]=h.useState([]),[u,m]=h.useState(0),[g,w]=h.useState(!1),[p,y]=h.useState(null),[v,b]=h.useState(0),[C,S]=h.useState(null),[T,I]=h.useState(""),[k,x]=h.useState(!1),[B,q]=h.useState(""),N=h.useRef(null),P=le(U=>{var H,ae;return((ae=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ae.channel)??""}),M=le(U=>{var H,ae;return((ae=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ae.uid)??""}),L=le(U=>{var H,ae,fe;return((fe=(ae=(H=U.editorConfig)==null?void 0:H.context)==null?void 0:ae.cloudStorage)==null?void 0:fe.presigned_headers)??{}}),F=le(U=>{var H,ae,fe;return((fe=(ae=(H=U.editorConfig)==null?void 0:H.config)==null?void 0:ae.assetConfig)==null?void 0:fe.size)??1*1024*1024}),z=le(U=>{var H,ae,fe;return((fe=(ae=(H=U.editorConfig)==null?void 0:H.config)==null?void 0:ae.assetConfig)==null?void 0:fe.accepted)??"image/png,image/jpeg"}),X=h.useCallback(async(U,H,ae=!1)=>{var fe;w(!0);try{const J={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};a==="my"&&M&&(J.createdBy=M),P&&(J.channel=P);const Me=((fe=(await ke.post("/action/composite/v3/search",{request:{filters:J,query:U,limit:Fh,offset:H,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:fe.result)??{},Oe=Me.content??[];m(Me.count??0),f(Ve=>ae?[...Ve,...Oe]:Oe)}catch{}finally{w(!1)}},[a,M,P]);h.useEffect(()=>{a!=="upload"&&(f([]),b(0),X(s,0))},[a]);const ve=h.useRef(),Ee=U=>{l(U),clearTimeout(ve.current),ve.current=setTimeout(()=>{f([]),b(0),X(U,0)},400)},Ce=()=>{const U=v+Fh;b(U),X(s,U,!0)},ue=()=>{const U=(p==null?void 0:p.artifactUrl)??(p==null?void 0:p.appIcon)??(p==null?void 0:p.downloadUrl)??"";U&&r(U)};h.useEffect(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);const Q=U=>{var fe;const H=(fe=U.target.files)==null?void 0:fe[0];if(U.target.value="",!H)return;const ae=z.split(",").map(J=>J.trim());if(!ae.includes(H.type)){const J=ae.map(oe=>oe.replace("image/","").toUpperCase()).join(", ");q(o.appIconPickerModal.invalidFileTypeError.replace("{types}",J));return}if(H.size>F){const J=(F/1048576).toFixed(0);q(o.appIconPickerModal.fileTooLargeError.replace("{size}",J));return}T&&URL.revokeObjectURL(T),S(H),I(URL.createObjectURL(H)),q("")},ne=async()=>{if(C){x(!0),q("");try{const U=await cE(C.name.split(".").slice(0,-1).join(".")||C.name,C.type,M,P),H=await dE(U,C.name);await uE(H,C,L);const ae=H.split("?")[0],fe=await fE(U,ae,C.type);r(fe)}catch(U){q(U instanceof Error?U.message:o.appIconPickerModal.uploadFailedError)}finally{x(!1)}}},te=d.length<u;return c.jsx("div",{className:pe.overlay,role:"dialog","aria-modal":"true","aria-label":o.appIconPickerModal.dialogAriaLabel,children:c.jsxs("div",{className:pe.modal,children:[c.jsxs("div",{className:pe.header,children:[c.jsx("span",{className:pe.title,children:o.appIconPickerModal.title}),c.jsx("button",{className:pe.closeBtn,onClick:n,"aria-label":o.appIconPickerModal.closeAriaLabel,children:c.jsx(yr,{size:18})})]}),c.jsxs("div",{className:pe.tabs,role:"tablist",children:[c.jsx("button",{role:"tab","aria-selected":a==="my",className:`${pe.tab} ${a==="my"?pe.activeTab:""}`,onClick:()=>i("my"),children:o.appIconPickerModal.myImagesTab}),c.jsx("button",{role:"tab","aria-selected":a==="all",className:`${pe.tab} ${a==="all"?pe.activeTab:""}`,onClick:()=>i("all"),children:o.appIconPickerModal.allImagesTab}),c.jsxs("button",{role:"tab","aria-selected":a==="upload",className:`${pe.tab} ${a==="upload"?pe.activeTab:""}`,onClick:()=>i("upload"),children:[c.jsx(Zi,{size:13,style:{marginRight:4}}),o.appIconPickerModal.uploadTab]})]}),c.jsx("div",{className:pe.body,children:a!=="upload"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:pe.searchWrap,children:[c.jsx(Ki,{size:14,className:pe.searchIcon}),c.jsx("input",{type:"search",className:pe.searchInput,placeholder:o.appIconPickerModal.searchPlaceholder,value:s,onChange:U=>Ee(U.target.value)})]}),g&&d.length===0?c.jsxs("div",{className:pe.loadingRow,children:[c.jsx(wa,{size:20,className:pe.spinner}),c.jsx("span",{children:o.appIconPickerModal.loadingText})]}):d.length===0?c.jsx("div",{className:pe.empty,children:o.appIconPickerModal.noImagesFound}):c.jsx("div",{className:pe.grid,children:d.map(U=>{const H=U.appIcon??U.artifactUrl??U.downloadUrl??"",ae=(p==null?void 0:p.identifier)===U.identifier;return c.jsxs("button",{type:"button",className:`${pe.imgCell} ${ae?pe.imgCellSelected:""}`,onClick:()=>y(U),title:U.name,children:[H?c.jsx("img",{src:H,alt:U.name,className:pe.thumb}):c.jsx("div",{className:pe.noThumb,children:o.appIconPickerModal.noThumbnailText}),ae&&c.jsx("div",{className:pe.checkBadge,children:c.jsx(wn,{size:12})})]},U.identifier)})}),te&&!g&&c.jsx("button",{className:pe.loadMoreBtn,onClick:Ce,children:o.appIconPickerModal.loadMoreButton}),g&&d.length>0&&c.jsx("div",{className:pe.loadingRow,children:c.jsx(wa,{size:16,className:pe.spinner})})]}):c.jsxs("div",{className:pe.uploadArea,children:[c.jsx("div",{className:pe.dropZone,onClick:()=>{var 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:T?c.jsx("img",{src:T,alt:o.appIconPickerModal.previewAlt,className:pe.uploadPreview}):c.jsxs(c.Fragment,{children:[c.jsx(Zi,{size:32,className:pe.uploadIcon}),c.jsx("p",{className:pe.dropText,children:o.appIconPickerModal.dropZoneText}),c.jsx("p",{className:pe.dropSubtext,children:o.appIconPickerModal.acceptedTypesInfo.replace("{types}",z.split(",").map(U=>U.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(F/(1024*1024)).toFixed(0))})]})}),c.jsx("input",{ref:N,type:"file",accept:z,className:pe.hiddenInput,onChange:Q}),C&&c.jsx("p",{className:pe.fileName,children:C.name}),B&&c.jsx("p",{className:pe.errorText,children:B})]})}),c.jsxs("div",{className:pe.footer,children:[c.jsx("button",{className:pe.cancelBtn,onClick:n,children:o.appIconPickerModal.cancelButton}),a==="upload"?c.jsx("button",{className:pe.confirmBtn,disabled:!C||k,onClick:ne,children:k?c.jsxs(c.Fragment,{children:[c.jsx(wa,{size:14,className:pe.spinner})," ",o.appIconPickerModal.uploadingText]}):o.appIconPickerModal.uploadAndUseButton}):c.jsx("button",{className:pe.confirmBtn,disabled:!p,onClick:ue,children:o.appIconPickerModal.useSelectedButton})]})]})})},hE=({name:e,label:t,nodeId:r,required:n,disabled:o})=>{const a=ce(),[i,s]=h.useState(!1),{watch:l,setValue:d,register:f,formState:{errors:u}}=tr(),m=l(e),g=u[e],w=y=>{d(e,y,{shouldDirty:!0,shouldValidate:!0}),s(!1)},p=()=>{d(e,"",{shouldDirty:!0,shouldValidate:!0})};return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...f(e,{required:n?a.appIconField.requiredError.replace("{field}",t):!1})}),c.jsx("div",{className:$.iconWrap,role:"button",tabIndex:o?-1:0,"aria-label":a.appIconField.selectIconAriaLabel,onClick:()=>!o&&s(!0),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&!o&&s(!0)},children:m?c.jsx("img",{src:m,alt:a.appIconField.iconAlt,className:$.iconPreview}):c.jsxs("div",{className:$.iconPlaceholder,children:[c.jsx(Zc,{size:20}),c.jsx("span",{children:a.appIconField.selectIconLabel})]})}),m&&!o&&c.jsxs("button",{type:"button",className:$.removeIconBtn,onClick:p,"aria-label":a.appIconField.removeIconAriaLabel,children:[c.jsx(Yi,{size:13}),c.jsx("span",{children:a.appIconField.removeLabel})]}),g&&c.jsx("span",{className:$.error,children:String(g.message)}),i&&c.jsx(Mh,{nodeId:r,currentValue:m,onSelect:w,onClose:()=>s(!1)})]})},pE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ti({name:e,control:a,rules:{required:r?o.dateTimeField.requiredError.replace("{field}",t):!1}});return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{id:e,type:"datetime-local",className:[$.input,s?$.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:i.onChange,onBlur:i.onBlur,ref:i.ref}),s&&c.jsx("span",{className:$.error,children:String(s.message)})]})},gE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ti({name:e,control:a,rules:{required:r?o.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[l,d]=h.useState(""),f=h.useRef(null),u=i.value??[],m=y=>{const v=y.trim();!v||u.includes(v)||i.onChange([...u,v])},g=y=>{i.onChange(u.filter(v=>v!==y))},w=y=>{y.key==="Enter"||y.key===","?(y.preventDefault(),m(l),d("")):y.key==="Backspace"&&l===""&&u.length>0&&g(u[u.length-1])},p=()=>{l.trim()&&(m(l),d("")),i.onBlur()};return c.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[c.jsxs("label",{className:$.label,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsxs("div",{className:[$.chipGroup,s?$.inputError:""].join(" "),onClick:()=>{var y;return!n&&((y=f.current)==null?void 0:y.focus())},style:{cursor:n?"not-allowed":"text"},children:[u.map(y=>c.jsxs("span",{className:$.tagChip,children:[y,!n&&c.jsx("button",{type:"button",className:$.tagChipRemove,onClick:v=>{v.stopPropagation(),g(y)},"aria-label":`Remove ${y}`,children:c.jsx(yr,{size:11})})]},y)),!n&&c.jsx("input",{ref:f,className:$.chipInput,value:l,onChange:y=>d(y.target.value),onKeyDown:w,onBlur:p,placeholder:u.length===0?o.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),s&&c.jsx("span",{className:$.error,children:String(s.message)})]})},mE=({name:e,label:t,levels:r,required:n,disabled:o})=>{const a=ce(),{control:i}=tr(),{field:s,fieldState:{error:l}}=ti({name:e,control:i,rules:{required:n?a.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),d=s.value??{},f=(u,m,g)=>{const w={};for(let p=0;p<m;p++)w[r[p].code]=d[r[p].code]??"";w[u]=g;for(let p=m+1;p<r.length;p++)w[r[p].code]="";s.onChange(w)};return c.jsxs("div",{className:[$.field,$.fullWidth].join(" "),children:[c.jsxs("label",{className:$.label,children:[t,n&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("div",{className:$.nestedSelectRow,children:r.map((u,m)=>{const g=m>0&&!d[r[m-1].code];return c.jsxs("div",{className:$.field,style:{flex:1},children:[c.jsx("label",{className:$.label,htmlFor:`${e}_${u.code}`,children:u.label}),c.jsxs("select",{id:`${e}_${u.code}`,className:[$.input,l?$.inputError:""].join(" "),disabled:o||g,value:d[u.code]??"",onChange:w=>f(u.code,m,w.target.value),onBlur:s.onBlur,children:[c.jsx("option",{value:"",children:a.nestedSelectField.selectPlaceholder}),u.options.map(w=>c.jsx("option",{value:w.value,children:w.label},w.value))]})]},u.code)})}),l&&c.jsx("span",{className:$.error,children:String(l.message)})]})},$h=[{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"}],yE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),[a,i]=h.useState(!1),s=h.useRef(null),{register:l,watch:d,setValue:f,formState:{errors:u}}=tr(),m=d(e),g=$h.find(y=>y.value===m),w=(g==null?void 0:g.label)??o.licenseSelectField.selectPlaceholder,p=u[e];return h.useEffect(()=>{if(!a)return;const y=v=>{var b;(b=s.current)!=null&&b.contains(v.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]),c.jsxs("div",{className:$.field,ref:s,style:{position:"relative"},children:[c.jsxs("label",{className:$.label,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsx("input",{type:"hidden",...l(e,{required:r?o.licenseSelectField.requiredError.replace("{field}",t):!1})}),c.jsxs("button",{type:"button",disabled:n,className:[$.selectBtn,p?$.inputError:"",a?$.selectOpen:""].join(" "),onClick:()=>i(y=>!y),"aria-haspopup":"listbox","aria-expanded":a,children:[c.jsx("span",{className:m?$.selectedVal:$.placeholder,children:w}),c.jsx(Cn,{size:14,className:a?$.chevronUp:""})]}),a&&c.jsx("div",{className:$.dropdown,role:"listbox",children:$h.map(y=>c.jsxs("button",{type:"button",role:"option","aria-selected":m===y.value,className:[$.option,m===y.value?$.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[c.jsx("span",{children:y.label}),m===y.value&&c.jsx(wn,{size:13})]},y.value))}),p&&c.jsx("span",{className:$.error,children:String(p.message)})]})},vE=({name:e,label:t,required:r,disabled:n})=>{const o=ce(),{control:a}=tr(),{field:i,fieldState:{error:s}}=ti({name:e,control:a,rules:{required:r?o.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[l,d]=h.useState("idle"),[f,u]=h.useState(""),m=async()=>{const w=(i.value??"").trim();if(!w){d("invalid"),u(o.dialcodeInputField.enterCodeMessage);return}d("loading"),u("");try{const p=await kw(w),y=p==null?void 0:p.result,v=y==null?void 0:y.dialcodes;Array.isArray(v)&&v.length>0?(d("valid"),u(o.dialcodeInputField.validMessage)):(d("invalid"),u(o.dialcodeInputField.notFoundMessage))}catch{d("invalid"),u(o.dialcodeInputField.validationFailedMessage)}},g=()=>l==="loading"?c.jsx(wa,{size:16,className:$.dialcodeSpinner}):l==="valid"?c.jsx(Gc,{size:16,color:"var(--sbx-success, #2e7d32)"}):l==="invalid"?c.jsx(xy,{size:16,color:"var(--sbx-error)"}):null;return c.jsxs("div",{className:$.field,children:[c.jsxs("label",{className:$.label,htmlFor:e,children:[t,r&&c.jsx("span",{className:$.required,children:"*"})]}),c.jsxs("div",{className:$.dialcodeRow,children:[c.jsx("input",{id:e,type:"text",className:[$.input,s?$.inputError:""].join(" "),disabled:n,value:i.value??"",onChange:w=>{i.onChange(w),d("idle"),u("")},onBlur:i.onBlur,ref:i.ref,placeholder:o.dialcodeInputField.placeholderExample,style:{flex:1}}),c.jsx("button",{type:"button",className:$.validateBtn,onClick:m,disabled:n||l==="loading","aria-label":o.dialcodeInputField.validateAriaLabel,children:l==="loading"?o.dialcodeInputField.validatingLabel:o.dialcodeInputField.validateButtonLabel}),g()]}),s&&c.jsx("span",{className:$.error,children:String(s.message)}),!s&&f&&c.jsx("span",{className:l==="valid"?$.dialcodeValid:$.error,children:f})]})},Cl={form:"_form_szqex_1",ungrouped:"_ungrouped_szqex_7",noFields:"_noFields_szqex_18"},bE=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:o,onFormValueChange:a,onFormStatusChange:i})=>{var We,ze,re,Ke,Re,He,et,Gt,It;const s=ce(),l=le(K=>K.editorConfig),d=le(K=>K.rootFormConfig),f=le(K=>K.unitFormConfig),u=le(K=>K.categoryMeta),m=le(K=>K.contentFramework),g=le(K=>K.contentTargetFWIds),{organisationFramework:w,targetFrameworks:p,isLoading:y}=Oh(m??((We=l==null?void 0:l.context)==null?void 0:We.framework),g??((ze=l==null?void 0:l.context)==null?void 0:ze.targetFWIds)),{frameworks:v,collectionAdditionalCategories:b,contentAdditionalCategories:C,defaultLicense:S,name:T}=x1((re=l==null?void 0:l.context)==null?void 0:re.channel),I=L1(((Ke=l==null?void 0:l.context)==null?void 0:Ke.userId)??((Re=l==null?void 0:l.context)==null?void 0:Re.uid)),k=k1(v,(He=u==null?void 0:u.frameworkMetadata)==null?void 0:He.orgFWType,(et=l==null?void 0:l.context)==null?void 0:et.channel),x={organisationFramework:w,targetFrameworks:p,orgFrameworks:k,channelAdditionalCategories:b},B=Ae(K=>K.selectedNodeId),q=Ae(K=>K.treeData),N=Ae(K=>K.treeCache),P=B?N[B]??{}:{},M={...e,...P},L=h.useMemo(()=>{var ge;if(!B)return 0;const K=[...q];for(;K.length;){const we=K.shift();if(we.id===B)return((ge=we.children)==null?void 0:ge.length)??0;we.children&&K.push(...we.children)}return 0},[q,B]),F=(l==null?void 0:l.config)??{},z=(l==null?void 0:l.context)??{},X={editorMode:o,editableFields:F.editableFields,objectType:F.objectType,setDefaultCopyRight:F.setDefaultCopyRight===!0,defaultLicense:z.defaultLicense??S,contextAdditionalCategories:z.additionalCategories,userFullName:((Gt=z.user)==null?void 0:Gt.fullName)??I,channelName:T,collectionAdditionalCategories:b,contentAdditionalCategories:C,childCount:L},ve=r?d:f,Ee=ve||(((It=l==null?void 0:l.config.hierarchy)==null?void 0:It.formConfig)??[]),Ce=Nh(Ee,M,x,r,X),ue=Ce.filter(K=>K.tab===t&&K.inputType!=="appIcon"&&K.visible!==!1),Q=D1({mode:"onChange",defaultValues:Object.fromEntries(Ce.map(K=>{const ge=["multiselect","chips","keywords","tagsinput"],we=["nestedselect"];return ge.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??[]]:we.includes(K.inputType)?[K.code,K.currentValue??K.defaultValue??{}]:[K.code,K.currentValue??K.defaultValue??""]}))});nE(Q,Ce);const{updateNode:ne}=Ae(),te=h.useRef(Ce);te.current=Ce;const U=h.useRef(B);U.current=B;const H=h.useRef(a);H.current=a;const ae=h.useRef(i);ae.current=i;const fe=h.useRef(typeof M.shuffle=="boolean"?M.shuffle:void 0),J=h.useRef(M.name??"");J.current=M.name??"";const oe=h.useRef(o);oe.current=o;const Me=["review","read","sourcingreview","orgreview"];h.useEffect(()=>{const K=U.current;if(K){const ge=Object.fromEntries(te.current.filter(we=>we.currentValue!==void 0&&we.currentValue!==null).map(we=>[we.code,we.currentValue]));Object.keys(ge).length>0&&ne(K,ge)}Q.trigger().then(()=>{const ge=Q.formState.errors,we=te.current,Wt=Array.from(new Set(Object.keys(ge).map(_=>{var A;return(A=we.find(D=>D.code===_))==null?void 0:A.tab}).filter(Boolean)));ae.current(Object.keys(ge).length===0,Wt)})},[]),h.useEffect(()=>{const K=Q.watch((ge,{name:we})=>{const Wt=U.current;if(!Wt)return;const _=te.current,A=new Set(_.map(j=>j.code));if(we&&A.has(we)){let j=Q.getValues(we);we==="dialcodes"&&(j=Array.isArray(j)?j:j?[j]:[]),we==="shuffle"&&(j===!0&&fe.current===!1&&Ie(s.sparkMetaForm.shuffleEnabledMessage,{icon:c.jsx(Ri,{size:16})}),fe.current=j);const G=rE(we,j);G&&(ne(Wt,G),H.current(G))}else if(!we){const j=Q.getValues(),G=Object.fromEntries(Object.entries(j).filter(([ee])=>A.has(ee))),R=tE(G,{isReview:Me.includes(oe.current),nodeTitle:J.current});Object.keys(R).length>0&&(ne(Wt,R),H.current(R))}const D=Q.formState.errors,V=Array.from(new Set(Object.keys(D).map(j=>{var G;return(G=_.find(R=>R.code===j))==null?void 0:G.tab}).filter(Boolean)));ae.current(Object.keys(D).length===0,V)});return()=>K.unsubscribe()},[Q]),h.useEffect(()=>{for(const K of["author","creator","copyright","copyrightYear","license"]){const ge=te.current.find(Wt=>Wt.code===K);if(!ge||ge.currentValue===void 0||ge.currentValue===null||ge.currentValue==="")continue;const we=Q.getValues(K);(we==null||we==="")&&Q.setValue(K,ge.currentValue,{shouldDirty:!1})}},[I,T,Q]);const Oe=ue.reduce((K,ge)=>{const we=K[K.length-1];return we&&we.section===ge.section?we.fields.push(ge):K.push({section:ge.section,fields:[ge]}),K},[]),Ve=K=>{const ge={key:K.code,name:K.code,label:K.label,required:K.required,disabled:K.editable===!1};switch(K.inputType){case"textarea":return c.jsx(Ph,{...ge,multiline:!0,maxLength:K.maxLength});case"select":return c.jsx(aE,{...ge,options:K.options??[]});case"multiselect":return c.jsx(iE,{...ge,options:K.options??[]});case"chips":return c.jsx(sE,{...ge});case"radio":return c.jsx(lE,{...ge,options:K.options??[]});case"appIcon":return c.jsx(hE,{...ge,nodeId:B??""});case"datepicker":case"datetime":return c.jsx(pE,{...ge});case"keywords":case"tagsinput":return c.jsx(gE,{...ge});case"nestedselect":return c.jsx(mE,{...ge,levels:K.levels??[]});case"license":return c.jsx(yE,{...ge});case"dialcode":return c.jsx(vE,{...ge});default:return c.jsx(Ph,{...ge,maxLength:K.maxLength})}};return c.jsx(p1,{...Q,children:c.jsxs("div",{className:Cl.form,children:[Oe.map((K,ge)=>{const we=K.section?P1[K.section]:void 0;return we?c.jsx(oE,{title:we.title,description:we.description,children:K.fields.map(Ve)},K.section??ge):c.jsx("div",{className:Cl.ungrouped,children:K.fields.map(Ve)},ge)}),ue.length===0&&!y&&c.jsx("p",{className:Cl.noFields,children:s.sparkMetaForm.noFieldsMessage})]})})};function Bh(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function wE(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function ii(e){return e!==null&&e>=0}function CE(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 SE(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const jh=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=Bh(t,n,r),i=t[o],s=a[o];return!s||!i?null:{x:s.left-i.left,y:s.top-i.top,scaleX:s.width/i.width,scaleY:s.height/i.height}},si={scaleX:1,scaleY:1},_E=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:a,overIndex:i}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(o===r){const d=a[i];return d?{x:0,y:r<i?d.top+d.height-(s.top+s.height):d.top-s.top,...si}:null}const l=TE(a,o,r);return o>r&&o<=i?{x:0,y:-s.height-l,...si}:o<r&&o>=i?{x:0,y:s.height+l,...si}:{x:0,y:0,...si}};function TE(e,t,r){const n=e[t],o=e[t-1],a=e[t+1];return n?r<t?o?n.top-(o.top+o.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const qh="Sortable",Uh=h.createContext({activeIndex:-1,containerId:qh,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:jh,disabled:{draggable:!1,droppable:!1}});function EE(e){let{children:t,id:r,items:n,strategy:o=jh,disabled:a=!1}=e;const{active:i,dragOverlay:s,droppableRects:l,over:d,measureDroppableContainers:f}=zc(),u=lo(qh,r),m=s.rect!==null,g=h.useMemo(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),w=i!=null,p=i?g.indexOf(i.id):-1,y=d?g.indexOf(d.id):-1,v=h.useRef(g),b=!CE(g,v.current),C=y!==-1&&p===-1||b,S=SE(a);Yt(()=>{b&&w&&f(g)},[b,g,w,f]),h.useEffect(()=>{v.current=g},[g]);const T=h.useMemo(()=>({activeIndex:p,containerId:u,disabled:S,disableTransforms:C,items:g,overIndex:y,useDragOverlay:m,sortedRects:wE(g,l),strategy:o}),[p,u,S.draggable,S.droppable,C,g,y,l,m,o]);return h.createElement(Uh.Provider,{value:T},t)}const IE=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Bh(r,n,o).indexOf(t)},OE=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:i,previousItems:s,previousContainerId:l,transition:d}=e;return!d||!n||s!==a&&o===i?!1:r?!0:i!==o&&t===l},AE={duration:200,easing:"ease"},Vh="transform",DE=Ar.Transition.toString({property:Vh,duration:0,easing:"linear"}),NE={roleDescription:"sortable"};function kE(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,i]=h.useState(null),s=h.useRef(r);return Yt(()=>{if(!t&&r!==s.current&&n.current){const l=o.current;if(l){const d=bn(n.current,{ignoreTransform:!0}),f={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(f.x||f.y)&&i(f)}}r!==s.current&&(s.current=r)},[t,r,n,o]),h.useEffect(()=>{a&&i(null)},[a]),a}function xE(e){let{animateLayoutChanges:t=OE,attributes:r,disabled:n,data:o,getNewIndex:a=IE,id:i,strategy:s,resizeObserverConfig:l,transition:d=AE}=e;const{items:f,containerId:u,activeIndex:m,disabled:g,disableTransforms:w,sortedRects:p,overIndex:y,useDragOverlay:v,strategy:b}=h.useContext(Uh),C=LE(n,g),S=f.indexOf(i),T=h.useMemo(()=>({sortable:{containerId:u,index:S,items:f},...o}),[u,o,S,f]),I=h.useMemo(()=>f.slice(f.indexOf(i)),[f,i]),{rect:k,node:x,isOver:B,setNodeRef:q}=fy({id:i,data:T,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:N,activatorEvent:P,activeNodeRect:M,attributes:L,setNodeRef:F,listeners:z,isDragging:X,over:ve,setActivatorNodeRef:Ee,transform:Ce}=Vc({id:i,data:T,attributes:{...NE,...r},disabled:C.draggable}),ue=Zg(q,F),Q=!!N,ne=Q&&!w&&ii(m)&&ii(y),te=!v&&X,U=te&&ne?Ce:null,ae=ne?U??(s??b)({rects:p,activeNodeRect:M,activeIndex:m,overIndex:y,index:S}):null,fe=ii(m)&&ii(y)?a({id:i,items:f,activeIndex:m,overIndex:y}):S,J=N==null?void 0:N.id,oe=h.useRef({activeId:J,items:f,newIndex:fe,containerId:u}),Me=f!==oe.current.items,Oe=t({active:N,containerId:u,isDragging:X,isSorting:Q,id:i,index:S,items:f,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:d,wasDragging:oe.current.activeId!=null}),Ve=kE({disabled:!Oe,index:S,node:x,rect:k});return h.useEffect(()=>{Q&&oe.current.newIndex!==fe&&(oe.current.newIndex=fe),u!==oe.current.containerId&&(oe.current.containerId=u),f!==oe.current.items&&(oe.current.items=f)},[Q,fe,u,f]),h.useEffect(()=>{if(J===oe.current.activeId)return;if(J&&!oe.current.activeId){oe.current.activeId=J;return}const ze=setTimeout(()=>{oe.current.activeId=J},50);return()=>clearTimeout(ze)},[J]),{active:N,activeIndex:m,attributes:L,data:T,rect:k,index:S,newIndex:fe,items:f,isOver:B,isSorting:Q,isDragging:X,listeners:z,node:x,overIndex:y,over:ve,setNodeRef:ue,setActivatorNodeRef:Ee,setDroppableNodeRef:q,setDraggableNodeRef:F,transform:Ve??ae,transition:We()};function We(){if(Ve||Me&&oe.current.newIndex===S)return DE;if(!(te&&!da(P)||!d)&&(Q||Oe))return Ar.Transition.toString({...d,property:Vh})}}function LE(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 li(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 PE=[_e.Down,_e.Right,_e.Up,_e.Left],FE=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:s}}=t;if(PE.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];a.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const m=o.get(u.id);if(m)switch(e.code){case _e.Down:n.top<m.top&&l.push(u);break;case _e.Up:n.top>m.top&&l.push(u);break;case _e.Left:n.left>m.left&&l.push(u);break;case _e.Right:n.left<m.left&&l.push(u);break}});const d=pm({collisionRect:n,droppableRects:o,droppableContainers:l});let f=pc(d,"id");if(f===(i==null?void 0:i.id)&&d.length>1&&(f=d[1].id),f!=null){const u=a.get(r.id),m=a.get(f),g=m?o.get(m.id):null,w=m==null?void 0:m.node.current;if(w&&g&&u&&m){const y=ha(w).some((I,k)=>s[k]!==I),v=zh(u,m),b=ME(u,m),C=y||!v?{x:0,y:0}:{x:b?n.width-g.width:0,y:b?n.height-g.height:0},S={x:g.left,y:g.top};return C.x&&C.y?S:co(S,C)}}}};function zh(e,t){return!li(e)||!li(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function ME(e,t){return!li(e)||!li(t)||!zh(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const tn={row:"_row_11nth_1",removeBtn:"_removeBtn_11nth_14",grip:"_grip_11nth_17",ctIcon:"_ctIcon_11nth_34",info:"_info_11nth_38",name:"_name_11nth_46",meta:"_meta_11nth_55"},$E={video:Xi,pdf:ba,h5p:Qi,scorm:Wi,audio:Gi,quiz:Hi,default:Sn},BE=({item:e,onRemove:t,isEditable:r})=>{const n=ce(),o=Xa(e),a=$E[o.key]??Sn,{attributes:i,listeners:s,setNodeRef:l,transform:d,transition:f,isDragging:u}=xE({id:e.id,disabled:!r}),m={transform:Ar.Transform.toString(d),transition:f,opacity:u?.5:1};return c.jsxs("div",{ref:l,style:m,className:tn.row,role:"listitem",children:[r&&c.jsx("span",{className:tn.grip,...i,...s,"aria-label":n.contentRow.dragToReorderAriaLabel,children:c.jsx(Yc,{size:15})}),c.jsx("span",{className:[`sbx-ct-sq--${o.key}`,tn.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(a,{size:14})}),c.jsxs("div",{className:tn.info,children:[c.jsx("span",{className:tn.name,title:e.name,children:e.name}),c.jsx("span",{className:tn.meta,children:o.label})]}),c.jsx("span",{className:`sbx-ct-badge--${o.key}`,children:o.label}),r&&c.jsx("button",{type:"button",className:tn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:c.jsx(yr,{size:14})})]})},rn={container:"_container_lzvke_1",header:"_header_lzvke_7",heading:"_heading_lzvke_13",count:"_count_lzvke_21",list:"_list_lzvke_30",emptyState:"_emptyState_lzvke_36",addRow:"_addRow_lzvke_52"},jE=({editorMode:e})=>{const t=ce(),{selectedNodeId:r,getChildrenOf:n,reorderChildren:o,deleteNode:a}=Ae(),i=r?n(r):[],s=e==="edit",l=dc(Li(pa,{activationConstraint:{distance:5}}),Li(Bi,{coordinateGetter:FE})),d=h.useCallback(u=>{const{active:m,over:g}=u;if(!g||m.id===g.id||!r)return;const w=Ae.getState().getChildrenOf(r),p=w.findIndex(v=>v.id===m.id),y=w.findIndex(v=>v.id===g.id);p<0||y<0||o(r,p,y)},[r,o]),f=h.useCallback(u=>{window.confirm(t.unitContentList.removeConfirm)&&a(u)},[a,t.unitContentList.removeConfirm]);return r?c.jsxs("div",{className:rn.container,children:[c.jsxs("div",{className:rn.header,children:[c.jsx("span",{className:rn.heading,children:t.unitContentList.heading}),c.jsx("span",{className:rn.count,children:i.length})]}),i.length>0?c.jsx(qc,{sensors:l,collisionDetection:hm,onDragEnd:d,children:c.jsx(EE,{items:i.map(u=>u.id),strategy:_E,children:c.jsx("div",{className:rn.list,role:"list",children:i.map(u=>c.jsx(BE,{item:u,onRemove:f,isEditable:s},u.id))})})}):c.jsxs("div",{className:rn.emptyState,children:[c.jsx("p",{children:t.unitContentList.emptyTitle}),c.jsx("span",{children:t.unitContentList.emptyHint})]}),s&&c.jsxs("button",{className:rn.addRow,type:"button","aria-label":t.unitContentList.addContentAriaLabel,children:[c.jsx(mo,{size:14})," ",t.unitContentList.addContent]})]}):null},Hh={dropZone:"_dropZone_ijo5w_1",active:"_active_ijo5w_14"},qE=({isActive:e,label:t,nodeId:r,className:n})=>{const o=ce(),a=t??o.dropZone.dropHere;return c.jsx("div",{className:`${Hh.dropZone} ${e?Hh.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":a,role:"region",children:c.jsx("span",{children:a})})};async function UE(e){var i;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((i=(await ke.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"]}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:i.result)??{},o=new Set(["count","facets"]);return{content:Object.entries(n).filter(([s])=>!o.has(s)).flatMap(([,s])=>Array.isArray(s)?s:[]),count:n.count??0}}async function VE(e){var r,n;return(n=(r=(await ke.get(`/action/content/v3/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}const Rh="application/vnd.sunbird.question";function Qh(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function Gh(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const o=Gh(n,t,e);if(o)return o}return null}function zE(e,t){const r=Gh(e,t);if(!r)return null;const{question:n,parent:o}=r,a={...e,children:[n],childNodes:[t],shuffle:o==null?void 0:o.shuffle,showSolutions:(o==null?void 0:o.showSolutions)??"No",showFeedback:(o==null?void 0:o.showFeedback)??"No"};return(o==null?void 0:o.shuffle)===!0?a.maxScore=1:n.qType==="SA"?delete a.maxScore:n.maxScore!=null&&(a.maxScore=n.maxScore),a}function HE(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return gn({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await iu(e),o=f=>{if(!f)return[];const u=f.mimeType===Rh&&f.identifier?[f.identifier]:[],m=(f.children??[]).flatMap(o);return[...u,...m]},a=o(n),i=new Map;a.length&&(await Sw(a)).forEach(u=>{const m=u.identifier;m&&i.set(m,u)});const s=f=>{if(!f)return f;if(f.mimeType===Rh&&f.identifier){const u=i.get(f.identifier)??f,m=u.outcomeDeclaration;return m!=null&&m.maxScore||(u.outcomeDeclaration={...m??{},maxScore:Qh(u)}),u}return Array.isArray(f.children)&&(f.children=f.children.map(u=>s(u))),f},l=s(n),d=l.outcomeDeclaration;return d!=null&&d.maxScore||(l.outcomeDeclaration={...d??{},maxScore:Qh(l)}),l}})}const Wh="/assets/quml-player/sunbird-quml-player.js",RE="/assets/quml-player/styles.css",Kh="sunbird-quml-player";function QE(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const ct=class ct{constructor(){Yo(this,"eventHandlers",new WeakMap)}loadScript(){return ct.scriptLoaded||customElements.get(Kh)?(ct.scriptLoaded=!0,Promise.resolve()):(ct.scriptLoading||(ct.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Wh,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{ct.scriptLoaded=!0,ct.scriptLoading=void 0,t()},n.onerror=()=>{ct.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Wh}`))},document.body.appendChild(n)})),ct.scriptLoading)}loadStyles(){if(ct.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){ct.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=RE,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),ct.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),ct.stylesLoaded=!1}async createConfig(t,r,n){var a,i,s;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((a=r==null?void 0:r.pdata)==null?void 0:a.id)??"sunbird.portal",ver:((i=r==null?void 0:r.pdata)==null?void 0:i.ver)??"1.0",pid:((s=r==null?void 0:r.pdata)==null?void 0:s.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:QE(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Kh);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const o=i=>r==null?void 0:r(i),a=i=>n==null?void 0:n(i.detail);t.addEventListener("playerEvent",o),t.addEventListener("telemetryEvent",a),this.eventHandlers.set(t,{player:o,telemetry:a})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};Yo(ct,"scriptLoaded",!1),Yo(ct,"scriptLoading"),Yo(ct,"stylesLoaded",!1);let ci=ct;const di=new ci,je={contentPlayerRoot:"_contentPlayerRoot_r6xk8_1",flowLayout:"_flowLayout_r6xk8_9",stage:"_stage_r6xk8_13",aspectRatio:"_aspectRatio_r6xk8_16",playerHeader:"_playerHeader_r6xk8_32",playerHeaderThumb:"_playerHeaderThumb_r6xk8_46",playerHeaderTitle:"_playerHeaderTitle_r6xk8_56",typeBadge:"_typeBadge_r6xk8_66",typeDot:"_typeDot_r6xk8_105",playerFrame:"_playerFrame_r6xk8_125",coverOverlay:"_coverOverlay_r6xk8_133",coverHidden:"_coverHidden_r6xk8_145",coverThumb:"_coverThumb_r6xk8_150",coverPlayRing:"_coverPlayRing_r6xk8_159",coverPlayIcon:"_coverPlayIcon_r6xk8_172",coverLabel:"_coverLabel_r6xk8_181",coverSkeleton:"_coverSkeleton_r6xk8_187",playerWrapper:"_playerWrapper_r6xk8_213",infoStrip:"_infoStrip_r6xk8_223",infoChip:"_infoChip_r6xk8_239",infoChipLabel:"_infoChipLabel_r6xk8_258",infoChipIcon:"_infoChipIcon_r6xk8_267",playerError:"_playerError_r6xk8_273",playerErrorIcon:"_playerErrorIcon_r6xk8_287",playerErrorMsg:"_playerErrorMsg_r6xk8_292",qumlRoot:"_qumlRoot_r6xk8_299"},GE="application/vnd.sunbird.questionset";function WE(e,t){const r=new Map,n=a=>{for(const i of a)r.set(i.id,i),i.children&&n(i.children)};n(e);let o=r.get(t);for(;o;){if(o.mimeType===GE)return o.identifier;o=o.parent?r.get(o.parent):void 0}return null}const KE=[{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 YE(e){return KE.find(t=>t.mimes.includes(e))??{key:"other"}}function ZE(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 XE={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},JE={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},eI={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},tI="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function Sl(e){for(const[t,r]of Object.entries(XE))if(r.includes(e))return t;return"default-player"}function rI(e,t,r){var a;const n=r==null?void 0:r.context,o=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((a=n==null?void 0:n.pdata)==null?void 0:a.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/sunbird-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:o==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function nI(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 oI(e,t,r=100){await nI(JE[t]??""),!customElements.get(e)&&await new Promise((n,o)=>{let a=0;const i=setInterval(()=>{a++,customElements.get(e)?(clearInterval(i),n()):a>=r&&(clearInterval(i),o(new Error(`Custom element <${e}> did not register`)))},100)})}const aI=[{key:"author",icon:Xy},{key:"license",icon:Ry},{key:"language",icon:$y},{key:"gradeLevel",icon:Qy},{key:"subject",icon:Dy},{key:"contentType",icon:Yy}];function iI(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 sI({node:e}){const t=ce(),r=e.metadata??{},n=aI.flatMap(o=>{const a=r[o.key];if(!a)return[];const i=Array.isArray(a)?a.join(", "):String(a);return i?[{...o,label:iI(o.key,t),val:i}]:[]});return n.length?c.jsx("div",{className:je.infoStrip,children:n.map(o=>c.jsxs("div",{className:je.infoChip,children:[o.icon&&c.jsx(o.icon,{size:13,className:je.infoChipIcon}),c.jsx("span",{className:je.infoChipLabel,children:o.label}),o.val]},o.key))}):null}function Yh({node:e,hidden:t}){var o;const r=ce(),n=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return c.jsx("div",{className:`${je.coverOverlay} ${t?je.coverHidden:""}`,children:n?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:n,alt:e.name,className:je.coverThumb}),c.jsx("div",{className:je.coverPlayRing,children:c.jsx("div",{className:je.coverPlayIcon})}),c.jsx("span",{className:je.coverLabel,children:r.contentPlayer.loadingPreview})]}):c.jsx("div",{className:je.coverSkeleton})})}function Zh({message:e}){return c.jsxs("div",{className:je.playerError,children:[c.jsx(Zy,{size:28,className:je.playerErrorIcon}),c.jsx("span",{className:je.playerErrorMsg,children:e})]})}function lI({mimeType:e}){const t=ce(),r=YE(e);return c.jsxs("span",{className:je.typeBadge,"data-type":r.key,children:[c.jsx("span",{className:je.typeDot}),ZE(r.key,t)]})}const _l=({node:e,editorMode:t,type:r,singleQuestion:n,layout:o="fill"})=>{var i;if(r==="quml")return c.jsx(dI,{node:e,editorMode:t,singleQuestion:!!n});const a=e.appIcon??((i=e.metadata)==null?void 0:i.appIcon);return c.jsxs("div",{className:`${je.contentPlayerRoot} ${o==="flow"?je.flowLayout:""}`,children:[c.jsxs("div",{className:je.stage,children:[c.jsxs("div",{className:je.playerHeader,children:[a&&c.jsx("img",{src:a,alt:"",className:je.playerHeaderThumb}),c.jsx("span",{className:je.playerHeaderTitle,children:e.name}),c.jsx(lI,{mimeType:e.mimeType??""})]}),c.jsx(cI,{node:e})]}),c.jsx(sI,{node:e})]})};function cI({node:e}){var v;const t=ce(),r=le(b=>b.editorConfig),[n,o]=h.useState(()=>Sl(e.mimeType??"")),[a,i]=h.useState(!1),[s,l]=h.useState(null),[d,f]=h.useState(e.metadata??{}),[u,m]=h.useState(!1),g=h.useRef(null),w=h.useRef(null),p=((v=r==null?void 0:r.config)==null?void 0:v.previewCdnUrl)??tI;h.useEffect(()=>{let b=!1;return m(!1),i(!1),l(null),f(e.metadata??{}),o(Sl(e.mimeType??"")),VE(e.identifier).then(C=>{if(b)return;const S={...e.metadata??{},...C};f(S);const T=C.mimeType??e.mimeType??"";o(Sl(T)),m(!0)}).catch(()=>{b||m(!0)}),()=>{b=!0}},[e.identifier]);const y=rI(e,d,r);return h.useEffect(()=>{if(!u||n!=="default-player")return;const b=g.current;if(!b)return;b.src=p;const C=()=>{try{const T=b.contentWindow;if(typeof(T==null?void 0:T.initializePreview)!="function"){l(t.contentPlayer.previewPlayerUnavailable);return}T.initializePreview(y),setTimeout(()=>i(!0),300)}catch(T){console.error("[ContentPlayer] initializePreview failed",T),l(t.contentPlayer.failedToInitializePlayer)}},S=()=>l(t.contentPlayer.previewPlayerLoadFailed);return b.addEventListener("load",C),b.addEventListener("error",S),()=>{b.removeEventListener("load",C),b.removeEventListener("error",S),b.src=""}},[e.identifier,n,p,u,t]),h.useEffect(()=>{if(!u||n==="default-player")return;const b=w.current;if(!b)return;const C=eI[n];if(!C)return;const S=y;oI(C,n).then(()=>{if(!w.current)return;if(!customElements.get(C)){o("default-player");return}const T=document.createElement(C);T.setAttribute("player-config",JSON.stringify(S)),T.addEventListener("playerEvent",()=>{}),T.addEventListener("telemetryEvent",()=>{}),b.innerHTML="",b.appendChild(T),setTimeout(()=>{try{T.playerConfig=S}catch{}i(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),o("default-player")})},[e.identifier,n,u]),c.jsxs("div",{className:je.aspectRatio,children:[s?c.jsx(Zh,{message:s}):c.jsx(Yh,{node:e,hidden:a}),n==="default-player"?c.jsx("iframe",{ref:g,id:"contentPlayer",title:e.name,className:je.playerFrame,name:"contentPlayer",allowFullScreen:!0}):c.jsx("div",{ref:w,className:je.playerFrame})]})}function dI({node:e,editorMode:t,singleQuestion:r}){const n=ce(),o=le(g=>g.editorConfig),a=Ae(g=>g.treeData),i=h.useRef(null),s=r?WE(a,e.id):e.identifier,{data:l,isLoading:d,error:f}=HE(s??"",{enabled:!!s}),u=h.useMemo(()=>l?r?zE(l,e.identifier):l:null,[l,r,e.identifier]);h.useEffect(()=>{const g=i.current;if(!g||!u)return;let w=null,p=!1;return(async()=>{try{const y=await di.createConfig(u,o==null?void 0:o.context,{mode:t==="edit"?"edit":"play"});if(p||!i.current)return;const v=di.createElement(y);w=v,di.attachEventListeners(v,b=>console.debug("[QumlPlayer] playerEvent",b.detail),b=>console.debug("[QumlPlayer] telemetryEvent",b)),g.innerHTML="",g.appendChild(v)}catch(y){console.error("[QumlPlayer] failed to initialize",y)}})(),()=>{p=!0,w&&(di.removeEventListeners(w),w.remove()),ci.unloadStyles()}},[u,o,t,r]);const m=f?`${n.contentPlayer.unableToLoadQuestionset} ${f.message}`:r&&!s?n.contentPlayer.parentQuestionsetNotResolved:r&&l&&!u?n.contentPlayer.questionNotFoundInQuestionset:null;return c.jsxs("div",{className:je.qumlRoot,children:[m?c.jsx(Zh,{message:m}):d||!u?c.jsx(Yh,{node:e,hidden:!1}):null,c.jsx("div",{ref:i,className:je.playerWrapper})]})}const Rt={overlay:"_overlay_ifddx_1",modal:"_modal_ifddx_11",header:"_header_ifddx_21",body:"_body_ifddx_37",hint:"_hint_ifddx_43",list:"_list_ifddx_49",item:"_item_ifddx_55",selected:"_selected_ifddx_68",empty:"_empty_ifddx_73",footer:"_footer_ifddx_79",cancelBtn:"_cancelBtn_ifddx_87",moveBtn:"_moveBtn_ifddx_95"};function uI(e,t,r){const n=[],o=a=>{var i;for(const s of a)s.isFolder&&s.id!==r&&s.id!==t&&n.push(s),(i=s.children)!=null&&i.length&&o(s.children)};return o(e),n}const fI=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var u;const o=ce(),{treeData:a,moveNode:i}=Ae(),s=uI(a,((u=a[0])==null?void 0:u.id)??"",r),[l,d]=h.useState(null),f=()=>{l&&(i(e,r,l),n())};return c.jsx("div",{className:Rt.overlay,role:"dialog","aria-label":o.resourceReorderDialog.dialogAriaLabel,children:c.jsxs("div",{className:Rt.modal,children:[c.jsxs("div",{className:Rt.header,children:[c.jsxs("span",{children:[o.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),c.jsx("button",{onClick:n,"aria-label":o.resourceReorderDialog.closeAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsxs("div",{className:Rt.body,children:[c.jsx("p",{className:Rt.hint,children:o.resourceReorderDialog.selectUnitHint}),c.jsxs("ul",{className:Rt.list,children:[s.map(m=>c.jsxs("li",{className:`${Rt.item} ${l===m.id?Rt.selected:""}`,onClick:()=>d(m.id),children:[c.jsx(Fy,{size:14}),c.jsx("span",{children:m.name})]},m.id)),s.length===0&&c.jsx("li",{className:Rt.empty,children:o.resourceReorderDialog.noUnitsAvailable})]})]}),c.jsxs("div",{className:Rt.footer,children:[c.jsx("button",{className:Rt.cancelBtn,onClick:n,children:o.resourceReorderDialog.cancelButton}),c.jsx("button",{className:Rt.moveBtn,onClick:f,disabled:!l,children:o.resourceReorderDialog.moveButton})]})]})})},lr={overlay:"_overlay_16at9_1",modal:"_modal_16at9_11",header:"_header_16at9_21",body:"_body_16at9_37",table:"_table_16at9_43",pageInput:"_pageInput_16at9_61",empty:"_empty_16at9_68",footer:"_footer_16at9_74",cancelBtn:"_cancelBtn_16at9_82",saveBtn:"_saveBtn_16at9_90"};function hI(e){const t=[],r=n=>{var o;for(const a of n)!a.isFolder&&(!a.children||a.children.length===0)?t.push(a):(o=a.children)!=null&&o.length&&r(a.children)};return r(e),t}const pI=({onClose:e})=>{const t=ce(),{treeData:r,updateNode:n}=Ae(),o=hI(r),[a,i]=h.useState(()=>Object.fromEntries(o.map(l=>{var d;return[l.id,String(((d=l.metadata)==null?void 0:d.pageNumber)??"")]}))),s=h.useCallback(()=>{for(const[l,d]of Object.entries(a))d!==""&&n(l,{pageNumber:parseInt(d,10)||void 0});e()},[a,n,e]);return c.jsx("div",{className:lr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:c.jsxs("div",{className:lr.modal,children:[c.jsxs("div",{className:lr.header,children:[c.jsx("span",{children:t.assignPageNumber.title}),c.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsx("div",{className:lr.body,children:o.length===0?c.jsx("p",{className:lr.empty,children:t.assignPageNumber.emptyState}):c.jsxs("table",{className:lr.table,children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),c.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),c.jsx("tbody",{children:o.map(l=>c.jsxs("tr",{children:[c.jsx("td",{children:l.name}),c.jsx("td",{children:c.jsx("input",{type:"number",min:1,value:a[l.id]??"",onChange:d=>i(f=>({...f,[l.id]:d.target.value})),className:lr.pageInput})})]},l.id))})]})}),c.jsxs("div",{className:lr.footer,children:[c.jsx("button",{className:lr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),c.jsxs("button",{className:lr.saveBtn,onClick:s,children:[c.jsx(Hy,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},Ge={container:"_container_1a7t2_1",panelHeader:"_panelHeader_1a7t2_10",panelHeaderLeft:"_panelHeaderLeft_1a7t2_19",panelCollapseBtn:"_panelCollapseBtn_1a7t2_27",titleRow:"_titleRow_1a7t2_46",field:"_field_1a7t2_47",moveBtn:"_moveBtn_1a7t2_64",icon:"_icon_1a7t2_84",nameInput:"_nameInput_1a7t2_93",fieldHeader:"_fieldHeader_1a7t2_118",label:"_label_1a7t2_124",fieldCount:"_fieldCount_1a7t2_133",chips:"_chips_1a7t2_170",chip:"_chip_1a7t2_170",chipRemove:"_chipRemove_1a7t2_188",keywordInput:"_keywordInput_1a7t2_202",input:"_input_1a7t2_207",addBtn:"_addBtn_1a7t2_220",radioGroup:"_radioGroup_1a7t2_234",radioLabel:"_radioLabel_1a7t2_239"},gI=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var P,M;const{updateNode:o,markDirty:a}=Ae(),i=t==="edit",s=Xa(e),l=ce(),d=le(L=>L.relationalFormConfig),f=L=>d==null?void 0:d.find(F=>F.code===L),u=L=>!d||!!f(L),m=(L,F)=>{var z;return((z=f(L))==null?void 0:z.label)||F},[g,w]=h.useState(!0),p=((P=e.metadata)==null?void 0:P.relationalMetadata)??{},[y,v]=h.useState(p.name??e.name??""),[b,C]=h.useState(""),[S,T]=h.useState(Array.isArray(p.keywords)?p.keywords:Array.isArray((M=e.metadata)==null?void 0:M.keywords)?e.metadata.keywords:[]),[I,k]=h.useState(!!p.optional);h.useEffect(()=>{var F,z;const L=((F=e.metadata)==null?void 0:F.relationalMetadata)??{};v(L.name??e.name??""),T(Array.isArray(L.keywords)?L.keywords:Array.isArray((z=e.metadata)==null?void 0:z.keywords)?e.metadata.keywords:[]),k(!!L.optional)},[e.id]);const x=()=>{y.trim()&&y!==e.name&&(o(e.id,{name:y.trim()}),a())},B=()=>{const L=b.trim();if(L&&!S.includes(L)){const F=[...S,L];T(F),o(e.id,{keywords:F}),a()}C("")},q=L=>{const F=S.filter(z=>z!==L);T(F),o(e.id,{keywords:F}),a()},N=L=>{k(L),o(e.id,{optional:L}),a()};return c.jsxs("div",{className:Ge.container,children:[c.jsxs("div",{className:Ge.panelHeader,children:[c.jsxs("div",{className:Ge.panelHeaderLeft,children:[c.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),i&&c.jsx("button",{type:"button",className:Ge.moveBtn,onClick:r,children:l.contentEditForm.moveToAnotherUnitButton})]}),c.jsx("button",{type:"button",className:Ge.panelCollapseBtn,onClick:()=>w(L=>!L),"aria-expanded":g,"aria-label":g?l.contentEditForm.collapseMetadataPanelAriaLabel:l.contentEditForm.expandMetadataPanelAriaLabel,title:g?l.contentEditForm.collapseTitle:l.contentEditForm.expandTitle,children:g?c.jsx(Cn,{size:15}):c.jsx(ky,{size:15})})]}),g&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:Ge.titleRow,children:[e.appIcon&&c.jsx("img",{src:e.appIcon,alt:l.contentEditForm.iconAlt,className:Ge.icon}),c.jsx("input",{type:"text",className:Ge.nameInput,value:y,disabled:!i,onChange:L=>v(L.target.value),onBlur:x,placeholder:l.contentEditForm.contentNamePlaceholder})]}),u("keywords")&&c.jsxs("div",{className:Ge.field,children:[c.jsx("div",{className:Ge.fieldHeader,children:c.jsxs("label",{className:Ge.label,children:[m("keywords",l.contentEditForm.keywordsLabel),S.length>0&&c.jsx("span",{className:Ge.fieldCount,children:S.length})]})}),S.length>0&&c.jsx("div",{className:Ge.chips,children:S.map(L=>c.jsxs("span",{className:Ge.chip,children:[L,i&&c.jsx("button",{type:"button",className:Ge.chipRemove,onClick:()=>q(L),children:"×"})]},L))}),i&&c.jsxs("div",{className:Ge.keywordInput,children:[c.jsx("input",{type:"text",className:Ge.input,value:b,placeholder:l.contentEditForm.addKeywordPlaceholder,onChange:L=>C(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),B())}}),c.jsx("button",{type:"button",className:Ge.addBtn,onClick:B,children:l.contentEditForm.addButton})]})]}),u("optional")&&c.jsxs("div",{className:Ge.field,children:[c.jsx("label",{className:Ge.label,children:m("optional",l.contentEditForm.optionalInCollectionLabel)}),c.jsxs("div",{className:Ge.radioGroup,children:[c.jsxs("label",{className:Ge.radioLabel,children:[c.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:I===!0,onChange:()=>N(!0),disabled:!i}),l.contentEditForm.yesOption]}),c.jsxs("label",{className:Ge.radioLabel,children:[c.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:I===!1,onChange:()=>N(!1),disabled:!i}),l.contentEditForm.noOption]})]})]})]}),n]})},$o={iconBtn:"_iconBtn_vl14u_1",editable:"_editable_vl14u_14",iconImg:"_iconImg_vl14u_26",placeholder:"_placeholder_vl14u_34",removeBtn:"_removeBtn_vl14u_41"},mI=({nodeId:e,value:t,editable:r})=>{const[n,o]=h.useState(!1),{updateNode:a,markDirty:i}=Ae(),s=ce(),l=f=>{a(e,{appIcon:f}),i(),o(!1)},d=f=>{f.stopPropagation(),a(e,{appIcon:""}),i()};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:[$o.iconBtn,r?$o.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?s.titleAppIcon.selectAppIconAriaLabel:s.titleAppIcon.appIconAriaLabel,onClick:()=>r&&o(!0),onKeyDown:f=>{r&&(f.key==="Enter"||f.key===" ")&&o(!0)},children:[t?c.jsx("img",{src:t,alt:s.titleAppIcon.appIconAlt,className:$o.iconImg}):c.jsx("div",{className:$o.placeholder,children:c.jsx(Zc,{size:18})}),t&&r&&c.jsx("button",{type:"button",className:$o.removeBtn,onClick:d,"aria-label":s.titleAppIcon.removeIconAriaLabel,children:c.jsx(Yi,{size:11})})]}),n&&c.jsx(Mh,{nodeId:e,currentValue:t,onSelect:l,onClose:()=>o(!1)})]})},rr={leafContentLayout:"_leafContentLayout_1lchu_1",container:"_container_1lchu_15",emptyState:"_emptyState_1lchu_24",titleRow:"_titleRow_1lchu_34",nodeTitle:"_nodeTitle_1lchu_50",formArea:"_formArea_1lchu_72",contentListArea:"_contentListArea_1lchu_76",dropZone:"_dropZone_1lchu_81",reviewComment:"_reviewComment_1lchu_88",reviewCommentLabel:"_reviewCommentLabel_1lchu_101",reviewCommentText:"_reviewCommentText_1lchu_107"},yI="application/vnd.sunbird.questionset",Xh="application/vnd.sunbird.question",vI=[yI,Xh];function Jh(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 bI=({editorMode:e,onToolbarEvent:t})=>{var M;const r=ce(),[n,o]=h.useState("details"),[a,i]=h.useState([]),[s,l]=h.useState(null),[d,f]=h.useState(!1),u=h.useRef(null),m=h.useRef(),{selectedNodeId:g,breadcrumb:w,activeNodeMeta:p,updateNode:y,treeData:v}=Ae(),b=le(L=>{var F,z,X,ve;return((z=(F=L.editorConfig)==null?void 0:F.context)==null?void 0:z.contentId)??((ve=(X=L.editorConfig)==null?void 0:X.context)==null?void 0:ve.identifier)??""}),C=g?ep(v,g):null,S=!!C&&!C.parent,T=!!(C!=null&&C.isFolder),I=C&&vI.includes(C.mimeType??""),k=(C==null?void 0:C.mimeType)===Xh,x=C&&!C.isFolder&&!I&&!S,B=Jh(C)??(S?Jh(v[0]):void 0),q=h.useCallback(()=>{const L=u.current;if(!L||!g)return;const F=L.innerText.trim();clearTimeout(m.current),m.current=setTimeout(()=>{y(g,{name:F})},600)},[g,y]),N=h.useCallback(L=>{t({action:"onFormValueChange",data:L})},[t]),P=h.useCallback((L,F)=>{i(F),t({action:"onFormStatusChange",data:{isValid:L,nodeId:g}})},[t,g]);return C?I?c.jsx(_l,{node:C,editorMode:e,type:"quml",singleQuestion:k}):x?c.jsxs("div",{className:rr.leafContentLayout,children:[c.jsx(_l,{node:C,editorMode:e,type:"content",layout:"flow"}),c.jsx(gI,{node:C,editorMode:e,onMoveClick:()=>l(C.identifier),reorderDialog:s?c.jsx(fI,{resourceId:s,resourceName:C.name,currentUnitId:C.parent??"",onClose:()=>l(null)}):null})]}):c.jsxs("div",{className:rr.container,children:[c.jsx(d1,{crumbs:w}),B&&c.jsxs("div",{className:rr.reviewComment,role:"alert",children:[c.jsx("span",{className:rr.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),c.jsx("span",{className:rr.reviewCommentText,children:B})]}),c.jsxs("div",{className:rr.titleRow,children:[S&&g&&c.jsx(mI,{nodeId:g,value:String(C.appIcon??((M=C.metadata)==null?void 0:M.appIcon)??""),editable:e==="edit"}),c.jsx("div",{ref:u,className:rr.nodeTitle,contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:q,onBlur:q,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:C.name})]}),c.jsx(u1,{activeTab:n,onChange:L=>o(L),errorTabs:a,visibleTabs:S?void 0:["details"]}),c.jsx("div",{className:rr.formArea,children:c.jsx(bE,{nodeMetadata:p,activeTab:n,isRoot:S,isFolder:T,editorMode:e,onFormValueChange:N,onFormStatusChange:P},`${g??"none"}:${S?"root":"node"}`)}),(T||S)&&n==="details"&&c.jsx("div",{className:rr.contentListArea,children:c.jsx(jE,{editorMode:e})}),c.jsx(qE,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:g??void 0,className:rr.dropZone}),d&&c.jsx(pI,{contentId:b,onClose:()=>f(!1)})]}):c.jsx("div",{className:rr.emptyState,children:c.jsx("p",{children:r.contextualEditor.emptyStateMessage})})};function ep(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=ep(r.children,t);if(n)return n}}}const tp=yo((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const a=[...t().allContent,...r];e({allContent:a,totalCount:n,offset:a.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:o}=t();let a=r;if(n&&n!=="all"){const i=n.toLowerCase();a=a.filter(s=>[s.mimeType??"",s.primaryCategory??"",s.contentType??""].join(" ").toLowerCase().includes(i))}if(o&&o.trim()!==""){const i=o.toLowerCase().trim();a=a.filter(s=>(s.name??"").toLowerCase().includes(i))}e({filteredContent:a})}})),wI=20;function rp(){var d;const e=le(f=>f.editorConfig),t=Ae(f=>f.selectedNodeId),r=Ae(f=>f.treeData),n=h.useCallback(()=>{if(!t||!r.length)return 0;function f(u,m,g=0){var w;for(const p of u){if(p.id===m)return g;if((w=p.children)!=null&&w.length){const y=f(p.children,m,g+1);if(y>=0)return y}}return-1}return Math.max(0,f(r,t))},[t,r])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...Xf];const a=`level${n}`,i=o[a],s=i==null?void 0:i.children,l=s==null?void 0:s.Content;return l!=null&&l.length?l:[...Xf]}function CI(){const e=tp(),t=le(u=>{var m,g;return((g=(m=u.editorConfig)==null?void 0:m.context)==null?void 0:g.channel)??""}),r=rp(),n=h.useRef(),o=h.useCallback(async(u="",m="all",g={},w=!0,p=!1)=>{var y,v,b,C,S;e.setLoading(!0);try{const T={status:["Live"],primaryCategory:m&&m!=="all"?[m]:r};(y=g==null?void 0:g.board)!=null&&y.length&&(T.board=g.board),(v=g==null?void 0:g.medium)!=null&&v.length&&(T.medium=g.medium),(b=g==null?void 0:g.gradeLevel)!=null&&b.length&&(T.gradeLevel=g.gradeLevel),(C=g==null?void 0:g.subject)!=null&&C.length&&(T.subject=g.subject),(S=g==null?void 0:g.primaryCategory)!=null&&S.length&&(T.primaryCategory=g.primaryCategory);const I=w?0:e.offset,{content:k,count:x}=await UE({filters:T,query:u,limit:u?50:wI,offset:I,channel:t||void 0,sortBy:p?{name:"asc"}:{lastUpdatedOn:"desc"}});w?e.setContent(k,x):e.appendContent(k,x)}catch(T){console.error("[useLibrary] load error:",T)}finally{e.setLoading(!1)}},[r,t]);h.useEffect(()=>{o()},[t]);const a=h.useCallback(u=>{e.setSearch(u),clearTimeout(n.current),n.current=setTimeout(()=>o(u,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,o]),i=h.useCallback(u=>{e.setFilter(u),o(e.searchQuery,u,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,o]),s=h.useCallback(u=>{e.setAdvancedFilters(u),o(e.searchQuery,e.activeFilter,u,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,o]),l=h.useCallback(()=>{const u=!e.sortAZ;e.setSortAZ(u),o(e.searchQuery,e.activeFilter,e.advancedFilters,!0,u)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,o]),d=h.useCallback(()=>{e.isLoading||o(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,o]),f=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:f,search:a,setFilter:i,applyAdvancedFilters:s,toggleSort:l,loadMore:d,refetch:()=>o(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ)}}const cr={card:"_card_jzciw_1",addBtn:"_addBtn_jzciw_17",dragging:"_dragging_jzciw_24",ctIcon:"_ctIcon_jzciw_29",info:"_info_jzciw_33",name:"_name_jzciw_41",meta:"_meta_jzciw_50",addBtnMuted:"_addBtnMuted_jzciw_78",added:"_added_jzciw_87",addedBadge:"_addedBadge_jzciw_96"},SI={video:Xi,pdf:ba,h5p:Qi,scorm:Wi,audio:Gi,quiz:Hi,default:Sn},_I=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:o})=>{var y,v;const a=ce(),i=Xa(e),s=SI[i.key]??Sn,l=nl(),d=XT(),f=l&&!o&&d,{attributes:u,listeners:m,setNodeRef:g,isDragging:w}=Vc({id:e.identifier,disabled:!n||!l||!d,data:{type:"library-item",item:e}}),p=()=>{r&&r(e)};return c.jsxs("div",{ref:g,className:[cr.card,w?cr.dragging:"",o?cr.added:""].join(" "),"aria-label":e.name,...n?{...u,...m}:{},role:"listitem",onClick:p,children:[c.jsx("span",{className:[`sbx-ct-sq--${i.key}`,cr.ctIcon].join(" "),"aria-hidden":"true",children:c.jsx(s,{size:14})}),c.jsxs("div",{className:cr.info,children:[c.jsx("span",{className:cr.name,title:e.name,children:e.name}),c.jsxs("span",{className:cr.meta,children:[((y=e.organisation)==null?void 0:y[0])??e.channel??"",(v=e.organisation)!=null&&v[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]})]}),o&&c.jsx("span",{className:cr.addedBadge,"aria-label":a.libraryCard.alreadyAddedAriaLabel,title:a.libraryCard.alreadyAddedTitle,children:c.jsx(wn,{size:12})}),!o&&n&&c.jsx("button",{type:"button",className:[cr.addBtn,!f&&l?cr.addBtnMuted:""].join(" "),onClick:b=>{b.stopPropagation(),t(e)},disabled:!l,"aria-disabled":!f,"aria-label":a.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:l?d?a.libraryCard.addToUnitTitle:a.libraryCard.selectUnitToAddTitle:a.libraryCard.draftOnlyTitle,children:c.jsx(mo,{size:14})})]})},np={chips:"_chips_xhhaq_1",chip:"_chip_xhhaq_1"},TI=({filters:e,active:t,onChange:r})=>{const n=ce();return c.jsx("div",{className:np.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(o=>c.jsx("button",{type:"button",role:"radio","aria-checked":t===o.value,className:["sbx-chip",t===o.value?"filled":"outline",np.chip].join(" "),onClick:()=>r(o.value),children:o.label},o.value))})},st={panel:"_panel_1cl11_1",header:"_header_1cl11_10",headerTitle:"_headerTitle_1cl11_19",closeBtn:"_closeBtn_1cl11_25",body:"_body_1cl11_43",section:"_section_1cl11_59",sectionLabel:"_sectionLabel_1cl11_65",chips:"_chips_1cl11_73",chip:"_chip_1cl11_73",active:"_active_1cl11_96",footer:"_footer_1cl11_102",resetBtn:"_resetBtn_1cl11_112",applyBtn:"_applyBtn_1cl11_129"},EI=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}],II=new Set(["board","medium","gradeLevel","subject","topic"]),OI=({local:e,toggle:t})=>{const r=ce(),n=rp();return n.length?c.jsxs("div",{className:st.section,children:[c.jsx("div",{className:st.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),c.jsx("div",{className:st.chips,children:n.map(o=>c.jsx("button",{type:"button",className:[st.chip,(e.primaryCategory??[]).includes(o)?st.active:""].join(" "),onClick:()=>t("primaryCategory",o),children:o},o))})]}):null},AI=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var y,v;const o=ce(),a=le(b=>b.editorConfig),i=le(b=>b.searchFormConfig),s=le(b=>b.contentFramework),l=le(b=>b.contentTargetFWIds),{organisationFramework:d}=Oh(s??((y=a==null?void 0:a.context)==null?void 0:y.framework),l??((v=a==null?void 0:a.context)==null?void 0:v.targetFWIds)),[f,u]=h.useState(t),m=i!=null&&i.length?i.filter(b=>II.has(b.code)).map(b=>({key:b.code,label:b.label||b.code})):EI(o);h.useEffect(()=>{u(t)},[t]);const g=(b,C)=>{u(S=>{const T=S[b]??[],I=T.includes(C)?T.filter(k=>k!==C):[...T,C];return{...S,[b]:I}})},w=(d==null?void 0:d.categories)??[],p=b=>{var C;return((C=w.find(S=>S.code===b))==null?void 0:C.terms)??[]};return e?c.jsxs("div",{className:st.panel,role:"dialog","aria-label":o.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[c.jsxs("div",{className:st.header,children:[c.jsx("span",{className:st.headerTitle,children:o.libraryFilterPanel.filtersHeaderTitle}),c.jsx("button",{type:"button",className:st.closeBtn,onClick:n,"aria-label":o.libraryFilterPanel.closeFiltersAriaLabel,children:c.jsx(yr,{size:16})})]}),c.jsxs("div",{className:st.body,children:[m.map(({key:b,label:C})=>{const S=p(b);return S.length?c.jsxs("div",{className:st.section,children:[c.jsx("div",{className:st.sectionLabel,children:C}),c.jsx("div",{className:st.chips,children:S.slice(0,20).map(T=>c.jsx("button",{type:"button",className:[st.chip,(f[b]??[]).includes(T.name)?st.active:""].join(" "),onClick:()=>g(b,T.name),children:T.name},T.identifier))})]},b):null}),c.jsx(OI,{local:f,toggle:g})]}),c.jsxs("div",{className:st.footer,children:[c.jsx("button",{type:"button",className:st.resetBtn,onClick:()=>u({}),children:o.libraryFilterPanel.resetButton}),c.jsx("button",{type:"button",className:st.applyBtn,onClick:()=>{r(f),n()},children:o.libraryFilterPanel.applyButton})]})]}):null},vr={header:"_header_6qdpu_10",title:"_title_6qdpu_20",headerActions:"_headerActions_6qdpu_31",iconBtn:"_iconBtn_6qdpu_38",playerArea:"_playerArea_6qdpu_56",footer:"_footer_6qdpu_64",addBtn:"_addBtn_6qdpu_73",modalOverlay:"_modalOverlay_6qdpu_92",modalPanel:"_modalPanel_6qdpu_103"},DI="application/vnd.sunbird.questionset",NI=({content:e,editorMode:t,onAdd:r,onClose:n})=>{const o=ce(),a=t==="edit";if(!e)return null;const i={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return Pe.createPortal(c.jsx("div",{className:vr.modalOverlay,role:"dialog","aria-modal":"true","aria-label":o.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:c.jsxs("div",{className:vr.modalPanel,onClick:s=>s.stopPropagation(),children:[c.jsxs("div",{className:vr.header,children:[c.jsx("span",{className:vr.title,title:e.name,children:e.name}),c.jsx("div",{className:vr.headerActions,children:c.jsx("button",{type:"button",className:vr.iconBtn,onClick:n,"aria-label":o.libraryPreviewPanel.closePreviewAriaLabel,children:c.jsx(yr,{size:16})})})]}),c.jsx("div",{className:vr.playerArea,children:c.jsx(_l,{node:i,editorMode:"read",type:e.mimeType===DI?"quml":"content"})}),a&&c.jsx("div",{className:vr.footer,children:c.jsx("button",{type:"button",className:vr.addBtn,onClick:()=>r(e),children:o.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},Ue={dock:"_dock_1lpg0_1",header:"_header_1lpg0_8",headerLeft:"_headerLeft_1lpg0_17",headerTitle:"_headerTitle_1lpg0_24",count:"_count_1lpg0_30",searchRow:"_searchRow_1lpg0_39",searchWrap:"_searchWrap_1lpg0_47",searchIcon:"_searchIcon_1lpg0_53",searchInput:"_searchInput_1lpg0_62",filterToggleBtn:"_filterToggleBtn_1lpg0_80",filterToggleBtnActive:"_filterToggleBtnActive_1lpg0_99",filterBadge:"_filterBadge_1lpg0_105",filters:"_filters_1lpg0_124",mainArea:"_mainArea_1lpg0_134",sidePanelOverlay:"_sidePanelOverlay_1lpg0_143",cardList:"_cardList_1lpg0_152",skeleton:"_skeleton_1lpg0_168",skeletonIcon:"_skeletonIcon_1lpg0_178",skeletonText:"_skeletonText_1lpg0_186",skeletonLine:"_skeletonLine_1lpg0_193",skeletonLineSm:"_skeletonLineSm_1lpg0_200",loadMoreBtn:"_loadMoreBtn_1lpg0_215",emptyState:"_emptyState_1lpg0_240",collapseBtn:"_collapseBtn_1lpg0_260"};function kI(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 xI=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=ce(),{content:o,isLoading:a,totalCount:i,activeFilter:s,searchQuery:l,sortAZ:d,hasMore:f,search:u,setFilter:m,applyAdvancedFilters:g,toggleSort:w,loadMore:p}=CI(),{addResource:y,selectedNodeId:v,treeData:b}=Ae(),C=e==="edit",[S,T]=h.useState(!1),[I,k]=h.useState({}),[x,B]=h.useState(null),q=h.useMemo(()=>kI(b),[b]),N=h.useCallback(z=>{var Ee;if(!v){Ie.error(n.libraryDock.selectUnitFirstToast);return}const X=(Ee=b[0])==null?void 0:Ee.id;if(v===X){Ie(n.libraryDock.selectUnitFromOutlineToast,{icon:c.jsx(Ri,{size:16}),duration:4e3});return}if(y(z,v)===!1){Ie.error(n.libraryDock.itemAlreadyAddedToast.replace("{name}",z.name));return}Ie.success(n.libraryDock.itemAddedToast.replace("{name}",z.name))},[v,y,b,n]),P=h.useCallback(z=>{k(z),g(z)},[g]),M=h.useCallback(z=>{B(z)},[]),L=h.useCallback(z=>{N(z),B(null)},[N]),F=h.useMemo(()=>Object.values(I).reduce((z,X)=>z+((X==null?void 0:X.length)??0),0),[I]);return c.jsxs("div",{className:Ue.dock,children:[c.jsx("div",{className:Ue.header,children:c.jsxs("div",{className:Ue.headerLeft,children:[c.jsx("button",{type:"button",className:Ue.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:c.jsx(Vy,{size:15})}),c.jsx(jy,{size:16}),c.jsx("span",{className:Ue.headerTitle,children:n.libraryDock.headerTitle}),i>0&&c.jsx("span",{className:Ue.count,children:i})]})}),c.jsxs("div",{className:Ue.searchRow,children:[c.jsxs("div",{className:Ue.searchWrap,children:[c.jsx(Ki,{size:14,className:Ue.searchIcon}),c.jsx("input",{type:"search",className:Ue.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:l,onChange:z=>u(z.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),c.jsx("button",{type:"button",className:[Ue.filterToggleBtn,d?Ue.filterToggleBtnActive:""].join(" "),onClick:w,"aria-label":d?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:d?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:d?c.jsx(Ay,{size:15}):c.jsx(Ly,{size:15})}),c.jsxs("button",{type:"button",className:[Ue.filterToggleBtn,S?Ue.filterToggleBtnActive:""].join(" "),onClick:()=>T(z=>!z),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":S,title:n.libraryDock.advancedFiltersTitle,children:[c.jsx(Ky,{size:15}),F>0&&c.jsx("span",{className:Ue.filterBadge,children:F})]})]}),c.jsx("div",{className:Ue.filters,children:c.jsx(TI,{filters:JT,active:s,onChange:m})}),c.jsxs("div",{className:Ue.mainArea,children:[c.jsx("div",{className:Ue.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:a&&o.length===0?Array.from({length:4}).map((z,X)=>c.jsxs("div",{className:Ue.skeleton,"aria-hidden":"true",children:[c.jsx("div",{className:Ue.skeletonIcon}),c.jsxs("div",{className:Ue.skeletonText,children:[c.jsx("div",{className:Ue.skeletonLine}),c.jsx("div",{className:Ue.skeletonLineSm})]})]},X)):o.length>0?c.jsxs(c.Fragment,{children:[o.map(z=>c.jsx(_I,{item:z,onAdd:N,onPreview:M,isDraggable:C,isAdded:q.has(z.identifier)},z.identifier)),f&&c.jsx("button",{type:"button",className:Ue.loadMoreBtn,onClick:p,disabled:a,"aria-label":n.libraryDock.loadMoreAriaLabel,children:a?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):c.jsxs("div",{className:Ue.emptyState,children:[c.jsx(Ki,{size:24}),c.jsx("p",{children:n.libraryDock.noContentFound}),c.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})}),S&&c.jsx("div",{className:Ue.sidePanelOverlay,children:c.jsx(AI,{isOpen:S,filters:I,onApply:P,onClose:()=>T(!1)})}),x&&c.jsx(NI,{content:x,editorMode:e,onAdd:L,onClose:()=>B(null)})]})]})};function LI(e,t,r){const n={},o={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),s=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","dialcodes"]),l=new Set(["copyrightYear","compatibilityLevel","version"]);function d(m,g=!1){const w={};for(const[p,y]of Object.entries(m))if(!a.has(p)&&!(g&&i.has(p)))if(s.has(p))Array.isArray(y)?w[p]=y:y!=null&&y!==""?w[p]=[y]:w[p]=[];else if(l.has(p)){const v=Number(y);isNaN(v)||(w[p]=v)}else w[p]=y;return w}function f(m){var w;const g={};for(const p of m.children??[]){if(p.isFolder)continue;const y=t[p.identifier];if(!y)continue;const{isNew:v,...b}=y;if(Object.keys(b).length===0)continue;const C=((w=p.metadata)==null?void 0:w.relationalMetadata)??{};g[p.identifier]={name:p.name,...C,...b}}return g}function u(m,g){var C,S;const w=m.identifier,p=t[w],y=w.startsWith("temp-")||!!(p!=null&&p.isNew),v=!m.isFolder&&!g;if(g||y||p&&!v){let T;if(y)T={mimeType:"application/vnd.ekstep.content-collection",code:w,contentType:((C=m.metadata)==null?void 0:C.contentType)??"CourseUnit",primaryCategory:((S=m.metadata)==null?void 0:S.primaryCategory)??"Course Unit",name:m.name,visibility:"Parent",channel:r,...d(m.metadata??{})};else if(g){const{isNew:I,...k}=p??{};T={...d(m.metadata??{},!0),...d(k,!1),name:m.name}}else{const{isNew:I,...k}=p??{};T={name:m.name,visibility:"Parent",...d(k,!0)}}n[w]={metadata:T,objectType:m.objectType||(m.isFolder?"Collection":"Content"),root:g,isNew:y}}const b=m.isFolder?f(m):{};o[w]={name:m.name,children:(m.children??[]).map(T=>T.identifier),...Object.keys(b).length>0?{relationalMetadata:b}:{},root:g},(m.children??[]).forEach(T=>u(T,!1))}return e.forEach((m,g)=>u(m,g===0)),{nodesModified:n,hierarchy:o}}function PI(){const[e,t]=h.useState(!1),r=Ae(f=>f.treeCache),n=Ae(f=>f.treeData),o=le(f=>f.isDirty),a=le(f=>f.lastSaved),{setIsDirty:i,setLastSaved:s}=le(),l=le(f=>f.editorConfig);return{save:h.useCallback(async()=>{if(!l||e)return;const f=l.context.contentId??l.context.identifier??"";if(!f)return;const u=l.context.channel??"",m=l.context.userId??l.context.uid??"";t(!0);try{const{nodesModified:g,hierarchy:w}=LI(n,r,u),{identifiers:p}=await Tw(f,g,w,m);p&&Object.keys(p).length>0&&Ae.getState().replaceNodeIds(p);const y=new Date().toISOString();s(y),i(!1)}catch(g){console.error("[useSaveHierarchy] save failed:",g),Ie.error("Failed to save. Please try again.")}finally{t(!1)}},[l,e,n,r,i,s]),isSaving:e,isDirty:o,lastSaved:a}}const FI={};function MI(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function $I(e,t,r,n,o){const a=[],i=(s,l)=>{var d;for(const f of s){const u=l&&!f.parent,m=u?r:f.isFolder?n:null;if(m&&m.length>0){const g={...f.metadata??{},...t[f.id]??{}},p=Nh(m,g,FI,u,o).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&MI(y.currentValue)).map(y=>y.label);p.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:p})}(d=f.children)!=null&&d.length&&i(f.children,!1)}};return i(e,!0),a}function BI(e){const t=le(u=>u.editorConfig),r=le(u=>u.setButtonLoader),n=le(u=>u.validateAllForms),o=le(u=>u.rootFormConfig),a=le(u=>u.unitFormConfig),i=Ae(u=>u.treeData),s=Ae(u=>u.treeCache),l=Ae(u=>u.selectNode),d=h.useCallback(()=>{var p,y,v;const u={editorMode:"edit",objectType:(p=t==null?void 0:t.config)==null?void 0:p.objectType,userFullName:(v=(y=t==null?void 0:t.context)==null?void 0:y.user)==null?void 0:v.fullName},m=$I(i,s,o,a,u);if(m.length===0)return!0;const g=m[0];Ie.error(`"${g.nodeName}": please fill required field${g.missing.length>1?"s":""} — ${g.missing.join(", ")}`);const{setFormStatus:w}=le.getState();return m.forEach(b=>w(b.nodeId,!1)),l(g.nodeId),!1},[i,s,o,a,t,l]);return{runAction:h.useCallback(async(u,m)=>{var p,y,v,b;const g=((p=t==null?void 0:t.context)==null?void 0:p.contentId)??((y=t==null?void 0:t.context)==null?void 0:y.identifier)??"";if(!g)return Ie.error("No content identifier found."),!1;const w=((v=t==null?void 0:t.context)==null?void 0:v.userId)??((b=t==null?void 0:t.context)==null?void 0:b.uid)??"";try{switch(u){case"sendForReview":return d()?n(i)?(r("saveCollection",!0),await e(),await Ow(g),Ie.success("Content sent for review"),!0):(Ie.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{r("rejectCollection",!0);const C=(m==null?void 0:m.comment)??"";return await Aw(g,C),Ie.success("Content rejected and sent back to the author"),!0}case"publish":return d()?n(i)?(r("publishCollection",!0),await e(),await Ew(g,w),Ie.success("Content published successfully"),!0):(Ie.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(C){console.error(`[useToolbarActions] ${u} failed`,C);const S=u==="sendForReview"?"send for review":u==="reject"?"reject":"publish";return Ie.error(`Failed to ${S}. Please try again.`),!1}finally{r("saveCollection",!1),r("rejectCollection",!1),r("publishCollection",!1)}},[t,e,r,d,n,i]),checkRequiredFields:d}}const Bt={shell:"_shell_90fon_1",workspace:"_workspace_90fon_8",sidebarCollapsed:"_sidebarCollapsed_90fon_16",dockCollapsed:"_dockCollapsed_90fon_19",dock:"_dock_90fon_19",outline:"_outline_90fon_40",reopenTab:"_reopenTab_90fon_45",outlineHidden:"_outlineHidden_90fon_79",editor:"_editor_90fon_86",dockHidden:"_dockHidden_90fon_101",dockReopenTab:"_dockReopenTab_90fon_108",dragChip:"_dragChip_90fon_133",dragChipLabel:"_dragChipLabel_90fon_148"},jI=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const o=ce(),[a,i]=h.useState(null),[s,l]=h.useState(!1),[d,f]=h.useState(!1),[u,m]=h.useState(!1),{addResource:g,treeData:w}=Ae(),p=le(F=>F.setFormStatus),[y,v]=h.useState(!0),b=Ae(F=>F.selectedNodeId),{save:C,isSaving:S,isDirty:T,lastSaved:I}=PI(),{runAction:k,checkRequiredFields:x}=BI(C);h.useEffect(()=>{if(!T)return;const F=z=>{z.preventDefault(),z.returnValue=""};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[T]);const B=dc(Li(pa,{activationConstraint:{distance:8}})),q=h.useCallback(F=>{var X;const z=(X=F.active.data.current)==null?void 0:X.item;z&&i(z)},[]),N=h.useCallback(F=>{var ue,Q;i(null);const z=(ue=F.active.data.current)==null?void 0:ue.item;if(!z)return;const X=F.over,ve=(X==null?void 0:X.id)??b??void 0;if(!ve){Ie.error(o.splitBuilderShell.dropOntoUnitError);return}const Ee=(Q=w[0])==null?void 0:Q.id;if(ve===Ee){Ie.error(o.splitBuilderShell.dropOntoCourseError);return}if(!g(z,ve)){Ie.error(o.splitBuilderShell.alreadyInCollectionError.replace("{name}",z.name));return}r==null||r(z,ve),Ie.success(o.splitBuilderShell.addedToUnitSuccess.replace("{name}",z.name))},[b,g,r,o]),P=h.useCallback(async F=>{if(F.action==="onFormStatusChange"){const{isValid:z,nodeId:X}=F.data??{},ve=z!==!1;v(ve),X&&p(X,ve);return}if(F.action==="back"&&T&&e==="edit"){m(!0);return}if(F.action==="saveCollection"){if(!y){Ie.error(o.splitBuilderShell.fillRequiredMetadataError);return}if(!x())return;await C(),n==null||n(w),t==null||t(F);return}if(F.action==="sendForReview"||F.action==="reject"||F.action==="publish"){await k(F.action,F.data)&&(t==null||t(F));return}t==null||t(F)},[C,k,x,t,n,w,T,y,e,o]),M=h.useCallback(async()=>{if(!x()){m(!1);return}await C(),m(!1),n==null||n(w),t==null||t({action:"back"})},[C,x,n,t,w]),L=h.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return c.jsxs(qc,{sensors:B,onDragStart:q,onDragEnd:N,children:[c.jsxs("div",{className:Bt.shell,children:[c.jsx(jw,{editorMode:e,isSaving:S,isDirty:T,lastSaved:I,isFormValid:y,onToolbarEvent:P}),c.jsxs("div",{className:[Bt.workspace,s?Bt.sidebarCollapsed:"",d?Bt.dockCollapsed:""].filter(Boolean).join(" "),children:[c.jsx("aside",{className:[Bt.outline,s?Bt.outlineHidden:""].join(" "),"aria-label":o.splitBuilderShell.outlineAriaLabel,"aria-hidden":s,children:c.jsx(c1,{editorMode:e,collapsed:s,onToggleCollapse:()=>l(F=>!F)})}),s&&c.jsx("button",{className:Bt.reopenTab,onClick:()=>l(!1),title:o.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),c.jsx("main",{className:Bt.editor,role:"main","aria-label":o.splitBuilderShell.editorAriaLabel,children:c.jsx(bI,{editorMode:e,onToolbarEvent:P})}),c.jsx("aside",{className:[Bt.dock,d?Bt.dockHidden:""].filter(Boolean).join(" "),"aria-label":o.splitBuilderShell.libraryAriaLabel,"aria-hidden":d,children:c.jsx(xI,{editorMode:e,collapsed:d,onToggleCollapse:()=>f(F=>!F)})}),d&&c.jsx("button",{className:Bt.dockReopenTab,onClick:()=>f(!1),title:o.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),c.jsx(_y,{dropAnimation:null,children:a?c.jsx("div",{className:Bt.dragChip,children:c.jsx("span",{className:Bt.dragChipLabel,children:a.name})}):null}),u&&c.jsx(qw,{onSave:M,onDiscard:L,onCancel:()=>m(!1),isSaving:S})]})},qI="v1";function UI(e){const t=e.validations,r=t==null?void 0:t.find(o=>o.type==="maxlength"||o.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function op(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:UI(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function Lr(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const o=n.name??void 0,a=n.fields.filter(i=>!!i.code).sort((i,s)=>(i.index??0)-(s.index??0));for(const i of a)r.push(op(i,o))}else n.code&&r.push(op(n));return r}function VI(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,o]of Object.entries(t))o&&"default"in o&&(r[n]=o.default);return r}async function zI(e,t,r="Collection",n=qI){var d,f;const a=(f=(d=(await ke.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:d.result)==null?void 0:f.objectCategoryDefinition,i=(a==null?void 0:a.forms)??{},s=(a==null?void 0:a.objectMetadata)??{},l=s.config??{};return{rootForm:Lr(i.create),unitForm:Lr(i.unitMetadata),childForm:Lr(i.childMetadata),searchForm:Lr(i.search??i.searchConfig),relationalForm:Lr(i.relationalMetadata),publishChecklist:Lr(i.publishchecklist),reviewChecklist:Lr(i.review),rfcChecklist:Lr(i.requestforchangeschecklist),schemaDefaults:VI(s.schema),frameworkMetadata:l.frameworkMetadata??{},sourcingSettings:l.sourcingSettings??{}}}function ap(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function HI({config:e,onError:t}){const[r,n]=h.useState(!0),[o,a]=h.useState(null),[i,s]=h.useState(!1),{setEditorConfig:l,setEditorMode:d,setCategoryDefinition:f,setContentFramework:u}=le(),{setTreeData:m,selectNode:g}=Ae();return h.useEffect(()=>{let w=!1;async function p(){var y,v,b;try{n(!0),a(null),e.apiBaseUrl&&nu(e.apiBaseUrl),l(e),d(e.config.mode);const C=e.context.contentId??e.context.identifier??"",S=e.context.channel??"";let T;if(S)try{T=(y=await Ah(S))==null?void 0:y.defaultFramework}catch{}let I=!1;if(C){const k=e.config.objectType==="QuestionSet",{rootNode:x}=k?await _w(C):await su(C);if(!w&&(m(x?[x]:[]),x)){g(x.id);const{framework:M,targetFWIds:L}=ap(x.metadata??{},T,e.context);u(M,L),I=!0}const B=e.config.primaryCategory??"Course",q=e.context.channel??"",N=e.config.categoryDefinitionApiVersion??"v1";try{const P=await zI(B,q,e.config.objectType??"Collection",N);if(!w){f(P);const M=((v=P.sourcingSettings)==null?void 0:v.collection)??{},L={};M.maxDepth&&!e.config.maxDepth&&(L.maxDepth=M.maxDepth),M.children&&!e.config.children&&(L.children=M.children),M.hierarchy&&!((b=e.config.hierarchy)!=null&&b.level1)&&(L.hierarchy={...e.config.hierarchy??{},...M.hierarchy}),Object.keys(L).length>0&&l({...e,config:{...e.config,...L}})}}catch{}}if(!w&&!I){const{framework:k,targetFWIds:x}=ap({},T,e.context);u(k,x)}w||s(!0)}catch(C){if(!w){const S=C instanceof Error?C:new Error(String(C));a(S),t==null||t(S)}}finally{w||n(!1)}}return p(),()=>{w=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:o,isReady:i}}function RI(){const e=md(t=>t.setLanguage);h.useEffect(()=>{e(localStorage.getItem(ss)||"en",{broadcast:!1});const t=n=>{n.key===ss&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var a;const o=(a=n.detail)==null?void 0:a.lang;o&&e(o,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(ls,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(ls,r)}},[e])}const Bo={root:"_root_qcpw6_1",loadingState:"_loadingState_qcpw6_10",loadingSpinner:"_loadingSpinner_qcpw6_20",errorState:"_errorState_qcpw6_34"},QI=new Kp({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function GI({error:e,onRetry:t}){const r=ce();return c.jsxs("div",{className:Bo.errorState,children:[c.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),c.jsx("p",{children:e.message}),c.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class WI extends h.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?c.jsx(GI,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function KI(e){RI();const t=ce(),{isLoading:r,error:n}=HI({config:e,onError:e.onError}),o=le(a=>a.editorMode);return r?c.jsxs("div",{className:Bo.loadingState,children:[c.jsx("div",{className:Bo.loadingSpinner}),c.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?c.jsxs("div",{className:Bo.errorState,children:[c.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),c.jsx("p",{children:n.message})]}):c.jsx("div",{className:`sb-split-builder ${Bo.root}`,children:c.jsx(jI,{editorMode:o,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const ip=e=>c.jsx(WI,{onError:e.onError,children:c.jsxs(Zp,{client:QI,children:[c.jsx(KI,{...e}),c.jsx(Yg,{position:"top-right",toastOptions:{duration:3e3}})]})}),ui=Symbol.for("r2wc.reactRender"),sp=Symbol.for("r2wc.shouldRender"),fi=Symbol.for("r2wc.root");function YI(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ZI(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var lp={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[ui]()}}),e[ui]()}};function XI(e,t,r,n={}){var o={isConnected:"isConnected"in HTMLElement.prototype},a=!1,i=function(){var d=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?d.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),d.attachShadow({mode:"open"})),d},s=Object.create(HTMLElement.prototype);s.constructor=i;var l=new Proxy(s,{has:function(d,f){return f in e.propTypes||f in s},set:function(d,f,u,m){return a&&(o[f]=!0),typeof f=="symbol"||o[f]||f in d?(e.propTypes&&f in e.propTypes&&lp.expando(m,f,u),Reflect.set(d,f,u,m)):(lp.expando(m,f,u),!0)},getOwnPropertyDescriptor:function(d,f){var u=Reflect.getOwnPropertyDescriptor(d,f);if(u)return u;if(f in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return i.prototype=l,s.connectedCallback=function(){this[sp]=!0,this[ui]()},s.disconnectedCallback=function(){typeof r.createRoot=="function"?this[fi].unmount():r.unmountComponentAtNode(this)},s[ui]=function(){if(this[sp]===!0){var d={};Object.keys(this).forEach(function(m){o[m]!==!1&&(d[m]=this[m])},this),a=!0;const f=n.shadow?this.shadowRoot:this,u=t.createElement(e,d);typeof r.createRoot=="function"?(this[fi]||(this[fi]=r.createRoot(f)),this[fi].render(u)):r.render(u,f),a=!1}},e.propTypes&&(i.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(d){return YI(d)}):Object.keys(e.propTypes),s.attributeChangedCallback=function(d,f,u){var m=n.dashStyleAttributes?ZI(d):d;this[m]=u}),i}var jo={},qo=Pe;if(process.env.NODE_ENV==="production")jo.createRoot=qo.createRoot,jo.hydrateRoot=qo.hydrateRoot;else{var hi=qo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;jo.createRoot=function(e,t){hi.usingClientEntryPoint=!0;try{return qo.createRoot(e,t)}finally{hi.usingClientEntryPoint=!1}},jo.hydrateRoot=function(e,t,r){hi.usingClientEntryPoint=!0;try{return qo.hydrateRoot(e,t,r)}finally{hi.usingClientEntryPoint=!1}}}function JI(){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 eO(e="sb-collection-editor"){if(JI(),typeof customElements>"u"||customElements.get(e))return;const t=XI(ip,h,jo,{});customElements.define(e,t)}me.CollectionEditor=ip,me.registerCollectionEditor=eO,me.setApiBaseUrl=nu,me.useEditorStore=le,me.useLibraryStore=tp,me.useTreeStore=Ae,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
|