ados-rcm 1.1.654 → 1.1.655

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/index.cjs.js CHANGED
@@ -278,66 +278,66 @@ H=m.get(G);H&&(k(F,"vt-share"),k(H,"vt-share"),m.set(G,null))}}c=c.nextSibling}f
278
278
  document.__reactViewTransition=document.startViewTransition({update:function(){A(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],b={},e=0;e<u.length;b={g:b.g},e++)if(b.g=u[e],!b.g.complete){var p=b.g.getBoundingClientRect();0<p.bottom&&0<p.right&&p.top<window.innerHeight&&p.left<window.innerWidth&&(p=new Promise(function(w){return function(q){w.g.addEventListener("load",q);w.g.addEventListener("error",q)}}(b)),a.push(p))}return Promise.race([Promise.all(a),new Promise(function(w){var q=
279
279
  performance.now();setTimeout(w,2300>q&&2E3<q?2300-q:500)})])},types:[]});z.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var b=l[a],e=b.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===b.getAttribute("style")&&b.removeAttribute("style")}});z.finished.finally(function(){document.__reactViewTransition===z&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}A(g)}.bind(null,$RV);`);var Rr=R('$RC("'),to=R(`$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=
280
280
  "stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=
281
- "$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`),Pi=R('$RR("'),jo=R('","'),es=R('",'),Zs=R('"'),gr=R(")<\/script>");R('<template data-rci="" data-bid="'),R('<template data-rri="" data-bid="'),R('" data-sid="'),R('" data-sty="');var Bl=R('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'),yo=R('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),Cl=R('$RX("'),qa=R('"'),Di=R(","),pc=R(")<\/script>");R('<template data-rxi="" data-bid="'),R('" data-dgst="'),R('" data-msg="'),R('" data-stck="'),R('" data-cstck="');var Ls=/[<\u2028\u2029]/g,_l=/[&><\u2028\u2029]/g,ps=R(' media="not all" data-precedence="'),zl=R('" data-href="'),vc=R('">'),Kc=R("</style>"),ts=!1,Jc=!0,Hl=[],ja=R(' data-precedence="'),mf=R('" data-href="'),_i=R(" "),mu=R('">'),Os=R("</style>");R('<link rel="expect" href="#'),R('" blocking="render"/>');var mr=R(' id="'),Qc=R("["),xf=R(",["),bc=R(","),qc=R("]"),yc=0,wf=1,Lo=2,jc=3,Ra=/[<>\r\n]/g,Cf=/["';,\r\n]/g,Ps=Function.prototype.bind,Qf=Symbol.for("react.client.reference"),no={};Object.freeze(no);var ns={},ca=null,Yu={},$c={},Vu=new Set,$a=new Set,qf=new Set,Zu=new Set,mc=new Set,ec=new Set,_f=new Set,xc=new Set,Sf=new Set,yh={enqueueSetState:function(c,f,E){var D=c._reactInternals;D.queue===null?tt(c,"setState"):(D.queue.push(f),E!=null&&Se(E))},enqueueReplaceState:function(c,f,E){c=c._reactInternals,c.replace=!0,c.queue=[f],E!=null&&Se(E)},enqueueForceUpdate:function(c,f){c._reactInternals.queue===null?tt(c,"forceUpdate"):f!=null&&Se(f)}},xu={id:1,overflow:""},wu=Math.clz32?Math.clz32:Sn,cd=Math.log,ud=Math.LN2,ua=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),jf=null,fd=typeof Object.is=="function"?Object.is:pr,$o=null,Ia=null,yi=null,Sl=null,Xs=null,li=null,El=!1,vs=!1,wo=0,Cu=0,Ef=-1,$f=0,fa=null,ha=null,Xu=0,Ks=!1,wc,Cc={readContext:ho,use:function(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return Gr(c);if(c.$$typeof===ki)return ho(c)}throw Error("An unsupported type was passed to use(): "+String(c))},useContext:function(c){return wc="useContext",On(),c._currentValue},useMemo:sl,useReducer:oo,useRef:function(c){$o=On(),li=An();var f=li.memoizedState;return f===null?(c={current:c},Object.seal(c),li.memoizedState=c):f},useState:function(c){return wc="useState",oo(So,c)},useInsertionEffect:In,useLayoutEffect:In,useCallback:function(c,f){return sl(function(){return c},f)},useImperativeHandle:In,useEffect:In,useDebugValue:In,useDeferredValue:function(c,f){return On(),f!==void 0?f:c},useTransition:function(){return On(),[!1,Jl]},useId:function(){var c=Ia.treeContext,f=c.overflow;c=c.id,c=(c&~(1<<32-wu(c)-1)).toString(32)+f;var E=u;if(E===null)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");return f=wo++,c="_"+E.idPrefix+"R_"+c,0<f&&(c+="H"+f.toString(32)),c+"_"},useSyncExternalStore:function(c,f,E){if(E===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return E()},useOptimistic:function(c){return On(),[c,Zo]},useActionState:xo,useFormState:xo,useHostTransitionStatus:function(){return On(),Yr},useMemoCache:function(c){for(var f=Array(c),E=0;E<c;E++)f[E]=ra;return f},useCacheRefresh:function(){return cn},useEffectEvent:function(){return Ai}},u=null,p=null,T={getCacheForType:function(){throw Error("Not implemented.")},cacheSignal:function(){throw Error("Not implemented.")},getOwner:function(){return p===null?null:p.componentStack}},F=0,q,ce,Ae,ze,Dt,je,wt;Cn.__reactDisabledLog=!0;var en,mn,an=!1,Wt=new(typeof WeakMap=="function"?WeakMap:Map),Ir={react_stack_bottom_frame:function(c,f,E){return c(f,E)}},Si=Ir.react_stack_bottom_frame.bind(Ir),or={react_stack_bottom_frame:function(c){return c.render()}},Cr=or.react_stack_bottom_frame.bind(or),el={react_stack_bottom_frame:function(c){var f=c._init;return f(c._payload)}},tl=el.react_stack_bottom_frame.bind(el),Kr=0;if(typeof performance=="object"&&typeof performance.now=="function")var Co=performance,rs=function(){return Co.now()};else{var Mn=Date;rs=function(){return Mn.now()}}var Pn=4,ei=0,Hr=1,mi=2,Ni=3,Wr=4,Bn=5,Wl=14,hi=null,pl={},Ui={},is={},_u={},bs=!1,ka=!1,vl=!1,ao=0,Go=!1;Fs(),Fs(),_g.prerender=function(c,f){return new Promise(function(E,D){var Z=f?f.onHeaders:void 0,ie;Z&&(ie=function(et){Z(new Headers(et))});var we=me(f?f.identifierPrefix:void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.bootstrapScriptContent:void 0,f?f.bootstrapScripts:void 0,f?f.bootstrapModules:void 0),De=Ii(c,we,ge(we,void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.importMap:void 0,ie,f?f.maxHeadersLength:void 0),pe(f?f.namespaceURI:void 0),f?f.progressiveChunkSize:void 0,f?f.onError:void 0,function(){var et=new ReadableStream({type:"bytes",pull:function(Zt){hs(De,Zt)},cancel:function(Zt){De.destination=null,ci(De,Zt)}},{highWaterMark:0});et={postponed:wi(De),prelude:et},E(et)},void 0,void 0,D,f?f.onPostpone:void 0);if(f&&f.signal){var mt=f.signal;if(mt.aborted)ci(De,mt.reason);else{var Ge=function(){ci(De,mt.reason),mt.removeEventListener("abort",Ge)};mt.addEventListener("abort",Ge)}}hl(De)})},_g.renderToReadableStream=function(c,f){return new Promise(function(E,D){var Z,ie,we=new Promise(function(qt,Ft){ie=qt,Z=Ft}),De=f?f.onHeaders:void 0,mt;De&&(mt=function(qt){De(new Headers(qt))});var Ge=me(f?f.identifierPrefix:void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.bootstrapScriptContent:void 0,f?f.bootstrapScripts:void 0,f?f.bootstrapModules:void 0),et=To(c,Ge,ge(Ge,f?f.nonce:void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.importMap:void 0,mt,f?f.maxHeadersLength:void 0),pe(f?f.namespaceURI:void 0),f?f.progressiveChunkSize:void 0,f?f.onError:void 0,ie,function(){var qt=new ReadableStream({type:"bytes",pull:function(Ft){hs(et,Ft)},cancel:function(Ft){et.destination=null,ci(et,Ft)}},{highWaterMark:0});qt.allReady=we,E(qt)},function(qt){we.catch(function(){}),D(qt)},Z,f?f.onPostpone:void 0,f?f.formState:void 0);if(f&&f.signal){var Zt=f.signal;if(Zt.aborted)ci(et,Zt.reason);else{var jt=function(){ci(et,Zt.reason),Zt.removeEventListener("abort",jt)};Zt.addEventListener("abort",jt)}}hl(et)})},_g.resume=function(c,f,E){return new Promise(function(D,Z){var ie,we,De=new Promise(function(Zt,jt){we=Zt,ie=jt}),mt=Vr(c,f,ge(f.resumableState,E?E.nonce:void 0,void 0,void 0,void 0,void 0),E?E.onError:void 0,we,function(){var Zt=new ReadableStream({type:"bytes",pull:function(jt){hs(mt,jt)},cancel:function(jt){mt.destination=null,ci(mt,jt)}},{highWaterMark:0});Zt.allReady=De,D(Zt)},function(Zt){De.catch(function(){}),Z(Zt)},ie,E?E.onPostpone:void 0);if(E&&E.signal){var Ge=E.signal;if(Ge.aborted)ci(mt,Ge.reason);else{var et=function(){ci(mt,Ge.reason),Ge.removeEventListener("abort",et)};Ge.addEventListener("abort",et)}}hl(mt)})},_g.resumeAndPrerender=function(c,f,E){return new Promise(function(D,Z){var ie=xr(c,f,ge(f.resumableState,void 0,void 0,void 0,void 0,void 0),E?E.onError:void 0,function(){var mt=new ReadableStream({type:"bytes",pull:function(Ge){hs(ie,Ge)},cancel:function(Ge){ie.destination=null,ci(ie,Ge)}},{highWaterMark:0});mt={postponed:wi(ie),prelude:mt},D(mt)},void 0,void 0,Z,E?E.onPostpone:void 0);if(E&&E.signal){var we=E.signal;if(we.aborted)ci(ie,we.reason);else{var De=function(){ci(ie,we.reason),we.removeEventListener("abort",De)};we.addEventListener("abort",De)}}hl(ie)})},_g.version="19.2.0"})()),_g}var H2;function HT(){if(H2)return wg;H2=1;var n,e;return process.env.NODE_ENV==="production"?(n=NT(),e=FT()):(n=BT(),e=zT()),wg.version=n.version,wg.renderToString=n.renderToString,wg.renderToStaticMarkup=n.renderToStaticMarkup,wg.renderToReadableStream=e.renderToReadableStream,wg.resume=e.resume,wg}var VC=HT();const a1=L1(VC);function gp(n,e,t){return e!==void 0&&n<e?e:t!==void 0&&n>t?t:n}const kg={_canvas:null,_cache:new Map,_fontCache:{value:"",timestamp:0},_charWidthMap:new Map,clearCache(){this._cache.clear(),this._canvas=null,this._fontCache={value:"",timestamp:0},this._charWidthMap.clear()},getDefaultFont(){const n=Date.now();if(this._fontCache.value&&n-this._fontCache.timestamp<3e5)return this._fontCache.value;try{const e=getComputedStyle(document.documentElement).getPropertyValue("--Font").trim()||"400 14px pretendard";return this._fontCache={value:e,timestamp:n},e}catch{return"400 14px pretendard"}},measureCharWidth(n,e){var i,o,l,a,h,g;const t=`${n}|${e}`;if(this._charWidthMap.has(t))return this._charWidthMap.get(t);try{this._canvas||(this._canvas=document.createElement("canvas"));const m=this._canvas.getContext("2d");if(m){m.font=e;const x=m.measureText(n).width;return this._charWidthMap.set(t,x),x}}catch{}let r;return n===" "?r=parseInt(((i=e.match(/(\d+)px/))==null?void 0:i[1])||"14")/3:/^[A-Z]$/.test(n)?r=parseInt(((o=e.match(/(\d+)px/))==null?void 0:o[1])||"14")*.67:/^[a-z]$/.test(n)?r=parseInt(((l=e.match(/(\d+)px/))==null?void 0:l[1])||"14")*.5:/^\d$/.test(n)?r=parseInt(((a=e.match(/(\d+)px/))==null?void 0:a[1])||"14")*.6:/^[.,;:!?]$/.test(n)?r=parseInt(((h=e.match(/(\d+)px/))==null?void 0:h[1])||"14")*.25:r=parseInt(((g=e.match(/(\d+)px/))==null?void 0:g[1])||"14")*.67,this._charWidthMap.set(t,r),r},extractTextFromNode(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return`${n}`;if(Array.isArray(n))return n.map(e=>this.extractTextFromNode(e)).join("");if(B.isValidElement(n))try{const t=VC.renderToString(n).replace(/<[^>]*>/g,""),r=document.createElement("div");return r.innerHTML=t,r.textContent||""}catch{return n.props&&n.props.children?this.extractTextFromNode(n.props.children):""}return""},measureTextWidth(n,e){var o;if(!n)return 0;const t=e||this.getDefaultFont(),r=`${n}|${t}`,i=this._cache.get(r);if(i!==void 0)return i;try{this._canvas||(this._canvas=document.createElement("canvas"));const l=this._canvas.getContext("2d");if(l){l.font=t;const a=l.measureText(n),h=Math.ceil(a.width);return this._cache.size>=300&&[...this._cache.keys()].slice(0,50).forEach(m=>this._cache.delete(m)),this._cache.set(r,h),h}}catch{}try{const l=document.createElement("span");l.style.font=t,l.style.position="absolute",l.style.visibility="hidden",l.style.whiteSpace="nowrap",l.textContent=n,document.body.appendChild(l);const a=Math.ceil(l.getBoundingClientRect().width);return document.body.removeChild(l),this._cache.set(r,a),a}catch{}try{let l=0;for(let h=0;h<n.length;h++)l+=this.measureCharWidth(n[h],t);l*=.95;const a=Math.ceil(l);return this._cache.set(r,a),a}catch{}try{const l=parseInt(((o=t.match(/(\d+)px/))==null?void 0:o[1])||"14");let a=0;for(let g=0;g<n.length;g++){const m=n[g];m===" "?a+=.33:/^[A-Z]$/.test(m)?a+=.67:/^[a-z]$/.test(m)?a+=.5:/^\d$/.test(m)?a+=.6:/^[.,;:!?]$/.test(m)?a+=.25:a+=.67}const h=Math.ceil(a*l);return this._cache.set(r,h),h}catch{const a=n.length*10;return this._cache.set(r,a),a}},measureTextWithElementStyle(n,e){if(!e)return 0;try{const t=window.getComputedStyle(n),r=t.getPropertyValue("--Font").trim()||`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;return this.measureTextWidth(e,r)}catch{return this.measureTextWidth(e)}},measureReactNodeWidth(n){const e=this.extractTextFromNode(n);return this.measureTextWidth(e)},measureRenderedOptionWidth(n,e){if(n==null)return 0;const t=e(n),r=this.extractTextFromNode(t);return this.measureTextWidth(r)},calculateOptimalSelectWidth({elementRef:n,options:e=[],selectedOption:t=null,selectedOptions:r=[],placeholder:i="",optionRenderer:o,type:l="Primary",isMulti:a=!1}){if(!n.current)return 200;try{let h=0;if(e&&e.length>0){const _=[...e.length>0?[e[0]]:[],...e.length>1?[e[e.length-1]]:[],...e.length>10?Array.from({length:8},(R,k)=>e[Math.floor(k*e.length/8)]):e,...e.length>20?Array.from({length:5},()=>e[Math.floor(Math.random()*e.length)]):[]],S=Array.from(new Set(_.filter(Boolean)));for(const R of S){if(!R)continue;const k=this.measureRenderedOptionWidth(R,o);h=Math.max(h,k)}}let g=0;if(!a&&t)g=this.measureRenderedOptionWidth(t,o);else if(a&&r&&r.length){if(r.length===1)g=this.measureRenderedOptionWidth(r[0],o);else if(g=this.measureTextWidth(`${r.length} selected`),r.length>0){let _=0;for(const S of r){const R=this.measureRenderedOptionWidth(S,o);_=Math.max(_,R)}g=Math.max(g,_)}}let m=0;i&&(m=this.measureReactNodeWidth(i));const w=Math.max(h,g,m,50);if(n.current){const _=window.getComputedStyle(n.current),S=parseFloat(_.paddingLeft||"0")+parseFloat(_.paddingRight||"0"),R=parseFloat(_.borderLeftWidth||"0")+parseFloat(_.borderRightWidth||"0"),k=l==="Primary"?30:20,O=a?24:0,P=Math.ceil(w*.05)+10;return Math.ceil(w+S+R+k+O+P)}return w+60}catch{return 200}}};function ZC(n,e){const t=Gn.c(5),[r,i]=B.useState(0);let o,l;return t[0]!==r||t[1]!==n||t[2]!==e?(o=()=>{const a=()=>{const g=n.current,m=e.current;if(!g||!m)return i(0);const x=g.getBoundingClientRect(),w=m.getBoundingClientRect(),_=Math.max(0,Math.round(x.right-w.left));_!==r&&i(_)};a();const h=new ResizeObserver(a);return n.current&&h.observe(n.current),e.current&&h.observe(e.current),window.addEventListener("resize",a),()=>{h.disconnect(),window.removeEventListener("resize",a)}},l=[n,e,r],t[0]=r,t[1]=n,t[2]=e,t[3]=o,t[4]=l):(o=t[3],l=t[4]),B.useEffect(o,l),r}var ic=(n=>(n.E="East",n.N="North",n.S="South",n.W="West",n))(ic||{}),O1=(n=>(n.E="East",n.EN="EastNorth",n.ES="EastSouth",n.N="North",n.NE="NorthEast",n.NW="NorthWest",n.S="South",n.SE="SouthEast",n.SW="SouthWest",n.W="West",n.WN="WestNorth",n.WS="WestSouth",n))(O1||{});function mm(n,e,t,r){if(!n.current||!e.current)return;const i=n.current.getBoundingClientRect(),o=e.current.getBoundingClientRect();let l={bottom:void 0,left:void 0,right:void 0,top:void 0};switch(t){case"North":l=o?{bottom:window.innerHeight-i.top,left:i.left+i.width/2-o.width/2}:{bottom:window.innerHeight-i.top,left:i.left};break;case"NorthWest":l={bottom:window.innerHeight-i.top,left:i.left};break;case"NorthEast":l={bottom:window.innerHeight-i.top,right:window.innerWidth-i.left-i.width};break;case"South":l=o?{top:i.bottom,left:i.left+i.width/2-o.width/2}:{top:i.bottom,left:i.left};break;case"SouthWest":l={top:i.bottom,left:i.left};break;case"SouthEast":l={top:i.bottom,right:window.innerWidth-i.left-i.width};break;case"East":l=o?{top:i.top+i.height/2-o.height/2,left:i.right}:{top:i.top,left:i.right};break;case"EastNorth":l={bottom:window.innerHeight-i.top-i.height,left:i.right};break;case"EastSouth":l={top:i.top,left:i.right};break;case"West":l=o?{top:i.top+i.height/2-o.height/2,right:window.innerWidth-i.left}:{top:i.top,right:window.innerWidth-i.left};break;case"WestNorth":l={bottom:window.innerHeight-i.top-i.height,right:window.innerWidth-i.left};break;case"WestSouth":l={top:i.top,right:window.innerWidth-i.left};break;default:l={top:i.top,left:i.left}}r&&(r.x&&l.left&&(l.left+=r.x),r.y&&l.top&&(l.top+=r.y)),l=KC(l,o),e.current.style.top=l.top+"px",e.current.style.left=l.left+"px",e.current.style.bottom=l.bottom+"px",e.current.style.right=l.right+"px"}function XC(n,e,t,r){if(!n)return;const i=e instanceof HTMLElement?e:e==null?void 0:e.current;if(!i)return;const o=n.getBoundingClientRect(),l=i.getBoundingClientRect();let a={bottom:void 0,left:void 0,right:void 0,top:void 0};switch(t){case"North":a=l?{bottom:window.innerHeight-o.top,left:o.left+o.width/2-l.width/2}:{bottom:window.innerHeight-o.top,left:o.left};break;case"NorthWest":a={bottom:window.innerHeight-o.top,left:o.left};break;case"NorthEast":a={bottom:window.innerHeight-o.top,right:window.innerWidth-o.left-o.width};break;case"South":a=l?{top:o.bottom,left:o.left+o.width/2-l.width/2}:{top:o.bottom,left:o.left};break;case"SouthWest":a={top:o.bottom,left:o.left};break;case"SouthEast":a={top:o.bottom,right:window.innerWidth-o.left-o.width};break;case"East":a=l?{top:o.top+o.height/2-l.height/2,left:o.right}:{top:o.top,left:o.right};break;case"EastNorth":a={bottom:window.innerHeight-o.top-o.height,left:o.right};break;case"EastSouth":a={top:o.top,left:o.right};break;case"West":a=l?{top:o.top+o.height/2-l.height/2,right:window.innerWidth-o.left}:{top:o.top,right:window.innerWidth-o.left};break;case"WestNorth":a={bottom:window.innerHeight-o.top-o.height,right:window.innerWidth-o.left};break;case"WestSouth":a={top:o.top,right:window.innerWidth-o.left};break;default:a={top:o.top,left:o.left}}return r&&(r.x&&a.left&&(a.left+=r.x),r.y&&a.top&&(a.top+=r.y)),a=KC(a,l),i.style.top=a.top+"px",i.style.left=a.left+"px",i.style.bottom=a.bottom+"px",i.style.right=a.right+"px",a}function KC(n,e,t=10){return n.left&&n.left<t&&(n.left=t),n.right&&n.right<t&&(n.right=t),n.top&&n.top<t&&(n.top=t),n.bottom&&n.bottom<t&&(n.bottom=t),n.left&&e&&n.left+e.width>window.innerWidth-t&&(n.left=window.innerWidth-e.width-t),n.right&&e&&n.right+e.width>window.innerWidth-t&&(n.right=window.innerWidth-e.width-t),n.top&&e&&n.top+e.height>window.innerHeight-t&&(n.top=window.innerHeight-e.height-t),n.bottom&&e&&n.bottom+e.height>window.innerHeight-t&&(n.bottom=window.innerHeight-e.height-t),n}function Eg(){const n={preventDefault:!1};return{event:n,e:{preventDefault:()=>n.preventDefault=!0}}}const WT="_Tooltip_1khnz_1",UT="_Arrow_1khnz_17",W2={Tooltip:WT,Arrow:UT},JC=n=>{const e=Gn.c(28),{tooltip:t,targetRef:r,delay:i,distance:o,direction:l}=n,a=i===void 0?0:i,h=o===void 0?10:o,g=l===void 0?ic.S:l,[m,x]=B.useState(!1),w=B.useRef(null),_=B.useRef(null),S=B.useRef(null);let R;e[0]!==a||e[1]!==g||e[2]!==h||e[3]!==r?(R=()=>{x(!0),S.current&&(clearTimeout(S.current),S.current=null);const ue=setTimeout(()=>U2(r,w,_,h,g),a);S.current=ue},e[0]=a,e[1]=g,e[2]=h,e[3]=r,e[4]=R):R=e[4];const k=R;let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=()=>x(!1),e[5]=O):O=e[5];const P=O;let z,H;e[6]!==k||e[7]!==r?(z=()=>{const ue=r.current;if(ue)return ue.addEventListener("mouseenter",k),ue.addEventListener("mouseleave",P),()=>{ue.removeEventListener("mouseenter",k),ue.removeEventListener("mouseleave",P)}},H=[r,P,k],e[6]=k,e[7]=r,e[8]=z,e[9]=H):(z=e[8],H=e[9]),B.useEffect(z,H);let G;e[10]!==g||e[11]!==h||e[12]!==r?(G=()=>{U2(r,w,_,h,g)},e[10]=g,e[11]=h,e[12]=r,e[13]=G):G=e[13];const N=G;let J,Y;e[14]!==m||e[15]!==N||e[16]!==r?(J=()=>{if(!r.current||!w.current||!m)return;const ue=r.current.parentElement;let se=ue;for(;se;)se.addEventListener("scroll",N),se=se.parentElement;return()=>{let $=ue;for(;$;)$.removeEventListener("scroll",N),$=$.parentElement}},Y=[r,N,m],e[14]=m,e[15]=N,e[16]=r,e[17]=J,e[18]=Y):(J=e[17],Y=e[18]),B.useEffect(J,Y);let K;e[19]!==N?(K=()=>{N()},e[19]=N,e[20]=K):K=e[20];let fe;e[21]!==N||e[22]!==t?(fe=[t,N],e[21]=N,e[22]=t,e[23]=fe):fe=e[23],B.useEffect(K,fe);let X;e:switch(typeof t){case"boolean":{X=!0;break e}case"string":{X=t==="";break e}case"number":{X=!1;break e}default:X=!t}if(!m||X)return null;let ne;if(e[24]!==t){let ue;e[26]===Symbol.for("react.memo_cache_sentinel")?(ue=dt.clsx(W2.Tooltip,"NoSelect"),e[26]=ue):ue=e[26];let se;e[27]===Symbol.for("react.memo_cache_sentinel")?(se=M.jsx("div",{ref:_,className:W2.Arrow}),e[27]=se):se=e[27],ne=su.createPortal(M.jsxs("div",{ref:w,className:ue,children:[t,se]}),document.body),e[24]=t,e[25]=ne}else ne=e[25];return ne},u0="5px solid var(--ATooltip_background-color)";function U2(n,e,t,r,i=ic.S){if(!n.current||!e.current||!t.current)return;const o=GT(n.current,e.current,r,i);if(!o)return;const{left:l,top:a,arrowDir:h,arrow:g}=o;e.current.style.left=`${l}px`,e.current.style.top=`${a}px`,e.current.style.visibility="visible",e.current.style.opacity="1",t.current.style.border="5px solid transparent",h===ic.N?(t.current.style.top="-9px",t.current.style.left=`calc(50% - 5px + ${g.left??0}px)`,t.current.style.borderBottom=u0):h===ic.S?(t.current.style.top="100%",t.current.style.left=`calc(50% - 5px + ${g.left??0}px)`,t.current.style.borderTop=u0):h===ic.W?(t.current.style.top=`calc(50% - 5px + ${g.top??0}px)`,t.current.style.left="-9px",t.current.style.borderRight=u0):h===ic.E&&(t.current.style.top=`calc(50% - 5px + ${g.top??0}px)`,t.current.style.left="100%",t.current.style.borderLeft=u0)}const Gd=5;function GT(n,e,t,r){const i=n.getBoundingClientRect(),o=e.getBoundingClientRect();function l(){if(window.innerHeight-i.bottom>o.height+t){const m=i.bottom+t,x=i.left+(i.width-o.width)/2,w=gp(x,Gd,window.innerWidth-Gd-o.width),_=ic.N;return{left:w,top:m,arrowDir:_,arrow:{left:x-w}}}}function a(){if(i.top>o.height+t){const m=i.top-o.height-t,x=i.left+(i.width-o.width)/2,w=gp(x,Gd,window.innerWidth-Gd-o.width),_=ic.S;return{left:w,top:m,arrowDir:_,arrow:{left:x-w}}}}function h(){if(window.innerWidth-i.right>o.width+t){const m=i.right+t,x=i.top+(i.height-o.height)/2,w=gp(x,Gd,window.innerHeight-Gd-o.height),_=ic.W;return{left:m,top:w,arrowDir:_,arrow:{top:x-w}}}}function g(){if(i.left>o.width+t){const m=i.left-o.width-t,x=i.top+(i.height-o.height)/2,w=gp(x,Gd,window.innerHeight-Gd-o.height),_=ic.E;return{left:m,top:w,arrowDir:_,arrow:{top:x-w}}}}if(r===ic.E)return h()||g()||l()||a();if(r===ic.S)return l()||a()||h()||g();if(r===ic.W)return g()||h()||l()||a();if(r===ic.N)return a()||l()||h()||g()}const YT="_ABase_c7a1t_1",VT="_UseDimming_c7a1t_6",ZT="_Dimmer_c7a1t_6",XT="_Spinner_c7a1t_9",KT="_Dimmed_c7a1t_12",JT="_HasProgress_c7a1t_18",QT="_IsDimmed_c7a1t_36",qT="_IsLoading_c7a1t_41",jT="_IsDisabled_c7a1t_46",qg={ABase:YT,UseDimming:VT,Dimmer:ZT,Spinner:XT,Dimmed:KT,HasProgress:JT,IsDimmed:QT,IsLoading:qT,IsDisabled:jT},zi=n=>{const e=Gn.c(27),{children:t,abaseRef:r,abaseCallbackRef:i,isDisabled:o,isLoading:l,isDimmed:a,tooltip:h,tooltipDistance:g,tooltipDelay:m,tooltipDirection:x,progress:w,ProgressRenderer:_,progressProps:S,...R}=n,k=g===void 0?10:g,O=m===void 0?0:m,P=x===void 0?ic.S:x,z=_===void 0?$T:_,H=B.useRef(null),G=r??H;let N;e:{if(typeof o=="string"&&o!==""){N=o;break e}else if(h!==void 0){N=h;break e}N=""}const J=N,Y=o||l||a,K=o!==void 0||l!==void 0||a!==void 0,fe=typeof w=="number"&&l,X=i||G,te=dt.clsx(R.className,qg.ABase,K&&qg.UseDimming,Y&&qg.Dimmed,fe&&qg.HasProgress);let ne;e[0]!==a||e[1]!==fe||e[2]!==o||e[3]!==l||e[4]!==K?(ne=K&&M.jsx("div",{className:dt.sclsx(qg,"Dimmer",o&&"IsDisabled",l&&"IsLoading",a&&"IsDimmed",fe&&"HasProgress")}),e[0]=a,e[1]=fe,e[2]=o,e[3]=l,e[4]=K,e[5]=ne):ne=e[5];let ue;e[6]!==z||e[7]!==fe||e[8]!==o||e[9]!==l||e[10]!==w||e[11]!==S?(ue=l&&M.jsxs("div",{className:dt.sclsx(qg,"Spinner",o&&"IsDisabled",l&&"IsLoading",fe&&"HasProgress"),children:[M.jsx(fo,{icon:"Spinner"}),M.jsx(B.Activity,{mode:fe?"visible":"hidden",children:M.jsx(z,{progress:w??0,...S})})]}),e[6]=z,e[7]=fe,e[8]=o,e[9]=l,e[10]=w,e[11]=S,e[12]=ue):ue=e[12];let se;e[13]!==G||e[14]!==J||e[15]!==O||e[16]!==P||e[17]!==k?(se=M.jsx(JC,{delay:O,direction:P,distance:k,targetRef:G,tooltip:J}),e[13]=G,e[14]=J,e[15]=O,e[16]=P,e[17]=k,e[18]=se):se=e[18];let $;return e[19]!==t||e[20]!==R||e[21]!==X||e[22]!==te||e[23]!==ne||e[24]!==ue||e[25]!==se?($=M.jsxs("div",{...R,ref:X,className:te,children:[t,ne,ue,se]}),e[19]=t,e[20]=R,e[21]=X,e[22]=te,e[23]=ne,e[24]=ue,e[25]=se,e[26]=$):$=e[26],$},$T=n=>{const e=Gn.c(6);let t,r;e[0]!==n?({progress:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;return e[3]!==t||e[4]!==r?(i=M.jsx(YC,{progress:t,...r}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i},eA="_AButton_vulhu_1",tA="_Primary_vulhu_14",nA="_Secondary_vulhu_19",rA="_Alter_vulhu_24",iA="_AIconButton_vulhu_30",oA="_AThemeButton_vulhu_71",Tp={AButton:eA,Primary:tA,Secondary:nA,Alter:rA,AIconButton:iA,AThemeButton:oA},lA=["Primary","Secondary","Alter","Raw"],Ic=n=>{const e=Gn.c(17);let t,r,i,o;e[0]!==n?({type:o,onClick:r,noInteractive:i,...t}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o):(t=e[1],r=e[2],i=e[3],o=e[4]);const l=o===void 0?"Primary":o,a=t.isDisabled||t.isLoading;let h;e[5]!==r||e[6]!==a?(h=w=>{a||r==null||r(w)},e[5]=r,e[6]=a,e[7]=h):h=e[7];const g=h;let m;e[8]!==t.className||e[9]!==i||e[10]!==l||e[11]!==a?(m=dt.clsx(t.className,Tp.AButton,l!=="Raw"&&Tp[l],"IsClickable",!a&&!i&&"IsInteractive"),e[8]=t.className,e[9]=i,e[10]=l,e[11]=a,e[12]=m):m=e[12];let x;return e[13]!==t||e[14]!==g||e[15]!==m?(x=M.jsx(zi,{...t,className:m,onClick:g}),e[13]=t,e[14]=g,e[15]=m,e[16]=x):x=e[16],x},sA=["Primary","Secondary","Raw"],ba=n=>{const e=Gn.c(29);let t,r,i,o,l,a,h,g,m;e[0]!==n?({icon:o,iconSize:l,type:g,onClick:i,isDisabled:a,isLoading:h,tooltip:m,className:r,...t}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9]);const x=g===void 0?"Primary":g,w=a||h;let _;e[10]!==i||e[11]!==w?(_=z=>{w||i==null||i(z)},e[10]=i,e[11]=w,e[12]=_):_=e[12];const S=_;let R;e:{if(ym.includes(o)){let z;e[13]!==o||e[14]!==l?(z=M.jsx(fo,{icon:o,size:l}),e[13]=o,e[14]=l,e[15]=z):z=e[15],R=z;break e}R=o}const k=R;let O;e[16]!==r||e[17]!==a||e[18]!==h||e[19]!==x?(O=dt.clsx(Tp.AIconButton,!a&&!h&&"IsClickable",x!=="Raw"&&Tp[x],r),e[16]=r,e[17]=a,e[18]=h,e[19]=x,e[20]=O):O=e[20];let P;return e[21]!==t||e[22]!==k||e[23]!==a||e[24]!==h||e[25]!==S||e[26]!==O||e[27]!==m?(P=M.jsx(zi,{className:O,isDisabled:a,isLoading:h,tooltip:m,onClick:S,...t,children:k}),e[21]=t,e[22]=k,e[23]=a,e[24]=h,e[25]=S,e[26]=O,e[27]=m,e[28]=P):P=e[28],P};function Fo(n,e){n!==void 0&&n.length===1&&(e=n[0]);const t=B.useState(e);let r;return n===void 0||n.length===1?r=t:r=n,r}const aA="_AWrap_u1f1h_1",cA="_Label_u1f1h_8",uA="_Asterisk_u1f1h_19",fA="_HelperTextConatiner_u1f1h_23",hA="_HelperText_u1f1h_23",jg={AWrap:aA,Label:cA,Asterisk:uA,HelperTextConatiner:fA,HelperText:hA,Error:"_Error_u1f1h_38"},dA=["Default","Error"],Bg=n=>{if(!n)return[{},{}];const e={},t={},r=["errorMessage","helperText","label","labelProps","wrapId","wrapProps","wrapType"];for(const i in n)r.includes(i)?e[i]=n[i]:t[i]=n[i];return[e,t]},lg=n=>{const{wrapProps:e,errorMessage:t,helperText:r,wrapType:i="Default",label:o,labelProps:l,wrapId:a,children:h}=n,g=B.useRef(null),[m,x]=B.useState({height:0}),w=B.useRef(null),[_,S]=B.useMemo(()=>{let k=r,O=i;if(Array.isArray(t)){const P=t.filter(Boolean);P.length>0&&([k,O]=[P,"Error"])}else t&&([k,O]=[t,"Error"]);return Array.isArray(k)&&(O!=="Error"&&(k=k.filter(Boolean)),k=k.map((P,z)=>M.jsxs(B.Fragment,{children:[P,M.jsx("br",{})]},$n.key(z)))),[k,O]},[r,t,i]);B.useEffect(()=>{if(!_||!g.current)x({height:0});else{const k=g.current.getBoundingClientRect();x({height:k.height,marginTop:k.height===0?0:6})}},[_]);const R=B.useMemo(()=>{switch(typeof(l==null?void 0:l.prefix)){case"string":return M.jsx(fo,{height:"1rem",icon:l.prefix,width:"1rem"});case"boolean":return M.jsx(fo,{height:10,icon:"Target",width:10});default:return l==null?void 0:l.prefix}},[l==null?void 0:l.prefix]);return M.jsxs("div",{...e,ref:w,className:dt.clsx(e==null?void 0:e.className,jg.AWrap),id:a,children:[o&&M.jsxs("div",{className:dt.clsx(jg.Label,"NoSelect",l==null?void 0:l.className),style:l==null?void 0:l.style,children:[l==null?void 0:l.leftAddon,R,o,(l==null?void 0:l.asterisk)&&M.jsx(zi,{className:jg.Asterisk,tooltip:Or.AWrap.Asterisk,children:"*"}),l==null?void 0:l.rightAddon]}),h,_!==void 0&&M.jsx("div",{className:dt.clsx(jg.HelperTextConatiner,"NoSelect"),style:m,children:M.jsx("div",{ref:g,className:dt.clsx(jg.HelperText,jg[S]),children:_})})]})},gA="_ASwitch_nlcij_1",pA="_Track_nlcij_6",vA="_Truthy_nlcij_13",bA="_Thumb_nlcij_17",$1={ASwitch:gA,Track:pA,Truthy:vA,Thumb:bA},QC=n=>{const e=Gn.c(33);let t,r;if(e[0]!==n){const{useCheck:G,...N}=n;r=G,t=Bg(N),e[0]=n,e[1]=t,e[2]=r}else t=e[1],r=e[2];const[i,o]=t;let l,a,h,g;e[3]!==i?({wrapId:a,wrapProps:h,labelProps:l,...g}=i,e[3]=i,e[4]=l,e[5]=a,e[6]=h,e[7]=g):(l=e[4],a=e[5],h=e[6],g=e[7]);const[m,x]=Fo(r,!1);let w;e[8]!==m||e[9]!==o||e[10]!==x?(w=G=>{var N;o.isDisabled||o.isLoading||(x==null||x(!m),(N=o.onClick)==null||N.call(o,G))},e[8]=m,e[9]=o,e[10]=x,e[11]=w):w=e[11];const _=w;let S;e[12]!==l||e[13]!==a||e[14]!==h||e[15]!==g?(S={wrapId:a,wrapProps:h,labelProps:l,...g},e[12]=l,e[13]=a,e[14]=h,e[15]=g,e[16]=S):S=e[16];let R;e[17]!==m?(R=dt.clsx($1.Track,m&&$1.Truthy),e[17]=m,e[18]=R):R=e[18];let k;e[19]!==m?(k=dt.clsx($1.Thumb,m&&$1.Truthy),e[19]=m,e[20]=k):k=e[20];let O;e[21]!==k?(O=M.jsx("div",{className:k}),e[21]=k,e[22]=O):O=e[22];let P;e[23]!==R||e[24]!==O?(P=M.jsx("div",{className:R,children:O}),e[23]=R,e[24]=O,e[25]=P):P=e[25];let z;e[26]!==_||e[27]!==o||e[28]!==P?(z=M.jsx(zi,{...o,className:$1.ASwitch,onClick:_,children:P}),e[26]=_,e[27]=o,e[28]=P,e[29]=z):z=e[29];let H;return e[30]!==S||e[31]!==z?(H=M.jsx(lg,{...S,children:z}),e[30]=S,e[31]=z,e[32]=H):H=e[32],H},yA={palette:{"mode-1":{"common-100":"#ffffff","common-0":"#000000","neutral-99":"#fcfcfc","neutral-94":"#efefef","neutral-89":"#e2e2e2","neutral-84":"#d6d6d6","neutral-79":"#c9c9c9","neutral-73":"#bababa","neutral-65":"#a5a5a5","neutral-54":"#898989","neutral-42":"#6b6b6b","neutral-30":"#4c4c4c","neutral-20":"#333333","neutral-15":"#2c2c2c","neutral-10":"#191919","neutral-5":"#0c0c0c","cool-neutral-99":"#fcfcfc","cool-neutral-94":"#efeff0","cool-neutral-89":"#e1e2e4","cool-neutral-84":"#d4d5d7","cool-neutral-79":"#c7c8cb","cool-neutral-73":"#b7b9bc","cool-neutral-65":"#a2a4a9","cool-neutral-54":"#85888e","cool-neutral-42":"#66696f","cool-neutral-30":"#494b4f","cool-neutral-20":"#303235","cool-neutral-10":"#18191a","cool-neutral-5":"#0c0c0c","red-99":"#fff9f9","red-95":"#ffe5e5","red-90":"#ffcccc","red-84":"#ffadad","red-76":"#ff8484","red-66":"#ff5151","red-53":"#ff0f0f","red-45":"#e50000","red-34":"#a80000","red-30":"#990000","red-24":"#7a0000","red-10":"#330000","green-99":"#fafffa","green-95":"#e5ffe8","green-90":"#ccffd1","green-84":"#adffb6","green-76":"#84ff90","green-66":"#51ff62","green-48":"#00f418","green-45":"#00e517","green-34":"#00a810","green-30":"#00990f","green-24":"#007a0c","green-10":"#003305","blue-99":"#fafdff","blue-95":"#e5f3ff","blue-90":"#cce6ff","blue-84":"#add7ff","blue-76":"#84c3ff","blue-66":"#51abff","blue-53":"#0f8bff","blue-45":"#0077e5","blue-34":"#0056a8","blue-30":"#004f99","blue-24":"#003f7a","blue-10":"#001a33","orange-99":"#fffcfa","orange-95":"#ffefe5","orange-90":"#ffdecc","orange-84":"#ffcbad","orange-76":"#ffb184","orange-66":"#ff9151","orange-53":"#ff670f","orange-45":"#e55400","orange-34":"#a83d00","orange-30":"#993800","orange-24":"#7a2c00","orange-10":"#331200","violet-99":"#fcfaff","violet-95":"#eee5ff","violet-90":"#dcccff","violet-84":"#c7adff","violet-76":"#ab84ff","violet-66":"#8852ff","violet-53":"#5b0fff","violet-45":"#4900e5","violet-34":"#3500a8","violet-28":"#2d008e","violet-24":"#26007a","violet-10":"#100033","cyan-99":"#faffff","cyan-95":"#e5fdff","cyan-90":"#ccfbff","cyan-84":"#adf9ff","cyan-76":"#84f6ff","cyan-66":"#51f3ff","cyan-50":"#00edff","cyan-45":"#00d6e5","cyan-40":"#00becc","cyan-30":"#008e99","cyan-21":"#00636b","cyan-10":"#002f33","pink-99":"#fffefa","pink-95":"#ffe5f5","pink-90":"#ffccea","pink-84":"#ffadde","pink-76":"#ff84ce","pink-66":"#ff51b9","pink-53":"#ff0f9f","pink-45":"#e5008a","pink-40":"#cc007a","pink-30":"#99005b","pink-21":"#6b0040","pink-10":"#33001e","lime-99":"#fcfffa","lime-95":"#eeffe5","lime-90":"#ddffcc","lime-84":"#c8ffad","lime-76":"#adff84","lime-66":"#8bff51","lime-49":"#53f900","lime-45":"#4ce500","lime-40":"#44cc00","lime-30":"#339900","lime-21":"#236b00","lime-10":"#113300","brand-b-color":"#386fff"}},semantic:{light:{"static-white":"common-100","static-black":"common-0","acent-brand":"brand-b-color","acent-brand-fill":"blue-95","label-normal":"neutral-20","label-strong":"neutral-5","label-neutral":"neutral-73","line-normal":"neutral-79","line-strong":"neutral-65","line-neutral":"neutral-89","background-normal":"common-100","elevation-0":"common-100","elevation-10":"neutral-94","elevation-20":"neutral-73","alert-warning":"orange-53","alert-success":"green-45","alert-danger":"red-45","inverse-label-normal":"neutral-84","inverse-label-strong":"neutral-99","inverse-label-neutral":"neutral-30","inverse-line-normal":"neutral-30","inverse-line-strong":"neutral-54","inverse-line-neutral":"neutral-20","inverse-elevation-0":"neutral-5","inverse-elevation-10":"neutral-10","inverse-elevation-20":"neutral-15"},dark:{"static-white":"common-100","static-black":"common-0","acent-brand":"brand-b-color","acent-brand-fill":"blue-10","label-normal":"neutral-84","label-strong":"neutral-99","label-neutral":"neutral-30","line-normal":"neutral-30","line-strong":"neutral-54","line-neutral":"neutral-20","background-normal":"neutral-5","elevation-0":"neutral-5","elevation-10":"neutral-10","elevation-20":"neutral-15","alert-warning":"orange-53","alert-success":"green-45","alert-danger":"red-45","inverse-label-normal":"neutral-20","inverse-label-strong":"neutral-5","inverse-label-neutral":"neutral-73","inverse-line-normal":"neutral-79","inverse-line-strong":"neutral-65","inverse-line-neutral":"neutral-89","inverse-elevation-0":"common-100","inverse-elevation-10":"neutral-94","inverse-elevation-20":"neutral-73"}}},lc=tg.cloneDeep(yA);$n.keys(lc.semantic).forEach(n=>{const e=lc.semantic[n];$n.keys(e).forEach(t=>{e[t]=`var(--${e[t]})`})});const Sv=$n.keys(lc.palette),qC=$n.keys(lc.palette[Sv[0]]);function mA(){return va.paletteMode}function xA(n,e=va.paletteMode){return lc.palette[e][n]}function wA(n){return Tv(n)}const $0=[];function jC(n){va.paletteMode=n,qC.forEach(e=>document.documentElement.style.setProperty(`--${e}`,lc.palette[n][e])),$0.forEach(e=>e(n))}function $C(n,e="all"){$n.keys(n).forEach(r=>{const i=n[r];i!==void 0&&(document.documentElement.style.setProperty(`--${r}`,i),e==="all"?Sv.forEach(o=>{lc.palette[o][r]=i}):lc.palette[e][r]=i)})}const x1=$n.keys(lc.semantic),e3=$n.keys(lc.semantic[x1[0]]);function CA(){return va.semanticMode}function _A(n,e=va.semanticMode){return lc.semantic[e][n]}function SA(n){return Tv(n)}const ev=[];function xm(n){va.semanticMode=n,document.documentElement.setAttribute("data-theme",n),e3.forEach(e=>document.documentElement.style.setProperty(`--${e}`,lc.semantic[n][e])),ev.forEach(e=>e(n)),va.save==="localStorage"?localStorage.setItem("semanticMode",n):va.save==="sessionStorage"&&sessionStorage.setItem("semanticMode",n)}function t3(n,e=va.semanticMode){$n.keys(n).forEach(r=>{const i=n[r];i!==void 0&&(document.documentElement.style.setProperty(`--${r}`,i),e==="all"?x1.forEach(o=>{lc.semantic[o][r]=i}):lc.semantic[e][r]=i)})}const n3=["Body-background-color","Body-color","Body-transition","Font","Scrollbar-handle","Scrollbar-handle-hover","Scrollbar-handle-active","Scrollbar-track","Scrollbar-border-radius","Scrollbar-width","Transition","Transition-Enabled"],r3=["ABase_Dimming_background-color"],i3=["ATooltip_background-color","ATooltip_color"],o3=["AButton_Primary_border","AButton_Primary_background-color","AButton_Primary_color","AButton_Secondary_border","AButton_Secondary_background-color","AButton_Secondary_color","AButton_Alter_border","AButton_Alter_background-color","AButton_Alter_color"],l3=["AInput_Primary_background-color","AInput_Primary_border","AInput_Primary_color","AInput_Primary_hover_border","AInput_Primary_focus_background-color","AInput_Primary_focus_border","AInput_Primary_placeholder_color","AInput_Secondary_background-color","AInput_Secondary_border","AInput_Secondary_color","AInput_Secondary_hover_border","AInput_Secondary_focus_border","AInput_Secondary_placeholder_color","AInput_ReadOnly_background-color","AInput_ReadOnly_border","AInput_ReadOnly_color","AInput_Error_HelperText_color","AInput_Error_background-color","AInput_Error_border","AInput_Error_color","AInput_Error_placeholder_color"],s3=["ATextArea_Primary_background-color","ATextArea_Primary_border","ATextArea_Primary_color","ATextArea_Primary_hover_border","ATextArea_Primary_focus_background-color","ATextArea_Primary_focus_border","ATextArea_Secondary_background-color","ATextArea_Secondary_border","ATextArea_Secondary_color","ATextArea_Secondary_hover_border","ATextArea_Secondary_focus_border","ATextArea_ReadOnly_background-color","ATextArea_ReadOnly_border","ATextArea_ReadOnly_color","ATextArea_Error_background-color","ATextArea_Error_border","ATextArea_Error_color","ATextArea_Error_placeholder_color"],a3=["AEditor_Primary_background-color","AEditor_Primary_border","AEditor_Primary_color","AEditor_Primary_hover_border","AEditor_Primary_focus_background-color","AEditor_Primary_focus_border","AEditor_ReadOnly_background-color","AEditor_ReadOnly_border","AEditor_ReadOnly_hover_border","AEditor_ReadOnly_focus_border","AEditor_ReadOnly_color","AEditor_Error_background-color","AEditor_Error_border","AEditor_Error_hover_border","AEditor_Error_focus_border","AEditor_Error_color","AEditor_Error_placeholder_color","AEditor_Addon_Primary_background-color","AEditor_Addon_Primary_border","AEditor_Addon_Primary_color","AEditor_Addon_Secondary_background-color","AEditor_Addon_Secondary_border","AEditor_Addon_Secondary_color","AEditor_Addon_hover_background-color","AEditor_Addon_hover_color","AEditor_Addon_focus_border","AEditor_border-radius","AEditor_Select_border-radius","AEditor_Option_border-radius"],c3=["ACheckBox_color"],u3=["ADialog_Paper_background-color","ADialog_background-color","ADialog_border","ADialog_Action_background-color"],f3=["ASelect_Placeholder_color","ASelect_Primary_border","ASelect_Primary_hover_border","ASelect_Primary_Arrow_color","ASelect_Primary_Options_background-color","ASelect_Primary_Options_border","ASelect_Primary_Option_hover_background-color","ASelect_Primary_Option_active_background-color","ASelect_Primary_Option_Selected_background-color","ASelect_Secondary_border","ASelect_Secondary_hover_border","ASelect_Secondary_background-color","ASelect_Secondary_Arrow_color","ASelect_Secondary_Options_background-color","ASelect_Secondary_Options_border","ASelect_Secondary_Option_hover_background-color","ASelect_Secondary_Option_active_background-color","ASelect_Secondary_Option_Selected_background-color"],h3=["AMultiSelect_Placeholder_color","AMultiSelect_Primary_border","AMultiSelect_Primary_hover_border","AMultiSelect_Primary_Arrow_color","AMultiSelect_Primary_Options_background-color","AMultiSelect_Primary_Options_border","AMultiSelect_Primary_Option_hover_background-color","AMultiSelect_Primary_Option_active_background-color","AMultiSelect_Primary_Option_Selected_background-color","AMultiSelect_Secondary_border","AMultiSelect_Secondary_hover_border","AMultiSelect_Secondary_background-color","AMultiSelect_Secondary_Arrow_color","AMultiSelect_Secondary_Options_background-color","AMultiSelect_Secondary_Options_border","AMultiSelect_Secondary_Option_hover_background-color","AMultiSelect_Secondary_Option_active_background-color","AMultiSelect_Secondary_Option_Selected_background-color"],d3=["ATree_background-color","ATree_Indent_border","ATreeBodyHeader_border-bottom","ATreeItem_hover_background-color","ATreeItem_active_background-color","ATreeItem_select_background-color","ATreeItem_search_background-color","ATreeItem_search_border-top","ATreeItem_search_border-bottom","ATreeItem_select_color"],g3=["ASwitch_Track_Falsy_border","ASwitch_Track_Truthy_border","ASwitch_Thumb_border"],p3=["ATab_IndicatorTrack_Primary_border-bottom","ATab_Indicator_Primary_background-color","ATab_Option_Secondary_border","ATab_Option_Secondary_IsSelected_border-bottom","ATab_Option_Secondary_IsDisabled_border","ATab_IndicatorTrack_Tertiary_background-color","ATab_Indicator_Tertiary_background-color","ATab_Option_Tertiary_color","ATab_Option_Tertiary_IsSelected_color","ATab_Option_Quaternary_color","ATab_Option_Quaternary_IsSelected_color"],v3=["AFileBox_border","AFileBox_background-color","AFileBox_SelectedFile_color","AFileBox_Dropping_color"],b3=["AFileUploader_background-color","AFileUploader_brand_color","AFileUploader_disabled_color","AFileUploader_error_color","AFileUploader_text_color"],y3=["AListView_border-thin","AListView_border-thick"],m3=["AStepper_OutCircle_background-color","AStepper_OutCircle_IsOver_background-color","AStepper_InCircle_background-color","AStepper_InCircle_IsOver_background-color","AStepper_Line_background-color","AStepper_Line_IsOver_background-color"],x3=["ADatePicker_Anchor_border","ADatePicker_Anchor_color","ADatePicker_Anchor_Placeholder_color","ADatePicker_Anchor_hover_border","ADatePicker_Anchor_focus_border","ADatePicker_Anchor_Icon_Primary_color","ADatePicker_Anchor_Icon_Secondary_color","ADatePicker_background-color","ADatePicker_border","ADatePicker_StringInputContainer_background-color","ADatePicker_String_border","ADatePicker_Prev_background-color","ADatePicker_Prev_border-right","ADatePicker_Next_background-color","ADatePicker_Next_border-left","ADatePicker_Cell_color","ADatePicker_Cell_IsNotCurrentMonth_color","ADatePicker_Cell_IsDisabled_color","ADatePicker_Cell_IsSelected_background-color","ADatePicker_Cell_IsSelected_color","ADatePicker_Cell_IsHovered_background-color"],w3=["ADateRangePicker_Anchor_border","ADateRangePicker_Anchor_color","ADateRangePicker_Anchor_Placeholder_color","ADateRangePicker_Anchor_hover_border","ADateRangePicker_Anchor_focus_border","ADateRangePicker_Anchor_Icon_Primary_color","ADateRangePicker_Anchor_Icon_Secondary_color","ADateRangePicker_background-color","ADateRangePicker_border","ADateRangePicker_StringInputContainer_background-color","ADateRangePicker_String_border","ADateRangePicker_Prev_background-color","ADateRangePicker_Prev_border-right","ADateRangePicker_Next_background-color","ADateRangePicker_Next_border-left","ADateRangePicker_Cell_color","ADateRangePicker_Cell_IsNotCurrentMonth_color","ADateRangePicker_Cell_IsDisabled_color","ADateRangePicker_Cell_IsSelected_background-color","ADateRangePicker_Cell_IsSelected_color","ADateRangePicker_Cell_IsHovered_background-color"],C3=["AIconButton_Primary_color","AIconButton_Primary_border","AIconButton_Primary_background-color","AIconButton_Primary_hover_background-color","AIconButton_Primary_active_background-color","AIconButton_Secondary_color","AIconButton_Secondary_background-color","AIconButton_Secondary_hover_background-color","AIconButton_Secondary_active_background-color"],_3=["ATableBody_TRow_border-bottom","ATableBody_TRow_IsSelected_background-color","ATableBody_TRow_IsSelectable_hover_background-color","ATableBody_TH_color","ATableBody_TD_IsMarked_background-color","ATableBody_TD_IsMarked_color","ATableBody_Resizer_hover_ResizerCenter_background-color","ATableBody_Resizer_active_ResizerCenter_background-color","ATableBody_Resizer_active_ResizerOut_background-color","ATableBody_Resizer_active_ResizerIn_background-color","ATableFooter_Button_IsSelected_background-color","ATableFooter_Button_IsSelected_color","ATableFooter_Button_IsDisabled_color","ATableFilter_SubFilters_background-color","ATableFilter_SubFilters_border","ATableFilter_Icon_color","ATableFilter_Alert_color"],S3=["ADivideFrame_DividerInner_background-color"],E3=["AFloatMenu_background-color","AFloatMenu_hover_background-color","AFloatMenu_color","AFloatMenu_border"],T3=["ALoadingBorder_background-color","ALoadingBorder_ProgressBar_background-color","ALoadingBorder_Cover_background-color"],A3=["AWrap_Error_color"],R3=["ARadioSelect_RadioButton_border","ARadioSelect_RadioButton_InnerCircle_isChecked_background-color"],I3=["AChip_background-color","AChip_color","AChip_border","AChip_hover_background-color","AChip_hover_color","AChip_DeleteButton_border","AChip_DeleteButton_color","AChip_DeleteButton_hover_border","AChip_DeleteButton_hover_color"],EA=[...n3,...r3,...i3,...o3,...l3,...s3,...a3,...c3,...u3,...f3,...h3,...d3,...g3,...p3,...v3,...b3,...y3,...m3,...x3,...w3,...C3,..._3,...S3,...E3,...T3,...A3,...R3,...I3],Ev={"Body-background-color":"var(--background-normal)","Body-color":"var(--label-normal)","Body-transition":"background-color var(--Transition), color var(--Transition)",Font:"400 16px pretendard","Scrollbar-handle":"var(--label-neutral)","Scrollbar-handle-hover":"var(--label-normal)","Scrollbar-handle-active":"var(--label-strong)","Scrollbar-track":"var(--elevation-10)","Scrollbar-border-radius":"6px","Scrollbar-width":"12px",Transition:"300ms","Transition-Enabled":"1","ABase_Dimming_background-color":"var(--elevation-0)","ATooltip_background-color":"var(--inverse-elevation-0)",ATooltip_color:"var(--inverse-label-strong)",AButton_Primary_border:"none","AButton_Primary_background-color":"var(--acent-brand)",AButton_Primary_color:"var(--static-white)",AButton_Secondary_border:"1px solid var(--elevation-10)","AButton_Secondary_background-color":"var(--elevation-10)",AButton_Secondary_color:"var(--label-normal)",AButton_Alter_border:"1px solid var(--line-normal)","AButton_Alter_background-color":"var(--elevation-0)",AButton_Alter_color:"var(--label-normal)","AInput_Primary_background-color":"var(--elevation-0)",AInput_Primary_border:"1px solid var(--line-normal)",AInput_Primary_color:"var(--label-normal)",AInput_Primary_hover_border:"1px solid var(--line-strong)","AInput_Primary_focus_background-color":"var(--elevation-10)",AInput_Primary_focus_border:"1px solid var(--line-strong)",AInput_Primary_placeholder_color:"var(--label-neutral)","AInput_Secondary_background-color":"var(--elevation-0)",AInput_Secondary_border:"1px solid var(--line-normal)",AInput_Secondary_color:"var(--label-normal)",AInput_Secondary_hover_border:"1px solid var(--line-strong)",AInput_Secondary_focus_border:"1px solid var(--line-strong)",AInput_Secondary_placeholder_color:"var(--label-neutral)","AInput_ReadOnly_background-color":"var(--elevation-10)",AInput_ReadOnly_border:"none",AInput_ReadOnly_color:"var(--label-normal)",AInput_Error_HelperText_color:"var(--alert-danger)","AInput_Error_background-color":"inherit",AInput_Error_border:"1px solid var(--line-normal)",AInput_Error_color:"var(--label-normal)",AInput_Error_placeholder_color:"var(--label-neutral)","ATextArea_Primary_background-color":"var(--elevation-0)",ATextArea_Primary_border:"1px solid var(--line-normal)",ATextArea_Primary_color:"var(--label-normal)",ATextArea_Primary_hover_border:"1px solid var(--line-strong)","ATextArea_Primary_focus_background-color":"var(--elevation-10)",ATextArea_Primary_focus_border:"1px solid var(--line-strong)","ATextArea_Secondary_background-color":"var(--elevation-0)",ATextArea_Secondary_border:"1px solid var(--line-normal)",ATextArea_Secondary_color:"var(--label-normal)",ATextArea_Secondary_hover_border:"1px solid var(--line-strong)",ATextArea_Secondary_focus_border:"1px solid var(--line-strong)","ATextArea_ReadOnly_background-color":"var(--elevation-10)",ATextArea_ReadOnly_border:"none",ATextArea_ReadOnly_color:"var(--label-normal)","ATextArea_Error_background-color":"inherit",ATextArea_Error_border:"1px solid var(--line-normal)",ATextArea_Error_color:"var(--label-normal)",ATextArea_Error_placeholder_color:"var(--label-neutral)","AEditor_Primary_background-color":"var(--elevation-0)",AEditor_Primary_border:"1px solid var(--line-normal)",AEditor_Primary_color:"var(--label-normal)",AEditor_Primary_hover_border:"1px solid var(--line-strong)","AEditor_Primary_focus_background-color":"var(--elevation-0)",AEditor_Primary_focus_border:"1px solid var(--line-strong)","AEditor_ReadOnly_background-color":"var(--elevation-0)",AEditor_ReadOnly_border:"1px solid var(--line-normal)",AEditor_ReadOnly_hover_border:"1px solid var(--line-strong)",AEditor_ReadOnly_focus_border:"1px solid var(--line-strong)",AEditor_ReadOnly_color:"var(--label-normal)","AEditor_Error_background-color":"inherit",AEditor_Error_border:"1px solid var(--alert-danger)",AEditor_Error_color:"var(--alert-danger)",AEditor_Error_hover_border:"1px solid var(--alert-danger)",AEditor_Error_focus_border:"1px solid var(--alert-danger)",AEditor_Error_placeholder_color:"var(--alert-danger)","AEditor_Addon_Primary_background-color":"var(--background-normal)",AEditor_Addon_Primary_border:"1px solid var(--line-normal)",AEditor_Addon_Primary_color:"var(--label-normal)","AEditor_Addon_Secondary_background-color":"var(--background-normal)",AEditor_Addon_Secondary_border:"1px solid var(--line-strong)",AEditor_Addon_Secondary_color:"var(--label-neutral)","AEditor_Addon_hover_background-color":"var(--elevation-10)",AEditor_Addon_hover_color:"var(--acent-brand)",AEditor_Addon_focus_border:"1px solid var(--line-strong)","AEditor_border-radius":"2px","AEditor_Select_border-radius":"6px","AEditor_Option_border-radius":"6px",ACheckBox_color:"var(--label-normal)","ADialog_Paper_background-color":"#00000060","ADialog_background-color":"var(--elevation-0)",ADialog_border:"1px solid var(--line-neutral)","ADialog_Action_background-color":"var(--elevation-0)",ASelect_Placeholder_color:"var(--label-neutral)",ASelect_Primary_border:"1px solid var(--line-normal)",ASelect_Primary_hover_border:"1px solid var(--line-strong)",ASelect_Primary_Arrow_color:"var(--label-normal)","ASelect_Primary_Options_background-color":"var(--elevation-0)",ASelect_Primary_Options_border:"1px solid var(--line-normal)","ASelect_Primary_Option_hover_background-color":"var(--elevation-10)","ASelect_Primary_Option_active_background-color":"var(--elevation-10)","ASelect_Primary_Option_Selected_background-color":"var(--elevation-20)",ASelect_Secondary_border:"1px solid var(--elevation-10)",ASelect_Secondary_hover_border:"1px solid var(--elevation-10)","ASelect_Secondary_background-color":"var(--elevation-10)",ASelect_Secondary_Arrow_color:"var(--label-normal)","ASelect_Secondary_Options_background-color":"var(--elevation-0)",ASelect_Secondary_Options_border:"var(--line-normal)","ASelect_Secondary_Option_hover_background-color":"var(--elevation-10)","ASelect_Secondary_Option_active_background-color":"var(--elevation-10)","ASelect_Secondary_Option_Selected_background-color":"var(--elevation-20)",AMultiSelect_Placeholder_color:"var(--label-neutral)",AMultiSelect_Primary_border:"1px solid var(--line-normal)",AMultiSelect_Primary_hover_border:"1px solid var(--line-strong)",AMultiSelect_Primary_Arrow_color:"var(--label-normal)","AMultiSelect_Primary_Options_background-color":"var(--elevation-0)",AMultiSelect_Primary_Options_border:"1px solid var(--line-normal)","AMultiSelect_Primary_Option_hover_background-color":"var(--elevation-10)","AMultiSelect_Primary_Option_active_background-color":"var(--elevation-10)","AMultiSelect_Primary_Option_Selected_background-color":"var(--elevation-20)",AMultiSelect_Secondary_border:"1px solid var(--elevation-10)",AMultiSelect_Secondary_hover_border:"1px solid var(--elevation-10)","AMultiSelect_Secondary_background-color":"var(--elevation-10)",AMultiSelect_Secondary_Arrow_color:"var(--label-normal)","AMultiSelect_Secondary_Options_background-color":"var(--elevation-0)",AMultiSelect_Secondary_Options_border:"1px solid var(--line-normal)","AMultiSelect_Secondary_Option_hover_background-color":"var(--elevation-10)","AMultiSelect_Secondary_Option_active_background-color":"var(--elevation-10)","AMultiSelect_Secondary_Option_Selected_background-color":"var(--elevation-20)","ATree_background-color":"var(--elevation-0)",ATree_Indent_border:"1px solid var(--line-normal)","ATreeBodyHeader_border-bottom":"1px solid var(--line-normal)","ATreeItem_hover_background-color":"var(--elevation-10)","ATreeItem_active_background-color":"var(--elevation-10)","ATreeItem_select_background-color":"var(--elevation-10)","ATreeItem_search_background-color":"yellow","ATreeItem_search_border-top":"1px dashed var(--label-normal)","ATreeItem_search_border-bottom":"1px dashed var(--label-normal)",ATreeItem_select_color:"var(--label-normal)",ASwitch_Track_Falsy_border:"12px solid var(--elevation-20)",ASwitch_Track_Truthy_border:"12px solid var(--acent-brand)",ASwitch_Thumb_border:"9px solid var(--static-white)","ATab_IndicatorTrack_Primary_border-bottom":"1px solid var(--line-normal)","ATab_Indicator_Primary_background-color":"var(--label-normal)",ATab_Option_Secondary_border:"2px solid var(--label-normal)","ATab_Option_Secondary_IsSelected_border-bottom":"2px solid var(--elevation-0)",ATab_Option_Secondary_IsDisabled_border:"2px solid var(--line-neutral)","ATab_IndicatorTrack_Tertiary_background-color":"var(--line-normal)","ATab_Indicator_Tertiary_background-color":"var(--elevation-0)",ATab_Option_Tertiary_color:"var(--line-strong)",ATab_Option_Tertiary_IsSelected_color:"var(--label-strong)",ATab_Option_Quaternary_color:"var(--label-neutral)",ATab_Option_Quaternary_IsSelected_color:"var(--label-normal)",AFileBox_border:"1px dashed var(--label-normal)","AFileBox_background-color":"var(--elevation-10)",AFileBox_SelectedFile_color:"var(--label-normal)",AFileBox_Dropping_color:"var(--label-normal)","AFileUploader_background-color":"var(--background-normal)",AFileUploader_brand_color:"var(--acent-brand)",AFileUploader_disabled_color:"var(--label-neutral)",AFileUploader_error_color:"var(--alert-danger)",AFileUploader_text_color:"var(--label-normal)","AListView_border-thin":"1px solid var(--line-neutral)","AListView_border-thick":"3px solid var(--line-neutral)","AStepper_OutCircle_background-color":"transparent","AStepper_OutCircle_IsOver_background-color":"var(--elevation-10)","AStepper_InCircle_background-color":"var(--elevation-20)","AStepper_InCircle_IsOver_background-color":"var(--label-normal)","AStepper_Line_background-color":"var(--line-neutral)","AStepper_Line_IsOver_background-color":"var(--label-normal)",ADatePicker_Anchor_border:"1px solid var(--line-normal)",ADatePicker_Anchor_color:"var(--label-normal)",ADatePicker_Anchor_Placeholder_color:"var(--label-neutral)",ADatePicker_Anchor_hover_border:"1px solid var(--line-strong)",ADatePicker_Anchor_focus_border:"1px solid var(--line-strong)",ADatePicker_Anchor_Icon_Primary_color:"var(--label-normal)",ADatePicker_Anchor_Icon_Secondary_color:"var(--label-normal)","ADatePicker_background-color":"var(--elevation-0)",ADatePicker_border:"1px solid var(--line-neutral)","ADatePicker_StringInputContainer_background-color":"var(--label-neutral)",ADatePicker_String_border:"1px solid var(--label-normal)","ADatePicker_Prev_background-color":"var(--elevation-10)","ADatePicker_Prev_border-right":"6px solid var(--label-normal)","ADatePicker_Next_background-color":"var(--elevation-10)","ADatePicker_Next_border-left":"6px solid var(--label-normal)",ADatePicker_Cell_color:"var(--label-normal)",ADatePicker_Cell_IsNotCurrentMonth_color:"var(--label-neutral)",ADatePicker_Cell_IsDisabled_color:"var(--label-neutral)","ADatePicker_Cell_IsSelected_background-color":"var(--elevation-20)",ADatePicker_Cell_IsSelected_color:"var(--label-normal)","ADatePicker_Cell_IsHovered_background-color":"var(--elevation-10)",ADateRangePicker_Anchor_border:"1px solid var(--line-normal)",ADateRangePicker_Anchor_color:"var(--label-normal)",ADateRangePicker_Anchor_Placeholder_color:"var(--label-neutral)",ADateRangePicker_Anchor_hover_border:"1px solid var(--line-strong)",ADateRangePicker_Anchor_focus_border:"1px solid var(--line-strong)",ADateRangePicker_Anchor_Icon_Primary_color:"var(--label-normal)",ADateRangePicker_Anchor_Icon_Secondary_color:"var(--label-normal)","ADateRangePicker_background-color":"var(--elevation-0)",ADateRangePicker_border:"1px solid var(--line-neutral)","ADateRangePicker_StringInputContainer_background-color":"var(--label-neutral)",ADateRangePicker_String_border:"1px solid var(--label-normal)","ADateRangePicker_Prev_background-color":"var(--elevation-10)","ADateRangePicker_Prev_border-right":"6px solid var(--label-normal)","ADateRangePicker_Next_background-color":"var(--elevation-10)","ADateRangePicker_Next_border-left":"6px solid var(--label-normal)",ADateRangePicker_Cell_color:"var(--label-normal)",ADateRangePicker_Cell_IsNotCurrentMonth_color:"var(--label-neutral)",ADateRangePicker_Cell_IsDisabled_color:"var(--label-neutral)","ADateRangePicker_Cell_IsSelected_background-color":"var(--elevation-20)",ADateRangePicker_Cell_IsSelected_color:"var(--label-normal)","ADateRangePicker_Cell_IsHovered_background-color":"var(--elevation-10)",AIconButton_Primary_color:"var(--label-normal)",AIconButton_Primary_border:"1px solid var(--line-normal)","AIconButton_Primary_background-color":"var(--elevation-0)","AIconButton_Primary_hover_background-color":"var(--elevation-10)","AIconButton_Primary_active_background-color":"var(--elevation-20)",AIconButton_Secondary_color:"var(--label-normal)","AIconButton_Secondary_background-color":"var(--elevation-0)","AIconButton_Secondary_hover_background-color":"var(--elevation-10)","AIconButton_Secondary_active_background-color":"var(--elevation-20)","ATableBody_TRow_border-bottom":"1px solid var(--line-normal)","ATableBody_TRow_IsSelected_background-color":"var(--elevation-10)","ATableBody_TRow_IsSelectable_hover_background-color":"var(--elevation-10)",ATableBody_TH_color:"var(--label-neutral)","ATableBody_TD_IsMarked_background-color":"yellow",ATableBody_TD_IsMarked_color:"var(--label-normal)","ATableBody_Resizer_hover_ResizerCenter_background-color":"var(--line-neutral)","ATableBody_Resizer_active_ResizerCenter_background-color":"var(--line-neutral)","ATableBody_Resizer_active_ResizerOut_background-color":"var(--line-neutral)","ATableBody_Resizer_active_ResizerIn_background-color":"var(--line-neutral)","ATableFooter_Button_IsSelected_background-color":"var(--elevation-10)",ATableFooter_Button_IsSelected_color:"var(--label-normal)",ATableFooter_Button_IsDisabled_color:"var(--label-neutral)","ATableFilter_SubFilters_background-color":"var(--elevation-0)",ATableFilter_SubFilters_border:"1px solid var(--line-normal)",ATableFilter_Icon_color:"var(--label-normal)",ATableFilter_Alert_color:"var(--alert-danger)","ADivideFrame_DividerInner_background-color":"var(--line-normal)","AFloatMenu_background-color":"var(--elevation-0)","AFloatMenu_hover_background-color":"var(--elevation-10)",AFloatMenu_color:"var(--label-normal)",AFloatMenu_border:"1px solid var(--line-neutral)","ALoadingBorder_background-color":"var(--label-normal)","ALoadingBorder_ProgressBar_background-color":"var(--elevation-0)","ALoadingBorder_Cover_background-color":"var(--label-normal)",AWrap_Error_color:"var(--alert-danger)",ARadioSelect_RadioButton_border:"1px solid var(--line-normal)","ARadioSelect_RadioButton_InnerCircle_isChecked_background-color":"var(--acent-brand)","AChip_background-color":"var(--elevation-10)",AChip_color:"var(--label-normal)",AChip_border:"1px solid var(--line-normal)","AChip_hover_background-color":"var(--elevation-20)",AChip_hover_color:"var(--label-normal)",AChip_DeleteButton_border:"9px solid var(--line-normal)",AChip_DeleteButton_color:"var(--label-normal)",AChip_DeleteButton_hover_border:"9px solid var(--line-strong)",AChip_DeleteButton_hover_color:"var(--label-normal)"};function TA(n){return Ev[n]}function AA(n){return Tv(n)}function k3(n){$n.keys(n).forEach(t=>{const r=n[t];r!==void 0&&(document.documentElement.style.setProperty(`--${t}`,r),Ev[t]=r)})}function RA(n){$n.keys(n).forEach(t=>{const r=n[t];if(r===void 0)return;const i=lc.semantic[va.semanticMode][r];i!==void 0&&(document.documentElement.style.setProperty(t,i),Ev[t]=i)})}const va={paletteMode:Sv[0],semanticMode:x1[0],save:"",followDeviceSetting:!1};function IA({semanticMode:n,save:e,followDeviceSetting:t}){if(t!==void 0&&(va.followDeviceSetting=t,t)){const r=window.matchMedia("(prefers-color-scheme: dark)"),i=l=>{va.semanticMode=l.matches?"dark":"light"};i(r);const o=l=>i(l);r.addEventListener("change",o)}if(e!==void 0){if(va.save=e,e==="localStorage"){const r=localStorage.getItem("semanticMode");x1.includes(r)&&(va.semanticMode=r)}else if(e==="sessionStorage"){const r=sessionStorage.getItem("semanticMode");x1.includes(r)&&(va.semanticMode=r)}}n!==void 0&&(va.semanticMode=n),jC(va.paletteMode),xm(va.semanticMode),$C(lc.palette[va.paletteMode]),t3(lc.semantic[va.semanticMode]),k3(Ev)}function kA(n){n.type==="semanticModeChange"?ev.push(n.listener):n.type==="paletteModeChange"?$0.push(n.listener):console.error("AThemes.addEventListener : parameter is not valid")}function MA(n){if(n.type==="semanticModeChange"){const e=ev.indexOf(n.listener);e!==-1&&ev.splice(e,1)}else if(n.type==="paletteModeChange"){const e=$0.indexOf(n.listener);e!==-1&&$0.splice(e,1)}else console.error("AThemes.removeEventListener : parameter is not valid")}function Tv(n){const e=window.getComputedStyle(document.documentElement);let t=e.getPropertyValue(n);return t===""&&(t=e.getPropertyValue(`--${n}`)),t}function LA(n){Object.assign(dt.additionalClasses,n),dt.updateKeys(),dt.additionalClasses=dt.additionalClasses}const pp={getCurrentPaletteMode:mA,getPaletteValue:xA,getPaletteDeepValue:wA,changePaletteMode:jC,editPalette:$C,getCurrentSemanticMode:CA,getSemanticValue:_A,getSemanticDeepValue:SA,changeSemanticMode:xm,editSemantic:t3,getComponentStyleValue:TA,getComponentStyleDeepValue:AA,editComponentStyle:k3,editComponentStyleWithSemantic:RA,init:IA,addEventListener:kA,removeEventListener:MA,getDeepValue:Tv,addClasses:LA},OA=n=>{const e=Gn.c(9),{onChange:t,onClick:r,type:i,...o}=n,l=i===void 0?"Icon":i,[a,h]=B.useState(pp.getCurrentSemanticMode()==="dark"?"Moon":"Sun");let g;e[0]!==r||e[1]!==t?(g=x=>{const w=pp.getCurrentSemanticMode();let _="light";w==="light"?_="dark":w==="dark"&&(_="light"),pp.changeSemanticMode(_),h(PA[_]),t==null||t(_),r==null||r(x)},e[0]=r,e[1]=t,e[2]=g):g=e[2];const m=g;if(l==="Icon")return M.jsx(ba,{...o,className:dt.clsx(Tp.AThemeButton,o.className,"IsInteractive"),icon:a,type:"Raw",onClick:m});if(l==="Switch"){let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=pp.getCurrentSemanticMode(),e[3]=x):x=e[3];let w;e[4]!==m?(w=[x==="dark",m],e[4]=m,e[5]=w):w=e[5];let _;return e[6]!==o||e[7]!==w?(_=M.jsx(QC,{...o,useCheck:w}),e[6]=o,e[7]=w,e[8]=_):_=e[8],_}},PA={light:"Sun",dark:"Moon"},DA="_ACheckBoxWrap_1ozuz_1",NA="_ACheckBox_1ozuz_1",G2={ACheckBoxWrap:DA,ACheckBox:NA},w1=n=>{const e=Gn.c(16),{useCheck:t,isIndeterminate:r,isDisabled:i,isLoading:o,onClick:l,...a}=n,[h,g]=Fo(t,!1);let m;e[0]!==h||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==g?(m=O=>{i||o||(g==null||g(!h),l==null||l(O))},e[0]=h,e[1]=l,e[2]=i,e[3]=o,e[4]=g,e[5]=m):m=e[5];const x=m,w=zi,_=dt.clsx(a.className,G2.ACheckBoxWrap),S=r?"Check.Indeterminate":h?"Check.Checked":"Check.UnChecked";let R;e[6]!==S?(R=M.jsx(fo,{className:G2.ACheckBox,icon:S}),e[6]=S,e[7]=R):R=e[7];let k;return e[8]!==w||e[9]!==a||e[10]!==i||e[11]!==o||e[12]!==x||e[13]!==_||e[14]!==R?(k=M.jsx(w,{...a,className:_,isDisabled:i,isLoading:o,onClick:x,children:R}),e[8]=w,e[9]=a,e[10]=i,e[11]=o,e[12]=x,e[13]=_,e[14]=R,e[15]=k):k=e[15],k};function FA(n){return typeof n=="function"}function BA(n,e){return FA(n)?n(e):n}const Ur={getContent:BA};class Y2{constructor(e){Ee(this,"capacity");Ee(this,"cache",new Map);this.capacity=e}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}put(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){const r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(e,t)}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}entries(){return Array.from(this.cache.entries())}}const Rg=class Rg{constructor(){Ee(this,"databases",{});Ee(this,"caches",{});Ee(this,"DEFAULT_CACHE_SIZE",100)}static getInstance(){return Rg.instance||(Rg.instance=new Rg),Rg.instance}getCache(e,t){const r=`${e}_${t}`;return this.caches[r]||(this.caches[r]=new Y2(this.DEFAULT_CACHE_SIZE)),this.caches[r]}async getDB(e,t,r=1){return this.databases[e]?this.databases[e]:new Promise((i,o)=>{if(!window.indexedDB){console.error("이 브라우저는 IndexedDB를 지원하지 않습니다."),o(new Error("IndexedDB not supported"));return}const l=window.indexedDB.open(e,r);l.onerror=a=>{console.error("IndexedDB 연결 오류:",a.target.error),o(a.target.error)},l.onsuccess=a=>{const h=a.target.result;this.databases[e]=h,i(h)},l.onupgradeneeded=a=>{const h=a.target.result;h.objectStoreNames.contains(t)||h.createObjectStore(t,{keyPath:"id"}).createIndex("updatedAt_idx","updatedAt",{unique:!1})}})}async save(e,t,r){this.getCache(e,t).put(r.id,{...r});const a=(await this.getDB(e,t)).transaction([t],"readwrite").objectStore(t);return new Promise((h,g)=>{const m=a.put(r);m.onsuccess=()=>h(),m.onerror=x=>{console.error("데이터 저장 오류:",x.target.error),g(x.target.error)}})}async batchSave(e,t,r){if(r.length===0)return;const i=this.getCache(e,t);r.forEach(h=>i.put(h.id,{...h}));const l=(await this.getDB(e,t)).transaction([t],"readwrite"),a=l.objectStore(t);return new Promise((h,g)=>{l.oncomplete=()=>h(),l.onerror=m=>{console.error("배치 저장 오류:",m.target.error),g(m.target.error)},r.forEach(m=>a.put(m))})}async get(e,t,r){const i=this.getCache(e,t),o=i.get(r);if(o)return o;const h=(await this.getDB(e,t)).transaction([t],"readonly").objectStore(t);return new Promise((g,m)=>{const x=h.get(r);x.onsuccess=()=>{const w=x.result;w&&i.put(r,w),g(w||null)},x.onerror=w=>{console.error("데이터 조회 오류:",w.target.error),m(w.target.error)}})}async getByIndex(e,t,r,i){const h=(await this.getDB(e,t)).transaction([t],"readonly").objectStore(t).index(r);return new Promise((g,m)=>{const x=h.getAll(i);x.onsuccess=()=>{const w=x.result,_=this.getCache(e,t);w.forEach(S=>{S&&S.id&&_.put(S.id,S)}),g(w)},x.onerror=w=>{console.error("인덱스 조회 오류:",w.target.error),m(w.target.error)}})}async delete(e,t,r){this.getCache(e,t).delete(r);const a=(await this.getDB(e,t)).transaction([t],"readwrite").objectStore(t);return new Promise((h,g)=>{const m=a.delete(r);m.onsuccess=()=>h(),m.onerror=x=>{console.error("데이터 삭제 오류:",x.target.error),g(x.target.error)}})}async batchDelete(e,t,r){if(r.length===0)return;const i=this.getCache(e,t);r.forEach(h=>i.delete(h));const l=(await this.getDB(e,t)).transaction([t],"readwrite"),a=l.objectStore(t);return new Promise((h,g)=>{l.oncomplete=()=>h(),l.onerror=m=>{console.error("배치 삭제 오류:",m.target.error),g(m.target.error)},r.forEach(m=>a.delete(m))})}async getAll(e,t){const o=(await this.getDB(e,t)).transaction([t],"readonly").objectStore(t);return new Promise((l,a)=>{const h=o.getAll();h.onsuccess=()=>{const g=h.result,m={},x=this.getCache(e,t);g.forEach(w=>{w.id&&(m[w.id]=w,x.put(w.id,w))}),l(m)},h.onerror=g=>{console.error("데이터 전체 조회 오류:",g.target.error),a(g.target.error)}})}async clear(e,t){this.getCache(e,t).clear();const l=(await this.getDB(e,t)).transaction([t],"readwrite").objectStore(t);return new Promise((a,h)=>{const g=l.clear();g.onsuccess=()=>a(),g.onerror=m=>{console.error("데이터 초기화 오류:",m.target.error),h(m.target.error)}})}getCached(e,t,r){return this.getCache(e,t).get(r)||null}clearCached(e,t){this.getCache(e,t).clear()}setCacheSize(e,t,r){const i=`${e}_${t}`,l=this.getCache(e,t).entries();this.caches[i]=new Y2(r);for(const[a,h]of l)this.caches[i].get(a)===void 0&&a!==void 0&&this.caches[i].put(a,h)}};Ee(Rg,"instance");let ky=Rg;const _h=ky.getInstance(),Th={save:(n,e,t)=>_h.save(n,e,t),get:(n,e,t)=>_h.get(n,e,t),delete:(n,e,t)=>_h.delete(n,e,t),getAll:(n,e)=>_h.getAll(n,e),clear:(n,e)=>_h.clear(n,e),batchSave:(n,e,t)=>_h.batchSave(n,e,t),batchDelete:(n,e,t)=>_h.batchDelete(n,e,t),getByIndex:(n,e,t,r)=>_h.getByIndex(n,e,t,r),getCached:(n,e,t)=>_h.getCached(n,e,t),clearCached:(n,e)=>_h.clearCached(n,e),setCacheSize:(n,e,t)=>_h.setCacheSize(n,e,t)};function M3(n,e,t={}){const{dataFieldName:r="data"}=t,[i,o]=B.useState(!1),[l,a]=B.useState(null),h=B.useRef(new Map);B.useEffect(()=>{const N=h.current;return()=>{N.forEach(J=>J.abort()),N.clear()}},[]);const g=B.useCallback(async(N,J)=>{try{o(!0),a(null);const Y=h.current,K=Y.get(N);K&&K.abort();const fe=new AbortController;Y.set(N,fe);const X=await J();return h.current.delete(N),X}catch(Y){return Y instanceof Error&&Y.name==="AbortError"||a(Y instanceof Error?Y:new Error(String(Y))),null}finally{o(!1)}},[]),m=B.useCallback(async(N,J)=>N?await g(`save_${N}`,async()=>(await Th.save(n,e,{id:N,[r]:J,updatedAt:new Date().toISOString()}),!0))===!0:!1,[n,e,r,g]),x=B.useCallback(async N=>N.length?await g(`batch_save_${Date.now()}`,async()=>{const J=N.map(Y=>({id:Y.id,[r]:Y.data,updatedAt:new Date().toISOString()}));return await Th.batchSave(n,e,J),!0})===!0:!1,[n,e,r,g]),w=B.useCallback(async N=>N?await g(`get_${N}`,async()=>{const J=await Th.get(n,e,N);return(J==null?void 0:J[r])||null}):null,[n,e,r,g]),_=B.useCallback(N=>{if(!N)return null;const J=Th.getCached(n,e,N);return(J==null?void 0:J[r])||null},[n,e,r]),S=B.useCallback(async N=>N?await g(`delete_${N}`,async()=>(await Th.delete(n,e,N),!0))===!0:!1,[n,e,g]),R=B.useCallback(async N=>N.length?await g(`batch_delete_${Date.now()}`,async()=>(await Th.batchDelete(n,e,N),!0))===!0:!1,[n,e,g]),k=B.useCallback(async()=>await g(`get_all_${Date.now()}`,async()=>{const N=await Th.getAll(n,e);return Object.entries(N).reduce((J,[Y,K])=>(J[Y]=K[r],J),{})})||{},[n,e,r,g]),O=B.useCallback(async()=>await g(`clear_all_${Date.now()}`,async()=>(await Th.clear(n,e),!0))===!0,[n,e,g]),P=B.useCallback(N=>{const J=h.current.get(N);J&&(J.abort(),h.current.delete(N))},[]),z=B.useCallback(()=>{new Map(h.current).forEach(J=>J.abort()),h.current.clear()},[]),H=B.useCallback(N=>{Th.setCacheSize(n,e,N)},[n,e]),G=B.useCallback(()=>{Th.clearCached(n,e)},[n,e]);return{save:m,get:w,delete:S,getAll:k,clearAll:O,batchSave:x,batchDelete:R,getCached:_,setCacheSize:H,clearCache:G,cancelOperation:P,cancelAllOperations:z,isLoading:i,error:l}}const zA="LayoutDB",HA="layouts";function L3(){const n=Gn.c(24);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={dataFieldName:"lengths"},n[0]=e):e=n[0];const t=M3(zA,HA,e);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={},n[1]=r):r=n[1];const[i,o]=B.useState(r);let l;n[2]===Symbol.for("react.memo_cache_sentinel")?(l={},n[2]=l):l=n[2];const a=B.useRef(l);let h;n[3]!==t?(h=async(G,N)=>await t.save(G,N),n[3]=t,n[4]=h):h=n[4];const g=h;let m;n[5]!==t?(m=async G=>await t.get(G),n[5]=t,n[6]=m):m=n[6];const x=m;let w;n[7]!==t?(w=G=>t.getCached(G),n[7]=t,n[8]=w):w=n[8];const _=w;let S;n[9]!==x||n[10]!==_||n[11]!==i?(S=G=>{const N=_(G);return N?{data:N,isLoaded:!0}:a.current[G]!==void 0?{data:a.current[G],isLoaded:!!i[G]}:(i[G]||(a.current[G]=null,x(G).then(J=>{a.current[G]=J,o(Y=>({...Y,[G]:!0}))})),{data:null,isLoaded:!1})},n[9]=x,n[10]=_,n[11]=i,n[12]=S):S=n[12];const R=S;let k;n[13]!==t?(k=async G=>(o(N=>{const J={...N};return delete J[G],J}),a.current[G]!==void 0&&delete a.current[G],await t.delete(G)),n[13]=t,n[14]=k):k=n[14];const O=k;let P;n[15]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{o({}),a.current={}},n[15]=P):P=n[15];const z=P;let H;return n[16]!==t.error||n[17]!==t.isLoading||n[18]!==O||n[19]!==x||n[20]!==_||n[21]!==R||n[22]!==g?(H={save:g,get:x,getCached:_,getSync:R,deleteItem:O,resetSyncState:z,isLoading:t.isLoading,error:t.error},n[16]=t.error,n[17]=t.isLoading,n[18]=O,n[19]=x,n[20]=_,n[21]=R,n[22]=g,n[23]=H):H=n[23],H}const WA="_ARowFrame_1puxj_1",UA="_AColFrame_1puxj_7",GA="_AOverflowFrame_1puxj_13",YA="_ADivideFrame_1puxj_22",VA="_Row_1puxj_30",ZA="_Col_1puxj_33",XA="_FadeIn_1puxj_36",KA="_NoTransition_1puxj_39",JA="_ChildFrame_1puxj_43",QA="_ExpandButtonOverlay_1puxj_61",qA="_Divider_1puxj_73",jA="_IsMoving_1puxj_81",$A="_NoDraggable_1puxj_81",e6="_DividerInner_1puxj_84",t6="_IsClicked_1puxj_109",n6="_RemoteButton_1puxj_144",r6="_isExpanded_1puxj_151",i6="_ExpandButton_1puxj_61",ll={ARowFrame:WA,AColFrame:UA,AOverflowFrame:GA,ADivideFrame:YA,Row:VA,Col:ZA,FadeIn:XA,NoTransition:KA,ChildFrame:JA,ExpandButtonOverlay:QA,Divider:qA,IsMoving:jA,NoDraggable:$A,DividerInner:e6,IsClicked:t6,RemoteButton:n6,isExpanded:r6,"fade-in":"_fade-in_1puxj_1",ExpandButton:i6},Ml=n=>{const e=Gn.c(5);let t;e[0]!==n.className?(t=dt.clsx(ll.ARowFrame,n.className),e[0]=n.className,e[1]=t):t=e[1];let r;return e[2]!==n||e[3]!==t?(r=M.jsx(zi,{...n,className:t,children:n.children}),e[2]=n,e[3]=t,e[4]=r):r=e[4],r},O3=n=>{const e=Gn.c(5);let t;e[0]!==n.className?(t=dt.clsx(ll.AColFrame,n.className),e[0]=n.className,e[1]=t):t=e[1];let r;return e[2]!==n||e[3]!==t?(r=M.jsx("div",{...n,className:t,children:n.children}),e[2]=n,e[3]=t,e[4]=r):r=e[4],r},nd=n=>{const{tooltip:e,children:t,abaseRef:r,isDisabled:i,className:o,noOverflowTooltip:l,...a}=n,h=B.useRef(null),g=B.useMemo(()=>r??h,[r]),[m,x]=B.useState(!1),w=B.useCallback(()=>x(!0),[]),_=B.useCallback(()=>x(!1),[]);B.useEffect(()=>{const R=g.current;if(R)return R.addEventListener("mouseenter",w),R.addEventListener("mouseleave",_),()=>{R.removeEventListener("mouseenter",w),R.removeEventListener("mouseleave",_)}},[g,w,_]);const S=B.useMemo(()=>{if(i)return"";if(l||!m)return e;const R=g.current;return R&&R.scrollWidth>R.clientWidth?t:e},[g,i,t,e,l,m]);return M.jsx(zi,{...a,children:t,abaseRef:g,className:dt.clsx(ll.AOverflowFrame,o),isDisabled:i,tooltip:S})},P3=n=>{const e=Gn.c(2),{value:t,map:r}=n;if(r[t]===void 0)return r.fallback;const i=r[t];let o;return e[0]!==i?(o=M.jsx(B.Suspense,{children:i}),e[0]=i,e[1]=o):o=e[1],o},D3=B.memo(n=>{const{pk:e,direction:t="Row",lefts:r,minLength:i=40,expandLayerLength:o=40,children:l,childStyle:a,childClassName:h,dividerStyle:g,dividerClassName:m,dividerPadding:x,dividerInnerClassName:w,dividerInnerStyle:_,showRemote:S,ShowRemoteRenderer:R=o6,noDividerDraggable:k,resources:O,showExpandButton:P,...z}=n,H=B.useMemo(()=>({...Or.ADivideFrame,...O}),[O]),G=B.useRef(null),N=B.useRef(!1),J=B.useRef(!0),Y=B.useRef(r),[K,fe]=B.useState(),[X,te]=B.useState("FadeOut"),[ne,ue]=B.useState(!1),[se,$]=B.useState(null),[re,ge]=B.useState({width:0,height:0}),{save:me,get:oe,deleteItem:Q}=L3(),pe=B.useCallback(()=>{J.current&&requestAnimationFrame(()=>{J.current=!1,te("FadeIn")})},[]),Ie=B.useMemo(()=>{let Ye;return Array.isArray(l)?Ye=l:Ye=[l],Ye.filter(Boolean)},[l]),Fe=B.useMemo(()=>Ie.length,[Ie.length]),xe=B.useMemo(()=>Ie.length-1,[Ie.length]),Oe=B.useMemo(()=>e?String(e):"",[e]),Le=B.useMemo(()=>e&&!S,[e,S]),He=B.useCallback(async()=>{if(!Le){$(r),pe();return}try{const Ye=await oe(Oe);Ye?$(Ye):($(r),me(Oe,r)),pe()}catch{$(r),pe()}},[Le,pe,Oe,oe,r,me]);B.useEffect(()=>{He()},[He]),B.useEffect(()=>{const Ye=()=>{ge({width:window.innerWidth,height:window.innerHeight})};return Ye(),window.addEventListener("resize",Ye),()=>window.removeEventListener("resize",Ye)},[]),B.useEffect(()=>{Y.current!==r&&(Y.current=r,N.current||($(r),Le&&me(Oe,r)),N.current=!1)},[Le,r,Oe,me]);const Te=B.useMemo(()=>{const Ye=x??0;return typeof i=="number"?Array(Fe).fill(i+Ye):i.map(Tt=>Tt+Ye)},[i,Fe,x]),ke=B.useMemo(()=>typeof o=="number"?Array(Fe).fill(o):o,[o,Fe]),Be=B.useMemo(()=>(K==null?void 0:K.lefts)||se||[],[K,se]),rt=B.useRef({x:0,y:0}),Re=B.useCallback((Ye,Tt,Ut)=>{const gt=Be[Ye],Ht=Ye===0?0:Be[Ye-1],xt=gt-Ht,pn={...a,...l6(t,xt,Tt)};return x!==void 0&&(t==="Row"?(Ut||(pn.paddingLeft=x),Tt||(pn.paddingRight=x)):(Ut||(pn.paddingTop=x),Tt||(pn.paddingBottom=x))),pn},[Be,a,t,x]),ut=B.useCallback(()=>{if(!(!S||t!=="Row")){if(ne)$(r),N.current=!1;else{if(Fe<=1)return;const Ye=[];let Tt=0;for(let Ut=0;Ut<Fe-1;Ut++){const gt=typeof i=="number"?i:i[Ut]||i[0];Tt+=gt,Ye.push(Tt)}$(Ye),N.current=!0}ue(Ye=>!Ye),J.current=!1}},[S,t,ne,Fe,r,i]),qe=B.useCallback((Ye,Tt)=>{if(Tt)return Ut=>{if(!G.current||!se)return;J.current=!1;const gt=G.current;rt.current={x:Ut.clientX,y:Ut.clientY};const Ht=gt.getBoundingClientRect(),xt=t==="Row"?Ht.left:Ht.top,pn=t==="Row"?Ht.width:Ht.height;let $t=[...se];fe({idx:Ye,lefts:$t});const sn=bn=>{$t=u6(se,t,Ye,bn,xt,pn,Te),fe({idx:Ye,lefts:$t})},Xt=()=>{fe(void 0),$($t),N.current=!0,Le&&me(Oe,$t),window.removeEventListener("mousemove",sn),window.removeEventListener("mouseup",Xt)};window.addEventListener("mousemove",sn),window.addEventListener("mouseup",Xt)}},[se,t,Te,Le,Oe,me]),ot=B.useCallback(Ye=>{if(Ye)return()=>{$(r),N.current=!1,fe(void 0),Le&&Q(Oe)}},[r,Le,Oe,Q]),st=B.useMemo(()=>Ie.map((Ye,Tt)=>{const Ut=S&&(ne||!ne&&Tt===xe-1);return!(k||Ut)}),[Ie,S,ne,k,xe]),bt=B.useMemo(()=>{if(!P||!G.current||X!=="FadeIn")return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};if(!re.width)return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};const Ye=G.current.getBoundingClientRect(),Tt=t==="Row"?Ye.width:Ye.height;if(Tt===0)return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};const Ut=[];for(let xt=0;xt<Fe;xt++){const pn=Be[xt],$t=xt===0?0:Be[xt-1],sn=xt===xe?Tt-$t:pn-$t,Xt=Array.isArray(ke)?ke[xt]:ke[0],bn=sn<=Xt;Ut.push({panelIndex:xt,actualLength:sn,expandLength:Xt,isCollapsed:bn})}const gt=Ut.filter(xt=>xt.isCollapsed).map(xt=>xt.panelIndex);if(gt.length===0)return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};let Ht=-1;return gt.includes(0)?Ht=0:gt.includes(xe)?Ht=xe:Ht=gt[0],{hasCollapsedAreas:!0,collapsedAreaIndex:Ht}},[P,X,t,Fe,xe,Be,ke,re]),Mt=B.useCallback(()=>{P&&($(r),N.current=!1,Le&&me(Oe,r),J.current=!1)},[P,r,Le,Oe,me]),Bt=B.useMemo(()=>st.map((Ye,Tt)=>qe(Tt,Ye)),[st,qe]),at=B.useMemo(()=>st.map(Ye=>ot(Ye)),[st,ot]);return se?M.jsx("div",{...z,ref:G,className:dt.clsx(ll.ADivideFrame,n.className,ll[t],ll[X],J.current&&ll.NoTransition),children:Ie.map((Ye,Tt)=>{const Ut=Tt===0,gt=Tt===xe,Ht=Re(Tt,gt,Ut),xt=Be[Tt],pn=st[Tt],$t=Bt[Tt],sn=at[Tt];return M.jsxs(B.Fragment,{children:[M.jsxs("div",{style:Ht,className:dt.clsx(ll.ChildFrame,h,K&&ll.IsMoving,J.current&&ll.NoTransition,ll[t]),children:[gt&&S&&t==="Row"&&M.jsx(R,{handleToggleExpand:ut,isExpanded:ne,resources:H}),Ye,P&&bt.hasCollapsedAreas&&bt.collapsedAreaIndex===Tt&&M.jsxs(M.Fragment,{children:[M.jsx(zi,{className:dt.clsx(ll.ExpandButtonOverlay,ll[t]),onClick:Mt}),M.jsx(ba,{className:dt.clsx(ll.ExpandButton,ll[t]),icon:a6(Tt,Fe),tooltip:H.Expand,type:"Raw",style:{transform:c6(Tt,t)},onClick:Mt})]})]}),!gt&&M.jsx("div",{"data-nodraggable":pn?void 0:"true",className:dt.clsx(ll.Divider,ll[t],"NoSelect",K&&ll.IsMoving,(K==null?void 0:K.idx)===Tt&&ll.IsClicked,J.current&&ll.NoTransition,!pn&&ll.NoDraggable,m),style:{...g,...s6(t,xt)},onDoubleClick:sn,onMouseDown:$t,children:M.jsx("div",{className:dt.clsx(ll.DividerInner,w),style:{..._}})})]},Tt)})}):M.jsx("div",{...z,ref:G,className:dt.clsx(ll.ADivideFrame,n.className,ll[t],ll.FadeOut,ll.NoTransition),style:{...z.style,visibility:"hidden",pointerEvents:"none"}})});D3.displayName="ADivideFrame";const o6=n=>{const{handleToggleExpand:e,isExpanded:t,resources:r}=n;return M.jsx(ba,{className:dt.clsx(ll.RemoteButton,t&&ll.isExpanded),icon:"DividerExpand",iconSize:"md",tabIndex:0,tooltip:t?r.Collapse:r.Expand,type:"Raw",onClick:e})};function l6(n,e,t){return t?{}:n==="Col"?{height:e,minHeight:e,maxHeight:e}:{maxWidth:e,width:e,minWidth:e}}function s6(n,e){return n==="Col"?{top:e}:{left:e}}function a6(n,e){const t=n===0,r=n===e-1;return t||r?"DividerExpand":"DividerMiddle"}function c6(n,e){const t=n===0;let r="";return e==="Row"&&t?r=" rotate(180deg)":e==="Col"&&(r=t?" rotate(-90deg)":" rotate(90deg)"),`translate(-50%, -50%)${r}`}function u6(n,e,t,r,i,o,l){const a=[...n],h=e==="Row"?r.clientX-i-n[t]:r.clientY-i-n[t];if(h===0)return a;const g=l.length,m=n.length,x=t+1,w=[],_=[];let S=0;for(let O=0;O<=g;O++)w[O]=S,O<g&&(S+=l[O]);let R=0;for(let O=g-2;O>=0;O--)R+=l[O+1],_[O]=R;_[g-1]=0;let k=a[t]+h;if(h<0){if(k<=w[x])for(let O=0;O<=t;O++)a[O]=w[O+1];else if(a[t]=k,t>0)for(let O=t-1;O>=0&&k-a[O]<l[O+1];O--)a[O]=k-l[O+1],k=a[O]}else{const O=t===g-2?l[g-1]:0;if(k>=o-_[t]-O)for(let P=t;P<m;P++)a[P]=o-_[P]-(P===m-1?0:O);else if(a[t]=k,t<m-1)for(let P=x;P<m&&a[P]-k<l[P];P++)a[P]=k+l[P],k=a[P]}return a}const zg=()=>{const n=Gn.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=M.jsx("div",{style:{display:"flex",flexGrow:1}}),n[0]=e):e=n[0],e},f6="_ASpace_1okqf_1",h6={ASpace:f6},cs=n=>{const e=Gn.c(14);let t,r,i,o,l;e[0]!==n?({h:r,w:l,...t}=n,i=t,o=dt.clsx(h6.ASpace,t.className),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5]);let a;e[6]!==t.style||e[7]!==r||e[8]!==l?(a={height:r,minHeight:r,maxHeight:r,width:l,minWidth:l,maxWidth:l,...t.style},e[6]=t.style,e[7]=r,e[8]=l,e[9]=a):a=e[9];let h;return e[10]!==i||e[11]!==o||e[12]!==a?(h=M.jsx("div",{...i,className:o,style:a}),e[10]=i,e[11]=o,e[12]=a,e[13]=h):h=e[13],h},d6="_AChipsContainer_1ag9v_1",g6="_AChip_1ag9v_1",p6="_Clickable_1ag9v_21",v6="_AChipDelete_1ag9v_26",b6="_IsHover_1ag9v_40",y6="_AChipDeleteIcon_1ag9v_45",h1={AChipsContainer:d6,AChip:g6,Clickable:p6,AChipDelete:v6,IsHover:b6,AChipDeleteIcon:y6},m6=n=>{const e=Gn.c(42);let t,r,i,o,l,a,h,g,m,x,w,_;e[0]!==n?({useLabels:_,alignItems:m,ChipStyle:l,ChipClassName:t,ChipOnDelete:o,ChipOnClick:i,ChipIcon:r,className:h,style:g,ButtonRenderer:x,gap:w,...a}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12]);const S=m===void 0?"flex-start":m,R=x===void 0?N3:x,k=w===void 0?8:w;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[],e[13]=O):O=e[13];const[P,z]=Fo(_,O);let H;e[14]!==o||e[15]!==P||e[16]!==z?(H=te=>{!z||!o||(o({label:te}),z(P.filter(ne=>ne!==te)))},e[14]=o,e[15]=P,e[16]=z,e[17]=H):H=e[17];const G=H;let N;e[18]!==t||e[19]!==r||e[20]!==i||e[21]!==l||e[22]!==G?(N=te=>{const ne={label:te};return{label:te,useLabel:[te,x6],style:Ur.getContent(l,ne),className:Ur.getContent(t,ne),icon:Ur.getContent(r,ne),onDelete:()=>G(te),onClick:i?()=>i({label:te}):void 0}},e[18]=t,e[19]=r,e[20]=i,e[21]=l,e[22]=G,e[23]=N):N=e[23];const J=N;let Y;e[24]!==h?(Y=dt.clsx(h1.AChipsContainer,h),e[24]=h,e[25]=Y):Y=e[25];let K;e[26]!==S||e[27]!==k||e[28]!==g?(K={...g,alignItems:S,gap:k},e[26]=S,e[27]=k,e[28]=g,e[29]=K):K=e[29];let fe;if(e[30]!==R||e[31]!==J||e[32]!==P){let te;e[34]!==R||e[35]!==J?(te=(ne,ue)=>M.jsx(wm,{...J(ne),ButtonRenderer:R},ue),e[34]=R,e[35]=J,e[36]=te):te=e[36],fe=P.map(te),e[30]=R,e[31]=J,e[32]=P,e[33]=fe}else fe=e[33];let X;return e[37]!==a||e[38]!==Y||e[39]!==K||e[40]!==fe?(X=M.jsx(zi,{...a,className:Y,style:K,children:fe}),e[37]=a,e[38]=Y,e[39]=K,e[40]=fe,e[41]=X):X=e[41],X},wm=n=>{const e=Gn.c(27);let t,r,i,o,l,a,h;if(e[0]!==n){const{label:O,useLabel:P,icon:z,className:H,onDelete:G,onClick:N,ButtonRenderer:J,width:Y,style:K,...fe}=n;i=O,r=H,o=N,a=J,h=Y,l=K,t=fe,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7];const g=a===void 0?N3:a,m=h===void 0?"fit-content":h;if(i===void 0){let O;return e[8]===Symbol.for("react.memo_cache_sentinel")?(O=M.jsx(M.Fragment,{}),e[8]=O):O=e[8],O}let x;e[9]!==r||e[10]!==o?(x=dt.clsx("NoSelect",h1.AChip,o&&h1.Clickable,o&&"IsClickable",r),e[9]=r,e[10]=o,e[11]=x):x=e[11];let w;e[12]!==l||e[13]!==m?(w={...l,width:m},e[12]=l,e[13]=m,e[14]=w):w=e[14];const _=i;let S;e[15]!==_?(S=M.jsx(nd,{children:_}),e[15]=_,e[16]=S):S=e[16];let R;e[17]!==g||e[18]!==n?(R=g({...n}),e[17]=g,e[18]=n,e[19]=R):R=e[19];let k;return e[20]!==t||e[21]!==o||e[22]!==x||e[23]!==w||e[24]!==S||e[25]!==R?(k=M.jsxs(zi,{...t,className:x,style:w,onClick:o,children:[S,R]}),e[20]=t,e[21]=o,e[22]=x,e[23]=w,e[24]=S,e[25]=R,e[26]=k):k=e[26],k},N3=n=>{const e=Gn.c(13),{label:t,icon:r,onDelete:i,useLabel:o}=n,[,l]=Fo(o,t),[a,h]=B.useState(!1);let g;e[0]!==i||e[1]!==n||e[2]!==l?(g=O=>{i&&(O.stopPropagation(),l==null||l(void 0),i(n))},e[0]=i,e[1]=n,e[2]=l,e[3]=g):g=e[3];const m=g;let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{h(!0)},e[4]=x):x=e[4];const w=x;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{h(!1)},e[5]=_):_=e[5];const S=_;let R;e[6]!==m||e[7]!==r||e[8]!==a||e[9]!==i?(R=i&&M.jsxs(M.Fragment,{children:[M.jsx(zg,{}),M.jsx(cs,{w:24}),M.jsx(zi,{className:dt.clsx(h1.AChipDelete,"IsClickable",a&&h1.IsHover)}),M.jsx(ba,{className:h1.AChipDeleteIcon,icon:r||M.jsx(fo,{height:14,icon:"Close",stroke:"currentColor",width:14}),type:"Raw",onClick:m,onMouseEnter:w,onMouseLeave:S})]}),e[6]=m,e[7]=r,e[8]=a,e[9]=i,e[10]=R):R=e[10];let k;return e[11]!==R?(k=M.jsx(M.Fragment,{children:R}),e[11]=R,e[12]=k):k=e[12],k};function x6(){}const Mg=n=>{if(!n)return"0 bytes";const e=["bytes","KB","MB","GB","TB","PB","EB","ZB","YB","RB","QB"];let t=0;for(;n>=1024&&t<e.length-1;)n/=1024,t++;return`${t===0?Math.floor(n):n.toFixed(1)} ${e[t]}`},w6=n=>{let e="";n<0&&(e+="-",n=-n);const t=Math.floor(n/3600),r=Math.floor(n%3600/60),i=n%60;return t>0&&(e+=t.toString().padStart(2,"0")+":"),e+=r.toString().padStart(2,"0")+":",e+=i.toString().padStart(2,"0"),e},C6=/[a-zA-Z0-9]/,_6=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9]{2,}$/,S6=/^[a-zA-Z0-9._-]+$/,E6=/^[0-9a-fA-F-]+$/i,T6=/[가-힣ㄱ-ㅎㅏ-ㅣ]/,A6=/^\S*$/,R6=/^([^ㄱ-ㅎㅏ-ㅣ])*$/i,I6=/[!@#$%^&*+=;:?/<>\\[\](){}~\-_.(),]/,k6=/^(?=.*[A-Za-z])(?=.*\d)(?=.*[\W_])[A-Za-z\d\W_]{8,}$/,M6=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,L6={hasKr:n=>/[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(n),hasMalKr:n=>/[ㄱ-ㅎㅏ-ㅣ]/.test(n),hasBlank:n=>/\s/.test(n),isBlank:n=>/^\s*$/.test(n),isUuid:n=>/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/.test(n),isEmail:n=>/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9]{2,}$/.test(n),isAlphabet:n=>/^[a-zA-Z]*$/.test(n),isAlphaNumeric:n=>/^[a-zA-Z0-9]*$/.test(n),isKr:n=>/^[가-힣ㄱ-ㅎㅏ-ㅣ]*$/.test(n),isKrNumeric:n=>/^[가-힣ㄱ-ㅎㅏ-ㅣ0-9]*/.test(n),isNumeric:n=>/^[0-9]$/.test(n),isLenMinMax:(n,e)=>t=>!(n!==void 0&&t.length<n||e!==void 0&&t.length>e)},O6=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)}),Cm={secondToTime:w6,validate:L6,FileSizeTrans:Mg,uuid:O6},P6=n=>{const e=Gn.c(52);let t,r,i,o,l,a;if(e[0]!==n){const{maxTicks:Q,interval:pe,onFinish:Ie,noStartOnRender:Fe,actionRef:xe,...Oe}=n;l=Ie,o=Fe,t=xe,i=Q===void 0?300:Q,r=pe===void 0?1e3:pe,a=Bg(Oe),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6];const[h,g]=a;let m,x,w,_;e[7]!==h?({wrapId:x,wrapProps:w,labelProps:m,..._}=h,e[7]=h,e[8]=m,e[9]=x,e[10]=w,e[11]=_):(m=e[8],x=e[9],w=e[10],_=e[11]);const[S,R]=B.useState(0),[k,O]=B.useState(!o);let P,z;e[12]!==r||e[13]!==k||e[14]!==g.isDisabled||e[15]!==g.isLoading?(P=()=>{if(!k||g.isDisabled||g.isLoading)return;const Q=setInterval(()=>R(D6),r);return()=>clearInterval(Q)},z=[r,k,g.isDisabled,g.isLoading],e[12]=r,e[13]=k,e[14]=g.isDisabled,e[15]=g.isLoading,e[16]=P,e[17]=z):(P=e[16],z=e[17]),B.useEffect(P,z);let H;e[18]!==l?(H=()=>{l==null||l(),O(!1)},e[18]=l,e[19]=H):H=e[19];const G=H;let N,J;e[20]!==i||e[21]!==G||e[22]!==g.isDisabled||e[23]!==g.isLoading||e[24]!==S?(N=()=>{S>=i&&!g.isDisabled&&!g.isLoading&&G()},J=[S,i,G,g.isDisabled,g.isLoading],e[20]=i,e[21]=G,e[22]=g.isDisabled,e[23]=g.isLoading,e[24]=S,e[25]=N,e[26]=J):(N=e[25],J=e[26]),B.useEffect(N,J);let Y;e[27]!==g.isDisabled?(Y=()=>{g.isDisabled||O(!0)},e[27]=g.isDisabled,e[28]=Y):Y=e[28];const K=Y;let fe;e[29]!==g.isDisabled?(fe=()=>{g.isDisabled||O(!1)},e[29]=g.isDisabled,e[30]=fe):fe=e[30];const X=fe;let te;e[31]!==g.isDisabled?(te=()=>{g.isDisabled||(O(!1),R(0))},e[31]=g.isDisabled,e[32]=te):te=e[32];const ne=te;let ue,se;e[33]!==t||e[34]!==ne||e[35]!==K||e[36]!==X?(ue=()=>{t&&(t.current={start:K,stop:X,reset:ne,setTicks:R})},se=[t,K,X,ne],e[33]=t,e[34]=ne,e[35]=K,e[36]=X,e[37]=ue,e[38]=se):(ue=e[37],se=e[38]),B.useEffect(ue,se);const $=i-S;let re;e[39]!==m||e[40]!==x||e[41]!==w||e[42]!==_?(re={wrapId:x,wrapProps:w,labelProps:m,..._},e[39]=m,e[40]=x,e[41]=w,e[42]=_,e[43]=re):re=e[43];let ge;e[44]!==$?(ge=Cm.secondToTime($>0?$:0),e[44]=$,e[45]=ge):ge=e[45];let me;e[46]!==g||e[47]!==ge?(me=M.jsx(zi,{...g,children:ge}),e[46]=g,e[47]=ge,e[48]=me):me=e[48];let oe;return e[49]!==re||e[50]!==me?(oe=M.jsx(lg,{...re,children:me}),e[49]=re,e[50]=me,e[51]=oe):oe=e[51],oe};function D6(n){return n+1}function Oh(n){const e=n.getFullYear(),t=n.getMonth()+1,r=n.getDate();return`${e}-${t<10?"0"+t:t}-${r<10?"0"+r:r}`}function N6(n){try{if(!n)return;const e=new Date(n);return isNaN(e.getTime())?void 0:e}catch{return}}function F6(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0)}function B6(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59,999)}function V2(n,e){return Oh(n)===Oh(e)}function d1(n,e){return Oh(n)>Oh(e)}function tv(n,e){return Oh(n)>=Oh(e)}function nv(n,e){return Oh(n)<Oh(e)}function rv(n,e){return Oh(n)<=Oh(e)}function Z2(n,e,t){return d1(n,t)?d1(e,t)&&nv(e,n):d1(e,n)&&nv(e,t)}function X2(n,e,t){return d1(n,t)?tv(e,t)&&rv(e,n):tv(e,n)&&rv(e,t)}const Un={toString:Oh,toDate:N6,makeSDate:F6,makeEDate:B6,"===":V2,">":d1,">=":tv,"<":nv,"<=":rv,"s<d<e|e<d<s":Z2,"s<=d<=e|e<=d<=s":X2,eq:V2,g:d1,ge:tv,l:nv,le:rv,b:Z2,be:X2},z6="_InputContainer_16eoo_7",H6="_AInput_16eoo_21",W6="_LeftAddon_16eoo_43",U6="_RightAddon_16eoo_50",G6="_ErrorHelperText_16eoo_57",Y6="_Primary_16eoo_61",V6="_UnAvailable_16eoo_66",Z6="_Secondary_16eoo_77",X6="_ReadOnly_16eoo_92",K6="_ANumInputUnitSelect_16eoo_108",ou={InputContainer:z6,AInput:H6,LeftAddon:W6,RightAddon:U6,ErrorHelperText:G6,Primary:Y6,UnAvailable:V6,Secondary:Z6,ReadOnly:X6,Error:"_Error_16eoo_57",ANumInputUnitSelect:K6},J6=["Primary","Secondary","ReadOnly","Error"],sg=n=>{const{onEnterPress:e,type:t="Primary",inputRef:r,useValue:i,isReadonly:o,placeholder:l,minLength:a,maxLength:h,tabIndex:g,autoFocus:m,isPassword:x,autoComplete:w="off",inputProps:_,LeftAddon:S,RightAddon:R,dataList:k=[],pattern:O,id:P=(_==null?void 0:_.id)??Cm.uuid(),...z}=n,[{wrapId:H,wrapProps:G,labelProps:N,...J},Y]=Bg(z),K=B.useMemo(()=>Q6(J.errorMessage)?"Error":t,[J.errorMessage,t]),fe=B.useMemo(()=>K==="ReadOnly"?!0:o,[K,o]),X=B.useMemo(()=>Y.isDisabled||Y.isLoading,[Y.isDisabled,Y.isLoading]),[te,ne]=Fo(i,""),ue=B.useCallback($=>{var re;X||((re=_==null?void 0:_.onKeyDown)==null||re.call(_,$),["Escape","Enter","ArrowUp","ArrowDown"].includes($.key)||$.stopPropagation(),$.key==="Enter"&&e&&e($.currentTarget.value))},[X,_,e]),se=B.useCallback($=>{var re;X||a&&$.target.value.length<a||(ne==null||ne($.target.value),(re=_==null?void 0:_.onChange)==null||re.call(_,$))},[X,a,ne,_]);return x?M.jsx(lg,{wrapId:H,wrapProps:G,labelProps:N,...J,children:M.jsx("form",{onSubmit:$=>$.preventDefault(),children:M.jsxs(zi,{...Y,className:dt.clsx(ou.InputContainer,ou[K],X&&ou.UnAvailable,Y.className),children:[S&&M.jsx("div",{className:ou.LeftAddon,children:S}),M.jsx("input",{..._,ref:r,autoComplete:w,autoFocus:m,className:dt.clsx(ou.AInput,K==="Error"&&ou.InputError,_==null?void 0:_.className),id:P,list:`${P}-datalist`,maxLength:h,placeholder:l,readOnly:fe,tabIndex:Y.isDisabled||Y.isLoading?-1:g,type:"password",value:te,onChange:se,onKeyDown:ue}),k.length>0&&M.jsx("datalist",{id:`${P}-datalist`,children:k.map(($,re)=>M.jsx("option",{value:$},re))}),R&&M.jsx("div",{className:dt.clsx(ou.RightAddon,"NoSelect"),children:R})]})})}):M.jsx(lg,{wrapId:H,wrapProps:G,labelProps:N,...J,children:M.jsxs(zi,{...Y,className:dt.clsx(ou.InputContainer,ou[K],X&&ou.UnAvailable,Y.className),children:[S&&M.jsx("div",{className:ou.LeftAddon,children:S}),M.jsx("input",{..._,ref:r,autoComplete:w,autoFocus:m,className:dt.clsx(ou.AInput,K==="Error"&&ou.InputError,_==null?void 0:_.className),id:P,list:`${P}-datalist`,maxLength:h,pattern:O,placeholder:l,readOnly:fe,tabIndex:Y.isDisabled||Y.isLoading?-1:g,value:te,onChange:se,onKeyDown:ue}),k.length>0&&M.jsx("datalist",{id:`${P}-datalist`,children:k.map(($,re)=>M.jsx("option",{value:$},re))}),R&&M.jsx("div",{className:ou.RightAddon,children:R})]})})};function Q6(n){return Array.isArray(n)?n.filter(Boolean).length>0:!!n}const q6="_ASelect_1gbzd_1",j6="_Arrow_1gbzd_14",$6="_Primary_1gbzd_23",eR="_UnAvailable_1gbzd_34",tR="_IsOpen_1gbzd_34",nR="_Secondary_1gbzd_41",rR="_Placeholder_1gbzd_57",iR="_ValuesContainer_1gbzd_61",oR="_Values_1gbzd_61",lR="_Options_1gbzd_80",sR="_Raw_1gbzd_93",aR="_Option_1gbzd_80",cR="_Selected_1gbzd_122",uR="_CheckBox_1gbzd_129",Df={ASelect:q6,Arrow:j6,Primary:$6,UnAvailable:eR,IsOpen:tR,Secondary:nR,Placeholder:rR,ValuesContainer:iR,Values:oR,Options:lR,Raw:sR,Option:aR,Selected:cR,CheckBox:uR},fR=["Primary","Secondary","Raw"],Td=n=>{const{options:e,useSelect:t,type:r="Primary",placeholder:i=Or.ASelect["Select(Placeholder)"],onClose:o,OptionRenderer:l=dR,SelectedRenderer:a=gR,minShowRows:h=2,maxShowRows:g=6,arrowProps:m,isAutoWidth:x=!1,...w}=n,_=B.useRef(null),S=B.useMemo(()=>w.abaseRef??_,[w.abaseRef]),R=B.useRef(null),[k,O]=Fo(t,e[0]),[P,z]=B.useState(void 0),[H,G]=B.useState(!1),[N,J]=B.useState(!1),Y=B.useRef(e),K=B.useRef(null),fe=B.useCallback(()=>J(!1),[]),X=B.useCallback(()=>{w.isDisabled||w.isLoading||e.length<1||(J(!0),setTimeout(()=>G(!0),0),setTimeout(()=>ob(R,S,e,h,g),0))},[S,w.isDisabled,w.isLoading,e,h,g]),te=B.useCallback(()=>{G(!1),J(!0),o==null||o()},[o]),ne=B.useCallback(oe=>{var Q;H?te():X(),setTimeout(()=>ob(R,S,e,h,g),0),(Q=w.onClick)==null||Q.call(w,oe)},[S,w,e,H,te,X,h,g]),ue=B.useCallback(()=>{ob(R,S,e,h,g)},[S,e,h,g]);B.useEffect(()=>{if(!H||!S.current)return;const oe=S.current;let Q=oe.parentElement;for(;Q;)Q.addEventListener("scroll",ue),Q=Q.parentElement;return()=>{let pe=oe.parentElement;for(;pe;)pe.removeEventListener("scroll",ue),pe=pe.parentElement}},[S,H,ue]),B.useEffect(()=>{if(H)return window.addEventListener("resize",ue),()=>window.removeEventListener("resize",ue)},[H,ue]);const se=B.useCallback(oe=>{oe[0].intersectionRatio===0&&te()},[te]);B.useEffect(()=>{if(!H)return;const oe=new IntersectionObserver(se,{threshold:0});return S.current&&oe.observe(S.current),()=>oe.disconnect()},[S,H,se]);const $=B.useCallback(oe=>{const Q=oe.target,pe=S.current,Ie=R.current;!pe||!Q||!Ie||!pe.contains(Q)&&!Ie.contains(Q)&&te()},[S,te]),re=B.useMemo(()=>w.isDisabled||w.isLoading||e.length<1,[w.isDisabled,w.isLoading,e]);B.useEffect(()=>{if(H)return setTimeout(()=>document.addEventListener("mousedown",$),0),()=>document.removeEventListener("mousedown",$)},[H,$]);const ge=B.useCallback((oe,Q)=>{oe.stopPropagation(),oe.preventDefault(),O==null||O(Q),te()},[O,te]),me=B.useCallback(()=>{if(!x||!S.current)return;const oe=kg.calculateOptimalSelectWidth({elementRef:S,options:e,selectedOption:k,placeholder:i,optionRenderer:Q=>Q===null?null:l({option:Q}),type:r,isMulti:!1});z(oe)},[x,S,e,k,i,l,r]);return B.useEffect(()=>x?((e!==Y.current||P===void 0)&&(K.current!==null&&cancelAnimationFrame(K.current),K.current=requestAnimationFrame(()=>{me(),K.current=null,Y.current=[...e]})),()=>{K.current!==null&&(cancelAnimationFrame(K.current),K.current=null)}):void 0,[x,e,me,P]),B.useEffect(()=>()=>{typeof kg.clearCache=="function"&&kg.clearCache()},[]),M.jsxs(M.Fragment,{children:[M.jsxs(zi,{...w,abaseRef:S,isDisabled:w.isDisabled||e.length<1,className:dt.clsx(w.className,Df.ASelect,"NoSelect",H&&Df.IsOpen,re&&Df.UnAvailable,Df[r]),style:{padding:r==="Secondary"?"8px 8px 8px 0":0,width:P?`${P}px`:x?"100px":void 0,...w.style},onClick:ne,children:[M.jsx("div",{className:Df.ValuesContainer,children:M.jsx("div",{className:dt.clsx(Df.Values,(k==null||k==="")&&Df.Placeholder),children:M.jsx(a,{OptionRenderer:l,placeholder:i,selectedOption:k})})}),M.jsx("div",{...m,className:dt.clsx(Df.Arrow,m==null?void 0:m.className),children:M.jsx(fo,{icon:"TriangleDown",style:{transform:H?"rotate(180deg)":"",transition:"var(--Transition)"}})})]}),e.length>0&&(H||N)&&su.createPortal(M.jsx("div",{ref:R,className:dt.clsx(Df.Options,Df[r]),style:{opacity:+H,visibility:H?"visible":"hidden",pointerEvents:H?void 0:"none",borderRadius:S.current?window.getComputedStyle(S.current).borderRadius:void 0,width:P?`${P}px`:x?"100px":void 0},onTransitionEnd:fe,children:e.map((oe,Q)=>{const pe=k===oe,Ie=S.current?window.getComputedStyle(S.current):void 0;return oe===null?null:M.jsx("div",{className:dt.clsx(Df.Option,pe&&Df.Selected,"NoSelect",Df[r]),style:{height:Ie==null?void 0:Ie.height},onClick:Fe=>ge(Fe,oe),children:M.jsx(l,{option:oe})},Q)})}),document.body)]})};function ob(n,e,t,r,i){if(!e.current||!n.current||!t||t.length<1)return;const o=e.current.getBoundingClientRect(),l=hR(o,t.length,r,i),a=window.getComputedStyle(e.current);n.current.style.top=`calc(${l.top??0}px - ${a.borderTopWidth})`,n.current.style.bottom=l.bottom?l.bottom+"px":"",n.current.style.left=l.left+"px",n.current.style.width||(n.current.style.minWidth=l.minWidth+"px"),n.current.style.minHeight=l.minHeight+"px",n.current.style.maxHeight=l.maxHeight+"px",n.current.style.visibility="visible"}function hR(n,e,t,r){const i={top:n.bottom,bottom:void 0,left:n.left,height:"fit-content",minWidth:n.width,minHeight:n.height*Math.min(t,e),maxHeight:n.height*r>window.innerHeight-n.bottom-10?window.innerHeight-n.bottom-10:n.height*r};return window.innerHeight-n.bottom-10<i.height&&(window.innerHeight-n.bottom-10<i.minHeight?(i.top=n.top-e*n.height,i.top<0&&(i.top=10,i.minHeight=n.top-10,i.height=n.top-10)):i.height=window.innerHeight-n.bottom-10),i}const dR=n=>{const{option:e}=n;return $n.isReactNode(e)?e:null},gR=n=>{const e=Gn.c(3),{selectedOption:t,OptionRenderer:r,placeholder:i}=n;if(t==null||t==="")return i;const o=t;let l;return e[0]!==r||e[1]!==o?(l=M.jsx(r,{option:o}),e[0]=r,e[1]=o,e[2]=l):l=e[2],l},pR="_Anchor_1l5ql_1",vR="_Primary_1l5ql_18",bR="_Secondary_1l5ql_21",yR="_Placeholder_1l5ql_25",mR="_Icon_1l5ql_30",xR="_ADatePicker_1l5ql_40",wR="_StringInputWrap_1l5ql_51",CR="_StringInputContainer_1l5ql_56",_R="_StringInput_1l5ql_51",SR="_IsIdx_1l5ql_71",ER="_CalendarContainer_1l5ql_75",TR="_Header_1l5ql_81",AR="_Prev_1l5ql_85",RR="_Next_1l5ql_86",IR="_MonthYear_1l5ql_119",kR="_Select_1l5ql_124",MR="_Calendar_1l5ql_75",LR="_Cell_1l5ql_134",OR="_IsNotCurrentMonth_1l5ql_146",PR="_IsSelected_1l5ql_150",DR="_IsDisabled_1l5ql_154",NR="_IsHovered_1l5ql_157",FR="_Week_1l5ql_161",BR="_WeekDay_1l5ql_166",Vo={Anchor:pR,Primary:vR,Secondary:bR,Placeholder:yR,Icon:mR,ADatePicker:xR,StringInputWrap:wR,StringInputContainer:CR,StringInput:_R,String:"_String_1l5ql_51",IsIdx:SR,CalendarContainer:ER,Header:TR,Prev:AR,Next:RR,MonthYear:IR,Select:kR,Calendar:MR,Cell:LR,IsNotCurrentMonth:OR,IsSelected:PR,IsDisabled:DR,IsHovered:NR,Week:FR,WeekDay:BR},zR="_Anchor_5u6hq_1",HR="_Primary_5u6hq_18",WR="_Secondary_5u6hq_22",UR="_Placeholder_5u6hq_26",GR="_Icon_5u6hq_31",YR="_ADateRangePicker_5u6hq_41",VR="_StringInputWrap_5u6hq_52",ZR="_StringInputContainer_5u6hq_56",XR="_StringInput_5u6hq_52",KR="_IsIdx_5u6hq_72",JR="_CalendarContainer_5u6hq_76",QR="_Header_5u6hq_82",qR="_Prev_5u6hq_86",jR="_Next_5u6hq_87",$R="_MonthYear_5u6hq_120",e8="_Select_5u6hq_125",t8="_Calendar_5u6hq_76",n8="_Cell_5u6hq_135",r8="_IsNotCurrentMonth_5u6hq_147",i8="_IsSelected_5u6hq_151",o8="_IsDisabled_5u6hq_155",l8="_IsHovered_5u6hq_158",s8="_Week_5u6hq_162",a8="_WeekDay_5u6hq_167",c8="_ChoiceButton_5u6hq_171",Xi={Anchor:zR,Primary:HR,Secondary:WR,Placeholder:UR,Icon:GR,ADateRangePicker:YR,StringInputWrap:VR,StringInputContainer:ZR,StringInput:XR,String:"_String_5u6hq_52",IsIdx:KR,CalendarContainer:JR,Header:QR,Prev:qR,Next:jR,MonthYear:$R,Select:e8,Calendar:t8,Cell:n8,IsNotCurrentMonth:r8,IsSelected:i8,IsDisabled:o8,IsHovered:l8,Week:s8,WeekDay:a8,ChoiceButton:c8},_m=n=>{const{type:e="Primary",className:t,useDateRange:r,actionRef:i,position:o=O1.SE,minDate:l,maxDate:a,isDisabled:h,isLoading:g,yearsOptionSize:m,noDefaultChoices:x,LeftAddon:w,RightAddon:_,placeholder:S,noClearButton:R,resources:k,onClick:O,...P}=n,z=B.useMemo(()=>({...Or.ADateRangePicker,...k}),[k]),H=B.useMemo(()=>S??z["Select DateRange"],[S,z]),[G,N]=B.useMemo(()=>{let Ce,it;if(l&&(Ce=Un.makeSDate(l)),a&&(it=Un.makeEDate(a)),Ce&&it&&Un["<"](it,Ce)){console.warn("ADateRangePicker: maxDate should be greater than minDate. maxDate and minDate are swapped.");const Ct=Ce;Ce=it,it=Ct}return[Ce,it]},[l,a]),[J,Y]=B.useState("sD"),[K,fe]=Fo(r,void 0),X=B.useCallback(Ce=>{fe&&(Ce===void 0?(fe(void 0),rt(""),qe("")):(fe({sDate:Un.makeSDate(Ce.sDate),eDate:Un.makeEDate(Ce.eDate)}),rt(Un.toString(Ce.sDate)),qe(Un.toString(Ce.eDate))))},[fe]);B.useEffect(()=>{K&&(rt(Un.toString(K.sDate)),qe(Un.toString(K.eDate)))},[K]);const te=B.useCallback(Ce=>{if(!fe)return;let it=K?K.sDate:Un.makeSDate(Ce);Ce=Un.makeEDate(Ce),fe({sDate:it,eDate:Ce}),rt(Un.toString(it)),qe(Un.toString(Ce))},[fe,K]),[ne,ue]=B.useState(),[se,$]=B.useState(),re=B.useCallback(Ce=>{J==="sD"&&X({sDate:Ce,eDate:Ce}),ue(Ce),$(Ce)},[J,X,ue]),ge=B.useCallback(Ce=>{J==="sD"?ne&&(Un.eq(ne,Ce)?Y("eD"):Un[">"](Ce,ne)?(te(Ce),ue(void 0)):(X({sDate:Ce,eDate:ne}),ue(void 0))):(K?Un["<"](Ce,K.sDate)?X({sDate:Ce,eDate:K.eDate}):te(Ce):X({sDate:Ce,eDate:Ce}),ue(void 0),Y("sD"))},[te,ne,Y,J,X,K,ue]),me=B.useCallback(Ce=>{ne&&$(Ce)},[ne]),oe=B.useCallback(()=>{$(void 0),ue(void 0),Y("sD")},[Y,ue]),[Q,pe]=B.useState(K2(K,G,N)),Ie=B.useMemo(()=>Sm(Q.year,G,N,m),[Q.year,G,N,m]),Fe=B.useMemo(()=>Ap(Q.year,G,N),[G,N,Q.year]),xe=B.useCallback(Ce=>{if(!Ie.includes(Ce))return;const it={month:Q.month,year:Ce},Ct=Ap(it.year,G,N);Ct.length<1||(Ct.includes(it.month)||(it.month<Ct[0]?it.month=Ct[0]:it.month>Ct[Ct.length-1]&&(it.month=Ct[Ct.length-1])),pe(it))},[G,N,Ie,Q.month]),Oe=B.useCallback(Ce=>{Fe.includes(Ce)&&pe({month:Ce,year:Q.year})},[Fe,Q.year]),Le=B.useMemo(()=>N?new Date(Q.year,Q.month+1,1)>N:!1,[Q,N]),He=B.useCallback(()=>{if(Le||Fe.length<1)return;const Ce=Q.month+1;Ce>11?pe({month:Fe[0],year:Q.year+1}):pe({month:Ce,year:Q.year})},[Le,Fe,Q]),Te=B.useMemo(()=>G?new Date(Q.year,Q.month,0)<G:!1,[Q,G]),ke=B.useCallback(()=>{if(Te||Fe.length<1)return;const Ce=Q.month-1;Ce<Fe[0]?pe({month:Fe[Fe.length-1],year:Q.year-1}):pe({month:Ce,year:Q.year})},[Te,Fe,Q]),[Be,rt]=B.useState(K!=null&&K.sDate?Un.toString(K.sDate):""),Re=B.useCallback(Ce=>{if(Ce.length>10||(rt(Ce),Ce.length<10)||!fe)return;let it=Un.toDate(Ce);if(!it)return;G&&it<G&&(it=G),N&&it>N&&(it=N);let Ct=K?K.eDate:it;K&&Un[">"](it,Ct)&&([it,Ct]=J2(it,Ct)),X({sDate:it,eDate:Ct}),pe({month:it.getMonth(),year:it.getFullYear()})},[fe,X,K,G,N]),[ut,qe]=B.useState(K!=null&&K.eDate?Un.toString(K.eDate):""),ot=B.useCallback(Ce=>{if(Ce.length>10||(qe(Ce),Ce.length<10)||!fe)return;let it=Un.toDate(Ce);if(!it)return;G&&it<G&&(it=G),N&&it>N&&(it=N);let Ct=K?K.sDate:it;K&&Un[">"](Ct,it)&&([Ct,it]=J2(Ct,it)),X({sDate:Ct,eDate:it}),pe({month:it.getMonth(),year:it.getFullYear()})},[fe,X,K,G,N]),st=B.useCallback(()=>{K&&(rt(Un.toString(K.sDate)),qe(Un.toString(K.eDate)))},[K]),bt=B.useMemo(()=>{const{month:Ce,year:it}=Q,Ct=new Date(it,Ce,1),Qt=new Date(it,Ce+1,0),Yt=[];for(let gn=0;gn<Ct.getDay();gn++){const kt=new Date(it,Ce,0).getDate()-Ct.getDay()+gn+1,vt=new Date(it,Ce-1,kt),zt=G&&G>vt||N&&N<vt,Lt=K?Un.be(K.sDate,vt,K.eDate):!1,yt=se&&K&&Un.be(K.sDate,vt,se);Yt.push({day:kt,isSelected:Lt,isHovered:yt,date:vt,isDisabled:zt,isCurrentMonth:!1})}for(let gn=1;gn<=Qt.getDate();gn++){const lt=new Date(it,Ce,gn),kt=G&&G>lt||N&&N<lt,vt=K?Un.be(K.sDate,lt,K.eDate):!1,zt=se&&K&&Un.be(K.sDate,lt,se);Yt.push({day:gn,isSelected:vt,isHovered:zt,date:lt,isDisabled:kt,isCurrentMonth:!0})}for(let gn=0;gn<7-Qt.getDay()-1;gn++){const lt=new Date(it,Ce+1,gn+1),kt=G&&G>lt||N&&N<lt,vt=K?Un.be(K.sDate,lt,K.eDate):!1,zt=se&&K&&Un.be(K.sDate,lt,se);Yt.push({day:gn+1,isSelected:vt,isHovered:zt,date:lt,isDisabled:kt,isCurrentMonth:!1})}const yn=[];for(let gn=0;gn<Yt.length/7;gn++)yn.push(M.jsx("div",{className:Xi.Week,children:Yt.slice(gn*7,gn*7+7).map((lt,kt)=>M.jsx(Ic,{isDisabled:lt.isDisabled,type:"Raw",className:dt.clsx(Xi.Cell,lt.isDisabled?Xi.IsDisabled:lt.isCurrentMonth?lt.isSelected?Xi.IsSelected:lt.isHovered&&Xi.IsHovered:Xi.IsNotCurrentMonth),onMouseDown:()=>lt.isCurrentMonth&&re(lt.date),onMouseEnter:()=>lt.isCurrentMonth&&me(lt.date),onMouseUp:()=>lt.isCurrentMonth&&ge(lt.date),children:lt.day},kt))},gn));return yn},[Q,se,K,G,N,re,ge,me]),Mt=B.useRef(null),Bt=B.useCallback(()=>{Mt&&mm(Mt,gt,o)},[Mt,o]),[at,Ye]=B.useState(!1),[Tt,Ut]=B.useState(!1),gt=B.useRef(null),Ht=B.useCallback(()=>{h||g||(Ye(!0),setTimeout(()=>Ut(!0),0),setTimeout(()=>Bt(),0),pe(K2(K,G,N)))},[h,g,K,Bt,G,N]),xt=B.useCallback(()=>{h||g||(Ye(!0),Ut(!1))},[h,g]),pn=B.useMemo(()=>Tt?xt:Ht,[Tt,Ht,xt]),$t=B.useCallback(()=>Ye(!1),[]),sn=B.useCallback(Ce=>{const it=document.getElementById("root"),Ct=Ce.target,Qt=gt.current,Yt=Mt.current;!it||!Qt||!Ct||!Yt||!Qt.contains(Ct)&&it.contains(Ct)&&!Yt.contains(Ct)&&xt()},[xt]);B.useEffect(()=>{if(Tt)return setTimeout(()=>document.addEventListener("mousedown",sn),0),()=>document.removeEventListener("mousedown",sn)},[Tt,sn]);const Xt=B.useCallback(()=>{Bt()},[Bt]);B.useEffect(()=>{if(!Tt||!(Mt!=null&&Mt.current))return;const Ce=Mt.current;let it=Ce.parentElement;for(;it;)it.addEventListener("scroll",Xt),it=it.parentElement;return()=>{let Ct=Ce.parentElement;for(;Ct;)Ct.removeEventListener("scroll",Xt),Ct=Ct.parentElement}},[Mt,Tt,Xt]),B.useEffect(()=>{if(Tt)return window.addEventListener("resize",Xt),()=>window.removeEventListener("resize",Xt)},[Tt,Xt]);const bn=B.useCallback(Ce=>{Ce[0].intersectionRatio===0&&xt()},[xt]);B.useEffect(()=>{if(!Tt)return;const Ce=new IntersectionObserver(bn,{threshold:0});return gt.current&&Ce.observe(gt.current),()=>Ce.disconnect()},[gt,Tt,bn]),B.useEffect(()=>{i&&(i.current={open:Ht,close:xt,toggle:pn})},[i,Ht,xt,pn]),B.useEffect(()=>{if(!K)return;let Ce={sDate:K.sDate,eDate:K.eDate};G&&(Un["<"](K.sDate,G)&&(Ce.sDate=G),Un["<"](K.eDate,G)&&(Ce.eDate=G)),N&&(Un[">"](K.sDate,N)&&(Ce.sDate=N),Un[">"](K.eDate,N)&&(Ce.eDate=N)),(Ce.sDate!==K.sDate||Ce.eDate!==K.eDate)&&X(Ce)},[G,N,K,X]);const hn=B.useCallback(Ce=>{O==null||O(Ce),pn()},[O,pn]),Rn=B.useCallback(Ce=>{X(void 0),xt(),Ce.stopPropagation()},[X,xt]),vn=B.useCallback(()=>K?M.jsx(ba,{icon:"Close",style:{scale:"0.8"},type:"Raw",onClick:Rn}):null,[K,Rn]),We=B.useMemo(()=>K?`${Un.toString(K.sDate)} ~ ${Un.toString(K.eDate)}`:M.jsx("span",{className:Xi.Placeholder,children:H}),[K,H]);return M.jsxs(M.Fragment,{children:[M.jsxs(zi,{...P,abaseRef:Mt,className:dt.clsx(Xi.Anchor,"IsClickable",Xi[e],t),isDisabled:h,isLoading:g,onClick:hn,children:[w,M.jsxs(B.Activity,{mode:e==="Primary"?"visible":"hidden",children:[M.jsx(fo,{className:dt.clsx(Xi.Icon,Xi[e]),icon:"CalendarDay"}),M.jsx(cs,{w:4})]}),We,M.jsx(zg,{}),M.jsx(B.Activity,{mode:R?"hidden":"visible",children:M.jsx(vn,{})}),M.jsx(B.Activity,{mode:e==="Secondary"?"visible":"hidden",children:M.jsx(fo,{className:dt.clsx(Xi.Icon,Xi[e]),icon:"CalendarDay"})}),M.jsx(B.Activity,{mode:_?"visible":"hidden",children:_})]}),(Tt||at)&&su.createPortal(M.jsxs("div",{ref:gt,className:Xi.ADateRangePicker,style:{opacity:+Tt,visibility:Tt?"visible":"hidden"},onMouseLeave:oe,onTransitionEnd:$t,children:[M.jsxs("div",{className:Xi.StringInputContainer,children:[M.jsxs(Ml,{children:[M.jsx(sg,{className:dt.clsx(Xi.String,J==="sD"&&se&&Xi.IsIdx),inputProps:{className:Xi.StringInput},maxLength:11,placeholder:"YYYY-MM-DD",useValue:[Be,Re],wrapProps:{className:Xi.StringInputWrap},onBlur:st}),M.jsx(cs,{w:8}),M.jsx(sg,{className:dt.clsx(Xi.String,J==="eD"&&se&&Xi.IsIdx),inputProps:{className:Xi.StringInput},maxLength:11,placeholder:"YYYY-MM-DD",useValue:[ut,ot],wrapProps:{className:Xi.StringInputWrap},onBlur:st})]}),!x&&M.jsxs(Ml,{style:{marginTop:4},children:[M.jsx(f0,{children:z["1일"],onClick:()=>X({sDate:new Date,eDate:new Date})}),M.jsx(f0,{children:z["1주일"],onClick:()=>X({sDate:new Date(new Date().setDate(new Date().getDate()-7)),eDate:new Date})}),M.jsx(f0,{children:z["1개월"],onClick:()=>X({sDate:new Date(new Date().setMonth(new Date().getMonth()-1)),eDate:new Date})}),M.jsx(f0,{children:z["3개월"],onClick:()=>X({sDate:new Date(new Date().setMonth(new Date().getMonth()-3)),eDate:new Date})})]})]}),M.jsxs("div",{className:Xi.CalendarContainer,children:[M.jsxs(Ml,{className:Xi.Header,children:[M.jsx(Ic,{className:Xi.Prev,isDisabled:Te,type:"Raw",onClick:ke}),M.jsxs("div",{className:Xi.MonthYear,children:[M.jsx(Td,{isAutoWidth:!0,className:Xi.Select,OptionRenderer:Ce=>z.months(Ce.option),options:Fe,SelectedRenderer:Ce=>z.months(Ce.selectedOption),type:"Secondary",useSelect:[Q.month,Oe]}),M.jsx(cs,{w:8}),M.jsx(Td,{isAutoWidth:!0,className:Xi.Select,options:Ie,type:"Secondary",useSelect:[Q.year,xe]})]}),M.jsx(Ic,{className:Xi.Next,isDisabled:Le,type:"Raw",onClick:He})]}),M.jsx(cs,{h:10}),M.jsxs("div",{className:Xi.Calendar,children:[M.jsx("div",{className:Xi.Week,children:[0,1,2,3,4,5,6].map(Ce=>M.jsx("div",{className:dt.clsx(Xi.WeekDay,Xi.Cell),children:z.weekDays(Ce)},Ce))}),bt]})]})]}),document.body)]})};function Ap(n,e,t){let r=0;e&&e.getFullYear()===n&&(r=e.getMonth());let i=11;t&&t.getFullYear()===n&&(i=t.getMonth());const o=[];for(let l=r;l<=i;l++)o.push(l);return o}function Sm(n,e,t,r=5){const i=[];let o=n-r/2+r%2/2;e&&o<e.getFullYear()&&(o=e.getFullYear());let l=o+r-1;t&&l>t.getFullYear()&&(l=t.getFullYear());for(let a=o;a<=l;a++)i.push(a);return i}function K2(n,e,t){return n??(n={sDate:new Date,eDate:new Date}),e&&Un["<"](n.sDate,e)?{month:e.getMonth(),year:e.getFullYear()}:t&&Un[">"](n.eDate,t)?{month:t.getMonth(),year:t.getFullYear()}:{month:n.sDate.getMonth(),year:n.sDate.getFullYear()}}function J2(n,e){return[e,n]}const f0=n=>{const e=Gn.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=dt.clsx(Xi.ChoiceButton,"Headline2"),e[0]=t):t=e[0];let r;return e[1]!==n?(r=M.jsx(Ic,{className:t,type:"Secondary",...n}),e[1]=n,e[2]=r):r=e[2],r},u8=["Primary","Secondary","Raw"],Em=n=>{const e=Gn.c(255);let t,r,i,o,l,a,h,g,m,x,w,_,S,R,k,O;e[0]!==n?({type:R,className:l,useDate:O,actionRef:o,position:k,minDate:h,maxDate:a,isDisabled:w,isLoading:_,placeholder:m,LeftAddon:t,RightAddon:r,resources:x,noClearButton:S,onClick:g,...i}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S,e[14]=R,e[15]=k,e[16]=O):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13],R=e[14],k=e[15],O=e[16]);const P=R===void 0?"Primary":R,z=k===void 0?O1.SE:k;let H;e[17]!==x?(H={...Or.ADatePicker,...x},e[17]=x,e[18]=H):H=e[18];const G=H,N=m??G["Select Date"];let J;if(e[19]!==a||e[20]!==h){e:{let cn,Cn;if(h&&(cn=Un.makeSDate(h)),a&&(Cn=Un.makeEDate(a)),cn&&Cn&&Un["<"](Cn,cn)){console.warn("ADatePicker: maxDate should be greater than minDate. maxDate and minDate are swapped."),J=[Un.makeSDate(Cn),Un.makeEDate(cn)];break e}let Pr;e[22]!==Cn||e[23]!==cn?(Pr=[cn,Cn],e[22]=Cn,e[23]=cn,e[24]=Pr):Pr=e[24],J=Pr}e[19]=a,e[20]=h,e[21]=J}else J=e[21];const[Y,K]=J,[fe,X]=Fo(O,null);let te;e[25]!==fe?(te=fe?Un.toString(fe):"",e[25]=fe,e[26]=te):te=e[26];const[ne,ue]=B.useState(te);let se;e[27]!==K||e[28]!==Y||e[29]!==fe?(se=()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getMonth():K&&cn>K?K.getMonth():(cn??new Date).getMonth()},e[27]=K,e[28]=Y,e[29]=fe,e[30]=se):se=e[30];const[$,re]=B.useState(se);let ge;e[31]!==K||e[32]!==Y||e[33]!==fe?(ge=()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getFullYear():K&&cn>K?K.getFullYear():(cn??new Date).getFullYear()},e[31]=K,e[32]=Y,e[33]=fe,e[34]=ge):ge=e[34];const[me,oe]=B.useState(ge);let Q;e[35]!==K||e[36]!==Y||e[37]!==$?(Q=cn=>{oe(cn);const Cn=Ap(cn,Y,K);Cn.includes($)||($<Cn[0]?re(Cn[0]):$>Cn[Cn.length-1]&&re(Cn[Cn.length-1]))},e[35]=K,e[36]=Y,e[37]=$,e[38]=Q):Q=e[38];const pe=Q;let Ie;e[39]!==K||e[40]!==Y||e[41]!==X?(Ie=cn=>{if(cn.length>10||(ue(cn),cn.length<10)||!X)return;let Cn=Un.toDate(cn);Cn&&(Y&&Cn<Y&&(Cn=Y),K&&Cn>K&&(Cn=K),X(Cn),oe(Cn.getFullYear()),re(Cn.getMonth()))},e[39]=K,e[40]=Y,e[41]=X,e[42]=Ie):Ie=e[42];const Fe=Ie;let xe;e[43]!==me?(xe=cn=>{const Cn=me+cn;Cn<0||oe(Cn)},e[43]=me,e[44]=xe):xe=e[44];const Oe=xe;let Le;e[45]!==$||e[46]!==Oe?(Le=cn=>{const Cn=$+cn;Cn<0?(re(11),Oe(-1)):Cn>11?(re(0),Oe(1)):re(Cn)},e[45]=$,e[46]=Oe,e[47]=Le):Le=e[47];const He=Le;let Te;e[48]!==X?(Te=cn=>{X&&(cn===void 0?(X(void 0),ue("")):(X(cn),ue(Un.toString(cn))))},e[48]=X,e[49]=Te):Te=e[49];const ke=Te;let Be;e[50]!==$||e[51]!==me?(Be=new Date(me,$,0),e[50]=$,e[51]=me,e[52]=Be):Be=e[52];const Re=Y&&Be<Y,ut=$+1;let qe;e[53]!==ut||e[54]!==me?(qe=new Date(me,ut,1),e[53]=ut,e[54]=me,e[55]=qe):qe=e[55];const st=K&&qe>K;let bt;e[56]!==Re||e[57]!==He?(bt=()=>{Re||He(-1)},e[56]=Re,e[57]=He,e[58]=bt):bt=e[58];const Mt=bt;let Bt;e[59]!==st||e[60]!==He?(Bt=()=>{st||He(1)},e[59]=st,e[60]=He,e[61]=Bt):Bt=e[61];const at=Bt,[Ye,Tt]=B.useState(null);let Ut;e[62]!==X?(Ut=()=>{X&&Tt(null)},e[62]=X,e[63]=Ut):Ut=e[63];const gt=Ut;let Ht;e[64]!==X?(Ht=cn=>{X&&Tt(cn)},e[64]=X,e[65]=Ht):Ht=e[65];const xt=Ht;let pn;if(e[66]!==ke||e[67]!==Ye||e[68]!==K||e[69]!==Y||e[70]!==$||e[71]!==xt||e[72]!==gt||e[73]!==fe||e[74]!==me){const cn=new Date(me,$,1),Cn=new Date(me,$+1,0),Pr=[];for(let fr=0;fr<cn.getDay();fr++){const Nr=new Date(me,$,0).getDate()-cn.getDay()+fr+1,Er=new Date(me,$-1,Nr),gi=Y&&Y>Er||K&&K<Er,Ri=fe&&Un.eq(Er,fe),Dr=Ye&&Un.eq(Er,Ye);Pr.push({day:Nr,isSelected:Ri,date:Er,isDisabled:gi,isHovered:Dr,isCurrentMonth:!1})}for(let fr=1;fr<=Cn.getDate();fr++){const ar=new Date(me,$,fr),Nr=Y&&Y>ar||K&&K<ar,Er=fe&&Un.eq(ar,fe),gi=Ye&&Un.eq(ar,Ye);Pr.push({day:fr,isSelected:Er,date:ar,isDisabled:Nr,isHovered:gi,isCurrentMonth:!0})}for(let fr=0;fr<7-Cn.getDay()-1;fr++){const ar=new Date(me,$+1,fr+1),Nr=Y&&Y>ar||K&&K<ar,Er=fe&&Un.eq(ar,fe),gi=Ye&&Un.eq(ar,Ye);Pr.push({day:fr+1,isSelected:Er,date:ar,isDisabled:Nr,isHovered:gi,isCurrentMonth:!1})}pn=[];for(let fr=0;fr<Pr.length/7;fr++)pn.push(M.jsx("div",{className:Vo.Week,children:Pr.slice(fr*7,fr*7+7).map((ar,Nr)=>M.jsx(Ic,{isDisabled:ar.isDisabled,type:"Raw",className:dt.clsx(Vo.Cell,ar.isDisabled?Vo.IsDisabled:ar.isCurrentMonth?ar.isSelected?Vo.IsSelected:ar.isHovered&&Vo.IsHovered:Vo.IsNotCurrentMonth),onClick:()=>ar.isCurrentMonth&&ke(ar.date),onMouseEnter:()=>ar.isCurrentMonth&&xt(ar.date),onMouseLeave:()=>ar.isCurrentMonth&&gt(),children:ar.day},Nr))},fr));e[66]=ke,e[67]=Ye,e[68]=K,e[69]=Y,e[70]=$,e[71]=xt,e[72]=gt,e[73]=fe,e[74]=me,e[75]=pn}else pn=e[75];const $t=pn,sn=B.useRef(null);let Xt;e[76]!==z?(Xt=()=>{sn&&mm(sn,Ce,z)},e[76]=z,e[77]=Xt):Xt=e[77];const bn=Xt,[hn,Rn]=B.useState(!1),[vn,We]=B.useState(!1),Ce=B.useRef(null);let it;e[78]!==bn||e[79]!==w||e[80]!==_||e[81]!==K||e[82]!==Y||e[83]!==fe?(it=()=>{w||_||(Rn(!0),setTimeout(()=>We(!0),0),setTimeout(()=>bn(),0),ue(fe?Un.toString(fe):""),re(()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getMonth():K&&cn>K?K.getMonth():cn.getMonth()}),oe(()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getFullYear():K&&cn>K?K.getFullYear():cn.getFullYear()}))},e[78]=bn,e[79]=w,e[80]=_,e[81]=K,e[82]=Y,e[83]=fe,e[84]=it):it=e[84];const Ct=it;let Qt;e[85]!==w||e[86]!==_?(Qt=()=>{w||_||(Rn(!0),We(!1))},e[85]=w,e[86]=_,e[87]=Qt):Qt=e[87];const Yt=Qt,yn=vn?Yt:Ct;let gn;e[88]===Symbol.for("react.memo_cache_sentinel")?(gn=()=>Rn(!1),e[88]=gn):gn=e[88];const lt=gn;let kt;e[89]!==Yt?(kt=cn=>{const Cn=document.getElementById("root"),Pr=cn.target,fr=Ce.current,ar=sn.current;!Cn||!fr||!Pr||!ar||!fr.contains(Pr)&&Cn.contains(Pr)&&!ar.contains(Pr)&&Yt()},e[89]=Yt,e[90]=kt):kt=e[90];const vt=kt;let zt,Lt;e[91]!==vn||e[92]!==vt?(zt=()=>{if(vn)return setTimeout(()=>document.addEventListener("mousedown",vt),0),()=>document.removeEventListener("mousedown",vt)},Lt=[vn,vt],e[91]=vn,e[92]=vt,e[93]=zt,e[94]=Lt):(zt=e[93],Lt=e[94]),B.useEffect(zt,Lt);let yt;e[95]!==bn?(yt=()=>{bn()},e[95]=bn,e[96]=yt):yt=e[96];const Rt=yt;let on,En;e[97]!==vn||e[98]!==Rt?(on=()=>{if(!vn||!(sn!=null&&sn.current))return;const cn=sn.current;let Cn=cn.parentElement;for(;Cn;)Cn.addEventListener("scroll",Rt),Cn=Cn.parentElement;return()=>{let Pr=cn.parentElement;for(;Pr;)Pr.removeEventListener("scroll",Rt),Pr=Pr.parentElement}},En=[sn,vn,Rt],e[97]=vn,e[98]=Rt,e[99]=on,e[100]=En):(on=e[99],En=e[100]),B.useEffect(on,En);let Jt,xn;e[101]!==vn||e[102]!==Rt?(Jt=()=>{if(vn)return window.addEventListener("resize",Rt),()=>window.removeEventListener("resize",Rt)},xn=[vn,Rt],e[101]=vn,e[102]=Rt,e[103]=Jt,e[104]=xn):(Jt=e[103],xn=e[104]),B.useEffect(Jt,xn);let _n;e[105]!==Yt?(_n=cn=>{cn[0].intersectionRatio===0&&Yt()},e[105]=Yt,e[106]=_n):_n=e[106];const zn=_n;let er;e[107]!==vn||e[108]!==zn?(er=()=>{if(!vn)return;const cn=new IntersectionObserver(zn,{threshold:0});return Ce.current&&cn.observe(Ce.current),()=>cn.disconnect()},e[107]=vn,e[108]=zn,e[109]=er):er=e[109];let wn;e[110]!==vn||e[111]!==zn?(wn=[Ce,vn,zn],e[110]=vn,e[111]=zn,e[112]=wn):wn=e[112],B.useEffect(er,wn);let ri,$e;e[113]!==o||e[114]!==Yt||e[115]!==Ct||e[116]!==yn?(ri=()=>{o&&(o.current={open:Ct,close:Yt,toggle:yn})},$e=[o,Ct,Yt,yn],e[113]=o,e[114]=Yt,e[115]=Ct,e[116]=yn,e[117]=ri,e[118]=$e):(ri=e[117],$e=e[118]),B.useEffect(ri,$e);let tn;e[119]!==g||e[120]!==yn?(tn=cn=>{g==null||g(cn),yn()},e[119]=g,e[120]=yn,e[121]=tn):tn=e[121];const ln=tn;let Nn;e[122]!==ke||e[123]!==Yt?(Nn=cn=>{ke(void 0),Yt(),cn.stopPropagation()},e[122]=ke,e[123]=Yt,e[124]=Nn):Nn=e[124];const yr=Nn;let Ln;e[125]!==yr||e[126]!==fe?(Ln=()=>fe?M.jsx(ba,{icon:"Close",style:{scale:"0.8"},type:"Raw",onClick:yr}):null,e[125]=yr,e[126]=fe,e[127]=Ln):Ln=e[127];const Pt=Ln;let Se;if(fe){let cn;e[128]!==fe?(cn=Un.toString(fe),e[128]=fe,e[129]=cn):cn=e[129],Se=cn}else{let cn;e[130]!==N?(cn=M.jsx("span",{className:Vo.Placeholder,children:N}),e[130]=N,e[131]=cn):cn=e[131],Se=cn}const tt=Se;let At;e[132]!==l||e[133]!==P?(At=dt.clsx(Vo.Anchor,"IsClickable",Vo[P],l),e[132]=l,e[133]=P,e[134]=At):At=e[134];const Sn=P==="Primary"?"visible":"hidden";let In;e[135]!==P?(In=dt.clsx(Vo.Icon,Vo[P]),e[135]=P,e[136]=In):In=e[136];let Yn;e[137]!==In?(Yn=M.jsx(fo,{className:In,icon:"CalendarDay"}),e[137]=In,e[138]=Yn):Yn=e[138];let lr;e[139]===Symbol.for("react.memo_cache_sentinel")?(lr=M.jsx(cs,{w:4}),e[139]=lr):lr=e[139];let pr;e[140]!==Sn||e[141]!==Yn?(pr=M.jsxs(B.Activity,{mode:Sn,children:[Yn,lr]}),e[140]=Sn,e[141]=Yn,e[142]=pr):pr=e[142];let On;e[143]===Symbol.for("react.memo_cache_sentinel")?(On=M.jsx(zg,{}),e[143]=On):On=e[143];const tr=S?"hidden":"visible";let An;e[144]!==Pt?(An=M.jsx(Pt,{}),e[144]=Pt,e[145]=An):An=e[145];let sr;e[146]!==tr||e[147]!==An?(sr=M.jsx(B.Activity,{mode:tr,children:An}),e[146]=tr,e[147]=An,e[148]=sr):sr=e[148];const hr=P==="Secondary"?"visible":"hidden";let ho;e[149]!==P?(ho=dt.clsx(Vo.Icon,Vo[P]),e[149]=P,e[150]=ho):ho=e[150];let So;e[151]!==ho?(So=M.jsx(fo,{className:ho,icon:"CalendarDay"}),e[151]=ho,e[152]=So):So=e[152];let oo;e[153]!==hr||e[154]!==So?(oo=M.jsx(B.Activity,{mode:hr,children:So}),e[153]=hr,e[154]=So,e[155]=oo):oo=e[155];const sl=r?"visible":"hidden";let Ki;e[156]!==r||e[157]!==sl?(Ki=M.jsx(B.Activity,{mode:sl,children:r}),e[156]=r,e[157]=sl,e[158]=Ki):Ki=e[158];let Ai;e[159]!==t||e[160]!==i||e[161]!==tt||e[162]!==w||e[163]!==_||e[164]!==ln||e[165]!==At||e[166]!==pr||e[167]!==sr||e[168]!==oo||e[169]!==Ki?(Ai=M.jsxs(zi,{...i,abaseRef:sn,className:At,isDisabled:w,isLoading:_,onClick:ln,children:[t,pr,tt,On,sr,oo,Ki]}),e[159]=t,e[160]=i,e[161]=tt,e[162]=w,e[163]=_,e[164]=ln,e[165]=At,e[166]=pr,e[167]=sr,e[168]=oo,e[169]=Ki,e[170]=Ai):Ai=e[170];const Jl=vn||hn?"visible":"hidden";let Zo;if(e[171]!==$t||e[172]!==ne||e[173]!==st||e[174]!==vn||e[175]!==Re||e[176]!==K||e[177]!==Y||e[178]!==$||e[179]!==Fe||e[180]!==at||e[181]!==Mt||e[182]!==pe||e[183]!==G||e[184]!==fe||e[185]!==me){const cn=+vn;let Cn;e[187]!==cn?(Cn={opacity:cn},e[187]=cn,e[188]=Cn):Cn=e[188];let Pr;e[189]===Symbol.for("react.memo_cache_sentinel")?(Pr={className:Vo.StringInput},e[189]=Pr):Pr=e[189];const fr=fe?30:11;let ar;e[190]!==ne||e[191]!==Fe?(ar=[ne,Fe],e[190]=ne,e[191]=Fe,e[192]=ar):ar=e[192];let Nr;e[193]===Symbol.for("react.memo_cache_sentinel")?(Nr={className:Vo.StringInputWrap},e[193]=Nr):Nr=e[193];let Er;e[194]!==fr||e[195]!==ar?(Er=M.jsx("div",{className:Vo.StringInputContainer,children:M.jsx(sg,{className:Vo.String,inputProps:Pr,maxLength:fr,placeholder:"YYYY-MM-DD",useValue:ar,wrapProps:Nr})}),e[194]=fr,e[195]=ar,e[196]=Er):Er=e[196];let gi;e[197]!==Re||e[198]!==Mt?(gi=M.jsx(Ic,{className:Vo.Prev,isDisabled:Re,type:"Raw",onClick:Mt}),e[197]=Re,e[198]=Mt,e[199]=gi):gi=e[199];let Ri;e[200]!==G?(Ri=go=>G.months(go.option),e[200]=G,e[201]=Ri):Ri=e[201];let Dr;e[202]!==K||e[203]!==Y||e[204]!==me?(Dr=Ap(me,Y,K),e[202]=K,e[203]=Y,e[204]=me,e[205]=Dr):Dr=e[205];let Bo;e[206]!==G?(Bo=go=>G.months(go.selectedOption),e[206]=G,e[207]=Bo):Bo=e[207];let Eo;e[208]!==$?(Eo=[$,re],e[208]=$,e[209]=Eo):Eo=e[209];let To;e[210]!==Ri||e[211]!==Dr||e[212]!==Bo||e[213]!==Eo?(To=M.jsx(Td,{isAutoWidth:!0,className:Vo.Select,OptionRenderer:Ri,options:Dr,SelectedRenderer:Bo,type:"Secondary",useSelect:Eo}),e[210]=Ri,e[211]=Dr,e[212]=Bo,e[213]=Eo,e[214]=To):To=e[214];let Ii;e[215]===Symbol.for("react.memo_cache_sentinel")?(Ii=M.jsx(cs,{w:8}),e[215]=Ii):Ii=e[215];let Vr;e[216]!==K||e[217]!==Y||e[218]!==me?(Vr=Sm(me,Y,K),e[216]=K,e[217]=Y,e[218]=me,e[219]=Vr):Vr=e[219];let xr;e[220]!==pe||e[221]!==me?(xr=[me,pe],e[220]=pe,e[221]=me,e[222]=xr):xr=e[222];let al;e[223]!==Vr||e[224]!==xr?(al=M.jsx(Td,{isAutoWidth:!0,className:Vo.Select,options:Vr,type:"Secondary",useSelect:xr}),e[223]=Vr,e[224]=xr,e[225]=al):al=e[225];let xi;e[226]!==To||e[227]!==al?(xi=M.jsxs("div",{className:Vo.MonthYear,children:[To,Ii,al]}),e[226]=To,e[227]=al,e[228]=xi):xi=e[228];let Ji;e[229]!==st||e[230]!==at?(Ji=M.jsx(Ic,{className:Vo.Next,isDisabled:st,type:"Raw",onClick:at}),e[229]=st,e[230]=at,e[231]=Ji):Ji=e[231];let cl;e[232]!==gi||e[233]!==xi||e[234]!==Ji?(cl=M.jsxs(Ml,{className:Vo.Header,children:[gi,xi,Ji]}),e[232]=gi,e[233]=xi,e[234]=Ji,e[235]=cl):cl=e[235];let Ao;e[236]===Symbol.for("react.memo_cache_sentinel")?(Ao=M.jsx(cs,{h:10}),e[236]=Ao):Ao=e[236];let Hi;e[237]!==G?(Hi=M.jsx("div",{className:Vo.Week,children:[0,1,2,3,4,5,6].map(go=>M.jsx("div",{className:dt.clsx(Vo.WeekDay,Vo.Cell),children:G.weekDays(go)},go))}),e[237]=G,e[238]=Hi):Hi=e[238];let zo;e[239]!==$t||e[240]!==Hi?(zo=M.jsxs("div",{className:Vo.Calendar,children:[Hi,$t]}),e[239]=$t,e[240]=Hi,e[241]=zo):zo=e[241];let Qi;e[242]!==cl||e[243]!==zo?(Qi=M.jsxs("div",{className:Vo.CalendarContainer,children:[cl,Ao,zo]}),e[242]=cl,e[243]=zo,e[244]=Qi):Qi=e[244];let qi;e[245]!==Cn||e[246]!==Er||e[247]!==Qi?(qi=M.jsxs("div",{ref:Ce,className:Vo.ADatePicker,style:Cn,onTransitionEnd:lt,children:[Er,Qi]}),e[245]=Cn,e[246]=Er,e[247]=Qi,e[248]=qi):qi=e[248],Zo=su.createPortal(qi,document.body),e[171]=$t,e[172]=ne,e[173]=st,e[174]=vn,e[175]=Re,e[176]=K,e[177]=Y,e[178]=$,e[179]=Fe,e[180]=at,e[181]=Mt,e[182]=pe,e[183]=G,e[184]=fe,e[185]=me,e[186]=Zo}else Zo=e[186];let xo;e[249]!==Jl||e[250]!==Zo?(xo=M.jsx(B.Activity,{mode:Jl,children:Zo}),e[249]=Jl,e[250]=Zo,e[251]=xo):xo=e[251];let Gr;return e[252]!==Ai||e[253]!==xo?(Gr=M.jsxs(M.Fragment,{children:[Ai,xo]}),e[252]=Ai,e[253]=xo,e[254]=Gr):Gr=e[254],Gr},f8="_Paper_e69j5_1",h8="_Card_e69j5_15",d8="_Body_e69j5_26",g8="_Title_e69j5_35",p8="_Content_e69j5_42",v8="_Action_e69j5_45",b8="_Button_e69j5_58",Qh={Paper:f8,Card:h8,Body:d8,Title:g8,Content:p8,Action:v8,Button:b8},y8=["okCancel","cancelOk","ok","cancel","none"],m8=n=>{const e=Gn.c(129),{dlgCore:t,type:r,title:i,children:o,style:l,titleStyle:a,bodyStyle:h,contentStyle:g,okButtonStyle:m,cancelButtonStyle:x,actionStyle:w,onOk:_,onCancel:S,onClose:R,onEnterPress:k,onEscPress:O,onSpacePress:P,onPaperClick:z,noDim:H,isLoading:G,isOkDisabled:N,isOkLoading:J,isCancelDisabled:Y,isCancelLoading:K,isChanged:fe,buttonNoInteractive:X,okButtonClassName:te,cancelButtonClassName:ne,progress:ue,ProgressRenderer:se,progressProps:$,resources:re}=n,ge=r===void 0?"okCancel":r,me=H===void 0?!1:H;let oe;e[0]!==re?(oe={...Or.ADialog,...re},e[0]=re,e[1]=oe):oe=e[1];const Q=oe,[pe,Ie]=B.useState(0);let Fe,xe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Fe=()=>Ie(1),xe=[],e[2]=Fe,e[3]=xe):(Fe=e[2],xe=e[3]),B.useEffect(Fe,xe);let Oe;e[4]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>{Ie(0)},e[4]=Oe):Oe=e[4];const Le=Oe;let He;e[5]!==t||e[6]!==R||e[7]!==pe?(He=()=>{if(!pe){const[,it]=t.state.useIsOpen;it==null||it(!1),R==null||R()}},e[5]=t,e[6]=R,e[7]=pe,e[8]=He):He=e[8];const Te=He;let ke;e[9]!==G||e[10]!==N||e[11]!==J||e[12]!==_||e[13]!==pe||e[14]!==ge?(ke=async()=>{if(!pe||ge==="cancel"||ge==="none"||G||N||J)return;const{event:it,e:Ct}=Eg();await(_==null?void 0:_(Ct)),!it.preventDefault&&Le()},e[9]=G,e[10]=N,e[11]=J,e[12]=_,e[13]=pe,e[14]=ge,e[15]=ke):ke=e[15];const Be=ke;let rt;e[16]!==Y||e[17]!==K||e[18]!==G||e[19]!==S||e[20]!==pe||e[21]!==ge?(rt=async()=>{if(!pe||ge==="ok"||ge==="none"||G||Y||K)return;const{event:it,e:Ct}=Eg();await(S==null?void 0:S(Ct)),!it.preventDefault&&Le()},e[16]=Y,e[17]=K,e[18]=G,e[19]=S,e[20]=pe,e[21]=ge,e[22]=rt):rt=e[22];const Re=rt;let ut,qe;e[23]!==Re||e[24]!==t||e[25]!==Be?(qe=()=>{t&&t.state.setAction({close:Le,ok:Be,cancel:Re})},ut=[t,Le,Be,Re],e[23]=Re,e[24]=t,e[25]=Be,e[26]=ut,e[27]=qe):(ut=e[26],qe=e[27]),B.useEffect(qe,ut);let ot;e[28]!==k||e[29]!==G||e[30]!==Be?(ot=async()=>{if(G)return;const{event:it,e:Ct}=Eg();await(k==null?void 0:k(Ct)),!it.preventDefault&&Be()},e[28]=k,e[29]=G,e[30]=Be,e[31]=ot):ot=e[31];const st=ot;let bt;e[32]!==P||e[33]!==G||e[34]!==Be?(bt=async()=>{if(G)return;const{event:it,e:Ct}=Eg();await(P==null?void 0:P(Ct)),!it.preventDefault&&Be()},e[32]=P,e[33]=G,e[34]=Be,e[35]=bt):bt=e[35];const Mt=bt;let Bt;e[36]!==Re||e[37]!==O||e[38]!==fe||e[39]!==G?(Bt=async()=>{if(G)return;const{event:it,e:Ct}=Eg();await(O==null?void 0:O(Ct)),!it.preventDefault&&(fe||Re())},e[36]=Re,e[37]=O,e[38]=fe,e[39]=G,e[40]=Bt):Bt=e[40];const at=Bt,Ye=B.useRef(null);let Tt;e[41]!==st||e[42]!==at||e[43]!==Mt||e[44]!==pe?(Tt=it=>{const Ct=document.body.getElementsByClassName(Qh.Paper);Ct.length===0||Ct[Ct.length-1]!==Ye.current||(it.key==="Enter"&&pe?st():it.key===" "&&pe?Mt():it.key==="Escape"&&pe&&at())},e[41]=st,e[42]=at,e[43]=Mt,e[44]=pe,e[45]=Tt):Tt=e[45];const Ut=Tt;let gt,Ht;e[46]!==Ut||e[47]!==pe?(gt=()=>{if(pe)return window.addEventListener("keydown",Ut),()=>window.removeEventListener("keydown",Ut)},Ht=[pe,Ut],e[46]=Ut,e[47]=pe,e[48]=gt,e[49]=Ht):(gt=e[48],Ht=e[49]),B.useEffect(gt,Ht);const xt=B.useRef(!1),pn=B.useRef(!1);let $t;e[50]===Symbol.for("react.memo_cache_sentinel")?($t=()=>{xt.current=!0},e[50]=$t):$t=e[50];const sn=$t;let Xt;e[51]===Symbol.for("react.memo_cache_sentinel")?(Xt=()=>{xt.current=!1,pn.current=!1},e[51]=Xt):Xt=e[51];const bn=Xt;let hn;e[52]===Symbol.for("react.memo_cache_sentinel")?(hn=()=>{pn.current=!0},e[52]=hn):hn=e[52];const Rn=hn;let vn;e[53]!==Re||e[54]!==z||e[55]!==fe||e[56]!==G?(vn=async()=>{if(G)return;const it=!pn.current||xt.current;if(xt.current=!1,pn.current=!1,it)return;const{event:Ct,e:Qt}=Eg();await(z==null?void 0:z(Qt)),!Ct.preventDefault&&(fe||Re())},e[53]=Re,e[54]=z,e[55]=fe,e[56]=G,e[57]=vn):vn=e[57];const We=vn;let Ce;if(e[58]!==se||e[59]!==w||e[60]!==h||e[61]!==X||e[62]!==Re||e[63]!==ne||e[64]!==x||e[65]!==o||e[66]!==g||e[67]!==Y||e[68]!==K||e[69]!==G||e[70]!==N||e[71]!==J||e[72]!==me||e[73]!==Be||e[74]!==te||e[75]!==m||e[76]!==We||e[77]!==Te||e[78]!==pe||e[79]!==ue||e[80]!==$||e[81]!==Q||e[82]!==l||e[83]!==i||e[84]!==a||e[85]!==ge){const it=me?"transparent":void 0,Ct=pe?void 0:"none";let Qt;e[87]!==pe||e[88]!==it||e[89]!==Ct?(Qt={backgroundColor:it,pointerEvents:Ct,opacity:pe},e[87]=pe,e[88]=it,e[89]=Ct,e[90]=Qt):Qt=e[90];let Yt;e[91]!==i||e[92]!==a?(Yt=i&&M.jsx(x8,{title:i,titleStyle:a}),e[91]=i,e[92]=a,e[93]=Yt):Yt=e[93];let yn;e[94]!==o||e[95]!==g?(yn=o&&M.jsx("div",{className:Qh.Content,style:g,children:o}),e[94]=o,e[95]=g,e[96]=yn):yn=e[96];let gn;e[97]!==h||e[98]!==Yt||e[99]!==yn?(gn=M.jsxs("div",{className:Qh.Body,style:h,children:[Yt,yn]}),e[97]=h,e[98]=Yt,e[99]=yn,e[100]=gn):gn=e[100];let lt;e[101]!==w||e[102]!==X||e[103]!==Re||e[104]!==ne||e[105]!==x||e[106]!==Y||e[107]!==K||e[108]!==N||e[109]!==J||e[110]!==Be||e[111]!==te||e[112]!==m||e[113]!==Q||e[114]!==ge?(lt=ge!=="none"&&M.jsx(w8,{type:ge,ok:Be,cancel:Re,resources:Q,isOkDisabled:N,isOkLoading:J,isCancelDisabled:Y,isCancelLoading:K,okButtonStyle:m,cancelButtonStyle:x,actionStyle:w,buttonNoInteractive:X,okButtonClassName:te,cancelButtonClassName:ne}),e[101]=w,e[102]=X,e[103]=Re,e[104]=ne,e[105]=x,e[106]=Y,e[107]=K,e[108]=N,e[109]=J,e[110]=Be,e[111]=te,e[112]=m,e[113]=Q,e[114]=ge,e[115]=lt):lt=e[115];let kt;e[116]!==se||e[117]!==G||e[118]!==ue||e[119]!==$||e[120]!==l||e[121]!==gn||e[122]!==lt?(kt=M.jsxs(zi,{className:Qh.Card,isLoading:G,progress:ue,progressProps:$,ProgressRenderer:se,style:l,onMouseDown:sn,onMouseUp:bn,children:[gn,lt]}),e[116]=se,e[117]=G,e[118]=ue,e[119]=$,e[120]=l,e[121]=gn,e[122]=lt,e[123]=kt):kt=e[123];let vt;e[124]!==We||e[125]!==Te||e[126]!==Qt||e[127]!==kt?(vt=M.jsx("div",{ref:Ye,className:Qh.Paper,style:Qt,onMouseDown:Rn,onMouseUp:We,onTransitionEnd:Te,children:kt}),e[124]=We,e[125]=Te,e[126]=Qt,e[127]=kt,e[128]=vt):vt=e[128],Ce=su.createPortal(vt,document.body),e[58]=se,e[59]=w,e[60]=h,e[61]=X,e[62]=Re,e[63]=ne,e[64]=x,e[65]=o,e[66]=g,e[67]=Y,e[68]=K,e[69]=G,e[70]=N,e[71]=J,e[72]=me,e[73]=Be,e[74]=te,e[75]=m,e[76]=We,e[77]=Te,e[78]=pe,e[79]=ue,e[80]=$,e[81]=Q,e[82]=l,e[83]=i,e[84]=a,e[85]=ge,e[86]=Ce}else Ce=e[86];return Ce},x8=n=>{const e=Gn.c(4),{title:t,titleStyle:r}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=dt.clsx(Qh.Title,"NoSelect","Title3"),e[0]=i):i=e[0];let o;return e[1]!==t||e[2]!==r?(o=M.jsx("div",{className:i,style:r,children:t}),e[1]=t,e[2]=r,e[3]=o):o=e[3],o},w8=n=>{const e=Gn.c(41),{type:t,ok:r,cancel:i,resources:o,isOkDisabled:l,isOkLoading:a,isCancelDisabled:h,isCancelLoading:g,okButtonStyle:m,cancelButtonStyle:x,actionStyle:w,buttonNoInteractive:_,okButtonClassName:S,cancelButtonClassName:R}=n,k=o.Ok;let O;e[0]!==S?(O=dt.clsx(Qh.Button,S),e[0]=S,e[1]=O):O=e[1];let P;e[2]!==_||e[3]!==l||e[4]!==a||e[5]!==r||e[6]!==m||e[7]!==o.Ok||e[8]!==O?(P={onClick:r,isDisabled:l,isLoading:a,children:k,style:m,noInteractive:_,className:O},e[2]=_,e[3]=l,e[4]=a,e[5]=r,e[6]=m,e[7]=o.Ok,e[8]=O,e[9]=P):P=e[9];const z=P,H=o.Cancel;let G;e[10]!==R?(G=dt.clsx(Qh.Button,R),e[10]=R,e[11]=G):G=e[11];let N;e[12]!==_||e[13]!==i||e[14]!==x||e[15]!==h||e[16]!==g||e[17]!==o.Cancel||e[18]!==G?(N={type:"Secondary",onClick:i,isDisabled:h,isLoading:g,children:H,style:x,noInteractive:_,className:G},e[12]=_,e[13]=i,e[14]=x,e[15]=h,e[16]=g,e[17]=o.Cancel,e[18]=G,e[19]=N):N=e[19];const J=N;if(t==="okCancel"||t==="ok"){let Y;e[20]!==w?(Y={...w},e[20]=w,e[21]=Y):Y=e[21];let K;e[22]!==z?(K=M.jsx(Ic,{...z}),e[22]=z,e[23]=K):K=e[23];let fe;e[24]!==J||e[25]!==t?(fe=t==="okCancel"&&M.jsxs(M.Fragment,{children:[M.jsx(cs,{w:8}),M.jsx(Ic,{...J})]}),e[24]=J,e[25]=t,e[26]=fe):fe=e[26];let X;return e[27]!==Y||e[28]!==K||e[29]!==fe||e[30]!==t?(X=M.jsxs("div",{className:Qh.Action,style:Y,children:[K,fe]},t),e[27]=Y,e[28]=K,e[29]=fe,e[30]=t,e[31]=X):X=e[31],X}else if(t==="cancelOk"||t==="cancel"){let Y;e[32]!==J?(Y=M.jsx(Ic,{...J}),e[32]=J,e[33]=Y):Y=e[33];let K;e[34]!==z||e[35]!==t?(K=t==="cancelOk"&&M.jsxs(M.Fragment,{children:[M.jsx(cs,{w:8}),M.jsx(Ic,{...z})]}),e[34]=z,e[35]=t,e[36]=K):K=e[36];let fe;return e[37]!==Y||e[38]!==K||e[39]!==t?(fe=M.jsxs("div",{className:Qh.Action,children:[Y,K]},t),e[37]=Y,e[38]=K,e[39]=t,e[40]=fe):fe=e[40],fe}},C8=n=>{const e=B.useMemo(()=>Math.random().toFixed(32),[]),t=B.useMemo(()=>{const _={};return n.forEach(S=>{_[S]=S+e}),_},[n,e]),r=B.useMemo(()=>[],[]),i=B.useMemo(()=>(r.length=0,r.push(...n),r),[r,n]),[o,l]=B.useState([]),a=B.useRef((()=>{const _={};return i.forEach(S=>{_[S]={open:()=>l(R=>[...R,S]),close:()=>{},ok:()=>{},cancel:()=>{}}}),_})()),h=B.useMemo(()=>{const _={};return i.forEach(S=>{_[S]=R=>{l(k=>!R&&k.includes(S)?k.filter(O=>O!==S):R&&!k.includes(S)?[...k,S]:k)}}),_},[i]),g=B.useMemo(()=>{const _={};return i.forEach(S=>{const k=[o.includes(S),h[S]],O=P=>{a.current[S]={...a.current[S],...P}};_[S]={useIsOpen:k,setAction:O}}),_},[o,h,i]),m=B.useMemo(()=>{const _={};return i.forEach(S=>{const R=()=>a.current[S].open(),k=()=>a.current[S].close(),O=()=>a.current[S].ok(),P=()=>a.current[S].cancel();_[S]={open:R,close:k,ok:O,cancel:P}}),_},[i]),x=B.useMemo(()=>({}),[]),w=B.useMemo(()=>(i.forEach(_=>{x[_]={state:g[_],action:m[_]}}),x),[x,i,g,m]);return B.useEffect(()=>(Object.keys(w).forEach(S=>{const R=w[S],k=t[S],O=kh.find(P=>{P.id});O?O.core=R:kh.push({id:k,core:R})}),()=>{const S=Object.keys(w),R=kh.filter(k=>S.includes(k.id));kh.length=0,kh.push(...R)}),[w,t]),w},_8=()=>{const n=B.useMemo(()=>Math.random().toFixed(32),[]),[e,t]=B.useState(!1),r=B.useRef({open:()=>t(!0),close:()=>{},ok:()=>{},cancel:()=>{}}),i=B.useMemo(()=>({useIsOpen:[e,t],setAction:h=>{r.current={...r.current,...h}}}),[e]),o=B.useMemo(()=>({open:()=>r.current.open(),close:()=>r.current.close(),ok:()=>r.current.ok(),cancel:()=>r.current.cancel()}),[]),l=B.useMemo(()=>({}),[]),a=B.useMemo(()=>(l.state=i,l.action=o,l),[l,i,o]);return B.useEffect(()=>{const h=kh.find(g=>g.id===n);return h?h.core=a:kh.push({id:n,core:a}),()=>{const g=kh.filter(m=>m.id!==n);kh.length=0,kh.push(...g)}},[n,a]),a},S8=n=>{const e=Gn.c(5),{dlgCore:t,children:r}=n,[i,o]=t.state.useIsOpen;let l,a;e[0]!==o?(l=()=>()=>o==null?void 0:o(!1),a=[o],e[0]=o,e[1]=l,e[2]=a):(l=e[1],a=e[2]),B.useEffect(l,a);const h=i&&r;let g;return e[3]!==h?(g=M.jsx(B.Suspense,{children:h}),e[3]=h,e[4]=g):g=e[4],g},E8=n=>e=>{const{dlgCore:t}=e;return M.jsx(S8,{dlgCore:t,children:B.cloneElement(M.jsx(n,{...e}),{dlgCore:t})})},kh=[],T8={closeAllDlgs:()=>{kh.forEach(n=>{n.core.action.close()})}},A8="_AFileBox_1hlo1_1",R8="_SelectedFile_1hlo1_16",I8="_Dropping_1hlo1_26",Tm={AFileBox:A8,SelectedFile:R8,Dropping:I8},k8=n=>{const e=Gn.c(60);let t,r,i,o,l,a,h,g,m,x,w,_;e[0]!==n?({useFile:_,FileRenderer:g,SelectRenderer:m,DropRenderer:x,resources:i,accept:w,onInvalidFileFormat:h,fileSelectButtonClassName:o,isDisabled:l,isLoading:a,className:r,...t}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12]);const S=g===void 0?M8:g,R=m===void 0?L8:m,k=x===void 0?O8:x,O=w===void 0?"":w;let P;e[13]!==i?(P={...Or.AFileBox,...i},e[13]=i,e[14]=P):P=e[14];const z=P,H=B.useRef(null),G=B.useRef(null),[N,J]=Fo(_,null),[Y,K]=B.useState(!1);let fe;e[15]!==O?(fe=O.split(",").map(P8).filter(D8),e[15]=O,e[16]=fe):fe=e[16];const X=fe;let te;e[17]!==X?(te=Re=>{if(X.length===0)return!1;const ut=Re.name.split(".").pop();return ut?!X.includes(`.${ut}`):!0},e[17]=X,e[18]=te):te=e[18];const ne=te;let ue;e[19]!==ne||e[20]!==h||e[21]!==J?(ue=Re=>{if(J)if(ne(Re)){h==null||h();return}else J(Re);else return},e[19]=ne,e[20]=h,e[21]=J,e[22]=ue):ue=e[22];const se=ue;let $;e[23]!==se?($=Re=>{Re.target.files&&Re.target.files.length>0&&se(Re.target.files[0])},e[23]=se,e[24]=$):$=e[24];const re=$;let ge;e[25]!==se||e[26]!==l||e[27]!==a?(ge=Re=>{Re.preventDefault(),K(!1),!(l||a)&&Re.dataTransfer.files&&Re.dataTransfer.files.length>0&&se(Re.dataTransfer.files[0])},e[25]=se,e[26]=l,e[27]=a,e[28]=ge):ge=e[28];const me=ge;let oe;e[29]!==l||e[30]!==a?(oe=Re=>{Re.preventDefault(),!(l||a)&&K(!0)},e[29]=l,e[30]=a,e[31]=oe):oe=e[31];const Q=oe;let pe;e[32]===Symbol.for("react.memo_cache_sentinel")?(pe=Re=>{Re.target===H.current&&Re.relatedTarget.contains(H.current.parentElement)&&(Re.preventDefault(),K(!1))},e[32]=pe):pe=e[32];const Ie=pe,Fe=N8;let xe;e[33]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{var Re;(Re=G.current)==null||Re.click()},e[33]=xe):xe=e[33];const Oe=xe;let Le;if(Y){let Re;e[34]!==k||e[35]!==z?(Re=M.jsx(k,{resources:z}),e[34]=k,e[35]=z,e[36]=Re):Re=e[36],Le=Re}else if(N){let Re;e[37]!==S||e[38]!==N||e[39]!==_?(Re=M.jsx(S,{file:N,useFile:_}),e[37]=S,e[38]=N,e[39]=_,e[40]=Re):Re=e[40],Le=Re}else{let Re;e[41]!==R||e[42]!==o||e[43]!==z?(Re=M.jsx(R,{fileSelectButtonClassName:o,resources:z,onClick:Oe}),e[41]=R,e[42]=o,e[43]=z,e[44]=Re):Re=e[44],Le=Re}const He=Le;let Te;e[45]!==r?(Te=dt.clsx(Tm.AFileBox,r),e[45]=r,e[46]=Te):Te=e[46];let ke;e[47]===Symbol.for("react.memo_cache_sentinel")?(ke={display:"none"},e[47]=ke):ke=e[47];let Be;e[48]!==O||e[49]!==re?(Be=M.jsx("input",{ref:G,accept:O,style:ke,type:"file",value:"",onChange:re}),e[48]=O,e[49]=re,e[50]=Be):Be=e[50];let rt;return e[51]!==t||e[52]!==He||e[53]!==l||e[54]!==a||e[55]!==Q||e[56]!==me||e[57]!==Te||e[58]!==Be?(rt=M.jsxs(zi,{...t,abaseRef:H,className:Te,isDisabled:l,isLoading:a,onDragEnter:Q,onDragLeave:Ie,onDragOver:Fe,onDrop:me,children:[Be,He]}),e[51]=t,e[52]=He,e[53]=l,e[54]=a,e[55]=Q,e[56]=me,e[57]=Te,e[58]=Be,e[59]=rt):rt=e[59],rt},M8=n=>{const e=Gn.c(10),{file:t,useFile:r}=n,[,i]=Fo(r,null);let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={backgroundColor:""},l=M.jsx(fo,{icon:"File"}),e[0]=o,e[1]=l):(o=e[0],l=e[1]);let a;e[2]!==t.name?(a=M.jsx(nd,{children:t.name}),e[2]=t.name,e[3]=a):a=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h={marginLeft:2,transform:"scale(0.8)"},e[4]=h):h=e[4];let g;e[5]!==i?(g=M.jsx(ba,{icon:"Close",style:h,type:"Raw",onClick:()=>i==null?void 0:i(null)}),e[5]=i,e[6]=g):g=e[6];let m;return e[7]!==a||e[8]!==g?(m=M.jsxs(Ml,{className:Tm.SelectedFile,style:o,children:[l,a,g]}),e[7]=a,e[8]=g,e[9]=m):m=e[9],m},L8=n=>{const e=Gn.c(9),{onClick:t,resources:r,fileSelectButtonClassName:i}=n;let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=dt.clsx("NoSelect"),l={gap:4},e[0]=o,e[1]=l):(o=e[0],l=e[1]);const a=r["Select File"];let h;e[2]!==i||e[3]!==t||e[4]!==a?(h=M.jsx(Ic,{className:i,onClick:t,children:a}),e[2]=i,e[3]=t,e[4]=a,e[5]=h):h=e[5];const g=r["or Drag & Drop"];let m;return e[6]!==h||e[7]!==g?(m=M.jsxs(Ml,{className:o,style:l,children:[h,g]}),e[6]=h,e[7]=g,e[8]=m):m=e[8],m},O8=n=>{const e=Gn.c(4),{resources:t}=n;let r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=dt.clsx(Tm.Dropping,"NoSelect","Headline2"),i=M.jsx(fo,{icon:"FileDownload"}),e[0]=r,e[1]=i):(r=e[0],i=e[1]);const o=t["drop file to select"];let l;return e[2]!==o?(l=M.jsxs(O3,{className:r,children:[i,o]}),e[2]=o,e[3]=l):l=e[3],l};function P8(n){return n.trim()}function D8(n){return n.length>0&&n.startsWith(".")}function N8(n){return n.preventDefault()}async function F8(n){const e=new Promise((t,r)=>{const i=new FileReader;i.onloadend=()=>{i.result?typeof i.result=="string"?t(i.result):r(new Error("Failed to convert file to Base64: Invalid result type.")):r(new Error("Failed to convert file to Base64: Empty result."))},i.onerror=r,i.readAsDataURL(n)});try{return await e}catch{return}}function B8(n,e){var a,h;const t=n.split(","),r=(h=(a=t[0])==null?void 0:a.match(/:(.*?);/))==null?void 0:h[1],i=atob(t[1]);let o=i.length;const l=new Uint8Array(o);for(;o--;)l[o]=i.charCodeAt(o);return new File([l],e,{type:r})}const F3=n=>n.idx?n.idx.toString():`${n.name}-${n.size}-${n.lastModified||""}`,Tg={toBase64:F8,toFile:B8,getFileKey:F3},z8="_AFileUploader_i2nun_1",H8="_LabelContainer_i2nun_16",W8="_LabelButton_i2nun_25",U8="_Disabled_i2nun_31",G8="_Delete_i2nun_34",Y8="_FileSize_i2nun_38",V8="_TotalFileSize_i2nun_45",Z8="_FileBox_i2nun_49",X8="_FileBoxFullSize_i2nun_68",K8="_SelectRenderer_i2nun_75",J8="_ChipsContainer_i2nun_87",Q8="_FileChip_i2nun_100",q8="_FileChipContent_i2nun_113",j8="_FileNameContainer_i2nun_124",$8="_ButtonRenderer_i2nun_130",e9="_ErrorBorder_i2nun_141",t9="_ErrorColor_i2nun_145",n9="_ErrorCursor_i2nun_149",r9="_DropIdle_i2nun_159",bl={AFileUploader:z8,LabelContainer:H8,LabelButton:W8,Disabled:U8,Delete:G8,FileSize:Y8,TotalFileSize:V8,FileBox:Z8,FileBoxFullSize:X8,SelectRenderer:K8,ChipsContainer:J8,FileChip:Q8,FileChipContent:q8,FileNameContainer:j8,ButtonRenderer:$8,ErrorBorder:e9,ErrorColor:t9,ErrorCursor:n9,DropIdle:r9},i9=n=>{const e=Gn.c(14),{file:t,baseClass:r,errorClass:i,errorCursorClass:o,resources:l,onDownload:a}=n,[h,g]=B.useState(!1);let m;e[0]!==r||e[1]!==i||e[2]!==o?(m=dt.clsx(r,i,o),e[0]=r,e[1]=i,e[2]=o,e[3]=m):m=e[3];const x=h?"FileDownload":"CircleAlertOutline",w=l["Fail Download"];let _;e[4]!==t||e[5]!==a?(_=()=>a(t),e[4]=t,e[5]=a,e[6]=_):_=e[6];let S,R;e[7]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(!0),R=()=>g(!1),e[7]=S,e[8]=R):(S=e[7],R=e[8]);let k;return e[9]!==m||e[10]!==x||e[11]!==w||e[12]!==_?(k=M.jsx(ba,{className:m,icon:x,iconSize:"sm",tooltip:w,type:"Raw",onClick:_,onMouseEnter:S,onMouseLeave:R}),e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=k):k=e[13],k},o9=n=>{const{useFiles:e,accept:t,onInvalidFileFormat:r,onDownload:i,onDownloadCsv:o,onDelete:l,type:a,limit:h=1024*1024*1024,maxFileCount:g,useError:m,isLoading:x,resources:w,className:_,onDownloadAll:S,csvFilename:R,...k}=n,[{wrapId:O,wrapProps:P,labelProps:z,...H},G]=Bg(k),N=B.useMemo(()=>({...Or.AFileUploader,...w}),[w]),[J,Y]=Fo(e,void 0),[K,fe]=Fo(m,!1),[X,te]=B.useState({}),[ne,ue]=B.useState(!1),se=B.useRef(0),$=B.useRef({}),re=B.useRef(null),ge=B.useRef(null),me=B.useMemo(()=>(J==null?void 0:J.reduce((at,Ye)=>at+Ye.size,0))||0,[J]);B.useEffect(()=>{fe&&fe(me>h)},[me,h,fe]);const oe=B.useCallback(at=>{var Ut;if(!t||t==="*"||t==="")return!0;const Ye=t.split(",").map(gt=>gt.trim()),Tt=`.${(Ut=at.name.split(".").pop())==null?void 0:Ut.toLowerCase()}`;return Ye.includes(Tt)?!0:Ye.some(gt=>{var Ht;if(gt.startsWith("."))return!1;if(gt.endsWith("/*")){const xt=gt.split("/")[0];return(Ht=at.type)==null?void 0:Ht.startsWith(`${xt}/`)}return at.type===gt})},[t]),Q=B.useCallback((at,Ye)=>{const Tt={...$.current};Tt[at]=Ye,$.current=Tt,te(Tt)},[te]),pe=B.useCallback(at=>{const Ye=Tg.getFileKey(at);return X[Ye]||"Normal"},[X]),Ie=B.useCallback(at=>x||pe(at)==="Loading",[x,pe]),Fe=B.useCallback(at=>pe(at)==="Error"||a==="Upload"&&at.size>h,[pe,h,a]),xe=B.useMemo(()=>J!=null&&J.length?a==="Download"?J.every(Fe):!1:!0,[J,a,Fe]),Oe=B.useCallback(()=>{re.current&&(re.current.value="")},[]),Le=B.useMemo(()=>!g||!(J!=null&&J.length)?!1:J.length>=g,[J,g]),He=B.useCallback(at=>{if(!Y)return;const Ye=[];let Tt=!1,Ut=[],gt=g?g-((J==null?void 0:J.length)||0):1/0;if(!(gt<=0)){if(Array.from(at).forEach((Ht,xt)=>{if(xt>=gt)return;if(!oe(Ht)){Tt=!0,Ut.push(Ht.name);return}const pn=Ht;pn.uniqueId=`file-${Date.now()}-${se.current++}`,Ye.push(pn)}),Tt)if(r)r();else{const Ht=t?t.replace(/,/g,", "):"",xt=Ht?`${N["Supported file format(s)"]}: ${Ht}`:"",pn=Ut.length>3?`${Ut.slice(0,3).join(", ")} ${N.and} ${Ut.length-3} ${N["more file(s)"]}`:Ut.join(", ");alert(`${N["Unsupported file format detected."]}
281
+ "$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`),Pi=R('$RR("'),jo=R('","'),es=R('",'),Zs=R('"'),gr=R(")<\/script>");R('<template data-rci="" data-bid="'),R('<template data-rri="" data-bid="'),R('" data-sid="'),R('" data-sty="');var Bl=R('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'),yo=R('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),Cl=R('$RX("'),qa=R('"'),Di=R(","),pc=R(")<\/script>");R('<template data-rxi="" data-bid="'),R('" data-dgst="'),R('" data-msg="'),R('" data-stck="'),R('" data-cstck="');var Ls=/[<\u2028\u2029]/g,_l=/[&><\u2028\u2029]/g,ps=R(' media="not all" data-precedence="'),zl=R('" data-href="'),vc=R('">'),Kc=R("</style>"),ts=!1,Jc=!0,Hl=[],ja=R(' data-precedence="'),mf=R('" data-href="'),_i=R(" "),mu=R('">'),Os=R("</style>");R('<link rel="expect" href="#'),R('" blocking="render"/>');var mr=R(' id="'),Qc=R("["),xf=R(",["),bc=R(","),qc=R("]"),yc=0,wf=1,Lo=2,jc=3,Ra=/[<>\r\n]/g,Cf=/["';,\r\n]/g,Ps=Function.prototype.bind,Qf=Symbol.for("react.client.reference"),no={};Object.freeze(no);var ns={},ca=null,Yu={},$c={},Vu=new Set,$a=new Set,qf=new Set,Zu=new Set,mc=new Set,ec=new Set,_f=new Set,xc=new Set,Sf=new Set,yh={enqueueSetState:function(c,f,E){var D=c._reactInternals;D.queue===null?tt(c,"setState"):(D.queue.push(f),E!=null&&Se(E))},enqueueReplaceState:function(c,f,E){c=c._reactInternals,c.replace=!0,c.queue=[f],E!=null&&Se(E)},enqueueForceUpdate:function(c,f){c._reactInternals.queue===null?tt(c,"forceUpdate"):f!=null&&Se(f)}},xu={id:1,overflow:""},wu=Math.clz32?Math.clz32:Sn,cd=Math.log,ud=Math.LN2,ua=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),jf=null,fd=typeof Object.is=="function"?Object.is:pr,$o=null,Ia=null,yi=null,Sl=null,Xs=null,li=null,El=!1,vs=!1,wo=0,Cu=0,Ef=-1,$f=0,fa=null,ha=null,Xu=0,Ks=!1,wc,Cc={readContext:ho,use:function(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return Gr(c);if(c.$$typeof===ki)return ho(c)}throw Error("An unsupported type was passed to use(): "+String(c))},useContext:function(c){return wc="useContext",On(),c._currentValue},useMemo:sl,useReducer:oo,useRef:function(c){$o=On(),li=An();var f=li.memoizedState;return f===null?(c={current:c},Object.seal(c),li.memoizedState=c):f},useState:function(c){return wc="useState",oo(So,c)},useInsertionEffect:In,useLayoutEffect:In,useCallback:function(c,f){return sl(function(){return c},f)},useImperativeHandle:In,useEffect:In,useDebugValue:In,useDeferredValue:function(c,f){return On(),f!==void 0?f:c},useTransition:function(){return On(),[!1,Jl]},useId:function(){var c=Ia.treeContext,f=c.overflow;c=c.id,c=(c&~(1<<32-wu(c)-1)).toString(32)+f;var E=u;if(E===null)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");return f=wo++,c="_"+E.idPrefix+"R_"+c,0<f&&(c+="H"+f.toString(32)),c+"_"},useSyncExternalStore:function(c,f,E){if(E===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return E()},useOptimistic:function(c){return On(),[c,Zo]},useActionState:xo,useFormState:xo,useHostTransitionStatus:function(){return On(),Yr},useMemoCache:function(c){for(var f=Array(c),E=0;E<c;E++)f[E]=ra;return f},useCacheRefresh:function(){return cn},useEffectEvent:function(){return Ai}},u=null,p=null,T={getCacheForType:function(){throw Error("Not implemented.")},cacheSignal:function(){throw Error("Not implemented.")},getOwner:function(){return p===null?null:p.componentStack}},F=0,q,ce,Ae,ze,Dt,je,wt;Cn.__reactDisabledLog=!0;var en,mn,an=!1,Wt=new(typeof WeakMap=="function"?WeakMap:Map),Ir={react_stack_bottom_frame:function(c,f,E){return c(f,E)}},Si=Ir.react_stack_bottom_frame.bind(Ir),or={react_stack_bottom_frame:function(c){return c.render()}},Cr=or.react_stack_bottom_frame.bind(or),el={react_stack_bottom_frame:function(c){var f=c._init;return f(c._payload)}},tl=el.react_stack_bottom_frame.bind(el),Kr=0;if(typeof performance=="object"&&typeof performance.now=="function")var Co=performance,rs=function(){return Co.now()};else{var Mn=Date;rs=function(){return Mn.now()}}var Pn=4,ei=0,Hr=1,mi=2,Ni=3,Wr=4,Bn=5,Wl=14,hi=null,pl={},Ui={},is={},_u={},bs=!1,ka=!1,vl=!1,ao=0,Go=!1;Fs(),Fs(),_g.prerender=function(c,f){return new Promise(function(E,D){var Z=f?f.onHeaders:void 0,ie;Z&&(ie=function(et){Z(new Headers(et))});var we=me(f?f.identifierPrefix:void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.bootstrapScriptContent:void 0,f?f.bootstrapScripts:void 0,f?f.bootstrapModules:void 0),De=Ii(c,we,ge(we,void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.importMap:void 0,ie,f?f.maxHeadersLength:void 0),pe(f?f.namespaceURI:void 0),f?f.progressiveChunkSize:void 0,f?f.onError:void 0,function(){var et=new ReadableStream({type:"bytes",pull:function(Zt){hs(De,Zt)},cancel:function(Zt){De.destination=null,ci(De,Zt)}},{highWaterMark:0});et={postponed:wi(De),prelude:et},E(et)},void 0,void 0,D,f?f.onPostpone:void 0);if(f&&f.signal){var mt=f.signal;if(mt.aborted)ci(De,mt.reason);else{var Ge=function(){ci(De,mt.reason),mt.removeEventListener("abort",Ge)};mt.addEventListener("abort",Ge)}}hl(De)})},_g.renderToReadableStream=function(c,f){return new Promise(function(E,D){var Z,ie,we=new Promise(function(qt,Ft){ie=qt,Z=Ft}),De=f?f.onHeaders:void 0,mt;De&&(mt=function(qt){De(new Headers(qt))});var Ge=me(f?f.identifierPrefix:void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.bootstrapScriptContent:void 0,f?f.bootstrapScripts:void 0,f?f.bootstrapModules:void 0),et=To(c,Ge,ge(Ge,f?f.nonce:void 0,f?f.unstable_externalRuntimeSrc:void 0,f?f.importMap:void 0,mt,f?f.maxHeadersLength:void 0),pe(f?f.namespaceURI:void 0),f?f.progressiveChunkSize:void 0,f?f.onError:void 0,ie,function(){var qt=new ReadableStream({type:"bytes",pull:function(Ft){hs(et,Ft)},cancel:function(Ft){et.destination=null,ci(et,Ft)}},{highWaterMark:0});qt.allReady=we,E(qt)},function(qt){we.catch(function(){}),D(qt)},Z,f?f.onPostpone:void 0,f?f.formState:void 0);if(f&&f.signal){var Zt=f.signal;if(Zt.aborted)ci(et,Zt.reason);else{var jt=function(){ci(et,Zt.reason),Zt.removeEventListener("abort",jt)};Zt.addEventListener("abort",jt)}}hl(et)})},_g.resume=function(c,f,E){return new Promise(function(D,Z){var ie,we,De=new Promise(function(Zt,jt){we=Zt,ie=jt}),mt=Vr(c,f,ge(f.resumableState,E?E.nonce:void 0,void 0,void 0,void 0,void 0),E?E.onError:void 0,we,function(){var Zt=new ReadableStream({type:"bytes",pull:function(jt){hs(mt,jt)},cancel:function(jt){mt.destination=null,ci(mt,jt)}},{highWaterMark:0});Zt.allReady=De,D(Zt)},function(Zt){De.catch(function(){}),Z(Zt)},ie,E?E.onPostpone:void 0);if(E&&E.signal){var Ge=E.signal;if(Ge.aborted)ci(mt,Ge.reason);else{var et=function(){ci(mt,Ge.reason),Ge.removeEventListener("abort",et)};Ge.addEventListener("abort",et)}}hl(mt)})},_g.resumeAndPrerender=function(c,f,E){return new Promise(function(D,Z){var ie=xr(c,f,ge(f.resumableState,void 0,void 0,void 0,void 0,void 0),E?E.onError:void 0,function(){var mt=new ReadableStream({type:"bytes",pull:function(Ge){hs(ie,Ge)},cancel:function(Ge){ie.destination=null,ci(ie,Ge)}},{highWaterMark:0});mt={postponed:wi(ie),prelude:mt},D(mt)},void 0,void 0,Z,E?E.onPostpone:void 0);if(E&&E.signal){var we=E.signal;if(we.aborted)ci(ie,we.reason);else{var De=function(){ci(ie,we.reason),we.removeEventListener("abort",De)};we.addEventListener("abort",De)}}hl(ie)})},_g.version="19.2.0"})()),_g}var H2;function HT(){if(H2)return wg;H2=1;var n,e;return process.env.NODE_ENV==="production"?(n=NT(),e=FT()):(n=BT(),e=zT()),wg.version=n.version,wg.renderToString=n.renderToString,wg.renderToStaticMarkup=n.renderToStaticMarkup,wg.renderToReadableStream=e.renderToReadableStream,wg.resume=e.resume,wg}var VC=HT();const a1=L1(VC);function gp(n,e,t){return e!==void 0&&n<e?e:t!==void 0&&n>t?t:n}const kg={_canvas:null,_cache:new Map,_fontCache:{value:"",timestamp:0},_charWidthMap:new Map,clearCache(){this._cache.clear(),this._canvas=null,this._fontCache={value:"",timestamp:0},this._charWidthMap.clear()},getDefaultFont(){const n=Date.now();if(this._fontCache.value&&n-this._fontCache.timestamp<3e5)return this._fontCache.value;try{const e=getComputedStyle(document.documentElement).getPropertyValue("--Font").trim()||"400 14px pretendard";return this._fontCache={value:e,timestamp:n},e}catch{return"400 14px pretendard"}},measureCharWidth(n,e){var i,o,l,a,h,g;const t=`${n}|${e}`;if(this._charWidthMap.has(t))return this._charWidthMap.get(t);try{this._canvas||(this._canvas=document.createElement("canvas"));const m=this._canvas.getContext("2d");if(m){m.font=e;const x=m.measureText(n).width;return this._charWidthMap.set(t,x),x}}catch{}let r;return n===" "?r=parseInt(((i=e.match(/(\d+)px/))==null?void 0:i[1])||"14")/3:/^[A-Z]$/.test(n)?r=parseInt(((o=e.match(/(\d+)px/))==null?void 0:o[1])||"14")*.67:/^[a-z]$/.test(n)?r=parseInt(((l=e.match(/(\d+)px/))==null?void 0:l[1])||"14")*.5:/^\d$/.test(n)?r=parseInt(((a=e.match(/(\d+)px/))==null?void 0:a[1])||"14")*.6:/^[.,;:!?]$/.test(n)?r=parseInt(((h=e.match(/(\d+)px/))==null?void 0:h[1])||"14")*.25:r=parseInt(((g=e.match(/(\d+)px/))==null?void 0:g[1])||"14")*.67,this._charWidthMap.set(t,r),r},extractTextFromNode(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return`${n}`;if(Array.isArray(n))return n.map(e=>this.extractTextFromNode(e)).join("");if(B.isValidElement(n))try{const t=VC.renderToString(n).replace(/<[^>]*>/g,""),r=document.createElement("div");return r.innerHTML=t,r.textContent||""}catch{return n.props&&n.props.children?this.extractTextFromNode(n.props.children):""}return""},measureTextWidth(n,e){var o;if(!n)return 0;const t=e||this.getDefaultFont(),r=`${n}|${t}`,i=this._cache.get(r);if(i!==void 0)return i;try{this._canvas||(this._canvas=document.createElement("canvas"));const l=this._canvas.getContext("2d");if(l){l.font=t;const a=l.measureText(n),h=Math.ceil(a.width);return this._cache.size>=300&&[...this._cache.keys()].slice(0,50).forEach(m=>this._cache.delete(m)),this._cache.set(r,h),h}}catch{}try{const l=document.createElement("span");l.style.font=t,l.style.position="absolute",l.style.visibility="hidden",l.style.whiteSpace="nowrap",l.textContent=n,document.body.appendChild(l);const a=Math.ceil(l.getBoundingClientRect().width);return document.body.removeChild(l),this._cache.set(r,a),a}catch{}try{let l=0;for(let h=0;h<n.length;h++)l+=this.measureCharWidth(n[h],t);l*=.95;const a=Math.ceil(l);return this._cache.set(r,a),a}catch{}try{const l=parseInt(((o=t.match(/(\d+)px/))==null?void 0:o[1])||"14");let a=0;for(let g=0;g<n.length;g++){const m=n[g];m===" "?a+=.33:/^[A-Z]$/.test(m)?a+=.67:/^[a-z]$/.test(m)?a+=.5:/^\d$/.test(m)?a+=.6:/^[.,;:!?]$/.test(m)?a+=.25:a+=.67}const h=Math.ceil(a*l);return this._cache.set(r,h),h}catch{const a=n.length*10;return this._cache.set(r,a),a}},measureTextWithElementStyle(n,e){if(!e)return 0;try{const t=window.getComputedStyle(n),r=t.getPropertyValue("--Font").trim()||`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;return this.measureTextWidth(e,r)}catch{return this.measureTextWidth(e)}},measureReactNodeWidth(n){const e=this.extractTextFromNode(n);return this.measureTextWidth(e)},measureRenderedOptionWidth(n,e){if(n==null)return 0;const t=e(n),r=this.extractTextFromNode(t);return this.measureTextWidth(r)},calculateOptimalSelectWidth({elementRef:n,options:e=[],selectedOption:t=null,selectedOptions:r=[],placeholder:i="",optionRenderer:o,type:l="Primary",isMulti:a=!1}){if(!n.current)return 200;try{let h=0;if(e&&e.length>0){const _=[...e.length>0?[e[0]]:[],...e.length>1?[e[e.length-1]]:[],...e.length>10?Array.from({length:8},(R,k)=>e[Math.floor(k*e.length/8)]):e,...e.length>20?Array.from({length:5},()=>e[Math.floor(Math.random()*e.length)]):[]],S=Array.from(new Set(_.filter(Boolean)));for(const R of S){if(!R)continue;const k=this.measureRenderedOptionWidth(R,o);h=Math.max(h,k)}}let g=0;if(!a&&t)g=this.measureRenderedOptionWidth(t,o);else if(a&&r&&r.length){if(r.length===1)g=this.measureRenderedOptionWidth(r[0],o);else if(g=this.measureTextWidth(`${r.length} selected`),r.length>0){let _=0;for(const S of r){const R=this.measureRenderedOptionWidth(S,o);_=Math.max(_,R)}g=Math.max(g,_)}}let m=0;i&&(m=this.measureReactNodeWidth(i));const w=Math.max(h,g,m,50);if(n.current){const _=window.getComputedStyle(n.current),S=parseFloat(_.paddingLeft||"0")+parseFloat(_.paddingRight||"0"),R=parseFloat(_.borderLeftWidth||"0")+parseFloat(_.borderRightWidth||"0"),k=l==="Primary"?30:20,O=a?24:0,P=Math.ceil(w*.05)+10;return Math.ceil(w+S+R+k+O+P)}return w+60}catch{return 200}}};function ZC(n,e){const t=Gn.c(5),[r,i]=B.useState(0);let o,l;return t[0]!==r||t[1]!==n||t[2]!==e?(o=()=>{const a=()=>{const g=n.current,m=e.current;if(!g||!m)return i(0);const x=g.getBoundingClientRect(),w=m.getBoundingClientRect(),_=Math.max(0,Math.round(x.right-w.left));_!==r&&i(_)};a();const h=new ResizeObserver(a);return n.current&&h.observe(n.current),e.current&&h.observe(e.current),window.addEventListener("resize",a),()=>{h.disconnect(),window.removeEventListener("resize",a)}},l=[n,e,r],t[0]=r,t[1]=n,t[2]=e,t[3]=o,t[4]=l):(o=t[3],l=t[4]),B.useEffect(o,l),r}var ic=(n=>(n.E="East",n.N="North",n.S="South",n.W="West",n))(ic||{}),O1=(n=>(n.E="East",n.EN="EastNorth",n.ES="EastSouth",n.N="North",n.NE="NorthEast",n.NW="NorthWest",n.S="South",n.SE="SouthEast",n.SW="SouthWest",n.W="West",n.WN="WestNorth",n.WS="WestSouth",n))(O1||{});function mm(n,e,t,r){if(!n.current||!e.current)return;const i=n.current.getBoundingClientRect(),o=e.current.getBoundingClientRect();let l={bottom:void 0,left:void 0,right:void 0,top:void 0};switch(t){case"North":l=o?{bottom:window.innerHeight-i.top,left:i.left+i.width/2-o.width/2}:{bottom:window.innerHeight-i.top,left:i.left};break;case"NorthWest":l={bottom:window.innerHeight-i.top,left:i.left};break;case"NorthEast":l={bottom:window.innerHeight-i.top,right:window.innerWidth-i.left-i.width};break;case"South":l=o?{top:i.bottom,left:i.left+i.width/2-o.width/2}:{top:i.bottom,left:i.left};break;case"SouthWest":l={top:i.bottom,left:i.left};break;case"SouthEast":l={top:i.bottom,right:window.innerWidth-i.left-i.width};break;case"East":l=o?{top:i.top+i.height/2-o.height/2,left:i.right}:{top:i.top,left:i.right};break;case"EastNorth":l={bottom:window.innerHeight-i.top-i.height,left:i.right};break;case"EastSouth":l={top:i.top,left:i.right};break;case"West":l=o?{top:i.top+i.height/2-o.height/2,right:window.innerWidth-i.left}:{top:i.top,right:window.innerWidth-i.left};break;case"WestNorth":l={bottom:window.innerHeight-i.top-i.height,right:window.innerWidth-i.left};break;case"WestSouth":l={top:i.top,right:window.innerWidth-i.left};break;default:l={top:i.top,left:i.left}}r&&(r.x&&l.left&&(l.left+=r.x),r.y&&l.top&&(l.top+=r.y)),l=KC(l,o),e.current.style.top=l.top+"px",e.current.style.left=l.left+"px",e.current.style.bottom=l.bottom+"px",e.current.style.right=l.right+"px"}function XC(n,e,t,r){if(!n)return;const i=e instanceof HTMLElement?e:e==null?void 0:e.current;if(!i)return;const o=n.getBoundingClientRect(),l=i.getBoundingClientRect();let a={bottom:void 0,left:void 0,right:void 0,top:void 0};switch(t){case"North":a=l?{bottom:window.innerHeight-o.top,left:o.left+o.width/2-l.width/2}:{bottom:window.innerHeight-o.top,left:o.left};break;case"NorthWest":a={bottom:window.innerHeight-o.top,left:o.left};break;case"NorthEast":a={bottom:window.innerHeight-o.top,right:window.innerWidth-o.left-o.width};break;case"South":a=l?{top:o.bottom,left:o.left+o.width/2-l.width/2}:{top:o.bottom,left:o.left};break;case"SouthWest":a={top:o.bottom,left:o.left};break;case"SouthEast":a={top:o.bottom,right:window.innerWidth-o.left-o.width};break;case"East":a=l?{top:o.top+o.height/2-l.height/2,left:o.right}:{top:o.top,left:o.right};break;case"EastNorth":a={bottom:window.innerHeight-o.top-o.height,left:o.right};break;case"EastSouth":a={top:o.top,left:o.right};break;case"West":a=l?{top:o.top+o.height/2-l.height/2,right:window.innerWidth-o.left}:{top:o.top,right:window.innerWidth-o.left};break;case"WestNorth":a={bottom:window.innerHeight-o.top-o.height,right:window.innerWidth-o.left};break;case"WestSouth":a={top:o.top,right:window.innerWidth-o.left};break;default:a={top:o.top,left:o.left}}return r&&(r.x&&a.left&&(a.left+=r.x),r.y&&a.top&&(a.top+=r.y)),a=KC(a,l),i.style.top=a.top+"px",i.style.left=a.left+"px",i.style.bottom=a.bottom+"px",i.style.right=a.right+"px",a}function KC(n,e,t=10){return n.left&&n.left<t&&(n.left=t),n.right&&n.right<t&&(n.right=t),n.top&&n.top<t&&(n.top=t),n.bottom&&n.bottom<t&&(n.bottom=t),n.left&&e&&n.left+e.width>window.innerWidth-t&&(n.left=window.innerWidth-e.width-t),n.right&&e&&n.right+e.width>window.innerWidth-t&&(n.right=window.innerWidth-e.width-t),n.top&&e&&n.top+e.height>window.innerHeight-t&&(n.top=window.innerHeight-e.height-t),n.bottom&&e&&n.bottom+e.height>window.innerHeight-t&&(n.bottom=window.innerHeight-e.height-t),n}function Eg(){const n={preventDefault:!1};return{event:n,e:{preventDefault:()=>n.preventDefault=!0}}}const WT="_Tooltip_1khnz_1",UT="_Arrow_1khnz_17",W2={Tooltip:WT,Arrow:UT},JC=n=>{const e=Gn.c(28),{tooltip:t,targetRef:r,delay:i,distance:o,direction:l}=n,a=i===void 0?0:i,h=o===void 0?10:o,g=l===void 0?ic.S:l,[m,x]=B.useState(!1),w=B.useRef(null),_=B.useRef(null),S=B.useRef(null);let R;e[0]!==a||e[1]!==g||e[2]!==h||e[3]!==r?(R=()=>{x(!0),S.current&&(clearTimeout(S.current),S.current=null);const ue=setTimeout(()=>U2(r,w,_,h,g),a);S.current=ue},e[0]=a,e[1]=g,e[2]=h,e[3]=r,e[4]=R):R=e[4];const k=R;let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=()=>x(!1),e[5]=O):O=e[5];const P=O;let z,H;e[6]!==k||e[7]!==r?(z=()=>{const ue=r.current;if(ue)return ue.addEventListener("mouseenter",k),ue.addEventListener("mouseleave",P),()=>{ue.removeEventListener("mouseenter",k),ue.removeEventListener("mouseleave",P)}},H=[r,P,k],e[6]=k,e[7]=r,e[8]=z,e[9]=H):(z=e[8],H=e[9]),B.useEffect(z,H);let G;e[10]!==g||e[11]!==h||e[12]!==r?(G=()=>{U2(r,w,_,h,g)},e[10]=g,e[11]=h,e[12]=r,e[13]=G):G=e[13];const N=G;let J,Y;e[14]!==m||e[15]!==N||e[16]!==r?(J=()=>{if(!r.current||!w.current||!m)return;const ue=r.current.parentElement;let se=ue;for(;se;)se.addEventListener("scroll",N),se=se.parentElement;return()=>{let $=ue;for(;$;)$.removeEventListener("scroll",N),$=$.parentElement}},Y=[r,N,m],e[14]=m,e[15]=N,e[16]=r,e[17]=J,e[18]=Y):(J=e[17],Y=e[18]),B.useEffect(J,Y);let K;e[19]!==N?(K=()=>{N()},e[19]=N,e[20]=K):K=e[20];let fe;e[21]!==N||e[22]!==t?(fe=[t,N],e[21]=N,e[22]=t,e[23]=fe):fe=e[23],B.useEffect(K,fe);let X;e:switch(typeof t){case"boolean":{X=!0;break e}case"string":{X=t==="";break e}case"number":{X=!1;break e}default:X=!t}if(!m||X)return null;let ne;if(e[24]!==t){let ue;e[26]===Symbol.for("react.memo_cache_sentinel")?(ue=dt.clsx(W2.Tooltip,"NoSelect"),e[26]=ue):ue=e[26];let se;e[27]===Symbol.for("react.memo_cache_sentinel")?(se=M.jsx("div",{ref:_,className:W2.Arrow}),e[27]=se):se=e[27],ne=su.createPortal(M.jsxs("div",{ref:w,className:ue,children:[t,se]}),document.body),e[24]=t,e[25]=ne}else ne=e[25];return ne},u0="5px solid var(--ATooltip_background-color)";function U2(n,e,t,r,i=ic.S){if(!n.current||!e.current||!t.current)return;const o=GT(n.current,e.current,r,i);if(!o)return;const{left:l,top:a,arrowDir:h,arrow:g}=o;e.current.style.left=`${l}px`,e.current.style.top=`${a}px`,e.current.style.visibility="visible",e.current.style.opacity="1",t.current.style.border="5px solid transparent",h===ic.N?(t.current.style.top="-9px",t.current.style.left=`calc(50% - 5px + ${g.left??0}px)`,t.current.style.borderBottom=u0):h===ic.S?(t.current.style.top="100%",t.current.style.left=`calc(50% - 5px + ${g.left??0}px)`,t.current.style.borderTop=u0):h===ic.W?(t.current.style.top=`calc(50% - 5px + ${g.top??0}px)`,t.current.style.left="-9px",t.current.style.borderRight=u0):h===ic.E&&(t.current.style.top=`calc(50% - 5px + ${g.top??0}px)`,t.current.style.left="100%",t.current.style.borderLeft=u0)}const Gd=5;function GT(n,e,t,r){const i=n.getBoundingClientRect(),o=e.getBoundingClientRect();function l(){if(window.innerHeight-i.bottom>o.height+t){const m=i.bottom+t,x=i.left+(i.width-o.width)/2,w=gp(x,Gd,window.innerWidth-Gd-o.width),_=ic.N;return{left:w,top:m,arrowDir:_,arrow:{left:x-w}}}}function a(){if(i.top>o.height+t){const m=i.top-o.height-t,x=i.left+(i.width-o.width)/2,w=gp(x,Gd,window.innerWidth-Gd-o.width),_=ic.S;return{left:w,top:m,arrowDir:_,arrow:{left:x-w}}}}function h(){if(window.innerWidth-i.right>o.width+t){const m=i.right+t,x=i.top+(i.height-o.height)/2,w=gp(x,Gd,window.innerHeight-Gd-o.height),_=ic.W;return{left:m,top:w,arrowDir:_,arrow:{top:x-w}}}}function g(){if(i.left>o.width+t){const m=i.left-o.width-t,x=i.top+(i.height-o.height)/2,w=gp(x,Gd,window.innerHeight-Gd-o.height),_=ic.E;return{left:m,top:w,arrowDir:_,arrow:{top:x-w}}}}if(r===ic.E)return h()||g()||l()||a();if(r===ic.S)return l()||a()||h()||g();if(r===ic.W)return g()||h()||l()||a();if(r===ic.N)return a()||l()||h()||g()}const YT="_ABase_c7a1t_1",VT="_UseDimming_c7a1t_6",ZT="_Dimmer_c7a1t_6",XT="_Spinner_c7a1t_9",KT="_Dimmed_c7a1t_12",JT="_HasProgress_c7a1t_18",QT="_IsDimmed_c7a1t_36",qT="_IsLoading_c7a1t_41",jT="_IsDisabled_c7a1t_46",qg={ABase:YT,UseDimming:VT,Dimmer:ZT,Spinner:XT,Dimmed:KT,HasProgress:JT,IsDimmed:QT,IsLoading:qT,IsDisabled:jT},zi=n=>{const e=Gn.c(27),{children:t,abaseRef:r,abaseCallbackRef:i,isDisabled:o,isLoading:l,isDimmed:a,tooltip:h,tooltipDistance:g,tooltipDelay:m,tooltipDirection:x,progress:w,ProgressRenderer:_,progressProps:S,...R}=n,k=g===void 0?10:g,O=m===void 0?0:m,P=x===void 0?ic.S:x,z=_===void 0?$T:_,H=B.useRef(null),G=r??H;let N;e:{if(typeof o=="string"&&o!==""){N=o;break e}else if(h!==void 0){N=h;break e}N=""}const J=N,Y=o||l||a,K=o!==void 0||l!==void 0||a!==void 0,fe=typeof w=="number"&&l,X=i||G,te=dt.clsx(R.className,qg.ABase,K&&qg.UseDimming,Y&&qg.Dimmed,fe&&qg.HasProgress);let ne;e[0]!==a||e[1]!==fe||e[2]!==o||e[3]!==l||e[4]!==K?(ne=K&&M.jsx("div",{className:dt.sclsx(qg,"Dimmer",o&&"IsDisabled",l&&"IsLoading",a&&"IsDimmed",fe&&"HasProgress")}),e[0]=a,e[1]=fe,e[2]=o,e[3]=l,e[4]=K,e[5]=ne):ne=e[5];let ue;e[6]!==z||e[7]!==fe||e[8]!==o||e[9]!==l||e[10]!==w||e[11]!==S?(ue=l&&M.jsxs("div",{className:dt.sclsx(qg,"Spinner",o&&"IsDisabled",l&&"IsLoading",fe&&"HasProgress"),children:[M.jsx(fo,{icon:"Spinner"}),M.jsx(B.Activity,{mode:fe?"visible":"hidden",children:M.jsx(z,{progress:w??0,...S})})]}),e[6]=z,e[7]=fe,e[8]=o,e[9]=l,e[10]=w,e[11]=S,e[12]=ue):ue=e[12];let se;e[13]!==G||e[14]!==J||e[15]!==O||e[16]!==P||e[17]!==k?(se=M.jsx(JC,{delay:O,direction:P,distance:k,targetRef:G,tooltip:J}),e[13]=G,e[14]=J,e[15]=O,e[16]=P,e[17]=k,e[18]=se):se=e[18];let $;return e[19]!==t||e[20]!==R||e[21]!==X||e[22]!==te||e[23]!==ne||e[24]!==ue||e[25]!==se?($=M.jsxs("div",{...R,ref:X,className:te,children:[t,ne,ue,se]}),e[19]=t,e[20]=R,e[21]=X,e[22]=te,e[23]=ne,e[24]=ue,e[25]=se,e[26]=$):$=e[26],$},$T=n=>{const e=Gn.c(6);let t,r;e[0]!==n?({progress:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;return e[3]!==t||e[4]!==r?(i=M.jsx(YC,{progress:t,...r}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i},eA="_AButton_vulhu_1",tA="_Primary_vulhu_14",nA="_Secondary_vulhu_19",rA="_Alter_vulhu_24",iA="_AIconButton_vulhu_30",oA="_AThemeButton_vulhu_71",Tp={AButton:eA,Primary:tA,Secondary:nA,Alter:rA,AIconButton:iA,AThemeButton:oA},lA=["Primary","Secondary","Alter","Raw"],Ic=n=>{const e=Gn.c(17);let t,r,i,o;e[0]!==n?({type:o,onClick:r,noInteractive:i,...t}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o):(t=e[1],r=e[2],i=e[3],o=e[4]);const l=o===void 0?"Primary":o,a=t.isDisabled||t.isLoading;let h;e[5]!==r||e[6]!==a?(h=w=>{a||r==null||r(w)},e[5]=r,e[6]=a,e[7]=h):h=e[7];const g=h;let m;e[8]!==t.className||e[9]!==i||e[10]!==l||e[11]!==a?(m=dt.clsx(t.className,Tp.AButton,l!=="Raw"&&Tp[l],"IsClickable",!a&&!i&&"IsInteractive"),e[8]=t.className,e[9]=i,e[10]=l,e[11]=a,e[12]=m):m=e[12];let x;return e[13]!==t||e[14]!==g||e[15]!==m?(x=M.jsx(zi,{...t,className:m,onClick:g}),e[13]=t,e[14]=g,e[15]=m,e[16]=x):x=e[16],x},sA=["Primary","Secondary","Raw"],ba=n=>{const e=Gn.c(29);let t,r,i,o,l,a,h,g,m;e[0]!==n?({icon:o,iconSize:l,type:g,onClick:i,isDisabled:a,isLoading:h,tooltip:m,className:r,...t}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9]);const x=g===void 0?"Primary":g,w=a||h;let _;e[10]!==i||e[11]!==w?(_=z=>{w||i==null||i(z)},e[10]=i,e[11]=w,e[12]=_):_=e[12];const S=_;let R;e:{if(ym.includes(o)){let z;e[13]!==o||e[14]!==l?(z=M.jsx(fo,{icon:o,size:l}),e[13]=o,e[14]=l,e[15]=z):z=e[15],R=z;break e}R=o}const k=R;let O;e[16]!==r||e[17]!==a||e[18]!==h||e[19]!==x?(O=dt.clsx(Tp.AIconButton,!a&&!h&&"IsClickable",x!=="Raw"&&Tp[x],r),e[16]=r,e[17]=a,e[18]=h,e[19]=x,e[20]=O):O=e[20];let P;return e[21]!==t||e[22]!==k||e[23]!==a||e[24]!==h||e[25]!==S||e[26]!==O||e[27]!==m?(P=M.jsx(zi,{className:O,isDisabled:a,isLoading:h,tooltip:m,onClick:S,...t,children:k}),e[21]=t,e[22]=k,e[23]=a,e[24]=h,e[25]=S,e[26]=O,e[27]=m,e[28]=P):P=e[28],P};function Fo(n,e){n!==void 0&&n.length===1&&(e=n[0]);const t=B.useState(e);let r;return n===void 0||n.length===1?r=t:r=n,r}const aA="_AWrap_u1f1h_1",cA="_Label_u1f1h_8",uA="_Asterisk_u1f1h_19",fA="_HelperTextConatiner_u1f1h_23",hA="_HelperText_u1f1h_23",jg={AWrap:aA,Label:cA,Asterisk:uA,HelperTextConatiner:fA,HelperText:hA,Error:"_Error_u1f1h_38"},dA=["Default","Error"],Bg=n=>{if(!n)return[{},{}];const e={},t={},r=["errorMessage","helperText","label","labelProps","wrapId","wrapProps","wrapType"];for(const i in n)r.includes(i)?e[i]=n[i]:t[i]=n[i];return[e,t]},lg=n=>{const{wrapProps:e,errorMessage:t,helperText:r,wrapType:i="Default",label:o,labelProps:l,wrapId:a,children:h}=n,g=B.useRef(null),[m,x]=B.useState({height:0}),w=B.useRef(null),[_,S]=B.useMemo(()=>{let k=r,O=i;if(Array.isArray(t)){const P=t.filter(Boolean);P.length>0&&([k,O]=[P,"Error"])}else t&&([k,O]=[t,"Error"]);return Array.isArray(k)&&(O!=="Error"&&(k=k.filter(Boolean)),k=k.map((P,z)=>M.jsxs(B.Fragment,{children:[P,M.jsx("br",{})]},$n.key(z)))),[k,O]},[r,t,i]);B.useEffect(()=>{if(!_||!g.current)x({height:0});else{const k=g.current.getBoundingClientRect();x({height:k.height,marginTop:k.height===0?0:6})}},[_]);const R=B.useMemo(()=>{switch(typeof(l==null?void 0:l.prefix)){case"string":return M.jsx(fo,{height:"1rem",icon:l.prefix,width:"1rem"});case"boolean":return M.jsx(fo,{height:10,icon:"Target",width:10});default:return l==null?void 0:l.prefix}},[l==null?void 0:l.prefix]);return M.jsxs("div",{...e,ref:w,className:dt.clsx(e==null?void 0:e.className,jg.AWrap),id:a,children:[o&&M.jsxs("div",{className:dt.clsx(jg.Label,"NoSelect",l==null?void 0:l.className),style:l==null?void 0:l.style,children:[l==null?void 0:l.leftAddon,R,o,(l==null?void 0:l.asterisk)&&M.jsx(zi,{className:jg.Asterisk,tooltip:Or.AWrap.Asterisk,children:"*"}),l==null?void 0:l.rightAddon]}),h,_!==void 0&&M.jsx("div",{className:dt.clsx(jg.HelperTextConatiner,"NoSelect"),style:m,children:M.jsx("div",{ref:g,className:dt.clsx(jg.HelperText,jg[S]),children:_})})]})},gA="_ASwitch_nlcij_1",pA="_Track_nlcij_6",vA="_Truthy_nlcij_13",bA="_Thumb_nlcij_17",$1={ASwitch:gA,Track:pA,Truthy:vA,Thumb:bA},QC=n=>{const e=Gn.c(33);let t,r;if(e[0]!==n){const{useCheck:G,...N}=n;r=G,t=Bg(N),e[0]=n,e[1]=t,e[2]=r}else t=e[1],r=e[2];const[i,o]=t;let l,a,h,g;e[3]!==i?({wrapId:a,wrapProps:h,labelProps:l,...g}=i,e[3]=i,e[4]=l,e[5]=a,e[6]=h,e[7]=g):(l=e[4],a=e[5],h=e[6],g=e[7]);const[m,x]=Fo(r,!1);let w;e[8]!==m||e[9]!==o||e[10]!==x?(w=G=>{var N;o.isDisabled||o.isLoading||(x==null||x(!m),(N=o.onClick)==null||N.call(o,G))},e[8]=m,e[9]=o,e[10]=x,e[11]=w):w=e[11];const _=w;let S;e[12]!==l||e[13]!==a||e[14]!==h||e[15]!==g?(S={wrapId:a,wrapProps:h,labelProps:l,...g},e[12]=l,e[13]=a,e[14]=h,e[15]=g,e[16]=S):S=e[16];let R;e[17]!==m?(R=dt.clsx($1.Track,m&&$1.Truthy),e[17]=m,e[18]=R):R=e[18];let k;e[19]!==m?(k=dt.clsx($1.Thumb,m&&$1.Truthy),e[19]=m,e[20]=k):k=e[20];let O;e[21]!==k?(O=M.jsx("div",{className:k}),e[21]=k,e[22]=O):O=e[22];let P;e[23]!==R||e[24]!==O?(P=M.jsx("div",{className:R,children:O}),e[23]=R,e[24]=O,e[25]=P):P=e[25];let z;e[26]!==_||e[27]!==o||e[28]!==P?(z=M.jsx(zi,{...o,className:$1.ASwitch,onClick:_,children:P}),e[26]=_,e[27]=o,e[28]=P,e[29]=z):z=e[29];let H;return e[30]!==S||e[31]!==z?(H=M.jsx(lg,{...S,children:z}),e[30]=S,e[31]=z,e[32]=H):H=e[32],H},yA={palette:{"mode-1":{"common-100":"#ffffff","common-0":"#000000","neutral-99":"#fcfcfc","neutral-94":"#efefef","neutral-89":"#e2e2e2","neutral-84":"#d6d6d6","neutral-79":"#c9c9c9","neutral-73":"#bababa","neutral-65":"#a5a5a5","neutral-54":"#898989","neutral-42":"#6b6b6b","neutral-30":"#4c4c4c","neutral-20":"#333333","neutral-15":"#2c2c2c","neutral-10":"#191919","neutral-5":"#0c0c0c","cool-neutral-99":"#fcfcfc","cool-neutral-94":"#efeff0","cool-neutral-89":"#e1e2e4","cool-neutral-84":"#d4d5d7","cool-neutral-79":"#c7c8cb","cool-neutral-73":"#b7b9bc","cool-neutral-65":"#a2a4a9","cool-neutral-54":"#85888e","cool-neutral-42":"#66696f","cool-neutral-30":"#494b4f","cool-neutral-20":"#303235","cool-neutral-10":"#18191a","cool-neutral-5":"#0c0c0c","red-99":"#fff9f9","red-95":"#ffe5e5","red-90":"#ffcccc","red-84":"#ffadad","red-76":"#ff8484","red-66":"#ff5151","red-53":"#ff0f0f","red-45":"#e50000","red-34":"#a80000","red-30":"#990000","red-24":"#7a0000","red-10":"#330000","green-99":"#fafffa","green-95":"#e5ffe8","green-90":"#ccffd1","green-84":"#adffb6","green-76":"#84ff90","green-66":"#51ff62","green-48":"#00f418","green-45":"#00e517","green-34":"#00a810","green-30":"#00990f","green-24":"#007a0c","green-10":"#003305","blue-99":"#fafdff","blue-95":"#e5f3ff","blue-90":"#cce6ff","blue-84":"#add7ff","blue-76":"#84c3ff","blue-66":"#51abff","blue-53":"#0f8bff","blue-45":"#0077e5","blue-34":"#0056a8","blue-30":"#004f99","blue-24":"#003f7a","blue-10":"#001a33","orange-99":"#fffcfa","orange-95":"#ffefe5","orange-90":"#ffdecc","orange-84":"#ffcbad","orange-76":"#ffb184","orange-66":"#ff9151","orange-53":"#ff670f","orange-45":"#e55400","orange-34":"#a83d00","orange-30":"#993800","orange-24":"#7a2c00","orange-10":"#331200","violet-99":"#fcfaff","violet-95":"#eee5ff","violet-90":"#dcccff","violet-84":"#c7adff","violet-76":"#ab84ff","violet-66":"#8852ff","violet-53":"#5b0fff","violet-45":"#4900e5","violet-34":"#3500a8","violet-28":"#2d008e","violet-24":"#26007a","violet-10":"#100033","cyan-99":"#faffff","cyan-95":"#e5fdff","cyan-90":"#ccfbff","cyan-84":"#adf9ff","cyan-76":"#84f6ff","cyan-66":"#51f3ff","cyan-50":"#00edff","cyan-45":"#00d6e5","cyan-40":"#00becc","cyan-30":"#008e99","cyan-21":"#00636b","cyan-10":"#002f33","pink-99":"#fffefa","pink-95":"#ffe5f5","pink-90":"#ffccea","pink-84":"#ffadde","pink-76":"#ff84ce","pink-66":"#ff51b9","pink-53":"#ff0f9f","pink-45":"#e5008a","pink-40":"#cc007a","pink-30":"#99005b","pink-21":"#6b0040","pink-10":"#33001e","lime-99":"#fcfffa","lime-95":"#eeffe5","lime-90":"#ddffcc","lime-84":"#c8ffad","lime-76":"#adff84","lime-66":"#8bff51","lime-49":"#53f900","lime-45":"#4ce500","lime-40":"#44cc00","lime-30":"#339900","lime-21":"#236b00","lime-10":"#113300","brand-b-color":"#386fff"}},semantic:{light:{"static-white":"common-100","static-black":"common-0","acent-brand":"brand-b-color","acent-brand-fill":"blue-95","label-normal":"neutral-20","label-strong":"neutral-5","label-neutral":"neutral-73","line-normal":"neutral-79","line-strong":"neutral-65","line-neutral":"neutral-89","background-normal":"common-100","elevation-0":"common-100","elevation-10":"neutral-94","elevation-20":"neutral-73","alert-warning":"orange-53","alert-success":"green-45","alert-danger":"red-45","inverse-label-normal":"neutral-84","inverse-label-strong":"neutral-99","inverse-label-neutral":"neutral-30","inverse-line-normal":"neutral-30","inverse-line-strong":"neutral-54","inverse-line-neutral":"neutral-20","inverse-elevation-0":"neutral-5","inverse-elevation-10":"neutral-10","inverse-elevation-20":"neutral-15"},dark:{"static-white":"common-100","static-black":"common-0","acent-brand":"brand-b-color","acent-brand-fill":"blue-10","label-normal":"neutral-84","label-strong":"neutral-99","label-neutral":"neutral-30","line-normal":"neutral-30","line-strong":"neutral-54","line-neutral":"neutral-20","background-normal":"neutral-5","elevation-0":"neutral-5","elevation-10":"neutral-10","elevation-20":"neutral-15","alert-warning":"orange-53","alert-success":"green-45","alert-danger":"red-45","inverse-label-normal":"neutral-20","inverse-label-strong":"neutral-5","inverse-label-neutral":"neutral-73","inverse-line-normal":"neutral-79","inverse-line-strong":"neutral-65","inverse-line-neutral":"neutral-89","inverse-elevation-0":"common-100","inverse-elevation-10":"neutral-94","inverse-elevation-20":"neutral-73"}}},lc=tg.cloneDeep(yA);$n.keys(lc.semantic).forEach(n=>{const e=lc.semantic[n];$n.keys(e).forEach(t=>{e[t]=`var(--${e[t]})`})});const Sv=$n.keys(lc.palette),qC=$n.keys(lc.palette[Sv[0]]);function mA(){return va.paletteMode}function xA(n,e=va.paletteMode){return lc.palette[e][n]}function wA(n){return Tv(n)}const $0=[];function jC(n){va.paletteMode=n,qC.forEach(e=>document.documentElement.style.setProperty(`--${e}`,lc.palette[n][e])),$0.forEach(e=>e(n))}function $C(n,e="all"){$n.keys(n).forEach(r=>{const i=n[r];i!==void 0&&(document.documentElement.style.setProperty(`--${r}`,i),e==="all"?Sv.forEach(o=>{lc.palette[o][r]=i}):lc.palette[e][r]=i)})}const x1=$n.keys(lc.semantic),e3=$n.keys(lc.semantic[x1[0]]);function CA(){return va.semanticMode}function _A(n,e=va.semanticMode){return lc.semantic[e][n]}function SA(n){return Tv(n)}const ev=[];function xm(n){va.semanticMode=n,document.documentElement.setAttribute("data-theme",n),e3.forEach(e=>document.documentElement.style.setProperty(`--${e}`,lc.semantic[n][e])),ev.forEach(e=>e(n)),va.save==="localStorage"?localStorage.setItem("semanticMode",n):va.save==="sessionStorage"&&sessionStorage.setItem("semanticMode",n)}function t3(n,e=va.semanticMode){$n.keys(n).forEach(r=>{const i=n[r];i!==void 0&&(document.documentElement.style.setProperty(`--${r}`,i),e==="all"?x1.forEach(o=>{lc.semantic[o][r]=i}):lc.semantic[e][r]=i)})}const n3=["Body-background-color","Body-color","Body-transition","Font","Scrollbar-handle","Scrollbar-handle-hover","Scrollbar-handle-active","Scrollbar-track","Scrollbar-border-radius","Scrollbar-width","Transition","Transition-Enabled"],r3=["ABase_Dimming_background-color"],i3=["ATooltip_background-color","ATooltip_color"],o3=["AButton_Primary_border","AButton_Primary_background-color","AButton_Primary_color","AButton_Secondary_border","AButton_Secondary_background-color","AButton_Secondary_color","AButton_Alter_border","AButton_Alter_background-color","AButton_Alter_color"],l3=["AInput_Primary_background-color","AInput_Primary_border","AInput_Primary_color","AInput_Primary_hover_border","AInput_Primary_focus_background-color","AInput_Primary_focus_border","AInput_Primary_placeholder_color","AInput_Secondary_background-color","AInput_Secondary_border","AInput_Secondary_color","AInput_Secondary_hover_border","AInput_Secondary_focus_border","AInput_Secondary_placeholder_color","AInput_ReadOnly_background-color","AInput_ReadOnly_border","AInput_ReadOnly_color","AInput_Error_HelperText_color","AInput_Error_background-color","AInput_Error_border","AInput_Error_color","AInput_Error_placeholder_color"],s3=["ATextArea_Primary_background-color","ATextArea_Primary_border","ATextArea_Primary_color","ATextArea_Primary_hover_border","ATextArea_Primary_focus_background-color","ATextArea_Primary_focus_border","ATextArea_Secondary_background-color","ATextArea_Secondary_border","ATextArea_Secondary_color","ATextArea_Secondary_hover_border","ATextArea_Secondary_focus_border","ATextArea_ReadOnly_background-color","ATextArea_ReadOnly_border","ATextArea_ReadOnly_color","ATextArea_Error_background-color","ATextArea_Error_border","ATextArea_Error_color","ATextArea_Error_placeholder_color"],a3=["AEditor_Primary_background-color","AEditor_Primary_border","AEditor_Primary_color","AEditor_Primary_hover_border","AEditor_Primary_focus_background-color","AEditor_Primary_focus_border","AEditor_ReadOnly_background-color","AEditor_ReadOnly_border","AEditor_ReadOnly_hover_border","AEditor_ReadOnly_focus_border","AEditor_ReadOnly_color","AEditor_Error_background-color","AEditor_Error_border","AEditor_Error_hover_border","AEditor_Error_focus_border","AEditor_Error_color","AEditor_Error_placeholder_color","AEditor_Addon_Primary_background-color","AEditor_Addon_Primary_border","AEditor_Addon_Primary_color","AEditor_Addon_Secondary_background-color","AEditor_Addon_Secondary_border","AEditor_Addon_Secondary_color","AEditor_Addon_hover_background-color","AEditor_Addon_hover_color","AEditor_Addon_focus_border","AEditor_border-radius","AEditor_Select_border-radius","AEditor_Option_border-radius"],c3=["ACheckBox_color"],u3=["ADialog_Paper_background-color","ADialog_background-color","ADialog_border","ADialog_Action_background-color"],f3=["ASelect_Placeholder_color","ASelect_Primary_border","ASelect_Primary_hover_border","ASelect_Primary_Arrow_color","ASelect_Primary_Options_background-color","ASelect_Primary_Options_border","ASelect_Primary_Option_hover_background-color","ASelect_Primary_Option_active_background-color","ASelect_Primary_Option_Selected_background-color","ASelect_Secondary_border","ASelect_Secondary_hover_border","ASelect_Secondary_background-color","ASelect_Secondary_Arrow_color","ASelect_Secondary_Options_background-color","ASelect_Secondary_Options_border","ASelect_Secondary_Option_hover_background-color","ASelect_Secondary_Option_active_background-color","ASelect_Secondary_Option_Selected_background-color"],h3=["AMultiSelect_Placeholder_color","AMultiSelect_Primary_border","AMultiSelect_Primary_hover_border","AMultiSelect_Primary_Arrow_color","AMultiSelect_Primary_Options_background-color","AMultiSelect_Primary_Options_border","AMultiSelect_Primary_Option_hover_background-color","AMultiSelect_Primary_Option_active_background-color","AMultiSelect_Primary_Option_Selected_background-color","AMultiSelect_Secondary_border","AMultiSelect_Secondary_hover_border","AMultiSelect_Secondary_background-color","AMultiSelect_Secondary_Arrow_color","AMultiSelect_Secondary_Options_background-color","AMultiSelect_Secondary_Options_border","AMultiSelect_Secondary_Option_hover_background-color","AMultiSelect_Secondary_Option_active_background-color","AMultiSelect_Secondary_Option_Selected_background-color"],d3=["ATree_background-color","ATree_Indent_border","ATreeBodyHeader_border-bottom","ATreeItem_hover_background-color","ATreeItem_active_background-color","ATreeItem_select_background-color","ATreeItem_search_background-color","ATreeItem_search_border-top","ATreeItem_search_border-bottom","ATreeItem_select_color"],g3=["ASwitch_Track_Falsy_border","ASwitch_Track_Truthy_border","ASwitch_Thumb_border"],p3=["ATab_IndicatorTrack_Primary_border-bottom","ATab_Indicator_Primary_background-color","ATab_Option_Secondary_border","ATab_Option_Secondary_IsSelected_border-bottom","ATab_Option_Secondary_IsDisabled_border","ATab_IndicatorTrack_Tertiary_background-color","ATab_Indicator_Tertiary_background-color","ATab_Option_Tertiary_color","ATab_Option_Tertiary_IsSelected_color","ATab_Option_Quaternary_color","ATab_Option_Quaternary_IsSelected_color"],v3=["AFileBox_border","AFileBox_background-color","AFileBox_SelectedFile_color","AFileBox_Dropping_color"],b3=["AFileUploader_background-color","AFileUploader_brand_color","AFileUploader_disabled_color","AFileUploader_error_color","AFileUploader_text_color"],y3=["AListView_border-thin","AListView_border-thick"],m3=["AStepper_OutCircle_background-color","AStepper_OutCircle_IsOver_background-color","AStepper_InCircle_background-color","AStepper_InCircle_IsOver_background-color","AStepper_Line_background-color","AStepper_Line_IsOver_background-color"],x3=["ADatePicker_Anchor_border","ADatePicker_Anchor_color","ADatePicker_Anchor_Placeholder_color","ADatePicker_Anchor_hover_border","ADatePicker_Anchor_focus_border","ADatePicker_Anchor_Icon_Primary_color","ADatePicker_Anchor_Icon_Secondary_color","ADatePicker_background-color","ADatePicker_border","ADatePicker_StringInputContainer_background-color","ADatePicker_String_border","ADatePicker_Prev_background-color","ADatePicker_Prev_border-right","ADatePicker_Next_background-color","ADatePicker_Next_border-left","ADatePicker_Cell_color","ADatePicker_Cell_IsNotCurrentMonth_color","ADatePicker_Cell_IsDisabled_color","ADatePicker_Cell_IsSelected_background-color","ADatePicker_Cell_IsSelected_color","ADatePicker_Cell_IsHovered_background-color"],w3=["ADateRangePicker_Anchor_border","ADateRangePicker_Anchor_color","ADateRangePicker_Anchor_Placeholder_color","ADateRangePicker_Anchor_hover_border","ADateRangePicker_Anchor_focus_border","ADateRangePicker_Anchor_Icon_Primary_color","ADateRangePicker_Anchor_Icon_Secondary_color","ADateRangePicker_background-color","ADateRangePicker_border","ADateRangePicker_StringInputContainer_background-color","ADateRangePicker_String_border","ADateRangePicker_Prev_background-color","ADateRangePicker_Prev_border-right","ADateRangePicker_Next_background-color","ADateRangePicker_Next_border-left","ADateRangePicker_Cell_color","ADateRangePicker_Cell_IsNotCurrentMonth_color","ADateRangePicker_Cell_IsDisabled_color","ADateRangePicker_Cell_IsSelected_background-color","ADateRangePicker_Cell_IsSelected_color","ADateRangePicker_Cell_IsHovered_background-color"],C3=["AIconButton_Primary_color","AIconButton_Primary_border","AIconButton_Primary_background-color","AIconButton_Primary_hover_background-color","AIconButton_Primary_active_background-color","AIconButton_Secondary_color","AIconButton_Secondary_background-color","AIconButton_Secondary_hover_background-color","AIconButton_Secondary_active_background-color"],_3=["ATableBody_TRow_border-bottom","ATableBody_TRow_IsSelected_background-color","ATableBody_TRow_IsSelectable_hover_background-color","ATableBody_TH_color","ATableBody_TD_IsMarked_background-color","ATableBody_TD_IsMarked_color","ATableBody_Resizer_hover_ResizerCenter_background-color","ATableBody_Resizer_active_ResizerCenter_background-color","ATableBody_Resizer_active_ResizerOut_background-color","ATableBody_Resizer_active_ResizerIn_background-color","ATableFooter_Button_IsSelected_background-color","ATableFooter_Button_IsSelected_color","ATableFooter_Button_IsDisabled_color","ATableFilter_SubFilters_background-color","ATableFilter_SubFilters_border","ATableFilter_Icon_color","ATableFilter_Alert_color"],S3=["ADivideFrame_DividerInner_background-color"],E3=["AFloatMenu_background-color","AFloatMenu_hover_background-color","AFloatMenu_color","AFloatMenu_border"],T3=["ALoadingBorder_background-color","ALoadingBorder_ProgressBar_background-color","ALoadingBorder_Cover_background-color"],A3=["AWrap_Error_color"],R3=["ARadioSelect_RadioButton_border","ARadioSelect_RadioButton_InnerCircle_isChecked_background-color"],I3=["AChip_background-color","AChip_color","AChip_border","AChip_hover_background-color","AChip_hover_color","AChip_DeleteButton_border","AChip_DeleteButton_color","AChip_DeleteButton_hover_border","AChip_DeleteButton_hover_color"],EA=[...n3,...r3,...i3,...o3,...l3,...s3,...a3,...c3,...u3,...f3,...h3,...d3,...g3,...p3,...v3,...b3,...y3,...m3,...x3,...w3,...C3,..._3,...S3,...E3,...T3,...A3,...R3,...I3],Ev={"Body-background-color":"var(--background-normal)","Body-color":"var(--label-normal)","Body-transition":"background-color var(--Transition), color var(--Transition)",Font:"400 16px pretendard","Scrollbar-handle":"var(--label-neutral)","Scrollbar-handle-hover":"var(--label-normal)","Scrollbar-handle-active":"var(--label-strong)","Scrollbar-track":"var(--elevation-10)","Scrollbar-border-radius":"6px","Scrollbar-width":"12px",Transition:"300ms","Transition-Enabled":"1","ABase_Dimming_background-color":"var(--elevation-0)","ATooltip_background-color":"var(--inverse-elevation-0)",ATooltip_color:"var(--inverse-label-strong)",AButton_Primary_border:"none","AButton_Primary_background-color":"var(--acent-brand)",AButton_Primary_color:"var(--static-white)",AButton_Secondary_border:"1px solid var(--elevation-10)","AButton_Secondary_background-color":"var(--elevation-10)",AButton_Secondary_color:"var(--label-normal)",AButton_Alter_border:"1px solid var(--line-normal)","AButton_Alter_background-color":"var(--elevation-0)",AButton_Alter_color:"var(--label-normal)","AInput_Primary_background-color":"var(--elevation-0)",AInput_Primary_border:"1px solid var(--line-normal)",AInput_Primary_color:"var(--label-normal)",AInput_Primary_hover_border:"1px solid var(--line-strong)","AInput_Primary_focus_background-color":"var(--elevation-10)",AInput_Primary_focus_border:"1px solid var(--line-strong)",AInput_Primary_placeholder_color:"var(--label-neutral)","AInput_Secondary_background-color":"var(--elevation-0)",AInput_Secondary_border:"1px solid var(--line-normal)",AInput_Secondary_color:"var(--label-normal)",AInput_Secondary_hover_border:"1px solid var(--line-strong)",AInput_Secondary_focus_border:"1px solid var(--line-strong)",AInput_Secondary_placeholder_color:"var(--label-neutral)","AInput_ReadOnly_background-color":"var(--elevation-10)",AInput_ReadOnly_border:"none",AInput_ReadOnly_color:"var(--label-normal)",AInput_Error_HelperText_color:"var(--alert-danger)","AInput_Error_background-color":"inherit",AInput_Error_border:"1px solid var(--line-normal)",AInput_Error_color:"var(--label-normal)",AInput_Error_placeholder_color:"var(--label-neutral)","ATextArea_Primary_background-color":"var(--elevation-0)",ATextArea_Primary_border:"1px solid var(--line-normal)",ATextArea_Primary_color:"var(--label-normal)",ATextArea_Primary_hover_border:"1px solid var(--line-strong)","ATextArea_Primary_focus_background-color":"var(--elevation-10)",ATextArea_Primary_focus_border:"1px solid var(--line-strong)","ATextArea_Secondary_background-color":"var(--elevation-0)",ATextArea_Secondary_border:"1px solid var(--line-normal)",ATextArea_Secondary_color:"var(--label-normal)",ATextArea_Secondary_hover_border:"1px solid var(--line-strong)",ATextArea_Secondary_focus_border:"1px solid var(--line-strong)","ATextArea_ReadOnly_background-color":"var(--elevation-10)",ATextArea_ReadOnly_border:"none",ATextArea_ReadOnly_color:"var(--label-normal)","ATextArea_Error_background-color":"inherit",ATextArea_Error_border:"1px solid var(--line-normal)",ATextArea_Error_color:"var(--label-normal)",ATextArea_Error_placeholder_color:"var(--label-neutral)","AEditor_Primary_background-color":"var(--elevation-0)",AEditor_Primary_border:"1px solid var(--line-normal)",AEditor_Primary_color:"var(--label-normal)",AEditor_Primary_hover_border:"1px solid var(--line-strong)","AEditor_Primary_focus_background-color":"var(--elevation-0)",AEditor_Primary_focus_border:"1px solid var(--line-strong)","AEditor_ReadOnly_background-color":"var(--elevation-0)",AEditor_ReadOnly_border:"1px solid var(--line-normal)",AEditor_ReadOnly_hover_border:"1px solid var(--line-strong)",AEditor_ReadOnly_focus_border:"1px solid var(--line-strong)",AEditor_ReadOnly_color:"var(--label-normal)","AEditor_Error_background-color":"inherit",AEditor_Error_border:"1px solid var(--alert-danger)",AEditor_Error_color:"var(--alert-danger)",AEditor_Error_hover_border:"1px solid var(--alert-danger)",AEditor_Error_focus_border:"1px solid var(--alert-danger)",AEditor_Error_placeholder_color:"var(--alert-danger)","AEditor_Addon_Primary_background-color":"var(--background-normal)",AEditor_Addon_Primary_border:"1px solid var(--line-normal)",AEditor_Addon_Primary_color:"var(--label-normal)","AEditor_Addon_Secondary_background-color":"var(--background-normal)",AEditor_Addon_Secondary_border:"1px solid var(--line-strong)",AEditor_Addon_Secondary_color:"var(--label-neutral)","AEditor_Addon_hover_background-color":"var(--elevation-10)",AEditor_Addon_hover_color:"var(--acent-brand)",AEditor_Addon_focus_border:"1px solid var(--line-strong)","AEditor_border-radius":"2px","AEditor_Select_border-radius":"6px","AEditor_Option_border-radius":"6px",ACheckBox_color:"var(--label-normal)","ADialog_Paper_background-color":"#00000060","ADialog_background-color":"var(--elevation-0)",ADialog_border:"1px solid var(--line-neutral)","ADialog_Action_background-color":"var(--elevation-0)",ASelect_Placeholder_color:"var(--label-neutral)",ASelect_Primary_border:"1px solid var(--line-normal)",ASelect_Primary_hover_border:"1px solid var(--line-strong)",ASelect_Primary_Arrow_color:"var(--label-normal)","ASelect_Primary_Options_background-color":"var(--elevation-0)",ASelect_Primary_Options_border:"1px solid var(--line-normal)","ASelect_Primary_Option_hover_background-color":"var(--elevation-10)","ASelect_Primary_Option_active_background-color":"var(--elevation-10)","ASelect_Primary_Option_Selected_background-color":"var(--elevation-20)",ASelect_Secondary_border:"1px solid var(--elevation-10)",ASelect_Secondary_hover_border:"1px solid var(--elevation-10)","ASelect_Secondary_background-color":"var(--elevation-10)",ASelect_Secondary_Arrow_color:"var(--label-normal)","ASelect_Secondary_Options_background-color":"var(--elevation-0)",ASelect_Secondary_Options_border:"var(--line-normal)","ASelect_Secondary_Option_hover_background-color":"var(--elevation-10)","ASelect_Secondary_Option_active_background-color":"var(--elevation-10)","ASelect_Secondary_Option_Selected_background-color":"var(--elevation-20)",AMultiSelect_Placeholder_color:"var(--label-neutral)",AMultiSelect_Primary_border:"1px solid var(--line-normal)",AMultiSelect_Primary_hover_border:"1px solid var(--line-strong)",AMultiSelect_Primary_Arrow_color:"var(--label-normal)","AMultiSelect_Primary_Options_background-color":"var(--elevation-0)",AMultiSelect_Primary_Options_border:"1px solid var(--line-normal)","AMultiSelect_Primary_Option_hover_background-color":"var(--elevation-10)","AMultiSelect_Primary_Option_active_background-color":"var(--elevation-10)","AMultiSelect_Primary_Option_Selected_background-color":"var(--elevation-20)",AMultiSelect_Secondary_border:"1px solid var(--elevation-10)",AMultiSelect_Secondary_hover_border:"1px solid var(--elevation-10)","AMultiSelect_Secondary_background-color":"var(--elevation-10)",AMultiSelect_Secondary_Arrow_color:"var(--label-normal)","AMultiSelect_Secondary_Options_background-color":"var(--elevation-0)",AMultiSelect_Secondary_Options_border:"1px solid var(--line-normal)","AMultiSelect_Secondary_Option_hover_background-color":"var(--elevation-10)","AMultiSelect_Secondary_Option_active_background-color":"var(--elevation-10)","AMultiSelect_Secondary_Option_Selected_background-color":"var(--elevation-20)","ATree_background-color":"var(--elevation-0)",ATree_Indent_border:"1px solid var(--line-normal)","ATreeBodyHeader_border-bottom":"1px solid var(--line-normal)","ATreeItem_hover_background-color":"var(--elevation-10)","ATreeItem_active_background-color":"var(--elevation-10)","ATreeItem_select_background-color":"var(--elevation-10)","ATreeItem_search_background-color":"yellow","ATreeItem_search_border-top":"1px dashed var(--label-normal)","ATreeItem_search_border-bottom":"1px dashed var(--label-normal)",ATreeItem_select_color:"var(--label-normal)",ASwitch_Track_Falsy_border:"12px solid var(--elevation-20)",ASwitch_Track_Truthy_border:"12px solid var(--acent-brand)",ASwitch_Thumb_border:"9px solid var(--static-white)","ATab_IndicatorTrack_Primary_border-bottom":"1px solid var(--line-normal)","ATab_Indicator_Primary_background-color":"var(--label-normal)",ATab_Option_Secondary_border:"2px solid var(--label-normal)","ATab_Option_Secondary_IsSelected_border-bottom":"2px solid var(--elevation-0)",ATab_Option_Secondary_IsDisabled_border:"2px solid var(--line-neutral)","ATab_IndicatorTrack_Tertiary_background-color":"var(--line-normal)","ATab_Indicator_Tertiary_background-color":"var(--elevation-0)",ATab_Option_Tertiary_color:"var(--line-strong)",ATab_Option_Tertiary_IsSelected_color:"var(--label-strong)",ATab_Option_Quaternary_color:"var(--label-neutral)",ATab_Option_Quaternary_IsSelected_color:"var(--label-normal)",AFileBox_border:"1px dashed var(--label-normal)","AFileBox_background-color":"var(--elevation-10)",AFileBox_SelectedFile_color:"var(--label-normal)",AFileBox_Dropping_color:"var(--label-normal)","AFileUploader_background-color":"var(--background-normal)",AFileUploader_brand_color:"var(--acent-brand)",AFileUploader_disabled_color:"var(--label-neutral)",AFileUploader_error_color:"var(--alert-danger)",AFileUploader_text_color:"var(--label-normal)","AListView_border-thin":"1px solid var(--line-neutral)","AListView_border-thick":"3px solid var(--line-neutral)","AStepper_OutCircle_background-color":"transparent","AStepper_OutCircle_IsOver_background-color":"var(--elevation-10)","AStepper_InCircle_background-color":"var(--elevation-20)","AStepper_InCircle_IsOver_background-color":"var(--label-normal)","AStepper_Line_background-color":"var(--line-neutral)","AStepper_Line_IsOver_background-color":"var(--label-normal)",ADatePicker_Anchor_border:"1px solid var(--line-normal)",ADatePicker_Anchor_color:"var(--label-normal)",ADatePicker_Anchor_Placeholder_color:"var(--label-neutral)",ADatePicker_Anchor_hover_border:"1px solid var(--line-strong)",ADatePicker_Anchor_focus_border:"1px solid var(--line-strong)",ADatePicker_Anchor_Icon_Primary_color:"var(--label-normal)",ADatePicker_Anchor_Icon_Secondary_color:"var(--label-normal)","ADatePicker_background-color":"var(--elevation-0)",ADatePicker_border:"1px solid var(--line-neutral)","ADatePicker_StringInputContainer_background-color":"var(--label-neutral)",ADatePicker_String_border:"1px solid var(--label-normal)","ADatePicker_Prev_background-color":"var(--elevation-10)","ADatePicker_Prev_border-right":"6px solid var(--label-normal)","ADatePicker_Next_background-color":"var(--elevation-10)","ADatePicker_Next_border-left":"6px solid var(--label-normal)",ADatePicker_Cell_color:"var(--label-normal)",ADatePicker_Cell_IsNotCurrentMonth_color:"var(--label-neutral)",ADatePicker_Cell_IsDisabled_color:"var(--label-neutral)","ADatePicker_Cell_IsSelected_background-color":"var(--elevation-20)",ADatePicker_Cell_IsSelected_color:"var(--label-normal)","ADatePicker_Cell_IsHovered_background-color":"var(--elevation-10)",ADateRangePicker_Anchor_border:"1px solid var(--line-normal)",ADateRangePicker_Anchor_color:"var(--label-normal)",ADateRangePicker_Anchor_Placeholder_color:"var(--label-neutral)",ADateRangePicker_Anchor_hover_border:"1px solid var(--line-strong)",ADateRangePicker_Anchor_focus_border:"1px solid var(--line-strong)",ADateRangePicker_Anchor_Icon_Primary_color:"var(--label-normal)",ADateRangePicker_Anchor_Icon_Secondary_color:"var(--label-normal)","ADateRangePicker_background-color":"var(--elevation-0)",ADateRangePicker_border:"1px solid var(--line-neutral)","ADateRangePicker_StringInputContainer_background-color":"var(--label-neutral)",ADateRangePicker_String_border:"1px solid var(--label-normal)","ADateRangePicker_Prev_background-color":"var(--elevation-10)","ADateRangePicker_Prev_border-right":"6px solid var(--label-normal)","ADateRangePicker_Next_background-color":"var(--elevation-10)","ADateRangePicker_Next_border-left":"6px solid var(--label-normal)",ADateRangePicker_Cell_color:"var(--label-normal)",ADateRangePicker_Cell_IsNotCurrentMonth_color:"var(--label-neutral)",ADateRangePicker_Cell_IsDisabled_color:"var(--label-neutral)","ADateRangePicker_Cell_IsSelected_background-color":"var(--elevation-20)",ADateRangePicker_Cell_IsSelected_color:"var(--label-normal)","ADateRangePicker_Cell_IsHovered_background-color":"var(--elevation-10)",AIconButton_Primary_color:"var(--label-normal)",AIconButton_Primary_border:"1px solid var(--line-normal)","AIconButton_Primary_background-color":"var(--elevation-0)","AIconButton_Primary_hover_background-color":"var(--elevation-10)","AIconButton_Primary_active_background-color":"var(--elevation-20)",AIconButton_Secondary_color:"var(--label-normal)","AIconButton_Secondary_background-color":"var(--elevation-0)","AIconButton_Secondary_hover_background-color":"var(--elevation-10)","AIconButton_Secondary_active_background-color":"var(--elevation-20)","ATableBody_TRow_border-bottom":"1px solid var(--line-normal)","ATableBody_TRow_IsSelected_background-color":"var(--elevation-10)","ATableBody_TRow_IsSelectable_hover_background-color":"var(--elevation-10)",ATableBody_TH_color:"var(--label-neutral)","ATableBody_TD_IsMarked_background-color":"yellow",ATableBody_TD_IsMarked_color:"var(--label-normal)","ATableBody_Resizer_hover_ResizerCenter_background-color":"var(--line-neutral)","ATableBody_Resizer_active_ResizerCenter_background-color":"var(--line-neutral)","ATableBody_Resizer_active_ResizerOut_background-color":"var(--line-neutral)","ATableBody_Resizer_active_ResizerIn_background-color":"var(--line-neutral)","ATableFooter_Button_IsSelected_background-color":"var(--elevation-10)",ATableFooter_Button_IsSelected_color:"var(--label-normal)",ATableFooter_Button_IsDisabled_color:"var(--label-neutral)","ATableFilter_SubFilters_background-color":"var(--elevation-0)",ATableFilter_SubFilters_border:"1px solid var(--line-normal)",ATableFilter_Icon_color:"var(--label-normal)",ATableFilter_Alert_color:"var(--alert-danger)","ADivideFrame_DividerInner_background-color":"var(--line-normal)","AFloatMenu_background-color":"var(--elevation-0)","AFloatMenu_hover_background-color":"var(--elevation-10)",AFloatMenu_color:"var(--label-normal)",AFloatMenu_border:"1px solid var(--line-neutral)","ALoadingBorder_background-color":"var(--label-normal)","ALoadingBorder_ProgressBar_background-color":"var(--elevation-0)","ALoadingBorder_Cover_background-color":"var(--label-normal)",AWrap_Error_color:"var(--alert-danger)",ARadioSelect_RadioButton_border:"1px solid var(--line-normal)","ARadioSelect_RadioButton_InnerCircle_isChecked_background-color":"var(--acent-brand)","AChip_background-color":"var(--elevation-10)",AChip_color:"var(--label-normal)",AChip_border:"1px solid var(--line-normal)","AChip_hover_background-color":"var(--elevation-20)",AChip_hover_color:"var(--label-normal)",AChip_DeleteButton_border:"9px solid var(--line-normal)",AChip_DeleteButton_color:"var(--label-normal)",AChip_DeleteButton_hover_border:"9px solid var(--line-strong)",AChip_DeleteButton_hover_color:"var(--label-normal)"};function TA(n){return Ev[n]}function AA(n){return Tv(n)}function k3(n){$n.keys(n).forEach(t=>{const r=n[t];r!==void 0&&(document.documentElement.style.setProperty(`--${t}`,r),Ev[t]=r)})}function RA(n){$n.keys(n).forEach(t=>{const r=n[t];if(r===void 0)return;const i=lc.semantic[va.semanticMode][r];i!==void 0&&(document.documentElement.style.setProperty(t,i),Ev[t]=i)})}const va={paletteMode:Sv[0],semanticMode:x1[0],save:"",followDeviceSetting:!1};function IA({semanticMode:n,save:e,followDeviceSetting:t}){if(t!==void 0&&(va.followDeviceSetting=t,t)){const r=window.matchMedia("(prefers-color-scheme: dark)"),i=l=>{va.semanticMode=l.matches?"dark":"light"};i(r);const o=l=>i(l);r.addEventListener("change",o)}if(e!==void 0){if(va.save=e,e==="localStorage"){const r=localStorage.getItem("semanticMode");x1.includes(r)&&(va.semanticMode=r)}else if(e==="sessionStorage"){const r=sessionStorage.getItem("semanticMode");x1.includes(r)&&(va.semanticMode=r)}}n!==void 0&&(va.semanticMode=n),jC(va.paletteMode),xm(va.semanticMode),$C(lc.palette[va.paletteMode]),t3(lc.semantic[va.semanticMode]),k3(Ev)}function kA(n){n.type==="semanticModeChange"?ev.push(n.listener):n.type==="paletteModeChange"?$0.push(n.listener):console.error("AThemes.addEventListener : parameter is not valid")}function MA(n){if(n.type==="semanticModeChange"){const e=ev.indexOf(n.listener);e!==-1&&ev.splice(e,1)}else if(n.type==="paletteModeChange"){const e=$0.indexOf(n.listener);e!==-1&&$0.splice(e,1)}else console.error("AThemes.removeEventListener : parameter is not valid")}function Tv(n){const e=window.getComputedStyle(document.documentElement);let t=e.getPropertyValue(n);return t===""&&(t=e.getPropertyValue(`--${n}`)),t}function LA(n){Object.assign(dt.additionalClasses,n),dt.updateKeys(),dt.additionalClasses=dt.additionalClasses}const pp={getCurrentPaletteMode:mA,getPaletteValue:xA,getPaletteDeepValue:wA,changePaletteMode:jC,editPalette:$C,getCurrentSemanticMode:CA,getSemanticValue:_A,getSemanticDeepValue:SA,changeSemanticMode:xm,editSemantic:t3,getComponentStyleValue:TA,getComponentStyleDeepValue:AA,editComponentStyle:k3,editComponentStyleWithSemantic:RA,init:IA,addEventListener:kA,removeEventListener:MA,getDeepValue:Tv,addClasses:LA},OA=n=>{const e=Gn.c(9),{onChange:t,onClick:r,type:i,...o}=n,l=i===void 0?"Icon":i,[a,h]=B.useState(pp.getCurrentSemanticMode()==="dark"?"Moon":"Sun");let g;e[0]!==r||e[1]!==t?(g=x=>{const w=pp.getCurrentSemanticMode();let _="light";w==="light"?_="dark":w==="dark"&&(_="light"),pp.changeSemanticMode(_),h(PA[_]),t==null||t(_),r==null||r(x)},e[0]=r,e[1]=t,e[2]=g):g=e[2];const m=g;if(l==="Icon")return M.jsx(ba,{...o,className:dt.clsx(Tp.AThemeButton,o.className,"IsInteractive"),icon:a,type:"Raw",onClick:m});if(l==="Switch"){let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=pp.getCurrentSemanticMode(),e[3]=x):x=e[3];let w;e[4]!==m?(w=[x==="dark",m],e[4]=m,e[5]=w):w=e[5];let _;return e[6]!==o||e[7]!==w?(_=M.jsx(QC,{...o,useCheck:w}),e[6]=o,e[7]=w,e[8]=_):_=e[8],_}},PA={light:"Sun",dark:"Moon"},DA="_ACheckBoxWrap_1ozuz_1",NA="_ACheckBox_1ozuz_1",G2={ACheckBoxWrap:DA,ACheckBox:NA},w1=n=>{const e=Gn.c(16),{useCheck:t,isIndeterminate:r,isDisabled:i,isLoading:o,onClick:l,...a}=n,[h,g]=Fo(t,!1);let m;e[0]!==h||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==g?(m=O=>{i||o||(g==null||g(!h),l==null||l(O))},e[0]=h,e[1]=l,e[2]=i,e[3]=o,e[4]=g,e[5]=m):m=e[5];const x=m,w=zi,_=dt.clsx(a.className,G2.ACheckBoxWrap),S=r?"Check.Indeterminate":h?"Check.Checked":"Check.UnChecked";let R;e[6]!==S?(R=M.jsx(fo,{className:G2.ACheckBox,icon:S}),e[6]=S,e[7]=R):R=e[7];let k;return e[8]!==w||e[9]!==a||e[10]!==i||e[11]!==o||e[12]!==x||e[13]!==_||e[14]!==R?(k=M.jsx(w,{...a,className:_,isDisabled:i,isLoading:o,onClick:x,children:R}),e[8]=w,e[9]=a,e[10]=i,e[11]=o,e[12]=x,e[13]=_,e[14]=R,e[15]=k):k=e[15],k};function FA(n){return typeof n=="function"}function BA(n,e){return FA(n)?n(e):n}const Ur={getContent:BA};class Y2{constructor(e){Ee(this,"capacity");Ee(this,"cache",new Map);this.capacity=e}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}put(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){const r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(e,t)}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}entries(){return Array.from(this.cache.entries())}}const Rg=class Rg{constructor(){Ee(this,"databases",{});Ee(this,"caches",{});Ee(this,"DEFAULT_CACHE_SIZE",100)}static getInstance(){return Rg.instance||(Rg.instance=new Rg),Rg.instance}getCache(e,t){const r=`${e}_${t}`;return this.caches[r]||(this.caches[r]=new Y2(this.DEFAULT_CACHE_SIZE)),this.caches[r]}async getDB(e,t,r=1){return this.databases[e]?this.databases[e]:new Promise((i,o)=>{if(!window.indexedDB){console.error("이 브라우저는 IndexedDB를 지원하지 않습니다."),o(new Error("IndexedDB not supported"));return}const l=window.indexedDB.open(e,r);l.onerror=a=>{console.error("IndexedDB 연결 오류:",a.target.error),o(a.target.error)},l.onsuccess=a=>{const h=a.target.result;this.databases[e]=h,i(h)},l.onupgradeneeded=a=>{const h=a.target.result;h.objectStoreNames.contains(t)||h.createObjectStore(t,{keyPath:"id"}).createIndex("updatedAt_idx","updatedAt",{unique:!1})}})}async save(e,t,r){this.getCache(e,t).put(r.id,{...r});const a=(await this.getDB(e,t)).transaction([t],"readwrite").objectStore(t);return new Promise((h,g)=>{const m=a.put(r);m.onsuccess=()=>h(),m.onerror=x=>{console.error("데이터 저장 오류:",x.target.error),g(x.target.error)}})}async batchSave(e,t,r){if(r.length===0)return;const i=this.getCache(e,t);r.forEach(h=>i.put(h.id,{...h}));const l=(await this.getDB(e,t)).transaction([t],"readwrite"),a=l.objectStore(t);return new Promise((h,g)=>{l.oncomplete=()=>h(),l.onerror=m=>{console.error("배치 저장 오류:",m.target.error),g(m.target.error)},r.forEach(m=>a.put(m))})}async get(e,t,r){const i=this.getCache(e,t),o=i.get(r);if(o)return o;const h=(await this.getDB(e,t)).transaction([t],"readonly").objectStore(t);return new Promise((g,m)=>{const x=h.get(r);x.onsuccess=()=>{const w=x.result;w&&i.put(r,w),g(w||null)},x.onerror=w=>{console.error("데이터 조회 오류:",w.target.error),m(w.target.error)}})}async getByIndex(e,t,r,i){const h=(await this.getDB(e,t)).transaction([t],"readonly").objectStore(t).index(r);return new Promise((g,m)=>{const x=h.getAll(i);x.onsuccess=()=>{const w=x.result,_=this.getCache(e,t);w.forEach(S=>{S&&S.id&&_.put(S.id,S)}),g(w)},x.onerror=w=>{console.error("인덱스 조회 오류:",w.target.error),m(w.target.error)}})}async delete(e,t,r){this.getCache(e,t).delete(r);const a=(await this.getDB(e,t)).transaction([t],"readwrite").objectStore(t);return new Promise((h,g)=>{const m=a.delete(r);m.onsuccess=()=>h(),m.onerror=x=>{console.error("데이터 삭제 오류:",x.target.error),g(x.target.error)}})}async batchDelete(e,t,r){if(r.length===0)return;const i=this.getCache(e,t);r.forEach(h=>i.delete(h));const l=(await this.getDB(e,t)).transaction([t],"readwrite"),a=l.objectStore(t);return new Promise((h,g)=>{l.oncomplete=()=>h(),l.onerror=m=>{console.error("배치 삭제 오류:",m.target.error),g(m.target.error)},r.forEach(m=>a.delete(m))})}async getAll(e,t){const o=(await this.getDB(e,t)).transaction([t],"readonly").objectStore(t);return new Promise((l,a)=>{const h=o.getAll();h.onsuccess=()=>{const g=h.result,m={},x=this.getCache(e,t);g.forEach(w=>{w.id&&(m[w.id]=w,x.put(w.id,w))}),l(m)},h.onerror=g=>{console.error("데이터 전체 조회 오류:",g.target.error),a(g.target.error)}})}async clear(e,t){this.getCache(e,t).clear();const l=(await this.getDB(e,t)).transaction([t],"readwrite").objectStore(t);return new Promise((a,h)=>{const g=l.clear();g.onsuccess=()=>a(),g.onerror=m=>{console.error("데이터 초기화 오류:",m.target.error),h(m.target.error)}})}getCached(e,t,r){return this.getCache(e,t).get(r)||null}clearCached(e,t){this.getCache(e,t).clear()}setCacheSize(e,t,r){const i=`${e}_${t}`,l=this.getCache(e,t).entries();this.caches[i]=new Y2(r);for(const[a,h]of l)this.caches[i].get(a)===void 0&&a!==void 0&&this.caches[i].put(a,h)}};Ee(Rg,"instance");let ky=Rg;const _h=ky.getInstance(),Th={save:(n,e,t)=>_h.save(n,e,t),get:(n,e,t)=>_h.get(n,e,t),delete:(n,e,t)=>_h.delete(n,e,t),getAll:(n,e)=>_h.getAll(n,e),clear:(n,e)=>_h.clear(n,e),batchSave:(n,e,t)=>_h.batchSave(n,e,t),batchDelete:(n,e,t)=>_h.batchDelete(n,e,t),getByIndex:(n,e,t,r)=>_h.getByIndex(n,e,t,r),getCached:(n,e,t)=>_h.getCached(n,e,t),clearCached:(n,e)=>_h.clearCached(n,e),setCacheSize:(n,e,t)=>_h.setCacheSize(n,e,t)};function M3(n,e,t={}){const{dataFieldName:r="data"}=t,[i,o]=B.useState(!1),[l,a]=B.useState(null),h=B.useRef(new Map);B.useEffect(()=>{const N=h.current;return()=>{N.forEach(J=>J.abort()),N.clear()}},[]);const g=B.useCallback(async(N,J)=>{try{o(!0),a(null);const Y=h.current,K=Y.get(N);K&&K.abort();const fe=new AbortController;Y.set(N,fe);const X=await J();return h.current.delete(N),X}catch(Y){return Y instanceof Error&&Y.name==="AbortError"||a(Y instanceof Error?Y:new Error(String(Y))),null}finally{o(!1)}},[]),m=B.useCallback(async(N,J)=>N?await g(`save_${N}`,async()=>(await Th.save(n,e,{id:N,[r]:J,updatedAt:new Date().toISOString()}),!0))===!0:!1,[n,e,r,g]),x=B.useCallback(async N=>N.length?await g(`batch_save_${Date.now()}`,async()=>{const J=N.map(Y=>({id:Y.id,[r]:Y.data,updatedAt:new Date().toISOString()}));return await Th.batchSave(n,e,J),!0})===!0:!1,[n,e,r,g]),w=B.useCallback(async N=>N?await g(`get_${N}`,async()=>{const J=await Th.get(n,e,N);return(J==null?void 0:J[r])||null}):null,[n,e,r,g]),_=B.useCallback(N=>{if(!N)return null;const J=Th.getCached(n,e,N);return(J==null?void 0:J[r])||null},[n,e,r]),S=B.useCallback(async N=>N?await g(`delete_${N}`,async()=>(await Th.delete(n,e,N),!0))===!0:!1,[n,e,g]),R=B.useCallback(async N=>N.length?await g(`batch_delete_${Date.now()}`,async()=>(await Th.batchDelete(n,e,N),!0))===!0:!1,[n,e,g]),k=B.useCallback(async()=>await g(`get_all_${Date.now()}`,async()=>{const N=await Th.getAll(n,e);return Object.entries(N).reduce((J,[Y,K])=>(J[Y]=K[r],J),{})})||{},[n,e,r,g]),O=B.useCallback(async()=>await g(`clear_all_${Date.now()}`,async()=>(await Th.clear(n,e),!0))===!0,[n,e,g]),P=B.useCallback(N=>{const J=h.current.get(N);J&&(J.abort(),h.current.delete(N))},[]),z=B.useCallback(()=>{new Map(h.current).forEach(J=>J.abort()),h.current.clear()},[]),H=B.useCallback(N=>{Th.setCacheSize(n,e,N)},[n,e]),G=B.useCallback(()=>{Th.clearCached(n,e)},[n,e]);return{save:m,get:w,delete:S,getAll:k,clearAll:O,batchSave:x,batchDelete:R,getCached:_,setCacheSize:H,clearCache:G,cancelOperation:P,cancelAllOperations:z,isLoading:i,error:l}}const zA="LayoutDB",HA="layouts";function L3(){const n=Gn.c(24);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={dataFieldName:"lengths"},n[0]=e):e=n[0];const t=M3(zA,HA,e);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={},n[1]=r):r=n[1];const[i,o]=B.useState(r);let l;n[2]===Symbol.for("react.memo_cache_sentinel")?(l={},n[2]=l):l=n[2];const a=B.useRef(l);let h;n[3]!==t?(h=async(G,N)=>await t.save(G,N),n[3]=t,n[4]=h):h=n[4];const g=h;let m;n[5]!==t?(m=async G=>await t.get(G),n[5]=t,n[6]=m):m=n[6];const x=m;let w;n[7]!==t?(w=G=>t.getCached(G),n[7]=t,n[8]=w):w=n[8];const _=w;let S;n[9]!==x||n[10]!==_||n[11]!==i?(S=G=>{const N=_(G);return N?{data:N,isLoaded:!0}:a.current[G]!==void 0?{data:a.current[G],isLoaded:!!i[G]}:(i[G]||(a.current[G]=null,x(G).then(J=>{a.current[G]=J,o(Y=>({...Y,[G]:!0}))})),{data:null,isLoaded:!1})},n[9]=x,n[10]=_,n[11]=i,n[12]=S):S=n[12];const R=S;let k;n[13]!==t?(k=async G=>(o(N=>{const J={...N};return delete J[G],J}),a.current[G]!==void 0&&delete a.current[G],await t.delete(G)),n[13]=t,n[14]=k):k=n[14];const O=k;let P;n[15]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{o({}),a.current={}},n[15]=P):P=n[15];const z=P;let H;return n[16]!==t.error||n[17]!==t.isLoading||n[18]!==O||n[19]!==x||n[20]!==_||n[21]!==R||n[22]!==g?(H={save:g,get:x,getCached:_,getSync:R,deleteItem:O,resetSyncState:z,isLoading:t.isLoading,error:t.error},n[16]=t.error,n[17]=t.isLoading,n[18]=O,n[19]=x,n[20]=_,n[21]=R,n[22]=g,n[23]=H):H=n[23],H}const WA="_ARowFrame_1puxj_1",UA="_AColFrame_1puxj_7",GA="_AOverflowFrame_1puxj_13",YA="_ADivideFrame_1puxj_22",VA="_Row_1puxj_30",ZA="_Col_1puxj_33",XA="_FadeIn_1puxj_36",KA="_NoTransition_1puxj_39",JA="_ChildFrame_1puxj_43",QA="_ExpandButtonOverlay_1puxj_61",qA="_Divider_1puxj_73",jA="_IsMoving_1puxj_81",$A="_NoDraggable_1puxj_81",e6="_DividerInner_1puxj_84",t6="_IsClicked_1puxj_109",n6="_RemoteButton_1puxj_144",r6="_isExpanded_1puxj_151",i6="_ExpandButton_1puxj_61",ll={ARowFrame:WA,AColFrame:UA,AOverflowFrame:GA,ADivideFrame:YA,Row:VA,Col:ZA,FadeIn:XA,NoTransition:KA,ChildFrame:JA,ExpandButtonOverlay:QA,Divider:qA,IsMoving:jA,NoDraggable:$A,DividerInner:e6,IsClicked:t6,RemoteButton:n6,isExpanded:r6,"fade-in":"_fade-in_1puxj_1",ExpandButton:i6},Ml=n=>{const e=Gn.c(5);let t;e[0]!==n.className?(t=dt.clsx(ll.ARowFrame,n.className),e[0]=n.className,e[1]=t):t=e[1];let r;return e[2]!==n||e[3]!==t?(r=M.jsx(zi,{...n,className:t,children:n.children}),e[2]=n,e[3]=t,e[4]=r):r=e[4],r},O3=n=>{const e=Gn.c(5);let t;e[0]!==n.className?(t=dt.clsx(ll.AColFrame,n.className),e[0]=n.className,e[1]=t):t=e[1];let r;return e[2]!==n||e[3]!==t?(r=M.jsx("div",{...n,className:t,children:n.children}),e[2]=n,e[3]=t,e[4]=r):r=e[4],r},nd=n=>{const{tooltip:e,children:t,abaseRef:r,isDisabled:i,className:o,noOverflowTooltip:l,...a}=n,h=B.useRef(null),g=B.useMemo(()=>r??h,[r]),[m,x]=B.useState(!1),w=B.useCallback(()=>x(!0),[]),_=B.useCallback(()=>x(!1),[]);B.useEffect(()=>{const R=g.current;if(R)return R.addEventListener("mouseenter",w),R.addEventListener("mouseleave",_),()=>{R.removeEventListener("mouseenter",w),R.removeEventListener("mouseleave",_)}},[g,w,_]);const S=B.useMemo(()=>{if(i)return"";if(l||!m)return e;const R=g.current;return R&&R.scrollWidth>R.clientWidth?t:e},[g,i,t,e,l,m]);return M.jsx(zi,{...a,children:t,abaseRef:g,className:dt.clsx(ll.AOverflowFrame,o),isDisabled:i,tooltip:S})},P3=n=>{const e=Gn.c(2),{value:t,map:r}=n;if(r[t]===void 0)return r.fallback;const i=r[t];let o;return e[0]!==i?(o=M.jsx(B.Suspense,{children:i}),e[0]=i,e[1]=o):o=e[1],o},D3=B.memo(n=>{const{pk:e,direction:t="Row",lefts:r,minLength:i=40,expandLayerLength:o=40,children:l,childStyle:a,childClassName:h,dividerStyle:g,dividerClassName:m,dividerPadding:x,dividerInnerClassName:w,dividerInnerStyle:_,showRemote:S,ShowRemoteRenderer:R=o6,noDividerDraggable:k,resources:O,showExpandButton:P,...z}=n,H=B.useMemo(()=>({...Or.ADivideFrame,...O}),[O]),G=B.useRef(null),N=B.useRef(!1),J=B.useRef(!0),Y=B.useRef(r),[K,fe]=B.useState(),[X,te]=B.useState("FadeOut"),[ne,ue]=B.useState(!1),[se,$]=B.useState(null),[re,ge]=B.useState({width:0,height:0}),{save:me,get:oe,deleteItem:Q}=L3(),pe=B.useCallback(()=>{J.current&&requestAnimationFrame(()=>{J.current=!1,te("FadeIn")})},[]),Ie=B.useMemo(()=>{let Ye;return Array.isArray(l)?Ye=l:Ye=[l],Ye.filter(Boolean)},[l]),Fe=B.useMemo(()=>Ie.length,[Ie.length]),xe=B.useMemo(()=>Ie.length-1,[Ie.length]),Oe=B.useMemo(()=>e?String(e):"",[e]),Le=B.useMemo(()=>e&&!S,[e,S]),He=B.useCallback(async()=>{if(!Le){$(r),pe();return}try{const Ye=await oe(Oe);Ye?$(Ye):($(r),me(Oe,r)),pe()}catch{$(r),pe()}},[Le,pe,Oe,oe,r,me]);B.useEffect(()=>{He()},[He]),B.useEffect(()=>{const Ye=()=>{ge({width:window.innerWidth,height:window.innerHeight})};return Ye(),window.addEventListener("resize",Ye),()=>window.removeEventListener("resize",Ye)},[]),B.useEffect(()=>{Y.current!==r&&(Y.current=r,N.current||($(r),Le&&me(Oe,r)),N.current=!1)},[Le,r,Oe,me]);const Te=B.useMemo(()=>{const Ye=x??0;return typeof i=="number"?Array(Fe).fill(i+Ye):i.map(Tt=>Tt+Ye)},[i,Fe,x]),ke=B.useMemo(()=>typeof o=="number"?Array(Fe).fill(o):o,[o,Fe]),Be=B.useMemo(()=>(K==null?void 0:K.lefts)||se||[],[K,se]),rt=B.useRef({x:0,y:0}),Re=B.useCallback((Ye,Tt,Ut)=>{const gt=Be[Ye],Ht=Ye===0?0:Be[Ye-1],xt=gt-Ht,pn={...a,...l6(t,xt,Tt)};return x!==void 0&&(t==="Row"?(Ut||(pn.paddingLeft=x),Tt||(pn.paddingRight=x)):(Ut||(pn.paddingTop=x),Tt||(pn.paddingBottom=x))),pn},[Be,a,t,x]),ut=B.useCallback(()=>{if(!(!S||t!=="Row")){if(ne)$(r),N.current=!1;else{if(Fe<=1)return;const Ye=[];let Tt=0;for(let Ut=0;Ut<Fe-1;Ut++){const gt=typeof i=="number"?i:i[Ut]||i[0];Tt+=gt,Ye.push(Tt)}$(Ye),N.current=!0}ue(Ye=>!Ye),J.current=!1}},[S,t,ne,Fe,r,i]),qe=B.useCallback((Ye,Tt)=>{if(Tt)return Ut=>{if(!G.current||!se)return;J.current=!1;const gt=G.current;rt.current={x:Ut.clientX,y:Ut.clientY};const Ht=gt.getBoundingClientRect(),xt=t==="Row"?Ht.left:Ht.top,pn=t==="Row"?Ht.width:Ht.height;let $t=[...se];fe({idx:Ye,lefts:$t});const sn=bn=>{$t=u6(se,t,Ye,bn,xt,pn,Te),fe({idx:Ye,lefts:$t})},Xt=()=>{fe(void 0),$($t),N.current=!0,Le&&me(Oe,$t),window.removeEventListener("mousemove",sn),window.removeEventListener("mouseup",Xt)};window.addEventListener("mousemove",sn),window.addEventListener("mouseup",Xt)}},[se,t,Te,Le,Oe,me]),ot=B.useCallback(Ye=>{if(Ye)return()=>{$(r),N.current=!1,fe(void 0),Le&&Q(Oe)}},[r,Le,Oe,Q]),st=B.useMemo(()=>Ie.map((Ye,Tt)=>{const Ut=S&&(ne||!ne&&Tt===xe-1);return!(k||Ut)}),[Ie,S,ne,k,xe]),bt=B.useMemo(()=>{if(!P||!G.current||X!=="FadeIn")return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};if(!re.width)return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};const Ye=G.current.getBoundingClientRect(),Tt=t==="Row"?Ye.width:Ye.height;if(Tt===0)return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};const Ut=[];for(let xt=0;xt<Fe;xt++){const pn=Be[xt],$t=xt===0?0:Be[xt-1],sn=xt===xe?Tt-$t:pn-$t,Xt=Array.isArray(ke)?ke[xt]:ke[0],bn=sn<=Xt;Ut.push({panelIndex:xt,actualLength:sn,expandLength:Xt,isCollapsed:bn})}const gt=Ut.filter(xt=>xt.isCollapsed).map(xt=>xt.panelIndex);if(gt.length===0)return{hasCollapsedAreas:!1,collapsedAreaIndex:-1};let Ht=-1;return gt.includes(0)?Ht=0:gt.includes(xe)?Ht=xe:Ht=gt[0],{hasCollapsedAreas:!0,collapsedAreaIndex:Ht}},[P,X,t,Fe,xe,Be,ke,re]),Mt=B.useCallback(()=>{P&&($(r),N.current=!1,Le&&me(Oe,r),J.current=!1)},[P,r,Le,Oe,me]),Bt=B.useMemo(()=>st.map((Ye,Tt)=>qe(Tt,Ye)),[st,qe]),at=B.useMemo(()=>st.map(Ye=>ot(Ye)),[st,ot]);return se?M.jsx("div",{...z,ref:G,className:dt.clsx(ll.ADivideFrame,n.className,ll[t],ll[X],J.current&&ll.NoTransition),children:Ie.map((Ye,Tt)=>{const Ut=Tt===0,gt=Tt===xe,Ht=Re(Tt,gt,Ut),xt=Be[Tt],pn=st[Tt],$t=Bt[Tt],sn=at[Tt];return M.jsxs(B.Fragment,{children:[M.jsxs("div",{style:Ht,className:dt.clsx(ll.ChildFrame,h,K&&ll.IsMoving,J.current&&ll.NoTransition,ll[t]),children:[gt&&S&&t==="Row"&&M.jsx(R,{handleToggleExpand:ut,isExpanded:ne,resources:H}),Ye,P&&bt.hasCollapsedAreas&&bt.collapsedAreaIndex===Tt&&M.jsxs(M.Fragment,{children:[M.jsx(zi,{className:dt.clsx(ll.ExpandButtonOverlay,ll[t]),onClick:Mt}),M.jsx(ba,{className:dt.clsx(ll.ExpandButton,ll[t]),icon:a6(Tt,Fe),tooltip:H.Expand,type:"Raw",style:{transform:c6(Tt,t)},onClick:Mt})]})]}),!gt&&M.jsx("div",{"data-nodraggable":pn?void 0:"true",className:dt.clsx(ll.Divider,ll[t],"NoSelect",K&&ll.IsMoving,(K==null?void 0:K.idx)===Tt&&ll.IsClicked,J.current&&ll.NoTransition,!pn&&ll.NoDraggable,m),style:{...g,...s6(t,xt)},onDoubleClick:sn,onMouseDown:$t,children:M.jsx("div",{className:dt.clsx(ll.DividerInner,w),style:{..._}})})]},Tt)})}):M.jsx("div",{...z,ref:G,className:dt.clsx(ll.ADivideFrame,n.className,ll[t],ll.FadeOut,ll.NoTransition),style:{...z.style,visibility:"hidden",pointerEvents:"none"}})});D3.displayName="ADivideFrame";const o6=n=>{const{handleToggleExpand:e,isExpanded:t,resources:r}=n;return M.jsx(ba,{className:dt.clsx(ll.RemoteButton,t&&ll.isExpanded),icon:"DividerExpand",iconSize:"md",tabIndex:0,tooltip:t?r.Collapse:r.Expand,type:"Raw",onClick:e})};function l6(n,e,t){return t?{}:n==="Col"?{height:e,minHeight:e,maxHeight:e}:{maxWidth:e,width:e,minWidth:e}}function s6(n,e){return n==="Col"?{top:e}:{left:e}}function a6(n,e){const t=n===0,r=n===e-1;return t||r?"DividerExpand":"DividerMiddle"}function c6(n,e){const t=n===0;let r="";return e==="Row"&&t?r=" rotate(180deg)":e==="Col"&&(r=t?" rotate(-90deg)":" rotate(90deg)"),`translate(-50%, -50%)${r}`}function u6(n,e,t,r,i,o,l){const a=[...n],h=e==="Row"?r.clientX-i-n[t]:r.clientY-i-n[t];if(h===0)return a;const g=l.length,m=n.length,x=t+1,w=[],_=[];let S=0;for(let O=0;O<=g;O++)w[O]=S,O<g&&(S+=l[O]);let R=0;for(let O=g-2;O>=0;O--)R+=l[O+1],_[O]=R;_[g-1]=0;let k=a[t]+h;if(h<0){if(k<=w[x])for(let O=0;O<=t;O++)a[O]=w[O+1];else if(a[t]=k,t>0)for(let O=t-1;O>=0&&k-a[O]<l[O+1];O--)a[O]=k-l[O+1],k=a[O]}else{const O=t===g-2?l[g-1]:0;if(k>=o-_[t]-O)for(let P=t;P<m;P++)a[P]=o-_[P]-(P===m-1?0:O);else if(a[t]=k,t<m-1)for(let P=x;P<m&&a[P]-k<l[P];P++)a[P]=k+l[P],k=a[P]}return a}const zg=()=>{const n=Gn.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=M.jsx("div",{style:{display:"flex",flexGrow:1}}),n[0]=e):e=n[0],e},f6="_ASpace_1okqf_1",h6={ASpace:f6},cs=n=>{const e=Gn.c(14);let t,r,i,o,l;e[0]!==n?({h:r,w:l,...t}=n,i=t,o=dt.clsx(h6.ASpace,t.className),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5]);let a;e[6]!==t.style||e[7]!==r||e[8]!==l?(a={height:r,minHeight:r,maxHeight:r,width:l,minWidth:l,maxWidth:l,...t.style},e[6]=t.style,e[7]=r,e[8]=l,e[9]=a):a=e[9];let h;return e[10]!==i||e[11]!==o||e[12]!==a?(h=M.jsx("div",{...i,className:o,style:a}),e[10]=i,e[11]=o,e[12]=a,e[13]=h):h=e[13],h},d6="_AChipsContainer_1ag9v_1",g6="_AChip_1ag9v_1",p6="_Clickable_1ag9v_21",v6="_AChipDelete_1ag9v_26",b6="_IsHover_1ag9v_40",y6="_AChipDeleteIcon_1ag9v_45",h1={AChipsContainer:d6,AChip:g6,Clickable:p6,AChipDelete:v6,IsHover:b6,AChipDeleteIcon:y6},m6=n=>{const e=Gn.c(42);let t,r,i,o,l,a,h,g,m,x,w,_;e[0]!==n?({useLabels:_,alignItems:m,ChipStyle:l,ChipClassName:t,ChipOnDelete:o,ChipOnClick:i,ChipIcon:r,className:h,style:g,ButtonRenderer:x,gap:w,...a}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12]);const S=m===void 0?"flex-start":m,R=x===void 0?N3:x,k=w===void 0?8:w;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[],e[13]=O):O=e[13];const[P,z]=Fo(_,O);let H;e[14]!==o||e[15]!==P||e[16]!==z?(H=te=>{!z||!o||(o({label:te}),z(P.filter(ne=>ne!==te)))},e[14]=o,e[15]=P,e[16]=z,e[17]=H):H=e[17];const G=H;let N;e[18]!==t||e[19]!==r||e[20]!==i||e[21]!==l||e[22]!==G?(N=te=>{const ne={label:te};return{label:te,useLabel:[te,x6],style:Ur.getContent(l,ne),className:Ur.getContent(t,ne),icon:Ur.getContent(r,ne),onDelete:()=>G(te),onClick:i?()=>i({label:te}):void 0}},e[18]=t,e[19]=r,e[20]=i,e[21]=l,e[22]=G,e[23]=N):N=e[23];const J=N;let Y;e[24]!==h?(Y=dt.clsx(h1.AChipsContainer,h),e[24]=h,e[25]=Y):Y=e[25];let K;e[26]!==S||e[27]!==k||e[28]!==g?(K={...g,alignItems:S,gap:k},e[26]=S,e[27]=k,e[28]=g,e[29]=K):K=e[29];let fe;if(e[30]!==R||e[31]!==J||e[32]!==P){let te;e[34]!==R||e[35]!==J?(te=(ne,ue)=>M.jsx(wm,{...J(ne),ButtonRenderer:R},ue),e[34]=R,e[35]=J,e[36]=te):te=e[36],fe=P.map(te),e[30]=R,e[31]=J,e[32]=P,e[33]=fe}else fe=e[33];let X;return e[37]!==a||e[38]!==Y||e[39]!==K||e[40]!==fe?(X=M.jsx(zi,{...a,className:Y,style:K,children:fe}),e[37]=a,e[38]=Y,e[39]=K,e[40]=fe,e[41]=X):X=e[41],X},wm=n=>{const e=Gn.c(27);let t,r,i,o,l,a,h;if(e[0]!==n){const{label:O,useLabel:P,icon:z,className:H,onDelete:G,onClick:N,ButtonRenderer:J,width:Y,style:K,...fe}=n;i=O,r=H,o=N,a=J,h=Y,l=K,t=fe,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7];const g=a===void 0?N3:a,m=h===void 0?"fit-content":h;if(i===void 0){let O;return e[8]===Symbol.for("react.memo_cache_sentinel")?(O=M.jsx(M.Fragment,{}),e[8]=O):O=e[8],O}let x;e[9]!==r||e[10]!==o?(x=dt.clsx("NoSelect",h1.AChip,o&&h1.Clickable,o&&"IsClickable",r),e[9]=r,e[10]=o,e[11]=x):x=e[11];let w;e[12]!==l||e[13]!==m?(w={...l,width:m},e[12]=l,e[13]=m,e[14]=w):w=e[14];const _=i;let S;e[15]!==_?(S=M.jsx(nd,{children:_}),e[15]=_,e[16]=S):S=e[16];let R;e[17]!==g||e[18]!==n?(R=g({...n}),e[17]=g,e[18]=n,e[19]=R):R=e[19];let k;return e[20]!==t||e[21]!==o||e[22]!==x||e[23]!==w||e[24]!==S||e[25]!==R?(k=M.jsxs(zi,{...t,className:x,style:w,onClick:o,children:[S,R]}),e[20]=t,e[21]=o,e[22]=x,e[23]=w,e[24]=S,e[25]=R,e[26]=k):k=e[26],k},N3=n=>{const e=Gn.c(13),{label:t,icon:r,onDelete:i,useLabel:o}=n,[,l]=Fo(o,t),[a,h]=B.useState(!1);let g;e[0]!==i||e[1]!==n||e[2]!==l?(g=O=>{i&&(O.stopPropagation(),l==null||l(void 0),i(n))},e[0]=i,e[1]=n,e[2]=l,e[3]=g):g=e[3];const m=g;let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{h(!0)},e[4]=x):x=e[4];const w=x;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{h(!1)},e[5]=_):_=e[5];const S=_;let R;e[6]!==m||e[7]!==r||e[8]!==a||e[9]!==i?(R=i&&M.jsxs(M.Fragment,{children:[M.jsx(zg,{}),M.jsx(cs,{w:24}),M.jsx(zi,{className:dt.clsx(h1.AChipDelete,"IsClickable",a&&h1.IsHover)}),M.jsx(ba,{className:h1.AChipDeleteIcon,icon:r||M.jsx(fo,{height:14,icon:"Close",stroke:"currentColor",width:14}),type:"Raw",onClick:m,onMouseEnter:w,onMouseLeave:S})]}),e[6]=m,e[7]=r,e[8]=a,e[9]=i,e[10]=R):R=e[10];let k;return e[11]!==R?(k=M.jsx(M.Fragment,{children:R}),e[11]=R,e[12]=k):k=e[12],k};function x6(){}const Mg=n=>{if(!n)return"0 bytes";const e=["bytes","KB","MB","GB","TB","PB","EB","ZB","YB","RB","QB"];let t=0;for(;n>=1024&&t<e.length-1;)n/=1024,t++;return`${t===0?Math.floor(n):n.toFixed(1)} ${e[t]}`},w6=n=>{let e="";n<0&&(e+="-",n=-n);const t=Math.floor(n/3600),r=Math.floor(n%3600/60),i=n%60;return t>0&&(e+=t.toString().padStart(2,"0")+":"),e+=r.toString().padStart(2,"0")+":",e+=i.toString().padStart(2,"0"),e},C6=/[a-zA-Z0-9]/,_6=/^[a-zA-Z0-9]*$/,S6=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9]{2,}$/,E6=/^[a-zA-Z0-9._-]+$/,T6=/^[0-9a-fA-F-]+$/i,A6=/[가-힣ㄱ-ㅎㅏ-ㅣ]/,R6=/^\S*$/,I6=/^([^ㄱ-ㅎㅏ-ㅣ])*$/i,k6=/[!@#$%^&*+=;:?/<>\\[\](){}~\-_.(),]/,M6=/^(?=.*[A-Za-z])(?=.*\d)(?=.*[\W_])[A-Za-z\d\W_]{8,}$/,L6=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,O6={hasKr:n=>/[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(n),hasMalKr:n=>/[ㄱ-ㅎㅏ-ㅣ]/.test(n),hasBlank:n=>/\s/.test(n),isBlank:n=>/^\s*$/.test(n),isUuid:n=>/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/.test(n),isEmail:n=>/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9]{2,}$/.test(n),isAlphabet:n=>/^[a-zA-Z]*$/.test(n),isAlphaNumeric:n=>/^[a-zA-Z0-9]*$/.test(n),isKr:n=>/^[가-힣ㄱ-ㅎㅏ-ㅣ]*$/.test(n),isKrNumeric:n=>/^[가-힣ㄱ-ㅎㅏ-ㅣ0-9]*/.test(n),isNumeric:n=>/^[0-9]$/.test(n),isLenMinMax:(n,e)=>t=>!(n!==void 0&&t.length<n||e!==void 0&&t.length>e)},P6=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)}),Cm={secondToTime:w6,validate:O6,FileSizeTrans:Mg,uuid:P6},D6=n=>{const e=Gn.c(52);let t,r,i,o,l,a;if(e[0]!==n){const{maxTicks:Q,interval:pe,onFinish:Ie,noStartOnRender:Fe,actionRef:xe,...Oe}=n;l=Ie,o=Fe,t=xe,i=Q===void 0?300:Q,r=pe===void 0?1e3:pe,a=Bg(Oe),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6];const[h,g]=a;let m,x,w,_;e[7]!==h?({wrapId:x,wrapProps:w,labelProps:m,..._}=h,e[7]=h,e[8]=m,e[9]=x,e[10]=w,e[11]=_):(m=e[8],x=e[9],w=e[10],_=e[11]);const[S,R]=B.useState(0),[k,O]=B.useState(!o);let P,z;e[12]!==r||e[13]!==k||e[14]!==g.isDisabled||e[15]!==g.isLoading?(P=()=>{if(!k||g.isDisabled||g.isLoading)return;const Q=setInterval(()=>R(N6),r);return()=>clearInterval(Q)},z=[r,k,g.isDisabled,g.isLoading],e[12]=r,e[13]=k,e[14]=g.isDisabled,e[15]=g.isLoading,e[16]=P,e[17]=z):(P=e[16],z=e[17]),B.useEffect(P,z);let H;e[18]!==l?(H=()=>{l==null||l(),O(!1)},e[18]=l,e[19]=H):H=e[19];const G=H;let N,J;e[20]!==i||e[21]!==G||e[22]!==g.isDisabled||e[23]!==g.isLoading||e[24]!==S?(N=()=>{S>=i&&!g.isDisabled&&!g.isLoading&&G()},J=[S,i,G,g.isDisabled,g.isLoading],e[20]=i,e[21]=G,e[22]=g.isDisabled,e[23]=g.isLoading,e[24]=S,e[25]=N,e[26]=J):(N=e[25],J=e[26]),B.useEffect(N,J);let Y;e[27]!==g.isDisabled?(Y=()=>{g.isDisabled||O(!0)},e[27]=g.isDisabled,e[28]=Y):Y=e[28];const K=Y;let fe;e[29]!==g.isDisabled?(fe=()=>{g.isDisabled||O(!1)},e[29]=g.isDisabled,e[30]=fe):fe=e[30];const X=fe;let te;e[31]!==g.isDisabled?(te=()=>{g.isDisabled||(O(!1),R(0))},e[31]=g.isDisabled,e[32]=te):te=e[32];const ne=te;let ue,se;e[33]!==t||e[34]!==ne||e[35]!==K||e[36]!==X?(ue=()=>{t&&(t.current={start:K,stop:X,reset:ne,setTicks:R})},se=[t,K,X,ne],e[33]=t,e[34]=ne,e[35]=K,e[36]=X,e[37]=ue,e[38]=se):(ue=e[37],se=e[38]),B.useEffect(ue,se);const $=i-S;let re;e[39]!==m||e[40]!==x||e[41]!==w||e[42]!==_?(re={wrapId:x,wrapProps:w,labelProps:m,..._},e[39]=m,e[40]=x,e[41]=w,e[42]=_,e[43]=re):re=e[43];let ge;e[44]!==$?(ge=Cm.secondToTime($>0?$:0),e[44]=$,e[45]=ge):ge=e[45];let me;e[46]!==g||e[47]!==ge?(me=M.jsx(zi,{...g,children:ge}),e[46]=g,e[47]=ge,e[48]=me):me=e[48];let oe;return e[49]!==re||e[50]!==me?(oe=M.jsx(lg,{...re,children:me}),e[49]=re,e[50]=me,e[51]=oe):oe=e[51],oe};function N6(n){return n+1}function Oh(n){const e=n.getFullYear(),t=n.getMonth()+1,r=n.getDate();return`${e}-${t<10?"0"+t:t}-${r<10?"0"+r:r}`}function F6(n){try{if(!n)return;const e=new Date(n);return isNaN(e.getTime())?void 0:e}catch{return}}function B6(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0)}function z6(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59,999)}function V2(n,e){return Oh(n)===Oh(e)}function d1(n,e){return Oh(n)>Oh(e)}function tv(n,e){return Oh(n)>=Oh(e)}function nv(n,e){return Oh(n)<Oh(e)}function rv(n,e){return Oh(n)<=Oh(e)}function Z2(n,e,t){return d1(n,t)?d1(e,t)&&nv(e,n):d1(e,n)&&nv(e,t)}function X2(n,e,t){return d1(n,t)?tv(e,t)&&rv(e,n):tv(e,n)&&rv(e,t)}const Un={toString:Oh,toDate:F6,makeSDate:B6,makeEDate:z6,"===":V2,">":d1,">=":tv,"<":nv,"<=":rv,"s<d<e|e<d<s":Z2,"s<=d<=e|e<=d<=s":X2,eq:V2,g:d1,ge:tv,l:nv,le:rv,b:Z2,be:X2},H6="_InputContainer_16eoo_7",W6="_AInput_16eoo_21",U6="_LeftAddon_16eoo_43",G6="_RightAddon_16eoo_50",Y6="_ErrorHelperText_16eoo_57",V6="_Primary_16eoo_61",Z6="_UnAvailable_16eoo_66",X6="_Secondary_16eoo_77",K6="_ReadOnly_16eoo_92",J6="_ANumInputUnitSelect_16eoo_108",ou={InputContainer:H6,AInput:W6,LeftAddon:U6,RightAddon:G6,ErrorHelperText:Y6,Primary:V6,UnAvailable:Z6,Secondary:X6,ReadOnly:K6,Error:"_Error_16eoo_57",ANumInputUnitSelect:J6},Q6=["Primary","Secondary","ReadOnly","Error"],sg=n=>{const{onEnterPress:e,type:t="Primary",inputRef:r,useValue:i,isReadonly:o,placeholder:l,minLength:a,maxLength:h,tabIndex:g,autoFocus:m,isPassword:x,autoComplete:w="off",inputProps:_,LeftAddon:S,RightAddon:R,dataList:k=[],pattern:O,id:P=(_==null?void 0:_.id)??Cm.uuid(),...z}=n,[{wrapId:H,wrapProps:G,labelProps:N,...J},Y]=Bg(z),K=B.useMemo(()=>q6(J.errorMessage)?"Error":t,[J.errorMessage,t]),fe=B.useMemo(()=>K==="ReadOnly"?!0:o,[K,o]),X=B.useMemo(()=>Y.isDisabled||Y.isLoading,[Y.isDisabled,Y.isLoading]),[te,ne]=Fo(i,""),ue=B.useCallback($=>{var re;if(!X){if(O&&$.key.length===1){const ge=$.currentTarget.value,me=ge.slice(0,$.currentTarget.selectionStart||0)+$.key+ge.slice($.currentTarget.selectionEnd||0);if(!new RegExp(O).test(me)){$.preventDefault();return}}(re=_==null?void 0:_.onKeyDown)==null||re.call(_,$),["Escape","Enter","ArrowUp","ArrowDown"].includes($.key)||$.stopPropagation(),$.key==="Enter"&&e&&e($.currentTarget.value)}},[X,_,e,O]),se=B.useCallback($=>{var re;X||O&&!new RegExp(O).test($.target.value)||a&&$.target.value.length<a||(ne==null||ne($.target.value),(re=_==null?void 0:_.onChange)==null||re.call(_,$))},[X,a,ne,_,O]);return x?M.jsx(lg,{wrapId:H,wrapProps:G,labelProps:N,...J,children:M.jsx("form",{onSubmit:$=>$.preventDefault(),children:M.jsxs(zi,{...Y,className:dt.clsx(ou.InputContainer,ou[K],X&&ou.UnAvailable,Y.className),children:[S&&M.jsx("div",{className:ou.LeftAddon,children:S}),M.jsx("input",{..._,ref:r,autoComplete:w,autoFocus:m,className:dt.clsx(ou.AInput,K==="Error"&&ou.InputError,_==null?void 0:_.className),id:P,list:`${P}-datalist`,maxLength:h,placeholder:l,readOnly:fe,tabIndex:Y.isDisabled||Y.isLoading?-1:g,type:"password",value:te,onChange:se,onKeyDown:ue}),k.length>0&&M.jsx("datalist",{id:`${P}-datalist`,children:k.map(($,re)=>M.jsx("option",{value:$},re))}),R&&M.jsx("div",{className:dt.clsx(ou.RightAddon,"NoSelect"),children:R})]})})}):M.jsx(lg,{wrapId:H,wrapProps:G,labelProps:N,...J,children:M.jsxs(zi,{...Y,className:dt.clsx(ou.InputContainer,ou[K],X&&ou.UnAvailable,Y.className),children:[S&&M.jsx("div",{className:ou.LeftAddon,children:S}),M.jsx("input",{..._,ref:r,autoComplete:w,autoFocus:m,className:dt.clsx(ou.AInput,K==="Error"&&ou.InputError,_==null?void 0:_.className),id:P,list:`${P}-datalist`,maxLength:h,pattern:O,placeholder:l,readOnly:fe,tabIndex:Y.isDisabled||Y.isLoading?-1:g,value:te,onChange:se,onKeyDown:ue}),k.length>0&&M.jsx("datalist",{id:`${P}-datalist`,children:k.map(($,re)=>M.jsx("option",{value:$},re))}),R&&M.jsx("div",{className:ou.RightAddon,children:R})]})})};function q6(n){return Array.isArray(n)?n.filter(Boolean).length>0:!!n}const j6="_ASelect_1gbzd_1",$6="_Arrow_1gbzd_14",eR="_Primary_1gbzd_23",tR="_UnAvailable_1gbzd_34",nR="_IsOpen_1gbzd_34",rR="_Secondary_1gbzd_41",iR="_Placeholder_1gbzd_57",oR="_ValuesContainer_1gbzd_61",lR="_Values_1gbzd_61",sR="_Options_1gbzd_80",aR="_Raw_1gbzd_93",cR="_Option_1gbzd_80",uR="_Selected_1gbzd_122",fR="_CheckBox_1gbzd_129",Df={ASelect:j6,Arrow:$6,Primary:eR,UnAvailable:tR,IsOpen:nR,Secondary:rR,Placeholder:iR,ValuesContainer:oR,Values:lR,Options:sR,Raw:aR,Option:cR,Selected:uR,CheckBox:fR},hR=["Primary","Secondary","Raw"],Td=n=>{const{options:e,useSelect:t,type:r="Primary",placeholder:i=Or.ASelect["Select(Placeholder)"],onClose:o,OptionRenderer:l=gR,SelectedRenderer:a=pR,minShowRows:h=2,maxShowRows:g=6,arrowProps:m,isAutoWidth:x=!1,...w}=n,_=B.useRef(null),S=B.useMemo(()=>w.abaseRef??_,[w.abaseRef]),R=B.useRef(null),[k,O]=Fo(t,e[0]),[P,z]=B.useState(void 0),[H,G]=B.useState(!1),[N,J]=B.useState(!1),Y=B.useRef(e),K=B.useRef(null),fe=B.useCallback(()=>J(!1),[]),X=B.useCallback(()=>{w.isDisabled||w.isLoading||e.length<1||(J(!0),setTimeout(()=>G(!0),0),setTimeout(()=>ob(R,S,e,h,g),0))},[S,w.isDisabled,w.isLoading,e,h,g]),te=B.useCallback(()=>{G(!1),J(!0),o==null||o()},[o]),ne=B.useCallback(oe=>{var Q;H?te():X(),setTimeout(()=>ob(R,S,e,h,g),0),(Q=w.onClick)==null||Q.call(w,oe)},[S,w,e,H,te,X,h,g]),ue=B.useCallback(()=>{ob(R,S,e,h,g)},[S,e,h,g]);B.useEffect(()=>{if(!H||!S.current)return;const oe=S.current;let Q=oe.parentElement;for(;Q;)Q.addEventListener("scroll",ue),Q=Q.parentElement;return()=>{let pe=oe.parentElement;for(;pe;)pe.removeEventListener("scroll",ue),pe=pe.parentElement}},[S,H,ue]),B.useEffect(()=>{if(H)return window.addEventListener("resize",ue),()=>window.removeEventListener("resize",ue)},[H,ue]);const se=B.useCallback(oe=>{oe[0].intersectionRatio===0&&te()},[te]);B.useEffect(()=>{if(!H)return;const oe=new IntersectionObserver(se,{threshold:0});return S.current&&oe.observe(S.current),()=>oe.disconnect()},[S,H,se]);const $=B.useCallback(oe=>{const Q=oe.target,pe=S.current,Ie=R.current;!pe||!Q||!Ie||!pe.contains(Q)&&!Ie.contains(Q)&&te()},[S,te]),re=B.useMemo(()=>w.isDisabled||w.isLoading||e.length<1,[w.isDisabled,w.isLoading,e]);B.useEffect(()=>{if(H)return setTimeout(()=>document.addEventListener("mousedown",$),0),()=>document.removeEventListener("mousedown",$)},[H,$]);const ge=B.useCallback((oe,Q)=>{oe.stopPropagation(),oe.preventDefault(),O==null||O(Q),te()},[O,te]),me=B.useCallback(()=>{if(!x||!S.current)return;const oe=kg.calculateOptimalSelectWidth({elementRef:S,options:e,selectedOption:k,placeholder:i,optionRenderer:Q=>Q===null?null:l({option:Q}),type:r,isMulti:!1});z(oe)},[x,S,e,k,i,l,r]);return B.useEffect(()=>x?((e!==Y.current||P===void 0)&&(K.current!==null&&cancelAnimationFrame(K.current),K.current=requestAnimationFrame(()=>{me(),K.current=null,Y.current=[...e]})),()=>{K.current!==null&&(cancelAnimationFrame(K.current),K.current=null)}):void 0,[x,e,me,P]),B.useEffect(()=>()=>{typeof kg.clearCache=="function"&&kg.clearCache()},[]),M.jsxs(M.Fragment,{children:[M.jsxs(zi,{...w,abaseRef:S,isDisabled:w.isDisabled||e.length<1,className:dt.clsx(w.className,Df.ASelect,"NoSelect",H&&Df.IsOpen,re&&Df.UnAvailable,Df[r]),style:{padding:r==="Secondary"?"8px 8px 8px 0":0,width:P?`${P}px`:x?"100px":void 0,...w.style},onClick:ne,children:[M.jsx("div",{className:Df.ValuesContainer,children:M.jsx("div",{className:dt.clsx(Df.Values,(k==null||k==="")&&Df.Placeholder),children:M.jsx(a,{OptionRenderer:l,placeholder:i,selectedOption:k})})}),M.jsx("div",{...m,className:dt.clsx(Df.Arrow,m==null?void 0:m.className),children:M.jsx(fo,{icon:"TriangleDown",style:{transform:H?"rotate(180deg)":"",transition:"var(--Transition)"}})})]}),e.length>0&&(H||N)&&su.createPortal(M.jsx("div",{ref:R,className:dt.clsx(Df.Options,Df[r]),style:{opacity:+H,visibility:H?"visible":"hidden",pointerEvents:H?void 0:"none",borderRadius:S.current?window.getComputedStyle(S.current).borderRadius:void 0,width:P?`${P}px`:x?"100px":void 0},onTransitionEnd:fe,children:e.map((oe,Q)=>{const pe=k===oe,Ie=S.current?window.getComputedStyle(S.current):void 0;return oe===null?null:M.jsx("div",{className:dt.clsx(Df.Option,pe&&Df.Selected,"NoSelect",Df[r]),style:{height:Ie==null?void 0:Ie.height},onClick:Fe=>ge(Fe,oe),children:M.jsx(l,{option:oe})},Q)})}),document.body)]})};function ob(n,e,t,r,i){if(!e.current||!n.current||!t||t.length<1)return;const o=e.current.getBoundingClientRect(),l=dR(o,t.length,r,i),a=window.getComputedStyle(e.current);n.current.style.top=`calc(${l.top??0}px - ${a.borderTopWidth})`,n.current.style.bottom=l.bottom?l.bottom+"px":"",n.current.style.left=l.left+"px",n.current.style.width||(n.current.style.minWidth=l.minWidth+"px"),n.current.style.minHeight=l.minHeight+"px",n.current.style.maxHeight=l.maxHeight+"px",n.current.style.visibility="visible"}function dR(n,e,t,r){const i={top:n.bottom,bottom:void 0,left:n.left,height:"fit-content",minWidth:n.width,minHeight:n.height*Math.min(t,e),maxHeight:n.height*r>window.innerHeight-n.bottom-10?window.innerHeight-n.bottom-10:n.height*r};return window.innerHeight-n.bottom-10<i.height&&(window.innerHeight-n.bottom-10<i.minHeight?(i.top=n.top-e*n.height,i.top<0&&(i.top=10,i.minHeight=n.top-10,i.height=n.top-10)):i.height=window.innerHeight-n.bottom-10),i}const gR=n=>{const{option:e}=n;return $n.isReactNode(e)?e:null},pR=n=>{const e=Gn.c(3),{selectedOption:t,OptionRenderer:r,placeholder:i}=n;if(t==null||t==="")return i;const o=t;let l;return e[0]!==r||e[1]!==o?(l=M.jsx(r,{option:o}),e[0]=r,e[1]=o,e[2]=l):l=e[2],l},vR="_Anchor_1l5ql_1",bR="_Primary_1l5ql_18",yR="_Secondary_1l5ql_21",mR="_Placeholder_1l5ql_25",xR="_Icon_1l5ql_30",wR="_ADatePicker_1l5ql_40",CR="_StringInputWrap_1l5ql_51",_R="_StringInputContainer_1l5ql_56",SR="_StringInput_1l5ql_51",ER="_IsIdx_1l5ql_71",TR="_CalendarContainer_1l5ql_75",AR="_Header_1l5ql_81",RR="_Prev_1l5ql_85",IR="_Next_1l5ql_86",kR="_MonthYear_1l5ql_119",MR="_Select_1l5ql_124",LR="_Calendar_1l5ql_75",OR="_Cell_1l5ql_134",PR="_IsNotCurrentMonth_1l5ql_146",DR="_IsSelected_1l5ql_150",NR="_IsDisabled_1l5ql_154",FR="_IsHovered_1l5ql_157",BR="_Week_1l5ql_161",zR="_WeekDay_1l5ql_166",Vo={Anchor:vR,Primary:bR,Secondary:yR,Placeholder:mR,Icon:xR,ADatePicker:wR,StringInputWrap:CR,StringInputContainer:_R,StringInput:SR,String:"_String_1l5ql_51",IsIdx:ER,CalendarContainer:TR,Header:AR,Prev:RR,Next:IR,MonthYear:kR,Select:MR,Calendar:LR,Cell:OR,IsNotCurrentMonth:PR,IsSelected:DR,IsDisabled:NR,IsHovered:FR,Week:BR,WeekDay:zR},HR="_Anchor_5u6hq_1",WR="_Primary_5u6hq_18",UR="_Secondary_5u6hq_22",GR="_Placeholder_5u6hq_26",YR="_Icon_5u6hq_31",VR="_ADateRangePicker_5u6hq_41",ZR="_StringInputWrap_5u6hq_52",XR="_StringInputContainer_5u6hq_56",KR="_StringInput_5u6hq_52",JR="_IsIdx_5u6hq_72",QR="_CalendarContainer_5u6hq_76",qR="_Header_5u6hq_82",jR="_Prev_5u6hq_86",$R="_Next_5u6hq_87",e8="_MonthYear_5u6hq_120",t8="_Select_5u6hq_125",n8="_Calendar_5u6hq_76",r8="_Cell_5u6hq_135",i8="_IsNotCurrentMonth_5u6hq_147",o8="_IsSelected_5u6hq_151",l8="_IsDisabled_5u6hq_155",s8="_IsHovered_5u6hq_158",a8="_Week_5u6hq_162",c8="_WeekDay_5u6hq_167",u8="_ChoiceButton_5u6hq_171",Xi={Anchor:HR,Primary:WR,Secondary:UR,Placeholder:GR,Icon:YR,ADateRangePicker:VR,StringInputWrap:ZR,StringInputContainer:XR,StringInput:KR,String:"_String_5u6hq_52",IsIdx:JR,CalendarContainer:QR,Header:qR,Prev:jR,Next:$R,MonthYear:e8,Select:t8,Calendar:n8,Cell:r8,IsNotCurrentMonth:i8,IsSelected:o8,IsDisabled:l8,IsHovered:s8,Week:a8,WeekDay:c8,ChoiceButton:u8},_m=n=>{const{type:e="Primary",className:t,useDateRange:r,actionRef:i,position:o=O1.SE,minDate:l,maxDate:a,isDisabled:h,isLoading:g,yearsOptionSize:m,noDefaultChoices:x,LeftAddon:w,RightAddon:_,placeholder:S,noClearButton:R,resources:k,onClick:O,...P}=n,z=B.useMemo(()=>({...Or.ADateRangePicker,...k}),[k]),H=B.useMemo(()=>S??z["Select DateRange"],[S,z]),[G,N]=B.useMemo(()=>{let Ce,it;if(l&&(Ce=Un.makeSDate(l)),a&&(it=Un.makeEDate(a)),Ce&&it&&Un["<"](it,Ce)){console.warn("ADateRangePicker: maxDate should be greater than minDate. maxDate and minDate are swapped.");const Ct=Ce;Ce=it,it=Ct}return[Ce,it]},[l,a]),[J,Y]=B.useState("sD"),[K,fe]=Fo(r,void 0),X=B.useCallback(Ce=>{fe&&(Ce===void 0?(fe(void 0),rt(""),qe("")):(fe({sDate:Un.makeSDate(Ce.sDate),eDate:Un.makeEDate(Ce.eDate)}),rt(Un.toString(Ce.sDate)),qe(Un.toString(Ce.eDate))))},[fe]);B.useEffect(()=>{K&&(rt(Un.toString(K.sDate)),qe(Un.toString(K.eDate)))},[K]);const te=B.useCallback(Ce=>{if(!fe)return;let it=K?K.sDate:Un.makeSDate(Ce);Ce=Un.makeEDate(Ce),fe({sDate:it,eDate:Ce}),rt(Un.toString(it)),qe(Un.toString(Ce))},[fe,K]),[ne,ue]=B.useState(),[se,$]=B.useState(),re=B.useCallback(Ce=>{J==="sD"&&X({sDate:Ce,eDate:Ce}),ue(Ce),$(Ce)},[J,X,ue]),ge=B.useCallback(Ce=>{J==="sD"?ne&&(Un.eq(ne,Ce)?Y("eD"):Un[">"](Ce,ne)?(te(Ce),ue(void 0)):(X({sDate:Ce,eDate:ne}),ue(void 0))):(K?Un["<"](Ce,K.sDate)?X({sDate:Ce,eDate:K.eDate}):te(Ce):X({sDate:Ce,eDate:Ce}),ue(void 0),Y("sD"))},[te,ne,Y,J,X,K,ue]),me=B.useCallback(Ce=>{ne&&$(Ce)},[ne]),oe=B.useCallback(()=>{$(void 0),ue(void 0),Y("sD")},[Y,ue]),[Q,pe]=B.useState(K2(K,G,N)),Ie=B.useMemo(()=>Sm(Q.year,G,N,m),[Q.year,G,N,m]),Fe=B.useMemo(()=>Ap(Q.year,G,N),[G,N,Q.year]),xe=B.useCallback(Ce=>{if(!Ie.includes(Ce))return;const it={month:Q.month,year:Ce},Ct=Ap(it.year,G,N);Ct.length<1||(Ct.includes(it.month)||(it.month<Ct[0]?it.month=Ct[0]:it.month>Ct[Ct.length-1]&&(it.month=Ct[Ct.length-1])),pe(it))},[G,N,Ie,Q.month]),Oe=B.useCallback(Ce=>{Fe.includes(Ce)&&pe({month:Ce,year:Q.year})},[Fe,Q.year]),Le=B.useMemo(()=>N?new Date(Q.year,Q.month+1,1)>N:!1,[Q,N]),He=B.useCallback(()=>{if(Le||Fe.length<1)return;const Ce=Q.month+1;Ce>11?pe({month:Fe[0],year:Q.year+1}):pe({month:Ce,year:Q.year})},[Le,Fe,Q]),Te=B.useMemo(()=>G?new Date(Q.year,Q.month,0)<G:!1,[Q,G]),ke=B.useCallback(()=>{if(Te||Fe.length<1)return;const Ce=Q.month-1;Ce<Fe[0]?pe({month:Fe[Fe.length-1],year:Q.year-1}):pe({month:Ce,year:Q.year})},[Te,Fe,Q]),[Be,rt]=B.useState(K!=null&&K.sDate?Un.toString(K.sDate):""),Re=B.useCallback(Ce=>{if(Ce.length>10||(rt(Ce),Ce.length<10)||!fe)return;let it=Un.toDate(Ce);if(!it)return;G&&it<G&&(it=G),N&&it>N&&(it=N);let Ct=K?K.eDate:it;K&&Un[">"](it,Ct)&&([it,Ct]=J2(it,Ct)),X({sDate:it,eDate:Ct}),pe({month:it.getMonth(),year:it.getFullYear()})},[fe,X,K,G,N]),[ut,qe]=B.useState(K!=null&&K.eDate?Un.toString(K.eDate):""),ot=B.useCallback(Ce=>{if(Ce.length>10||(qe(Ce),Ce.length<10)||!fe)return;let it=Un.toDate(Ce);if(!it)return;G&&it<G&&(it=G),N&&it>N&&(it=N);let Ct=K?K.sDate:it;K&&Un[">"](Ct,it)&&([Ct,it]=J2(Ct,it)),X({sDate:Ct,eDate:it}),pe({month:it.getMonth(),year:it.getFullYear()})},[fe,X,K,G,N]),st=B.useCallback(()=>{K&&(rt(Un.toString(K.sDate)),qe(Un.toString(K.eDate)))},[K]),bt=B.useMemo(()=>{const{month:Ce,year:it}=Q,Ct=new Date(it,Ce,1),Qt=new Date(it,Ce+1,0),Yt=[];for(let gn=0;gn<Ct.getDay();gn++){const kt=new Date(it,Ce,0).getDate()-Ct.getDay()+gn+1,vt=new Date(it,Ce-1,kt),zt=G&&G>vt||N&&N<vt,Lt=K?Un.be(K.sDate,vt,K.eDate):!1,yt=se&&K&&Un.be(K.sDate,vt,se);Yt.push({day:kt,isSelected:Lt,isHovered:yt,date:vt,isDisabled:zt,isCurrentMonth:!1})}for(let gn=1;gn<=Qt.getDate();gn++){const lt=new Date(it,Ce,gn),kt=G&&G>lt||N&&N<lt,vt=K?Un.be(K.sDate,lt,K.eDate):!1,zt=se&&K&&Un.be(K.sDate,lt,se);Yt.push({day:gn,isSelected:vt,isHovered:zt,date:lt,isDisabled:kt,isCurrentMonth:!0})}for(let gn=0;gn<7-Qt.getDay()-1;gn++){const lt=new Date(it,Ce+1,gn+1),kt=G&&G>lt||N&&N<lt,vt=K?Un.be(K.sDate,lt,K.eDate):!1,zt=se&&K&&Un.be(K.sDate,lt,se);Yt.push({day:gn+1,isSelected:vt,isHovered:zt,date:lt,isDisabled:kt,isCurrentMonth:!1})}const yn=[];for(let gn=0;gn<Yt.length/7;gn++)yn.push(M.jsx("div",{className:Xi.Week,children:Yt.slice(gn*7,gn*7+7).map((lt,kt)=>M.jsx(Ic,{isDisabled:lt.isDisabled,type:"Raw",className:dt.clsx(Xi.Cell,lt.isDisabled?Xi.IsDisabled:lt.isCurrentMonth?lt.isSelected?Xi.IsSelected:lt.isHovered&&Xi.IsHovered:Xi.IsNotCurrentMonth),onMouseDown:()=>lt.isCurrentMonth&&re(lt.date),onMouseEnter:()=>lt.isCurrentMonth&&me(lt.date),onMouseUp:()=>lt.isCurrentMonth&&ge(lt.date),children:lt.day},kt))},gn));return yn},[Q,se,K,G,N,re,ge,me]),Mt=B.useRef(null),Bt=B.useCallback(()=>{Mt&&mm(Mt,gt,o)},[Mt,o]),[at,Ye]=B.useState(!1),[Tt,Ut]=B.useState(!1),gt=B.useRef(null),Ht=B.useCallback(()=>{h||g||(Ye(!0),setTimeout(()=>Ut(!0),0),setTimeout(()=>Bt(),0),pe(K2(K,G,N)))},[h,g,K,Bt,G,N]),xt=B.useCallback(()=>{h||g||(Ye(!0),Ut(!1))},[h,g]),pn=B.useMemo(()=>Tt?xt:Ht,[Tt,Ht,xt]),$t=B.useCallback(()=>Ye(!1),[]),sn=B.useCallback(Ce=>{const it=document.getElementById("root"),Ct=Ce.target,Qt=gt.current,Yt=Mt.current;!it||!Qt||!Ct||!Yt||!Qt.contains(Ct)&&it.contains(Ct)&&!Yt.contains(Ct)&&xt()},[xt]);B.useEffect(()=>{if(Tt)return setTimeout(()=>document.addEventListener("mousedown",sn),0),()=>document.removeEventListener("mousedown",sn)},[Tt,sn]);const Xt=B.useCallback(()=>{Bt()},[Bt]);B.useEffect(()=>{if(!Tt||!(Mt!=null&&Mt.current))return;const Ce=Mt.current;let it=Ce.parentElement;for(;it;)it.addEventListener("scroll",Xt),it=it.parentElement;return()=>{let Ct=Ce.parentElement;for(;Ct;)Ct.removeEventListener("scroll",Xt),Ct=Ct.parentElement}},[Mt,Tt,Xt]),B.useEffect(()=>{if(Tt)return window.addEventListener("resize",Xt),()=>window.removeEventListener("resize",Xt)},[Tt,Xt]);const bn=B.useCallback(Ce=>{Ce[0].intersectionRatio===0&&xt()},[xt]);B.useEffect(()=>{if(!Tt)return;const Ce=new IntersectionObserver(bn,{threshold:0});return gt.current&&Ce.observe(gt.current),()=>Ce.disconnect()},[gt,Tt,bn]),B.useEffect(()=>{i&&(i.current={open:Ht,close:xt,toggle:pn})},[i,Ht,xt,pn]),B.useEffect(()=>{if(!K)return;let Ce={sDate:K.sDate,eDate:K.eDate};G&&(Un["<"](K.sDate,G)&&(Ce.sDate=G),Un["<"](K.eDate,G)&&(Ce.eDate=G)),N&&(Un[">"](K.sDate,N)&&(Ce.sDate=N),Un[">"](K.eDate,N)&&(Ce.eDate=N)),(Ce.sDate!==K.sDate||Ce.eDate!==K.eDate)&&X(Ce)},[G,N,K,X]);const hn=B.useCallback(Ce=>{O==null||O(Ce),pn()},[O,pn]),Rn=B.useCallback(Ce=>{X(void 0),xt(),Ce.stopPropagation()},[X,xt]),vn=B.useCallback(()=>K?M.jsx(ba,{icon:"Close",style:{scale:"0.8"},type:"Raw",onClick:Rn}):null,[K,Rn]),We=B.useMemo(()=>K?`${Un.toString(K.sDate)} ~ ${Un.toString(K.eDate)}`:M.jsx("span",{className:Xi.Placeholder,children:H}),[K,H]);return M.jsxs(M.Fragment,{children:[M.jsxs(zi,{...P,abaseRef:Mt,className:dt.clsx(Xi.Anchor,"IsClickable",Xi[e],t),isDisabled:h,isLoading:g,onClick:hn,children:[w,M.jsxs(B.Activity,{mode:e==="Primary"?"visible":"hidden",children:[M.jsx(fo,{className:dt.clsx(Xi.Icon,Xi[e]),icon:"CalendarDay"}),M.jsx(cs,{w:4})]}),We,M.jsx(zg,{}),M.jsx(B.Activity,{mode:R?"hidden":"visible",children:M.jsx(vn,{})}),M.jsx(B.Activity,{mode:e==="Secondary"?"visible":"hidden",children:M.jsx(fo,{className:dt.clsx(Xi.Icon,Xi[e]),icon:"CalendarDay"})}),M.jsx(B.Activity,{mode:_?"visible":"hidden",children:_})]}),(Tt||at)&&su.createPortal(M.jsxs("div",{ref:gt,className:Xi.ADateRangePicker,style:{opacity:+Tt,visibility:Tt?"visible":"hidden"},onMouseLeave:oe,onTransitionEnd:$t,children:[M.jsxs("div",{className:Xi.StringInputContainer,children:[M.jsxs(Ml,{children:[M.jsx(sg,{className:dt.clsx(Xi.String,J==="sD"&&se&&Xi.IsIdx),inputProps:{className:Xi.StringInput},maxLength:11,placeholder:"YYYY-MM-DD",useValue:[Be,Re],wrapProps:{className:Xi.StringInputWrap},onBlur:st}),M.jsx(cs,{w:8}),M.jsx(sg,{className:dt.clsx(Xi.String,J==="eD"&&se&&Xi.IsIdx),inputProps:{className:Xi.StringInput},maxLength:11,placeholder:"YYYY-MM-DD",useValue:[ut,ot],wrapProps:{className:Xi.StringInputWrap},onBlur:st})]}),!x&&M.jsxs(Ml,{style:{marginTop:4},children:[M.jsx(f0,{children:z["1일"],onClick:()=>X({sDate:new Date,eDate:new Date})}),M.jsx(f0,{children:z["1주일"],onClick:()=>X({sDate:new Date(new Date().setDate(new Date().getDate()-7)),eDate:new Date})}),M.jsx(f0,{children:z["1개월"],onClick:()=>X({sDate:new Date(new Date().setMonth(new Date().getMonth()-1)),eDate:new Date})}),M.jsx(f0,{children:z["3개월"],onClick:()=>X({sDate:new Date(new Date().setMonth(new Date().getMonth()-3)),eDate:new Date})})]})]}),M.jsxs("div",{className:Xi.CalendarContainer,children:[M.jsxs(Ml,{className:Xi.Header,children:[M.jsx(Ic,{className:Xi.Prev,isDisabled:Te,type:"Raw",onClick:ke}),M.jsxs("div",{className:Xi.MonthYear,children:[M.jsx(Td,{isAutoWidth:!0,className:Xi.Select,OptionRenderer:Ce=>z.months(Ce.option),options:Fe,SelectedRenderer:Ce=>z.months(Ce.selectedOption),type:"Secondary",useSelect:[Q.month,Oe]}),M.jsx(cs,{w:8}),M.jsx(Td,{isAutoWidth:!0,className:Xi.Select,options:Ie,type:"Secondary",useSelect:[Q.year,xe]})]}),M.jsx(Ic,{className:Xi.Next,isDisabled:Le,type:"Raw",onClick:He})]}),M.jsx(cs,{h:10}),M.jsxs("div",{className:Xi.Calendar,children:[M.jsx("div",{className:Xi.Week,children:[0,1,2,3,4,5,6].map(Ce=>M.jsx("div",{className:dt.clsx(Xi.WeekDay,Xi.Cell),children:z.weekDays(Ce)},Ce))}),bt]})]})]}),document.body)]})};function Ap(n,e,t){let r=0;e&&e.getFullYear()===n&&(r=e.getMonth());let i=11;t&&t.getFullYear()===n&&(i=t.getMonth());const o=[];for(let l=r;l<=i;l++)o.push(l);return o}function Sm(n,e,t,r=5){const i=[];let o=n-r/2+r%2/2;e&&o<e.getFullYear()&&(o=e.getFullYear());let l=o+r-1;t&&l>t.getFullYear()&&(l=t.getFullYear());for(let a=o;a<=l;a++)i.push(a);return i}function K2(n,e,t){return n??(n={sDate:new Date,eDate:new Date}),e&&Un["<"](n.sDate,e)?{month:e.getMonth(),year:e.getFullYear()}:t&&Un[">"](n.eDate,t)?{month:t.getMonth(),year:t.getFullYear()}:{month:n.sDate.getMonth(),year:n.sDate.getFullYear()}}function J2(n,e){return[e,n]}const f0=n=>{const e=Gn.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=dt.clsx(Xi.ChoiceButton,"Headline2"),e[0]=t):t=e[0];let r;return e[1]!==n?(r=M.jsx(Ic,{className:t,type:"Secondary",...n}),e[1]=n,e[2]=r):r=e[2],r},f8=["Primary","Secondary","Raw"],Em=n=>{const e=Gn.c(255);let t,r,i,o,l,a,h,g,m,x,w,_,S,R,k,O;e[0]!==n?({type:R,className:l,useDate:O,actionRef:o,position:k,minDate:h,maxDate:a,isDisabled:w,isLoading:_,placeholder:m,LeftAddon:t,RightAddon:r,resources:x,noClearButton:S,onClick:g,...i}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S,e[14]=R,e[15]=k,e[16]=O):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13],R=e[14],k=e[15],O=e[16]);const P=R===void 0?"Primary":R,z=k===void 0?O1.SE:k;let H;e[17]!==x?(H={...Or.ADatePicker,...x},e[17]=x,e[18]=H):H=e[18];const G=H,N=m??G["Select Date"];let J;if(e[19]!==a||e[20]!==h){e:{let cn,Cn;if(h&&(cn=Un.makeSDate(h)),a&&(Cn=Un.makeEDate(a)),cn&&Cn&&Un["<"](Cn,cn)){console.warn("ADatePicker: maxDate should be greater than minDate. maxDate and minDate are swapped."),J=[Un.makeSDate(Cn),Un.makeEDate(cn)];break e}let Pr;e[22]!==Cn||e[23]!==cn?(Pr=[cn,Cn],e[22]=Cn,e[23]=cn,e[24]=Pr):Pr=e[24],J=Pr}e[19]=a,e[20]=h,e[21]=J}else J=e[21];const[Y,K]=J,[fe,X]=Fo(O,null);let te;e[25]!==fe?(te=fe?Un.toString(fe):"",e[25]=fe,e[26]=te):te=e[26];const[ne,ue]=B.useState(te);let se;e[27]!==K||e[28]!==Y||e[29]!==fe?(se=()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getMonth():K&&cn>K?K.getMonth():(cn??new Date).getMonth()},e[27]=K,e[28]=Y,e[29]=fe,e[30]=se):se=e[30];const[$,re]=B.useState(se);let ge;e[31]!==K||e[32]!==Y||e[33]!==fe?(ge=()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getFullYear():K&&cn>K?K.getFullYear():(cn??new Date).getFullYear()},e[31]=K,e[32]=Y,e[33]=fe,e[34]=ge):ge=e[34];const[me,oe]=B.useState(ge);let Q;e[35]!==K||e[36]!==Y||e[37]!==$?(Q=cn=>{oe(cn);const Cn=Ap(cn,Y,K);Cn.includes($)||($<Cn[0]?re(Cn[0]):$>Cn[Cn.length-1]&&re(Cn[Cn.length-1]))},e[35]=K,e[36]=Y,e[37]=$,e[38]=Q):Q=e[38];const pe=Q;let Ie;e[39]!==K||e[40]!==Y||e[41]!==X?(Ie=cn=>{if(cn.length>10||(ue(cn),cn.length<10)||!X)return;let Cn=Un.toDate(cn);Cn&&(Y&&Cn<Y&&(Cn=Y),K&&Cn>K&&(Cn=K),X(Cn),oe(Cn.getFullYear()),re(Cn.getMonth()))},e[39]=K,e[40]=Y,e[41]=X,e[42]=Ie):Ie=e[42];const Fe=Ie;let xe;e[43]!==me?(xe=cn=>{const Cn=me+cn;Cn<0||oe(Cn)},e[43]=me,e[44]=xe):xe=e[44];const Oe=xe;let Le;e[45]!==$||e[46]!==Oe?(Le=cn=>{const Cn=$+cn;Cn<0?(re(11),Oe(-1)):Cn>11?(re(0),Oe(1)):re(Cn)},e[45]=$,e[46]=Oe,e[47]=Le):Le=e[47];const He=Le;let Te;e[48]!==X?(Te=cn=>{X&&(cn===void 0?(X(void 0),ue("")):(X(cn),ue(Un.toString(cn))))},e[48]=X,e[49]=Te):Te=e[49];const ke=Te;let Be;e[50]!==$||e[51]!==me?(Be=new Date(me,$,0),e[50]=$,e[51]=me,e[52]=Be):Be=e[52];const Re=Y&&Be<Y,ut=$+1;let qe;e[53]!==ut||e[54]!==me?(qe=new Date(me,ut,1),e[53]=ut,e[54]=me,e[55]=qe):qe=e[55];const st=K&&qe>K;let bt;e[56]!==Re||e[57]!==He?(bt=()=>{Re||He(-1)},e[56]=Re,e[57]=He,e[58]=bt):bt=e[58];const Mt=bt;let Bt;e[59]!==st||e[60]!==He?(Bt=()=>{st||He(1)},e[59]=st,e[60]=He,e[61]=Bt):Bt=e[61];const at=Bt,[Ye,Tt]=B.useState(null);let Ut;e[62]!==X?(Ut=()=>{X&&Tt(null)},e[62]=X,e[63]=Ut):Ut=e[63];const gt=Ut;let Ht;e[64]!==X?(Ht=cn=>{X&&Tt(cn)},e[64]=X,e[65]=Ht):Ht=e[65];const xt=Ht;let pn;if(e[66]!==ke||e[67]!==Ye||e[68]!==K||e[69]!==Y||e[70]!==$||e[71]!==xt||e[72]!==gt||e[73]!==fe||e[74]!==me){const cn=new Date(me,$,1),Cn=new Date(me,$+1,0),Pr=[];for(let fr=0;fr<cn.getDay();fr++){const Nr=new Date(me,$,0).getDate()-cn.getDay()+fr+1,Er=new Date(me,$-1,Nr),gi=Y&&Y>Er||K&&K<Er,Ri=fe&&Un.eq(Er,fe),Dr=Ye&&Un.eq(Er,Ye);Pr.push({day:Nr,isSelected:Ri,date:Er,isDisabled:gi,isHovered:Dr,isCurrentMonth:!1})}for(let fr=1;fr<=Cn.getDate();fr++){const ar=new Date(me,$,fr),Nr=Y&&Y>ar||K&&K<ar,Er=fe&&Un.eq(ar,fe),gi=Ye&&Un.eq(ar,Ye);Pr.push({day:fr,isSelected:Er,date:ar,isDisabled:Nr,isHovered:gi,isCurrentMonth:!0})}for(let fr=0;fr<7-Cn.getDay()-1;fr++){const ar=new Date(me,$+1,fr+1),Nr=Y&&Y>ar||K&&K<ar,Er=fe&&Un.eq(ar,fe),gi=Ye&&Un.eq(ar,Ye);Pr.push({day:fr+1,isSelected:Er,date:ar,isDisabled:Nr,isHovered:gi,isCurrentMonth:!1})}pn=[];for(let fr=0;fr<Pr.length/7;fr++)pn.push(M.jsx("div",{className:Vo.Week,children:Pr.slice(fr*7,fr*7+7).map((ar,Nr)=>M.jsx(Ic,{isDisabled:ar.isDisabled,type:"Raw",className:dt.clsx(Vo.Cell,ar.isDisabled?Vo.IsDisabled:ar.isCurrentMonth?ar.isSelected?Vo.IsSelected:ar.isHovered&&Vo.IsHovered:Vo.IsNotCurrentMonth),onClick:()=>ar.isCurrentMonth&&ke(ar.date),onMouseEnter:()=>ar.isCurrentMonth&&xt(ar.date),onMouseLeave:()=>ar.isCurrentMonth&&gt(),children:ar.day},Nr))},fr));e[66]=ke,e[67]=Ye,e[68]=K,e[69]=Y,e[70]=$,e[71]=xt,e[72]=gt,e[73]=fe,e[74]=me,e[75]=pn}else pn=e[75];const $t=pn,sn=B.useRef(null);let Xt;e[76]!==z?(Xt=()=>{sn&&mm(sn,Ce,z)},e[76]=z,e[77]=Xt):Xt=e[77];const bn=Xt,[hn,Rn]=B.useState(!1),[vn,We]=B.useState(!1),Ce=B.useRef(null);let it;e[78]!==bn||e[79]!==w||e[80]!==_||e[81]!==K||e[82]!==Y||e[83]!==fe?(it=()=>{w||_||(Rn(!0),setTimeout(()=>We(!0),0),setTimeout(()=>bn(),0),ue(fe?Un.toString(fe):""),re(()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getMonth():K&&cn>K?K.getMonth():cn.getMonth()}),oe(()=>{const cn=fe??new Date;return Y&&cn<Y?Y.getFullYear():K&&cn>K?K.getFullYear():cn.getFullYear()}))},e[78]=bn,e[79]=w,e[80]=_,e[81]=K,e[82]=Y,e[83]=fe,e[84]=it):it=e[84];const Ct=it;let Qt;e[85]!==w||e[86]!==_?(Qt=()=>{w||_||(Rn(!0),We(!1))},e[85]=w,e[86]=_,e[87]=Qt):Qt=e[87];const Yt=Qt,yn=vn?Yt:Ct;let gn;e[88]===Symbol.for("react.memo_cache_sentinel")?(gn=()=>Rn(!1),e[88]=gn):gn=e[88];const lt=gn;let kt;e[89]!==Yt?(kt=cn=>{const Cn=document.getElementById("root"),Pr=cn.target,fr=Ce.current,ar=sn.current;!Cn||!fr||!Pr||!ar||!fr.contains(Pr)&&Cn.contains(Pr)&&!ar.contains(Pr)&&Yt()},e[89]=Yt,e[90]=kt):kt=e[90];const vt=kt;let zt,Lt;e[91]!==vn||e[92]!==vt?(zt=()=>{if(vn)return setTimeout(()=>document.addEventListener("mousedown",vt),0),()=>document.removeEventListener("mousedown",vt)},Lt=[vn,vt],e[91]=vn,e[92]=vt,e[93]=zt,e[94]=Lt):(zt=e[93],Lt=e[94]),B.useEffect(zt,Lt);let yt;e[95]!==bn?(yt=()=>{bn()},e[95]=bn,e[96]=yt):yt=e[96];const Rt=yt;let on,En;e[97]!==vn||e[98]!==Rt?(on=()=>{if(!vn||!(sn!=null&&sn.current))return;const cn=sn.current;let Cn=cn.parentElement;for(;Cn;)Cn.addEventListener("scroll",Rt),Cn=Cn.parentElement;return()=>{let Pr=cn.parentElement;for(;Pr;)Pr.removeEventListener("scroll",Rt),Pr=Pr.parentElement}},En=[sn,vn,Rt],e[97]=vn,e[98]=Rt,e[99]=on,e[100]=En):(on=e[99],En=e[100]),B.useEffect(on,En);let Jt,xn;e[101]!==vn||e[102]!==Rt?(Jt=()=>{if(vn)return window.addEventListener("resize",Rt),()=>window.removeEventListener("resize",Rt)},xn=[vn,Rt],e[101]=vn,e[102]=Rt,e[103]=Jt,e[104]=xn):(Jt=e[103],xn=e[104]),B.useEffect(Jt,xn);let _n;e[105]!==Yt?(_n=cn=>{cn[0].intersectionRatio===0&&Yt()},e[105]=Yt,e[106]=_n):_n=e[106];const zn=_n;let er;e[107]!==vn||e[108]!==zn?(er=()=>{if(!vn)return;const cn=new IntersectionObserver(zn,{threshold:0});return Ce.current&&cn.observe(Ce.current),()=>cn.disconnect()},e[107]=vn,e[108]=zn,e[109]=er):er=e[109];let wn;e[110]!==vn||e[111]!==zn?(wn=[Ce,vn,zn],e[110]=vn,e[111]=zn,e[112]=wn):wn=e[112],B.useEffect(er,wn);let ri,$e;e[113]!==o||e[114]!==Yt||e[115]!==Ct||e[116]!==yn?(ri=()=>{o&&(o.current={open:Ct,close:Yt,toggle:yn})},$e=[o,Ct,Yt,yn],e[113]=o,e[114]=Yt,e[115]=Ct,e[116]=yn,e[117]=ri,e[118]=$e):(ri=e[117],$e=e[118]),B.useEffect(ri,$e);let tn;e[119]!==g||e[120]!==yn?(tn=cn=>{g==null||g(cn),yn()},e[119]=g,e[120]=yn,e[121]=tn):tn=e[121];const ln=tn;let Nn;e[122]!==ke||e[123]!==Yt?(Nn=cn=>{ke(void 0),Yt(),cn.stopPropagation()},e[122]=ke,e[123]=Yt,e[124]=Nn):Nn=e[124];const yr=Nn;let Ln;e[125]!==yr||e[126]!==fe?(Ln=()=>fe?M.jsx(ba,{icon:"Close",style:{scale:"0.8"},type:"Raw",onClick:yr}):null,e[125]=yr,e[126]=fe,e[127]=Ln):Ln=e[127];const Pt=Ln;let Se;if(fe){let cn;e[128]!==fe?(cn=Un.toString(fe),e[128]=fe,e[129]=cn):cn=e[129],Se=cn}else{let cn;e[130]!==N?(cn=M.jsx("span",{className:Vo.Placeholder,children:N}),e[130]=N,e[131]=cn):cn=e[131],Se=cn}const tt=Se;let At;e[132]!==l||e[133]!==P?(At=dt.clsx(Vo.Anchor,"IsClickable",Vo[P],l),e[132]=l,e[133]=P,e[134]=At):At=e[134];const Sn=P==="Primary"?"visible":"hidden";let In;e[135]!==P?(In=dt.clsx(Vo.Icon,Vo[P]),e[135]=P,e[136]=In):In=e[136];let Yn;e[137]!==In?(Yn=M.jsx(fo,{className:In,icon:"CalendarDay"}),e[137]=In,e[138]=Yn):Yn=e[138];let lr;e[139]===Symbol.for("react.memo_cache_sentinel")?(lr=M.jsx(cs,{w:4}),e[139]=lr):lr=e[139];let pr;e[140]!==Sn||e[141]!==Yn?(pr=M.jsxs(B.Activity,{mode:Sn,children:[Yn,lr]}),e[140]=Sn,e[141]=Yn,e[142]=pr):pr=e[142];let On;e[143]===Symbol.for("react.memo_cache_sentinel")?(On=M.jsx(zg,{}),e[143]=On):On=e[143];const tr=S?"hidden":"visible";let An;e[144]!==Pt?(An=M.jsx(Pt,{}),e[144]=Pt,e[145]=An):An=e[145];let sr;e[146]!==tr||e[147]!==An?(sr=M.jsx(B.Activity,{mode:tr,children:An}),e[146]=tr,e[147]=An,e[148]=sr):sr=e[148];const hr=P==="Secondary"?"visible":"hidden";let ho;e[149]!==P?(ho=dt.clsx(Vo.Icon,Vo[P]),e[149]=P,e[150]=ho):ho=e[150];let So;e[151]!==ho?(So=M.jsx(fo,{className:ho,icon:"CalendarDay"}),e[151]=ho,e[152]=So):So=e[152];let oo;e[153]!==hr||e[154]!==So?(oo=M.jsx(B.Activity,{mode:hr,children:So}),e[153]=hr,e[154]=So,e[155]=oo):oo=e[155];const sl=r?"visible":"hidden";let Ki;e[156]!==r||e[157]!==sl?(Ki=M.jsx(B.Activity,{mode:sl,children:r}),e[156]=r,e[157]=sl,e[158]=Ki):Ki=e[158];let Ai;e[159]!==t||e[160]!==i||e[161]!==tt||e[162]!==w||e[163]!==_||e[164]!==ln||e[165]!==At||e[166]!==pr||e[167]!==sr||e[168]!==oo||e[169]!==Ki?(Ai=M.jsxs(zi,{...i,abaseRef:sn,className:At,isDisabled:w,isLoading:_,onClick:ln,children:[t,pr,tt,On,sr,oo,Ki]}),e[159]=t,e[160]=i,e[161]=tt,e[162]=w,e[163]=_,e[164]=ln,e[165]=At,e[166]=pr,e[167]=sr,e[168]=oo,e[169]=Ki,e[170]=Ai):Ai=e[170];const Jl=vn||hn?"visible":"hidden";let Zo;if(e[171]!==$t||e[172]!==ne||e[173]!==st||e[174]!==vn||e[175]!==Re||e[176]!==K||e[177]!==Y||e[178]!==$||e[179]!==Fe||e[180]!==at||e[181]!==Mt||e[182]!==pe||e[183]!==G||e[184]!==fe||e[185]!==me){const cn=+vn;let Cn;e[187]!==cn?(Cn={opacity:cn},e[187]=cn,e[188]=Cn):Cn=e[188];let Pr;e[189]===Symbol.for("react.memo_cache_sentinel")?(Pr={className:Vo.StringInput},e[189]=Pr):Pr=e[189];const fr=fe?30:11;let ar;e[190]!==ne||e[191]!==Fe?(ar=[ne,Fe],e[190]=ne,e[191]=Fe,e[192]=ar):ar=e[192];let Nr;e[193]===Symbol.for("react.memo_cache_sentinel")?(Nr={className:Vo.StringInputWrap},e[193]=Nr):Nr=e[193];let Er;e[194]!==fr||e[195]!==ar?(Er=M.jsx("div",{className:Vo.StringInputContainer,children:M.jsx(sg,{className:Vo.String,inputProps:Pr,maxLength:fr,placeholder:"YYYY-MM-DD",useValue:ar,wrapProps:Nr})}),e[194]=fr,e[195]=ar,e[196]=Er):Er=e[196];let gi;e[197]!==Re||e[198]!==Mt?(gi=M.jsx(Ic,{className:Vo.Prev,isDisabled:Re,type:"Raw",onClick:Mt}),e[197]=Re,e[198]=Mt,e[199]=gi):gi=e[199];let Ri;e[200]!==G?(Ri=go=>G.months(go.option),e[200]=G,e[201]=Ri):Ri=e[201];let Dr;e[202]!==K||e[203]!==Y||e[204]!==me?(Dr=Ap(me,Y,K),e[202]=K,e[203]=Y,e[204]=me,e[205]=Dr):Dr=e[205];let Bo;e[206]!==G?(Bo=go=>G.months(go.selectedOption),e[206]=G,e[207]=Bo):Bo=e[207];let Eo;e[208]!==$?(Eo=[$,re],e[208]=$,e[209]=Eo):Eo=e[209];let To;e[210]!==Ri||e[211]!==Dr||e[212]!==Bo||e[213]!==Eo?(To=M.jsx(Td,{isAutoWidth:!0,className:Vo.Select,OptionRenderer:Ri,options:Dr,SelectedRenderer:Bo,type:"Secondary",useSelect:Eo}),e[210]=Ri,e[211]=Dr,e[212]=Bo,e[213]=Eo,e[214]=To):To=e[214];let Ii;e[215]===Symbol.for("react.memo_cache_sentinel")?(Ii=M.jsx(cs,{w:8}),e[215]=Ii):Ii=e[215];let Vr;e[216]!==K||e[217]!==Y||e[218]!==me?(Vr=Sm(me,Y,K),e[216]=K,e[217]=Y,e[218]=me,e[219]=Vr):Vr=e[219];let xr;e[220]!==pe||e[221]!==me?(xr=[me,pe],e[220]=pe,e[221]=me,e[222]=xr):xr=e[222];let al;e[223]!==Vr||e[224]!==xr?(al=M.jsx(Td,{isAutoWidth:!0,className:Vo.Select,options:Vr,type:"Secondary",useSelect:xr}),e[223]=Vr,e[224]=xr,e[225]=al):al=e[225];let xi;e[226]!==To||e[227]!==al?(xi=M.jsxs("div",{className:Vo.MonthYear,children:[To,Ii,al]}),e[226]=To,e[227]=al,e[228]=xi):xi=e[228];let Ji;e[229]!==st||e[230]!==at?(Ji=M.jsx(Ic,{className:Vo.Next,isDisabled:st,type:"Raw",onClick:at}),e[229]=st,e[230]=at,e[231]=Ji):Ji=e[231];let cl;e[232]!==gi||e[233]!==xi||e[234]!==Ji?(cl=M.jsxs(Ml,{className:Vo.Header,children:[gi,xi,Ji]}),e[232]=gi,e[233]=xi,e[234]=Ji,e[235]=cl):cl=e[235];let Ao;e[236]===Symbol.for("react.memo_cache_sentinel")?(Ao=M.jsx(cs,{h:10}),e[236]=Ao):Ao=e[236];let Hi;e[237]!==G?(Hi=M.jsx("div",{className:Vo.Week,children:[0,1,2,3,4,5,6].map(go=>M.jsx("div",{className:dt.clsx(Vo.WeekDay,Vo.Cell),children:G.weekDays(go)},go))}),e[237]=G,e[238]=Hi):Hi=e[238];let zo;e[239]!==$t||e[240]!==Hi?(zo=M.jsxs("div",{className:Vo.Calendar,children:[Hi,$t]}),e[239]=$t,e[240]=Hi,e[241]=zo):zo=e[241];let Qi;e[242]!==cl||e[243]!==zo?(Qi=M.jsxs("div",{className:Vo.CalendarContainer,children:[cl,Ao,zo]}),e[242]=cl,e[243]=zo,e[244]=Qi):Qi=e[244];let qi;e[245]!==Cn||e[246]!==Er||e[247]!==Qi?(qi=M.jsxs("div",{ref:Ce,className:Vo.ADatePicker,style:Cn,onTransitionEnd:lt,children:[Er,Qi]}),e[245]=Cn,e[246]=Er,e[247]=Qi,e[248]=qi):qi=e[248],Zo=su.createPortal(qi,document.body),e[171]=$t,e[172]=ne,e[173]=st,e[174]=vn,e[175]=Re,e[176]=K,e[177]=Y,e[178]=$,e[179]=Fe,e[180]=at,e[181]=Mt,e[182]=pe,e[183]=G,e[184]=fe,e[185]=me,e[186]=Zo}else Zo=e[186];let xo;e[249]!==Jl||e[250]!==Zo?(xo=M.jsx(B.Activity,{mode:Jl,children:Zo}),e[249]=Jl,e[250]=Zo,e[251]=xo):xo=e[251];let Gr;return e[252]!==Ai||e[253]!==xo?(Gr=M.jsxs(M.Fragment,{children:[Ai,xo]}),e[252]=Ai,e[253]=xo,e[254]=Gr):Gr=e[254],Gr},h8="_Paper_e69j5_1",d8="_Card_e69j5_15",g8="_Body_e69j5_26",p8="_Title_e69j5_35",v8="_Content_e69j5_42",b8="_Action_e69j5_45",y8="_Button_e69j5_58",Qh={Paper:h8,Card:d8,Body:g8,Title:p8,Content:v8,Action:b8,Button:y8},m8=["okCancel","cancelOk","ok","cancel","none"],x8=n=>{const e=Gn.c(129),{dlgCore:t,type:r,title:i,children:o,style:l,titleStyle:a,bodyStyle:h,contentStyle:g,okButtonStyle:m,cancelButtonStyle:x,actionStyle:w,onOk:_,onCancel:S,onClose:R,onEnterPress:k,onEscPress:O,onSpacePress:P,onPaperClick:z,noDim:H,isLoading:G,isOkDisabled:N,isOkLoading:J,isCancelDisabled:Y,isCancelLoading:K,isChanged:fe,buttonNoInteractive:X,okButtonClassName:te,cancelButtonClassName:ne,progress:ue,ProgressRenderer:se,progressProps:$,resources:re}=n,ge=r===void 0?"okCancel":r,me=H===void 0?!1:H;let oe;e[0]!==re?(oe={...Or.ADialog,...re},e[0]=re,e[1]=oe):oe=e[1];const Q=oe,[pe,Ie]=B.useState(0);let Fe,xe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Fe=()=>Ie(1),xe=[],e[2]=Fe,e[3]=xe):(Fe=e[2],xe=e[3]),B.useEffect(Fe,xe);let Oe;e[4]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>{Ie(0)},e[4]=Oe):Oe=e[4];const Le=Oe;let He;e[5]!==t||e[6]!==R||e[7]!==pe?(He=()=>{if(!pe){const[,it]=t.state.useIsOpen;it==null||it(!1),R==null||R()}},e[5]=t,e[6]=R,e[7]=pe,e[8]=He):He=e[8];const Te=He;let ke;e[9]!==G||e[10]!==N||e[11]!==J||e[12]!==_||e[13]!==pe||e[14]!==ge?(ke=async()=>{if(!pe||ge==="cancel"||ge==="none"||G||N||J)return;const{event:it,e:Ct}=Eg();await(_==null?void 0:_(Ct)),!it.preventDefault&&Le()},e[9]=G,e[10]=N,e[11]=J,e[12]=_,e[13]=pe,e[14]=ge,e[15]=ke):ke=e[15];const Be=ke;let rt;e[16]!==Y||e[17]!==K||e[18]!==G||e[19]!==S||e[20]!==pe||e[21]!==ge?(rt=async()=>{if(!pe||ge==="ok"||ge==="none"||G||Y||K)return;const{event:it,e:Ct}=Eg();await(S==null?void 0:S(Ct)),!it.preventDefault&&Le()},e[16]=Y,e[17]=K,e[18]=G,e[19]=S,e[20]=pe,e[21]=ge,e[22]=rt):rt=e[22];const Re=rt;let ut,qe;e[23]!==Re||e[24]!==t||e[25]!==Be?(qe=()=>{t&&t.state.setAction({close:Le,ok:Be,cancel:Re})},ut=[t,Le,Be,Re],e[23]=Re,e[24]=t,e[25]=Be,e[26]=ut,e[27]=qe):(ut=e[26],qe=e[27]),B.useEffect(qe,ut);let ot;e[28]!==k||e[29]!==G||e[30]!==Be?(ot=async()=>{if(G)return;const{event:it,e:Ct}=Eg();await(k==null?void 0:k(Ct)),!it.preventDefault&&Be()},e[28]=k,e[29]=G,e[30]=Be,e[31]=ot):ot=e[31];const st=ot;let bt;e[32]!==P||e[33]!==G||e[34]!==Be?(bt=async()=>{if(G)return;const{event:it,e:Ct}=Eg();await(P==null?void 0:P(Ct)),!it.preventDefault&&Be()},e[32]=P,e[33]=G,e[34]=Be,e[35]=bt):bt=e[35];const Mt=bt;let Bt;e[36]!==Re||e[37]!==O||e[38]!==fe||e[39]!==G?(Bt=async()=>{if(G)return;const{event:it,e:Ct}=Eg();await(O==null?void 0:O(Ct)),!it.preventDefault&&(fe||Re())},e[36]=Re,e[37]=O,e[38]=fe,e[39]=G,e[40]=Bt):Bt=e[40];const at=Bt,Ye=B.useRef(null);let Tt;e[41]!==st||e[42]!==at||e[43]!==Mt||e[44]!==pe?(Tt=it=>{const Ct=document.body.getElementsByClassName(Qh.Paper);Ct.length===0||Ct[Ct.length-1]!==Ye.current||(it.key==="Enter"&&pe?st():it.key===" "&&pe?Mt():it.key==="Escape"&&pe&&at())},e[41]=st,e[42]=at,e[43]=Mt,e[44]=pe,e[45]=Tt):Tt=e[45];const Ut=Tt;let gt,Ht;e[46]!==Ut||e[47]!==pe?(gt=()=>{if(pe)return window.addEventListener("keydown",Ut),()=>window.removeEventListener("keydown",Ut)},Ht=[pe,Ut],e[46]=Ut,e[47]=pe,e[48]=gt,e[49]=Ht):(gt=e[48],Ht=e[49]),B.useEffect(gt,Ht);const xt=B.useRef(!1),pn=B.useRef(!1);let $t;e[50]===Symbol.for("react.memo_cache_sentinel")?($t=()=>{xt.current=!0},e[50]=$t):$t=e[50];const sn=$t;let Xt;e[51]===Symbol.for("react.memo_cache_sentinel")?(Xt=()=>{xt.current=!1,pn.current=!1},e[51]=Xt):Xt=e[51];const bn=Xt;let hn;e[52]===Symbol.for("react.memo_cache_sentinel")?(hn=()=>{pn.current=!0},e[52]=hn):hn=e[52];const Rn=hn;let vn;e[53]!==Re||e[54]!==z||e[55]!==fe||e[56]!==G?(vn=async()=>{if(G)return;const it=!pn.current||xt.current;if(xt.current=!1,pn.current=!1,it)return;const{event:Ct,e:Qt}=Eg();await(z==null?void 0:z(Qt)),!Ct.preventDefault&&(fe||Re())},e[53]=Re,e[54]=z,e[55]=fe,e[56]=G,e[57]=vn):vn=e[57];const We=vn;let Ce;if(e[58]!==se||e[59]!==w||e[60]!==h||e[61]!==X||e[62]!==Re||e[63]!==ne||e[64]!==x||e[65]!==o||e[66]!==g||e[67]!==Y||e[68]!==K||e[69]!==G||e[70]!==N||e[71]!==J||e[72]!==me||e[73]!==Be||e[74]!==te||e[75]!==m||e[76]!==We||e[77]!==Te||e[78]!==pe||e[79]!==ue||e[80]!==$||e[81]!==Q||e[82]!==l||e[83]!==i||e[84]!==a||e[85]!==ge){const it=me?"transparent":void 0,Ct=pe?void 0:"none";let Qt;e[87]!==pe||e[88]!==it||e[89]!==Ct?(Qt={backgroundColor:it,pointerEvents:Ct,opacity:pe},e[87]=pe,e[88]=it,e[89]=Ct,e[90]=Qt):Qt=e[90];let Yt;e[91]!==i||e[92]!==a?(Yt=i&&M.jsx(w8,{title:i,titleStyle:a}),e[91]=i,e[92]=a,e[93]=Yt):Yt=e[93];let yn;e[94]!==o||e[95]!==g?(yn=o&&M.jsx("div",{className:Qh.Content,style:g,children:o}),e[94]=o,e[95]=g,e[96]=yn):yn=e[96];let gn;e[97]!==h||e[98]!==Yt||e[99]!==yn?(gn=M.jsxs("div",{className:Qh.Body,style:h,children:[Yt,yn]}),e[97]=h,e[98]=Yt,e[99]=yn,e[100]=gn):gn=e[100];let lt;e[101]!==w||e[102]!==X||e[103]!==Re||e[104]!==ne||e[105]!==x||e[106]!==Y||e[107]!==K||e[108]!==N||e[109]!==J||e[110]!==Be||e[111]!==te||e[112]!==m||e[113]!==Q||e[114]!==ge?(lt=ge!=="none"&&M.jsx(C8,{type:ge,ok:Be,cancel:Re,resources:Q,isOkDisabled:N,isOkLoading:J,isCancelDisabled:Y,isCancelLoading:K,okButtonStyle:m,cancelButtonStyle:x,actionStyle:w,buttonNoInteractive:X,okButtonClassName:te,cancelButtonClassName:ne}),e[101]=w,e[102]=X,e[103]=Re,e[104]=ne,e[105]=x,e[106]=Y,e[107]=K,e[108]=N,e[109]=J,e[110]=Be,e[111]=te,e[112]=m,e[113]=Q,e[114]=ge,e[115]=lt):lt=e[115];let kt;e[116]!==se||e[117]!==G||e[118]!==ue||e[119]!==$||e[120]!==l||e[121]!==gn||e[122]!==lt?(kt=M.jsxs(zi,{className:Qh.Card,isLoading:G,progress:ue,progressProps:$,ProgressRenderer:se,style:l,onMouseDown:sn,onMouseUp:bn,children:[gn,lt]}),e[116]=se,e[117]=G,e[118]=ue,e[119]=$,e[120]=l,e[121]=gn,e[122]=lt,e[123]=kt):kt=e[123];let vt;e[124]!==We||e[125]!==Te||e[126]!==Qt||e[127]!==kt?(vt=M.jsx("div",{ref:Ye,className:Qh.Paper,style:Qt,onMouseDown:Rn,onMouseUp:We,onTransitionEnd:Te,children:kt}),e[124]=We,e[125]=Te,e[126]=Qt,e[127]=kt,e[128]=vt):vt=e[128],Ce=su.createPortal(vt,document.body),e[58]=se,e[59]=w,e[60]=h,e[61]=X,e[62]=Re,e[63]=ne,e[64]=x,e[65]=o,e[66]=g,e[67]=Y,e[68]=K,e[69]=G,e[70]=N,e[71]=J,e[72]=me,e[73]=Be,e[74]=te,e[75]=m,e[76]=We,e[77]=Te,e[78]=pe,e[79]=ue,e[80]=$,e[81]=Q,e[82]=l,e[83]=i,e[84]=a,e[85]=ge,e[86]=Ce}else Ce=e[86];return Ce},w8=n=>{const e=Gn.c(4),{title:t,titleStyle:r}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=dt.clsx(Qh.Title,"NoSelect","Title3"),e[0]=i):i=e[0];let o;return e[1]!==t||e[2]!==r?(o=M.jsx("div",{className:i,style:r,children:t}),e[1]=t,e[2]=r,e[3]=o):o=e[3],o},C8=n=>{const e=Gn.c(41),{type:t,ok:r,cancel:i,resources:o,isOkDisabled:l,isOkLoading:a,isCancelDisabled:h,isCancelLoading:g,okButtonStyle:m,cancelButtonStyle:x,actionStyle:w,buttonNoInteractive:_,okButtonClassName:S,cancelButtonClassName:R}=n,k=o.Ok;let O;e[0]!==S?(O=dt.clsx(Qh.Button,S),e[0]=S,e[1]=O):O=e[1];let P;e[2]!==_||e[3]!==l||e[4]!==a||e[5]!==r||e[6]!==m||e[7]!==o.Ok||e[8]!==O?(P={onClick:r,isDisabled:l,isLoading:a,children:k,style:m,noInteractive:_,className:O},e[2]=_,e[3]=l,e[4]=a,e[5]=r,e[6]=m,e[7]=o.Ok,e[8]=O,e[9]=P):P=e[9];const z=P,H=o.Cancel;let G;e[10]!==R?(G=dt.clsx(Qh.Button,R),e[10]=R,e[11]=G):G=e[11];let N;e[12]!==_||e[13]!==i||e[14]!==x||e[15]!==h||e[16]!==g||e[17]!==o.Cancel||e[18]!==G?(N={type:"Secondary",onClick:i,isDisabled:h,isLoading:g,children:H,style:x,noInteractive:_,className:G},e[12]=_,e[13]=i,e[14]=x,e[15]=h,e[16]=g,e[17]=o.Cancel,e[18]=G,e[19]=N):N=e[19];const J=N;if(t==="okCancel"||t==="ok"){let Y;e[20]!==w?(Y={...w},e[20]=w,e[21]=Y):Y=e[21];let K;e[22]!==z?(K=M.jsx(Ic,{...z}),e[22]=z,e[23]=K):K=e[23];let fe;e[24]!==J||e[25]!==t?(fe=t==="okCancel"&&M.jsxs(M.Fragment,{children:[M.jsx(cs,{w:8}),M.jsx(Ic,{...J})]}),e[24]=J,e[25]=t,e[26]=fe):fe=e[26];let X;return e[27]!==Y||e[28]!==K||e[29]!==fe||e[30]!==t?(X=M.jsxs("div",{className:Qh.Action,style:Y,children:[K,fe]},t),e[27]=Y,e[28]=K,e[29]=fe,e[30]=t,e[31]=X):X=e[31],X}else if(t==="cancelOk"||t==="cancel"){let Y;e[32]!==J?(Y=M.jsx(Ic,{...J}),e[32]=J,e[33]=Y):Y=e[33];let K;e[34]!==z||e[35]!==t?(K=t==="cancelOk"&&M.jsxs(M.Fragment,{children:[M.jsx(cs,{w:8}),M.jsx(Ic,{...z})]}),e[34]=z,e[35]=t,e[36]=K):K=e[36];let fe;return e[37]!==Y||e[38]!==K||e[39]!==t?(fe=M.jsxs("div",{className:Qh.Action,children:[Y,K]},t),e[37]=Y,e[38]=K,e[39]=t,e[40]=fe):fe=e[40],fe}},_8=n=>{const e=B.useMemo(()=>Math.random().toFixed(32),[]),t=B.useMemo(()=>{const _={};return n.forEach(S=>{_[S]=S+e}),_},[n,e]),r=B.useMemo(()=>[],[]),i=B.useMemo(()=>(r.length=0,r.push(...n),r),[r,n]),[o,l]=B.useState([]),a=B.useRef((()=>{const _={};return i.forEach(S=>{_[S]={open:()=>l(R=>[...R,S]),close:()=>{},ok:()=>{},cancel:()=>{}}}),_})()),h=B.useMemo(()=>{const _={};return i.forEach(S=>{_[S]=R=>{l(k=>!R&&k.includes(S)?k.filter(O=>O!==S):R&&!k.includes(S)?[...k,S]:k)}}),_},[i]),g=B.useMemo(()=>{const _={};return i.forEach(S=>{const k=[o.includes(S),h[S]],O=P=>{a.current[S]={...a.current[S],...P}};_[S]={useIsOpen:k,setAction:O}}),_},[o,h,i]),m=B.useMemo(()=>{const _={};return i.forEach(S=>{const R=()=>a.current[S].open(),k=()=>a.current[S].close(),O=()=>a.current[S].ok(),P=()=>a.current[S].cancel();_[S]={open:R,close:k,ok:O,cancel:P}}),_},[i]),x=B.useMemo(()=>({}),[]),w=B.useMemo(()=>(i.forEach(_=>{x[_]={state:g[_],action:m[_]}}),x),[x,i,g,m]);return B.useEffect(()=>(Object.keys(w).forEach(S=>{const R=w[S],k=t[S],O=kh.find(P=>{P.id});O?O.core=R:kh.push({id:k,core:R})}),()=>{const S=Object.keys(w),R=kh.filter(k=>S.includes(k.id));kh.length=0,kh.push(...R)}),[w,t]),w},S8=()=>{const n=B.useMemo(()=>Math.random().toFixed(32),[]),[e,t]=B.useState(!1),r=B.useRef({open:()=>t(!0),close:()=>{},ok:()=>{},cancel:()=>{}}),i=B.useMemo(()=>({useIsOpen:[e,t],setAction:h=>{r.current={...r.current,...h}}}),[e]),o=B.useMemo(()=>({open:()=>r.current.open(),close:()=>r.current.close(),ok:()=>r.current.ok(),cancel:()=>r.current.cancel()}),[]),l=B.useMemo(()=>({}),[]),a=B.useMemo(()=>(l.state=i,l.action=o,l),[l,i,o]);return B.useEffect(()=>{const h=kh.find(g=>g.id===n);return h?h.core=a:kh.push({id:n,core:a}),()=>{const g=kh.filter(m=>m.id!==n);kh.length=0,kh.push(...g)}},[n,a]),a},E8=n=>{const e=Gn.c(5),{dlgCore:t,children:r}=n,[i,o]=t.state.useIsOpen;let l,a;e[0]!==o?(l=()=>()=>o==null?void 0:o(!1),a=[o],e[0]=o,e[1]=l,e[2]=a):(l=e[1],a=e[2]),B.useEffect(l,a);const h=i&&r;let g;return e[3]!==h?(g=M.jsx(B.Suspense,{children:h}),e[3]=h,e[4]=g):g=e[4],g},T8=n=>e=>{const{dlgCore:t}=e;return M.jsx(E8,{dlgCore:t,children:B.cloneElement(M.jsx(n,{...e}),{dlgCore:t})})},kh=[],A8={closeAllDlgs:()=>{kh.forEach(n=>{n.core.action.close()})}},R8="_AFileBox_1hlo1_1",I8="_SelectedFile_1hlo1_16",k8="_Dropping_1hlo1_26",Tm={AFileBox:R8,SelectedFile:I8,Dropping:k8},M8=n=>{const e=Gn.c(60);let t,r,i,o,l,a,h,g,m,x,w,_;e[0]!==n?({useFile:_,FileRenderer:g,SelectRenderer:m,DropRenderer:x,resources:i,accept:w,onInvalidFileFormat:h,fileSelectButtonClassName:o,isDisabled:l,isLoading:a,className:r,...t}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_):(t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12]);const S=g===void 0?L8:g,R=m===void 0?O8:m,k=x===void 0?P8:x,O=w===void 0?"":w;let P;e[13]!==i?(P={...Or.AFileBox,...i},e[13]=i,e[14]=P):P=e[14];const z=P,H=B.useRef(null),G=B.useRef(null),[N,J]=Fo(_,null),[Y,K]=B.useState(!1);let fe;e[15]!==O?(fe=O.split(",").map(D8).filter(N8),e[15]=O,e[16]=fe):fe=e[16];const X=fe;let te;e[17]!==X?(te=Re=>{if(X.length===0)return!1;const ut=Re.name.split(".").pop();return ut?!X.includes(`.${ut}`):!0},e[17]=X,e[18]=te):te=e[18];const ne=te;let ue;e[19]!==ne||e[20]!==h||e[21]!==J?(ue=Re=>{if(J)if(ne(Re)){h==null||h();return}else J(Re);else return},e[19]=ne,e[20]=h,e[21]=J,e[22]=ue):ue=e[22];const se=ue;let $;e[23]!==se?($=Re=>{Re.target.files&&Re.target.files.length>0&&se(Re.target.files[0])},e[23]=se,e[24]=$):$=e[24];const re=$;let ge;e[25]!==se||e[26]!==l||e[27]!==a?(ge=Re=>{Re.preventDefault(),K(!1),!(l||a)&&Re.dataTransfer.files&&Re.dataTransfer.files.length>0&&se(Re.dataTransfer.files[0])},e[25]=se,e[26]=l,e[27]=a,e[28]=ge):ge=e[28];const me=ge;let oe;e[29]!==l||e[30]!==a?(oe=Re=>{Re.preventDefault(),!(l||a)&&K(!0)},e[29]=l,e[30]=a,e[31]=oe):oe=e[31];const Q=oe;let pe;e[32]===Symbol.for("react.memo_cache_sentinel")?(pe=Re=>{Re.target===H.current&&Re.relatedTarget.contains(H.current.parentElement)&&(Re.preventDefault(),K(!1))},e[32]=pe):pe=e[32];const Ie=pe,Fe=F8;let xe;e[33]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{var Re;(Re=G.current)==null||Re.click()},e[33]=xe):xe=e[33];const Oe=xe;let Le;if(Y){let Re;e[34]!==k||e[35]!==z?(Re=M.jsx(k,{resources:z}),e[34]=k,e[35]=z,e[36]=Re):Re=e[36],Le=Re}else if(N){let Re;e[37]!==S||e[38]!==N||e[39]!==_?(Re=M.jsx(S,{file:N,useFile:_}),e[37]=S,e[38]=N,e[39]=_,e[40]=Re):Re=e[40],Le=Re}else{let Re;e[41]!==R||e[42]!==o||e[43]!==z?(Re=M.jsx(R,{fileSelectButtonClassName:o,resources:z,onClick:Oe}),e[41]=R,e[42]=o,e[43]=z,e[44]=Re):Re=e[44],Le=Re}const He=Le;let Te;e[45]!==r?(Te=dt.clsx(Tm.AFileBox,r),e[45]=r,e[46]=Te):Te=e[46];let ke;e[47]===Symbol.for("react.memo_cache_sentinel")?(ke={display:"none"},e[47]=ke):ke=e[47];let Be;e[48]!==O||e[49]!==re?(Be=M.jsx("input",{ref:G,accept:O,style:ke,type:"file",value:"",onChange:re}),e[48]=O,e[49]=re,e[50]=Be):Be=e[50];let rt;return e[51]!==t||e[52]!==He||e[53]!==l||e[54]!==a||e[55]!==Q||e[56]!==me||e[57]!==Te||e[58]!==Be?(rt=M.jsxs(zi,{...t,abaseRef:H,className:Te,isDisabled:l,isLoading:a,onDragEnter:Q,onDragLeave:Ie,onDragOver:Fe,onDrop:me,children:[Be,He]}),e[51]=t,e[52]=He,e[53]=l,e[54]=a,e[55]=Q,e[56]=me,e[57]=Te,e[58]=Be,e[59]=rt):rt=e[59],rt},L8=n=>{const e=Gn.c(10),{file:t,useFile:r}=n,[,i]=Fo(r,null);let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={backgroundColor:""},l=M.jsx(fo,{icon:"File"}),e[0]=o,e[1]=l):(o=e[0],l=e[1]);let a;e[2]!==t.name?(a=M.jsx(nd,{children:t.name}),e[2]=t.name,e[3]=a):a=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h={marginLeft:2,transform:"scale(0.8)"},e[4]=h):h=e[4];let g;e[5]!==i?(g=M.jsx(ba,{icon:"Close",style:h,type:"Raw",onClick:()=>i==null?void 0:i(null)}),e[5]=i,e[6]=g):g=e[6];let m;return e[7]!==a||e[8]!==g?(m=M.jsxs(Ml,{className:Tm.SelectedFile,style:o,children:[l,a,g]}),e[7]=a,e[8]=g,e[9]=m):m=e[9],m},O8=n=>{const e=Gn.c(9),{onClick:t,resources:r,fileSelectButtonClassName:i}=n;let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=dt.clsx("NoSelect"),l={gap:4},e[0]=o,e[1]=l):(o=e[0],l=e[1]);const a=r["Select File"];let h;e[2]!==i||e[3]!==t||e[4]!==a?(h=M.jsx(Ic,{className:i,onClick:t,children:a}),e[2]=i,e[3]=t,e[4]=a,e[5]=h):h=e[5];const g=r["or Drag & Drop"];let m;return e[6]!==h||e[7]!==g?(m=M.jsxs(Ml,{className:o,style:l,children:[h,g]}),e[6]=h,e[7]=g,e[8]=m):m=e[8],m},P8=n=>{const e=Gn.c(4),{resources:t}=n;let r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=dt.clsx(Tm.Dropping,"NoSelect","Headline2"),i=M.jsx(fo,{icon:"FileDownload"}),e[0]=r,e[1]=i):(r=e[0],i=e[1]);const o=t["drop file to select"];let l;return e[2]!==o?(l=M.jsxs(O3,{className:r,children:[i,o]}),e[2]=o,e[3]=l):l=e[3],l};function D8(n){return n.trim()}function N8(n){return n.length>0&&n.startsWith(".")}function F8(n){return n.preventDefault()}async function B8(n){const e=new Promise((t,r)=>{const i=new FileReader;i.onloadend=()=>{i.result?typeof i.result=="string"?t(i.result):r(new Error("Failed to convert file to Base64: Invalid result type.")):r(new Error("Failed to convert file to Base64: Empty result."))},i.onerror=r,i.readAsDataURL(n)});try{return await e}catch{return}}function z8(n,e){var a,h;const t=n.split(","),r=(h=(a=t[0])==null?void 0:a.match(/:(.*?);/))==null?void 0:h[1],i=atob(t[1]);let o=i.length;const l=new Uint8Array(o);for(;o--;)l[o]=i.charCodeAt(o);return new File([l],e,{type:r})}const F3=n=>n.idx?n.idx.toString():`${n.name}-${n.size}-${n.lastModified||""}`,Tg={toBase64:B8,toFile:z8,getFileKey:F3},H8="_AFileUploader_i2nun_1",W8="_LabelContainer_i2nun_16",U8="_LabelButton_i2nun_25",G8="_Disabled_i2nun_31",Y8="_Delete_i2nun_34",V8="_FileSize_i2nun_38",Z8="_TotalFileSize_i2nun_45",X8="_FileBox_i2nun_49",K8="_FileBoxFullSize_i2nun_68",J8="_SelectRenderer_i2nun_75",Q8="_ChipsContainer_i2nun_87",q8="_FileChip_i2nun_100",j8="_FileChipContent_i2nun_113",$8="_FileNameContainer_i2nun_124",e9="_ButtonRenderer_i2nun_130",t9="_ErrorBorder_i2nun_141",n9="_ErrorColor_i2nun_145",r9="_ErrorCursor_i2nun_149",i9="_DropIdle_i2nun_159",bl={AFileUploader:H8,LabelContainer:W8,LabelButton:U8,Disabled:G8,Delete:Y8,FileSize:V8,TotalFileSize:Z8,FileBox:X8,FileBoxFullSize:K8,SelectRenderer:J8,ChipsContainer:Q8,FileChip:q8,FileChipContent:j8,FileNameContainer:$8,ButtonRenderer:e9,ErrorBorder:t9,ErrorColor:n9,ErrorCursor:r9,DropIdle:i9},o9=n=>{const e=Gn.c(14),{file:t,baseClass:r,errorClass:i,errorCursorClass:o,resources:l,onDownload:a}=n,[h,g]=B.useState(!1);let m;e[0]!==r||e[1]!==i||e[2]!==o?(m=dt.clsx(r,i,o),e[0]=r,e[1]=i,e[2]=o,e[3]=m):m=e[3];const x=h?"FileDownload":"CircleAlertOutline",w=l["Fail Download"];let _;e[4]!==t||e[5]!==a?(_=()=>a(t),e[4]=t,e[5]=a,e[6]=_):_=e[6];let S,R;e[7]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(!0),R=()=>g(!1),e[7]=S,e[8]=R):(S=e[7],R=e[8]);let k;return e[9]!==m||e[10]!==x||e[11]!==w||e[12]!==_?(k=M.jsx(ba,{className:m,icon:x,iconSize:"sm",tooltip:w,type:"Raw",onClick:_,onMouseEnter:S,onMouseLeave:R}),e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=k):k=e[13],k},l9=n=>{const{useFiles:e,accept:t,onInvalidFileFormat:r,onDownload:i,onDownloadCsv:o,onDelete:l,type:a,limit:h=1024*1024*1024,maxFileCount:g,useError:m,isLoading:x,resources:w,className:_,onDownloadAll:S,csvFilename:R,...k}=n,[{wrapId:O,wrapProps:P,labelProps:z,...H},G]=Bg(k),N=B.useMemo(()=>({...Or.AFileUploader,...w}),[w]),[J,Y]=Fo(e,void 0),[K,fe]=Fo(m,!1),[X,te]=B.useState({}),[ne,ue]=B.useState(!1),se=B.useRef(0),$=B.useRef({}),re=B.useRef(null),ge=B.useRef(null),me=B.useMemo(()=>(J==null?void 0:J.reduce((at,Ye)=>at+Ye.size,0))||0,[J]);B.useEffect(()=>{fe&&fe(me>h)},[me,h,fe]);const oe=B.useCallback(at=>{var Ut;if(!t||t==="*"||t==="")return!0;const Ye=t.split(",").map(gt=>gt.trim()),Tt=`.${(Ut=at.name.split(".").pop())==null?void 0:Ut.toLowerCase()}`;return Ye.includes(Tt)?!0:Ye.some(gt=>{var Ht;if(gt.startsWith("."))return!1;if(gt.endsWith("/*")){const xt=gt.split("/")[0];return(Ht=at.type)==null?void 0:Ht.startsWith(`${xt}/`)}return at.type===gt})},[t]),Q=B.useCallback((at,Ye)=>{const Tt={...$.current};Tt[at]=Ye,$.current=Tt,te(Tt)},[te]),pe=B.useCallback(at=>{const Ye=Tg.getFileKey(at);return X[Ye]||"Normal"},[X]),Ie=B.useCallback(at=>x||pe(at)==="Loading",[x,pe]),Fe=B.useCallback(at=>pe(at)==="Error"||a==="Upload"&&at.size>h,[pe,h,a]),xe=B.useMemo(()=>J!=null&&J.length?a==="Download"?J.every(Fe):!1:!0,[J,a,Fe]),Oe=B.useCallback(()=>{re.current&&(re.current.value="")},[]),Le=B.useMemo(()=>!g||!(J!=null&&J.length)?!1:J.length>=g,[J,g]),He=B.useCallback(at=>{if(!Y)return;const Ye=[];let Tt=!1,Ut=[],gt=g?g-((J==null?void 0:J.length)||0):1/0;if(!(gt<=0)){if(Array.from(at).forEach((Ht,xt)=>{if(xt>=gt)return;if(!oe(Ht)){Tt=!0,Ut.push(Ht.name);return}const pn=Ht;pn.uniqueId=`file-${Date.now()}-${se.current++}`,Ye.push(pn)}),Tt)if(r)r();else{const Ht=t?t.replace(/,/g,", "):"",xt=Ht?`${N["Supported file format(s)"]}: ${Ht}`:"",pn=Ut.length>3?`${Ut.slice(0,3).join(", ")} ${N.and} ${Ut.length-3} ${N["more file(s)"]}`:Ut.join(", ");alert(`${N["Unsupported file format detected."]}
282
282
 
283
283
  ${N["Invalid file(s)"]}: ${pn}${xt?`
284
284
 
285
- `+xt:""}`)}Ye.length>0&&Y([...J||[],...Ye])}},[Y,oe,r,t,N,J,g]),Te=B.useCallback(()=>{var at;return(at=re.current)==null?void 0:at.click()},[]),ke=B.useCallback(at=>{const Ye=at.target.files;Ye!=null&&Ye.length&&(He(Ye),Oe())},[He,Oe]),Be=B.useCallback(at=>{if(l==null||l(at),!Y||!J)return;const Ye=Tg.getFileKey(at),Tt=J.filter(Ut=>Tg.getFileKey(Ut)!==Ye);Y(Tt),Oe()},[l,Y,J,Oe]),rt=B.useCallback(()=>{Y&&(Y([]),Oe())},[Y,Oe]),Re=B.useCallback(at=>{if(!i)return Promise.resolve();const Ye=Tg.getFileKey(at);return $.current[Ye]==="Loading"?Promise.resolve():(Q(Ye,"Loading"),new Promise(Tt=>{i(at,Ut=>{Q(Ye,Ut),Tt()})}))},[i,Q]),ut=B.useCallback(async()=>{if(J!=null&&J.length){if(te){const at={...$.current};J.forEach(Ye=>{at[Tg.getFileKey(Ye)]="Loading"}),$.current=at,te(at)}if(S){S(J,at=>{if(te){const Ye={...$.current,...at};$.current=Ye,te(Ye)}});return}for(const at of J){if(!i)continue;const Ye=Tg.getFileKey(at);await new Promise(Tt=>{i(at,Ut=>{if(te){const gt={...$.current};gt[Ye]=Ut,$.current=gt,te(gt)}Tt()})})}}},[J,i,S,te]),qe=B.useCallback(()=>{!(J!=null&&J.length)||!o||o(J)},[J,o]),ot=B.useMemo(()=>{const at=Ye=>(Ye.preventDefault(),Ye.stopPropagation(),Ye);return{onDragEnter:Ye=>{at(Ye),!K&&!x&&ue(!0)},onDragOver:Ye=>{at(Ye),!K&&!x&&Ye.dataTransfer&&(Ye.dataTransfer.dropEffect="copy")},onDragLeave:Ye=>{var Ut;at(Ye);const Tt=(Ut=ge.current)==null?void 0:Ut.contains(Ye.relatedTarget);(!Ye.relatedTarget||!Tt)&&ue(!1)},onDrop:Ye=>{var Tt;at(Ye),ue(!1),!K&&!x&&((Tt=Ye.dataTransfer.files)!=null&&Tt.length)&&He(Ye.dataTransfer.files)}}},[K,x,He]),st=B.useMemo(()=>{const at=dt.clsx(bl.ButtonRenderer,"NoSelect");return{upload:Ye=>M.jsx(ba,{className:at,icon:"X",iconSize:"sm",style:{color:"var(--AFileUploader_text_color)"},tooltip:N.Delete,type:"Raw",onClick:()=>Be(Ye)}),loading:()=>M.jsx(ba,{className:at,icon:"Spinner",iconSize:"sm",type:"Raw"}),error:Ye=>M.jsx(i9,{baseClass:at,errorClass:bl.ErrorColor,errorCursorClass:bl.ErrorCursor,file:Ye,resources:N,onDownload:Re}),download:Ye=>M.jsx(ba,{className:at,icon:"FileDownload",iconSize:"sm",style:{color:"var(--AFileUploader_brand_color)"},tooltip:N.Download,type:"Raw",onClick:()=>Re(Ye)}),view:()=>null}},[N,Be,Re]),bt=B.useCallback((at,Ye)=>{const Tt=Ie(at),Ut=Fe(at),gt=()=>a==="Upload"?st.upload(at):a==="View"?st.view():Tt?st.loading():Ut?st.error(at):st.download(at);return M.jsx(wm,{ButtonRenderer:gt,className:dt.clsx(bl.FileChip,Ut&&bl.ErrorBorder),label:M.jsx("div",{className:bl.FileChipContent,children:M.jsxs(Ml,{className:bl.FileNameContainer,children:[M.jsx(nd,{children:at.name,className:dt.clsx(Ut&&bl.ErrorColor)}),M.jsx("span",{children:Mg(at.size),className:bl.FileSize})]})})},Ye)},[Ie,Fe,a,st]),Mt=B.useCallback(()=>M.jsx("div",{className:dt.clsx(bl.FileBox,K&&bl.ErrorBorder,K&&bl.ErrorColor,K&&bl.ErrorCursor,Le&&bl.Disabled,ne&&!(J!=null&&J.length)&&bl.FileBoxFullSize),...ot,ref:ge,children:ne?M.jsxs(Ml,{className:dt.clsx("NoSelect"),style:{gap:4,display:J!=null&&J.length?"flex":"none"},children:[M.jsx(fo,{icon:"FileDownload"}),M.jsx("span",{children:N["Drop file to select"]})]}):M.jsxs(Ic,{className:dt.clsx(bl.SelectRenderer,"NoSelect"),isDisabled:K||x||Le,type:"Raw",onClick:Te,children:[N["Insert File"],g&&` ${(J==null?void 0:J.length)||0} / ${g}`]})}),[K,Le,ne,J==null?void 0:J.length,ot,N,x,Te,g]),Bt=B.useMemo(()=>{const at=a==="Upload",Ye=a==="View",Tt=at?N["Delete All"]:N["Download All"],Ut=at?rt:ut,gt=(J==null?void 0:J.some(Ht=>Ie(Ht)))||!1;return M.jsxs(Ml,{className:bl.LabelContainer,children:[H.label,a==="Upload"&&M.jsxs(nd,{className:dt.clsx(bl.TotalFileSize,"NoSelect"),children:["(",M.jsx("span",{className:dt.clsx(K&&bl.ErrorColor),children:Mg(me)})," / ",Mg(h),")"]}),!Ye&&M.jsx("span",{children:Tt,className:dt.clsx(bl.LabelButton,"Label1",(xe||gt)&&bl.Disabled,at&&bl.Delete),onClick:!xe&&!gt?Ut:void 0}),o&&M.jsx("span",{children:N["Download List"]||"Download List",className:dt.clsx(bl.LabelButton,"Label1",!(J!=null&&J.length)&&bl.Disabled),style:{marginLeft:"auto"},onClick:J!=null&&J.length?qe:void 0})]})},[a,N,rt,ut,J,H.label,K,me,h,xe,o,qe,Ie]);return a!=="Upload"&&!(J!=null&&J.length)?null:M.jsxs(lg,{wrapId:O,wrapProps:P,labelProps:z,...H,label:Bt,children:[M.jsx("input",{ref:re,multiple:!0,accept:t||"",style:{display:"none"},type:"file",onChange:ke}),M.jsxs(zi,{...G,className:dt.clsx(bl.AFileUploader,_),children:[M.jsxs(Ml,{className:bl.ChipsContainer,children:[a==="Upload"&&Mt(),J==null?void 0:J.map(bt)]}),a==="Upload"&&M.jsx(zi,{className:dt.clsx(bl.DropIdle,"Title1","NoSelect"),style:{color:ne?"var(--AFileUploader_brand_color)":"var(--AFileUploader_disabled_color)",opacity:ne?1:.4},...ot,abaseRef:ge,onClick:at=>at.preventDefault(),children:!(J!=null&&J.length)&&M.jsxs(Ml,{style:{gap:4},children:[M.jsx(fo,{icon:"FileDownload",size:"2xl"}),M.jsx("span",{children:N["Drop file to select"]})]})})]})]})},l9="_AFloatMenu_xco8u_1",s9="_Content_xco8u_10",Q2={AFloatMenu:l9,Content:s9},B3=n=>{const e=Gn.c(67),{defs:t,defaultDef:r,actionRef:i,offset:o,onClose:l,onClick:a,onPaperClick:h,position:g,width:m}=n,x=g===void 0?O1.ES:g,w=m===void 0?137:m;let _;e[0]!==r?(_={content:a9,...r},e[0]=r,e[1]=_):_=e[1];const S=_;let R;e[2]!==S||e[3]!==t?(R={},$n.keys(t).forEach(qe=>{const ot=t[qe],st={...S,...ot};st.noDisplay||(R[qe]=st)}),e[2]=S,e[3]=t,e[4]=R):R=e[4];const k=R,[O,P]=B.useState(null);let z;e[5]!==o||e[6]!==x?(z=qe=>{XC(qe,K,x,o),P(qe)},e[5]=o,e[6]=x,e[7]=z):z=e[7];const H=z,[G,N]=B.useState(!1),[J,Y]=B.useState(!1),K=B.useRef(null);let fe;e[8]!==H?(fe=qe=>{Y(!0),setTimeout(()=>N(!0),0),setTimeout(()=>H(qe),0)},e[8]=H,e[9]=fe):fe=e[9];const X=fe;let te;e[10]!==l?(te=()=>{N(!1),Y(!0),l==null||l()},e[10]=l,e[11]=te):te=e[11];const ne=te;let ue;e[12]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>Y(!1),e[12]=ue):ue=e[12];const se=ue;let $;e[13]!==ne||e[14]!==h?($=async qe=>{const ot=document.getElementById("root"),st=qe.target,bt=K.current;!ot||!bt||!st||!bt.contains(st)&&ot.contains(st)&&(await(h==null?void 0:h(qe)),ne())},e[13]=ne,e[14]=h,e[15]=$):$=e[15];const re=$;let ge,me;e[16]!==G||e[17]!==re?(ge=()=>{if(G)return setTimeout(()=>document.addEventListener("mousedown",re),0),()=>document.removeEventListener("mousedown",re)},me=[G,re],e[16]=G,e[17]=re,e[18]=ge,e[19]=me):(ge=e[18],me=e[19]),B.useEffect(ge,me);let oe;e[20]!==H||e[21]!==O?(oe=()=>{O&&H(O)},e[20]=H,e[21]=O,e[22]=oe):oe=e[22];const Q=oe;let pe,Ie;e[23]!==G||e[24]!==O||e[25]!==Q?(pe=()=>{if(!G||!O)return;let qe=O.parentElement;for(;qe;)qe.addEventListener("scroll",Q),qe=qe.parentElement;return()=>{let ot=O.parentElement;for(;ot;)ot.removeEventListener("scroll",Q),ot=ot.parentElement}},Ie=[O,G,Q],e[23]=G,e[24]=O,e[25]=Q,e[26]=pe,e[27]=Ie):(pe=e[26],Ie=e[27]),B.useEffect(pe,Ie);let Fe,xe;e[28]!==G||e[29]!==Q?(Fe=()=>{if(G)return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},xe=[G,Q],e[28]=G,e[29]=Q,e[30]=Fe,e[31]=xe):(Fe=e[30],xe=e[31]),B.useEffect(Fe,xe);let Oe;e[32]!==ne?(Oe=qe=>{qe[0].intersectionRatio===0&&ne()},e[32]=ne,e[33]=Oe):Oe=e[33];const Le=Oe;let He;e[34]!==G||e[35]!==Le?(He=()=>{if(!G)return;const qe=new IntersectionObserver(Le,{threshold:0});return K.current&&qe.observe(K.current),()=>qe.disconnect()},e[34]=G,e[35]=Le,e[36]=He):He=e[36];let Te;e[37]!==G||e[38]!==Le?(Te=[K,G,Le],e[37]=G,e[38]=Le,e[39]=Te):Te=e[39],B.useEffect(He,Te);let ke,Be;e[40]!==i||e[41]!==ne||e[42]!==X?(ke=()=>{i&&(i.current={open:X,close:ne})},Be=[i,X,ne],e[40]=i,e[41]=ne,e[42]=X,e[43]=ke,e[44]=Be):(ke=e[43],Be=e[44]),B.useEffect(ke,Be);let rt;e[45]!==ne||e[46]!==k||e[47]!==a||e[48]!==G?(rt=qe=>{var ot;if(G){if((ot=k[qe])!=null&&ot.isDisabled)return}else return;a==null||a(qe),ne()},e[45]=ne,e[46]=k,e[47]=a,e[48]=G,e[49]=rt):rt=e[49];const Re=rt;if(!G&&!J)return null;let ut;if(e[50]!==S||e[51]!==k||e[52]!==G||e[53]!==Re||e[54]!==w){const qe=+G,ot=G&&Object.keys(k).length>0?"visible":"hidden";let st;e[56]!==qe||e[57]!==ot||e[58]!==w?(st={opacity:qe,visibility:ot,minWidth:w},e[56]=qe,e[57]=ot,e[58]=w,e[59]=st):st=e[59];let bt;e[60]!==S||e[61]!==k||e[62]!==Re?(bt=$n.map(k,(Bt,at)=>{const[Ye]=Bt,Tt={...S,...k[Ye]};let{content:Ut,noDisplay:gt,tooltipDirection:Ht,...xt}=Tt;const pn=Ht===void 0?ic.E:Ht;return gt?null:(Ut=Ur.getContent(Tt.content,{defKey:Ye,def:Tt}),B.createElement(zi,{...xt,key:at,className:dt.clsx(Q2.Content,"Label2","IsClickable",xt.className),tooltipDirection:pn,onClick:$t=>{var sn;Re==null||Re(Ye),(sn=xt.onClick)==null||sn.call(xt,$t)}},Ut))}),e[60]=S,e[61]=k,e[62]=Re,e[63]=bt):bt=e[63];let Mt;e[64]!==st||e[65]!==bt?(Mt=M.jsx("div",{ref:K,className:Q2.AFloatMenu,style:st,onTransitionEnd:se,children:bt}),e[64]=st,e[65]=bt,e[66]=Mt):Mt=e[66],ut=su.createPortal(Mt,document.body),e[50]=S,e[51]=k,e[52]=G,e[53]=Re,e[54]=w,e[55]=ut}else ut=e[55];return ut},a9=n=>n.defKey;function c9(n){try{const e=Number.parseInt(n);return isNaN(e)?void 0:e}catch{return}}const G0={parseInt:c9},u9=`${Number.MAX_SAFE_INTEGER}`.length-1,f9=n=>{const e=Gn.c(58);let t,r,i,o,l,a,h,g,m,x,w,_,S;if(e[0]!==n){const{unit:He,unitMargin:Te,unitOptions:ke,useSelectUnit:Be,type:rt,min:Re,max:ut,unitSelectWidth:qe,unitOptionsRenderer:ot,useValue:st,onEnterPress:bt,canAsterisk:Mt,onFocus:Bt,...at}=n;g=He,l=Te,m=ke,_=Be,a=rt,o=Re,i=ut,w=qe,x=ot,S=st,r=bt,h=Mt,t=at,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13];const R=l===void 0?4:l,k=a===void 0?"Secondary":a,O=i!==void 0&&o!==void 0?Math.max(`${i}`.length+1,`${o}`.length+1):u9,[P,z]=Fo(S,""),[H,G]=B.useState(!1),[N,J]=B.useState(""),Y=B.useRef(null);let K;e:{if(!P||!z){K=String(P);break e}const He=String(P),Te=G0.parseInt(He);if(Te!==void 0){if(o!==void 0&&Te<o){const ke=`${o}`;z(ke),K=ke;break e}if(i!==void 0&&Te>i){const ke=`${i}`;z(ke),K=ke;break e}}K=He}const fe=K;let X;e[14]!==H||e[15]!==i||e[16]!==z?(X=He=>{if(H){if(i!==void 0&&He!==""){const Te=G0.parseInt(He);if(Te!==void 0&&Te>i){J(`${i}`);return}}J(He)}else z&&z(He)},e[14]=H,e[15]=i,e[16]=z,e[17]=X):X=e[17];const te=X;let ne;e[18]!==fe?(ne=()=>{G(!0),J(fe)},e[18]=fe,e[19]=ne):ne=e[19];const ue=ne;let se;e[20]!==i||e[21]!==o||e[22]!==z?(se=He=>{if(G(!1),!z)return;const Te=He.target.value;let ke=Te;if(Te===""||Te==="-")ke=o!==void 0?`${o}`:Te;else{const Be=G0.parseInt(Te);Be===void 0?ke=o!==void 0?`${o}`:Te:o!==void 0&&Be<o?ke=`${o}`:i!==void 0&&Be>i&&(ke=`${i}`)}ke!==Te&&(He.target.value=ke),z(ke)},e[20]=i,e[21]=o,e[22]=z,e[23]=se):se=e[23];const $=se;let re;e[24]!==r?(re=He=>{var Te;(Te=Y.current)==null||Te.blur(),r==null||r(He)},e[24]=r,e[25]=re):re=e[25];const ge=re,me=o===void 0&&i===void 0?g??"number":`${o??""}~${i??""}`,[oe,Q]=Fo(_,(m==null?void 0:m[0])??"");let pe;if(m){const He=w||"fit-content";let Te;e[26]!==He?(Te={maxWidth:He},e[26]=He,e[27]=Te):Te=e[27];let ke;e[28]!==Q||e[29]!==oe?(ke=[oe,Q],e[28]=Q,e[29]=oe,e[30]=ke):ke=e[30];let Be;e[31]!==R?(Be={style:{color:"var(--label-normal)",marginLeft:4,marginRight:R}},e[31]=R,e[32]=Be):Be=e[32];let rt;e[33]!==Te||e[34]!==ke||e[35]!==Be||e[36]!==m||e[37]!==x?(rt=M.jsx(Td,{className:ou.ANumInputUnitSelect,OptionRenderer:x,options:m,style:Te,type:"Raw",useSelect:ke,arrowProps:Be}),e[33]=Te,e[34]=ke,e[35]=Be,e[36]=m,e[37]=x,e[38]=rt):rt=e[38],pe=rt}else{let He;e[39]!==g||e[40]!==R?(He=g&&M.jsx("span",{style:{marginRight:R},children:g}),e[39]=g,e[40]=R,e[41]=He):He=e[41],pe=He}const Ie=pe;let Fe;e[42]!==n.className?(Fe=dt.clsx(ou.ANumInput,n.className),e[42]=n.className,e[43]=Fe):Fe=e[43];const xe=H?N:fe;let Oe;e[44]!==te||e[45]!==xe?(Oe=[xe,te],e[44]=te,e[45]=xe,e[46]=Oe):Oe=e[46];let Le;return e[47]!==t||e[48]!==O||e[49]!==$||e[50]!==ge||e[51]!==ue||e[52]!==me||e[53]!==Oe||e[54]!==Fe||e[55]!==k||e[56]!==Ie?(Le=M.jsx(sg,{...t,autoComplete:"off",className:Fe,inputRef:Y,maxLength:O,placeholder:me,RightAddon:Ie,type:k,useValue:Oe,onBlur:$,onEnterPress:ge,onFocus:ue}),e[47]=t,e[48]=O,e[49]=$,e[50]=ge,e[51]=ue,e[52]=me,e[53]=Oe,e[54]=Fe,e[55]=k,e[56]=Ie,e[57]=Le):Le=e[57],Le},h9="_AListView_1nv5l_1",d9="_Row_1nv5l_10",g9="_Label_1nv5l_19",p9="_Content_1nv5l_29",h0={AListView:h9,Row:d9,Label:g9,Content:p9},v9=n=>{const e=Gn.c(48);let t,r,i,o,l,a,h,g,m,x,w,_,S,R,k,O,P,z;if(e[0]!==n){const{defs:J,defaultDef:Y,item:K,rowHeight:fe,labelWidth:X,noBorder:te,onlyMiddleBorder:ne,rowGap:ue,middleBorder:se,rowBottomBorder:$,outerBorder:re,style:ge,labelClassName:me,contentClassName:oe,labelStyle:Q,contentStyle:pe,...Ie}=n;h=K,k=fe,x=X,R=ue,O=ge,g=me,i=oe,m=Q,o=pe,_=te||ne,r=_?"":$||"var(--AListView_border-thin)",S=_?"":re||"var(--AListView_border-thick)",w=te?"":se||"var(--AListView_border-thick)";let Fe;e[19]!==Y?(Fe={content:y9,label:b9,...Y},e[19]=Y,e[20]=Fe):Fe=e[20],l=Fe;let xe;e[21]!==l||e[22]!==J?(xe={},$n.keys(J).forEach(Oe=>{const Le=J[Oe],He={...l,...Le};xe[Oe]=He}),e[21]=l,e[22]=J,e[23]=xe):xe=e[23],a=xe,t=zi,P=Ie,z=dt.clsx(h0.AListView,Ie.className),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S,e[14]=R,e[15]=k,e[16]=O,e[17]=P,e[18]=z}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13],R=e[14],k=e[15],O=e[16],P=e[17],z=e[18];let H;e[24]!==r||e[25]!==O?(H={...O,borderTop:r},e[24]=r,e[25]=O,e[26]=H):H=e[26];let G;e[27]!==r||e[28]!==i||e[29]!==o||e[30]!==l||e[31]!==a||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==x||e[36]!==w||e[37]!==_||e[38]!==S||e[39]!==R||e[40]!==k?(G=$n.map(a,(J,Y)=>{const[K]=J,fe={...l,...a[K]},X=Ur.getContent(fe.label,{defKey:K,item:h,def:fe}),te=Ur.getContent(fe.content,{defKey:K,item:h||{[K]:""},def:fe}),ne=Ur.getContent(fe.bold||"label",{defKey:K,item:h,def:fe});return M.jsxs("div",{className:h0.Row,style:{height:fe.fixedHeight?k:void 0,minHeight:fe.fixedHeight?k:void 0,maxHeight:fe.fixedHeight?k:void 0,borderBottom:r,marginTop:Y===0?0:typeof R=="number"?`${R}px`:R},children:[M.jsx("div",{className:dt.clsx(h0.Label,"NoSelect",ne!=="content"&&"Bold",g),style:{width:x,minWidth:x,maxWidth:x,borderLeft:S,paddingLeft:_?0:10,...m},children:M.jsx(nd,{children:X})}),M.jsx("div",{className:dt.clsx(h0.Content,ne!=="label"&&"Bold",i),style:{borderLeft:w,borderRight:S,...o},children:M.jsx(nd,{style:{width:"100%",padding:_?0:10},children:te})})]},K)}),e[27]=r,e[28]=i,e[29]=o,e[30]=l,e[31]=a,e[32]=h,e[33]=g,e[34]=m,e[35]=x,e[36]=w,e[37]=_,e[38]=S,e[39]=R,e[40]=k,e[41]=G):G=e[41];let N;return e[42]!==t||e[43]!==P||e[44]!==z||e[45]!==H||e[46]!==G?(N=M.jsx(t,{...P,className:z,style:H,children:G}),e[42]=t,e[43]=P,e[44]=z,e[45]=H,e[46]=G,e[47]=N):N=e[47],N},b9=n=>n.defKey,y9=n=>{const{defKey:e,item:t}=n;if(t)if($n.hasKey(t,e)){const r=t[e];return $n.isReactNode(r)?r:null}else return null;else return null},m9="_ALoadingBorder_kwc1g_1",x9="_ProgressBar_kwc1g_9",w9="_IsLoading_kwc1g_15",C9="_Cover_kwc1g_19",ep={ALoadingBorder:m9,ProgressBar:x9,IsLoading:w9,Cover:C9},Am=n=>{const e=Gn.c(15),{isLoading:t}=n,[r,i]=B.useState(!1),o=B.useRef(null);let l,a;e[0]!==t?(l=()=>{t?(i(!0),o.current&&clearTimeout(o.current)):o.current=setTimeout(()=>i(!1),300)},a=[t],e[0]=t,e[1]=l,e[2]=a):(l=e[1],a=e[2]),B.useEffect(l,a);let h;e[3]!==r?(h=dt.clsx(ep.ProgressBar,r&&ep.IsLoading),e[3]=r,e[4]=h):h=e[4];let g;e[5]!==h?(g=M.jsx("div",{className:h}),e[5]=h,e[6]=g):g=e[6];let m;e[7]!==t?(m=dt.clsx(ep.Cover,t&&ep.IsLoading),e[7]=t,e[8]=m):m=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={transition:"all 300ms"},e[9]=x):x=e[9];let w;e[10]!==m?(w=M.jsx("div",{className:m,style:x}),e[10]=m,e[11]=w):w=e[11];let _;return e[12]!==g||e[13]!==w?(_=M.jsxs("div",{className:ep.ALoadingBorder,children:[g,w]}),e[12]=g,e[13]=w,e[14]=_):_=e[14],_},_9="_Container_ez8dc_1",S9="_Option_ez8dc_7",E9="_RadioButton_ez8dc_14",T9="_InnerCircle_ez8dc_24",A9="_isChecked_ez8dc_29",c1={Container:_9,Option:S9,RadioButton:E9,InnerCircle:T9,isChecked:A9},R9=n=>{const{options:e,useSelect:t,selectDisabled:r,radius:i=23,innerRadius:o=i*.6,OptionRenderer:l=z3}=n,[a,h]=Fo(t,e[0]);return M.jsx("div",{className:c1.Container,children:e.map((g,m)=>{const x=r==null?void 0:r(g),w=()=>x?null:h==null?void 0:h(g);return M.jsxs(Ml,{className:dt.clsx(c1.Option,"IsClickable"),isDisabled:x,onClick:w,children:[M.jsx(I9,{innerRadius:o,isChecked:a===g,radius:i},m),M.jsx(l,{option:g})]},m)})})},z3=({option:n})=>n,I9=n=>{const e=Gn.c(15),{isChecked:t,radius:r,innerRadius:i}=n;let o;e[0]!==t?(o=dt.clsx(c1.RadioButton,t&&c1.isChecked),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==r?(l={width:r,height:r},e[2]=r,e[3]=l):l=e[3];let a;e[4]!==t?(a=dt.clsx(c1.InnerCircle,t&&c1.isChecked),e[4]=t,e[5]=a):a=e[5];let h;e[6]!==i?(h={width:i,height:i},e[6]=i,e[7]=h):h=e[7];let g;e[8]!==a||e[9]!==h?(g=M.jsx(zi,{className:a,style:h}),e[8]=a,e[9]=h,e[10]=g):g=e[10];let m;return e[11]!==o||e[12]!==l||e[13]!==g?(m=M.jsx(zi,{className:o,style:l,children:g}),e[11]=o,e[12]=l,e[13]=g,e[14]=m):m=e[14],m},k9="_AMultiSelect_19uuu_1",M9="_Arrow_19uuu_15",L9="_Primary_19uuu_24",O9="_UnAvailable_19uuu_35",P9="_IsOpen_19uuu_35",D9="_Secondary_19uuu_42",N9="_Placeholder_19uuu_58",F9="_ValuesContainer_19uuu_63",B9="_Values_19uuu_63",z9="_Options_19uuu_82",H9="_Option_19uuu_82",W9="_Selected_19uuu_124",U9="_CheckBox_19uuu_131",sf={AMultiSelect:k9,Arrow:M9,Primary:L9,UnAvailable:O9,IsOpen:P9,Secondary:D9,Placeholder:N9,ValuesContainer:F9,Values:B9,Options:z9,Option:H9,Selected:W9,CheckBox:U9},G9=n=>{const{options:e,useSelect:t,type:r="Primary",placeholder:i=Or.AMultiSelect["Select(Placeholder)"],onClose:o,SelectedRenderer:l=V9,OptionRenderer:a=Z9,minShowRows:h=2,maxShowRows:g=6,arrowProps:m,isAutoWidth:x=!1,...w}=n,_=B.useRef(null),S=B.useMemo(()=>w.abaseRef??_,[w.abaseRef]),R=B.useRef(null),[k,O]=Fo(t,[]),[P,z]=B.useState(void 0),H=B.useRef(e),G=B.useRef(null),[N,J]=B.useState(!1),[Y,K]=B.useState(!1),fe=B.useCallback(()=>K(!1),[]),X=B.useCallback(()=>{w.isDisabled||w.isLoading||e.length<1||(K(!0),setTimeout(()=>J(!0),0),setTimeout(()=>lb(R,S,e,h,g),0))},[S,w.isDisabled,w.isLoading,e,h,g]),te=B.useCallback(()=>{J(!1),K(!0),o==null||o()},[o]),ne=B.useCallback(oe=>{var Q;N?te():X(),setTimeout(()=>lb(R,S,e,h,g),0),(Q=w.onClick)==null||Q.call(w,oe)},[S,w,e,N,te,X,h,g]),ue=B.useCallback(()=>{lb(R,S,e,h,g)},[S,e,h,g]);B.useEffect(()=>{if(!N||!S.current)return;const oe=S.current;let Q=oe.parentElement;for(;Q;)Q.addEventListener("scroll",ue),Q=Q.parentElement;return()=>{let pe=oe.parentElement;for(;pe;)pe.removeEventListener("scroll",ue),pe=pe.parentElement}},[S,N,ue]),B.useEffect(()=>{if(N)return window.addEventListener("resize",ue),()=>window.removeEventListener("resize",ue)},[N,ue]);const se=B.useCallback(oe=>{oe[0].intersectionRatio===0&&te()},[te]);B.useEffect(()=>{if(!N)return;const oe=new IntersectionObserver(se,{threshold:0});return S.current&&oe.observe(S.current),()=>oe.disconnect()},[S,N,se]);const $=B.useCallback(oe=>{const Q=oe.target,pe=S.current,Ie=R.current;!pe||!Q||!Ie||!pe.contains(Q)&&!Ie.contains(Q)&&te()},[S,te]),re=B.useMemo(()=>w.isDisabled||w.isLoading||e.length<1,[w.isDisabled,w.isLoading,e]);B.useEffect(()=>{if(N)return setTimeout(()=>document.addEventListener("mousedown",$),0),()=>document.removeEventListener("mousedown",$)},[N,$]);const ge=B.useCallback((oe,Q)=>{oe.stopPropagation(),oe.preventDefault();let pe=[...k];pe.includes(Q)?pe=pe.filter(Ie=>Ie!==Q):pe.push(Q),O==null||O(pe)},[k,O]),me=B.useCallback(()=>{if(!x||!S.current)return;const oe=kg.calculateOptimalSelectWidth({elementRef:S,options:e,selectedOptions:k,placeholder:i,optionRenderer:Q=>a({option:Q}),type:r,isMulti:!0});z(oe)},[x,S,e,k,i,a,r]);return B.useEffect(()=>x?((e!==H.current||P===void 0)&&(G.current!==null&&cancelAnimationFrame(G.current),G.current=requestAnimationFrame(()=>{me(),G.current=null,H.current=[...e]})),()=>{G.current!==null&&(cancelAnimationFrame(G.current),G.current=null)}):void 0,[x,e,me,P]),B.useEffect(()=>()=>{typeof kg.clearCache=="function"&&kg.clearCache()},[]),M.jsxs(M.Fragment,{children:[M.jsxs(zi,{...w,abaseRef:S,isDisabled:w.isDisabled||e.length<1,className:dt.clsx(w.className,sf.AMultiSelect,"NoSelect",N&&sf.IsOpen,re&&sf.UnAvailable,sf[r]),style:{padding:r==="Secondary"?"8px 8px 8px 0":0,width:P?`${P}px`:x?"100px":void 0,...w.style},onClick:ne,children:[M.jsx("div",{className:sf.ValuesContainer,children:M.jsx("div",{className:dt.clsx(sf.Values,k.length<1&&sf.Placeholder),children:M.jsx(l,{OptionRenderer:a,placeholder:i,selectedOptions:k})})}),M.jsx("div",{...m,className:dt.clsx(sf.Arrow,m==null?void 0:m.className),children:M.jsx(fo,{icon:"TriangleDown",style:{transform:N?"rotate(180deg)":"",transition:"var(--Transition)"}})})]}),e.length>0&&(N||Y)&&su.createPortal(M.jsx("div",{ref:R,className:dt.clsx(sf.Options,sf[r]),style:{opacity:+N,visibility:N?"visible":"hidden",pointerEvents:N?void 0:"none",width:P?`${P}px`:x?"100px":void 0,borderRadius:S.current?window.getComputedStyle(S.current).borderRadius:void 0},onTransitionEnd:fe,children:e.map((oe,Q)=>{var Ie;const pe=k.includes(oe);return M.jsxs("div",{className:dt.clsx(sf.Option,pe&&sf.Selected,"NoSelect",sf[r]),style:{height:(Ie=S.current)==null?void 0:Ie.getBoundingClientRect().height},onClick:Fe=>ge(Fe,oe),children:[M.jsx(w1,{className:sf.CheckBox,useCheck:[+pe,void 0]}),M.jsx(a,{option:oe})]},Q)})}),document.body)]})};function lb(n,e,t,r,i){if(!e.current||!n.current||!t||t.length<1)return;const o=e.current.getBoundingClientRect(),l=Y9(o,t.length,r,i),a=window.getComputedStyle(e.current);n.current.style.top=`calc(${l.top??0}px - ${a.borderTopWidth})`,n.current.style.bottom=l.bottom?l.bottom+"px":"",n.current.style.left=l.left+"px",n.current.style.width||(n.current.style.minWidth=l.minWidth+"px"),n.current.style.minHeight=l.minHeight+"px",n.current.style.maxHeight=l.maxHeight+"px",n.current.style.visibility="visible"}function Y9(n,e,t,r){const i={top:n.bottom,bottom:void 0,left:n.left,height:"fit-content",minWidth:n.width,minHeight:n.height*Math.min(t,e),maxHeight:n.height*r>window.innerHeight-n.bottom-10?window.innerHeight-n.bottom-10:n.height*r};return window.innerHeight-n.bottom-10<i.height&&(window.innerHeight-n.bottom-10<i.minHeight?(i.top=n.top-e*n.height,i.top<0&&(i.top=10,i.minHeight=n.top-10,i.height=n.top-10)):i.height=window.innerHeight-n.bottom-10),i}const V9=n=>{const e=Gn.c(3),{OptionRenderer:t,selectedOptions:r,placeholder:i}=n;if(r.length<1)return i;if(r.length===1){let o;return e[0]!==t||e[1]!==r[0]?(o=M.jsx(t,{option:r[0]}),e[0]=t,e[1]=r[0],e[2]=o):o=e[2],o}else return`${r.length} selected`},Z9=n=>{const{option:e}=n;return $n.isReactNode(e)?e:null},X9="_Container_10ion_1",K9="_Steps_10ion_9",J9="_Step_10ion_9",Q9="_OutCircle_10ion_26",q9="_IsOver_10ion_37",j9="_InCircle_10ion_41",$9="_Line_10ion_54",eI="_Left_10ion_66",tI="_Right_10ion_69",nI="_ContentContainer_10ion_73",rI="_Content_10ion_73",ku={Container:X9,Steps:K9,Step:J9,OutCircle:Q9,IsOver:q9,InCircle:j9,Line:$9,Left:eI,Right:tI,ContentContainer:nI,Content:rI},iI=n=>{const e=Gn.c(26),{useSelect:t,steps:r,StepRenderer:i,ContentRenderer:o}=n,l=i===void 0?q2:i,a=o===void 0?q2:o;if(r.length===0)throw new Error("steps should have at least one element");const h=B.useRef(null),[g,m]=Fo(t,r[0]);let x;e[0]!==m?(x=G=>m==null?void 0:m(G),e[0]=m,e[1]=x):x=e[1];const w=x,_=r.indexOf(g);let S;e[2]!==_||e[3]!==w||e[4]!==r[0]?(S=()=>{_<0&&w(r[0])},e[2]=_,e[3]=w,e[4]=r[0],e[5]=S):S=e[5];let R;e[6]!==_||e[7]!==w||e[8]!==r?(R=[_,r,w],e[6]=_,e[7]=w,e[8]=r,e[9]=R):R=e[9],B.useEffect(S,R);let k;e[10]!==l||e[11]!==_||e[12]!==w||e[13]!==r?(k=r.map((G,N)=>{const J=r.indexOf(G),Y=_>=N,K=_>N;return M.jsxs("div",{className:ku.Step,children:[N!==0&&M.jsx("div",{className:dt.clsx(ku.Line,ku.Left,Y&&ku.IsOver)}),N!==r.length-1&&M.jsx("div",{className:dt.clsx(ku.Line,ku.Right,K&&ku.IsOver)}),M.jsx(Ic,{className:dt.clsx(ku.OutCircle,Y&&ku.IsOver),type:"Raw",onClick:()=>w(G),children:M.jsx("div",{className:dt.clsx(ku.InCircle,Y&&ku.IsOver)})}),M.jsx(l,{step:G,stepIdx:J})]},N)}),e[10]=l,e[11]=_,e[12]=w,e[13]=r,e[14]=k):k=e[14];let O;e[15]!==k?(O=M.jsx("div",{className:ku.Steps,children:k}),e[15]=k,e[16]=O):O=e[16];let P;e[17]!==a||e[18]!==_||e[19]!==r?(P=r.map((G,N)=>{const J=r.indexOf(G);return M.jsx("div",{className:ku.Content,style:N===0?{marginLeft:`${_*-100}%`}:{},children:M.jsx(a,{step:G,stepIdx:J})},N)}),e[17]=a,e[18]=_,e[19]=r,e[20]=P):P=e[20];let z;e[21]!==P?(z=M.jsx("div",{ref:h,className:ku.ContentContainer,children:P}),e[21]=P,e[22]=z):z=e[22];let H;return e[23]!==O||e[24]!==z?(H=M.jsxs("div",{className:ku.Container,children:[O,z]}),e[23]=O,e[24]=z,e[25]=H):H=e[25],H},q2=n=>{const{step:e}=n;return typeof e=="object"?$n.stringify(e):e},oI="_ATab_9eg6z_1",lI="_Addon_9eg6z_9",sI="_Option_9eg6z_14",aI="_Underline_9eg6z_26",cI="_IsSelected_9eg6z_26",uI="_IndicatorTrack_9eg6z_37",fI="_Indicator_9eg6z_37",hI="_Primary_9eg6z_54",dI="_Secondary_9eg6z_57",gI="_IsDisabled_9eg6z_63",pI="_Tertiary_9eg6z_77",vI="_Quaternary_9eg6z_101",Zh={ATab:oI,Addon:lI,Option:sI,Underline:aI,IsSelected:cI,IndicatorTrack:uI,Indicator:fI,Primary:hI,Secondary:dI,IsDisabled:gI,Tertiary:pI,Quaternary:vI},bI=["Primary","Secondary","Tertiary","Quaternary"],H3=n=>{const{options:e,useSelect:t,selectDisabled:r,type:i="Primary",tabProps:o,optionProps:l,optionWidth:a,OptionRenderer:h=yI,RightAddon:g,LeftAddon:m,color:x,selectedColor:w,underline:_,indicatorProps:S,indicatorTrackProps:R,height:k=40}=n;if(e.length===0)throw new Error("options should have at least one element");const O=B.useMemo(()=>e.findIndex(Le=>!(r!=null&&r(Le))),[e,r]),P=i==="Tertiary",z=i==="Secondary",H=P?k*.1:0,G=z?8:0,N=B.useMemo(()=>H+G,[H,G]),J=B.useMemo(()=>(G-H)/e.length,[e.length,H,G]),[Y,K]=Fo(t,e[O]),fe=B.useRef([]),X=B.useCallback(Le=>K==null?void 0:K(Le),[K]),te=B.useMemo(()=>typeof a=="number"?a+"px":a,[a]),ne=B.useMemo(()=>e.indexOf(Y),[e,Y]),ue=B.useMemo(()=>`calc(${100/e.length}% + ${J}px)`,[e.length,J]),se=B.useMemo(()=>te||`calc(${ue} - ${N}px)`,[ue,N,te]),[$,re]=B.useState(0),[ge,me]=B.useState(0),[oe,Q]=B.useState(se),pe=B.useRef(null),Ie=B.useRef(null),Fe=ZC(Ie,pe),xe=B.useMemo(()=>{let Le;switch(te){case void 0:Le=`calc(${ue} * ${ne})`;break;case"fit-content":Le=`calc(${$}px)`;break;default:Le=`calc((${te} + ${N}px) * ${ne})`;break}return Le},[te,ue,ne,$,N]),Oe=B.useMemo(()=>{switch(te){case void 0:return;case"fit-content":return`calc(${ge}px)`;default:return`calc((${te} + ${N}px - ${J}px) * ${e.length})`}},[te,J,N,e,ge]);return B.useEffect(()=>{var He,Te;if(e.includes(Y)||K==null||K(e[O]),te!=="fit-content"){Q(se);return}let Le=0;fe.current.forEach((ke,Be)=>{Be<ne&&ke.current&&(Le+=ke.current.offsetWidth+N)}),re(Le),Q(`calc(${((Te=(He=fe.current[ne])==null?void 0:He.current)==null?void 0:Te.offsetWidth)||0}px)`),me(fe.current.reduce((ke,Be)=>{var rt;return ke+((((rt=Be.current)==null?void 0:rt.offsetWidth)||0)+N-J)},0))},[te,fe,e,Y,K,O,J,N,ne,se]),M.jsxs("div",{ref:pe,...o,className:dt.clsx(Zh.ATab,"Headline2",Zh[i],o==null?void 0:o.className),style:{minHeight:k,height:k,maxHeight:k},children:[m&&M.jsx("div",{ref:Ie,className:Zh.Addon,children:m}),M.jsx("div",{...S,className:dt.clsx(Zh.Indicator,S==null?void 0:S.className),style:{minWidth:oe,left:xe,marginLeft:H,transform:`translate(${Fe??0}px, ${P?"-50%":"0"})`,height:P?k-H*2:void 0,...S==null?void 0:S.style}}),M.jsx("div",{...R,className:dt.clsx(Zh.IndicatorTrack,R==null?void 0:R.className),style:{width:Oe,marginLeft:P?Fe:0,height:k,...R==null?void 0:R.style}}),e.map((Le,He)=>{const Te=r==null?void 0:r(Le);return fe.current[He]||(fe.current[He]=B.createRef()),M.jsx(zi,{abaseRef:fe.current[He],...l,isDisabled:Te,className:dt.clsx(Zh.Option,Te&&Zh.IsDiabled,Le===Y&&Zh.IsSelected,"IsClickable",_&&Zh.Underline,l==null?void 0:l.className),style:{minWidth:se,maxWidth:se,marginLeft:H,marginRight:G,"--color":Le===Y&&w||x,height:k,...l==null?void 0:l.style},onClick:ke=>{!Te&&X(Le),l&&l.onClick&&l.onClick(ke)},children:M.jsx(h,{option:Le})},He)}),M.jsx(cs,{w:H}),g&&M.jsxs(M.Fragment,{children:[M.jsx(zg,{}),M.jsx("div",{className:Zh.Addon,children:g})]})]})},yI=n=>{const{option:e}=n;if(typeof e=="string")return e;if(typeof e=="number")return e;if(typeof e=="object"){if(e===null)return"";const t=$n.keys(e);return"name"in t?e.name:"label"in t?e.label:"value"in t?e.value:JSON.stringify(e)}else return JSON.stringify(e)};function W3(...n){const e=Gn.c(3),t=n,r=B.useRef(!1);let i,o;e[0]!==t?(i=()=>{r.current||(r.current=!0,t.forEach(mI))},o=[t],e[0]=t,e[1]=i,e[2]=o):(i=e[1],o=e[2]),B.useEffect(i,o)}function mI(n){return n()}const U3={String:(n,e,t,r)=>{const{value:i}=r;if(i===void 0)return!1;if(t==="")return $n.keys(e).some(m=>{const x=e[m],w=Ur.getContent(x.asText,{defKey:m,def:x,item:n});if(w!==void 0)return w.toString().toLowerCase().includes(i.toLowerCase());const _=Ur.getContent(x.content,{defKey:m,def:x,item:n});return["string","number"].includes(typeof _)&&_!==void 0&&_!==null?_.toString().toLowerCase().includes(i.toLowerCase()):!1});const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0)return h.toString().toLowerCase().includes(i.toLowerCase());const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});return["string","number"].includes(typeof g)&&g!==void 0&&g!==null?g.toString().toLowerCase().includes(i.toLowerCase()):!1},Select:(n,e,t,r)=>{const{value:i}=r;if(i==null)return!1;const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0)return i.toString().toLowerCase()===h.toString().toLowerCase();const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});return["string","number"].includes(typeof g)&&g!==void 0&&g!==null?i.toString().toLowerCase()===g.toString().toLowerCase():!1},Date:(n,e,t,r)=>{const{value:i}=r;if(i===void 0)return!1;const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0){const m=Un.toDate(h.toString());return m&&Un.eq(m,i)}const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});if(["string","number"].includes(typeof g)&&g!==void 0&&g!==null){const m=Un.toDate(g.toString());return m&&Un.eq(m,i)}return!1},DateRange:(n,e,t,r)=>{const{value:i}=r;if(i===void 0)return!1;const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0){const m=Un.toDate(h.toString());return m&&Un.be(i.sDate,m,i.eDate)}const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});if(["string","number"].includes(typeof g)&&g!==void 0&&g!==null){const m=Un.toDate(g.toString());return m&&Un.be(i.sDate,m,i.eDate)}return!1}},xI=(n,e,t)=>{let r=n;return $n.keys(t).forEach(o=>{const l=t[o];l.value===void 0||l.value===null||l.value===""||(r=r.filter(a=>{var h;return(h=l.predicate??U3[l.type])==null?void 0:h(a,e,o,l)}))}),r},wI=(n,e,t)=>{if(!t)return n;const r=t.defKey,i=e[r];if(r===void 0)return n;const o=t.sortF??((l,a)=>{const h=Ur.getContent(i.content,{defKey:r,def:i,item:l}),g=Ur.getContent(i.content,{defKey:r,def:i,item:a});return typeof h=="string"&&typeof g=="string"?h<g?-1:h>g?1:0:typeof h=="number"&&typeof g=="number"?h-g:typeof h=="string"&&typeof g=="number"?-1:typeof h=="number"&&typeof g=="string"||h===void 0&&g!==void 0?1:h!==void 0&&g===void 0?-1:0});return typeof o=="function"&&o.length>=3?n.slice().sort((l,a)=>o(l,a,t.isAsc)):n.slice().sort((l,a)=>{const h=o(l,a);return t.isAsc?h:-h})},CI=(n,e,t)=>n.slice((e-1)*t,e*t),G3=(n,e)=>{const t=Math.max(Math.ceil(n/e),1);return Array.from({length:t},(r,i)=>i+1)},_I=(n,e,t,r)=>{const i=G3(e,t),o=Math.floor((n-1)/r),l=o*r+1,a=(o+1)*r,h=i.slice(l-1,a);return{pages:i,rangedPages:h}},SI=(n,e,t)=>{const r=[],i=Object.keys(t),o=[];i.forEach(w=>{const _=t[w],S=Ur.getContent(_.hContent,{defKey:w,def:_});if(S!==void 0){if(typeof S=="string"){o.push(S);return}else if(typeof S=="number"){o.push(S.toString());return}}const R=Ur.getContent(_.name,{defKey:w,def:_});if(R!==void 0&&typeof R=="string"){o.push(R);return}o.push(w)});const l=o.map(w=>`"${w.replaceAll('"','""')}"`);r.push(l.join(",")),e.forEach(w=>{const _=[];i.forEach(R=>{const k=t[R],O=Ur.getContent(k.content,{defKey:R,def:k,item:w});if(O!==void 0){if(typeof O=="string"){_.push(O);return}else if(typeof O=="number"){_.push(O.toString());return}}const P=w[R];typeof P=="string"?_.push(P):typeof P=="number"?_.push(P.toString()):_.push("")});const S=_.map(R=>`"${R.replaceAll('"','""')}"`);r.push(S.join(","))});const a=`${n}.csv`,h="\uFEFF"+r.join(`
286
- `),g=new Blob([h],{type:"text/csv;charset=UTF-8"}),m=URL.createObjectURL(g),x=document.createElement("a");x.href=m,x.download=a,x.click(),URL.revokeObjectURL(m)},EI=n=>{const e=$n.keys(n);if(e.length!==1)return;const t=e[0];if(t!=="")return;const r=n[t];if(r.type==="String")return r.value},TI=n=>{const e=Object.entries(n);let t={};return e.forEach(([r,i])=>{!i||i.value===void 0||i.value===null||i.value===""||(i.type==="DateRange"?(t[i.sFilterKey]=i.value.sDate,t[i.eFilterKey]=i.value.eDate):t[i.filterKey??r]=i.value)}),t},AI=n=>{const e=$n.keys(n).filter(i=>i!=="");if(e.length!==1)return;const t=e[0],r=n[t];return!r||r.value===void 0||r.value===null||r.value===""?{selectedKey:t,value:void 0}:{selectedKey:t,value:r.value}},_d={applyFilteration:xI,applySortation:wI,applyPagination:CI,getPages:G3,getRangedPages:_I,downloadCsv:SI,getSingleFilterValue:EI,getMultiFilterValues:TI,getSelectFilterValue:AI},RI="_ATable_12zow_1",II={ATable:RI};function Y3(n,e,t,r){const i=Gn.c(6);let o,l;i[0]!==e||i[1]!==n||i[2]!==t||i[3]!==r?(o=()=>{if(n)return n.addEventListener(e,t,r),()=>{n.removeEventListener(e,t,r)}},l=[n,e,t,r],i[0]=e,i[1]=n,i[2]=t,i[3]=r,i[4]=o,i[5]=l):(o=i[4],l=i[5]),B.useEffect(o,l)}const kI="_BodyHeader_ys4y0_1",MI="_TRow_ys4y0_7",LI="_OverflowSpace_ys4y0_11",OI="_BodyBody_ys4y0_16",PI="_IsSelected_ys4y0_35",DI="_IsSelectable_ys4y0_39",NI="_IsRowMarked_ys4y0_47",FI="_TH_ys4y0_52",BI="_TD_ys4y0_57",zI="_IsMarked_ys4y0_57",HI="_Resizer_ys4y0_76",WI="_IsMoving_ys4y0_88",UI="_IsResizable_ys4y0_91",GI="_ResizerCenter_ys4y0_94",YI="_ResizerOut_ys4y0_100",VI="_ResizerIn_ys4y0_104",ZI="_IsClicked_ys4y0_139",XI="_NoItems_ys4y0_146",KI="_Content_ys4y0_152",Zl={BodyHeader:kI,TRow:MI,OverflowSpace:LI,BodyBody:OI,IsSelected:PI,IsSelectable:DI,IsRowMarked:NI,TH:FI,TD:BI,IsMarked:zI,Resizer:HI,IsMoving:WI,IsResizable:UI,ResizerCenter:GI,ResizerOut:YI,ResizerIn:VI,IsClicked:ZI,NoItems:XI,Content:KI},jd=25,sb=50,JI=n=>{const e=Gn.c(119),{defs:t,isEqual:r,rProps:i,useSelect:o,isTableDisabled:l,isSelectMulti:a,selectDisabled:h,appliedFilteration:g,useSortation:m,pagination:x,pagedItems:w,noMarking:_,noDefHeader:S,isLoading:R,onScrollToSelectedReady:k,showRows:O,RowRenderer:P,isRowRendered:z,rowHeight:H,resources:G}=n,N=P===void 0?jI:P;let J;e[0]!==o?(J=o??[],e[0]=o,e[1]=J):J=e[1];const[Y,K]=J;let fe;e[2]!==r||e[3]!==a||e[4]!==l||e[5]!==h||e[6]!==Y||e[7]!==K?(fe=Se=>{l||!K||!Y||h!=null&&h(Se)||(a?Y.some(tt=>r(tt,Se))?K(Y.filter(tt=>!r(tt,Se))):K([...Y,Se]):K([Se]))},e[2]=r,e[3]=a,e[4]=l,e[5]=h,e[6]=Y,e[7]=K,e[8]=fe):fe=e[8];const X=fe;let te,ne;e[9]!==a||e[10]!==Y||e[11]!==K?(te=()=>{a||!Y||!K||Y.length>1&&K([Y[Y.length-1]])},ne=[Y,K,a],e[9]=a,e[10]=Y,e[11]=K,e[12]=te,e[13]=ne):(te=e[12],ne=e[13]),B.useEffect(te,ne);let ue,se;e[14]!==h||e[15]!==Y||e[16]!==K?(ue=()=>{if(!Y||!K)return;Y.filter(tt=>h==null?void 0:h(tt)).length>0&&K(Y.filter(tt=>!(h!=null&&h(tt))))},se=[Y,K,h],e[14]=h,e[15]=Y,e[16]=K,e[17]=ue,e[18]=se):(ue=e[17],se=e[18]),B.useEffect(ue,se);const[$,re]=m;let ge;e[19]!==re||e[20]!==$?(ge=(Se,tt)=>{re&&(($==null?void 0:$.defKey)===Se?$.isAsc===!0?re({defKey:Se,isAsc:!1,sortF:tt}):$.isAsc===!1?re(void 0):re({defKey:Se,isAsc:!0,sortF:tt}):re({defKey:Se,isAsc:!0,sortF:tt}))},e[19]=re,e[20]=$,e[21]=ge):ge=e[21];const me=ge;let oe;e[22]===Symbol.for("react.memo_cache_sentinel")?(oe={elem:null,row:null},e[22]=oe):oe=e[22];const[Q,pe]=B.useState(oe),Ie=B.useRef(null),Fe=B.useRef(null);let xe;e[23]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>pe({elem:Ie.current,row:Fe.current}),e[23]=xe):xe=e[23];const Oe=xe;let Le;e[24]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>Oe(),e[24]=Le):Le=e[24];let He;e[25]!==w.length?(He=[w.length,Oe],e[25]=w.length,e[26]=He):He=e[26],B.useEffect(Le,He),Y3(window,"resize",Oe);const[Te,ke]=B.useState(H);let Be;e[27]!==Q?(Be=()=>{const{row:Se}=Q;Se!=null&&ke(Se.clientHeight)},e[27]=Q,e[28]=Be):Be=e[28];let rt;e[29]!==Q||e[30]!==Te?(rt=[Q,Te],e[29]=Q,e[30]=Te,e[31]=rt):rt=e[31],B.useEffect(Be,rt);let Re;e:{const{elem:Se}=Q;if(!Se){Re=0;break e}Re=Math.floor(Se.clientHeight/Te)}const ut=Re;let qe;O?qe=O:w.length<=ut?qe=ut:qe=w.length;const ot=qe;let st;O===void 0?st=void 0:st=O*Te;const bt=st,Mt=bt;let Bt;e:{const{elem:Se}=Q;if(!Se){Bt=!1;break e}let tt;e[32]!==Se?(tt=Se.getBoundingClientRect(),e[32]=Se,e[33]=tt):tt=e[33],Bt=tt.height/Te<w.length}const at=Bt,[Ye,Tt]=B.useState();let Ut;const{elem:gt}=Q;!Ye||!gt?Ut="100%":Ut=gt.clientHeight+(z?0:50);const Ht=Ut,xt=B.useRef(null);let pn;e[34]===Symbol.for("react.memo_cache_sentinel")?(pn={},e[34]=pn):pn=e[34];const[$t,sn]=B.useState(pn);let Xt;e[35]===Symbol.for("react.memo_cache_sentinel")?(Xt={x:0,y:0},e[35]=Xt):Xt=e[35];const bn=B.useRef(Xt);let hn;e[36]===Symbol.for("react.memo_cache_sentinel")?(hn={},e[36]=hn):hn=e[36];const Rn=B.useRef(hn);let vn;e[37]!==$t?(vn=$n.keys($t),e[37]=$t,e[38]=vn):vn=e[38];const We=vn;let Ce;e[39]!==t?(Ce=(Se,tt)=>{const At=xt.current;if(!At)return;const Sn=[];At.childNodes.forEach(pr=>{pr.classList.contains(Zl.TH)&&Sn.push(pr)});const In={};$n.keys(t).forEach((pr,On)=>{const tr=Sn[On];if(!tr)return;const An=tr.getBoundingClientRect().width;In[pr]=An}),Rn.current=In,Tt(tt),bn.current={x:Se.clientX,y:Se.clientY};const Yn=pr=>{if(!xt.current)return;const tr=pr.clientX-bn.current.x,An=qI(t,tt,Rn.current,tr);sn(An)};document.addEventListener("mousemove",Yn);const lr=()=>{Tt(void 0),document.removeEventListener("mousemove",Yn),document.removeEventListener("mouseup",lr)};document.addEventListener("mouseup",lr)},e[39]=t,e[40]=Ce):Ce=e[40];const it=Ce;let Ct;e[41]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>{Tt(void 0),sn({})},e[41]=Ct):Ct=e[41];const Qt=Ct;let Yt;e:{if(We.length===0){let tt;if(e[42]!==t){tt={};const At=$n.keys(t);for(let Sn=0;Sn<At.length;Sn++){const In=At[Sn],Yn=t[In],lr=Ur.getContent(Yn.colSpan,{defKey:In,def:Yn}),pr=Yn.width??80,On=Yn.minWidth??jd,tr=Yn.maxWidth,An={width:pr,minWidth:On,maxWidth:tr,flexGrow:lr??1};if(tt[In]=An,lr!==void 0){for(let sr=1;sr<Math.min(lr,At.length-Sn);sr++){const hr=t[At[Sn+sr]],ho=hr.width??80,So=hr.minWidth??jd,oo=hr.maxWidth;An.width=An.width+ho,An.minWidth=An.minWidth+So,An.maxWidth!==void 0&&(oo!==void 0?An.maxWidth=An.maxWidth+oo:An.maxWidth=void 0)}Sn=Sn+(lr-1)}}e[42]=t,e[43]=tt}else tt=e[43];Yt=tt;break e}let Se;if(e[44]!==t||e[45]!==$t){Se={};const tt=$n.keys(t);for(let At=0;At<tt.length;At++){const Sn=tt[At],In=t[Sn],Yn=$t[Sn],lr=Ur.getContent(In.colSpan,{defKey:Sn,def:In}),pr=In.minWidth??jd,On=In.maxWidth,tr={width:Yn,minWidth:pr,maxWidth:On,flexGrow:lr??1};if(Se[Sn]=tr,lr!==void 0){for(let An=1;An<Math.min(lr,tt.length-At);An++){const sr=t[tt[At+An]],hr=$t[tt[At+An]],ho=sr.minWidth??jd,So=sr.maxWidth;tr.width=tr.width+hr,tr.minWidth=tr.minWidth+ho,tr.maxWidth!==void 0&&(So!==void 0?tr.maxWidth=tr.maxWidth+So:tr.maxWidth=void 0)}At=At+(lr-1)}}e[44]=t,e[45]=$t,e[46]=Se}else Se=e[46];Yt=Se}const yn=Yt,gn=B.useRef(null);let lt;e[47]!==g?(lt=_d.getSingleFilterValue(g),e[47]=g,e[48]=lt):lt=e[48];const kt=lt;let vt;e[49]===Symbol.for("react.memo_cache_sentinel")?(vt=()=>{Ie.current&&Ie.current.scrollTo({top:0})},e[49]=vt):vt=e[49];let zt;e[50]!==x.page?(zt=[x.page],e[50]=x.page,e[51]=zt):zt=e[51],B.useEffect(vt,zt);let Lt;e[52]!==Y?(Lt=Se=>{const tt=Se===void 0?"center":Se;Y&&Y.length>0&&requestAnimationFrame(()=>{var At;return(At=Fe.current)==null?void 0:At.scrollIntoView({behavior:"auto",block:tt})})},e[52]=Y,e[53]=Lt):Lt=e[53];const yt=Lt;let Rt,on;e[54]!==k||e[55]!==yt?(Rt=()=>{k==null||k(yt)},on=[k,yt],e[54]=k,e[55]=yt,e[56]=Rt,e[57]=on):(Rt=e[56],on=e[57]),B.useEffect(Rt,on);let En;e[58]!==R?(En=M.jsx(Am,{isLoading:R}),e[58]=R,e[59]=En):En=e[59];let Jt;e[60]!==Ye?(Jt=dt.clsx(Zl.BodyHeader,Ye!==void 0&&Zl.IsClicked),e[60]=Ye,e[61]=Jt):Jt=e[61];const xn=S||z?"none":"flex";let _n;e[62]!==xn?(_n={display:xn},e[62]=xn,e[63]=_n):_n=e[63];let zn;e[64]===Symbol.for("react.memo_cache_sentinel")?(zn={minHeight:sb,maxHeight:sb},e[64]=zn):zn=e[64];let er;e[65]!==Ye||e[66]!==t||e[67]!==$t||e[68]!==Ht||e[69]!==it||e[70]!==me||e[71]!==($==null?void 0:$.defKey)||e[72]!==($==null?void 0:$.isAsc)||e[73]!==We?(er=$n.map(t,(Se,tt)=>{const[At]=Se,Sn=t[At],In=Ur.getContent(Sn.hContent,{defKey:At,def:Sn}),Yn=Sn.name,lr=tt===$n.keys(t).length-1,pr=Sn.width??80,On=Sn.minWidth??jd,tr=Sn.maxWidth,An={width:pr,minWidth:On,maxWidth:tr,justifyContent:Ur.getContent(Sn.hAlign,{defKey:At,def:Sn})??"flex-start",...Ur.getContent(Sn.hStyle,{defKey:At,def:Sn})};We.includes(At)&&(An.width=$t[At]);const sr=Sn.isSortable,hr=($==null?void 0:$.defKey)===At,ho=$==null?void 0:$.isAsc;return M.jsxs(B.Fragment,{children:[M.jsxs("div",{className:dt.clsx(Zl.TH,"Label1",sr?"IsClickable":"NoSelect"),style:An,onClick:()=>sr&&me(At,Sn.sortF),children:[M.jsx(nd,{children:In??Yn,className:Zl.Content}),sr&&M.jsx(fo,{icon:hr?ho?"SortUp":"SortDown":"SortBoth",style:{width:16,height:16}})]}),!lr&&M.jsxs("div",{className:dt.sclsx(Zl,"Resizer","IsResizable","NoSelect",Ye!==void 0&&"IsMoving"),onDoubleClick:Qt,onMouseDown:So=>it(So,At),children:[M.jsx("div",{className:Zl.ResizerOut}),M.jsx("div",{className:Zl.ResizerIn}),M.jsx("div",{className:Zl.ResizerCenter,style:{height:Ht}}),M.jsx("div",{className:Zl.ResizerIn}),M.jsx("div",{className:Zl.ResizerOut})]}),lr&&M.jsx(cs,{className:Zl.OverflowSpace,h:sb,style:{color:An.color,backgroundColor:An.backgroundColor,transition:An.transition},w:"var(--Scrollbar-width)"})]},At)}),e[65]=Ye,e[66]=t,e[67]=$t,e[68]=Ht,e[69]=it,e[70]=me,e[71]=$==null?void 0:$.defKey,e[72]=$==null?void 0:$.isAsc,e[73]=We,e[74]=er):er=e[74];let wn;e[75]!==er?(wn=M.jsx("div",{ref:xt,className:Zl.TRow,style:zn,children:er}),e[75]=er,e[76]=wn):wn=e[76];let ri;e[77]!==Jt||e[78]!==_n||e[79]!==wn?(ri=M.jsx("div",{ref:gn,className:Jt,style:_n,children:wn}),e[77]=Jt,e[78]=_n,e[79]=wn,e[80]=ri):ri=e[80];let $e;e[81]!==Ye?($e=dt.clsx(Zl.BodyBody,Ye!==void 0&&Zl.IsClicked),e[81]=Ye,e[82]=$e):$e=e[82];const tn=at?"scroll":"hidden";let ln;e[83]!==Mt||e[84]!==bt||e[85]!==tn?(ln={overflowY:tn,minHeight:bt,maxHeight:Mt},e[83]=Mt,e[84]=bt,e[85]=tn,e[86]=ln):ln=e[86];let Nn;e[87]!==N||e[88]!==t||e[89]!==H||e[90]!==at||e[91]!==r||e[92]!==z||e[93]!==l||e[94]!==_||e[95]!==X||e[96]!==w||e[97]!==i||e[98]!==h||e[99]!==Y||e[100]!==K||e[101]!==kt||e[102]!==yn?(Nn=w.map((Se,tt)=>{const At=Ur.getContent(i,{item:Se}),Sn=K&&!l,In=Y==null?void 0:Y.some(On=>r(On,Se)),Yn=Y&&(h==null?void 0:h(Se)),lr=typeof Yn=="string"?Yn:void 0,pr={...Se};return z&&$n.keys(t).forEach(On=>{const tr=t[On],An=Ur.getContent(tr.content,{defKey:On,def:tr,item:Se});let sr=!1;if(kt&&!_){const hr=Ur.getContent(tr.asText,{defKey:On,def:tr,item:Se});hr!==void 0?sr=hr.toString().toLowerCase().includes(kt.toLowerCase()):["string","number"].includes(typeof An)&&An!==void 0&&An!==null&&(sr=An.toString().toLowerCase().includes(kt.toLowerCase()))}pr[On]=M.jsx("span",{className:dt.clsx(sr&&Zl.IsRowMarked),children:pr[On]})}),M.jsx(zi,{isDisabled:Yn,tooltip:lr,...At,abaseRef:In?Fe:void 0,className:dt.clsx(At==null?void 0:At.className,Sn&&Zl.IsSelectable,In&&Zl.IsSelected),onClick:On=>{var tr;X(Se),(tr=At==null?void 0:At.onClick)==null||tr.call(At,On)},children:M.jsx(N,{defs:t,isBodyBodyOverflowed:at,item:Se,markedItem:pr,noMarking:_,rowHeight:H,singleFilterValue:kt,spanWidths:yn})},tt)}),e[87]=N,e[88]=t,e[89]=H,e[90]=at,e[91]=r,e[92]=z,e[93]=l,e[94]=_,e[95]=X,e[96]=w,e[97]=i,e[98]=h,e[99]=Y,e[100]=K,e[101]=kt,e[102]=yn,e[103]=Nn):Nn=e[103];let yr;e[104]!==z||e[105]!==w.length||e[106]!==G||e[107]!==Te||e[108]!==ot?(yr=M.jsx(QI,{isRowRendered:z,itemsLength:w.length,resources:G,rowHeight:Te,showRows:ot}),e[104]=z,e[105]=w.length,e[106]=G,e[107]=Te,e[108]=ot,e[109]=yr):yr=e[109];let Ln;e[110]!==$e||e[111]!==ln||e[112]!==Nn||e[113]!==yr?(Ln=M.jsxs("div",{ref:Ie,className:$e,style:ln,children:[Nn,yr]}),e[110]=$e,e[111]=ln,e[112]=Nn,e[113]=yr,e[114]=Ln):Ln=e[114];let Pt;return e[115]!==En||e[116]!==ri||e[117]!==Ln?(Pt=M.jsxs(M.Fragment,{children:[En,ri,Ln]}),e[115]=En,e[116]=ri,e[117]=Ln,e[118]=Pt):Pt=e[118],Pt},QI=n=>{const e=Gn.c(13),{showRows:t,itemsLength:r,resources:i,isRowRendered:o,rowHeight:l}=n;let a;e:{if(r===0){a=t;break e}a=t-r}const h=a;let g;if(e[0]!==o||e[1]!==r||e[2]!==h||e[3]!==i||e[4]!==l||e[5]!==t){let m;e[7]!==o||e[8]!==r||e[9]!==i||e[10]!==l||e[11]!==t?(m=(x,w)=>M.jsx("div",{className:dt.clsx(Zl.TRow,"NoSelect"),style:{minHeight:l,maxHeight:l,...o&&{border:"none"}},children:r===0&&w===Math.floor(t/2)&&M.jsx(Ml,{className:Zl.NoItems,children:i["No Items"]})},w),e[7]=o,e[8]=r,e[9]=i,e[10]=l,e[11]=t,e[12]=m):m=e[12],g=Array.from({length:h},m),e[0]=o,e[1]=r,e[2]=h,e[3]=i,e[4]=l,e[5]=t,e[6]=g}else g=e[6];return g};function qI(n,e,t,r){const i={...t},o=$n.keys(n).findIndex(g=>g===e)+1,l=Object.entries(n);let a=o-1,h=o;if(r<0){for(;r<0&&!(a<0||h>=l.length);){const[g,m]=[l[a][0],l[a][1]],[x,w]=[l[h][0],l[h][1]],_=m.minWidth??jd,S=w.maxWidth,R=i[g],k=i[x];let O=R-_;S!==void 0&&(O=Math.min(O,S-k));let P=-r;P=Math.min(P,O),R-P<=_&&a--,S!==void 0&&k+P>=S&&h++,i[g]=R-P,i[x]=k+P,r+=P}return i}else if(r>0){for(;r>0&&!(a<0||h>=l.length);){const[g,m]=[l[a][0],l[a][1]],[x,w]=[l[h][0],l[h][1]],_=w.minWidth??jd,S=m.maxWidth,R=i[x],k=i[g];let O=R-_;S!==void 0&&(O=Math.min(O,S-k));let P=r;P=Math.min(P,O),R-P<=_&&h++,S!==void 0&&k+P>=S&&a--,i[x]=R-P,i[g]=k+P,r-=P}return i}return i}const jI=n=>{const e=Gn.c(14),{defs:t,item:r,noMarking:i,spanWidths:o,singleFilterValue:l,isBodyBodyOverflowed:a,rowHeight:h}=n;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=dt.clsx(Zl.TRow),e[0]=g):g=e[0];let m;e[1]!==h?(m={minHeight:h,maxHeight:h},e[1]=h,e[2]=m):m=e[2];let x;e[3]!==t||e[4]!==a||e[5]!==r||e[6]!==i||e[7]!==h||e[8]!==l||e[9]!==o?(x=$n.map(t,(_,S)=>{const[R]=_,k=o[R];if(k===void 0)return null;const O=S===$n.keys(t).length-1,P=t[R],z=Ur.getContent(P.content,{defKey:R,def:P,item:r}),H={width:k.width,minWidth:k.minWidth,maxWidth:k.maxWidth,flexGrow:k.flexGrow,justifyContent:Ur.getContent(P.align,{defKey:R,def:P,item:r})??"flex-start",...Ur.getContent(P.style,{defKey:R,def:P,item:r})};let G=!1;if(l&&!i){const N=Ur.getContent(P.asText,{defKey:R,def:P,item:r});N!==void 0?G=N.toString().toLowerCase().includes(l.toLowerCase()):["string","number"].includes(typeof z)&&z!==void 0&&z!==null&&(G=z.toString().toLowerCase().includes(l.toLowerCase()))}return M.jsxs(B.Fragment,{children:[M.jsx("div",{className:dt.clsx(Zl.TD,"Label1",G&&Zl.IsMarked),style:H,children:M.jsx(nd,{children:z,className:Zl.Content})}),!a&&O&&M.jsx(cs,{className:Zl.OverflowSpace,h,style:{color:H.color,backgroundColor:H.backgroundColor},w:"var(--Scrollbar-width)"})]},R)}),e[3]=t,e[4]=a,e[5]=r,e[6]=i,e[7]=h,e[8]=l,e[9]=o,e[10]=x):x=e[10];let w;return e[11]!==m||e[12]!==x?(w=M.jsx("div",{className:g,style:m,children:x}),e[11]=m,e[12]=x,e[13]=w):w=e[13],w},$I="_ATableFooter_w090q_1",ek="_Button_w090q_10",tk="_IsSelected_w090q_26",nk="_IsDisabled_w090q_31",Sh={ATableFooter:$I,Button:ek,IsSelected:tk,IsDisabled:nk},rk=n=>{const e=Gn.c(35),{pages:t,rangedPages:r,pageF:i,pagination:o}=n,l=t[t.length-1];let a;e[0]!==o.page?(a=dt.clsx(Sh.Button,o.page===1&&Sh.IsDisabled),e[0]=o.page,e[1]=a):a=e[1];let h;e[2]!==i.moveFirst||e[3]!==a?(h=M.jsx(fo,{className:a,icon:"FirstPage",onClick:i.moveFirst}),e[2]=i.moveFirst,e[3]=a,e[4]=h):h=e[4];let g;e[5]!==o.page?(g=dt.clsx(Sh.Button,o.page===1&&Sh.IsDisabled),e[5]=o.page,e[6]=g):g=e[6];let m;e[7]!==i.movePrev||e[8]!==g?(m=M.jsx(fo,{className:g,icon:"NavigateBefore",onClick:i.movePrev}),e[7]=i.movePrev,e[8]=g,e[9]=m):m=e[9];let x;if(e[10]!==i||e[11]!==o.page||e[12]!==r){let O;e[14]!==i||e[15]!==o.page?(O=P=>M.jsx("div",{className:dt.clsx(Sh.Button,"NoSelect",o.page===P&&Sh.IsSelected),onClick:()=>i.move(P),children:P},P),e[14]=i,e[15]=o.page,e[16]=O):O=e[16],x=r.map(O),e[10]=i,e[11]=o.page,e[12]=r,e[13]=x}else x=e[13];let w;e[17]!==l||e[18]!==o.page?(w=dt.clsx(Sh.Button,o.page===l&&Sh.IsDisabled),e[17]=l,e[18]=o.page,e[19]=w):w=e[19];let _;e[20]!==i.moveNext||e[21]!==w?(_=M.jsx(fo,{className:w,icon:"NavigateNext",onClick:i.moveNext}),e[20]=i.moveNext,e[21]=w,e[22]=_):_=e[22];let S;e[23]!==l||e[24]!==o.page?(S=dt.clsx(Sh.Button,o.page===l&&Sh.IsDisabled),e[23]=l,e[24]=o.page,e[25]=S):S=e[25];let R;e[26]!==i.moveLast||e[27]!==S?(R=M.jsx(fo,{className:S,icon:"LastPage",onClick:i.moveLast}),e[26]=i.moveLast,e[27]=S,e[28]=R):R=e[28];let k;return e[29]!==h||e[30]!==m||e[31]!==x||e[32]!==_||e[33]!==R?(k=M.jsxs(Ml,{className:Sh.ATableFooter,children:[h,m,x,_,R]}),e[29]=h,e[30]=m,e[31]=x,e[32]=_,e[33]=R,e[34]=k):k=e[34],k},ik="_Filter_1b9j0_1",ok="_SelectFilter_1b9j0_11",lk="_MainFilter_1b9j0_15",sk="_IsOpen_1b9j0_26",ak="_SubFilters_1b9j0_30",ck="_Input_1b9j0_44",uk="_Main_1b9j0_15",fk="_Sub_1b9j0_30",hk="_Actions_1b9j0_62",dk="_Icon_1b9j0_67",gk="_LeftIcon_1b9j0_74",pk="_CircleAlertOutline_1b9j0_79",vk="_Rotate_1b9j0_87",ni={Filter:ik,SelectFilter:ok,MainFilter:lk,IsOpen:sk,SubFilters:ak,Input:ck,Main:uk,Sub:fk,Actions:hk,Icon:dk,LeftIcon:gk,CircleAlertOutline:pk,Rotate:vk},bk=n=>{const e=Gn.c(79),{defs:t,useFilteration:r,hasToggleFilteration:i,filterF:o,isRowRendered:l,isFilterSort:a,filterType:h,resources:g,placeholder:m}=n;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[w,_]=B.useState(x),[S,R]=r,k=h==="Select";let O;e[1]!==S?(O=$n.keys(S).map(xk),e[1]=S,e[2]=O):O=e[2];const P=O,[z,H]=B.useState(k&&P.length>0?P[0]:null);let G;e[3]!==S||e[4]!==R?(G=(sn,Xt,bn)=>{if(!R)return;const hn={...S};sn.value=Xt,R(hn),_(Rn=>Rn.map((vn,We)=>We===(bn?bn+1:0)?"":vn))},e[3]=S,e[4]=R,e[5]=G):G=e[5];const N=G;let J;if(e[6]!==t||e[7]!==S||e[8]!==k||e[9]!==z){J=[];let sn=$n.keys(S);if(k&&z){let Xt;e[11]!==z?(Xt=bn=>bn===z,e[11]=z,e[12]=Xt):Xt=e[12],sn=sn.filter(Xt)}for(const Xt of sn)J.push({key:Xt,def:t[Xt],filter:S[Xt]});e[6]=t,e[7]=S,e[8]=k,e[9]=z,e[10]=J}else J=e[10];const Y=J,K=Y.length>0?Y[0]:null,fe=w.length>0?w[0]:"";let X;e[13]!==Y?(X=Y.length>1?Y.slice(1):[],e[13]=Y,e[14]=X):X=e[14];const te=X;let ne;e[15]!==w?(ne=w.length>1?w.slice(1):[],e[15]=w,e[16]=ne):ne=e[16];const ue=ne,se=te.length>0,[$,re]=B.useState(!1),[ge,me]=B.useState(!1),oe=B.useRef(null);let Q;e[17]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>re(!1),e[17]=Q):Q=e[17];const pe=Q,Ie=B.useRef(null);let Fe;e[18]===Symbol.for("react.memo_cache_sentinel")?(Fe=()=>{me(!1),re(!0),Ie.current&&(document.removeEventListener("mousedown",Ie.current),Ie.current=null)},e[18]=Fe):Fe=e[18];const xe=Fe;let Oe;e[19]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>{const sn=Xt=>{const bn=document.getElementById("root"),hn=Xt.target,Rn=oe.current;!bn||!Rn||!hn||!Rn.contains(hn)&&bn.contains(hn)&&xe()};return Ie.current=sn,sn},e[19]=Oe):Oe=e[19];const Le=Oe;let He;e[20]===Symbol.for("react.memo_cache_sentinel")?(He=()=>{re(!0),me(!0),setTimeout(()=>{const sn=Le();document.addEventListener("mousedown",sn)},0)},e[20]=He):He=e[20];const Te=He,ke=ge?xe:Te;let Be;e[21]!==w||e[22]!==Y?(Be=()=>{const sn=Y.map((Xt,bn)=>Xt.filter.type==="String"&&Xt.filter.validation?Xt.filter.validation(Xt.filter.value||""):Xt.filter.type==="Date"&&Xt.filter.validation||Xt.filter.type==="DateRange"&&Xt.filter.validation?Xt.filter.validation(Xt.filter.value):w[bn]);return _(sn),sn.every(wk)},e[21]=w,e[22]=Y,e[23]=Be):Be=e[23];const rt=Be;let Re;e[24]!==o||e[25]!==rt?(Re=sn=>{sn.key==="Enter"?(rt()&&o.apply(),sn.stopPropagation()):sn.key==="Escape"&&(me(!1),sn.currentTarget.focus(),sn.currentTarget.blur(),sn.stopPropagation())},e[24]=o,e[25]=rt,e[26]=Re):Re=e[26];const ut=Re;let qe;e[27]!==ke||e[28]!==rt?(qe={open:Te,close:xe,toggle:ke,validate:rt},e[27]=ke,e[28]=rt,e[29]=qe):qe=e[29];const ot=qe;let st;e[30]!==o?(st=()=>{o.clear()},e[30]=o,e[31]=st):st=e[31];const bt=st;let Mt;e[32]!==o||e[33]!==S||e[34]!==R?(Mt=sn=>{if(!R||!sn)return;H(sn);const Xt={...S};$n.keys(Xt).forEach(bn=>{if(bn!==sn&&Xt[bn])e:switch(Xt[bn].type){case"String":{Xt[bn].value="";break e}case"Select":{Xt[bn].value=null;break e}case"Date":{Xt[bn].value=void 0;break e}case"DateRange":Xt[bn].value=void 0}}),_([]),R(Xt),o.clear(),setTimeout(()=>{var hn;const bn=(hn=oe.current)==null?void 0:hn.querySelector("input");bn&&bn.focus()},0)},e[32]=o,e[33]=S,e[34]=R,e[35]=Mt):Mt=e[35];const Bt=Mt;if(!K)return null;let at;e[36]!==t||e[37]!==P||e[38]!==S||e[39]!==Bt||e[40]!==k||e[41]!==z?(at=k&&M.jsx(Td,{isAutoWidth:!0,className:dt.clsx(ni.SelectFilter),options:P,type:"Secondary",useSelect:[z,Bt],OptionRenderer:sn=>{const{option:Xt}=sn,bn=t[Xt];let hn;if(bn!=null&&bn.hContent){const Rn={defKey:Xt,def:bn};hn=typeof bn.hContent=="function"?bn.hContent(Rn):bn.hContent}else{const Rn=S[Xt],vn=(bn==null?void 0:bn.name)||(Rn==null?void 0:Rn.placeholder)||String(Xt);hn=M.jsx("span",{children:vn})}return hn}}),e[36]=t,e[37]=P,e[38]=S,e[39]=Bt,e[40]=k,e[41]=z,e[42]=at):at=e[42];let Ye;e[43]===Symbol.for("react.memo_cache_sentinel")?(Ye=dt.clsx(ni.Filter),e[43]=Ye):Ye=e[43];const Tt=l?a?180:void 0:180,Ut=l?a?300:void 0:300;let gt;e[44]!==Tt||e[45]!==Ut?(gt={minWidth:Tt,maxWidth:Ut},e[44]=Tt,e[45]=Ut,e[46]=gt):gt=e[46];let Ht;e[47]!==o||e[48]!==k||e[49]!==se||e[50]!==i||e[51]!==ge||e[52]!==fe||e[53]!==K||e[54]!==N||e[55]!==m||e[56]!==ot||e[57]!==g?(Ht=M.jsx(yk,{errorMessage:fe,filterF:o,filterSet:K,hasSelectFilterType:k,hasSubFilters:se,hasToggleFilteration:i,isOpen:ge,placeholder:m,popupF:ot,resources:g,onChange:N}),e[47]=o,e[48]=k,e[49]=se,e[50]=i,e[51]=ge,e[52]=fe,e[53]=K,e[54]=N,e[55]=m,e[56]=ot,e[57]=g,e[58]=Ht):Ht=e[58];let xt;e[59]!==o||e[60]!==k||e[61]!==ge||e[62]!==$||e[63]!==N||e[64]!==bt||e[65]!==m||e[66]!==g||e[67]!==ue||e[68]!==te||e[69]!==rt?(xt=!k&&M.jsx(mk,{errorMessages:ue,filterF:o,isOpen:ge,isTransitioning:$,placeholder:m,resources:g,subFilterSets:te,validate:rt,onChange:N,onClearClick:bt,onTransitionEnd:pe}),e[59]=o,e[60]=k,e[61]=ge,e[62]=$,e[63]=N,e[64]=bt,e[65]=m,e[66]=g,e[67]=ue,e[68]=te,e[69]=rt,e[70]=xt):xt=e[70];let pn;e[71]!==ut||e[72]!==gt||e[73]!==Ht||e[74]!==xt?(pn=M.jsxs("div",{ref:oe,className:Ye,tabIndex:-1,style:gt,onKeyDown:ut,onClick:Ck,children:[Ht,xt]}),e[71]=ut,e[72]=gt,e[73]=Ht,e[74]=xt,e[75]=pn):pn=e[75];let $t;return e[76]!==at||e[77]!==pn?($t=M.jsxs(M.Fragment,{children:[at,pn]}),e[76]=at,e[77]=pn,e[78]=$t):$t=e[78],$t},yk=n=>{var _,S,R,k;const e=Gn.c(181),{filterSet:t,hasToggleFilteration:r,hasSelectFilterType:i,onChange:o,filterF:l,hasSubFilters:a,popupF:h,isOpen:g,resources:m,errorMessage:x,placeholder:w}=n;if(t.filter.type==="String"){const O=t.filter.value??"";let P;e[0]!==t.filter||e[1]!==o?(P=oe=>o(t.filter,oe),e[0]=t.filter,e[1]=o,e[2]=P):P=e[2];let z;e[3]!==O||e[4]!==P?(z=[O,P],e[3]=O,e[4]=P,e[5]=z):z=e[5];const H=z,G=w??t.filter.placeholder??((_=t.def)==null?void 0:_.name),N=t.filter.icon,J=t.filter.iconTooltip??G;let Y;e[6]!==g?(Y=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[6]=g,e[7]=Y):Y=e[7];const K=N??"Type";let fe;e[8]!==J||e[9]!==g||e[10]!==K?(fe=M.jsx(Kh,{icon:K,isOpen:g,tooltip:J}),e[8]=J,e[9]=g,e[10]=K,e[11]=fe):fe=e[11];const X=t.filter.autoFocus;let te;e[12]===Symbol.for("react.memo_cache_sentinel")?(te=dt.clsx(ni.Input,ni.Main),e[12]=te):te=e[12];let ne;e[13]!==l||e[14]!==r||e[15]!==g||e[16]!==h||e[17]!==m?(ne=r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),e[13]=l,e[14]=r,e[15]=g,e[16]=h,e[17]=m,e[18]=ne):ne=e[18];const ue=G??m["Search(Placeholder)"],se=x?"Error":"Primary";let $;e[19]===Symbol.for("react.memo_cache_sentinel")?($={style:{width:"100%",boxSizing:"border-box"}},e[19]=$):$=e[19];let re;e[20]!==x||e[21]!==l||e[22]!==i||e[23]!==a||e[24]!==g||e[25]!==h||e[26]!==m?(re=M.jsx(g0,{errorMessage:x,filterF:l,hasSelectFilterType:i,hasSubFilters:a,isOpen:g,popupF:h,resources:m}),e[20]=x,e[21]=l,e[22]=i,e[23]=a,e[24]=g,e[25]=h,e[26]=m,e[27]=re):re=e[27];let ge;e[28]!==t.filter.autoFocus||e[29]!==t.filter.dataList||e[30]!==t.filter.maxLength||e[31]!==t.filter.pattern||e[32]!==se||e[33]!==re||e[34]!==ne||e[35]!==ue||e[36]!==H?(ge=M.jsx(sg,{autoFocus:X,className:te,dataList:t.filter.dataList,LeftAddon:ne,maxLength:t.filter.maxLength,pattern:t.filter.pattern,placeholder:ue,type:se,useValue:H,wrapProps:$,RightAddon:re}),e[28]=t.filter.autoFocus,e[29]=t.filter.dataList,e[30]=t.filter.maxLength,e[31]=t.filter.pattern,e[32]=se,e[33]=re,e[34]=ne,e[35]=ue,e[36]=H,e[37]=ge):ge=e[37];let me;return e[38]!==ge||e[39]!==Y||e[40]!==fe?(me=M.jsxs("div",{className:Y,children:[fe,ge]}),e[38]=ge,e[39]=Y,e[40]=fe,e[41]=me):me=e[41],me}else if(t.filter.type==="Select"){const O=t.filter.value??null;let P;e[42]!==l||e[43]!==t.filter||e[44]!==i||e[45]!==o||e[46]!==h?(P=se=>{o(t.filter,se),i&&setTimeout(()=>{h.validate()&&l.apply()},0)},e[42]=l,e[43]=t.filter,e[44]=i,e[45]=o,e[46]=h,e[47]=P):P=e[47];let z;e[48]!==O||e[49]!==P?(z=[O,P],e[48]=O,e[49]=P,e[50]=z):z=e[50];const H=z,G=w??t.filter.placeholder??((S=t.def)==null?void 0:S.name),N=t.filter.icon,J=t.filter.iconTooltip??G;let Y;e[51]!==g?(Y=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[51]=g,e[52]=Y):Y=e[52];const K=N??"Menu";let fe;e[53]!==J||e[54]!==g||e[55]!==K?(fe=M.jsx(Kh,{icon:K,isOpen:g,tooltip:J}),e[53]=J,e[54]=g,e[55]=K,e[56]=fe):fe=e[56];let X;e[57]===Symbol.for("react.memo_cache_sentinel")?(X=dt.clsx(ni.Input,ni.Main),e[57]=X):X=e[57];let te;e[58]!==l||e[59]!==t.filter.placeholder||e[60]!==i||e[61]!==a||e[62]!==r||e[63]!==g||e[64]!==G||e[65]!==h||e[66]!==m?(te=se=>{const{OptionRenderer:$,selectedOption:re}=se;return re===null?G||t.filter.placeholder:M.jsxs(M.Fragment,{children:[r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),M.jsx($,{option:re}),M.jsx(g0,{filterF:l,hasSelectFilterType:i,hasSubFilters:a,hideSearchButton:!0,isOpen:g,popupF:h,resources:m})]})},e[58]=l,e[59]=t.filter.placeholder,e[60]=i,e[61]=a,e[62]=r,e[63]=g,e[64]=G,e[65]=h,e[66]=m,e[67]=te):te=e[67];let ne;e[68]!==t.filter.OptionRenderer||e[69]!==t.filter.options||e[70]!==G||e[71]!==te||e[72]!==H?(ne=M.jsx(Td,{className:X,OptionRenderer:t.filter.OptionRenderer,options:t.filter.options,placeholder:G,useSelect:H,SelectedRenderer:te}),e[68]=t.filter.OptionRenderer,e[69]=t.filter.options,e[70]=G,e[71]=te,e[72]=H,e[73]=ne):ne=e[73];let ue;return e[74]!==Y||e[75]!==fe||e[76]!==ne?(ue=M.jsxs("div",{className:Y,children:[fe,ne]}),e[74]=Y,e[75]=fe,e[76]=ne,e[77]=ue):ue=e[77],ue}else if(t.filter.type==="Date"){let O;e[78]!==t.filter||e[79]!==o?(O=pe=>o(t.filter,pe),e[78]=t.filter,e[79]=o,e[80]=O):O=e[80];let P;e[81]!==t.filter.value||e[82]!==O?(P=[t.filter.value,O],e[81]=t.filter.value,e[82]=O,e[83]=P):P=e[83];const z=P,H=w??t.filter.placeholder??((R=t.def)==null?void 0:R.name),G=t.filter.icon,N=t.filter.iconTooltip??H;let J;e[84]!==g?(J=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[84]=g,e[85]=J):J=e[85];const Y=G??"CalendarDay";let K;e[86]!==N||e[87]!==g||e[88]!==Y?(K=M.jsx(Kh,{icon:Y,isOpen:g,tooltip:N}),e[86]=N,e[87]=g,e[88]=Y,e[89]=K):K=e[89];let fe;e[90]===Symbol.for("react.memo_cache_sentinel")?(fe=dt.clsx(ni.DatePicker,ni.Input,ni.Main),e[90]=fe):fe=e[90];let X;e[91]!==l||e[92]!==r||e[93]!==g||e[94]!==h||e[95]!==m?(X=r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),e[91]=l,e[92]=r,e[93]=g,e[94]=h,e[95]=m,e[96]=X):X=e[96];let te;e[97]!==r||e[98]!==g?(te=!r&&M.jsx(cs,{w:g?0:6}),e[97]=r,e[98]=g,e[99]=te):te=e[99];const ne=G??"CalendarDay",ue=!g;let se;e[100]!==N||e[101]!==ne||e[102]!==ue?(se=M.jsx(Kh,{icon:ne,isOpen:ue,tooltip:N}),e[100]=N,e[101]=ne,e[102]=ue,e[103]=se):se=e[103];const $=g?8:0;let re;e[104]!==$?(re=M.jsx(cs,{w:$}),e[104]=$,e[105]=re):re=e[105];let ge;e[106]!==se||e[107]!==re||e[108]!==X||e[109]!==te?(ge=M.jsxs(M.Fragment,{children:[X,te,se,re]}),e[106]=se,e[107]=re,e[108]=X,e[109]=te,e[110]=ge):ge=e[110];let me;e[111]!==l||e[112]!==i||e[113]!==a||e[114]!==g||e[115]!==h||e[116]!==m?(me=M.jsx(g0,{filterF:l,hasSelectFilterType:i,hasSubFilters:a,isOpen:g,popupF:h,resources:m}),e[111]=l,e[112]=i,e[113]=a,e[114]=g,e[115]=h,e[116]=m,e[117]=me):me=e[117];let oe;e[118]!==t.filter.maxDate||e[119]!==t.filter.minDate||e[120]!==H||e[121]!==ge||e[122]!==me||e[123]!==z?(oe=M.jsx(Em,{className:fe,maxDate:t.filter.maxDate,minDate:t.filter.minDate,placeholder:H,type:"Raw",useDate:z,LeftAddon:ge,RightAddon:me}),e[118]=t.filter.maxDate,e[119]=t.filter.minDate,e[120]=H,e[121]=ge,e[122]=me,e[123]=z,e[124]=oe):oe=e[124];let Q;return e[125]!==oe||e[126]!==J||e[127]!==K?(Q=M.jsxs("div",{className:J,children:[K,oe]}),e[125]=oe,e[126]=J,e[127]=K,e[128]=Q):Q=e[128],Q}else if(t.filter.type==="DateRange"){let O;e[129]!==t.filter||e[130]!==o?(O=Ie=>o(t.filter,Ie),e[129]=t.filter,e[130]=o,e[131]=O):O=e[131];let P;e[132]!==t.filter.value||e[133]!==O?(P=[t.filter.value,O],e[132]=t.filter.value,e[133]=O,e[134]=P):P=e[134];const z=P,{noDefaultChoices:H}=t.filter,G=w??t.filter.placeholder??((k=t.def)==null?void 0:k.name),N=t.filter.icon,J=t.filter.iconTooltip??G;let Y;e[135]!==g?(Y=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[135]=g,e[136]=Y):Y=e[136];const K=N??"CalendarDay";let fe;e[137]!==J||e[138]!==g||e[139]!==K?(fe=M.jsx(Kh,{icon:K,isOpen:g,tooltip:J}),e[137]=J,e[138]=g,e[139]=K,e[140]=fe):fe=e[140];let X;e[141]===Symbol.for("react.memo_cache_sentinel")?(X=dt.clsx(ni.DatePicker,ni.Input,ni.Main),e[141]=X):X=e[141];let te;e[142]!==l||e[143]!==r||e[144]!==g||e[145]!==h||e[146]!==m?(te=r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),e[142]=l,e[143]=r,e[144]=g,e[145]=h,e[146]=m,e[147]=te):te=e[147];let ne;e[148]!==r||e[149]!==g?(ne=!r&&M.jsx(cs,{w:g?0:6}),e[148]=r,e[149]=g,e[150]=ne):ne=e[150];const ue=N??"CalendarDay",se=!g;let $;e[151]!==J||e[152]!==ue||e[153]!==se?($=M.jsx(Kh,{icon:ue,isOpen:se,tooltip:J}),e[151]=J,e[152]=ue,e[153]=se,e[154]=$):$=e[154];const re=g?8:0;let ge;e[155]!==re?(ge=M.jsx(cs,{w:re}),e[155]=re,e[156]=ge):ge=e[156];let me;e[157]!==$||e[158]!==ge||e[159]!==te||e[160]!==ne?(me=M.jsxs(M.Fragment,{children:[te,ne,$,ge]}),e[157]=$,e[158]=ge,e[159]=te,e[160]=ne,e[161]=me):me=e[161];let oe;e[162]!==l||e[163]!==i||e[164]!==a||e[165]!==g||e[166]!==h||e[167]!==m?(oe=M.jsx(g0,{filterF:l,hasSelectFilterType:i,hasSubFilters:a,isOpen:g,popupF:h,resources:m}),e[162]=l,e[163]=i,e[164]=a,e[165]=g,e[166]=h,e[167]=m,e[168]=oe):oe=e[168];let Q;e[169]!==t.filter.maxDate||e[170]!==t.filter.minDate||e[171]!==H||e[172]!==G||e[173]!==me||e[174]!==oe||e[175]!==z?(Q=M.jsx(_m,{className:X,maxDate:t.filter.maxDate,minDate:t.filter.minDate,noDefaultChoices:H,placeholder:G,type:"Raw",useDateRange:z,LeftAddon:me,RightAddon:oe}),e[169]=t.filter.maxDate,e[170]=t.filter.minDate,e[171]=H,e[172]=G,e[173]=me,e[174]=oe,e[175]=z,e[176]=Q):Q=e[176];let pe;return e[177]!==Q||e[178]!==Y||e[179]!==fe?(pe=M.jsxs("div",{className:Y,children:[fe,Q]}),e[177]=Q,e[178]=Y,e[179]=fe,e[180]=pe):pe=e[180],pe}return null},d0=n=>{const e=Gn.c(10),{filterF:t,popupF:r,resources:i,isOpen:o}=n,l=o?0:24,a=o?0:8;let h;e[0]!==l||e[1]!==a?(h={width:l,marginLeft:a},e[0]=l,e[1]=a,e[2]=h):h=e[2];const g=i["Toggle Filter"];let m;e[3]!==t||e[4]!==r?(m=w=>{w.currentTarget.classList.add(ni.Rotate),t.toggle(),r.close(),w.stopPropagation()},e[3]=t,e[4]=r,e[5]=m):m=e[5];let x;return e[6]!==h||e[7]!==g||e[8]!==m?(x=M.jsx(ba,{className:ni.Icon,icon:"Convert",style:h,tooltip:g,type:"Raw",onMouseDown:_k,onClick:m}),e[6]=h,e[7]=g,e[8]=m,e[9]=x):x=e[9],x},g0=n=>{const e=Gn.c(29),{hasSubFilters:t,popupF:r,isOpen:i,resources:o,errorMessage:l,hideSearchButton:a,hasSelectFilterType:h,filterF:g}=n;let m;e[0]!==r?(m=G=>{G.stopPropagation(),r.open()},e[0]=r,e[1]=m):m=e[1];const x=m;let w;e[2]!==r?(w=G=>{G.stopPropagation(),r.close()},e[2]=r,e[3]=w):w=e[3];const _=w;let S;e[4]!==g||e[5]!==r?(S=G=>{G.stopPropagation(),r.validate()&&g.apply()},e[4]=g,e[5]=r,e[6]=S):S=e[6];const R=S;let k;e[7]!==l?(k=l&&M.jsx(ba,{className:ni.CircleAlertOutline,icon:"CircleAlertOutline",iconSize:"xs",tooltip:l,type:"Raw"}),e[7]=l,e[8]=k):k=e[8];let O;e[9]!==h||e[10]!==t||e[11]!==i||e[12]!==x?(O=t&&!h&&M.jsx(ba,{className:ni.Icon,icon:"ListAdd",type:"Raw",style:{opacity:+!i,visibility:+!i?"visible":"hidden",marginRight:-24,pointerEvents:i?"none":void 0},onClick:x}),e[9]=h,e[10]=t,e[11]=i,e[12]=x,e[13]=O):O=e[13];let P;e[14]!==h||e[15]!==t||e[16]!==i||e[17]!==_?(P=t&&!h&&M.jsx(ba,{className:ni.Icon,icon:"ListRemove",type:"Raw",style:{opacity:+i,visibility:+i?"visible":"hidden",marginRight:i?-24:0,pointerEvents:i?void 0:"none"},onClick:_}),e[14]=h,e[15]=t,e[16]=i,e[17]=_,e[18]=P):P=e[18];let z;e[19]!==a||e[20]!==i||e[21]!==R||e[22]!==o?(z=!a&&M.jsx(ba,{className:ni.Icon,icon:"Search",tooltip:o["Search(Button)"],type:"Raw",style:{opacity:+!i,visibility:+!i?"visible":"hidden",pointerEvents:i?"none":void 0,marginRight:4},onClick:R}),e[19]=a,e[20]=i,e[21]=R,e[22]=o,e[23]=z):z=e[23];let H;return e[24]!==k||e[25]!==O||e[26]!==P||e[27]!==z?(H=M.jsxs(B.Fragment,{children:[k,O,P,z]}),e[24]=k,e[25]=O,e[26]=P,e[27]=z,e[28]=H):H=e[28],H},mk=n=>{const e=Gn.c(31),{subFilterSets:t,onChange:r,onClearClick:i,isOpen:o,isTransitioning:l,onTransitionEnd:a,resources:h,errorMessages:g,placeholder:m,filterF:x,validate:w}=n;if(!o&&!l)return null;const _=+o,S=+o?"visible":"hidden";let R;e[0]!==_||e[1]!==S?(R={opacity:_,visibility:S},e[0]=_,e[1]=S,e[2]=R):R=e[2];let k;if(e[3]!==g||e[4]!==m||e[5]!==r||e[6]!==h||e[7]!==t){let Y;e[9]!==g||e[10]!==m||e[11]!==r||e[12]!==h?(Y=(K,fe)=>{var X,te,ne,ue;if(K.filter.type==="String"){const se=[K.filter.value??"",oe=>r(K.filter,oe,fe)],$=g[fe],re=m??K.filter.placeholder??((X=K.def)==null?void 0:X.name),ge=K.filter.icon,me=K.filter.iconTooltip??re;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:ge??"Type",tooltip:me}),M.jsx(sg,{autoFocus:K.filter.autoFocus,className:dt.clsx(ni.Input,ni.Sub),dataList:K.filter.dataList,maxLength:K.filter.maxLength,pattern:K.filter.pattern,placeholder:re??h["Search(Placeholder)"],type:$?"Error":"Secondary",useValue:se,wrapProps:{style:{width:"100%"}},RightAddon:$&&M.jsx(ba,{className:ni.CircleAlertOutline,icon:"CircleAlertOutline",iconSize:"xs",tooltip:$,type:"Raw"})}),M.jsx(cs,{h:8})]},fe)}else if(K.filter.type==="Select"){const se=[K.filter.value??null,me=>r(K.filter,me)],$=m??K.filter.placeholder??((te=K.def)==null?void 0:te.name),re=K.filter.icon,ge=K.filter.iconTooltip??$;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:re??"Menu",tooltip:ge}),M.jsx(Td,{arrowProps:{style:{marginRight:4}},className:dt.clsx(ni.Input,ni.Sub),OptionRenderer:K.filter.OptionRenderer,options:K.filter.options,placeholder:$,type:"Secondary",useSelect:se}),M.jsx(cs,{h:8})]},fe)}else if(K.filter.type==="Date"){const se=[K.filter.value,me=>r(K.filter,me)],$=m??K.filter.placeholder??((ne=K.def)==null?void 0:ne.name),re=K.filter.icon,ge=K.filter.iconTooltip??$;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:re??"CalendarDay",tooltip:ge}),M.jsx(Em,{className:dt.clsx(ni.DatePicker,ni.Input,ni.Sub),LeftAddon:M.jsx(cs,{w:12}),maxDate:K.filter.maxDate,minDate:K.filter.minDate,placeholder:$,type:"Raw",useDate:se}),M.jsx(cs,{h:8})]},fe)}else if(K.filter.type==="DateRange"){const se=[K.filter.value,oe=>r(K.filter,oe)],{noDefaultChoices:$}=K.filter,re=m??K.filter.placeholder??((ue=K.def)==null?void 0:ue.name),ge=K.filter.icon,me=K.filter.iconTooltip??re;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:ge??"CalendarDay",tooltip:me}),M.jsx(_m,{className:dt.clsx(ni.DatePicker,ni.Input,ni.Sub),LeftAddon:M.jsx(cs,{w:12}),maxDate:K.filter.maxDate,minDate:K.filter.minDate,noDefaultChoices:$,placeholder:re,type:"Raw",useDateRange:se})]},fe)}else return null},e[9]=g,e[10]=m,e[11]=r,e[12]=h,e[13]=Y):Y=e[13],k=t.map(Y),e[3]=g,e[4]=m,e[5]=r,e[6]=h,e[7]=t,e[8]=k}else k=e[8];const O=h["Clear(Button)"];let P;e[14]!==i||e[15]!==O?(P=M.jsx(Ic,{type:"Secondary",onClick:i,children:O}),e[14]=i,e[15]=O,e[16]=P):P=e[16];let z;e[17]!==x||e[18]!==w?(z=()=>{w()&&x.apply()},e[17]=x,e[18]=w,e[19]=z):z=e[19];const H=h["Search(Button)"];let G;e[20]!==z||e[21]!==H?(G=M.jsx(Ic,{onClick:z,children:H}),e[20]=z,e[21]=H,e[22]=G):G=e[22];let N;e[23]!==P||e[24]!==G?(N=M.jsxs(Ml,{className:ni.Actions,children:[P,G]}),e[23]=P,e[24]=G,e[25]=N):N=e[25];let J;return e[26]!==a||e[27]!==R||e[28]!==k||e[29]!==N?(J=M.jsxs("div",{className:ni.SubFilters,style:R,onTransitionEnd:a,children:[k,N]}),e[26]=a,e[27]=R,e[28]=k,e[29]=N,e[30]=J):J=e[30],J},Kh=n=>{const e=Gn.c(8),{icon:t,tooltip:r,isOpen:i}=n,o=i===void 0?!0:i,l=o?24:0,a=o?4:0,h=+o;let g;e[0]!==l||e[1]!==a||e[2]!==h?(g={width:l,marginRight:a,opacity:h},e[0]=l,e[1]=a,e[2]=h,e[3]=g):g=e[3];let m;return e[4]!==t||e[5]!==g||e[6]!==r?(m=M.jsx(ba,{className:ni.LeftIcon,icon:t,tooltip:r,type:"Raw",style:g}),e[4]=t,e[5]=g,e[6]=r,e[7]=m):m=e[7],m};function xk(n){return String(n)}function wk(n){return!n}function Ck(n){n.preventDefault(),n.stopPropagation()}function _k(n){return n.currentTarget.classList.remove(ni.Rotate)}const Sk="_ATableHeader_1hzfz_1",Ek="_LeftHeaderContent_1hzfz_11",Tk="_RightHeaderContent_1hzfz_19",Ak="_TopRightAddon_1hzfz_27",Rk="_HItem_1hzfz_32",Sg={ATableHeader:Sk,LeftHeaderContent:Ek,RightHeaderContent:Tk,TopRightAddon:Ak,HItem:Rk},Ik=n=>{const{defs:e,title:t,totalCount:r,useCheck:i,useFilteration:o,hasToggleFilteration:l,filterF:a,noFilter:h,noCount:g,isFiltered:m,TopLeftAddon:x,TopRightAddon:w,useSortation:_,resources:S=Or.ATable,filterType:R,placeholder:k}=n,[O]=B.useMemo(()=>i||[],[i]),P=B.useMemo(()=>m?S["Searched n items"](r):S["Total n items"](r),[S,m,r]),[z]=o,[H,G]=_,[N,J]=B.useState(!1),Y=B.useMemo(()=>{const re=$n.values(z).filter(oe=>oe.type==="DateRange"),ge=$n.keys(z).filter(oe=>re.includes(z[oe])),me=$n.keys(e).filter(oe=>e[oe].isSortable);return ge.length>0?(ge.length>1&&J(!0),me.map(Q=>ge.includes(Q)?[Q+"_Asc",Q+"_Desc"]:Q).flat()):me},[e,z]),K=B.useMemo(()=>n.isRowRendered&&Y.length>0,[Y.length,n.isRowRendered]),fe=B.useCallback((re,ge)=>{G&&(H==null?void 0:H.defKey)===re&&(H.isAsc===!0?G({defKey:re,isAsc:!1,sortF:ge}):G({defKey:re,isAsc:!0,sortF:ge}))},[H,G]),X=B.useRef(null),[te,ne]=B.useState(),[ue,se]=B.useState(H?H.defKey:Y[0]),$=B.useMemo(()=>{if(!te)return{};const re=e[te];return{SortUp:{onClick:()=>{G==null||G({defKey:te,isAsc:!0,sortF:re.sortF}),se(te)},content:()=>S["Sort up"]},SortDown:{onClick:()=>{G==null||G({defKey:te,isAsc:!1,sortF:re.sortF}),se(te)},content:()=>S["Sort down"]}}},[G,te,e,S]);return M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:dt.clsx(Sg.ATableHeader),children:[M.jsxs("div",{className:dt.clsx(Sg.LeftHeaderContent,"NoSelect"),children:[M.jsxs(Ml,{style:{marginBottom:K?8:0},children:[x&&M.jsx("div",{className:dt.clsx(Sg.HItem),children:x}),t&&M.jsx("div",{className:dt.clsx(Sg.HItem),style:{whiteSpace:"nowrap"},children:t}),!g&&M.jsxs("div",{className:dt.clsx(Sg.HItem),style:{maxHeight:14,...K&&{minHeight:14,color:"var(--label-neutral)"}},children:[P,O&&O.length>0&&M.jsxs(M.Fragment,{children:[" / ",S["Checked n items"](O.length)]})]})]}),K&&M.jsx(H3,{options:Y,optionWidth:"fit-content",tabProps:{style:{marginRight:8}},type:"Tertiary",useSelect:[ue,()=>{}],optionProps:{style:{cursor:"default"},onClick:re=>{var oe;const ge=re.currentTarget.textContent;if(ge===S[ge])return;re.currentTarget.querySelector("svg")===null&&((oe=X.current)==null||oe.open(re.currentTarget))}},OptionRenderer:re=>{const ge=/_Asc|_Desc/.test(re.option),me=(H==null?void 0:H.defKey)===re.option,oe=ue===re.option,Q=H==null?void 0:H.isAsc,pe=()=>{if(ge){ne(void 0),se(re.option);const[xe,Oe]=re.option.split("_"),Le=Oe==="Asc";G==null||G({defKey:xe,isAsc:Le,sortF:e[xe].sortF})}else oe?fe(re.option,e[re.option].sortF):ne(re.option)},Fe=ge?(xe=>{const[Oe,Le]=xe.split("_");return(N?Oe+" ":"")+S[Le]})(re.option):S["Sort by x"](re.option);return M.jsxs(Ml,{className:dt.clsx(!(ge&&oe)&&"IsClickable"),style:{height:"100%"},onClick:pe,children:[Fe,oe&&!ge&&M.jsx(fo,{icon:me?Q?"RowSortUp":"RowSortDown":"RowSortBoth",style:{marginRight:-5,marginLeft:4}})]},re.option)}})]}),M.jsx(zg,{}),M.jsxs("div",{className:dt.clsx(Sg.RightHeaderContent,"NoSelect"),children:[!h&&M.jsx(bk,{defs:e,filterF:a,filterType:R,hasToggleFilteration:l,isFilterSort:Y.length>0,isRowRendered:n.isRowRendered,placeholder:k,resources:S,useFilteration:o}),w&&M.jsx(Ml,{children:w,className:dt.clsx(Sg.TopRightAddon)})]})]}),M.jsx(B3,{actionRef:X,defs:$,position:O1.S,width:100,onClose:()=>ne(void 0)})]})},kk=n=>{const e=Gn.c(253),{defs:t,pk:r,defaultDef:i,rProps:o,useSelect:l,isSelectMulti:a,selectDisabled:h,useCheck:g,checkDisabled:m,isLoading:x,isDisabled:w,title:_,entireItems:S,onStateChange:R,pagedItems:k,pageNumber:O,totalCount:P,useFilteration:z,useToggleFilteration:H,filterType:G,placeholder:N,rowHeight:J,usePagination:Y,useSortation:K,showRows:fe,noHeader:X,noDefHeader:te,noFooter:ne,noFilter:ue,noCount:se,noMarking:$,noStateChangeOnMount:re,TopLeftAddon:ge,TopRightAddon:me,actionRef:oe,RowRenderer:Q,resources:pe}=n,Ie=G===void 0?"Default":G,Fe=J===void 0?40:J;let xe;e[0]!==pe?(xe={...Or.ATable,...pe},e[0]=pe,e[1]=xe):xe=e[1];const Oe=xe,Le=B.useRef(null);let He;e[2]!==r?(He=(Et,he)=>r!==void 0?Array.isArray(r)?r.every(Ve=>Jh.isEqual(Et[Ve],he[Ve])):Jh.isEqual(Et[r],he[r]):Jh.isEqual(Et,he),e[2]=r,e[3]=He):He=e[3];const Te=He;let ke;e[4]!==i?(ke={content:Mk,...i},e[4]=i,e[5]=ke):ke=e[5];const Be=ke;let rt;e[6]!==Be||e[7]!==t?(rt={},$n.keys(t).forEach(Et=>{const he=t[Et],Ve={...Be,...he};rt[Et]=Ve}),e[6]=Be,e[7]=t,e[8]=rt):rt=e[8];const Re=rt;let ut;e[9]!==z?(ut=Jh.cloneDeep(z),e[9]=z,e[10]=ut):ut=e[10];const qe=Oe["Search(Placeholder)"];let ot;e[11]!==qe?(ot={"":{type:"String",placeholder:qe,value:""}},e[11]=qe,e[12]=ot):ot=e[12];const[st,bt]=Fo(ut,ot);let Mt;e[13]!==H?(Mt=Jh.cloneDeep(H),e[13]=H,e[14]=Mt):Mt=e[14];const[Bt,at]=Fo(Mt,void 0),[Ye,Tt]=B.useState(!1);let Ut;e:{if(Ye&&Bt){let he;e[15]!==at||e[16]!==Bt?(he=[Bt,at],e[15]=at,e[16]=Bt,e[17]=he):he=e[17],Ut=he;break e}let Et;e[18]!==st||e[19]!==bt?(Et=[st,bt],e[18]=st,e[19]=bt,e[20]=Et):Et=e[20],Ut=Et}const[gt,Ht]=Ut,[xt,pn]=B.useState(gt);let $t;e:{if(!S){let he;e[21]===Symbol.for("react.memo_cache_sentinel")?(he=[],e[21]=he):he=e[21],$t=he;break e}let Et;e[22]!==xt||e[23]!==Re||e[24]!==S?(Et=_d.applyFilteration(S,Re,xt),e[22]=xt,e[23]=Re,e[24]=S,e[25]=Et):Et=e[25],$t=Et}const sn=$t;let Xt;e:{for(const Et in xt){const he=xt[Et];if(he.value!==void 0&&he.value!==null&&he.value!==""){Xt=!0;break e}}Xt=!1}const bn=Xt,[hn,Rn]=Fo(K,void 0);let vn;e[26]!==Re||e[27]!==sn||e[28]!==hn?(vn=_d.applySortation(sn,Re,hn),e[26]=Re,e[27]=sn,e[28]=hn,e[29]=vn):vn=e[29];const We=vn;let Ce;e:{if(k!==void 0){let Et;e[30]!==Re||e[31]!==k||e[32]!==hn?(Et=_d.applySortation(k,Re,hn),e[30]=Re,e[31]=k,e[32]=hn,e[33]=Et):Et=e[33],Ce=Et;break e}Ce=void 0}const it=Ce;let Ct;e[34]===Symbol.for("react.memo_cache_sentinel")?(Ct={page:1,pageSize:50,pageRange:10},e[34]=Ct):Ct=e[34];const[Qt,Yt]=Fo(Y,Ct),yn=O??Qt.page??1;let gn;e[35]!==Qt||e[36]!==yn?(gn={pageSize:50,pageRange:10,...Qt,page:yn},e[35]=Qt,e[36]=yn,e[37]=gn):gn=e[37];const lt=gn;let kt;if(e[38]!==S||e[39]!==lt||e[40]!==P||e[41]!==We||e[42]!==it){const Et={...lt};if(it!==void 0){const he=P??it.length,Ve=_d.getPages(he,Et.pageSize);Et.page>Ve.length?Et.page=Ve.length:Et.page<1&&(Et.page=1),kt={pagedItems:it,totalCount:he,pagination:Et}}else if(S!==void 0){const he=P??We.length,Ve=_d.getPages(he,Et.pageSize);Et.page>Ve.length?Et.page=Ve.length:Et.page<1&&(Et.page=1);const _t=_d.applyPagination(We,Et.page,Et.pageSize);let rn;e[44]!==_t||e[45]!==Et||e[46]!==he?(rn={pagedItems:_t,totalCount:he,pagination:Et},e[44]=_t,e[45]=Et,e[46]=he,e[47]=rn):rn=e[47],kt=rn}else{let he;e[48]===Symbol.for("react.memo_cache_sentinel")?(he=[],e[48]=he):he=e[48];const Ve=P??0;let _t;e[49]!==lt||e[50]!==Ve?(_t={pagedItems:he,totalCount:Ve,pagination:lt},e[49]=lt,e[50]=Ve,e[51]=_t):_t=e[51],kt=_t}e[38]=S,e[39]=lt,e[40]=P,e[41]=We,e[42]=it,e[43]=kt}else kt=e[43];const{pagedItems:vt,totalCount:zt,pagination:Lt}=kt;let yt;e[52]!==Lt.page||e[53]!==Lt.pageRange||e[54]!==Lt.pageSize||e[55]!==zt?(yt=_d.getRangedPages(Lt.page,zt,Lt.pageSize,Lt.pageRange),e[52]=Lt.page,e[53]=Lt.pageRange,e[54]=Lt.pageSize,e[55]=zt,e[56]=yt):yt=e[56];const{pages:Rt,rangedPages:on}=yt;let En;e[57]!==g?(En=g??[],e[57]=g,e[58]=En):En=e[58];const[Jt,xn]=En;let _n;if(e[59]!==Jt||e[60]!==Te||e[61]!==vt){let Et;e[63]!==Jt||e[64]!==Te?(Et=he=>Jt==null?void 0:Jt.some(Ve=>Te(Ve,he)),e[63]=Jt,e[64]=Te,e[65]=Et):Et=e[65],_n=vt.filter(Et),e[59]=Jt,e[60]=Te,e[61]=vt,e[62]=_n}else _n=e[62];const zn=_n;let er;if(e[66]!==m||e[67]!==vt){let Et;e[69]!==m?(Et=he=>!(m!=null&&m(he)),e[69]=m,e[70]=Et):Et=e[70],er=vt.filter(Et),e[66]=m,e[67]=vt,e[68]=er}else er=e[68];const wn=er;let ri;e[71]!==Te||e[72]!==wn||e[73]!==zn?(ri=wn.length>0&&wn.every(Et=>zn.some(he=>Te(he,Et))),e[71]=Te,e[72]=wn,e[73]=zn,e[74]=ri):ri=e[74];const $e=ri;let tn;e:{if($e){tn=!1;break e}let Et;if(e[75]!==Te||e[76]!==wn||e[77]!==zn){let he;e[79]!==Te||e[80]!==zn?(he=Ve=>zn.some(_t=>Te(_t,Ve)),e[79]=Te,e[80]=zn,e[81]=he):he=e[81],Et=wn.some(he),e[75]=Te,e[76]=wn,e[77]=zn,e[78]=Et}else Et=e[78];tn=Et}const ln=tn;let Nn;e[82]!==Jt||e[83]!==w||e[84]!==Te||e[85]!==$e||e[86]!==ln||e[87]!==wn||e[88]!==xn?(Nn=()=>{!Jt||!xn||w||xn($e||ln?Jt.filter(Et=>!wn.some(he=>Te(he,Et))):[...Jt,...wn])},e[82]=Jt,e[83]=w,e[84]=Te,e[85]=$e,e[86]=ln,e[87]=wn,e[88]=xn,e[89]=Nn):Nn=e[89];const yr=Nn;let Ln;e[90]!==Jt||e[91]!==w||e[92]!==Te||e[93]!==xn?(Ln=Et=>{!Jt||!xn||w||(Jt.some(he=>Te(he,Et))?xn(Jt.filter(he=>!Te(he,Et))):xn([...Jt,Et]))},e[90]=Jt,e[91]=w,e[92]=Te,e[93]=xn,e[94]=Ln):Ln=e[94];const Pt=Ln;let Se,tt;e[95]!==m||e[96]!==Jt||e[97]!==xn?(Se=()=>{if(!xn||!Jt||!m)return;Jt.filter(he=>m(he)).length>0&&xn(Jt.filter(he=>!m(he)))},tt=[m,Jt,xn],e[95]=m,e[96]=Jt,e[97]=xn,e[98]=Se,e[99]=tt):(Se=e[98],tt=e[99]),B.useEffect(Se,tt);let At;e[100]!==Jt||e[101]!==$e||e[102]!==ln||e[103]!==yr?(At=Jt&&M.jsx(w1,{isIndeterminate:ln,useCheck:[$e,yr]}),e[100]=Jt,e[101]=$e,e[102]=ln,e[103]=yr,e[104]=At):At=e[104];let Sn;e[105]!==m||e[106]!==Jt||e[107]!==Te||e[108]!==Pt?(Sn=Et=>{const{item:he}=Et,Ve=m==null?void 0:m(he),_t=typeof Ve=="string"?Ve:void 0,rn=Jt==null?void 0:Jt.some(pi=>Te(pi,he));return M.jsx(w1,{isDisabled:Ve,style:{zIndex:1},tooltip:_t,useCheck:[rn,()=>Pt(he)],onClick:Lk})},e[105]=m,e[106]=Jt,e[107]=Te,e[108]=Pt,e[109]=Sn):Sn=e[109];let In;e[110]!==At||e[111]!==Sn?(In={hContent:At,content:Sn,minWidth:32,maxWidth:32},e[110]=At,e[111]=Sn,e[112]=In):In=e[112];const Yn=In;let lr;e:{if(!g){lr=Re;break e}let Et;e[113]!==Yn||e[114]!==Re?(Et={checkDef:Yn,...Re},e[113]=Yn,e[114]=Re,e[115]=Et):Et=e[115],lr=Et}const pr=lr,[On,tr]=B.useState(!1),An=x??On;let sr;e[116]!==R||e[117]!==Yt||e[118]!==Rn?(sr=async Et=>{R&&(tr(!0),await R(Et),tr(!1)),Yt==null||Yt(Et.pagination),Rn==null||Rn(Et.sortation),pn(Et.filteration)},e[116]=R,e[117]=Yt,e[118]=Rn,e[119]=sr):sr=e[119];const hr=sr;let ho;e[120]===Symbol.for("react.memo_cache_sentinel")?(ho=Et=>{var he;(he=Le.current)==null||he.call(Le,Et)},e[120]=ho):ho=e[120];const So=ho;let oo,sl;e[121]!==oe||e[122]!==S||e[123]!==gt||e[124]!==hr||e[125]!==Lt||e[126]!==Ht||e[127]!==hn?(oo=()=>{if(!oe)return;const Et=Ve=>{const _t={entireItems:S,filteration:gt,pagination:Lt,sortation:hn},rn=Ve?Ve(_t):_t;hr(rn)},he=Ve=>{const _t={...Lt,page:1},rn=Ve?Ve(gt):gt;Ht==null||Ht(rn),hr({entireItems:S,filteration:rn,pagination:_t,sortation:hn})};oe.current={fireOnStateChange:Et,applyFilteration:he,scrollToSelected:So}},sl=[oe,hr,S,Ht,gt,Lt,hn,So],e[121]=oe,e[122]=S,e[123]=gt,e[124]=hr,e[125]=Lt,e[126]=Ht,e[127]=hn,e[128]=oo,e[129]=sl):(oo=e[128],sl=e[129]),B.useEffect(oo,sl);let Ki;e[130]!==xt||e[131]!==S||e[132]!==hr||e[133]!==Rt||e[134]!==Lt.page||e[135]!==Lt.pageSize||e[136]!==hn?(Ki=Et=>{Et.page===Lt.page&&Et.pageSize===Lt.pageSize||(Et.page<1?Et.page=1:Et.page>Rt[Rt.length-1]&&(Et.page=Rt[Rt.length-1]),hr({entireItems:S,filteration:xt,pagination:Et,sortation:hn}))},e[130]=xt,e[131]=S,e[132]=hr,e[133]=Rt,e[134]=Lt.page,e[135]=Lt.pageSize,e[136]=hn,e[137]=Ki):Ki=e[137];const Ai=Ki;let Jl;e[138]!==Ht?(Jl=Et=>{Ht&&Ht(Et)},e[138]=Ht,e[139]=Jl):Jl=e[139];const Zo=Jl;let xo;e[140]!==xt||e[141]!==S||e[142]!==hr||e[143]!==Lt?(xo=Et=>{hr({entireItems:S,filteration:xt,pagination:Lt,sortation:Et})},e[140]=xt,e[141]=S,e[142]=hr,e[143]=Lt,e[144]=xo):xo=e[144];const Gr=xo;let cn;e[145]!==Ai||e[146]!==Lt?(cn=Et=>{Ai({...Lt,page:Et})},e[145]=Ai,e[146]=Lt,e[147]=cn):cn=e[147];const Cn=cn;let Pr;e[148]!==Cn||e[149]!==Lt.page?(Pr=()=>{Cn(Lt.page-1)},e[148]=Cn,e[149]=Lt.page,e[150]=Pr):Pr=e[150];const fr=Pr;let ar;e[151]!==Cn||e[152]!==Lt.page?(ar=()=>{Cn(Lt.page+1)},e[151]=Cn,e[152]=Lt.page,e[153]=ar):ar=e[153];const Nr=ar;let Er;e[154]!==Cn?(Er=()=>{Cn(1)},e[154]=Cn,e[155]=Er):Er=e[155];const gi=Er;let Ri;e[156]!==Cn||e[157]!==Rt?(Ri=()=>{Cn(Rt[Rt.length-1])},e[156]=Cn,e[157]=Rt,e[158]=Ri):Ri=e[158];const Dr=Ri;let Bo;e[159]!==Cn||e[160]!==gi||e[161]!==Dr||e[162]!==Nr||e[163]!==fr?(Bo={move:Cn,movePrev:fr,moveNext:Nr,moveFirst:gi,moveLast:Dr},e[159]=Cn,e[160]=gi,e[161]=Dr,e[162]=Nr,e[163]=fr,e[164]=Bo):Bo=e[164];const Eo=Bo;let To;e[165]!==S||e[166]!==gt||e[167]!==hr||e[168]!==Lt||e[169]!==hn?(To=()=>{const Et={...Lt,page:1};hr({entireItems:S,filteration:gt,pagination:Et,sortation:hn})},e[165]=S,e[166]=gt,e[167]=hr,e[168]=Lt,e[169]=hn,e[170]=To):To=e[170];const Ii=To;let Vr;e[171]!==Ye?(Vr=()=>{Tt(!Ye)},e[171]=Ye,e[172]=Vr):Vr=e[172];const xr=Vr;let al;e[173]!==st||e[174]!==Ye||e[175]!==Ht||e[176]!==at||e[177]!==Bt?(al=()=>{Ye&&Bt?at==null||at(j2(Bt)):Ht==null||Ht(j2(st))},e[173]=st,e[174]=Ye,e[175]=Ht,e[176]=at,e[177]=Bt,e[178]=al):al=e[178];const xi=al;let Ji;e[179]!==Ii||e[180]!==xi||e[181]!==xr?(Ji={apply:Ii,toggle:xr,clear:xi},e[179]=Ii,e[180]=xi,e[181]=xr,e[182]=Ji):Ji=e[182];const cl=Ji;let Ao;e[183]!==S||e[184]!==gt||e[185]!==re||e[186]!==hr||e[187]!==Lt||e[188]!==hn?(Ao=()=>{re||hr({entireItems:S,filteration:gt,pagination:Lt,sortation:hn})},e[183]=S,e[184]=gt,e[185]=re,e[186]=hr,e[187]=Lt,e[188]=hn,e[189]=Ao):Ao=e[189],W3(Ao);let Hi;e[190]!==Re?(Hi=$n.map(Re,he=>{const[Ve]=he;return Re[Ve].minWidth??jd}).reduce(Ok,0),e[190]=Re,e[191]=Hi):Hi=e[191];const zo=Hi,Qi=Q!==void 0;let qi;e[192]!==zo?(qi={minWidth:zo},e[192]=zo,e[193]=qi):qi=e[193];let go;e[194]!==ge||e[195]!==me||e[196]!==Jt||e[197]!==Re||e[198]!==cl||e[199]!==Ie||e[200]!==gt||e[201]!==bn||e[202]!==Qi||e[203]!==se||e[204]!==ue||e[205]!==X||e[206]!==Zo||e[207]!==Gr||e[208]!==N||e[209]!==Oe||e[210]!==xn||e[211]!==hn||e[212]!==_||e[213]!==Bt||e[214]!==zt||e[215]!==g?(go=!X&&M.jsx(Ik,{defs:Re,filterF:cl,filterType:Ie,hasToggleFilteration:Bt!==void 0,isFiltered:bn,isRowRendered:Qi,noCount:se,noFilter:ue,placeholder:N,resources:Oe,title:_,TopLeftAddon:ge,TopRightAddon:me,totalCount:zt,useCheck:g&&Jt?[Jt,xn]:void 0,useFilteration:[gt,Zo],useSortation:[hn,Gr]}),e[194]=ge,e[195]=me,e[196]=Jt,e[197]=Re,e[198]=cl,e[199]=Ie,e[200]=gt,e[201]=bn,e[202]=Qi,e[203]=se,e[204]=ue,e[205]=X,e[206]=Zo,e[207]=Gr,e[208]=N,e[209]=Oe,e[210]=xn,e[211]=hn,e[212]=_,e[213]=Bt,e[214]=zt,e[215]=g,e[216]=go):go=e[216];let Jn;e[217]!==Gr||e[218]!==hn?(Jn=[hn,Gr],e[217]=Gr,e[218]=hn,e[219]=Jn):Jn=e[219];let Ro;e[220]===Symbol.for("react.memo_cache_sentinel")?(Ro=Et=>Le.current=Et,e[220]=Ro):Ro=e[220];let ai;e[221]!==Q||e[222]!==xt||e[223]!==pr||e[224]!==w||e[225]!==Te||e[226]!==An||e[227]!==Qi||e[228]!==a||e[229]!==te||e[230]!==$||e[231]!==vt||e[232]!==Lt||e[233]!==o||e[234]!==Oe||e[235]!==Fe||e[236]!==h||e[237]!==fe||e[238]!==Jn||e[239]!==l?(ai=M.jsx(JI,{appliedFilteration:xt,defs:pr,isEqual:Te,isLoading:An,isRowRendered:Qi,isSelectMulti:a,isTableDisabled:w,noDefHeader:te,noMarking:$,pagedItems:vt,pagination:Lt,resources:Oe,rowHeight:Fe,RowRenderer:Q,rProps:o,selectDisabled:h,showRows:fe,useSelect:l,useSortation:Jn,onScrollToSelectedReady:Ro}),e[221]=Q,e[222]=xt,e[223]=pr,e[224]=w,e[225]=Te,e[226]=An,e[227]=Qi,e[228]=a,e[229]=te,e[230]=$,e[231]=vt,e[232]=Lt,e[233]=o,e[234]=Oe,e[235]=Fe,e[236]=h,e[237]=fe,e[238]=Jn,e[239]=l,e[240]=ai):ai=e[240];let Io;e[241]!==ne||e[242]!==Eo||e[243]!==Rt||e[244]!==Lt||e[245]!==on?(Io=!ne&&M.jsx(rk,{pageF:Eo,pages:Rt,pagination:Lt,rangedPages:on}),e[241]=ne,e[242]=Eo,e[243]=Rt,e[244]=Lt,e[245]=on,e[246]=Io):Io=e[246];let Qn;return e[247]!==w||e[248]!==qi||e[249]!==go||e[250]!==ai||e[251]!==Io?(Qn=M.jsxs(zi,{className:II.ATable,isDisabled:w,style:qi,children:[go,ai,Io]}),e[247]=w,e[248]=qi,e[249]=go,e[250]=ai,e[251]=Io,e[252]=Qn):Qn=e[252],Qn},Mk=n=>{const{defKey:e,item:t}=n;if($n.hasKey(t,e)){const r=t[e];return $n.isReactNode(r)?r:null}else return null};function j2(n){const e={...n};for(const t in e)e[t].value=void 0;return e}function Lk(n){return n.stopPropagation()}function Ok(n,e){return n+e}const Pk="_AText_1asz6_1",Dk={AText:Pk},V3=n=>{const e=Gn.c(12),{text:t,styled:r,style:i}=n;let o;if(e[0]!==i||e[1]!==r||e[2]!==t){e:{if(t)if(r)if(i){if(r===!0)if(i==="bold"){let g;e[4]!==t?(g=M.jsx("b",{children:t}),e[4]=t,e[5]=g):g=e[5],o=g;break e}else{let g;e[6]!==i||e[7]!==t?(g=M.jsx("span",{style:i,children:t}),e[6]=i,e[7]=t,e[8]=g):g=e[8],o=g;break e}else if(typeof r=="string"){const g=t.split(r);if(i==="bold"){o=g.map((m,x)=>M.jsxs(B.Fragment,{children:[p0(m),x<g.length-1?M.jsx("b",{children:p0(r)}):""]},x));break e}o=g.map((m,x)=>M.jsxs(B.Fragment,{children:[p0(m),x<g.length-1&&M.jsx("span",{style:i,children:p0(r)})]},x));break e}}else{o=t;break e}else{o=t;break e}else{o="";break e}o=void 0}e[0]=i,e[1]=r,e[2]=t,e[3]=o}else o=e[3];const l=o;let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=dt.clsx("Body1Reading",Dk.AText,"NoSelect"),e[9]=a):a=e[9];let h;return e[10]!==l?(h=M.jsx("div",{className:a,children:l}),e[10]=l,e[11]=h):h=e[11],h};function p0(n){const e=n.split(`
287
- `);return e.map((t,r)=>M.jsxs(B.Fragment,{children:[t,r!==e.length-1&&M.jsx("br",{})]},r))}const Nk="_Base_cpm4t_7",Fk="_ATextArea_cpm4t_11",Bk="_Primary_cpm4t_34",zk="_UnAvailable_cpm4t_39",Hk="_Secondary_cpm4t_47",Wk="_ReadOnly_cpm4t_59",v0={Base:Nk,ATextArea:Fk,Primary:Bk,UnAvailable:zk,Secondary:Hk,ReadOnly:Wk,Error:"_Error_cpm4t_66"},Uk=["Primary","Secondary","ReadOnly","Error"],Gk=n=>{const e=Gn.c(60);let t,r,i,o,l,a,h,g,m,x,w,_,S;if(e[0]!==n){const{onEnterPress:xe,errorMessage:Oe,type:Le,textAreaRef:He,useValue:Te,rows:ke,isReadonly:Be,placeholder:rt,maxLength:Re,tabIndex:ut,autoFocus:qe,textAreaProps:ot,...st}=n;a=xe,r=Oe,_=He,S=Te,g=ke,i=Be,h=rt,l=Re,x=ut,t=qe,w=ot,o=Le===void 0?"Primary":Le,m=Bg(st),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13];const[R,k]=m;let O,P,z,H;e[14]!==R?({wrapId:P,wrapProps:z,labelProps:O,...H}=R,e[14]=R,e[15]=O,e[16]=P,e[17]=z,e[18]=H):(O=e[15],P=e[16],z=e[17],H=e[18]);let G;Yk(r)?G="Error":G=o;const N=G;let J;N==="ReadOnly"?J=!0:J=i;const Y=J,K=k.isDisabled||k.isLoading,[fe,X]=Fo(S,"");let te;e[19]!==X?(te=xe=>{X&&X(xe)},e[19]=X,e[20]=te):te=e[20];const ne=te;let ue;e[21]!==ne||e[22]!==w||e[23]!==K?(ue=xe=>{var Oe;K||(ne(xe.target.value),(Oe=w==null?void 0:w.onChange)==null||Oe.call(w,xe))},e[21]=ne,e[22]=w,e[23]=K,e[24]=ue):ue=e[24];const se=ue;let $;e[25]!==a||e[26]!==w||e[27]!==K?($=xe=>{var Oe;if(!K){if((Oe=w==null?void 0:w.onKeyDown)==null||Oe.call(w,xe),xe.key==="Tab"){const Le=xe.currentTarget.selectionStart,He=xe.currentTarget.selectionEnd;xe.currentTarget.value=xe.currentTarget.value.substring(0,Le)+" "+xe.currentTarget.value.substring(He),xe.currentTarget.selectionStart=xe.currentTarget.selectionEnd=Le+1,xe.preventDefault()}else xe.key==="Enter"&&(a==null||a(xe.currentTarget.value),xe.stopPropagation());xe.key!=="Escape"&&xe.stopPropagation()}},e[25]=a,e[26]=w,e[27]=K,e[28]=$):$=e[28];const re=$;let ge;e[29]!==O||e[30]!==P||e[31]!==z||e[32]!==H?(ge={wrapId:P,wrapProps:z,labelProps:O,...H},e[29]=O,e[30]=P,e[31]=z,e[32]=H,e[33]=ge):ge=e[33];let me;e[34]!==k.className?(me=dt.clsx(v0.Base,k.className),e[34]=k.className,e[35]=me):me=e[35];let oe;e[36]!==(w==null?void 0:w.className)||e[37]!==N||e[38]!==K?(oe=dt.clsx(v0.ATextArea,v0[N],K&&v0.UnAvailable,w==null?void 0:w.className),e[36]=w==null?void 0:w.className,e[37]=N,e[38]=K,e[39]=oe):oe=e[39];const Q=k.isDisabled||k.isLoading?-1:x;let pe;e[40]!==t||e[41]!==Y||e[42]!==l||e[43]!==se||e[44]!==re||e[45]!==h||e[46]!==g||e[47]!==Q||e[48]!==oe||e[49]!==w||e[50]!==_||e[51]!==fe?(pe=M.jsx("textarea",{...w,ref:_,autoFocus:t,className:oe,maxLength:l,placeholder:h,readOnly:Y,rows:g,tabIndex:Q,value:fe,onChange:se,onKeyDown:re}),e[40]=t,e[41]=Y,e[42]=l,e[43]=se,e[44]=re,e[45]=h,e[46]=g,e[47]=Q,e[48]=oe,e[49]=w,e[50]=_,e[51]=fe,e[52]=pe):pe=e[52];let Ie;e[53]!==k||e[54]!==pe||e[55]!==me?(Ie=M.jsx(zi,{...k,className:me,children:pe}),e[53]=k,e[54]=pe,e[55]=me,e[56]=Ie):Ie=e[56];let Fe;return e[57]!==Ie||e[58]!==ge?(Fe=M.jsx(lg,{...ge,children:Ie}),e[57]=Ie,e[58]=ge,e[59]=Fe):Fe=e[59],Fe};function Yk(n){return Array.isArray(n)?n.filter(Boolean).length>0:!!n}/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:Z3,setPrototypeOf:$2,isFrozen:Vk,getPrototypeOf:Zk,getOwnPropertyDescriptor:Xk}=Object;let{freeze:Ou,seal:vh,create:My}=Object,{apply:Ly,construct:Oy}=typeof Reflect<"u"&&Reflect;Ou||(Ou=function(e){return e});vh||(vh=function(e){return e});Ly||(Ly=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});Oy||(Oy=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const b0=Pu(Array.prototype.forEach),Kk=Pu(Array.prototype.lastIndexOf),ex=Pu(Array.prototype.pop),tp=Pu(Array.prototype.push),Jk=Pu(Array.prototype.splice),Y0=Pu(String.prototype.toLowerCase),ab=Pu(String.prototype.toString),cb=Pu(String.prototype.match),np=Pu(String.prototype.replace),Qk=Pu(String.prototype.indexOf),qk=Pu(String.prototype.trim),Ah=Pu(Object.prototype.hasOwnProperty),Mu=Pu(RegExp.prototype.test),rp=jk(TypeError);function Pu(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Ly(n,e,r)}}function jk(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Oy(n,t)}}function Ti(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y0;$2&&$2(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(Vk(e)||(e[r]=o),i=o)}n[i]=!0}return n}function $k(n){for(let e=0;e<n.length;e++)Ah(n,e)||(n[e]=null);return n}function Cd(n){const e=My(null);for(const[t,r]of Z3(n))Ah(n,t)&&(Array.isArray(r)?e[t]=$k(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Cd(r):e[t]=r);return e}function ip(n,e){for(;n!==null;){const r=Xk(n,e);if(r){if(r.get)return Pu(r.get);if(typeof r.value=="function")return Pu(r.value)}n=Zk(n)}function t(){return null}return t}const tx=Ou(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ub=Ou(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fb=Ou(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),e7=Ou(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hb=Ou(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),t7=Ou(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nx=Ou(["#text"]),rx=Ou(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),db=Ou(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ix=Ou(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),y0=Ou(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),n7=vh(/\{\{[\w\W]*|[\w\W]*\}\}/gm),r7=vh(/<%[\w\W]*|[\w\W]*%>/gm),i7=vh(/\$\{[\w\W]*/gm),o7=vh(/^data-[\-\w.\u00B7-\uFFFF]+$/),l7=vh(/^aria-[\-\w]+$/),X3=vh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),s7=vh(/^(?:\w+script|data):/i),a7=vh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K3=vh(/^html$/i),c7=vh(/^[a-z][.\w]*(-[.\w]+)+$/i);var ox=Object.freeze({__proto__:null,ARIA_ATTR:l7,ATTR_WHITESPACE:a7,CUSTOM_ELEMENT:c7,DATA_ATTR:o7,DOCTYPE_NAME:K3,ERB_EXPR:r7,IS_ALLOWED_URI:X3,IS_SCRIPT_OR_DATA:s7,MUSTACHE_EXPR:n7,TMPLIT_EXPR:i7});const op={element:1,text:3,progressingInstruction:7,comment:8,document:9},u7=function(){return typeof window>"u"?null:window},f7=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},lx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function J3(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:u7();const e=Pt=>J3(Pt);if(e.version="3.3.0",e.removed=[],!n||!n.document||n.document.nodeType!==op.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:a,Element:h,NodeFilter:g,NamedNodeMap:m=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:x,DOMParser:w,trustedTypes:_}=n,S=h.prototype,R=ip(S,"cloneNode"),k=ip(S,"remove"),O=ip(S,"nextSibling"),P=ip(S,"childNodes"),z=ip(S,"parentNode");if(typeof l=="function"){const Pt=t.createElement("template");Pt.content&&Pt.content.ownerDocument&&(t=Pt.content.ownerDocument)}let H,G="";const{implementation:N,createNodeIterator:J,createDocumentFragment:Y,getElementsByTagName:K}=t,{importNode:fe}=r;let X=lx();e.isSupported=typeof Z3=="function"&&typeof z=="function"&&N&&N.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:te,ERB_EXPR:ne,TMPLIT_EXPR:ue,DATA_ATTR:se,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:me}=ox;let{IS_ALLOWED_URI:oe}=ox,Q=null;const pe=Ti({},[...tx,...ub,...fb,...hb,...nx]);let Ie=null;const Fe=Ti({},[...rx,...db,...ix,...y0]);let xe=Object.seal(My(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Le=null;const He=Object.seal(My(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,ke=!0,Be=!1,rt=!0,Re=!1,ut=!0,qe=!1,ot=!1,st=!1,bt=!1,Mt=!1,Bt=!1,at=!0,Ye=!1;const Tt="user-content-";let Ut=!0,gt=!1,Ht={},xt=null;const pn=Ti({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $t=null;const sn=Ti({},["audio","video","img","source","image","track"]);let Xt=null;const bn=Ti({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hn="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let We=vn,Ce=!1,it=null;const Ct=Ti({},[hn,Rn,vn],ab);let Qt=Ti({},["mi","mo","mn","ms","mtext"]),Yt=Ti({},["annotation-xml"]);const yn=Ti({},["title","style","font","a","script"]);let gn=null;const lt=["application/xhtml+xml","text/html"],kt="text/html";let vt=null,zt=null;const Lt=t.createElement("form"),yt=function(Se){return Se instanceof RegExp||Se instanceof Function},Rt=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(zt&&zt===Se)){if((!Se||typeof Se!="object")&&(Se={}),Se=Cd(Se),gn=lt.indexOf(Se.PARSER_MEDIA_TYPE)===-1?kt:Se.PARSER_MEDIA_TYPE,vt=gn==="application/xhtml+xml"?ab:Y0,Q=Ah(Se,"ALLOWED_TAGS")?Ti({},Se.ALLOWED_TAGS,vt):pe,Ie=Ah(Se,"ALLOWED_ATTR")?Ti({},Se.ALLOWED_ATTR,vt):Fe,it=Ah(Se,"ALLOWED_NAMESPACES")?Ti({},Se.ALLOWED_NAMESPACES,ab):Ct,Xt=Ah(Se,"ADD_URI_SAFE_ATTR")?Ti(Cd(bn),Se.ADD_URI_SAFE_ATTR,vt):bn,$t=Ah(Se,"ADD_DATA_URI_TAGS")?Ti(Cd(sn),Se.ADD_DATA_URI_TAGS,vt):sn,xt=Ah(Se,"FORBID_CONTENTS")?Ti({},Se.FORBID_CONTENTS,vt):pn,Oe=Ah(Se,"FORBID_TAGS")?Ti({},Se.FORBID_TAGS,vt):Cd({}),Le=Ah(Se,"FORBID_ATTR")?Ti({},Se.FORBID_ATTR,vt):Cd({}),Ht=Ah(Se,"USE_PROFILES")?Se.USE_PROFILES:!1,Te=Se.ALLOW_ARIA_ATTR!==!1,ke=Se.ALLOW_DATA_ATTR!==!1,Be=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,rt=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Re=Se.SAFE_FOR_TEMPLATES||!1,ut=Se.SAFE_FOR_XML!==!1,qe=Se.WHOLE_DOCUMENT||!1,bt=Se.RETURN_DOM||!1,Mt=Se.RETURN_DOM_FRAGMENT||!1,Bt=Se.RETURN_TRUSTED_TYPE||!1,st=Se.FORCE_BODY||!1,at=Se.SANITIZE_DOM!==!1,Ye=Se.SANITIZE_NAMED_PROPS||!1,Ut=Se.KEEP_CONTENT!==!1,gt=Se.IN_PLACE||!1,oe=Se.ALLOWED_URI_REGEXP||X3,We=Se.NAMESPACE||vn,Qt=Se.MATHML_TEXT_INTEGRATION_POINTS||Qt,Yt=Se.HTML_INTEGRATION_POINTS||Yt,xe=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&yt(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&yt(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(ke=!1),Mt&&(bt=!0),Ht&&(Q=Ti({},nx),Ie=[],Ht.html===!0&&(Ti(Q,tx),Ti(Ie,rx)),Ht.svg===!0&&(Ti(Q,ub),Ti(Ie,db),Ti(Ie,y0)),Ht.svgFilters===!0&&(Ti(Q,fb),Ti(Ie,db),Ti(Ie,y0)),Ht.mathMl===!0&&(Ti(Q,hb),Ti(Ie,ix),Ti(Ie,y0))),Se.ADD_TAGS&&(typeof Se.ADD_TAGS=="function"?He.tagCheck=Se.ADD_TAGS:(Q===pe&&(Q=Cd(Q)),Ti(Q,Se.ADD_TAGS,vt))),Se.ADD_ATTR&&(typeof Se.ADD_ATTR=="function"?He.attributeCheck=Se.ADD_ATTR:(Ie===Fe&&(Ie=Cd(Ie)),Ti(Ie,Se.ADD_ATTR,vt))),Se.ADD_URI_SAFE_ATTR&&Ti(Xt,Se.ADD_URI_SAFE_ATTR,vt),Se.FORBID_CONTENTS&&(xt===pn&&(xt=Cd(xt)),Ti(xt,Se.FORBID_CONTENTS,vt)),Ut&&(Q["#text"]=!0),qe&&Ti(Q,["html","head","body"]),Q.table&&(Ti(Q,["tbody"]),delete Oe.tbody),Se.TRUSTED_TYPES_POLICY){if(typeof Se.TRUSTED_TYPES_POLICY.createHTML!="function")throw rp('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Se.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rp('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');H=Se.TRUSTED_TYPES_POLICY,G=H.createHTML("")}else H===void 0&&(H=f7(_,i)),H!==null&&typeof G=="string"&&(G=H.createHTML(""));Ou&&Ou(Se),zt=Se}},on=Ti({},[...ub,...fb,...e7]),En=Ti({},[...hb,...t7]),Jt=function(Se){let tt=z(Se);(!tt||!tt.tagName)&&(tt={namespaceURI:We,tagName:"template"});const At=Y0(Se.tagName),Sn=Y0(tt.tagName);return it[Se.namespaceURI]?Se.namespaceURI===Rn?tt.namespaceURI===vn?At==="svg":tt.namespaceURI===hn?At==="svg"&&(Sn==="annotation-xml"||Qt[Sn]):!!on[At]:Se.namespaceURI===hn?tt.namespaceURI===vn?At==="math":tt.namespaceURI===Rn?At==="math"&&Yt[Sn]:!!En[At]:Se.namespaceURI===vn?tt.namespaceURI===Rn&&!Yt[Sn]||tt.namespaceURI===hn&&!Qt[Sn]?!1:!En[At]&&(yn[At]||!on[At]):!!(gn==="application/xhtml+xml"&&it[Se.namespaceURI]):!1},xn=function(Se){tp(e.removed,{element:Se});try{z(Se).removeChild(Se)}catch{k(Se)}},_n=function(Se,tt){try{tp(e.removed,{attribute:tt.getAttributeNode(Se),from:tt})}catch{tp(e.removed,{attribute:null,from:tt})}if(tt.removeAttribute(Se),Se==="is")if(bt||Mt)try{xn(tt)}catch{}else try{tt.setAttribute(Se,"")}catch{}},zn=function(Se){let tt=null,At=null;if(st)Se="<remove></remove>"+Se;else{const Yn=cb(Se,/^[\r\n\t ]+/);At=Yn&&Yn[0]}gn==="application/xhtml+xml"&&We===vn&&(Se='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Se+"</body></html>");const Sn=H?H.createHTML(Se):Se;if(We===vn)try{tt=new w().parseFromString(Sn,gn)}catch{}if(!tt||!tt.documentElement){tt=N.createDocument(We,"template",null);try{tt.documentElement.innerHTML=Ce?G:Sn}catch{}}const In=tt.body||tt.documentElement;return Se&&At&&In.insertBefore(t.createTextNode(At),In.childNodes[0]||null),We===vn?K.call(tt,qe?"html":"body")[0]:qe?tt.documentElement:In},er=function(Se){return J.call(Se.ownerDocument||Se,Se,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},wn=function(Se){return Se instanceof x&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof m)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},ri=function(Se){return typeof a=="function"&&Se instanceof a};function $e(Pt,Se,tt){b0(Pt,At=>{At.call(e,Se,tt,zt)})}const tn=function(Se){let tt=null;if($e(X.beforeSanitizeElements,Se,null),wn(Se))return xn(Se),!0;const At=vt(Se.nodeName);if($e(X.uponSanitizeElement,Se,{tagName:At,allowedTags:Q}),ut&&Se.hasChildNodes()&&!ri(Se.firstElementChild)&&Mu(/<[/\w!]/g,Se.innerHTML)&&Mu(/<[/\w!]/g,Se.textContent)||Se.nodeType===op.progressingInstruction||ut&&Se.nodeType===op.comment&&Mu(/<[/\w]/g,Se.data))return xn(Se),!0;if(!(He.tagCheck instanceof Function&&He.tagCheck(At))&&(!Q[At]||Oe[At])){if(!Oe[At]&&Nn(At)&&(xe.tagNameCheck instanceof RegExp&&Mu(xe.tagNameCheck,At)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(At)))return!1;if(Ut&&!xt[At]){const Sn=z(Se)||Se.parentNode,In=P(Se)||Se.childNodes;if(In&&Sn){const Yn=In.length;for(let lr=Yn-1;lr>=0;--lr){const pr=R(In[lr],!0);pr.__removalCount=(Se.__removalCount||0)+1,Sn.insertBefore(pr,O(Se))}}}return xn(Se),!0}return Se instanceof h&&!Jt(Se)||(At==="noscript"||At==="noembed"||At==="noframes")&&Mu(/<\/no(script|embed|frames)/i,Se.innerHTML)?(xn(Se),!0):(Re&&Se.nodeType===op.text&&(tt=Se.textContent,b0([te,ne,ue],Sn=>{tt=np(tt,Sn," ")}),Se.textContent!==tt&&(tp(e.removed,{element:Se.cloneNode()}),Se.textContent=tt)),$e(X.afterSanitizeElements,Se,null),!1)},ln=function(Se,tt,At){if(at&&(tt==="id"||tt==="name")&&(At in t||At in Lt))return!1;if(!(ke&&!Le[tt]&&Mu(se,tt))){if(!(Te&&Mu($,tt))){if(!(He.attributeCheck instanceof Function&&He.attributeCheck(tt,Se))){if(!Ie[tt]||Le[tt]){if(!(Nn(Se)&&(xe.tagNameCheck instanceof RegExp&&Mu(xe.tagNameCheck,Se)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Se))&&(xe.attributeNameCheck instanceof RegExp&&Mu(xe.attributeNameCheck,tt)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(tt,Se))||tt==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&Mu(xe.tagNameCheck,At)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(At))))return!1}else if(!Xt[tt]){if(!Mu(oe,np(At,ge,""))){if(!((tt==="src"||tt==="xlink:href"||tt==="href")&&Se!=="script"&&Qk(At,"data:")===0&&$t[Se])){if(!(Be&&!Mu(re,np(At,ge,"")))){if(At)return!1}}}}}}}return!0},Nn=function(Se){return Se!=="annotation-xml"&&cb(Se,me)},yr=function(Se){$e(X.beforeSanitizeAttributes,Se,null);const{attributes:tt}=Se;if(!tt||wn(Se))return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie,forceKeepAttr:void 0};let Sn=tt.length;for(;Sn--;){const In=tt[Sn],{name:Yn,namespaceURI:lr,value:pr}=In,On=vt(Yn),tr=pr;let An=Yn==="value"?tr:qk(tr);if(At.attrName=On,At.attrValue=An,At.keepAttr=!0,At.forceKeepAttr=void 0,$e(X.uponSanitizeAttribute,Se,At),An=At.attrValue,Ye&&(On==="id"||On==="name")&&(_n(Yn,Se),An=Tt+An),ut&&Mu(/((--!?|])>)|<\/(style|title|textarea)/i,An)){_n(Yn,Se);continue}if(On==="attributename"&&cb(An,"href")){_n(Yn,Se);continue}if(At.forceKeepAttr)continue;if(!At.keepAttr){_n(Yn,Se);continue}if(!rt&&Mu(/\/>/i,An)){_n(Yn,Se);continue}Re&&b0([te,ne,ue],hr=>{An=np(An,hr," ")});const sr=vt(Se.nodeName);if(!ln(sr,On,An)){_n(Yn,Se);continue}if(H&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!lr)switch(_.getAttributeType(sr,On)){case"TrustedHTML":{An=H.createHTML(An);break}case"TrustedScriptURL":{An=H.createScriptURL(An);break}}if(An!==tr)try{lr?Se.setAttributeNS(lr,Yn,An):Se.setAttribute(Yn,An),wn(Se)?xn(Se):ex(e.removed)}catch{_n(Yn,Se)}}$e(X.afterSanitizeAttributes,Se,null)},Ln=function Pt(Se){let tt=null;const At=er(Se);for($e(X.beforeSanitizeShadowDOM,Se,null);tt=At.nextNode();)$e(X.uponSanitizeShadowNode,tt,null),tn(tt),yr(tt),tt.content instanceof o&&Pt(tt.content);$e(X.afterSanitizeShadowDOM,Se,null)};return e.sanitize=function(Pt){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=null,At=null,Sn=null,In=null;if(Ce=!Pt,Ce&&(Pt="<!-->"),typeof Pt!="string"&&!ri(Pt))if(typeof Pt.toString=="function"){if(Pt=Pt.toString(),typeof Pt!="string")throw rp("dirty is not a string, aborting")}else throw rp("toString is not a function");if(!e.isSupported)return Pt;if(ot||Rt(Se),e.removed=[],typeof Pt=="string"&&(gt=!1),gt){if(Pt.nodeName){const pr=vt(Pt.nodeName);if(!Q[pr]||Oe[pr])throw rp("root node is forbidden and cannot be sanitized in-place")}}else if(Pt instanceof a)tt=zn("<!---->"),At=tt.ownerDocument.importNode(Pt,!0),At.nodeType===op.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?tt=At:tt.appendChild(At);else{if(!bt&&!Re&&!qe&&Pt.indexOf("<")===-1)return H&&Bt?H.createHTML(Pt):Pt;if(tt=zn(Pt),!tt)return bt?null:Bt?G:""}tt&&st&&xn(tt.firstChild);const Yn=er(gt?Pt:tt);for(;Sn=Yn.nextNode();)tn(Sn),yr(Sn),Sn.content instanceof o&&Ln(Sn.content);if(gt)return Pt;if(bt){if(Mt)for(In=Y.call(tt.ownerDocument);tt.firstChild;)In.appendChild(tt.firstChild);else In=tt;return(Ie.shadowroot||Ie.shadowrootmode)&&(In=fe.call(r,In,!0)),In}let lr=qe?tt.outerHTML:tt.innerHTML;return qe&&Q["!doctype"]&&tt.ownerDocument&&tt.ownerDocument.doctype&&tt.ownerDocument.doctype.name&&Mu(K3,tt.ownerDocument.doctype.name)&&(lr="<!DOCTYPE "+tt.ownerDocument.doctype.name+`>
288
- `+lr),Re&&b0([te,ne,ue],pr=>{lr=np(lr,pr," ")}),H&&Bt?H.createHTML(lr):lr},e.setConfig=function(){let Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rt(Pt),ot=!0},e.clearConfig=function(){zt=null,ot=!1},e.isValidAttribute=function(Pt,Se,tt){zt||Rt({});const At=vt(Pt),Sn=vt(Se);return ln(At,Sn,tt)},e.addHook=function(Pt,Se){typeof Se=="function"&&tp(X[Pt],Se)},e.removeHook=function(Pt,Se){if(Se!==void 0){const tt=Kk(X[Pt],Se);return tt===-1?void 0:Jk(X[Pt],tt,1)[0]}return ex(X[Pt])},e.removeHooks=function(Pt){X[Pt]=[]},e.removeAllHooks=function(){X=lx()},e}var h7=J3(),m0={exports:{}},gb,sx;function d7(){if(sx)return gb;sx=1;var n=-1,e=1,t=0;function r(X,te,ne,ue,se){if(X===te)return X?[[t,X]]:[];if(ne!=null){var $=K(X,te,ne);if($)return $}var re=a(X,te),ge=X.substring(0,re);X=X.substring(re),te=te.substring(re),re=g(X,te);var me=X.substring(X.length-re);X=X.substring(0,X.length-re),te=te.substring(0,te.length-re);var oe=i(X,te);return ge&&oe.unshift([t,ge]),me&&oe.push([t,me]),P(oe,se),ue&&x(oe),oe}function i(X,te){var ne;if(!X)return[[e,te]];if(!te)return[[n,X]];var ue=X.length>te.length?X:te,se=X.length>te.length?te:X,$=ue.indexOf(se);if($!==-1)return ne=[[e,ue.substring(0,$)],[t,se],[e,ue.substring($+se.length)]],X.length>te.length&&(ne[0][0]=ne[2][0]=n),ne;if(se.length===1)return[[n,X],[e,te]];var re=m(X,te);if(re){var ge=re[0],me=re[1],oe=re[2],Q=re[3],pe=re[4],Ie=r(ge,oe),Fe=r(me,Q);return Ie.concat([[t,pe]],Fe)}return o(X,te)}function o(X,te){for(var ne=X.length,ue=te.length,se=Math.ceil((ne+ue)/2),$=se,re=2*se,ge=new Array(re),me=new Array(re),oe=0;oe<re;oe++)ge[oe]=-1,me[oe]=-1;ge[$+1]=0,me[$+1]=0;for(var Q=ne-ue,pe=Q%2!==0,Ie=0,Fe=0,xe=0,Oe=0,Le=0;Le<se;Le++){for(var He=-Le+Ie;He<=Le-Fe;He+=2){var Te=$+He,ke;He===-Le||He!==Le&&ge[Te-1]<ge[Te+1]?ke=ge[Te+1]:ke=ge[Te-1]+1;for(var Be=ke-He;ke<ne&&Be<ue&&X.charAt(ke)===te.charAt(Be);)ke++,Be++;if(ge[Te]=ke,ke>ne)Fe+=2;else if(Be>ue)Ie+=2;else if(pe){var rt=$+Q-He;if(rt>=0&&rt<re&&me[rt]!==-1){var Re=ne-me[rt];if(ke>=Re)return l(X,te,ke,Be)}}}for(var ut=-Le+xe;ut<=Le-Oe;ut+=2){var rt=$+ut,Re;ut===-Le||ut!==Le&&me[rt-1]<me[rt+1]?Re=me[rt+1]:Re=me[rt-1]+1;for(var qe=Re-ut;Re<ne&&qe<ue&&X.charAt(ne-Re-1)===te.charAt(ue-qe-1);)Re++,qe++;if(me[rt]=Re,Re>ne)Oe+=2;else if(qe>ue)xe+=2;else if(!pe){var Te=$+Q-ut;if(Te>=0&&Te<re&&ge[Te]!==-1){var ke=ge[Te],Be=$+ke-Te;if(Re=ne-Re,ke>=Re)return l(X,te,ke,Be)}}}}return[[n,X],[e,te]]}function l(X,te,ne,ue){var se=X.substring(0,ne),$=te.substring(0,ue),re=X.substring(ne),ge=te.substring(ue),me=r(se,$),oe=r(re,ge);return me.concat(oe)}function a(X,te){if(!X||!te||X.charAt(0)!==te.charAt(0))return 0;for(var ne=0,ue=Math.min(X.length,te.length),se=ue,$=0;ne<se;)X.substring($,se)==te.substring($,se)?(ne=se,$=ne):ue=se,se=Math.floor((ue-ne)/2+ne);return z(X.charCodeAt(se-1))&&se--,se}function h(X,te){var ne=X.length,ue=te.length;if(ne==0||ue==0)return 0;ne>ue?X=X.substring(ne-ue):ne<ue&&(te=te.substring(0,ne));var se=Math.min(ne,ue);if(X==te)return se;for(var $=0,re=1;;){var ge=X.substring(se-re),me=te.indexOf(ge);if(me==-1)return $;re+=me,(me==0||X.substring(se-re)==te.substring(0,re))&&($=re,re++)}}function g(X,te){if(!X||!te||X.slice(-1)!==te.slice(-1))return 0;for(var ne=0,ue=Math.min(X.length,te.length),se=ue,$=0;ne<se;)X.substring(X.length-se,X.length-$)==te.substring(te.length-se,te.length-$)?(ne=se,$=ne):ue=se,se=Math.floor((ue-ne)/2+ne);return H(X.charCodeAt(X.length-se))&&se--,se}function m(X,te){var ne=X.length>te.length?X:te,ue=X.length>te.length?te:X;if(ne.length<4||ue.length*2<ne.length)return null;function se(Fe,xe,Oe){for(var Le=Fe.substring(Oe,Oe+Math.floor(Fe.length/4)),He=-1,Te="",ke,Be,rt,Re;(He=xe.indexOf(Le,He+1))!==-1;){var ut=a(Fe.substring(Oe),xe.substring(He)),qe=g(Fe.substring(0,Oe),xe.substring(0,He));Te.length<qe+ut&&(Te=xe.substring(He-qe,He)+xe.substring(He,He+ut),ke=Fe.substring(0,Oe-qe),Be=Fe.substring(Oe+ut),rt=xe.substring(0,He-qe),Re=xe.substring(He+ut))}return Te.length*2>=Fe.length?[ke,Be,rt,Re,Te]:null}var $=se(ne,ue,Math.ceil(ne.length/4)),re=se(ne,ue,Math.ceil(ne.length/2)),ge;if(!$&&!re)return null;re?$?ge=$[4].length>re[4].length?$:re:ge=re:ge=$;var me,oe,Q,pe;X.length>te.length?(me=ge[0],oe=ge[1],Q=ge[2],pe=ge[3]):(Q=ge[0],pe=ge[1],me=ge[2],oe=ge[3]);var Ie=ge[4];return[me,oe,Q,pe,Ie]}function x(X){for(var te=!1,ne=[],ue=0,se=null,$=0,re=0,ge=0,me=0,oe=0;$<X.length;)X[$][0]==t?(ne[ue++]=$,re=me,ge=oe,me=0,oe=0,se=X[$][1]):(X[$][0]==e?me+=X[$][1].length:oe+=X[$][1].length,se&&se.length<=Math.max(re,ge)&&se.length<=Math.max(me,oe)&&(X.splice(ne[ue-1],0,[n,se]),X[ne[ue-1]+1][0]=e,ue--,ue--,$=ue>0?ne[ue-1]:-1,re=0,ge=0,me=0,oe=0,se=null,te=!0)),$++;for(te&&P(X),O(X),$=1;$<X.length;){if(X[$-1][0]==n&&X[$][0]==e){var Q=X[$-1][1],pe=X[$][1],Ie=h(Q,pe),Fe=h(pe,Q);Ie>=Fe?(Ie>=Q.length/2||Ie>=pe.length/2)&&(X.splice($,0,[t,pe.substring(0,Ie)]),X[$-1][1]=Q.substring(0,Q.length-Ie),X[$+1][1]=pe.substring(Ie),$++):(Fe>=Q.length/2||Fe>=pe.length/2)&&(X.splice($,0,[t,Q.substring(0,Fe)]),X[$-1][0]=e,X[$-1][1]=pe.substring(0,pe.length-Fe),X[$+1][0]=n,X[$+1][1]=Q.substring(Fe),$++),$++}$++}}var w=/[^a-zA-Z0-9]/,_=/\s/,S=/[\r\n]/,R=/\n\r?\n$/,k=/^\r?\n\r?\n/;function O(X){function te(Fe,xe){if(!Fe||!xe)return 6;var Oe=Fe.charAt(Fe.length-1),Le=xe.charAt(0),He=Oe.match(w),Te=Le.match(w),ke=He&&Oe.match(_),Be=Te&&Le.match(_),rt=ke&&Oe.match(S),Re=Be&&Le.match(S),ut=rt&&Fe.match(R),qe=Re&&xe.match(k);return ut||qe?5:rt||Re?4:He&&!ke&&Be?3:ke||Be?2:He||Te?1:0}for(var ne=1;ne<X.length-1;){if(X[ne-1][0]==t&&X[ne+1][0]==t){var ue=X[ne-1][1],se=X[ne][1],$=X[ne+1][1],re=g(ue,se);if(re){var ge=se.substring(se.length-re);ue=ue.substring(0,ue.length-re),se=ge+se.substring(0,se.length-re),$=ge+$}for(var me=ue,oe=se,Q=$,pe=te(ue,se)+te(se,$);se.charAt(0)===$.charAt(0);){ue+=se.charAt(0),se=se.substring(1)+$.charAt(0),$=$.substring(1);var Ie=te(ue,se)+te(se,$);Ie>=pe&&(pe=Ie,me=ue,oe=se,Q=$)}X[ne-1][1]!=me&&(me?X[ne-1][1]=me:(X.splice(ne-1,1),ne--),X[ne][1]=oe,Q?X[ne+1][1]=Q:(X.splice(ne+1,1),ne--))}ne++}}function P(X,te){X.push([t,""]);for(var ne=0,ue=0,se=0,$="",re="",ge;ne<X.length;){if(ne<X.length-1&&!X[ne][1]){X.splice(ne,1);continue}switch(X[ne][0]){case e:se++,re+=X[ne][1],ne++;break;case n:ue++,$+=X[ne][1],ne++;break;case t:var me=ne-se-ue-1;if(te){if(me>=0&&N(X[me][1])){var oe=X[me][1].slice(-1);if(X[me][1]=X[me][1].slice(0,-1),$=oe+$,re=oe+re,!X[me][1]){X.splice(me,1),ne--;var Q=me-1;X[Q]&&X[Q][0]===e&&(se++,re=X[Q][1]+re,Q--),X[Q]&&X[Q][0]===n&&(ue++,$=X[Q][1]+$,Q--),me=Q}}if(G(X[ne][1])){var oe=X[ne][1].charAt(0);X[ne][1]=X[ne][1].slice(1),$+=oe,re+=oe}}if(ne<X.length-1&&!X[ne][1]){X.splice(ne,1);break}if($.length>0||re.length>0){$.length>0&&re.length>0&&(ge=a(re,$),ge!==0&&(me>=0?X[me][1]+=re.substring(0,ge):(X.splice(0,0,[t,re.substring(0,ge)]),ne++),re=re.substring(ge),$=$.substring(ge)),ge=g(re,$),ge!==0&&(X[ne][1]=re.substring(re.length-ge)+X[ne][1],re=re.substring(0,re.length-ge),$=$.substring(0,$.length-ge)));var pe=se+ue;$.length===0&&re.length===0?(X.splice(ne-pe,pe),ne=ne-pe):$.length===0?(X.splice(ne-pe,pe,[e,re]),ne=ne-pe+1):re.length===0?(X.splice(ne-pe,pe,[n,$]),ne=ne-pe+1):(X.splice(ne-pe,pe,[n,$],[e,re]),ne=ne-pe+2)}ne!==0&&X[ne-1][0]===t?(X[ne-1][1]+=X[ne][1],X.splice(ne,1)):ne++,se=0,ue=0,$="",re="";break}}X[X.length-1][1]===""&&X.pop();var Ie=!1;for(ne=1;ne<X.length-1;)X[ne-1][0]===t&&X[ne+1][0]===t&&(X[ne][1].substring(X[ne][1].length-X[ne-1][1].length)===X[ne-1][1]?(X[ne][1]=X[ne-1][1]+X[ne][1].substring(0,X[ne][1].length-X[ne-1][1].length),X[ne+1][1]=X[ne-1][1]+X[ne+1][1],X.splice(ne-1,1),Ie=!0):X[ne][1].substring(0,X[ne+1][1].length)==X[ne+1][1]&&(X[ne-1][1]+=X[ne+1][1],X[ne][1]=X[ne][1].substring(X[ne+1][1].length)+X[ne+1][1],X.splice(ne+1,1),Ie=!0)),ne++;Ie&&P(X,te)}function z(X){return X>=55296&&X<=56319}function H(X){return X>=56320&&X<=57343}function G(X){return H(X.charCodeAt(0))}function N(X){return z(X.charCodeAt(X.length-1))}function J(X){for(var te=[],ne=0;ne<X.length;ne++)X[ne][1].length>0&&te.push(X[ne]);return te}function Y(X,te,ne,ue){return N(X)||G(ue)?null:J([[t,X],[n,te],[e,ne],[t,ue]])}function K(X,te,ne){var ue=typeof ne=="number"?{index:ne,length:0}:ne.oldRange,se=typeof ne=="number"?null:ne.newRange,$=X.length,re=te.length;if(ue.length===0&&(se===null||se.length===0)){var ge=ue.index,me=X.slice(0,ge),oe=X.slice(ge),Q=se?se.index:null;e:{var pe=ge+re-$;if(Q!==null&&Q!==pe||pe<0||pe>re)break e;var Ie=te.slice(0,pe),Fe=te.slice(pe);if(Fe!==oe)break e;var xe=Math.min(ge,pe),Oe=me.slice(0,xe),Le=Ie.slice(0,xe);if(Oe!==Le)break e;var He=me.slice(xe),Te=Ie.slice(xe);return Y(Oe,He,Te,oe)}e:{if(Q!==null&&Q!==ge)break e;var ke=ge,Ie=te.slice(0,ke),Fe=te.slice(ke);if(Ie!==me)break e;var Be=Math.min($-ke,re-ke),rt=oe.slice(oe.length-Be),Re=Fe.slice(Fe.length-Be);if(rt!==Re)break e;var He=oe.slice(0,oe.length-Be),Te=Fe.slice(0,Fe.length-Be);return Y(me,He,Te,rt)}}if(ue.length>0&&se&&se.length===0)e:{var Oe=X.slice(0,ue.index),rt=X.slice(ue.index+ue.length),xe=Oe.length,Be=rt.length;if(re<xe+Be)break e;var Le=te.slice(0,xe),Re=te.slice(re-Be);if(Oe!==Le||rt!==Re)break e;var He=X.slice(xe,$-Be),Te=te.slice(xe,re-Be);return Y(Oe,He,Te,rt)}return null}function fe(X,te,ne,ue){return r(X,te,ne,ue,!0)}return fe.INSERT=e,fe.DELETE=n,fe.EQUAL=t,gb=fe,gb}var vp={exports:{}};vp.exports;var ax;function Q3(){return ax||(ax=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",l="[object Array]",a="[object Boolean]",h="[object Date]",g="[object Error]",m="[object Function]",x="[object GeneratorFunction]",w="[object Map]",_="[object Number]",S="[object Object]",R="[object Promise]",k="[object RegExp]",O="[object Set]",P="[object String]",z="[object Symbol]",H="[object WeakMap]",G="[object ArrayBuffer]",N="[object DataView]",J="[object Float32Array]",Y="[object Float64Array]",K="[object Int8Array]",fe="[object Int16Array]",X="[object Int32Array]",te="[object Uint8Array]",ne="[object Uint8ClampedArray]",ue="[object Uint16Array]",se="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,re=/\w*$/,ge=/^\[object .+?Constructor\]$/,me=/^(?:0|[1-9]\d*)$/,oe={};oe[o]=oe[l]=oe[G]=oe[N]=oe[a]=oe[h]=oe[J]=oe[Y]=oe[K]=oe[fe]=oe[X]=oe[w]=oe[_]=oe[S]=oe[k]=oe[O]=oe[P]=oe[z]=oe[te]=oe[ne]=oe[ue]=oe[se]=!0,oe[g]=oe[m]=oe[H]=!1;var Q=typeof jh=="object"&&jh&&jh.Object===Object&&jh,pe=typeof self=="object"&&self&&self.Object===Object&&self,Ie=Q||pe||Function("return this")(),Fe=e&&!e.nodeType&&e,xe=Fe&&!0&&n&&!n.nodeType&&n,Oe=xe&&xe.exports===Fe;function Le(he,Ve){return he.set(Ve[0],Ve[1]),he}function He(he,Ve){return he.add(Ve),he}function Te(he,Ve){for(var _t=-1,rn=he?he.length:0;++_t<rn&&Ve(he[_t],_t,he)!==!1;);return he}function ke(he,Ve){for(var _t=-1,rn=Ve.length,pi=he.length;++_t<rn;)he[pi+_t]=Ve[_t];return he}function Be(he,Ve,_t,rn){for(var pi=-1,lo=he?he.length:0;++pi<lo;)_t=Ve(_t,he[pi],pi,he);return _t}function rt(he,Ve){for(var _t=-1,rn=Array(he);++_t<he;)rn[_t]=Ve(_t);return rn}function Re(he,Ve){return he==null?void 0:he[Ve]}function ut(he){var Ve=!1;if(he!=null&&typeof he.toString!="function")try{Ve=!!(he+"")}catch{}return Ve}function qe(he){var Ve=-1,_t=Array(he.size);return he.forEach(function(rn,pi){_t[++Ve]=[pi,rn]}),_t}function ot(he,Ve){return function(_t){return he(Ve(_t))}}function st(he){var Ve=-1,_t=Array(he.size);return he.forEach(function(rn){_t[++Ve]=rn}),_t}var bt=Array.prototype,Mt=Function.prototype,Bt=Object.prototype,at=Ie["__core-js_shared__"],Ye=(function(){var he=/[^.]+$/.exec(at&&at.keys&&at.keys.IE_PROTO||"");return he?"Symbol(src)_1."+he:""})(),Tt=Mt.toString,Ut=Bt.hasOwnProperty,gt=Bt.toString,Ht=RegExp("^"+Tt.call(Ut).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xt=Oe?Ie.Buffer:void 0,pn=Ie.Symbol,$t=Ie.Uint8Array,sn=ot(Object.getPrototypeOf,Object),Xt=Object.create,bn=Bt.propertyIsEnumerable,hn=bt.splice,Rn=Object.getOwnPropertySymbols,vn=xt?xt.isBuffer:void 0,We=ot(Object.keys,Object),Ce=gi(Ie,"DataView"),it=gi(Ie,"Map"),Ct=gi(Ie,"Promise"),Qt=gi(Ie,"Set"),Yt=gi(Ie,"WeakMap"),yn=gi(Object,"create"),gn=xi(Ce),lt=xi(it),kt=xi(Ct),vt=xi(Qt),zt=xi(Yt),Lt=pn?pn.prototype:void 0,yt=Lt?Lt.valueOf:void 0;function Rt(he){var Ve=-1,_t=he?he.length:0;for(this.clear();++Ve<_t;){var rn=he[Ve];this.set(rn[0],rn[1])}}function on(){this.__data__=yn?yn(null):{}}function En(he){return this.has(he)&&delete this.__data__[he]}function Jt(he){var Ve=this.__data__;if(yn){var _t=Ve[he];return _t===r?void 0:_t}return Ut.call(Ve,he)?Ve[he]:void 0}function xn(he){var Ve=this.__data__;return yn?Ve[he]!==void 0:Ut.call(Ve,he)}function _n(he,Ve){var _t=this.__data__;return _t[he]=yn&&Ve===void 0?r:Ve,this}Rt.prototype.clear=on,Rt.prototype.delete=En,Rt.prototype.get=Jt,Rt.prototype.has=xn,Rt.prototype.set=_n;function zn(he){var Ve=-1,_t=he?he.length:0;for(this.clear();++Ve<_t;){var rn=he[Ve];this.set(rn[0],rn[1])}}function er(){this.__data__=[]}function wn(he){var Ve=this.__data__,_t=tr(Ve,he);if(_t<0)return!1;var rn=Ve.length-1;return _t==rn?Ve.pop():hn.call(Ve,_t,1),!0}function ri(he){var Ve=this.__data__,_t=tr(Ve,he);return _t<0?void 0:Ve[_t][1]}function $e(he){return tr(this.__data__,he)>-1}function tn(he,Ve){var _t=this.__data__,rn=tr(_t,he);return rn<0?_t.push([he,Ve]):_t[rn][1]=Ve,this}zn.prototype.clear=er,zn.prototype.delete=wn,zn.prototype.get=ri,zn.prototype.has=$e,zn.prototype.set=tn;function ln(he){var Ve=-1,_t=he?he.length:0;for(this.clear();++Ve<_t;){var rn=he[Ve];this.set(rn[0],rn[1])}}function Nn(){this.__data__={hash:new Rt,map:new(it||zn),string:new Rt}}function yr(he){return Er(this,he).delete(he)}function Ln(he){return Er(this,he).get(he)}function Pt(he){return Er(this,he).has(he)}function Se(he,Ve){return Er(this,he).set(he,Ve),this}ln.prototype.clear=Nn,ln.prototype.delete=yr,ln.prototype.get=Ln,ln.prototype.has=Pt,ln.prototype.set=Se;function tt(he){this.__data__=new zn(he)}function At(){this.__data__=new zn}function Sn(he){return this.__data__.delete(he)}function In(he){return this.__data__.get(he)}function Yn(he){return this.__data__.has(he)}function lr(he,Ve){var _t=this.__data__;if(_t instanceof zn){var rn=_t.__data__;if(!it||rn.length<t-1)return rn.push([he,Ve]),this;_t=this.__data__=new ln(rn)}return _t.set(he,Ve),this}tt.prototype.clear=At,tt.prototype.delete=Sn,tt.prototype.get=In,tt.prototype.has=Yn,tt.prototype.set=lr;function pr(he,Ve){var _t=Hi(he)||Ao(he)?rt(he.length,String):[],rn=_t.length,pi=!!rn;for(var lo in he)Ut.call(he,lo)&&!(pi&&(lo=="length"||Ii(lo,rn)))&&_t.push(lo);return _t}function On(he,Ve,_t){var rn=he[Ve];(!(Ut.call(he,Ve)&&cl(rn,_t))||_t===void 0&&!(Ve in he))&&(he[Ve]=_t)}function tr(he,Ve){for(var _t=he.length;_t--;)if(cl(he[_t][0],Ve))return _t;return-1}function An(he,Ve){return he&&fr(Ve,Io(Ve),he)}function sr(he,Ve,_t,rn,pi,lo,ul){var po;if(rn&&(po=lo?rn(he,pi,lo,ul):rn(he)),po!==void 0)return po;if(!Ro(he))return he;var Wi=Hi(he);if(Wi){if(po=Bo(he),!Ve)return Pr(he,po)}else{var so=Dr(he),Ll=so==m||so==x;if(qi(he))return Ki(he,Ve);if(so==S||so==o||Ll&&!lo){if(ut(he))return lo?he:{};if(po=Eo(Ll?{}:he),!Ve)return ar(he,An(po,he))}else{if(!oe[so])return lo?he:{};po=To(he,so,sr,Ve)}}ul||(ul=new tt);var Ql=ul.get(he);if(Ql)return Ql;if(ul.set(he,po),!Wi)var sc=_t?Nr(he):Io(he);return Te(sc||he,function(fl,za){sc&&(za=fl,fl=he[za]),On(po,za,sr(fl,Ve,_t,rn,za,he,ul))}),po}function hr(he){return Ro(he)?Xt(he):{}}function ho(he,Ve,_t){var rn=Ve(he);return Hi(he)?rn:ke(rn,_t(he))}function So(he){return gt.call(he)}function oo(he){if(!Ro(he)||xr(he))return!1;var Ve=go(he)||ut(he)?Ht:ge;return Ve.test(xi(he))}function sl(he){if(!al(he))return We(he);var Ve=[];for(var _t in Object(he))Ut.call(he,_t)&&_t!="constructor"&&Ve.push(_t);return Ve}function Ki(he,Ve){if(Ve)return he.slice();var _t=new he.constructor(he.length);return he.copy(_t),_t}function Ai(he){var Ve=new he.constructor(he.byteLength);return new $t(Ve).set(new $t(he)),Ve}function Jl(he,Ve){var _t=Ve?Ai(he.buffer):he.buffer;return new he.constructor(_t,he.byteOffset,he.byteLength)}function Zo(he,Ve,_t){var rn=Ve?_t(qe(he),!0):qe(he);return Be(rn,Le,new he.constructor)}function xo(he){var Ve=new he.constructor(he.source,re.exec(he));return Ve.lastIndex=he.lastIndex,Ve}function Gr(he,Ve,_t){var rn=Ve?_t(st(he),!0):st(he);return Be(rn,He,new he.constructor)}function cn(he){return yt?Object(yt.call(he)):{}}function Cn(he,Ve){var _t=Ve?Ai(he.buffer):he.buffer;return new he.constructor(_t,he.byteOffset,he.length)}function Pr(he,Ve){var _t=-1,rn=he.length;for(Ve||(Ve=Array(rn));++_t<rn;)Ve[_t]=he[_t];return Ve}function fr(he,Ve,_t,rn){_t||(_t={});for(var pi=-1,lo=Ve.length;++pi<lo;){var ul=Ve[pi],po=void 0;On(_t,ul,po===void 0?he[ul]:po)}return _t}function ar(he,Ve){return fr(he,Ri(he),Ve)}function Nr(he){return ho(he,Io,Ri)}function Er(he,Ve){var _t=he.__data__;return Vr(Ve)?_t[typeof Ve=="string"?"string":"hash"]:_t.map}function gi(he,Ve){var _t=Re(he,Ve);return oo(_t)?_t:void 0}var Ri=Rn?ot(Rn,Object):Qn,Dr=So;(Ce&&Dr(new Ce(new ArrayBuffer(1)))!=N||it&&Dr(new it)!=w||Ct&&Dr(Ct.resolve())!=R||Qt&&Dr(new Qt)!=O||Yt&&Dr(new Yt)!=H)&&(Dr=function(he){var Ve=gt.call(he),_t=Ve==S?he.constructor:void 0,rn=_t?xi(_t):void 0;if(rn)switch(rn){case gn:return N;case lt:return w;case kt:return R;case vt:return O;case zt:return H}return Ve});function Bo(he){var Ve=he.length,_t=he.constructor(Ve);return Ve&&typeof he[0]=="string"&&Ut.call(he,"index")&&(_t.index=he.index,_t.input=he.input),_t}function Eo(he){return typeof he.constructor=="function"&&!al(he)?hr(sn(he)):{}}function To(he,Ve,_t,rn){var pi=he.constructor;switch(Ve){case G:return Ai(he);case a:case h:return new pi(+he);case N:return Jl(he,rn);case J:case Y:case K:case fe:case X:case te:case ne:case ue:case se:return Cn(he,rn);case w:return Zo(he,rn,_t);case _:case P:return new pi(he);case k:return xo(he);case O:return Gr(he,rn,_t);case z:return cn(he)}}function Ii(he,Ve){return Ve=Ve??i,!!Ve&&(typeof he=="number"||me.test(he))&&he>-1&&he%1==0&&he<Ve}function Vr(he){var Ve=typeof he;return Ve=="string"||Ve=="number"||Ve=="symbol"||Ve=="boolean"?he!=="__proto__":he===null}function xr(he){return!!Ye&&Ye in he}function al(he){var Ve=he&&he.constructor,_t=typeof Ve=="function"&&Ve.prototype||Bt;return he===_t}function xi(he){if(he!=null){try{return Tt.call(he)}catch{}try{return he+""}catch{}}return""}function Ji(he){return sr(he,!0,!0)}function cl(he,Ve){return he===Ve||he!==he&&Ve!==Ve}function Ao(he){return Qi(he)&&Ut.call(he,"callee")&&(!bn.call(he,"callee")||gt.call(he)==o)}var Hi=Array.isArray;function zo(he){return he!=null&&Jn(he.length)&&!go(he)}function Qi(he){return ai(he)&&zo(he)}var qi=vn||Et;function go(he){var Ve=Ro(he)?gt.call(he):"";return Ve==m||Ve==x}function Jn(he){return typeof he=="number"&&he>-1&&he%1==0&&he<=i}function Ro(he){var Ve=typeof he;return!!he&&(Ve=="object"||Ve=="function")}function ai(he){return!!he&&typeof he=="object"}function Io(he){return zo(he)?pr(he):sl(he)}function Qn(){return[]}function Et(){return!1}n.exports=Ji})(vp,vp.exports)),vp.exports}var pb,cx;function q3(){return cx||(cx=1,pb=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(i=r;i--!==0;)if(!n(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){var l=o[i];if(!n(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}),pb}var x0={},ux;function g7(){if(ux)return x0;ux=1,Object.defineProperty(x0,"__esModule",{value:!0});const n=Q3(),e=q3();var t;return(function(r){function i(h={},g={},m=!1){typeof h!="object"&&(h={}),typeof g!="object"&&(g={});let x=n(g);m||(x=Object.keys(x).reduce((w,_)=>(x[_]!=null&&(w[_]=x[_]),w),{}));for(const w in h)h[w]!==void 0&&g[w]===void 0&&(x[w]=h[w]);return Object.keys(x).length>0?x:void 0}r.compose=i;function o(h={},g={}){typeof h!="object"&&(h={}),typeof g!="object"&&(g={});const m=Object.keys(h).concat(Object.keys(g)).reduce((x,w)=>(e(h[w],g[w])||(x[w]=g[w]===void 0?null:g[w]),x),{});return Object.keys(m).length>0?m:void 0}r.diff=o;function l(h={},g={}){h=h||{};const m=Object.keys(g).reduce((x,w)=>(g[w]!==h[w]&&h[w]!==void 0&&(x[w]=g[w]),x),{});return Object.keys(h).reduce((x,w)=>(h[w]!==g[w]&&g[w]===void 0&&(x[w]=null),x),m)}r.invert=l;function a(h,g,m=!1){if(typeof h!="object")return g;if(typeof g!="object")return;if(!m)return g;const x=Object.keys(g).reduce((w,_)=>(h[_]===void 0&&(w[_]=g[_]),w),{});return Object.keys(x).length>0?x:void 0}r.transform=a})(t||(t={})),x0.default=t,x0}var w0={},fx;function j3(){if(fx)return w0;fx=1,Object.defineProperty(w0,"__esModule",{value:!0});var n;return(function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t})(n||(n={})),w0.default=n,w0}var C0={},hx;function p7(){if(hx)return C0;hx=1,Object.defineProperty(C0,"__esModule",{value:!0});const n=j3();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const i=this.ops[this.index];if(i){const o=this.offset,l=n.default.length(i);if(r>=l-o?(r=l-o,this.index+=1,this.offset=0):this.offset+=r,typeof i.delete=="number")return{delete:r};{const a={};return i.attributes&&(a.attributes=i.attributes),typeof i.retain=="number"?a.retain=r:typeof i.retain=="object"&&i.retain!==null?a.retain=i.retain:typeof i.insert=="string"?a.insert=i.insert.substr(o,r):a.insert=i.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,i=this.index,o=this.next(),l=this.ops.slice(this.index);return this.offset=r,this.index=i,[o].concat(l)}}else return[]}}return C0.default=e,C0}var dx;function v7(){return dx||(dx=1,(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=d7(),r=Q3(),i=q3(),o=g7();e.AttributeMap=o.default;const l=j3();e.Op=l.default;const a=p7();e.OpIterator=a.default;const h="\0",g=(x,w)=>{if(typeof x!="object"||x===null)throw new Error(`cannot retain a ${typeof x}`);if(typeof w!="object"||w===null)throw new Error(`cannot retain a ${typeof w}`);const _=Object.keys(x)[0];if(!_||_!==Object.keys(w)[0])throw new Error(`embed types not matched: ${_} != ${Object.keys(w)[0]}`);return[_,x[_],w[_]]};class m{constructor(w){Array.isArray(w)?this.ops=w:w!=null&&Array.isArray(w.ops)?this.ops=w.ops:this.ops=[]}static registerEmbed(w,_){this.handlers[w]=_}static unregisterEmbed(w){delete this.handlers[w]}static getHandler(w){const _=this.handlers[w];if(!_)throw new Error(`no handlers for embed type "${w}"`);return _}insert(w,_){const S={};return typeof w=="string"&&w.length===0?this:(S.insert=w,_!=null&&typeof _=="object"&&Object.keys(_).length>0&&(S.attributes=_),this.push(S))}delete(w){return w<=0?this:this.push({delete:w})}retain(w,_){if(typeof w=="number"&&w<=0)return this;const S={retain:w};return _!=null&&typeof _=="object"&&Object.keys(_).length>0&&(S.attributes=_),this.push(S)}push(w){let _=this.ops.length,S=this.ops[_-1];if(w=r(w),typeof S=="object"){if(typeof w.delete=="number"&&typeof S.delete=="number")return this.ops[_-1]={delete:S.delete+w.delete},this;if(typeof S.delete=="number"&&w.insert!=null&&(_-=1,S=this.ops[_-1],typeof S!="object"))return this.ops.unshift(w),this;if(i(w.attributes,S.attributes)){if(typeof w.insert=="string"&&typeof S.insert=="string")return this.ops[_-1]={insert:S.insert+w.insert},typeof w.attributes=="object"&&(this.ops[_-1].attributes=w.attributes),this;if(typeof w.retain=="number"&&typeof S.retain=="number")return this.ops[_-1]={retain:S.retain+w.retain},typeof w.attributes=="object"&&(this.ops[_-1].attributes=w.attributes),this}}return _===this.ops.length?this.ops.push(w):this.ops.splice(_,0,w),this}chop(){const w=this.ops[this.ops.length-1];return w&&typeof w.retain=="number"&&!w.attributes&&this.ops.pop(),this}filter(w){return this.ops.filter(w)}forEach(w){this.ops.forEach(w)}map(w){return this.ops.map(w)}partition(w){const _=[],S=[];return this.forEach(R=>{(w(R)?_:S).push(R)}),[_,S]}reduce(w,_){return this.ops.reduce(w,_)}changeLength(){return this.reduce((w,_)=>_.insert?w+l.default.length(_):_.delete?w-_.delete:w,0)}length(){return this.reduce((w,_)=>w+l.default.length(_),0)}slice(w=0,_=1/0){const S=[],R=new a.default(this.ops);let k=0;for(;k<_&&R.hasNext();){let O;k<w?O=R.next(w-k):(O=R.next(_-k),S.push(O)),k+=l.default.length(O)}return new m(S)}compose(w){const _=new a.default(this.ops),S=new a.default(w.ops),R=[],k=S.peek();if(k!=null&&typeof k.retain=="number"&&k.attributes==null){let P=k.retain;for(;_.peekType()==="insert"&&_.peekLength()<=P;)P-=_.peekLength(),R.push(_.next());k.retain-P>0&&S.next(k.retain-P)}const O=new m(R);for(;_.hasNext()||S.hasNext();)if(S.peekType()==="insert")O.push(S.next());else if(_.peekType()==="delete")O.push(_.next());else{const P=Math.min(_.peekLength(),S.peekLength()),z=_.next(P),H=S.next(P);if(H.retain){const G={};if(typeof z.retain=="number")G.retain=typeof H.retain=="number"?P:H.retain;else if(typeof H.retain=="number")z.retain==null?G.insert=z.insert:G.retain=z.retain;else{const J=z.retain==null?"insert":"retain",[Y,K,fe]=g(z[J],H.retain),X=m.getHandler(Y);G[J]={[Y]:X.compose(K,fe,J==="retain")}}const N=o.default.compose(z.attributes,H.attributes,typeof z.retain=="number");if(N&&(G.attributes=N),O.push(G),!S.hasNext()&&i(O.ops[O.ops.length-1],G)){const J=new m(_.rest());return O.concat(J).chop()}}else typeof H.delete=="number"&&(typeof z.retain=="number"||typeof z.retain=="object"&&z.retain!==null)&&O.push(H)}return O.chop()}concat(w){const _=new m(this.ops.slice());return w.ops.length>0&&(_.push(w.ops[0]),_.ops=_.ops.concat(w.ops.slice(1))),_}diff(w,_){if(this.ops===w.ops)return new m;const S=[this,w].map(z=>z.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:h;const G=z===w?"on":"with";throw new Error("diff() called "+G+" non-document")}).join("")),R=new m,k=t(S[0],S[1],_,!0),O=new a.default(this.ops),P=new a.default(w.ops);return k.forEach(z=>{let H=z[1].length;for(;H>0;){let G=0;switch(z[0]){case t.INSERT:G=Math.min(P.peekLength(),H),R.push(P.next(G));break;case t.DELETE:G=Math.min(H,O.peekLength()),O.next(G),R.delete(G);break;case t.EQUAL:G=Math.min(O.peekLength(),P.peekLength(),H);const N=O.next(G),J=P.next(G);i(N.insert,J.insert)?R.retain(G,o.default.diff(N.attributes,J.attributes)):R.push(J).delete(G);break}H-=G}}),R.chop()}eachLine(w,_=`
289
- `){const S=new a.default(this.ops);let R=new m,k=0;for(;S.hasNext();){if(S.peekType()!=="insert")return;const O=S.peek(),P=l.default.length(O)-S.peekLength(),z=typeof O.insert=="string"?O.insert.indexOf(_,P)-P:-1;if(z<0)R.push(S.next());else if(z>0)R.push(S.next(z));else{if(w(R,S.next(1).attributes||{},k)===!1)return;k+=1,R=new m}}R.length()>0&&w(R,{},k)}invert(w){const _=new m;return this.reduce((S,R)=>{if(R.insert)_.delete(l.default.length(R));else{if(typeof R.retain=="number"&&R.attributes==null)return _.retain(R.retain),S+R.retain;if(R.delete||typeof R.retain=="number"){const k=R.delete||R.retain;return w.slice(S,S+k).forEach(P=>{R.delete?_.push(P):R.retain&&R.attributes&&_.retain(l.default.length(P),o.default.invert(R.attributes,P.attributes))}),S+k}else if(typeof R.retain=="object"&&R.retain!==null){const k=w.slice(S,S+1),O=new a.default(k.ops).next(),[P,z,H]=g(R.retain,O.insert),G=m.getHandler(P);return _.retain({[P]:G.invert(z,H)},o.default.invert(R.attributes,O.attributes)),S+1}}return S},0),_.chop()}transform(w,_=!1){if(_=!!_,typeof w=="number")return this.transformPosition(w,_);const S=w,R=new a.default(this.ops),k=new a.default(S.ops),O=new m;for(;R.hasNext()||k.hasNext();)if(R.peekType()==="insert"&&(_||k.peekType()!=="insert"))O.retain(l.default.length(R.next()));else if(k.peekType()==="insert")O.push(k.next());else{const P=Math.min(R.peekLength(),k.peekLength()),z=R.next(P),H=k.next(P);if(z.delete)continue;if(H.delete)O.push(H);else{const G=z.retain,N=H.retain;let J=typeof N=="object"&&N!==null?N:P;if(typeof G=="object"&&G!==null&&typeof N=="object"&&N!==null){const Y=Object.keys(G)[0];if(Y===Object.keys(N)[0]){const K=m.getHandler(Y);K&&(J={[Y]:K.transform(G[Y],N[Y],_)})}}O.retain(J,o.default.transform(z.attributes,H.attributes,_))}}return O.chop()}transformPosition(w,_=!1){_=!!_;const S=new a.default(this.ops);let R=0;for(;S.hasNext()&&R<=w;){const k=S.peekLength(),O=S.peekType();if(S.next(),O==="delete"){w-=Math.min(k,w-R);continue}else O==="insert"&&(R<w||!_)&&(w+=k);R+=k}return w}}m.Op=l.default,m.OpIterator=a.default,m.AttributeMap=o.default,m.handlers={},e.default=m,n.exports=m,n.exports.default=m})(m0,m0.exports)),m0.exports}var ph=v7();const Xn=L1(ph);var $3=typeof global=="object"&&global&&global.Object===Object&&global,b7=typeof self=="object"&&self&&self.Object===Object&&self,sd=$3||b7||Function("return this")(),ag=sd.Symbol,e4=Object.prototype,y7=e4.hasOwnProperty,m7=e4.toString,lp=ag?ag.toStringTag:void 0;function x7(n){var e=y7.call(n,lp),t=n[lp];try{n[lp]=void 0;var r=!0}catch{}var i=m7.call(n);return r&&(e?n[lp]=t:delete n[lp]),i}var w7=Object.prototype,C7=w7.toString;function _7(n){return C7.call(n)}var S7="[object Null]",E7="[object Undefined]",gx=ag?ag.toStringTag:void 0;function P1(n){return n==null?n===void 0?E7:S7:gx&&gx in Object(n)?x7(n):_7(n)}function Ad(n){return n!=null&&typeof n=="object"}var Pg=Array.isArray;function fg(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function t4(n){return n}var T7="[object AsyncFunction]",A7="[object Function]",R7="[object GeneratorFunction]",I7="[object Proxy]";function Rm(n){if(!fg(n))return!1;var e=P1(n);return e==A7||e==R7||e==T7||e==I7}var vb=sd["__core-js_shared__"],px=(function(){var n=/[^.]+$/.exec(vb&&vb.keys&&vb.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function k7(n){return!!px&&px in n}var M7=Function.prototype,L7=M7.toString;function Hg(n){if(n!=null){try{return L7.call(n)}catch{}try{return n+""}catch{}}return""}var O7=/[\\^$.*+?()[\]{}|]/g,P7=/^\[object .+?Constructor\]$/,D7=Function.prototype,N7=Object.prototype,F7=D7.toString,B7=N7.hasOwnProperty,z7=RegExp("^"+F7.call(B7).replace(O7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function H7(n){if(!fg(n)||k7(n))return!1;var e=Rm(n)?z7:P7;return e.test(Hg(n))}function W7(n,e){return n==null?void 0:n[e]}function Wg(n,e){var t=W7(n,e);return H7(t)?t:void 0}var Py=Wg(sd,"WeakMap"),vx=Object.create,U7=(function(){function n(){}return function(e){if(!fg(e))return{};if(vx)return vx(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function G7(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Y7(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var V7=800,Z7=16,X7=Date.now;function K7(n){var e=0,t=0;return function(){var r=X7(),i=Z7-(r-t);if(t=r,i>0){if(++e>=V7)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function J7(n){return function(){return n}}var iv=(function(){try{var n=Wg(Object,"defineProperty");return n({},"",{}),n}catch{}})(),Q7=iv?function(n,e){return iv(n,"toString",{configurable:!0,enumerable:!1,value:J7(e),writable:!0})}:t4,q7=K7(Q7);function j7(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var $7=9007199254740991,eM=/^(?:0|[1-9]\d*)$/;function n4(n,e){var t=typeof n;return e=e??$7,!!e&&(t=="number"||t!="symbol"&&eM.test(n))&&n>-1&&n%1==0&&n<e}function Im(n,e,t){e=="__proto__"&&iv?iv(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Wp(n,e){return n===e||n!==n&&e!==e}var tM=Object.prototype,nM=tM.hasOwnProperty;function r4(n,e,t){var r=n[e];(!(nM.call(n,e)&&Wp(r,t))||t===void 0&&!(e in n))&&Im(n,e,t)}function rM(n,e,t,r){var i=!t;t||(t={});for(var o=-1,l=e.length;++o<l;){var a=e[o],h=void 0;h===void 0&&(h=n[a]),i?Im(t,a,h):r4(t,a,h)}return t}var bx=Math.max;function iM(n,e,t){return e=bx(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,o=bx(r.length-e,0),l=Array(o);++i<o;)l[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(l),G7(n,this,a)}}function oM(n,e){return q7(iM(n,e,t4),n+"")}var lM=9007199254740991;function i4(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=lM}function Av(n){return n!=null&&i4(n.length)&&!Rm(n)}function sM(n,e,t){if(!fg(t))return!1;var r=typeof e;return(r=="number"?Av(t)&&n4(e,t.length):r=="string"&&e in t)?Wp(t[e],n):!1}function aM(n){return oM(function(e,t){var r=-1,i=t.length,o=i>1?t[i-1]:void 0,l=i>2?t[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,l&&sM(t[0],t[1],l)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,o)}return e})}var cM=Object.prototype;function km(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||cM;return n===t}function uM(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var fM="[object Arguments]";function yx(n){return Ad(n)&&P1(n)==fM}var o4=Object.prototype,hM=o4.hasOwnProperty,dM=o4.propertyIsEnumerable,Dy=yx((function(){return arguments})())?yx:function(n){return Ad(n)&&hM.call(n,"callee")&&!dM.call(n,"callee")};function gM(){return!1}var l4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mx=l4&&typeof module=="object"&&module&&!module.nodeType&&module,pM=mx&&mx.exports===l4,xx=pM?sd.Buffer:void 0,vM=xx?xx.isBuffer:void 0,Rp=vM||gM,bM="[object Arguments]",yM="[object Array]",mM="[object Boolean]",xM="[object Date]",wM="[object Error]",CM="[object Function]",_M="[object Map]",SM="[object Number]",EM="[object Object]",TM="[object RegExp]",AM="[object Set]",RM="[object String]",IM="[object WeakMap]",kM="[object ArrayBuffer]",MM="[object DataView]",LM="[object Float32Array]",OM="[object Float64Array]",PM="[object Int8Array]",DM="[object Int16Array]",NM="[object Int32Array]",FM="[object Uint8Array]",BM="[object Uint8ClampedArray]",zM="[object Uint16Array]",HM="[object Uint32Array]",Xl={};Xl[LM]=Xl[OM]=Xl[PM]=Xl[DM]=Xl[NM]=Xl[FM]=Xl[BM]=Xl[zM]=Xl[HM]=!0;Xl[bM]=Xl[yM]=Xl[kM]=Xl[mM]=Xl[MM]=Xl[xM]=Xl[wM]=Xl[CM]=Xl[_M]=Xl[SM]=Xl[EM]=Xl[TM]=Xl[AM]=Xl[RM]=Xl[IM]=!1;function WM(n){return Ad(n)&&i4(n.length)&&!!Xl[P1(n)]}function Mm(n){return function(e){return n(e)}}var s4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yp=s4&&typeof module=="object"&&module&&!module.nodeType&&module,UM=yp&&yp.exports===s4,bb=UM&&$3.process,C1=(function(){try{var n=yp&&yp.require&&yp.require("util").types;return n||bb&&bb.binding&&bb.binding("util")}catch{}})(),wx=C1&&C1.isTypedArray,Lm=wx?Mm(wx):WM,GM=Object.prototype,YM=GM.hasOwnProperty;function a4(n,e){var t=Pg(n),r=!t&&Dy(n),i=!t&&!r&&Rp(n),o=!t&&!r&&!i&&Lm(n),l=t||r||i||o,a=l?uM(n.length,String):[],h=a.length;for(var g in n)(e||YM.call(n,g))&&!(l&&(g=="length"||i&&(g=="offset"||g=="parent")||o&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||n4(g,h)))&&a.push(g);return a}function c4(n,e){return function(t){return n(e(t))}}var VM=c4(Object.keys,Object),ZM=Object.prototype,XM=ZM.hasOwnProperty;function KM(n){if(!km(n))return VM(n);var e=[];for(var t in Object(n))XM.call(n,t)&&t!="constructor"&&e.push(t);return e}function JM(n){return Av(n)?a4(n):KM(n)}function QM(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var qM=Object.prototype,jM=qM.hasOwnProperty;function $M(n){if(!fg(n))return QM(n);var e=km(n),t=[];for(var r in n)r=="constructor"&&(e||!jM.call(n,r))||t.push(r);return t}function u4(n){return Av(n)?a4(n,!0):$M(n)}var Ip=Wg(Object,"create");function eL(){this.__data__=Ip?Ip(null):{},this.size=0}function tL(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var nL="__lodash_hash_undefined__",rL=Object.prototype,iL=rL.hasOwnProperty;function oL(n){var e=this.__data__;if(Ip){var t=e[n];return t===nL?void 0:t}return iL.call(e,n)?e[n]:void 0}var lL=Object.prototype,sL=lL.hasOwnProperty;function aL(n){var e=this.__data__;return Ip?e[n]!==void 0:sL.call(e,n)}var cL="__lodash_hash_undefined__";function uL(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ip&&e===void 0?cL:e,this}function Dg(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Dg.prototype.clear=eL;Dg.prototype.delete=tL;Dg.prototype.get=oL;Dg.prototype.has=aL;Dg.prototype.set=uL;function fL(){this.__data__=[],this.size=0}function Rv(n,e){for(var t=n.length;t--;)if(Wp(n[t][0],e))return t;return-1}var hL=Array.prototype,dL=hL.splice;function gL(n){var e=this.__data__,t=Rv(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():dL.call(e,t,1),--this.size,!0}function pL(n){var e=this.__data__,t=Rv(e,n);return t<0?void 0:e[t][1]}function vL(n){return Rv(this.__data__,n)>-1}function bL(n,e){var t=this.__data__,r=Rv(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function kd(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}kd.prototype.clear=fL;kd.prototype.delete=gL;kd.prototype.get=pL;kd.prototype.has=vL;kd.prototype.set=bL;var kp=Wg(sd,"Map");function yL(){this.size=0,this.__data__={hash:new Dg,map:new(kp||kd),string:new Dg}}function mL(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Iv(n,e){var t=n.__data__;return mL(e)?t[typeof e=="string"?"string":"hash"]:t.map}function xL(n){var e=Iv(this,n).delete(n);return this.size-=e?1:0,e}function wL(n){return Iv(this,n).get(n)}function CL(n){return Iv(this,n).has(n)}function _L(n,e){var t=Iv(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Ug(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ug.prototype.clear=yL;Ug.prototype.delete=xL;Ug.prototype.get=wL;Ug.prototype.has=CL;Ug.prototype.set=_L;function SL(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var f4=c4(Object.getPrototypeOf,Object),EL="[object Object]",TL=Function.prototype,AL=Object.prototype,h4=TL.toString,RL=AL.hasOwnProperty,IL=h4.call(Object);function kL(n){if(!Ad(n)||P1(n)!=EL)return!1;var e=f4(n);if(e===null)return!0;var t=RL.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&h4.call(t)==IL}function ML(){this.__data__=new kd,this.size=0}function LL(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function OL(n){return this.__data__.get(n)}function PL(n){return this.__data__.has(n)}var DL=200;function NL(n,e){var t=this.__data__;if(t instanceof kd){var r=t.__data__;if(!kp||r.length<DL-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Ug(r)}return t.set(n,e),this.size=t.size,this}function $h(n){var e=this.__data__=new kd(n);this.size=e.size}$h.prototype.clear=ML;$h.prototype.delete=LL;$h.prototype.get=OL;$h.prototype.has=PL;$h.prototype.set=NL;var d4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cx=d4&&typeof module=="object"&&module&&!module.nodeType&&module,FL=Cx&&Cx.exports===d4,_x=FL?sd.Buffer:void 0,Sx=_x?_x.allocUnsafe:void 0;function g4(n,e){if(e)return n.slice();var t=n.length,r=Sx?Sx(t):new n.constructor(t);return n.copy(r),r}function BL(n,e){for(var t=-1,r=n==null?0:n.length,i=0,o=[];++t<r;){var l=n[t];e(l,t,n)&&(o[i++]=l)}return o}function zL(){return[]}var HL=Object.prototype,WL=HL.propertyIsEnumerable,Ex=Object.getOwnPropertySymbols,UL=Ex?function(n){return n==null?[]:(n=Object(n),BL(Ex(n),function(e){return WL.call(n,e)}))}:zL;function GL(n,e,t){var r=e(n);return Pg(n)?r:SL(r,t(n))}function Ny(n){return GL(n,JM,UL)}var Fy=Wg(sd,"DataView"),By=Wg(sd,"Promise"),zy=Wg(sd,"Set"),Tx="[object Map]",YL="[object Object]",Ax="[object Promise]",Rx="[object Set]",Ix="[object WeakMap]",kx="[object DataView]",VL=Hg(Fy),ZL=Hg(kp),XL=Hg(By),KL=Hg(zy),JL=Hg(Py),Ih=P1;(Fy&&Ih(new Fy(new ArrayBuffer(1)))!=kx||kp&&Ih(new kp)!=Tx||By&&Ih(By.resolve())!=Ax||zy&&Ih(new zy)!=Rx||Py&&Ih(new Py)!=Ix)&&(Ih=function(n){var e=P1(n),t=e==YL?n.constructor:void 0,r=t?Hg(t):"";if(r)switch(r){case VL:return kx;case ZL:return Tx;case XL:return Ax;case KL:return Rx;case JL:return Ix}return e});var QL=Object.prototype,qL=QL.hasOwnProperty;function jL(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&qL.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var ov=sd.Uint8Array;function Om(n){var e=new n.constructor(n.byteLength);return new ov(e).set(new ov(n)),e}function $L(n,e){var t=Om(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var eO=/\w*$/;function tO(n){var e=new n.constructor(n.source,eO.exec(n));return e.lastIndex=n.lastIndex,e}var Mx=ag?ag.prototype:void 0,Lx=Mx?Mx.valueOf:void 0;function nO(n){return Lx?Object(Lx.call(n)):{}}function p4(n,e){var t=e?Om(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var rO="[object Boolean]",iO="[object Date]",oO="[object Map]",lO="[object Number]",sO="[object RegExp]",aO="[object Set]",cO="[object String]",uO="[object Symbol]",fO="[object ArrayBuffer]",hO="[object DataView]",dO="[object Float32Array]",gO="[object Float64Array]",pO="[object Int8Array]",vO="[object Int16Array]",bO="[object Int32Array]",yO="[object Uint8Array]",mO="[object Uint8ClampedArray]",xO="[object Uint16Array]",wO="[object Uint32Array]";function CO(n,e,t){var r=n.constructor;switch(e){case fO:return Om(n);case rO:case iO:return new r(+n);case hO:return $L(n);case dO:case gO:case pO:case vO:case bO:case yO:case mO:case xO:case wO:return p4(n,t);case oO:return new r;case lO:case cO:return new r(n);case sO:return tO(n);case aO:return new r;case uO:return nO(n)}}function v4(n){return typeof n.constructor=="function"&&!km(n)?U7(f4(n)):{}}var _O="[object Map]";function SO(n){return Ad(n)&&Ih(n)==_O}var Ox=C1&&C1.isMap,EO=Ox?Mm(Ox):SO,TO="[object Set]";function AO(n){return Ad(n)&&Ih(n)==TO}var Px=C1&&C1.isSet,RO=Px?Mm(Px):AO,IO=1,b4="[object Arguments]",kO="[object Array]",MO="[object Boolean]",LO="[object Date]",OO="[object Error]",y4="[object Function]",PO="[object GeneratorFunction]",DO="[object Map]",NO="[object Number]",m4="[object Object]",FO="[object RegExp]",BO="[object Set]",zO="[object String]",HO="[object Symbol]",WO="[object WeakMap]",UO="[object ArrayBuffer]",GO="[object DataView]",YO="[object Float32Array]",VO="[object Float64Array]",ZO="[object Int8Array]",XO="[object Int16Array]",KO="[object Int32Array]",JO="[object Uint8Array]",QO="[object Uint8ClampedArray]",qO="[object Uint16Array]",jO="[object Uint32Array]",kl={};kl[b4]=kl[kO]=kl[UO]=kl[GO]=kl[MO]=kl[LO]=kl[YO]=kl[VO]=kl[ZO]=kl[XO]=kl[KO]=kl[DO]=kl[NO]=kl[m4]=kl[FO]=kl[BO]=kl[zO]=kl[HO]=kl[JO]=kl[QO]=kl[qO]=kl[jO]=!0;kl[OO]=kl[y4]=kl[WO]=!1;function V0(n,e,t,r,i,o){var l,a=e&IO;if(l!==void 0)return l;if(!fg(n))return n;var h=Pg(n);if(h)l=jL(n);else{var g=Ih(n),m=g==y4||g==PO;if(Rp(n))return g4(n,a);if(g==m4||g==b4||m&&!i)l=m?{}:v4(n);else{if(!kl[g])return i?n:{};l=CO(n,g,a)}}o||(o=new $h);var x=o.get(n);if(x)return x;o.set(n,l),RO(n)?n.forEach(function(S){l.add(V0(S,e,t,S,n,o))}):EO(n)&&n.forEach(function(S,R){l.set(R,V0(S,e,t,R,n,o))});var w=Ny,_=h?void 0:w(n);return j7(_||n,function(S,R){_&&(R=S,S=n[R]),r4(l,R,V0(S,e,t,R,n,o))}),l}var $O=1,eP=4;function g1(n){return V0(n,$O|eP)}var tP="__lodash_hash_undefined__";function nP(n){return this.__data__.set(n,tP),this}function rP(n){return this.__data__.has(n)}function lv(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Ug;++e<t;)this.add(n[e])}lv.prototype.add=lv.prototype.push=nP;lv.prototype.has=rP;function iP(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function oP(n,e){return n.has(e)}var lP=1,sP=2;function x4(n,e,t,r,i,o){var l=t&lP,a=n.length,h=e.length;if(a!=h&&!(l&&h>a))return!1;var g=o.get(n),m=o.get(e);if(g&&m)return g==e&&m==n;var x=-1,w=!0,_=t&sP?new lv:void 0;for(o.set(n,e),o.set(e,n);++x<a;){var S=n[x],R=e[x];if(r)var k=l?r(R,S,x,e,n,o):r(S,R,x,n,e,o);if(k!==void 0){if(k)continue;w=!1;break}if(_){if(!iP(e,function(O,P){if(!oP(_,P)&&(S===O||i(S,O,t,r,o)))return _.push(P)})){w=!1;break}}else if(!(S===R||i(S,R,t,r,o))){w=!1;break}}return o.delete(n),o.delete(e),w}function aP(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function cP(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var uP=1,fP=2,hP="[object Boolean]",dP="[object Date]",gP="[object Error]",pP="[object Map]",vP="[object Number]",bP="[object RegExp]",yP="[object Set]",mP="[object String]",xP="[object Symbol]",wP="[object ArrayBuffer]",CP="[object DataView]",Dx=ag?ag.prototype:void 0,yb=Dx?Dx.valueOf:void 0;function _P(n,e,t,r,i,o,l){switch(t){case CP:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case wP:return!(n.byteLength!=e.byteLength||!o(new ov(n),new ov(e)));case hP:case dP:case vP:return Wp(+n,+e);case gP:return n.name==e.name&&n.message==e.message;case bP:case mP:return n==e+"";case pP:var a=aP;case yP:var h=r&uP;if(a||(a=cP),n.size!=e.size&&!h)return!1;var g=l.get(n);if(g)return g==e;r|=fP,l.set(n,e);var m=x4(a(n),a(e),r,i,o,l);return l.delete(n),m;case xP:if(yb)return yb.call(n)==yb.call(e)}return!1}var SP=1,EP=Object.prototype,TP=EP.hasOwnProperty;function AP(n,e,t,r,i,o){var l=t&SP,a=Ny(n),h=a.length,g=Ny(e),m=g.length;if(h!=m&&!l)return!1;for(var x=h;x--;){var w=a[x];if(!(l?w in e:TP.call(e,w)))return!1}var _=o.get(n),S=o.get(e);if(_&&S)return _==e&&S==n;var R=!0;o.set(n,e),o.set(e,n);for(var k=l;++x<h;){w=a[x];var O=n[w],P=e[w];if(r)var z=l?r(P,O,w,e,n,o):r(O,P,w,n,e,o);if(!(z===void 0?O===P||i(O,P,t,r,o):z)){R=!1;break}k||(k=w=="constructor")}if(R&&!k){var H=n.constructor,G=e.constructor;H!=G&&"constructor"in n&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof G=="function"&&G instanceof G)&&(R=!1)}return o.delete(n),o.delete(e),R}var RP=1,Nx="[object Arguments]",Fx="[object Array]",_0="[object Object]",IP=Object.prototype,Bx=IP.hasOwnProperty;function kP(n,e,t,r,i,o){var l=Pg(n),a=Pg(e),h=l?Fx:Ih(n),g=a?Fx:Ih(e);h=h==Nx?_0:h,g=g==Nx?_0:g;var m=h==_0,x=g==_0,w=h==g;if(w&&Rp(n)){if(!Rp(e))return!1;l=!0,m=!1}if(w&&!m)return o||(o=new $h),l||Lm(n)?x4(n,e,t,r,i,o):_P(n,e,h,t,r,i,o);if(!(t&RP)){var _=m&&Bx.call(n,"__wrapped__"),S=x&&Bx.call(e,"__wrapped__");if(_||S){var R=_?n.value():n,k=S?e.value():e;return o||(o=new $h),i(R,k,t,r,o)}}return w?(o||(o=new $h),AP(n,e,t,r,i,o)):!1}function w4(n,e,t,r,i){return n===e?!0:n==null||e==null||!Ad(n)&&!Ad(e)?n!==n&&e!==e:kP(n,e,t,r,w4,i)}function MP(n){return function(e,t,r){for(var i=-1,o=Object(e),l=r(e),a=l.length;a--;){var h=l[++i];if(t(o[h],h,o)===!1)break}return e}}var LP=MP();function Hy(n,e,t){(t!==void 0&&!Wp(n[e],t)||t===void 0&&!(e in n))&&Im(n,e,t)}function OP(n){return Ad(n)&&Av(n)}function Wy(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function PP(n){return rM(n,u4(n))}function DP(n,e,t,r,i,o,l){var a=Wy(n,t),h=Wy(e,t),g=l.get(h);if(g){Hy(n,t,g);return}var m=o?o(a,h,t+"",n,e,l):void 0,x=m===void 0;if(x){var w=Pg(h),_=!w&&Rp(h),S=!w&&!_&&Lm(h);m=h,w||_||S?Pg(a)?m=a:OP(a)?m=Y7(a):_?(x=!1,m=g4(h,!0)):S?(x=!1,m=p4(h,!0)):m=[]:kL(h)||Dy(h)?(m=a,Dy(a)?m=PP(a):(!fg(a)||Rm(a))&&(m=v4(h))):x=!1}x&&(l.set(h,m),i(m,h,r,o,l),l.delete(h)),Hy(n,t,m)}function C4(n,e,t,r,i){n!==e&&LP(e,function(o,l){if(i||(i=new $h),fg(o))DP(n,e,l,t,C4,r,i);else{var a=r?r(Wy(n,l),o,l+"",n,e,i):void 0;a===void 0&&(a=o),Hy(n,l,a)}},u4)}function $d(n,e){return w4(n,e)}var og=aM(function(n,e,t){C4(n,e,t)}),Kn=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(Kn||{});class rd{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const i=Kn.TYPE&Kn.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Kn.LEVEL|i:Kn.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class p1 extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const _4=class Uy{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const i=this.query(t);if(i==null)throw new p1(`Unable to create ${t} blot`);const o=i,l=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:o.create(r),a=new o(e,l,r);return Uy.blots.set(a.domNode,a),a}find(e,t=!1){return Uy.find(e,t)}query(e,t=Kn.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Kn.LEVEL&Kn.BLOCK?r=this.types.block:e&Kn.LEVEL&Kn.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&Kn.LEVEL&r.scope&&t&Kn.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,i="attrName"in t;if(!r&&!i)throw new p1("Invalid definition");if(r&&t.blotName==="abstract")throw new p1("Cannot register abstract class");const o=r?t.blotName:i?t.attrName:void 0;return this.types[o]=t,i?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(l=>l.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(l=>{(this.tags[l]==null||t.className==null)&&(this.tags[l]=t)}))),t})}};_4.blots=new WeakMap;let _1=_4;function zx(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class NP extends rd{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){zx(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(zx(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Bh=NP;function mb(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class FP extends rd{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[mb(this.keyName)]=t,!0):!1}remove(e){e.style[mb(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[mb(this.keyName)];return this.canAdd(e,t)?t:""}}const hg=FP;class BP{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=_1.find(this.domNode);if(e==null)return;const t=rd.keys(this.domNode),r=Bh.keys(this.domNode),i=hg.keys(this.domNode);t.concat(r).concat(i).forEach(o=>{const l=e.scroll.query(o,Kn.ATTRIBUTE);l instanceof rd&&(this.attributes[l.attrName]=l)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const kv=BP,S4=class{constructor(e,t){this.scroll=e,this.domNode=t,_1.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new p1("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),_1.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,i){const o=this.isolate(e,t);if(this.scroll.query(r,Kn.BLOT)!=null&&i)o.wrap(r,i);else if(this.scroll.query(r,Kn.ATTRIBUTE)!=null){const l=this.scroll.create(this.statics.scope);o.wrap(l),l.format(r,i)}}insertAt(e,t,r){const i=r==null?this.scroll.create("text",t):this.scroll.create(t,r),o=this.split(e);this.parent.insertBefore(i,o||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new p1(`Cannot wrap ${e}`);return r.appendChild(this),r}};S4.blotName="abstract";let E4=S4;const T4=class extends E4{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};T4.scope=Kn.INLINE_BLOT;let zP=T4;const lu=zP;class HP{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),i=0;for(;r;){if(r===e)return i;i+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let i=r();for(;i;){const o=i.length();if(e<o||t&&e===o&&(i.next==null||i.next.length()!==0))return[i,e];e-=o,i=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[i,o]=this.find(e);let l=e-o;const a=this.iterator(i);let h=a();for(;h&&l<e+t;){const g=h.length();e>l?r(h,e-l,Math.min(t,l+g-e)):r(h,0,Math.min(g,e+t-l)),l+=g,h=a()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let i=r();for(;i;)t=e(t,i),i=r();return t}}function Hx(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(Kn.INLINE);return Array.from(n.childNodes).forEach(i=>{r.domNode.appendChild(i)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const A4=class Kd extends E4{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Kd.uiClass&&this.uiNode.classList.add(Kd.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new HP,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Hx(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof p1)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,i,o)=>{r.deleteAt(i,o)})}descendant(e,t=0){const[r,i]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof Kd?r.descendant(e,i):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let i=[],o=r;return this.children.forEachAt(t,r,(l,a,h)=>{(e.blotName==null&&e(l)||e.blotName!=null&&l instanceof e)&&i.push(l),l instanceof Kd&&(i=i.concat(l.descendants(e,a,o))),o-=h}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===Kn.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof Kd?t.unwrap():t.remove())})}formatAt(e,t,r,i){this.children.forEachAt(e,t,(o,l,a)=>{o.formatAt(l,a,r,i)})}insertAt(e,t,r){const[i,o]=this.children.find(e);if(i)i.insertAt(o,t,r);else{const l=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(l)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,i]=this.children.find(e,t),o=[[this,e]];return r instanceof Kd?o.concat(r.path(i,t)):(r!=null&&o.push([r,i]),o)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof Kd&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,o,l)=>{const a=i.split(o,t);a!=null&&r.appendChild(a)}),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],i=[];e.forEach(o=>{o.target===this.domNode&&o.type==="childList"&&(r.push(...o.addedNodes),i.push(...o.removedNodes))}),i.forEach(o=>{if(o.parentNode!=null&&o.tagName!=="IFRAME"&&document.body.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const l=this.scroll.find(o);l!=null&&(l.domNode.parentNode==null||l.domNode.parentNode===this.domNode)&&l.detach()}),r.filter(o=>o.parentNode===this.domNode&&o!==this.uiNode).sort((o,l)=>o===l?0:o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(o=>{let l=null;o.nextSibling!=null&&(l=this.scroll.find(o.nextSibling));const a=Hx(o,this.scroll);(a.next!==l||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,l||void 0))}),this.enforceAllowedChildren()}};A4.uiClass="";let WP=A4;const Lh=WP;function UP(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const n1=class r1 extends Lh{static create(e){return super.create(e)}static formats(e,t){const r=t.query(r1.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kv(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof r1||(r=r.wrap(r1.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Kn.INLINE);if(r==null)return;r instanceof rd?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.formats()[r]!=null||this.scroll.query(r,Kn.ATTRIBUTE)?this.isolate(e,t).format(r,i):super.formatAt(e,t,r,i)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof r1&&r.prev===this&&UP(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof r1&&this.attributes.move(r),r}};n1.allowedChildren=[n1,lu],n1.blotName="inline",n1.scope=Kn.INLINE_BLOT,n1.tagName="SPAN";let GP=n1;const Pm=GP,i1=class Gy extends Lh{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Gy.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kv(this.domNode)}format(e,t){const r=this.scroll.query(e,Kn.BLOCK);r!=null&&(r instanceof rd?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Gy.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.scroll.query(r,Kn.BLOCK)!=null?this.format(r,i):super.formatAt(e,t,r,i)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Kn.INLINE)!=null)super.insertAt(e,t,r);else{const i=this.split(e);if(i!=null){const o=this.scroll.create(t,r);i.parent.insertBefore(o,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};i1.blotName="block",i1.scope=Kn.BLOCK_BLOT,i1.tagName="P",i1.allowedChildren=[Pm,i1,lu];let YP=i1;const Mp=YP,Yy=class extends Lh{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,i){super.formatAt(e,t,r,i),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Yy.blotName="container",Yy.scope=Kn.BLOCK_BLOT;let VP=Yy;const Mv=VP;class ZP extends lu{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,i){e===0&&t===this.length()?this.format(r,i):super.formatAt(e,t,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const zf=ZP,XP={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},KP=100,o1=class extends Lh{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,XP),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=Kn.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,i){this.update(),super.formatAt(e,t,r,i)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const o=(h,g=!0)=>{h==null||h===this||h.domNode.parentNode!=null&&(r.has(h.domNode)||r.set(h.domNode,[]),g&&o(h.parent))},l=h=>{r.has(h.domNode)&&(h instanceof Lh&&h.children.forEach(l),r.delete(h.domNode),h.optimize(t))};let a=e;for(let h=0;a.length>0;h+=1){if(h>=KP)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(g=>{const m=this.find(g.target,!0);m!=null&&(m.domNode===g.target&&(g.type==="childList"?(o(this.find(g.previousSibling,!1)),Array.from(g.addedNodes).forEach(x=>{const w=this.find(x,!1);o(w,!1),w instanceof Lh&&w.children.forEach(_=>{o(_,!1)})})):g.type==="attributes"&&o(m.prev)),o(m))}),this.children.forEach(l),a=Array.from(this.observer.takeRecords()),i=a.slice();i.length>0;)e.push(i.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const o=this.find(i.target,!0);return o==null?null:r.has(o.domNode)?(r.get(o.domNode).push(i),null):(r.set(o.domNode,[i]),o)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};o1.blotName="scroll",o1.defaultChild=Mp,o1.allowedChildren=[Mp,Mv],o1.scope=Kn.BLOCK_BLOT,o1.tagName="DIV";let JP=o1;const Dm=JP,Vy=class R4 extends lu{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof R4&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Vy.blotName="text",Vy.scope=Kn.INLINE_BLOT;let QP=Vy;const sv=QP,qP=Object.freeze(Object.defineProperty({__proto__:null,Attributor:rd,AttributorStore:kv,BlockBlot:Mp,ClassAttributor:Bh,ContainerBlot:Mv,EmbedBlot:zf,InlineBlot:Pm,LeafBlot:lu,ParentBlot:Lh,Registry:_1,Scope:Kn,ScrollBlot:Dm,StyleAttributor:hg,TextBlot:sv},Symbol.toStringTag,{value:"Module"}));class zh extends zf{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}zh.blotName="break";zh.tagName="BR";let Ph=class extends sv{};const jP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Lv(n){return n.replace(/[&<>"']/g,e=>jP[e])}const Xh=class Xh extends Pm{static compare(e,t){const r=Xh.order.indexOf(e),i=Xh.order.indexOf(t);return r>=0||i>=0?r-i:e===t?0:e<t?-1:1}formatAt(e,t,r,i){if(Xh.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Kn.BLOT)){const o=this.isolate(e,t);i&&o.wrap(r,i)}else super.formatAt(e,t,r,i)}optimize(e){if(super.optimize(e),this.parent instanceof Xh&&Xh.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};Ee(Xh,"allowedChildren",[Xh,zh,zf,Ph]),Ee(Xh,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let id=Xh;const Wx=1;class kc extends Mp{constructor(){super(...arguments);Ee(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=I4(this)),this.cache.delta}deleteAt(t,r){super.deleteAt(t,r),this.cache={}}formatAt(t,r,i,o){r<=0||(this.scroll.query(i,Kn.BLOCK)?t+r===this.length()&&this.format(i,o):super.formatAt(t,Math.min(r,this.length()-t-1),i,o),this.cache={})}insertAt(t,r,i){if(i!=null){super.insertAt(t,r,i),this.cache={};return}if(r.length===0)return;const o=r.split(`
285
+ `+xt:""}`)}Ye.length>0&&Y([...J||[],...Ye])}},[Y,oe,r,t,N,J,g]),Te=B.useCallback(()=>{var at;return(at=re.current)==null?void 0:at.click()},[]),ke=B.useCallback(at=>{const Ye=at.target.files;Ye!=null&&Ye.length&&(He(Ye),Oe())},[He,Oe]),Be=B.useCallback(at=>{if(l==null||l(at),!Y||!J)return;const Ye=Tg.getFileKey(at),Tt=J.filter(Ut=>Tg.getFileKey(Ut)!==Ye);Y(Tt),Oe()},[l,Y,J,Oe]),rt=B.useCallback(()=>{Y&&(Y([]),Oe())},[Y,Oe]),Re=B.useCallback(at=>{if(!i)return Promise.resolve();const Ye=Tg.getFileKey(at);return $.current[Ye]==="Loading"?Promise.resolve():(Q(Ye,"Loading"),new Promise(Tt=>{i(at,Ut=>{Q(Ye,Ut),Tt()})}))},[i,Q]),ut=B.useCallback(async()=>{if(J!=null&&J.length){if(te){const at={...$.current};J.forEach(Ye=>{at[Tg.getFileKey(Ye)]="Loading"}),$.current=at,te(at)}if(S){S(J,at=>{if(te){const Ye={...$.current,...at};$.current=Ye,te(Ye)}});return}for(const at of J){if(!i)continue;const Ye=Tg.getFileKey(at);await new Promise(Tt=>{i(at,Ut=>{if(te){const gt={...$.current};gt[Ye]=Ut,$.current=gt,te(gt)}Tt()})})}}},[J,i,S,te]),qe=B.useCallback(()=>{!(J!=null&&J.length)||!o||o(J)},[J,o]),ot=B.useMemo(()=>{const at=Ye=>(Ye.preventDefault(),Ye.stopPropagation(),Ye);return{onDragEnter:Ye=>{at(Ye),!K&&!x&&ue(!0)},onDragOver:Ye=>{at(Ye),!K&&!x&&Ye.dataTransfer&&(Ye.dataTransfer.dropEffect="copy")},onDragLeave:Ye=>{var Ut;at(Ye);const Tt=(Ut=ge.current)==null?void 0:Ut.contains(Ye.relatedTarget);(!Ye.relatedTarget||!Tt)&&ue(!1)},onDrop:Ye=>{var Tt;at(Ye),ue(!1),!K&&!x&&((Tt=Ye.dataTransfer.files)!=null&&Tt.length)&&He(Ye.dataTransfer.files)}}},[K,x,He]),st=B.useMemo(()=>{const at=dt.clsx(bl.ButtonRenderer,"NoSelect");return{upload:Ye=>M.jsx(ba,{className:at,icon:"X",iconSize:"sm",style:{color:"var(--AFileUploader_text_color)"},tooltip:N.Delete,type:"Raw",onClick:()=>Be(Ye)}),loading:()=>M.jsx(ba,{className:at,icon:"Spinner",iconSize:"sm",type:"Raw"}),error:Ye=>M.jsx(o9,{baseClass:at,errorClass:bl.ErrorColor,errorCursorClass:bl.ErrorCursor,file:Ye,resources:N,onDownload:Re}),download:Ye=>M.jsx(ba,{className:at,icon:"FileDownload",iconSize:"sm",style:{color:"var(--AFileUploader_brand_color)"},tooltip:N.Download,type:"Raw",onClick:()=>Re(Ye)}),view:()=>null}},[N,Be,Re]),bt=B.useCallback((at,Ye)=>{const Tt=Ie(at),Ut=Fe(at),gt=()=>a==="Upload"?st.upload(at):a==="View"?st.view():Tt?st.loading():Ut?st.error(at):st.download(at);return M.jsx(wm,{ButtonRenderer:gt,className:dt.clsx(bl.FileChip,Ut&&bl.ErrorBorder),label:M.jsx("div",{className:bl.FileChipContent,children:M.jsxs(Ml,{className:bl.FileNameContainer,children:[M.jsx(nd,{children:at.name,className:dt.clsx(Ut&&bl.ErrorColor)}),M.jsx("span",{children:Mg(at.size),className:bl.FileSize})]})})},Ye)},[Ie,Fe,a,st]),Mt=B.useCallback(()=>M.jsx("div",{className:dt.clsx(bl.FileBox,K&&bl.ErrorBorder,K&&bl.ErrorColor,K&&bl.ErrorCursor,Le&&bl.Disabled,ne&&!(J!=null&&J.length)&&bl.FileBoxFullSize),...ot,ref:ge,children:ne?M.jsxs(Ml,{className:dt.clsx("NoSelect"),style:{gap:4,display:J!=null&&J.length?"flex":"none"},children:[M.jsx(fo,{icon:"FileDownload"}),M.jsx("span",{children:N["Drop file to select"]})]}):M.jsxs(Ic,{className:dt.clsx(bl.SelectRenderer,"NoSelect"),isDisabled:K||x||Le,type:"Raw",onClick:Te,children:[N["Insert File"],g&&` ${(J==null?void 0:J.length)||0} / ${g}`]})}),[K,Le,ne,J==null?void 0:J.length,ot,N,x,Te,g]),Bt=B.useMemo(()=>{const at=a==="Upload",Ye=a==="View",Tt=at?N["Delete All"]:N["Download All"],Ut=at?rt:ut,gt=(J==null?void 0:J.some(Ht=>Ie(Ht)))||!1;return M.jsxs(Ml,{className:bl.LabelContainer,children:[H.label,a==="Upload"&&M.jsxs(nd,{className:dt.clsx(bl.TotalFileSize,"NoSelect"),children:["(",M.jsx("span",{className:dt.clsx(K&&bl.ErrorColor),children:Mg(me)})," / ",Mg(h),")"]}),!Ye&&M.jsx("span",{children:Tt,className:dt.clsx(bl.LabelButton,"Label1",(xe||gt)&&bl.Disabled,at&&bl.Delete),onClick:!xe&&!gt?Ut:void 0}),o&&M.jsx("span",{children:N["Download List"]||"Download List",className:dt.clsx(bl.LabelButton,"Label1",!(J!=null&&J.length)&&bl.Disabled),style:{marginLeft:"auto"},onClick:J!=null&&J.length?qe:void 0})]})},[a,N,rt,ut,J,H.label,K,me,h,xe,o,qe,Ie]);return a!=="Upload"&&!(J!=null&&J.length)?null:M.jsxs(lg,{wrapId:O,wrapProps:P,labelProps:z,...H,label:Bt,children:[M.jsx("input",{ref:re,multiple:!0,accept:t||"",style:{display:"none"},type:"file",onChange:ke}),M.jsxs(zi,{...G,className:dt.clsx(bl.AFileUploader,_),children:[M.jsxs(Ml,{className:bl.ChipsContainer,children:[a==="Upload"&&Mt(),J==null?void 0:J.map(bt)]}),a==="Upload"&&M.jsx(zi,{className:dt.clsx(bl.DropIdle,"Title1","NoSelect"),style:{color:ne?"var(--AFileUploader_brand_color)":"var(--AFileUploader_disabled_color)",opacity:ne?1:.4},...ot,abaseRef:ge,onClick:at=>at.preventDefault(),children:!(J!=null&&J.length)&&M.jsxs(Ml,{style:{gap:4},children:[M.jsx(fo,{icon:"FileDownload",size:"2xl"}),M.jsx("span",{children:N["Drop file to select"]})]})})]})]})},s9="_AFloatMenu_xco8u_1",a9="_Content_xco8u_10",Q2={AFloatMenu:s9,Content:a9},B3=n=>{const e=Gn.c(67),{defs:t,defaultDef:r,actionRef:i,offset:o,onClose:l,onClick:a,onPaperClick:h,position:g,width:m}=n,x=g===void 0?O1.ES:g,w=m===void 0?137:m;let _;e[0]!==r?(_={content:c9,...r},e[0]=r,e[1]=_):_=e[1];const S=_;let R;e[2]!==S||e[3]!==t?(R={},$n.keys(t).forEach(qe=>{const ot=t[qe],st={...S,...ot};st.noDisplay||(R[qe]=st)}),e[2]=S,e[3]=t,e[4]=R):R=e[4];const k=R,[O,P]=B.useState(null);let z;e[5]!==o||e[6]!==x?(z=qe=>{XC(qe,K,x,o),P(qe)},e[5]=o,e[6]=x,e[7]=z):z=e[7];const H=z,[G,N]=B.useState(!1),[J,Y]=B.useState(!1),K=B.useRef(null);let fe;e[8]!==H?(fe=qe=>{Y(!0),setTimeout(()=>N(!0),0),setTimeout(()=>H(qe),0)},e[8]=H,e[9]=fe):fe=e[9];const X=fe;let te;e[10]!==l?(te=()=>{N(!1),Y(!0),l==null||l()},e[10]=l,e[11]=te):te=e[11];const ne=te;let ue;e[12]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>Y(!1),e[12]=ue):ue=e[12];const se=ue;let $;e[13]!==ne||e[14]!==h?($=async qe=>{const ot=document.getElementById("root"),st=qe.target,bt=K.current;!ot||!bt||!st||!bt.contains(st)&&ot.contains(st)&&(await(h==null?void 0:h(qe)),ne())},e[13]=ne,e[14]=h,e[15]=$):$=e[15];const re=$;let ge,me;e[16]!==G||e[17]!==re?(ge=()=>{if(G)return setTimeout(()=>document.addEventListener("mousedown",re),0),()=>document.removeEventListener("mousedown",re)},me=[G,re],e[16]=G,e[17]=re,e[18]=ge,e[19]=me):(ge=e[18],me=e[19]),B.useEffect(ge,me);let oe;e[20]!==H||e[21]!==O?(oe=()=>{O&&H(O)},e[20]=H,e[21]=O,e[22]=oe):oe=e[22];const Q=oe;let pe,Ie;e[23]!==G||e[24]!==O||e[25]!==Q?(pe=()=>{if(!G||!O)return;let qe=O.parentElement;for(;qe;)qe.addEventListener("scroll",Q),qe=qe.parentElement;return()=>{let ot=O.parentElement;for(;ot;)ot.removeEventListener("scroll",Q),ot=ot.parentElement}},Ie=[O,G,Q],e[23]=G,e[24]=O,e[25]=Q,e[26]=pe,e[27]=Ie):(pe=e[26],Ie=e[27]),B.useEffect(pe,Ie);let Fe,xe;e[28]!==G||e[29]!==Q?(Fe=()=>{if(G)return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},xe=[G,Q],e[28]=G,e[29]=Q,e[30]=Fe,e[31]=xe):(Fe=e[30],xe=e[31]),B.useEffect(Fe,xe);let Oe;e[32]!==ne?(Oe=qe=>{qe[0].intersectionRatio===0&&ne()},e[32]=ne,e[33]=Oe):Oe=e[33];const Le=Oe;let He;e[34]!==G||e[35]!==Le?(He=()=>{if(!G)return;const qe=new IntersectionObserver(Le,{threshold:0});return K.current&&qe.observe(K.current),()=>qe.disconnect()},e[34]=G,e[35]=Le,e[36]=He):He=e[36];let Te;e[37]!==G||e[38]!==Le?(Te=[K,G,Le],e[37]=G,e[38]=Le,e[39]=Te):Te=e[39],B.useEffect(He,Te);let ke,Be;e[40]!==i||e[41]!==ne||e[42]!==X?(ke=()=>{i&&(i.current={open:X,close:ne})},Be=[i,X,ne],e[40]=i,e[41]=ne,e[42]=X,e[43]=ke,e[44]=Be):(ke=e[43],Be=e[44]),B.useEffect(ke,Be);let rt;e[45]!==ne||e[46]!==k||e[47]!==a||e[48]!==G?(rt=qe=>{var ot;if(G){if((ot=k[qe])!=null&&ot.isDisabled)return}else return;a==null||a(qe),ne()},e[45]=ne,e[46]=k,e[47]=a,e[48]=G,e[49]=rt):rt=e[49];const Re=rt;if(!G&&!J)return null;let ut;if(e[50]!==S||e[51]!==k||e[52]!==G||e[53]!==Re||e[54]!==w){const qe=+G,ot=G&&Object.keys(k).length>0?"visible":"hidden";let st;e[56]!==qe||e[57]!==ot||e[58]!==w?(st={opacity:qe,visibility:ot,minWidth:w},e[56]=qe,e[57]=ot,e[58]=w,e[59]=st):st=e[59];let bt;e[60]!==S||e[61]!==k||e[62]!==Re?(bt=$n.map(k,(Bt,at)=>{const[Ye]=Bt,Tt={...S,...k[Ye]};let{content:Ut,noDisplay:gt,tooltipDirection:Ht,...xt}=Tt;const pn=Ht===void 0?ic.E:Ht;return gt?null:(Ut=Ur.getContent(Tt.content,{defKey:Ye,def:Tt}),B.createElement(zi,{...xt,key:at,className:dt.clsx(Q2.Content,"Label2","IsClickable",xt.className),tooltipDirection:pn,onClick:$t=>{var sn;Re==null||Re(Ye),(sn=xt.onClick)==null||sn.call(xt,$t)}},Ut))}),e[60]=S,e[61]=k,e[62]=Re,e[63]=bt):bt=e[63];let Mt;e[64]!==st||e[65]!==bt?(Mt=M.jsx("div",{ref:K,className:Q2.AFloatMenu,style:st,onTransitionEnd:se,children:bt}),e[64]=st,e[65]=bt,e[66]=Mt):Mt=e[66],ut=su.createPortal(Mt,document.body),e[50]=S,e[51]=k,e[52]=G,e[53]=Re,e[54]=w,e[55]=ut}else ut=e[55];return ut},c9=n=>n.defKey;function u9(n){try{const e=Number.parseInt(n);return isNaN(e)?void 0:e}catch{return}}const G0={parseInt:u9},f9=`${Number.MAX_SAFE_INTEGER}`.length-1,h9=n=>{const e=Gn.c(58);let t,r,i,o,l,a,h,g,m,x,w,_,S;if(e[0]!==n){const{unit:He,unitMargin:Te,unitOptions:ke,useSelectUnit:Be,type:rt,min:Re,max:ut,unitSelectWidth:qe,unitOptionsRenderer:ot,useValue:st,onEnterPress:bt,canAsterisk:Mt,onFocus:Bt,...at}=n;g=He,l=Te,m=ke,_=Be,a=rt,o=Re,i=ut,w=qe,x=ot,S=st,r=bt,h=Mt,t=at,e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13];const R=l===void 0?4:l,k=a===void 0?"Secondary":a,O=i!==void 0&&o!==void 0?Math.max(`${i}`.length+1,`${o}`.length+1):f9,[P,z]=Fo(S,""),[H,G]=B.useState(!1),[N,J]=B.useState(""),Y=B.useRef(null);let K;e:{if(!P||!z){K=String(P);break e}const He=String(P),Te=G0.parseInt(He);if(Te!==void 0){if(o!==void 0&&Te<o){const ke=`${o}`;z(ke),K=ke;break e}if(i!==void 0&&Te>i){const ke=`${i}`;z(ke),K=ke;break e}}K=He}const fe=K;let X;e[14]!==H||e[15]!==i||e[16]!==z?(X=He=>{if(H){if(i!==void 0&&He!==""){const Te=G0.parseInt(He);if(Te!==void 0&&Te>i){J(`${i}`);return}}J(He)}else z&&z(He)},e[14]=H,e[15]=i,e[16]=z,e[17]=X):X=e[17];const te=X;let ne;e[18]!==fe?(ne=()=>{G(!0),J(fe)},e[18]=fe,e[19]=ne):ne=e[19];const ue=ne;let se;e[20]!==i||e[21]!==o||e[22]!==z?(se=He=>{if(G(!1),!z)return;const Te=He.target.value;let ke=Te;if(Te===""||Te==="-")ke=o!==void 0?`${o}`:Te;else{const Be=G0.parseInt(Te);Be===void 0?ke=o!==void 0?`${o}`:Te:o!==void 0&&Be<o?ke=`${o}`:i!==void 0&&Be>i&&(ke=`${i}`)}ke!==Te&&(He.target.value=ke),z(ke)},e[20]=i,e[21]=o,e[22]=z,e[23]=se):se=e[23];const $=se;let re;e[24]!==r?(re=He=>{var Te;(Te=Y.current)==null||Te.blur(),r==null||r(He)},e[24]=r,e[25]=re):re=e[25];const ge=re,me=o===void 0&&i===void 0?g??"number":`${o??""}~${i??""}`,[oe,Q]=Fo(_,(m==null?void 0:m[0])??"");let pe;if(m){const He=w||"fit-content";let Te;e[26]!==He?(Te={maxWidth:He},e[26]=He,e[27]=Te):Te=e[27];let ke;e[28]!==Q||e[29]!==oe?(ke=[oe,Q],e[28]=Q,e[29]=oe,e[30]=ke):ke=e[30];let Be;e[31]!==R?(Be={style:{color:"var(--label-normal)",marginLeft:4,marginRight:R}},e[31]=R,e[32]=Be):Be=e[32];let rt;e[33]!==Te||e[34]!==ke||e[35]!==Be||e[36]!==m||e[37]!==x?(rt=M.jsx(Td,{className:ou.ANumInputUnitSelect,OptionRenderer:x,options:m,style:Te,type:"Raw",useSelect:ke,arrowProps:Be}),e[33]=Te,e[34]=ke,e[35]=Be,e[36]=m,e[37]=x,e[38]=rt):rt=e[38],pe=rt}else{let He;e[39]!==g||e[40]!==R?(He=g&&M.jsx("span",{style:{marginRight:R},children:g}),e[39]=g,e[40]=R,e[41]=He):He=e[41],pe=He}const Ie=pe;let Fe;e[42]!==n.className?(Fe=dt.clsx(ou.ANumInput,n.className),e[42]=n.className,e[43]=Fe):Fe=e[43];const xe=H?N:fe;let Oe;e[44]!==te||e[45]!==xe?(Oe=[xe,te],e[44]=te,e[45]=xe,e[46]=Oe):Oe=e[46];let Le;return e[47]!==t||e[48]!==O||e[49]!==$||e[50]!==ge||e[51]!==ue||e[52]!==me||e[53]!==Oe||e[54]!==Fe||e[55]!==k||e[56]!==Ie?(Le=M.jsx(sg,{...t,autoComplete:"off",className:Fe,inputRef:Y,maxLength:O,placeholder:me,RightAddon:Ie,type:k,useValue:Oe,onBlur:$,onEnterPress:ge,onFocus:ue}),e[47]=t,e[48]=O,e[49]=$,e[50]=ge,e[51]=ue,e[52]=me,e[53]=Oe,e[54]=Fe,e[55]=k,e[56]=Ie,e[57]=Le):Le=e[57],Le},d9="_AListView_1nv5l_1",g9="_Row_1nv5l_10",p9="_Label_1nv5l_19",v9="_Content_1nv5l_29",h0={AListView:d9,Row:g9,Label:p9,Content:v9},b9=n=>{const e=Gn.c(48);let t,r,i,o,l,a,h,g,m,x,w,_,S,R,k,O,P,z;if(e[0]!==n){const{defs:J,defaultDef:Y,item:K,rowHeight:fe,labelWidth:X,noBorder:te,onlyMiddleBorder:ne,rowGap:ue,middleBorder:se,rowBottomBorder:$,outerBorder:re,style:ge,labelClassName:me,contentClassName:oe,labelStyle:Q,contentStyle:pe,...Ie}=n;h=K,k=fe,x=X,R=ue,O=ge,g=me,i=oe,m=Q,o=pe,_=te||ne,r=_?"":$||"var(--AListView_border-thin)",S=_?"":re||"var(--AListView_border-thick)",w=te?"":se||"var(--AListView_border-thick)";let Fe;e[19]!==Y?(Fe={content:m9,label:y9,...Y},e[19]=Y,e[20]=Fe):Fe=e[20],l=Fe;let xe;e[21]!==l||e[22]!==J?(xe={},$n.keys(J).forEach(Oe=>{const Le=J[Oe],He={...l,...Le};xe[Oe]=He}),e[21]=l,e[22]=J,e[23]=xe):xe=e[23],a=xe,t=zi,P=Ie,z=dt.clsx(h0.AListView,Ie.className),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S,e[14]=R,e[15]=k,e[16]=O,e[17]=P,e[18]=z}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13],R=e[14],k=e[15],O=e[16],P=e[17],z=e[18];let H;e[24]!==r||e[25]!==O?(H={...O,borderTop:r},e[24]=r,e[25]=O,e[26]=H):H=e[26];let G;e[27]!==r||e[28]!==i||e[29]!==o||e[30]!==l||e[31]!==a||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==x||e[36]!==w||e[37]!==_||e[38]!==S||e[39]!==R||e[40]!==k?(G=$n.map(a,(J,Y)=>{const[K]=J,fe={...l,...a[K]},X=Ur.getContent(fe.label,{defKey:K,item:h,def:fe}),te=Ur.getContent(fe.content,{defKey:K,item:h||{[K]:""},def:fe}),ne=Ur.getContent(fe.bold||"label",{defKey:K,item:h,def:fe});return M.jsxs("div",{className:h0.Row,style:{height:fe.fixedHeight?k:void 0,minHeight:fe.fixedHeight?k:void 0,maxHeight:fe.fixedHeight?k:void 0,borderBottom:r,marginTop:Y===0?0:typeof R=="number"?`${R}px`:R},children:[M.jsx("div",{className:dt.clsx(h0.Label,"NoSelect",ne!=="content"&&"Bold",g),style:{width:x,minWidth:x,maxWidth:x,borderLeft:S,paddingLeft:_?0:10,...m},children:M.jsx(nd,{children:X})}),M.jsx("div",{className:dt.clsx(h0.Content,ne!=="label"&&"Bold",i),style:{borderLeft:w,borderRight:S,...o},children:M.jsx(nd,{style:{width:"100%",padding:_?0:10},children:te})})]},K)}),e[27]=r,e[28]=i,e[29]=o,e[30]=l,e[31]=a,e[32]=h,e[33]=g,e[34]=m,e[35]=x,e[36]=w,e[37]=_,e[38]=S,e[39]=R,e[40]=k,e[41]=G):G=e[41];let N;return e[42]!==t||e[43]!==P||e[44]!==z||e[45]!==H||e[46]!==G?(N=M.jsx(t,{...P,className:z,style:H,children:G}),e[42]=t,e[43]=P,e[44]=z,e[45]=H,e[46]=G,e[47]=N):N=e[47],N},y9=n=>n.defKey,m9=n=>{const{defKey:e,item:t}=n;if(t)if($n.hasKey(t,e)){const r=t[e];return $n.isReactNode(r)?r:null}else return null;else return null},x9="_ALoadingBorder_kwc1g_1",w9="_ProgressBar_kwc1g_9",C9="_IsLoading_kwc1g_15",_9="_Cover_kwc1g_19",ep={ALoadingBorder:x9,ProgressBar:w9,IsLoading:C9,Cover:_9},Am=n=>{const e=Gn.c(15),{isLoading:t}=n,[r,i]=B.useState(!1),o=B.useRef(null);let l,a;e[0]!==t?(l=()=>{t?(i(!0),o.current&&clearTimeout(o.current)):o.current=setTimeout(()=>i(!1),300)},a=[t],e[0]=t,e[1]=l,e[2]=a):(l=e[1],a=e[2]),B.useEffect(l,a);let h;e[3]!==r?(h=dt.clsx(ep.ProgressBar,r&&ep.IsLoading),e[3]=r,e[4]=h):h=e[4];let g;e[5]!==h?(g=M.jsx("div",{className:h}),e[5]=h,e[6]=g):g=e[6];let m;e[7]!==t?(m=dt.clsx(ep.Cover,t&&ep.IsLoading),e[7]=t,e[8]=m):m=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={transition:"all 300ms"},e[9]=x):x=e[9];let w;e[10]!==m?(w=M.jsx("div",{className:m,style:x}),e[10]=m,e[11]=w):w=e[11];let _;return e[12]!==g||e[13]!==w?(_=M.jsxs("div",{className:ep.ALoadingBorder,children:[g,w]}),e[12]=g,e[13]=w,e[14]=_):_=e[14],_},S9="_Container_ez8dc_1",E9="_Option_ez8dc_7",T9="_RadioButton_ez8dc_14",A9="_InnerCircle_ez8dc_24",R9="_isChecked_ez8dc_29",c1={Container:S9,Option:E9,RadioButton:T9,InnerCircle:A9,isChecked:R9},I9=n=>{const{options:e,useSelect:t,selectDisabled:r,radius:i=23,innerRadius:o=i*.6,OptionRenderer:l=z3}=n,[a,h]=Fo(t,e[0]);return M.jsx("div",{className:c1.Container,children:e.map((g,m)=>{const x=r==null?void 0:r(g),w=()=>x?null:h==null?void 0:h(g);return M.jsxs(Ml,{className:dt.clsx(c1.Option,"IsClickable"),isDisabled:x,onClick:w,children:[M.jsx(k9,{innerRadius:o,isChecked:a===g,radius:i},m),M.jsx(l,{option:g})]},m)})})},z3=({option:n})=>n,k9=n=>{const e=Gn.c(15),{isChecked:t,radius:r,innerRadius:i}=n;let o;e[0]!==t?(o=dt.clsx(c1.RadioButton,t&&c1.isChecked),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==r?(l={width:r,height:r},e[2]=r,e[3]=l):l=e[3];let a;e[4]!==t?(a=dt.clsx(c1.InnerCircle,t&&c1.isChecked),e[4]=t,e[5]=a):a=e[5];let h;e[6]!==i?(h={width:i,height:i},e[6]=i,e[7]=h):h=e[7];let g;e[8]!==a||e[9]!==h?(g=M.jsx(zi,{className:a,style:h}),e[8]=a,e[9]=h,e[10]=g):g=e[10];let m;return e[11]!==o||e[12]!==l||e[13]!==g?(m=M.jsx(zi,{className:o,style:l,children:g}),e[11]=o,e[12]=l,e[13]=g,e[14]=m):m=e[14],m},M9="_AMultiSelect_19uuu_1",L9="_Arrow_19uuu_15",O9="_Primary_19uuu_24",P9="_UnAvailable_19uuu_35",D9="_IsOpen_19uuu_35",N9="_Secondary_19uuu_42",F9="_Placeholder_19uuu_58",B9="_ValuesContainer_19uuu_63",z9="_Values_19uuu_63",H9="_Options_19uuu_82",W9="_Option_19uuu_82",U9="_Selected_19uuu_124",G9="_CheckBox_19uuu_131",sf={AMultiSelect:M9,Arrow:L9,Primary:O9,UnAvailable:P9,IsOpen:D9,Secondary:N9,Placeholder:F9,ValuesContainer:B9,Values:z9,Options:H9,Option:W9,Selected:U9,CheckBox:G9},Y9=n=>{const{options:e,useSelect:t,type:r="Primary",placeholder:i=Or.AMultiSelect["Select(Placeholder)"],onClose:o,SelectedRenderer:l=Z9,OptionRenderer:a=X9,minShowRows:h=2,maxShowRows:g=6,arrowProps:m,isAutoWidth:x=!1,...w}=n,_=B.useRef(null),S=B.useMemo(()=>w.abaseRef??_,[w.abaseRef]),R=B.useRef(null),[k,O]=Fo(t,[]),[P,z]=B.useState(void 0),H=B.useRef(e),G=B.useRef(null),[N,J]=B.useState(!1),[Y,K]=B.useState(!1),fe=B.useCallback(()=>K(!1),[]),X=B.useCallback(()=>{w.isDisabled||w.isLoading||e.length<1||(K(!0),setTimeout(()=>J(!0),0),setTimeout(()=>lb(R,S,e,h,g),0))},[S,w.isDisabled,w.isLoading,e,h,g]),te=B.useCallback(()=>{J(!1),K(!0),o==null||o()},[o]),ne=B.useCallback(oe=>{var Q;N?te():X(),setTimeout(()=>lb(R,S,e,h,g),0),(Q=w.onClick)==null||Q.call(w,oe)},[S,w,e,N,te,X,h,g]),ue=B.useCallback(()=>{lb(R,S,e,h,g)},[S,e,h,g]);B.useEffect(()=>{if(!N||!S.current)return;const oe=S.current;let Q=oe.parentElement;for(;Q;)Q.addEventListener("scroll",ue),Q=Q.parentElement;return()=>{let pe=oe.parentElement;for(;pe;)pe.removeEventListener("scroll",ue),pe=pe.parentElement}},[S,N,ue]),B.useEffect(()=>{if(N)return window.addEventListener("resize",ue),()=>window.removeEventListener("resize",ue)},[N,ue]);const se=B.useCallback(oe=>{oe[0].intersectionRatio===0&&te()},[te]);B.useEffect(()=>{if(!N)return;const oe=new IntersectionObserver(se,{threshold:0});return S.current&&oe.observe(S.current),()=>oe.disconnect()},[S,N,se]);const $=B.useCallback(oe=>{const Q=oe.target,pe=S.current,Ie=R.current;!pe||!Q||!Ie||!pe.contains(Q)&&!Ie.contains(Q)&&te()},[S,te]),re=B.useMemo(()=>w.isDisabled||w.isLoading||e.length<1,[w.isDisabled,w.isLoading,e]);B.useEffect(()=>{if(N)return setTimeout(()=>document.addEventListener("mousedown",$),0),()=>document.removeEventListener("mousedown",$)},[N,$]);const ge=B.useCallback((oe,Q)=>{oe.stopPropagation(),oe.preventDefault();let pe=[...k];pe.includes(Q)?pe=pe.filter(Ie=>Ie!==Q):pe.push(Q),O==null||O(pe)},[k,O]),me=B.useCallback(()=>{if(!x||!S.current)return;const oe=kg.calculateOptimalSelectWidth({elementRef:S,options:e,selectedOptions:k,placeholder:i,optionRenderer:Q=>a({option:Q}),type:r,isMulti:!0});z(oe)},[x,S,e,k,i,a,r]);return B.useEffect(()=>x?((e!==H.current||P===void 0)&&(G.current!==null&&cancelAnimationFrame(G.current),G.current=requestAnimationFrame(()=>{me(),G.current=null,H.current=[...e]})),()=>{G.current!==null&&(cancelAnimationFrame(G.current),G.current=null)}):void 0,[x,e,me,P]),B.useEffect(()=>()=>{typeof kg.clearCache=="function"&&kg.clearCache()},[]),M.jsxs(M.Fragment,{children:[M.jsxs(zi,{...w,abaseRef:S,isDisabled:w.isDisabled||e.length<1,className:dt.clsx(w.className,sf.AMultiSelect,"NoSelect",N&&sf.IsOpen,re&&sf.UnAvailable,sf[r]),style:{padding:r==="Secondary"?"8px 8px 8px 0":0,width:P?`${P}px`:x?"100px":void 0,...w.style},onClick:ne,children:[M.jsx("div",{className:sf.ValuesContainer,children:M.jsx("div",{className:dt.clsx(sf.Values,k.length<1&&sf.Placeholder),children:M.jsx(l,{OptionRenderer:a,placeholder:i,selectedOptions:k})})}),M.jsx("div",{...m,className:dt.clsx(sf.Arrow,m==null?void 0:m.className),children:M.jsx(fo,{icon:"TriangleDown",style:{transform:N?"rotate(180deg)":"",transition:"var(--Transition)"}})})]}),e.length>0&&(N||Y)&&su.createPortal(M.jsx("div",{ref:R,className:dt.clsx(sf.Options,sf[r]),style:{opacity:+N,visibility:N?"visible":"hidden",pointerEvents:N?void 0:"none",width:P?`${P}px`:x?"100px":void 0,borderRadius:S.current?window.getComputedStyle(S.current).borderRadius:void 0},onTransitionEnd:fe,children:e.map((oe,Q)=>{var Ie;const pe=k.includes(oe);return M.jsxs("div",{className:dt.clsx(sf.Option,pe&&sf.Selected,"NoSelect",sf[r]),style:{height:(Ie=S.current)==null?void 0:Ie.getBoundingClientRect().height},onClick:Fe=>ge(Fe,oe),children:[M.jsx(w1,{className:sf.CheckBox,useCheck:[+pe,void 0]}),M.jsx(a,{option:oe})]},Q)})}),document.body)]})};function lb(n,e,t,r,i){if(!e.current||!n.current||!t||t.length<1)return;const o=e.current.getBoundingClientRect(),l=V9(o,t.length,r,i),a=window.getComputedStyle(e.current);n.current.style.top=`calc(${l.top??0}px - ${a.borderTopWidth})`,n.current.style.bottom=l.bottom?l.bottom+"px":"",n.current.style.left=l.left+"px",n.current.style.width||(n.current.style.minWidth=l.minWidth+"px"),n.current.style.minHeight=l.minHeight+"px",n.current.style.maxHeight=l.maxHeight+"px",n.current.style.visibility="visible"}function V9(n,e,t,r){const i={top:n.bottom,bottom:void 0,left:n.left,height:"fit-content",minWidth:n.width,minHeight:n.height*Math.min(t,e),maxHeight:n.height*r>window.innerHeight-n.bottom-10?window.innerHeight-n.bottom-10:n.height*r};return window.innerHeight-n.bottom-10<i.height&&(window.innerHeight-n.bottom-10<i.minHeight?(i.top=n.top-e*n.height,i.top<0&&(i.top=10,i.minHeight=n.top-10,i.height=n.top-10)):i.height=window.innerHeight-n.bottom-10),i}const Z9=n=>{const e=Gn.c(3),{OptionRenderer:t,selectedOptions:r,placeholder:i}=n;if(r.length<1)return i;if(r.length===1){let o;return e[0]!==t||e[1]!==r[0]?(o=M.jsx(t,{option:r[0]}),e[0]=t,e[1]=r[0],e[2]=o):o=e[2],o}else return`${r.length} selected`},X9=n=>{const{option:e}=n;return $n.isReactNode(e)?e:null},K9="_Container_10ion_1",J9="_Steps_10ion_9",Q9="_Step_10ion_9",q9="_OutCircle_10ion_26",j9="_IsOver_10ion_37",$9="_InCircle_10ion_41",eI="_Line_10ion_54",tI="_Left_10ion_66",nI="_Right_10ion_69",rI="_ContentContainer_10ion_73",iI="_Content_10ion_73",ku={Container:K9,Steps:J9,Step:Q9,OutCircle:q9,IsOver:j9,InCircle:$9,Line:eI,Left:tI,Right:nI,ContentContainer:rI,Content:iI},oI=n=>{const e=Gn.c(26),{useSelect:t,steps:r,StepRenderer:i,ContentRenderer:o}=n,l=i===void 0?q2:i,a=o===void 0?q2:o;if(r.length===0)throw new Error("steps should have at least one element");const h=B.useRef(null),[g,m]=Fo(t,r[0]);let x;e[0]!==m?(x=G=>m==null?void 0:m(G),e[0]=m,e[1]=x):x=e[1];const w=x,_=r.indexOf(g);let S;e[2]!==_||e[3]!==w||e[4]!==r[0]?(S=()=>{_<0&&w(r[0])},e[2]=_,e[3]=w,e[4]=r[0],e[5]=S):S=e[5];let R;e[6]!==_||e[7]!==w||e[8]!==r?(R=[_,r,w],e[6]=_,e[7]=w,e[8]=r,e[9]=R):R=e[9],B.useEffect(S,R);let k;e[10]!==l||e[11]!==_||e[12]!==w||e[13]!==r?(k=r.map((G,N)=>{const J=r.indexOf(G),Y=_>=N,K=_>N;return M.jsxs("div",{className:ku.Step,children:[N!==0&&M.jsx("div",{className:dt.clsx(ku.Line,ku.Left,Y&&ku.IsOver)}),N!==r.length-1&&M.jsx("div",{className:dt.clsx(ku.Line,ku.Right,K&&ku.IsOver)}),M.jsx(Ic,{className:dt.clsx(ku.OutCircle,Y&&ku.IsOver),type:"Raw",onClick:()=>w(G),children:M.jsx("div",{className:dt.clsx(ku.InCircle,Y&&ku.IsOver)})}),M.jsx(l,{step:G,stepIdx:J})]},N)}),e[10]=l,e[11]=_,e[12]=w,e[13]=r,e[14]=k):k=e[14];let O;e[15]!==k?(O=M.jsx("div",{className:ku.Steps,children:k}),e[15]=k,e[16]=O):O=e[16];let P;e[17]!==a||e[18]!==_||e[19]!==r?(P=r.map((G,N)=>{const J=r.indexOf(G);return M.jsx("div",{className:ku.Content,style:N===0?{marginLeft:`${_*-100}%`}:{},children:M.jsx(a,{step:G,stepIdx:J})},N)}),e[17]=a,e[18]=_,e[19]=r,e[20]=P):P=e[20];let z;e[21]!==P?(z=M.jsx("div",{ref:h,className:ku.ContentContainer,children:P}),e[21]=P,e[22]=z):z=e[22];let H;return e[23]!==O||e[24]!==z?(H=M.jsxs("div",{className:ku.Container,children:[O,z]}),e[23]=O,e[24]=z,e[25]=H):H=e[25],H},q2=n=>{const{step:e}=n;return typeof e=="object"?$n.stringify(e):e},lI="_ATab_9eg6z_1",sI="_Addon_9eg6z_9",aI="_Option_9eg6z_14",cI="_Underline_9eg6z_26",uI="_IsSelected_9eg6z_26",fI="_IndicatorTrack_9eg6z_37",hI="_Indicator_9eg6z_37",dI="_Primary_9eg6z_54",gI="_Secondary_9eg6z_57",pI="_IsDisabled_9eg6z_63",vI="_Tertiary_9eg6z_77",bI="_Quaternary_9eg6z_101",Zh={ATab:lI,Addon:sI,Option:aI,Underline:cI,IsSelected:uI,IndicatorTrack:fI,Indicator:hI,Primary:dI,Secondary:gI,IsDisabled:pI,Tertiary:vI,Quaternary:bI},yI=["Primary","Secondary","Tertiary","Quaternary"],H3=n=>{const{options:e,useSelect:t,selectDisabled:r,type:i="Primary",tabProps:o,optionProps:l,optionWidth:a,OptionRenderer:h=mI,RightAddon:g,LeftAddon:m,color:x,selectedColor:w,underline:_,indicatorProps:S,indicatorTrackProps:R,height:k=40}=n;if(e.length===0)throw new Error("options should have at least one element");const O=B.useMemo(()=>e.findIndex(Le=>!(r!=null&&r(Le))),[e,r]),P=i==="Tertiary",z=i==="Secondary",H=P?k*.1:0,G=z?8:0,N=B.useMemo(()=>H+G,[H,G]),J=B.useMemo(()=>(G-H)/e.length,[e.length,H,G]),[Y,K]=Fo(t,e[O]),fe=B.useRef([]),X=B.useCallback(Le=>K==null?void 0:K(Le),[K]),te=B.useMemo(()=>typeof a=="number"?a+"px":a,[a]),ne=B.useMemo(()=>e.indexOf(Y),[e,Y]),ue=B.useMemo(()=>`calc(${100/e.length}% + ${J}px)`,[e.length,J]),se=B.useMemo(()=>te||`calc(${ue} - ${N}px)`,[ue,N,te]),[$,re]=B.useState(0),[ge,me]=B.useState(0),[oe,Q]=B.useState(se),pe=B.useRef(null),Ie=B.useRef(null),Fe=ZC(Ie,pe),xe=B.useMemo(()=>{let Le;switch(te){case void 0:Le=`calc(${ue} * ${ne})`;break;case"fit-content":Le=`calc(${$}px)`;break;default:Le=`calc((${te} + ${N}px) * ${ne})`;break}return Le},[te,ue,ne,$,N]),Oe=B.useMemo(()=>{switch(te){case void 0:return;case"fit-content":return`calc(${ge}px)`;default:return`calc((${te} + ${N}px - ${J}px) * ${e.length})`}},[te,J,N,e,ge]);return B.useEffect(()=>{var He,Te;if(e.includes(Y)||K==null||K(e[O]),te!=="fit-content"){Q(se);return}let Le=0;fe.current.forEach((ke,Be)=>{Be<ne&&ke.current&&(Le+=ke.current.offsetWidth+N)}),re(Le),Q(`calc(${((Te=(He=fe.current[ne])==null?void 0:He.current)==null?void 0:Te.offsetWidth)||0}px)`),me(fe.current.reduce((ke,Be)=>{var rt;return ke+((((rt=Be.current)==null?void 0:rt.offsetWidth)||0)+N-J)},0))},[te,fe,e,Y,K,O,J,N,ne,se]),M.jsxs("div",{ref:pe,...o,className:dt.clsx(Zh.ATab,"Headline2",Zh[i],o==null?void 0:o.className),style:{minHeight:k,height:k,maxHeight:k},children:[m&&M.jsx("div",{ref:Ie,className:Zh.Addon,children:m}),M.jsx("div",{...S,className:dt.clsx(Zh.Indicator,S==null?void 0:S.className),style:{minWidth:oe,left:xe,marginLeft:H,transform:`translate(${Fe??0}px, ${P?"-50%":"0"})`,height:P?k-H*2:void 0,...S==null?void 0:S.style}}),M.jsx("div",{...R,className:dt.clsx(Zh.IndicatorTrack,R==null?void 0:R.className),style:{width:Oe,marginLeft:P?Fe:0,height:k,...R==null?void 0:R.style}}),e.map((Le,He)=>{const Te=r==null?void 0:r(Le);return fe.current[He]||(fe.current[He]=B.createRef()),M.jsx(zi,{abaseRef:fe.current[He],...l,isDisabled:Te,className:dt.clsx(Zh.Option,Te&&Zh.IsDiabled,Le===Y&&Zh.IsSelected,"IsClickable",_&&Zh.Underline,l==null?void 0:l.className),style:{minWidth:se,maxWidth:se,marginLeft:H,marginRight:G,"--color":Le===Y&&w||x,height:k,...l==null?void 0:l.style},onClick:ke=>{!Te&&X(Le),l&&l.onClick&&l.onClick(ke)},children:M.jsx(h,{option:Le})},He)}),M.jsx(cs,{w:H}),g&&M.jsxs(M.Fragment,{children:[M.jsx(zg,{}),M.jsx("div",{className:Zh.Addon,children:g})]})]})},mI=n=>{const{option:e}=n;if(typeof e=="string")return e;if(typeof e=="number")return e;if(typeof e=="object"){if(e===null)return"";const t=$n.keys(e);return"name"in t?e.name:"label"in t?e.label:"value"in t?e.value:JSON.stringify(e)}else return JSON.stringify(e)};function W3(...n){const e=Gn.c(3),t=n,r=B.useRef(!1);let i,o;e[0]!==t?(i=()=>{r.current||(r.current=!0,t.forEach(xI))},o=[t],e[0]=t,e[1]=i,e[2]=o):(i=e[1],o=e[2]),B.useEffect(i,o)}function xI(n){return n()}const U3={String:(n,e,t,r)=>{const{value:i}=r;if(i===void 0)return!1;if(t==="")return $n.keys(e).some(m=>{const x=e[m],w=Ur.getContent(x.asText,{defKey:m,def:x,item:n});if(w!==void 0)return w.toString().toLowerCase().includes(i.toLowerCase());const _=Ur.getContent(x.content,{defKey:m,def:x,item:n});return["string","number"].includes(typeof _)&&_!==void 0&&_!==null?_.toString().toLowerCase().includes(i.toLowerCase()):!1});const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0)return h.toString().toLowerCase().includes(i.toLowerCase());const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});return["string","number"].includes(typeof g)&&g!==void 0&&g!==null?g.toString().toLowerCase().includes(i.toLowerCase()):!1},Select:(n,e,t,r)=>{const{value:i}=r;if(i==null)return!1;const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0)return i.toString().toLowerCase()===h.toString().toLowerCase();const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});return["string","number"].includes(typeof g)&&g!==void 0&&g!==null?i.toString().toLowerCase()===g.toString().toLowerCase():!1},Date:(n,e,t,r)=>{const{value:i}=r;if(i===void 0)return!1;const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0){const m=Un.toDate(h.toString());return m&&Un.eq(m,i)}const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});if(["string","number"].includes(typeof g)&&g!==void 0&&g!==null){const m=Un.toDate(g.toString());return m&&Un.eq(m,i)}return!1},DateRange:(n,e,t,r)=>{const{value:i}=r;if(i===void 0)return!1;const o=$n.keys(e),l=t;if(!o.includes(l))return!1;const a=e[l],h=Ur.getContent(a.asText,{defKey:l,def:a,item:n});if(h!==void 0){const m=Un.toDate(h.toString());return m&&Un.be(i.sDate,m,i.eDate)}const g=Ur.getContent(a.content,{defKey:l,def:a,item:n});if(["string","number"].includes(typeof g)&&g!==void 0&&g!==null){const m=Un.toDate(g.toString());return m&&Un.be(i.sDate,m,i.eDate)}return!1}},wI=(n,e,t)=>{let r=n;return $n.keys(t).forEach(o=>{const l=t[o];l.value===void 0||l.value===null||l.value===""||(r=r.filter(a=>{var h;return(h=l.predicate??U3[l.type])==null?void 0:h(a,e,o,l)}))}),r},CI=(n,e,t)=>{if(!t)return n;const r=t.defKey,i=e[r];if(r===void 0)return n;const o=t.sortF??((l,a)=>{const h=Ur.getContent(i.content,{defKey:r,def:i,item:l}),g=Ur.getContent(i.content,{defKey:r,def:i,item:a});return typeof h=="string"&&typeof g=="string"?h<g?-1:h>g?1:0:typeof h=="number"&&typeof g=="number"?h-g:typeof h=="string"&&typeof g=="number"?-1:typeof h=="number"&&typeof g=="string"||h===void 0&&g!==void 0?1:h!==void 0&&g===void 0?-1:0});return typeof o=="function"&&o.length>=3?n.slice().sort((l,a)=>o(l,a,t.isAsc)):n.slice().sort((l,a)=>{const h=o(l,a);return t.isAsc?h:-h})},_I=(n,e,t)=>n.slice((e-1)*t,e*t),G3=(n,e)=>{const t=Math.max(Math.ceil(n/e),1);return Array.from({length:t},(r,i)=>i+1)},SI=(n,e,t,r)=>{const i=G3(e,t),o=Math.floor((n-1)/r),l=o*r+1,a=(o+1)*r,h=i.slice(l-1,a);return{pages:i,rangedPages:h}},EI=(n,e,t)=>{const r=[],i=Object.keys(t),o=[];i.forEach(w=>{const _=t[w],S=Ur.getContent(_.hContent,{defKey:w,def:_});if(S!==void 0){if(typeof S=="string"){o.push(S);return}else if(typeof S=="number"){o.push(S.toString());return}}const R=Ur.getContent(_.name,{defKey:w,def:_});if(R!==void 0&&typeof R=="string"){o.push(R);return}o.push(w)});const l=o.map(w=>`"${w.replaceAll('"','""')}"`);r.push(l.join(",")),e.forEach(w=>{const _=[];i.forEach(R=>{const k=t[R],O=Ur.getContent(k.content,{defKey:R,def:k,item:w});if(O!==void 0){if(typeof O=="string"){_.push(O);return}else if(typeof O=="number"){_.push(O.toString());return}}const P=w[R];typeof P=="string"?_.push(P):typeof P=="number"?_.push(P.toString()):_.push("")});const S=_.map(R=>`"${R.replaceAll('"','""')}"`);r.push(S.join(","))});const a=`${n}.csv`,h="\uFEFF"+r.join(`
286
+ `),g=new Blob([h],{type:"text/csv;charset=UTF-8"}),m=URL.createObjectURL(g),x=document.createElement("a");x.href=m,x.download=a,x.click(),URL.revokeObjectURL(m)},TI=n=>{const e=$n.keys(n);if(e.length!==1)return;const t=e[0];if(t!=="")return;const r=n[t];if(r.type==="String")return r.value},AI=n=>{const e=Object.entries(n);let t={};return e.forEach(([r,i])=>{!i||i.value===void 0||i.value===null||i.value===""||(i.type==="DateRange"?(t[i.sFilterKey]=i.value.sDate,t[i.eFilterKey]=i.value.eDate):t[i.filterKey??r]=i.value)}),t},RI=n=>{const e=$n.keys(n).filter(i=>i!=="");if(e.length!==1)return;const t=e[0],r=n[t];return!r||r.value===void 0||r.value===null||r.value===""?{selectedKey:t,value:void 0}:{selectedKey:t,value:r.value}},_d={applyFilteration:wI,applySortation:CI,applyPagination:_I,getPages:G3,getRangedPages:SI,downloadCsv:EI,getSingleFilterValue:TI,getMultiFilterValues:AI,getSelectFilterValue:RI},II="_ATable_12zow_1",kI={ATable:II};function Y3(n,e,t,r){const i=Gn.c(6);let o,l;i[0]!==e||i[1]!==n||i[2]!==t||i[3]!==r?(o=()=>{if(n)return n.addEventListener(e,t,r),()=>{n.removeEventListener(e,t,r)}},l=[n,e,t,r],i[0]=e,i[1]=n,i[2]=t,i[3]=r,i[4]=o,i[5]=l):(o=i[4],l=i[5]),B.useEffect(o,l)}const MI="_BodyHeader_ys4y0_1",LI="_TRow_ys4y0_7",OI="_OverflowSpace_ys4y0_11",PI="_BodyBody_ys4y0_16",DI="_IsSelected_ys4y0_35",NI="_IsSelectable_ys4y0_39",FI="_IsRowMarked_ys4y0_47",BI="_TH_ys4y0_52",zI="_TD_ys4y0_57",HI="_IsMarked_ys4y0_57",WI="_Resizer_ys4y0_76",UI="_IsMoving_ys4y0_88",GI="_IsResizable_ys4y0_91",YI="_ResizerCenter_ys4y0_94",VI="_ResizerOut_ys4y0_100",ZI="_ResizerIn_ys4y0_104",XI="_IsClicked_ys4y0_139",KI="_NoItems_ys4y0_146",JI="_Content_ys4y0_152",Zl={BodyHeader:MI,TRow:LI,OverflowSpace:OI,BodyBody:PI,IsSelected:DI,IsSelectable:NI,IsRowMarked:FI,TH:BI,TD:zI,IsMarked:HI,Resizer:WI,IsMoving:UI,IsResizable:GI,ResizerCenter:YI,ResizerOut:VI,ResizerIn:ZI,IsClicked:XI,NoItems:KI,Content:JI},jd=25,sb=50,QI=n=>{const e=Gn.c(119),{defs:t,isEqual:r,rProps:i,useSelect:o,isTableDisabled:l,isSelectMulti:a,selectDisabled:h,appliedFilteration:g,useSortation:m,pagination:x,pagedItems:w,noMarking:_,noDefHeader:S,isLoading:R,onScrollToSelectedReady:k,showRows:O,RowRenderer:P,isRowRendered:z,rowHeight:H,resources:G}=n,N=P===void 0?$I:P;let J;e[0]!==o?(J=o??[],e[0]=o,e[1]=J):J=e[1];const[Y,K]=J;let fe;e[2]!==r||e[3]!==a||e[4]!==l||e[5]!==h||e[6]!==Y||e[7]!==K?(fe=Se=>{l||!K||!Y||h!=null&&h(Se)||(a?Y.some(tt=>r(tt,Se))?K(Y.filter(tt=>!r(tt,Se))):K([...Y,Se]):K([Se]))},e[2]=r,e[3]=a,e[4]=l,e[5]=h,e[6]=Y,e[7]=K,e[8]=fe):fe=e[8];const X=fe;let te,ne;e[9]!==a||e[10]!==Y||e[11]!==K?(te=()=>{a||!Y||!K||Y.length>1&&K([Y[Y.length-1]])},ne=[Y,K,a],e[9]=a,e[10]=Y,e[11]=K,e[12]=te,e[13]=ne):(te=e[12],ne=e[13]),B.useEffect(te,ne);let ue,se;e[14]!==h||e[15]!==Y||e[16]!==K?(ue=()=>{if(!Y||!K)return;Y.filter(tt=>h==null?void 0:h(tt)).length>0&&K(Y.filter(tt=>!(h!=null&&h(tt))))},se=[Y,K,h],e[14]=h,e[15]=Y,e[16]=K,e[17]=ue,e[18]=se):(ue=e[17],se=e[18]),B.useEffect(ue,se);const[$,re]=m;let ge;e[19]!==re||e[20]!==$?(ge=(Se,tt)=>{re&&(($==null?void 0:$.defKey)===Se?$.isAsc===!0?re({defKey:Se,isAsc:!1,sortF:tt}):$.isAsc===!1?re(void 0):re({defKey:Se,isAsc:!0,sortF:tt}):re({defKey:Se,isAsc:!0,sortF:tt}))},e[19]=re,e[20]=$,e[21]=ge):ge=e[21];const me=ge;let oe;e[22]===Symbol.for("react.memo_cache_sentinel")?(oe={elem:null,row:null},e[22]=oe):oe=e[22];const[Q,pe]=B.useState(oe),Ie=B.useRef(null),Fe=B.useRef(null);let xe;e[23]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>pe({elem:Ie.current,row:Fe.current}),e[23]=xe):xe=e[23];const Oe=xe;let Le;e[24]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>Oe(),e[24]=Le):Le=e[24];let He;e[25]!==w.length?(He=[w.length,Oe],e[25]=w.length,e[26]=He):He=e[26],B.useEffect(Le,He),Y3(window,"resize",Oe);const[Te,ke]=B.useState(H);let Be;e[27]!==Q?(Be=()=>{const{row:Se}=Q;Se!=null&&ke(Se.clientHeight)},e[27]=Q,e[28]=Be):Be=e[28];let rt;e[29]!==Q||e[30]!==Te?(rt=[Q,Te],e[29]=Q,e[30]=Te,e[31]=rt):rt=e[31],B.useEffect(Be,rt);let Re;e:{const{elem:Se}=Q;if(!Se){Re=0;break e}Re=Math.floor(Se.clientHeight/Te)}const ut=Re;let qe;O?qe=O:w.length<=ut?qe=ut:qe=w.length;const ot=qe;let st;O===void 0?st=void 0:st=O*Te;const bt=st,Mt=bt;let Bt;e:{const{elem:Se}=Q;if(!Se){Bt=!1;break e}let tt;e[32]!==Se?(tt=Se.getBoundingClientRect(),e[32]=Se,e[33]=tt):tt=e[33],Bt=tt.height/Te<w.length}const at=Bt,[Ye,Tt]=B.useState();let Ut;const{elem:gt}=Q;!Ye||!gt?Ut="100%":Ut=gt.clientHeight+(z?0:50);const Ht=Ut,xt=B.useRef(null);let pn;e[34]===Symbol.for("react.memo_cache_sentinel")?(pn={},e[34]=pn):pn=e[34];const[$t,sn]=B.useState(pn);let Xt;e[35]===Symbol.for("react.memo_cache_sentinel")?(Xt={x:0,y:0},e[35]=Xt):Xt=e[35];const bn=B.useRef(Xt);let hn;e[36]===Symbol.for("react.memo_cache_sentinel")?(hn={},e[36]=hn):hn=e[36];const Rn=B.useRef(hn);let vn;e[37]!==$t?(vn=$n.keys($t),e[37]=$t,e[38]=vn):vn=e[38];const We=vn;let Ce;e[39]!==t?(Ce=(Se,tt)=>{const At=xt.current;if(!At)return;const Sn=[];At.childNodes.forEach(pr=>{pr.classList.contains(Zl.TH)&&Sn.push(pr)});const In={};$n.keys(t).forEach((pr,On)=>{const tr=Sn[On];if(!tr)return;const An=tr.getBoundingClientRect().width;In[pr]=An}),Rn.current=In,Tt(tt),bn.current={x:Se.clientX,y:Se.clientY};const Yn=pr=>{if(!xt.current)return;const tr=pr.clientX-bn.current.x,An=jI(t,tt,Rn.current,tr);sn(An)};document.addEventListener("mousemove",Yn);const lr=()=>{Tt(void 0),document.removeEventListener("mousemove",Yn),document.removeEventListener("mouseup",lr)};document.addEventListener("mouseup",lr)},e[39]=t,e[40]=Ce):Ce=e[40];const it=Ce;let Ct;e[41]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>{Tt(void 0),sn({})},e[41]=Ct):Ct=e[41];const Qt=Ct;let Yt;e:{if(We.length===0){let tt;if(e[42]!==t){tt={};const At=$n.keys(t);for(let Sn=0;Sn<At.length;Sn++){const In=At[Sn],Yn=t[In],lr=Ur.getContent(Yn.colSpan,{defKey:In,def:Yn}),pr=Yn.width??80,On=Yn.minWidth??jd,tr=Yn.maxWidth,An={width:pr,minWidth:On,maxWidth:tr,flexGrow:lr??1};if(tt[In]=An,lr!==void 0){for(let sr=1;sr<Math.min(lr,At.length-Sn);sr++){const hr=t[At[Sn+sr]],ho=hr.width??80,So=hr.minWidth??jd,oo=hr.maxWidth;An.width=An.width+ho,An.minWidth=An.minWidth+So,An.maxWidth!==void 0&&(oo!==void 0?An.maxWidth=An.maxWidth+oo:An.maxWidth=void 0)}Sn=Sn+(lr-1)}}e[42]=t,e[43]=tt}else tt=e[43];Yt=tt;break e}let Se;if(e[44]!==t||e[45]!==$t){Se={};const tt=$n.keys(t);for(let At=0;At<tt.length;At++){const Sn=tt[At],In=t[Sn],Yn=$t[Sn],lr=Ur.getContent(In.colSpan,{defKey:Sn,def:In}),pr=In.minWidth??jd,On=In.maxWidth,tr={width:Yn,minWidth:pr,maxWidth:On,flexGrow:lr??1};if(Se[Sn]=tr,lr!==void 0){for(let An=1;An<Math.min(lr,tt.length-At);An++){const sr=t[tt[At+An]],hr=$t[tt[At+An]],ho=sr.minWidth??jd,So=sr.maxWidth;tr.width=tr.width+hr,tr.minWidth=tr.minWidth+ho,tr.maxWidth!==void 0&&(So!==void 0?tr.maxWidth=tr.maxWidth+So:tr.maxWidth=void 0)}At=At+(lr-1)}}e[44]=t,e[45]=$t,e[46]=Se}else Se=e[46];Yt=Se}const yn=Yt,gn=B.useRef(null);let lt;e[47]!==g?(lt=_d.getSingleFilterValue(g),e[47]=g,e[48]=lt):lt=e[48];const kt=lt;let vt;e[49]===Symbol.for("react.memo_cache_sentinel")?(vt=()=>{Ie.current&&Ie.current.scrollTo({top:0})},e[49]=vt):vt=e[49];let zt;e[50]!==x.page?(zt=[x.page],e[50]=x.page,e[51]=zt):zt=e[51],B.useEffect(vt,zt);let Lt;e[52]!==Y?(Lt=Se=>{const tt=Se===void 0?"center":Se;Y&&Y.length>0&&requestAnimationFrame(()=>{var At;return(At=Fe.current)==null?void 0:At.scrollIntoView({behavior:"auto",block:tt})})},e[52]=Y,e[53]=Lt):Lt=e[53];const yt=Lt;let Rt,on;e[54]!==k||e[55]!==yt?(Rt=()=>{k==null||k(yt)},on=[k,yt],e[54]=k,e[55]=yt,e[56]=Rt,e[57]=on):(Rt=e[56],on=e[57]),B.useEffect(Rt,on);let En;e[58]!==R?(En=M.jsx(Am,{isLoading:R}),e[58]=R,e[59]=En):En=e[59];let Jt;e[60]!==Ye?(Jt=dt.clsx(Zl.BodyHeader,Ye!==void 0&&Zl.IsClicked),e[60]=Ye,e[61]=Jt):Jt=e[61];const xn=S||z?"none":"flex";let _n;e[62]!==xn?(_n={display:xn},e[62]=xn,e[63]=_n):_n=e[63];let zn;e[64]===Symbol.for("react.memo_cache_sentinel")?(zn={minHeight:sb,maxHeight:sb},e[64]=zn):zn=e[64];let er;e[65]!==Ye||e[66]!==t||e[67]!==$t||e[68]!==Ht||e[69]!==it||e[70]!==me||e[71]!==($==null?void 0:$.defKey)||e[72]!==($==null?void 0:$.isAsc)||e[73]!==We?(er=$n.map(t,(Se,tt)=>{const[At]=Se,Sn=t[At],In=Ur.getContent(Sn.hContent,{defKey:At,def:Sn}),Yn=Sn.name,lr=tt===$n.keys(t).length-1,pr=Sn.width??80,On=Sn.minWidth??jd,tr=Sn.maxWidth,An={width:pr,minWidth:On,maxWidth:tr,justifyContent:Ur.getContent(Sn.hAlign,{defKey:At,def:Sn})??"flex-start",...Ur.getContent(Sn.hStyle,{defKey:At,def:Sn})};We.includes(At)&&(An.width=$t[At]);const sr=Sn.isSortable,hr=($==null?void 0:$.defKey)===At,ho=$==null?void 0:$.isAsc;return M.jsxs(B.Fragment,{children:[M.jsxs("div",{className:dt.clsx(Zl.TH,"Label1",sr?"IsClickable":"NoSelect"),style:An,onClick:()=>sr&&me(At,Sn.sortF),children:[M.jsx(nd,{children:In??Yn,className:Zl.Content}),sr&&M.jsx(fo,{icon:hr?ho?"SortUp":"SortDown":"SortBoth",style:{width:16,height:16}})]}),!lr&&M.jsxs("div",{className:dt.sclsx(Zl,"Resizer","IsResizable","NoSelect",Ye!==void 0&&"IsMoving"),onDoubleClick:Qt,onMouseDown:So=>it(So,At),children:[M.jsx("div",{className:Zl.ResizerOut}),M.jsx("div",{className:Zl.ResizerIn}),M.jsx("div",{className:Zl.ResizerCenter,style:{height:Ht}}),M.jsx("div",{className:Zl.ResizerIn}),M.jsx("div",{className:Zl.ResizerOut})]}),lr&&M.jsx(cs,{className:Zl.OverflowSpace,h:sb,style:{color:An.color,backgroundColor:An.backgroundColor,transition:An.transition},w:"var(--Scrollbar-width)"})]},At)}),e[65]=Ye,e[66]=t,e[67]=$t,e[68]=Ht,e[69]=it,e[70]=me,e[71]=$==null?void 0:$.defKey,e[72]=$==null?void 0:$.isAsc,e[73]=We,e[74]=er):er=e[74];let wn;e[75]!==er?(wn=M.jsx("div",{ref:xt,className:Zl.TRow,style:zn,children:er}),e[75]=er,e[76]=wn):wn=e[76];let ri;e[77]!==Jt||e[78]!==_n||e[79]!==wn?(ri=M.jsx("div",{ref:gn,className:Jt,style:_n,children:wn}),e[77]=Jt,e[78]=_n,e[79]=wn,e[80]=ri):ri=e[80];let $e;e[81]!==Ye?($e=dt.clsx(Zl.BodyBody,Ye!==void 0&&Zl.IsClicked),e[81]=Ye,e[82]=$e):$e=e[82];const tn=at?"scroll":"hidden";let ln;e[83]!==Mt||e[84]!==bt||e[85]!==tn?(ln={overflowY:tn,minHeight:bt,maxHeight:Mt},e[83]=Mt,e[84]=bt,e[85]=tn,e[86]=ln):ln=e[86];let Nn;e[87]!==N||e[88]!==t||e[89]!==H||e[90]!==at||e[91]!==r||e[92]!==z||e[93]!==l||e[94]!==_||e[95]!==X||e[96]!==w||e[97]!==i||e[98]!==h||e[99]!==Y||e[100]!==K||e[101]!==kt||e[102]!==yn?(Nn=w.map((Se,tt)=>{const At=Ur.getContent(i,{item:Se}),Sn=K&&!l,In=Y==null?void 0:Y.some(On=>r(On,Se)),Yn=Y&&(h==null?void 0:h(Se)),lr=typeof Yn=="string"?Yn:void 0,pr={...Se};return z&&$n.keys(t).forEach(On=>{const tr=t[On],An=Ur.getContent(tr.content,{defKey:On,def:tr,item:Se});let sr=!1;if(kt&&!_){const hr=Ur.getContent(tr.asText,{defKey:On,def:tr,item:Se});hr!==void 0?sr=hr.toString().toLowerCase().includes(kt.toLowerCase()):["string","number"].includes(typeof An)&&An!==void 0&&An!==null&&(sr=An.toString().toLowerCase().includes(kt.toLowerCase()))}pr[On]=M.jsx("span",{className:dt.clsx(sr&&Zl.IsRowMarked),children:pr[On]})}),M.jsx(zi,{isDisabled:Yn,tooltip:lr,...At,abaseRef:In?Fe:void 0,className:dt.clsx(At==null?void 0:At.className,Sn&&Zl.IsSelectable,In&&Zl.IsSelected),onClick:On=>{var tr;X(Se),(tr=At==null?void 0:At.onClick)==null||tr.call(At,On)},children:M.jsx(N,{defs:t,isBodyBodyOverflowed:at,item:Se,markedItem:pr,noMarking:_,rowHeight:H,singleFilterValue:kt,spanWidths:yn})},tt)}),e[87]=N,e[88]=t,e[89]=H,e[90]=at,e[91]=r,e[92]=z,e[93]=l,e[94]=_,e[95]=X,e[96]=w,e[97]=i,e[98]=h,e[99]=Y,e[100]=K,e[101]=kt,e[102]=yn,e[103]=Nn):Nn=e[103];let yr;e[104]!==z||e[105]!==w.length||e[106]!==G||e[107]!==Te||e[108]!==ot?(yr=M.jsx(qI,{isRowRendered:z,itemsLength:w.length,resources:G,rowHeight:Te,showRows:ot}),e[104]=z,e[105]=w.length,e[106]=G,e[107]=Te,e[108]=ot,e[109]=yr):yr=e[109];let Ln;e[110]!==$e||e[111]!==ln||e[112]!==Nn||e[113]!==yr?(Ln=M.jsxs("div",{ref:Ie,className:$e,style:ln,children:[Nn,yr]}),e[110]=$e,e[111]=ln,e[112]=Nn,e[113]=yr,e[114]=Ln):Ln=e[114];let Pt;return e[115]!==En||e[116]!==ri||e[117]!==Ln?(Pt=M.jsxs(M.Fragment,{children:[En,ri,Ln]}),e[115]=En,e[116]=ri,e[117]=Ln,e[118]=Pt):Pt=e[118],Pt},qI=n=>{const e=Gn.c(13),{showRows:t,itemsLength:r,resources:i,isRowRendered:o,rowHeight:l}=n;let a;e:{if(r===0){a=t;break e}a=t-r}const h=a;let g;if(e[0]!==o||e[1]!==r||e[2]!==h||e[3]!==i||e[4]!==l||e[5]!==t){let m;e[7]!==o||e[8]!==r||e[9]!==i||e[10]!==l||e[11]!==t?(m=(x,w)=>M.jsx("div",{className:dt.clsx(Zl.TRow,"NoSelect"),style:{minHeight:l,maxHeight:l,...o&&{border:"none"}},children:r===0&&w===Math.floor(t/2)&&M.jsx(Ml,{className:Zl.NoItems,children:i["No Items"]})},w),e[7]=o,e[8]=r,e[9]=i,e[10]=l,e[11]=t,e[12]=m):m=e[12],g=Array.from({length:h},m),e[0]=o,e[1]=r,e[2]=h,e[3]=i,e[4]=l,e[5]=t,e[6]=g}else g=e[6];return g};function jI(n,e,t,r){const i={...t},o=$n.keys(n).findIndex(g=>g===e)+1,l=Object.entries(n);let a=o-1,h=o;if(r<0){for(;r<0&&!(a<0||h>=l.length);){const[g,m]=[l[a][0],l[a][1]],[x,w]=[l[h][0],l[h][1]],_=m.minWidth??jd,S=w.maxWidth,R=i[g],k=i[x];let O=R-_;S!==void 0&&(O=Math.min(O,S-k));let P=-r;P=Math.min(P,O),R-P<=_&&a--,S!==void 0&&k+P>=S&&h++,i[g]=R-P,i[x]=k+P,r+=P}return i}else if(r>0){for(;r>0&&!(a<0||h>=l.length);){const[g,m]=[l[a][0],l[a][1]],[x,w]=[l[h][0],l[h][1]],_=w.minWidth??jd,S=m.maxWidth,R=i[x],k=i[g];let O=R-_;S!==void 0&&(O=Math.min(O,S-k));let P=r;P=Math.min(P,O),R-P<=_&&h++,S!==void 0&&k+P>=S&&a--,i[x]=R-P,i[g]=k+P,r-=P}return i}return i}const $I=n=>{const e=Gn.c(14),{defs:t,item:r,noMarking:i,spanWidths:o,singleFilterValue:l,isBodyBodyOverflowed:a,rowHeight:h}=n;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=dt.clsx(Zl.TRow),e[0]=g):g=e[0];let m;e[1]!==h?(m={minHeight:h,maxHeight:h},e[1]=h,e[2]=m):m=e[2];let x;e[3]!==t||e[4]!==a||e[5]!==r||e[6]!==i||e[7]!==h||e[8]!==l||e[9]!==o?(x=$n.map(t,(_,S)=>{const[R]=_,k=o[R];if(k===void 0)return null;const O=S===$n.keys(t).length-1,P=t[R],z=Ur.getContent(P.content,{defKey:R,def:P,item:r}),H={width:k.width,minWidth:k.minWidth,maxWidth:k.maxWidth,flexGrow:k.flexGrow,justifyContent:Ur.getContent(P.align,{defKey:R,def:P,item:r})??"flex-start",...Ur.getContent(P.style,{defKey:R,def:P,item:r})};let G=!1;if(l&&!i){const N=Ur.getContent(P.asText,{defKey:R,def:P,item:r});N!==void 0?G=N.toString().toLowerCase().includes(l.toLowerCase()):["string","number"].includes(typeof z)&&z!==void 0&&z!==null&&(G=z.toString().toLowerCase().includes(l.toLowerCase()))}return M.jsxs(B.Fragment,{children:[M.jsx("div",{className:dt.clsx(Zl.TD,"Label1",G&&Zl.IsMarked),style:H,children:M.jsx(nd,{children:z,className:Zl.Content})}),!a&&O&&M.jsx(cs,{className:Zl.OverflowSpace,h,style:{color:H.color,backgroundColor:H.backgroundColor},w:"var(--Scrollbar-width)"})]},R)}),e[3]=t,e[4]=a,e[5]=r,e[6]=i,e[7]=h,e[8]=l,e[9]=o,e[10]=x):x=e[10];let w;return e[11]!==m||e[12]!==x?(w=M.jsx("div",{className:g,style:m,children:x}),e[11]=m,e[12]=x,e[13]=w):w=e[13],w},ek="_ATableFooter_w090q_1",tk="_Button_w090q_10",nk="_IsSelected_w090q_26",rk="_IsDisabled_w090q_31",Sh={ATableFooter:ek,Button:tk,IsSelected:nk,IsDisabled:rk},ik=n=>{const e=Gn.c(35),{pages:t,rangedPages:r,pageF:i,pagination:o}=n,l=t[t.length-1];let a;e[0]!==o.page?(a=dt.clsx(Sh.Button,o.page===1&&Sh.IsDisabled),e[0]=o.page,e[1]=a):a=e[1];let h;e[2]!==i.moveFirst||e[3]!==a?(h=M.jsx(fo,{className:a,icon:"FirstPage",onClick:i.moveFirst}),e[2]=i.moveFirst,e[3]=a,e[4]=h):h=e[4];let g;e[5]!==o.page?(g=dt.clsx(Sh.Button,o.page===1&&Sh.IsDisabled),e[5]=o.page,e[6]=g):g=e[6];let m;e[7]!==i.movePrev||e[8]!==g?(m=M.jsx(fo,{className:g,icon:"NavigateBefore",onClick:i.movePrev}),e[7]=i.movePrev,e[8]=g,e[9]=m):m=e[9];let x;if(e[10]!==i||e[11]!==o.page||e[12]!==r){let O;e[14]!==i||e[15]!==o.page?(O=P=>M.jsx("div",{className:dt.clsx(Sh.Button,"NoSelect",o.page===P&&Sh.IsSelected),onClick:()=>i.move(P),children:P},P),e[14]=i,e[15]=o.page,e[16]=O):O=e[16],x=r.map(O),e[10]=i,e[11]=o.page,e[12]=r,e[13]=x}else x=e[13];let w;e[17]!==l||e[18]!==o.page?(w=dt.clsx(Sh.Button,o.page===l&&Sh.IsDisabled),e[17]=l,e[18]=o.page,e[19]=w):w=e[19];let _;e[20]!==i.moveNext||e[21]!==w?(_=M.jsx(fo,{className:w,icon:"NavigateNext",onClick:i.moveNext}),e[20]=i.moveNext,e[21]=w,e[22]=_):_=e[22];let S;e[23]!==l||e[24]!==o.page?(S=dt.clsx(Sh.Button,o.page===l&&Sh.IsDisabled),e[23]=l,e[24]=o.page,e[25]=S):S=e[25];let R;e[26]!==i.moveLast||e[27]!==S?(R=M.jsx(fo,{className:S,icon:"LastPage",onClick:i.moveLast}),e[26]=i.moveLast,e[27]=S,e[28]=R):R=e[28];let k;return e[29]!==h||e[30]!==m||e[31]!==x||e[32]!==_||e[33]!==R?(k=M.jsxs(Ml,{className:Sh.ATableFooter,children:[h,m,x,_,R]}),e[29]=h,e[30]=m,e[31]=x,e[32]=_,e[33]=R,e[34]=k):k=e[34],k},ok="_Filter_1b9j0_1",lk="_SelectFilter_1b9j0_11",sk="_MainFilter_1b9j0_15",ak="_IsOpen_1b9j0_26",ck="_SubFilters_1b9j0_30",uk="_Input_1b9j0_44",fk="_Main_1b9j0_15",hk="_Sub_1b9j0_30",dk="_Actions_1b9j0_62",gk="_Icon_1b9j0_67",pk="_LeftIcon_1b9j0_74",vk="_CircleAlertOutline_1b9j0_79",bk="_Rotate_1b9j0_87",ni={Filter:ok,SelectFilter:lk,MainFilter:sk,IsOpen:ak,SubFilters:ck,Input:uk,Main:fk,Sub:hk,Actions:dk,Icon:gk,LeftIcon:pk,CircleAlertOutline:vk,Rotate:bk},yk=n=>{const e=Gn.c(79),{defs:t,useFilteration:r,hasToggleFilteration:i,filterF:o,isRowRendered:l,isFilterSort:a,filterType:h,resources:g,placeholder:m}=n;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[w,_]=B.useState(x),[S,R]=r,k=h==="Select";let O;e[1]!==S?(O=$n.keys(S).map(wk),e[1]=S,e[2]=O):O=e[2];const P=O,[z,H]=B.useState(k&&P.length>0?P[0]:null);let G;e[3]!==S||e[4]!==R?(G=(sn,Xt,bn)=>{if(!R)return;const hn={...S};sn.value=Xt,R(hn),_(Rn=>Rn.map((vn,We)=>We===(bn?bn+1:0)?"":vn))},e[3]=S,e[4]=R,e[5]=G):G=e[5];const N=G;let J;if(e[6]!==t||e[7]!==S||e[8]!==k||e[9]!==z){J=[];let sn=$n.keys(S);if(k&&z){let Xt;e[11]!==z?(Xt=bn=>bn===z,e[11]=z,e[12]=Xt):Xt=e[12],sn=sn.filter(Xt)}for(const Xt of sn)J.push({key:Xt,def:t[Xt],filter:S[Xt]});e[6]=t,e[7]=S,e[8]=k,e[9]=z,e[10]=J}else J=e[10];const Y=J,K=Y.length>0?Y[0]:null,fe=w.length>0?w[0]:"";let X;e[13]!==Y?(X=Y.length>1?Y.slice(1):[],e[13]=Y,e[14]=X):X=e[14];const te=X;let ne;e[15]!==w?(ne=w.length>1?w.slice(1):[],e[15]=w,e[16]=ne):ne=e[16];const ue=ne,se=te.length>0,[$,re]=B.useState(!1),[ge,me]=B.useState(!1),oe=B.useRef(null);let Q;e[17]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>re(!1),e[17]=Q):Q=e[17];const pe=Q,Ie=B.useRef(null);let Fe;e[18]===Symbol.for("react.memo_cache_sentinel")?(Fe=()=>{me(!1),re(!0),Ie.current&&(document.removeEventListener("mousedown",Ie.current),Ie.current=null)},e[18]=Fe):Fe=e[18];const xe=Fe;let Oe;e[19]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>{const sn=Xt=>{const bn=document.getElementById("root"),hn=Xt.target,Rn=oe.current;!bn||!Rn||!hn||!Rn.contains(hn)&&bn.contains(hn)&&xe()};return Ie.current=sn,sn},e[19]=Oe):Oe=e[19];const Le=Oe;let He;e[20]===Symbol.for("react.memo_cache_sentinel")?(He=()=>{re(!0),me(!0),setTimeout(()=>{const sn=Le();document.addEventListener("mousedown",sn)},0)},e[20]=He):He=e[20];const Te=He,ke=ge?xe:Te;let Be;e[21]!==w||e[22]!==Y?(Be=()=>{const sn=Y.map((Xt,bn)=>Xt.filter.type==="String"&&Xt.filter.validation?Xt.filter.validation(Xt.filter.value||""):Xt.filter.type==="Date"&&Xt.filter.validation||Xt.filter.type==="DateRange"&&Xt.filter.validation?Xt.filter.validation(Xt.filter.value):w[bn]);return _(sn),sn.every(Ck)},e[21]=w,e[22]=Y,e[23]=Be):Be=e[23];const rt=Be;let Re;e[24]!==o||e[25]!==rt?(Re=sn=>{sn.key==="Enter"?(rt()&&o.apply(),sn.stopPropagation()):sn.key==="Escape"&&(me(!1),sn.currentTarget.focus(),sn.currentTarget.blur(),sn.stopPropagation())},e[24]=o,e[25]=rt,e[26]=Re):Re=e[26];const ut=Re;let qe;e[27]!==ke||e[28]!==rt?(qe={open:Te,close:xe,toggle:ke,validate:rt},e[27]=ke,e[28]=rt,e[29]=qe):qe=e[29];const ot=qe;let st;e[30]!==o?(st=()=>{o.clear()},e[30]=o,e[31]=st):st=e[31];const bt=st;let Mt;e[32]!==o||e[33]!==S||e[34]!==R?(Mt=sn=>{if(!R||!sn)return;H(sn);const Xt={...S};$n.keys(Xt).forEach(bn=>{if(bn!==sn&&Xt[bn])e:switch(Xt[bn].type){case"String":{Xt[bn].value="";break e}case"Select":{Xt[bn].value=null;break e}case"Date":{Xt[bn].value=void 0;break e}case"DateRange":Xt[bn].value=void 0}}),_([]),R(Xt),o.clear(),setTimeout(()=>{var hn;const bn=(hn=oe.current)==null?void 0:hn.querySelector("input");bn&&bn.focus()},0)},e[32]=o,e[33]=S,e[34]=R,e[35]=Mt):Mt=e[35];const Bt=Mt;if(!K)return null;let at;e[36]!==t||e[37]!==P||e[38]!==S||e[39]!==Bt||e[40]!==k||e[41]!==z?(at=k&&M.jsx(Td,{isAutoWidth:!0,className:dt.clsx(ni.SelectFilter),options:P,type:"Secondary",useSelect:[z,Bt],OptionRenderer:sn=>{const{option:Xt}=sn,bn=t[Xt];let hn;if(bn!=null&&bn.hContent){const Rn={defKey:Xt,def:bn};hn=typeof bn.hContent=="function"?bn.hContent(Rn):bn.hContent}else{const Rn=S[Xt],vn=(bn==null?void 0:bn.name)||(Rn==null?void 0:Rn.placeholder)||String(Xt);hn=M.jsx("span",{children:vn})}return hn}}),e[36]=t,e[37]=P,e[38]=S,e[39]=Bt,e[40]=k,e[41]=z,e[42]=at):at=e[42];let Ye;e[43]===Symbol.for("react.memo_cache_sentinel")?(Ye=dt.clsx(ni.Filter),e[43]=Ye):Ye=e[43];const Tt=l?a?180:void 0:180,Ut=l?a?300:void 0:300;let gt;e[44]!==Tt||e[45]!==Ut?(gt={minWidth:Tt,maxWidth:Ut},e[44]=Tt,e[45]=Ut,e[46]=gt):gt=e[46];let Ht;e[47]!==o||e[48]!==k||e[49]!==se||e[50]!==i||e[51]!==ge||e[52]!==fe||e[53]!==K||e[54]!==N||e[55]!==m||e[56]!==ot||e[57]!==g?(Ht=M.jsx(mk,{errorMessage:fe,filterF:o,filterSet:K,hasSelectFilterType:k,hasSubFilters:se,hasToggleFilteration:i,isOpen:ge,placeholder:m,popupF:ot,resources:g,onChange:N}),e[47]=o,e[48]=k,e[49]=se,e[50]=i,e[51]=ge,e[52]=fe,e[53]=K,e[54]=N,e[55]=m,e[56]=ot,e[57]=g,e[58]=Ht):Ht=e[58];let xt;e[59]!==o||e[60]!==k||e[61]!==ge||e[62]!==$||e[63]!==N||e[64]!==bt||e[65]!==m||e[66]!==g||e[67]!==ue||e[68]!==te||e[69]!==rt?(xt=!k&&M.jsx(xk,{errorMessages:ue,filterF:o,isOpen:ge,isTransitioning:$,placeholder:m,resources:g,subFilterSets:te,validate:rt,onChange:N,onClearClick:bt,onTransitionEnd:pe}),e[59]=o,e[60]=k,e[61]=ge,e[62]=$,e[63]=N,e[64]=bt,e[65]=m,e[66]=g,e[67]=ue,e[68]=te,e[69]=rt,e[70]=xt):xt=e[70];let pn;e[71]!==ut||e[72]!==gt||e[73]!==Ht||e[74]!==xt?(pn=M.jsxs("div",{ref:oe,className:Ye,tabIndex:-1,style:gt,onKeyDown:ut,onClick:_k,children:[Ht,xt]}),e[71]=ut,e[72]=gt,e[73]=Ht,e[74]=xt,e[75]=pn):pn=e[75];let $t;return e[76]!==at||e[77]!==pn?($t=M.jsxs(M.Fragment,{children:[at,pn]}),e[76]=at,e[77]=pn,e[78]=$t):$t=e[78],$t},mk=n=>{var _,S,R,k;const e=Gn.c(181),{filterSet:t,hasToggleFilteration:r,hasSelectFilterType:i,onChange:o,filterF:l,hasSubFilters:a,popupF:h,isOpen:g,resources:m,errorMessage:x,placeholder:w}=n;if(t.filter.type==="String"){const O=t.filter.value??"";let P;e[0]!==t.filter||e[1]!==o?(P=oe=>o(t.filter,oe),e[0]=t.filter,e[1]=o,e[2]=P):P=e[2];let z;e[3]!==O||e[4]!==P?(z=[O,P],e[3]=O,e[4]=P,e[5]=z):z=e[5];const H=z,G=w??t.filter.placeholder??((_=t.def)==null?void 0:_.name),N=t.filter.icon,J=t.filter.iconTooltip??G;let Y;e[6]!==g?(Y=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[6]=g,e[7]=Y):Y=e[7];const K=N??"Type";let fe;e[8]!==J||e[9]!==g||e[10]!==K?(fe=M.jsx(Kh,{icon:K,isOpen:g,tooltip:J}),e[8]=J,e[9]=g,e[10]=K,e[11]=fe):fe=e[11];const X=t.filter.autoFocus;let te;e[12]===Symbol.for("react.memo_cache_sentinel")?(te=dt.clsx(ni.Input,ni.Main),e[12]=te):te=e[12];let ne;e[13]!==l||e[14]!==r||e[15]!==g||e[16]!==h||e[17]!==m?(ne=r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),e[13]=l,e[14]=r,e[15]=g,e[16]=h,e[17]=m,e[18]=ne):ne=e[18];const ue=G??m["Search(Placeholder)"],se=x?"Error":"Primary";let $;e[19]===Symbol.for("react.memo_cache_sentinel")?($={style:{width:"100%",boxSizing:"border-box"}},e[19]=$):$=e[19];let re;e[20]!==x||e[21]!==l||e[22]!==i||e[23]!==a||e[24]!==g||e[25]!==h||e[26]!==m?(re=M.jsx(g0,{errorMessage:x,filterF:l,hasSelectFilterType:i,hasSubFilters:a,isOpen:g,popupF:h,resources:m}),e[20]=x,e[21]=l,e[22]=i,e[23]=a,e[24]=g,e[25]=h,e[26]=m,e[27]=re):re=e[27];let ge;e[28]!==t.filter.autoFocus||e[29]!==t.filter.dataList||e[30]!==t.filter.maxLength||e[31]!==t.filter.pattern||e[32]!==se||e[33]!==re||e[34]!==ne||e[35]!==ue||e[36]!==H?(ge=M.jsx(sg,{autoFocus:X,className:te,dataList:t.filter.dataList,LeftAddon:ne,maxLength:t.filter.maxLength,pattern:t.filter.pattern,placeholder:ue,type:se,useValue:H,wrapProps:$,RightAddon:re}),e[28]=t.filter.autoFocus,e[29]=t.filter.dataList,e[30]=t.filter.maxLength,e[31]=t.filter.pattern,e[32]=se,e[33]=re,e[34]=ne,e[35]=ue,e[36]=H,e[37]=ge):ge=e[37];let me;return e[38]!==ge||e[39]!==Y||e[40]!==fe?(me=M.jsxs("div",{className:Y,children:[fe,ge]}),e[38]=ge,e[39]=Y,e[40]=fe,e[41]=me):me=e[41],me}else if(t.filter.type==="Select"){const O=t.filter.value??null;let P;e[42]!==l||e[43]!==t.filter||e[44]!==i||e[45]!==o||e[46]!==h?(P=se=>{o(t.filter,se),i&&setTimeout(()=>{h.validate()&&l.apply()},0)},e[42]=l,e[43]=t.filter,e[44]=i,e[45]=o,e[46]=h,e[47]=P):P=e[47];let z;e[48]!==O||e[49]!==P?(z=[O,P],e[48]=O,e[49]=P,e[50]=z):z=e[50];const H=z,G=w??t.filter.placeholder??((S=t.def)==null?void 0:S.name),N=t.filter.icon,J=t.filter.iconTooltip??G;let Y;e[51]!==g?(Y=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[51]=g,e[52]=Y):Y=e[52];const K=N??"Menu";let fe;e[53]!==J||e[54]!==g||e[55]!==K?(fe=M.jsx(Kh,{icon:K,isOpen:g,tooltip:J}),e[53]=J,e[54]=g,e[55]=K,e[56]=fe):fe=e[56];let X;e[57]===Symbol.for("react.memo_cache_sentinel")?(X=dt.clsx(ni.Input,ni.Main),e[57]=X):X=e[57];let te;e[58]!==l||e[59]!==t.filter.placeholder||e[60]!==i||e[61]!==a||e[62]!==r||e[63]!==g||e[64]!==G||e[65]!==h||e[66]!==m?(te=se=>{const{OptionRenderer:$,selectedOption:re}=se;return re===null?G||t.filter.placeholder:M.jsxs(M.Fragment,{children:[r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),M.jsx($,{option:re}),M.jsx(g0,{filterF:l,hasSelectFilterType:i,hasSubFilters:a,hideSearchButton:!0,isOpen:g,popupF:h,resources:m})]})},e[58]=l,e[59]=t.filter.placeholder,e[60]=i,e[61]=a,e[62]=r,e[63]=g,e[64]=G,e[65]=h,e[66]=m,e[67]=te):te=e[67];let ne;e[68]!==t.filter.OptionRenderer||e[69]!==t.filter.options||e[70]!==G||e[71]!==te||e[72]!==H?(ne=M.jsx(Td,{className:X,OptionRenderer:t.filter.OptionRenderer,options:t.filter.options,placeholder:G,useSelect:H,SelectedRenderer:te}),e[68]=t.filter.OptionRenderer,e[69]=t.filter.options,e[70]=G,e[71]=te,e[72]=H,e[73]=ne):ne=e[73];let ue;return e[74]!==Y||e[75]!==fe||e[76]!==ne?(ue=M.jsxs("div",{className:Y,children:[fe,ne]}),e[74]=Y,e[75]=fe,e[76]=ne,e[77]=ue):ue=e[77],ue}else if(t.filter.type==="Date"){let O;e[78]!==t.filter||e[79]!==o?(O=pe=>o(t.filter,pe),e[78]=t.filter,e[79]=o,e[80]=O):O=e[80];let P;e[81]!==t.filter.value||e[82]!==O?(P=[t.filter.value,O],e[81]=t.filter.value,e[82]=O,e[83]=P):P=e[83];const z=P,H=w??t.filter.placeholder??((R=t.def)==null?void 0:R.name),G=t.filter.icon,N=t.filter.iconTooltip??H;let J;e[84]!==g?(J=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[84]=g,e[85]=J):J=e[85];const Y=G??"CalendarDay";let K;e[86]!==N||e[87]!==g||e[88]!==Y?(K=M.jsx(Kh,{icon:Y,isOpen:g,tooltip:N}),e[86]=N,e[87]=g,e[88]=Y,e[89]=K):K=e[89];let fe;e[90]===Symbol.for("react.memo_cache_sentinel")?(fe=dt.clsx(ni.DatePicker,ni.Input,ni.Main),e[90]=fe):fe=e[90];let X;e[91]!==l||e[92]!==r||e[93]!==g||e[94]!==h||e[95]!==m?(X=r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),e[91]=l,e[92]=r,e[93]=g,e[94]=h,e[95]=m,e[96]=X):X=e[96];let te;e[97]!==r||e[98]!==g?(te=!r&&M.jsx(cs,{w:g?0:6}),e[97]=r,e[98]=g,e[99]=te):te=e[99];const ne=G??"CalendarDay",ue=!g;let se;e[100]!==N||e[101]!==ne||e[102]!==ue?(se=M.jsx(Kh,{icon:ne,isOpen:ue,tooltip:N}),e[100]=N,e[101]=ne,e[102]=ue,e[103]=se):se=e[103];const $=g?8:0;let re;e[104]!==$?(re=M.jsx(cs,{w:$}),e[104]=$,e[105]=re):re=e[105];let ge;e[106]!==se||e[107]!==re||e[108]!==X||e[109]!==te?(ge=M.jsxs(M.Fragment,{children:[X,te,se,re]}),e[106]=se,e[107]=re,e[108]=X,e[109]=te,e[110]=ge):ge=e[110];let me;e[111]!==l||e[112]!==i||e[113]!==a||e[114]!==g||e[115]!==h||e[116]!==m?(me=M.jsx(g0,{filterF:l,hasSelectFilterType:i,hasSubFilters:a,isOpen:g,popupF:h,resources:m}),e[111]=l,e[112]=i,e[113]=a,e[114]=g,e[115]=h,e[116]=m,e[117]=me):me=e[117];let oe;e[118]!==t.filter.maxDate||e[119]!==t.filter.minDate||e[120]!==H||e[121]!==ge||e[122]!==me||e[123]!==z?(oe=M.jsx(Em,{className:fe,maxDate:t.filter.maxDate,minDate:t.filter.minDate,placeholder:H,type:"Raw",useDate:z,LeftAddon:ge,RightAddon:me}),e[118]=t.filter.maxDate,e[119]=t.filter.minDate,e[120]=H,e[121]=ge,e[122]=me,e[123]=z,e[124]=oe):oe=e[124];let Q;return e[125]!==oe||e[126]!==J||e[127]!==K?(Q=M.jsxs("div",{className:J,children:[K,oe]}),e[125]=oe,e[126]=J,e[127]=K,e[128]=Q):Q=e[128],Q}else if(t.filter.type==="DateRange"){let O;e[129]!==t.filter||e[130]!==o?(O=Ie=>o(t.filter,Ie),e[129]=t.filter,e[130]=o,e[131]=O):O=e[131];let P;e[132]!==t.filter.value||e[133]!==O?(P=[t.filter.value,O],e[132]=t.filter.value,e[133]=O,e[134]=P):P=e[134];const z=P,{noDefaultChoices:H}=t.filter,G=w??t.filter.placeholder??((k=t.def)==null?void 0:k.name),N=t.filter.icon,J=t.filter.iconTooltip??G;let Y;e[135]!==g?(Y=dt.clsx(ni.MainFilter,g&&ni.IsOpen),e[135]=g,e[136]=Y):Y=e[136];const K=N??"CalendarDay";let fe;e[137]!==J||e[138]!==g||e[139]!==K?(fe=M.jsx(Kh,{icon:K,isOpen:g,tooltip:J}),e[137]=J,e[138]=g,e[139]=K,e[140]=fe):fe=e[140];let X;e[141]===Symbol.for("react.memo_cache_sentinel")?(X=dt.clsx(ni.DatePicker,ni.Input,ni.Main),e[141]=X):X=e[141];let te;e[142]!==l||e[143]!==r||e[144]!==g||e[145]!==h||e[146]!==m?(te=r&&M.jsx(d0,{isOpen:g,filterF:l,popupF:h,resources:m}),e[142]=l,e[143]=r,e[144]=g,e[145]=h,e[146]=m,e[147]=te):te=e[147];let ne;e[148]!==r||e[149]!==g?(ne=!r&&M.jsx(cs,{w:g?0:6}),e[148]=r,e[149]=g,e[150]=ne):ne=e[150];const ue=N??"CalendarDay",se=!g;let $;e[151]!==J||e[152]!==ue||e[153]!==se?($=M.jsx(Kh,{icon:ue,isOpen:se,tooltip:J}),e[151]=J,e[152]=ue,e[153]=se,e[154]=$):$=e[154];const re=g?8:0;let ge;e[155]!==re?(ge=M.jsx(cs,{w:re}),e[155]=re,e[156]=ge):ge=e[156];let me;e[157]!==$||e[158]!==ge||e[159]!==te||e[160]!==ne?(me=M.jsxs(M.Fragment,{children:[te,ne,$,ge]}),e[157]=$,e[158]=ge,e[159]=te,e[160]=ne,e[161]=me):me=e[161];let oe;e[162]!==l||e[163]!==i||e[164]!==a||e[165]!==g||e[166]!==h||e[167]!==m?(oe=M.jsx(g0,{filterF:l,hasSelectFilterType:i,hasSubFilters:a,isOpen:g,popupF:h,resources:m}),e[162]=l,e[163]=i,e[164]=a,e[165]=g,e[166]=h,e[167]=m,e[168]=oe):oe=e[168];let Q;e[169]!==t.filter.maxDate||e[170]!==t.filter.minDate||e[171]!==H||e[172]!==G||e[173]!==me||e[174]!==oe||e[175]!==z?(Q=M.jsx(_m,{className:X,maxDate:t.filter.maxDate,minDate:t.filter.minDate,noDefaultChoices:H,placeholder:G,type:"Raw",useDateRange:z,LeftAddon:me,RightAddon:oe}),e[169]=t.filter.maxDate,e[170]=t.filter.minDate,e[171]=H,e[172]=G,e[173]=me,e[174]=oe,e[175]=z,e[176]=Q):Q=e[176];let pe;return e[177]!==Q||e[178]!==Y||e[179]!==fe?(pe=M.jsxs("div",{className:Y,children:[fe,Q]}),e[177]=Q,e[178]=Y,e[179]=fe,e[180]=pe):pe=e[180],pe}return null},d0=n=>{const e=Gn.c(10),{filterF:t,popupF:r,resources:i,isOpen:o}=n,l=o?0:24,a=o?0:8;let h;e[0]!==l||e[1]!==a?(h={width:l,marginLeft:a},e[0]=l,e[1]=a,e[2]=h):h=e[2];const g=i["Toggle Filter"];let m;e[3]!==t||e[4]!==r?(m=w=>{w.currentTarget.classList.add(ni.Rotate),t.toggle(),r.close(),w.stopPropagation()},e[3]=t,e[4]=r,e[5]=m):m=e[5];let x;return e[6]!==h||e[7]!==g||e[8]!==m?(x=M.jsx(ba,{className:ni.Icon,icon:"Convert",style:h,tooltip:g,type:"Raw",onMouseDown:Sk,onClick:m}),e[6]=h,e[7]=g,e[8]=m,e[9]=x):x=e[9],x},g0=n=>{const e=Gn.c(29),{hasSubFilters:t,popupF:r,isOpen:i,resources:o,errorMessage:l,hideSearchButton:a,hasSelectFilterType:h,filterF:g}=n;let m;e[0]!==r?(m=G=>{G.stopPropagation(),r.open()},e[0]=r,e[1]=m):m=e[1];const x=m;let w;e[2]!==r?(w=G=>{G.stopPropagation(),r.close()},e[2]=r,e[3]=w):w=e[3];const _=w;let S;e[4]!==g||e[5]!==r?(S=G=>{G.stopPropagation(),r.validate()&&g.apply()},e[4]=g,e[5]=r,e[6]=S):S=e[6];const R=S;let k;e[7]!==l?(k=l&&M.jsx(ba,{className:ni.CircleAlertOutline,icon:"CircleAlertOutline",iconSize:"xs",tooltip:l,type:"Raw"}),e[7]=l,e[8]=k):k=e[8];let O;e[9]!==h||e[10]!==t||e[11]!==i||e[12]!==x?(O=t&&!h&&M.jsx(ba,{className:ni.Icon,icon:"ListAdd",type:"Raw",style:{opacity:+!i,visibility:+!i?"visible":"hidden",marginRight:-24,pointerEvents:i?"none":void 0},onClick:x}),e[9]=h,e[10]=t,e[11]=i,e[12]=x,e[13]=O):O=e[13];let P;e[14]!==h||e[15]!==t||e[16]!==i||e[17]!==_?(P=t&&!h&&M.jsx(ba,{className:ni.Icon,icon:"ListRemove",type:"Raw",style:{opacity:+i,visibility:+i?"visible":"hidden",marginRight:i?-24:0,pointerEvents:i?void 0:"none"},onClick:_}),e[14]=h,e[15]=t,e[16]=i,e[17]=_,e[18]=P):P=e[18];let z;e[19]!==a||e[20]!==i||e[21]!==R||e[22]!==o?(z=!a&&M.jsx(ba,{className:ni.Icon,icon:"Search",tooltip:o["Search(Button)"],type:"Raw",style:{opacity:+!i,visibility:+!i?"visible":"hidden",pointerEvents:i?"none":void 0,marginRight:4},onClick:R}),e[19]=a,e[20]=i,e[21]=R,e[22]=o,e[23]=z):z=e[23];let H;return e[24]!==k||e[25]!==O||e[26]!==P||e[27]!==z?(H=M.jsxs(B.Fragment,{children:[k,O,P,z]}),e[24]=k,e[25]=O,e[26]=P,e[27]=z,e[28]=H):H=e[28],H},xk=n=>{const e=Gn.c(31),{subFilterSets:t,onChange:r,onClearClick:i,isOpen:o,isTransitioning:l,onTransitionEnd:a,resources:h,errorMessages:g,placeholder:m,filterF:x,validate:w}=n;if(!o&&!l)return null;const _=+o,S=+o?"visible":"hidden";let R;e[0]!==_||e[1]!==S?(R={opacity:_,visibility:S},e[0]=_,e[1]=S,e[2]=R):R=e[2];let k;if(e[3]!==g||e[4]!==m||e[5]!==r||e[6]!==h||e[7]!==t){let Y;e[9]!==g||e[10]!==m||e[11]!==r||e[12]!==h?(Y=(K,fe)=>{var X,te,ne,ue;if(K.filter.type==="String"){const se=[K.filter.value??"",oe=>r(K.filter,oe,fe)],$=g[fe],re=m??K.filter.placeholder??((X=K.def)==null?void 0:X.name),ge=K.filter.icon,me=K.filter.iconTooltip??re;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:ge??"Type",tooltip:me}),M.jsx(sg,{autoFocus:K.filter.autoFocus,className:dt.clsx(ni.Input,ni.Sub),dataList:K.filter.dataList,maxLength:K.filter.maxLength,pattern:K.filter.pattern,placeholder:re??h["Search(Placeholder)"],type:$?"Error":"Secondary",useValue:se,wrapProps:{style:{width:"100%"}},RightAddon:$&&M.jsx(ba,{className:ni.CircleAlertOutline,icon:"CircleAlertOutline",iconSize:"xs",tooltip:$,type:"Raw"})}),M.jsx(cs,{h:8})]},fe)}else if(K.filter.type==="Select"){const se=[K.filter.value??null,me=>r(K.filter,me)],$=m??K.filter.placeholder??((te=K.def)==null?void 0:te.name),re=K.filter.icon,ge=K.filter.iconTooltip??$;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:re??"Menu",tooltip:ge}),M.jsx(Td,{arrowProps:{style:{marginRight:4}},className:dt.clsx(ni.Input,ni.Sub),OptionRenderer:K.filter.OptionRenderer,options:K.filter.options,placeholder:$,type:"Secondary",useSelect:se}),M.jsx(cs,{h:8})]},fe)}else if(K.filter.type==="Date"){const se=[K.filter.value,me=>r(K.filter,me)],$=m??K.filter.placeholder??((ne=K.def)==null?void 0:ne.name),re=K.filter.icon,ge=K.filter.iconTooltip??$;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:re??"CalendarDay",tooltip:ge}),M.jsx(Em,{className:dt.clsx(ni.DatePicker,ni.Input,ni.Sub),LeftAddon:M.jsx(cs,{w:12}),maxDate:K.filter.maxDate,minDate:K.filter.minDate,placeholder:$,type:"Raw",useDate:se}),M.jsx(cs,{h:8})]},fe)}else if(K.filter.type==="DateRange"){const se=[K.filter.value,oe=>r(K.filter,oe)],{noDefaultChoices:$}=K.filter,re=m??K.filter.placeholder??((ue=K.def)==null?void 0:ue.name),ge=K.filter.icon,me=K.filter.iconTooltip??re;return M.jsxs(Ml,{style:{marginBottom:6},children:[M.jsx(Kh,{icon:ge??"CalendarDay",tooltip:me}),M.jsx(_m,{className:dt.clsx(ni.DatePicker,ni.Input,ni.Sub),LeftAddon:M.jsx(cs,{w:12}),maxDate:K.filter.maxDate,minDate:K.filter.minDate,noDefaultChoices:$,placeholder:re,type:"Raw",useDateRange:se})]},fe)}else return null},e[9]=g,e[10]=m,e[11]=r,e[12]=h,e[13]=Y):Y=e[13],k=t.map(Y),e[3]=g,e[4]=m,e[5]=r,e[6]=h,e[7]=t,e[8]=k}else k=e[8];const O=h["Clear(Button)"];let P;e[14]!==i||e[15]!==O?(P=M.jsx(Ic,{type:"Secondary",onClick:i,children:O}),e[14]=i,e[15]=O,e[16]=P):P=e[16];let z;e[17]!==x||e[18]!==w?(z=()=>{w()&&x.apply()},e[17]=x,e[18]=w,e[19]=z):z=e[19];const H=h["Search(Button)"];let G;e[20]!==z||e[21]!==H?(G=M.jsx(Ic,{onClick:z,children:H}),e[20]=z,e[21]=H,e[22]=G):G=e[22];let N;e[23]!==P||e[24]!==G?(N=M.jsxs(Ml,{className:ni.Actions,children:[P,G]}),e[23]=P,e[24]=G,e[25]=N):N=e[25];let J;return e[26]!==a||e[27]!==R||e[28]!==k||e[29]!==N?(J=M.jsxs("div",{className:ni.SubFilters,style:R,onTransitionEnd:a,children:[k,N]}),e[26]=a,e[27]=R,e[28]=k,e[29]=N,e[30]=J):J=e[30],J},Kh=n=>{const e=Gn.c(8),{icon:t,tooltip:r,isOpen:i}=n,o=i===void 0?!0:i,l=o?24:0,a=o?4:0,h=+o;let g;e[0]!==l||e[1]!==a||e[2]!==h?(g={width:l,marginRight:a,opacity:h},e[0]=l,e[1]=a,e[2]=h,e[3]=g):g=e[3];let m;return e[4]!==t||e[5]!==g||e[6]!==r?(m=M.jsx(ba,{className:ni.LeftIcon,icon:t,tooltip:r,type:"Raw",style:g}),e[4]=t,e[5]=g,e[6]=r,e[7]=m):m=e[7],m};function wk(n){return String(n)}function Ck(n){return!n}function _k(n){n.preventDefault(),n.stopPropagation()}function Sk(n){return n.currentTarget.classList.remove(ni.Rotate)}const Ek="_ATableHeader_1hzfz_1",Tk="_LeftHeaderContent_1hzfz_11",Ak="_RightHeaderContent_1hzfz_19",Rk="_TopRightAddon_1hzfz_27",Ik="_HItem_1hzfz_32",Sg={ATableHeader:Ek,LeftHeaderContent:Tk,RightHeaderContent:Ak,TopRightAddon:Rk,HItem:Ik},kk=n=>{const{defs:e,title:t,totalCount:r,useCheck:i,useFilteration:o,hasToggleFilteration:l,filterF:a,noFilter:h,noCount:g,isFiltered:m,TopLeftAddon:x,TopRightAddon:w,useSortation:_,resources:S=Or.ATable,filterType:R,placeholder:k}=n,[O]=B.useMemo(()=>i||[],[i]),P=B.useMemo(()=>m?S["Searched n items"](r):S["Total n items"](r),[S,m,r]),[z]=o,[H,G]=_,[N,J]=B.useState(!1),Y=B.useMemo(()=>{const re=$n.values(z).filter(oe=>oe.type==="DateRange"),ge=$n.keys(z).filter(oe=>re.includes(z[oe])),me=$n.keys(e).filter(oe=>e[oe].isSortable);return ge.length>0?(ge.length>1&&J(!0),me.map(Q=>ge.includes(Q)?[Q+"_Asc",Q+"_Desc"]:Q).flat()):me},[e,z]),K=B.useMemo(()=>n.isRowRendered&&Y.length>0,[Y.length,n.isRowRendered]),fe=B.useCallback((re,ge)=>{G&&(H==null?void 0:H.defKey)===re&&(H.isAsc===!0?G({defKey:re,isAsc:!1,sortF:ge}):G({defKey:re,isAsc:!0,sortF:ge}))},[H,G]),X=B.useRef(null),[te,ne]=B.useState(),[ue,se]=B.useState(H?H.defKey:Y[0]),$=B.useMemo(()=>{if(!te)return{};const re=e[te];return{SortUp:{onClick:()=>{G==null||G({defKey:te,isAsc:!0,sortF:re.sortF}),se(te)},content:()=>S["Sort up"]},SortDown:{onClick:()=>{G==null||G({defKey:te,isAsc:!1,sortF:re.sortF}),se(te)},content:()=>S["Sort down"]}}},[G,te,e,S]);return M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:dt.clsx(Sg.ATableHeader),children:[M.jsxs("div",{className:dt.clsx(Sg.LeftHeaderContent,"NoSelect"),children:[M.jsxs(Ml,{style:{marginBottom:K?8:0},children:[x&&M.jsx("div",{className:dt.clsx(Sg.HItem),children:x}),t&&M.jsx("div",{className:dt.clsx(Sg.HItem),style:{whiteSpace:"nowrap"},children:t}),!g&&M.jsxs("div",{className:dt.clsx(Sg.HItem),style:{maxHeight:14,...K&&{minHeight:14,color:"var(--label-neutral)"}},children:[P,O&&O.length>0&&M.jsxs(M.Fragment,{children:[" / ",S["Checked n items"](O.length)]})]})]}),K&&M.jsx(H3,{options:Y,optionWidth:"fit-content",tabProps:{style:{marginRight:8}},type:"Tertiary",useSelect:[ue,()=>{}],optionProps:{style:{cursor:"default"},onClick:re=>{var oe;const ge=re.currentTarget.textContent;if(ge===S[ge])return;re.currentTarget.querySelector("svg")===null&&((oe=X.current)==null||oe.open(re.currentTarget))}},OptionRenderer:re=>{const ge=/_Asc|_Desc/.test(re.option),me=(H==null?void 0:H.defKey)===re.option,oe=ue===re.option,Q=H==null?void 0:H.isAsc,pe=()=>{if(ge){ne(void 0),se(re.option);const[xe,Oe]=re.option.split("_"),Le=Oe==="Asc";G==null||G({defKey:xe,isAsc:Le,sortF:e[xe].sortF})}else oe?fe(re.option,e[re.option].sortF):ne(re.option)},Fe=ge?(xe=>{const[Oe,Le]=xe.split("_");return(N?Oe+" ":"")+S[Le]})(re.option):S["Sort by x"](re.option);return M.jsxs(Ml,{className:dt.clsx(!(ge&&oe)&&"IsClickable"),style:{height:"100%"},onClick:pe,children:[Fe,oe&&!ge&&M.jsx(fo,{icon:me?Q?"RowSortUp":"RowSortDown":"RowSortBoth",style:{marginRight:-5,marginLeft:4}})]},re.option)}})]}),M.jsx(zg,{}),M.jsxs("div",{className:dt.clsx(Sg.RightHeaderContent,"NoSelect"),children:[!h&&M.jsx(yk,{defs:e,filterF:a,filterType:R,hasToggleFilteration:l,isFilterSort:Y.length>0,isRowRendered:n.isRowRendered,placeholder:k,resources:S,useFilteration:o}),w&&M.jsx(Ml,{children:w,className:dt.clsx(Sg.TopRightAddon)})]})]}),M.jsx(B3,{actionRef:X,defs:$,position:O1.S,width:100,onClose:()=>ne(void 0)})]})},Mk=n=>{const e=Gn.c(253),{defs:t,pk:r,defaultDef:i,rProps:o,useSelect:l,isSelectMulti:a,selectDisabled:h,useCheck:g,checkDisabled:m,isLoading:x,isDisabled:w,title:_,entireItems:S,onStateChange:R,pagedItems:k,pageNumber:O,totalCount:P,useFilteration:z,useToggleFilteration:H,filterType:G,placeholder:N,rowHeight:J,usePagination:Y,useSortation:K,showRows:fe,noHeader:X,noDefHeader:te,noFooter:ne,noFilter:ue,noCount:se,noMarking:$,noStateChangeOnMount:re,TopLeftAddon:ge,TopRightAddon:me,actionRef:oe,RowRenderer:Q,resources:pe}=n,Ie=G===void 0?"Default":G,Fe=J===void 0?40:J;let xe;e[0]!==pe?(xe={...Or.ATable,...pe},e[0]=pe,e[1]=xe):xe=e[1];const Oe=xe,Le=B.useRef(null);let He;e[2]!==r?(He=(Et,he)=>r!==void 0?Array.isArray(r)?r.every(Ve=>Jh.isEqual(Et[Ve],he[Ve])):Jh.isEqual(Et[r],he[r]):Jh.isEqual(Et,he),e[2]=r,e[3]=He):He=e[3];const Te=He;let ke;e[4]!==i?(ke={content:Lk,...i},e[4]=i,e[5]=ke):ke=e[5];const Be=ke;let rt;e[6]!==Be||e[7]!==t?(rt={},$n.keys(t).forEach(Et=>{const he=t[Et],Ve={...Be,...he};rt[Et]=Ve}),e[6]=Be,e[7]=t,e[8]=rt):rt=e[8];const Re=rt;let ut;e[9]!==z?(ut=Jh.cloneDeep(z),e[9]=z,e[10]=ut):ut=e[10];const qe=Oe["Search(Placeholder)"];let ot;e[11]!==qe?(ot={"":{type:"String",placeholder:qe,value:""}},e[11]=qe,e[12]=ot):ot=e[12];const[st,bt]=Fo(ut,ot);let Mt;e[13]!==H?(Mt=Jh.cloneDeep(H),e[13]=H,e[14]=Mt):Mt=e[14];const[Bt,at]=Fo(Mt,void 0),[Ye,Tt]=B.useState(!1);let Ut;e:{if(Ye&&Bt){let he;e[15]!==at||e[16]!==Bt?(he=[Bt,at],e[15]=at,e[16]=Bt,e[17]=he):he=e[17],Ut=he;break e}let Et;e[18]!==st||e[19]!==bt?(Et=[st,bt],e[18]=st,e[19]=bt,e[20]=Et):Et=e[20],Ut=Et}const[gt,Ht]=Ut,[xt,pn]=B.useState(gt);let $t;e:{if(!S){let he;e[21]===Symbol.for("react.memo_cache_sentinel")?(he=[],e[21]=he):he=e[21],$t=he;break e}let Et;e[22]!==xt||e[23]!==Re||e[24]!==S?(Et=_d.applyFilteration(S,Re,xt),e[22]=xt,e[23]=Re,e[24]=S,e[25]=Et):Et=e[25],$t=Et}const sn=$t;let Xt;e:{for(const Et in xt){const he=xt[Et];if(he.value!==void 0&&he.value!==null&&he.value!==""){Xt=!0;break e}}Xt=!1}const bn=Xt,[hn,Rn]=Fo(K,void 0);let vn;e[26]!==Re||e[27]!==sn||e[28]!==hn?(vn=_d.applySortation(sn,Re,hn),e[26]=Re,e[27]=sn,e[28]=hn,e[29]=vn):vn=e[29];const We=vn;let Ce;e:{if(k!==void 0){let Et;e[30]!==Re||e[31]!==k||e[32]!==hn?(Et=_d.applySortation(k,Re,hn),e[30]=Re,e[31]=k,e[32]=hn,e[33]=Et):Et=e[33],Ce=Et;break e}Ce=void 0}const it=Ce;let Ct;e[34]===Symbol.for("react.memo_cache_sentinel")?(Ct={page:1,pageSize:50,pageRange:10},e[34]=Ct):Ct=e[34];const[Qt,Yt]=Fo(Y,Ct),yn=O??Qt.page??1;let gn;e[35]!==Qt||e[36]!==yn?(gn={pageSize:50,pageRange:10,...Qt,page:yn},e[35]=Qt,e[36]=yn,e[37]=gn):gn=e[37];const lt=gn;let kt;if(e[38]!==S||e[39]!==lt||e[40]!==P||e[41]!==We||e[42]!==it){const Et={...lt};if(it!==void 0){const he=P??it.length,Ve=_d.getPages(he,Et.pageSize);Et.page>Ve.length?Et.page=Ve.length:Et.page<1&&(Et.page=1),kt={pagedItems:it,totalCount:he,pagination:Et}}else if(S!==void 0){const he=P??We.length,Ve=_d.getPages(he,Et.pageSize);Et.page>Ve.length?Et.page=Ve.length:Et.page<1&&(Et.page=1);const _t=_d.applyPagination(We,Et.page,Et.pageSize);let rn;e[44]!==_t||e[45]!==Et||e[46]!==he?(rn={pagedItems:_t,totalCount:he,pagination:Et},e[44]=_t,e[45]=Et,e[46]=he,e[47]=rn):rn=e[47],kt=rn}else{let he;e[48]===Symbol.for("react.memo_cache_sentinel")?(he=[],e[48]=he):he=e[48];const Ve=P??0;let _t;e[49]!==lt||e[50]!==Ve?(_t={pagedItems:he,totalCount:Ve,pagination:lt},e[49]=lt,e[50]=Ve,e[51]=_t):_t=e[51],kt=_t}e[38]=S,e[39]=lt,e[40]=P,e[41]=We,e[42]=it,e[43]=kt}else kt=e[43];const{pagedItems:vt,totalCount:zt,pagination:Lt}=kt;let yt;e[52]!==Lt.page||e[53]!==Lt.pageRange||e[54]!==Lt.pageSize||e[55]!==zt?(yt=_d.getRangedPages(Lt.page,zt,Lt.pageSize,Lt.pageRange),e[52]=Lt.page,e[53]=Lt.pageRange,e[54]=Lt.pageSize,e[55]=zt,e[56]=yt):yt=e[56];const{pages:Rt,rangedPages:on}=yt;let En;e[57]!==g?(En=g??[],e[57]=g,e[58]=En):En=e[58];const[Jt,xn]=En;let _n;if(e[59]!==Jt||e[60]!==Te||e[61]!==vt){let Et;e[63]!==Jt||e[64]!==Te?(Et=he=>Jt==null?void 0:Jt.some(Ve=>Te(Ve,he)),e[63]=Jt,e[64]=Te,e[65]=Et):Et=e[65],_n=vt.filter(Et),e[59]=Jt,e[60]=Te,e[61]=vt,e[62]=_n}else _n=e[62];const zn=_n;let er;if(e[66]!==m||e[67]!==vt){let Et;e[69]!==m?(Et=he=>!(m!=null&&m(he)),e[69]=m,e[70]=Et):Et=e[70],er=vt.filter(Et),e[66]=m,e[67]=vt,e[68]=er}else er=e[68];const wn=er;let ri;e[71]!==Te||e[72]!==wn||e[73]!==zn?(ri=wn.length>0&&wn.every(Et=>zn.some(he=>Te(he,Et))),e[71]=Te,e[72]=wn,e[73]=zn,e[74]=ri):ri=e[74];const $e=ri;let tn;e:{if($e){tn=!1;break e}let Et;if(e[75]!==Te||e[76]!==wn||e[77]!==zn){let he;e[79]!==Te||e[80]!==zn?(he=Ve=>zn.some(_t=>Te(_t,Ve)),e[79]=Te,e[80]=zn,e[81]=he):he=e[81],Et=wn.some(he),e[75]=Te,e[76]=wn,e[77]=zn,e[78]=Et}else Et=e[78];tn=Et}const ln=tn;let Nn;e[82]!==Jt||e[83]!==w||e[84]!==Te||e[85]!==$e||e[86]!==ln||e[87]!==wn||e[88]!==xn?(Nn=()=>{!Jt||!xn||w||xn($e||ln?Jt.filter(Et=>!wn.some(he=>Te(he,Et))):[...Jt,...wn])},e[82]=Jt,e[83]=w,e[84]=Te,e[85]=$e,e[86]=ln,e[87]=wn,e[88]=xn,e[89]=Nn):Nn=e[89];const yr=Nn;let Ln;e[90]!==Jt||e[91]!==w||e[92]!==Te||e[93]!==xn?(Ln=Et=>{!Jt||!xn||w||(Jt.some(he=>Te(he,Et))?xn(Jt.filter(he=>!Te(he,Et))):xn([...Jt,Et]))},e[90]=Jt,e[91]=w,e[92]=Te,e[93]=xn,e[94]=Ln):Ln=e[94];const Pt=Ln;let Se,tt;e[95]!==m||e[96]!==Jt||e[97]!==xn?(Se=()=>{if(!xn||!Jt||!m)return;Jt.filter(he=>m(he)).length>0&&xn(Jt.filter(he=>!m(he)))},tt=[m,Jt,xn],e[95]=m,e[96]=Jt,e[97]=xn,e[98]=Se,e[99]=tt):(Se=e[98],tt=e[99]),B.useEffect(Se,tt);let At;e[100]!==Jt||e[101]!==$e||e[102]!==ln||e[103]!==yr?(At=Jt&&M.jsx(w1,{isIndeterminate:ln,useCheck:[$e,yr]}),e[100]=Jt,e[101]=$e,e[102]=ln,e[103]=yr,e[104]=At):At=e[104];let Sn;e[105]!==m||e[106]!==Jt||e[107]!==Te||e[108]!==Pt?(Sn=Et=>{const{item:he}=Et,Ve=m==null?void 0:m(he),_t=typeof Ve=="string"?Ve:void 0,rn=Jt==null?void 0:Jt.some(pi=>Te(pi,he));return M.jsx(w1,{isDisabled:Ve,style:{zIndex:1},tooltip:_t,useCheck:[rn,()=>Pt(he)],onClick:Ok})},e[105]=m,e[106]=Jt,e[107]=Te,e[108]=Pt,e[109]=Sn):Sn=e[109];let In;e[110]!==At||e[111]!==Sn?(In={hContent:At,content:Sn,minWidth:32,maxWidth:32},e[110]=At,e[111]=Sn,e[112]=In):In=e[112];const Yn=In;let lr;e:{if(!g){lr=Re;break e}let Et;e[113]!==Yn||e[114]!==Re?(Et={checkDef:Yn,...Re},e[113]=Yn,e[114]=Re,e[115]=Et):Et=e[115],lr=Et}const pr=lr,[On,tr]=B.useState(!1),An=x??On;let sr;e[116]!==R||e[117]!==Yt||e[118]!==Rn?(sr=async Et=>{R&&(tr(!0),await R(Et),tr(!1)),Yt==null||Yt(Et.pagination),Rn==null||Rn(Et.sortation),pn(Et.filteration)},e[116]=R,e[117]=Yt,e[118]=Rn,e[119]=sr):sr=e[119];const hr=sr;let ho;e[120]===Symbol.for("react.memo_cache_sentinel")?(ho=Et=>{var he;(he=Le.current)==null||he.call(Le,Et)},e[120]=ho):ho=e[120];const So=ho;let oo,sl;e[121]!==oe||e[122]!==S||e[123]!==gt||e[124]!==hr||e[125]!==Lt||e[126]!==Ht||e[127]!==hn?(oo=()=>{if(!oe)return;const Et=Ve=>{const _t={entireItems:S,filteration:gt,pagination:Lt,sortation:hn},rn=Ve?Ve(_t):_t;hr(rn)},he=Ve=>{const _t={...Lt,page:1},rn=Ve?Ve(gt):gt;Ht==null||Ht(rn),hr({entireItems:S,filteration:rn,pagination:_t,sortation:hn})};oe.current={fireOnStateChange:Et,applyFilteration:he,scrollToSelected:So}},sl=[oe,hr,S,Ht,gt,Lt,hn,So],e[121]=oe,e[122]=S,e[123]=gt,e[124]=hr,e[125]=Lt,e[126]=Ht,e[127]=hn,e[128]=oo,e[129]=sl):(oo=e[128],sl=e[129]),B.useEffect(oo,sl);let Ki;e[130]!==xt||e[131]!==S||e[132]!==hr||e[133]!==Rt||e[134]!==Lt.page||e[135]!==Lt.pageSize||e[136]!==hn?(Ki=Et=>{Et.page===Lt.page&&Et.pageSize===Lt.pageSize||(Et.page<1?Et.page=1:Et.page>Rt[Rt.length-1]&&(Et.page=Rt[Rt.length-1]),hr({entireItems:S,filteration:xt,pagination:Et,sortation:hn}))},e[130]=xt,e[131]=S,e[132]=hr,e[133]=Rt,e[134]=Lt.page,e[135]=Lt.pageSize,e[136]=hn,e[137]=Ki):Ki=e[137];const Ai=Ki;let Jl;e[138]!==Ht?(Jl=Et=>{Ht&&Ht(Et)},e[138]=Ht,e[139]=Jl):Jl=e[139];const Zo=Jl;let xo;e[140]!==xt||e[141]!==S||e[142]!==hr||e[143]!==Lt?(xo=Et=>{hr({entireItems:S,filteration:xt,pagination:Lt,sortation:Et})},e[140]=xt,e[141]=S,e[142]=hr,e[143]=Lt,e[144]=xo):xo=e[144];const Gr=xo;let cn;e[145]!==Ai||e[146]!==Lt?(cn=Et=>{Ai({...Lt,page:Et})},e[145]=Ai,e[146]=Lt,e[147]=cn):cn=e[147];const Cn=cn;let Pr;e[148]!==Cn||e[149]!==Lt.page?(Pr=()=>{Cn(Lt.page-1)},e[148]=Cn,e[149]=Lt.page,e[150]=Pr):Pr=e[150];const fr=Pr;let ar;e[151]!==Cn||e[152]!==Lt.page?(ar=()=>{Cn(Lt.page+1)},e[151]=Cn,e[152]=Lt.page,e[153]=ar):ar=e[153];const Nr=ar;let Er;e[154]!==Cn?(Er=()=>{Cn(1)},e[154]=Cn,e[155]=Er):Er=e[155];const gi=Er;let Ri;e[156]!==Cn||e[157]!==Rt?(Ri=()=>{Cn(Rt[Rt.length-1])},e[156]=Cn,e[157]=Rt,e[158]=Ri):Ri=e[158];const Dr=Ri;let Bo;e[159]!==Cn||e[160]!==gi||e[161]!==Dr||e[162]!==Nr||e[163]!==fr?(Bo={move:Cn,movePrev:fr,moveNext:Nr,moveFirst:gi,moveLast:Dr},e[159]=Cn,e[160]=gi,e[161]=Dr,e[162]=Nr,e[163]=fr,e[164]=Bo):Bo=e[164];const Eo=Bo;let To;e[165]!==S||e[166]!==gt||e[167]!==hr||e[168]!==Lt||e[169]!==hn?(To=()=>{const Et={...Lt,page:1};hr({entireItems:S,filteration:gt,pagination:Et,sortation:hn})},e[165]=S,e[166]=gt,e[167]=hr,e[168]=Lt,e[169]=hn,e[170]=To):To=e[170];const Ii=To;let Vr;e[171]!==Ye?(Vr=()=>{Tt(!Ye)},e[171]=Ye,e[172]=Vr):Vr=e[172];const xr=Vr;let al;e[173]!==st||e[174]!==Ye||e[175]!==Ht||e[176]!==at||e[177]!==Bt?(al=()=>{Ye&&Bt?at==null||at(j2(Bt)):Ht==null||Ht(j2(st))},e[173]=st,e[174]=Ye,e[175]=Ht,e[176]=at,e[177]=Bt,e[178]=al):al=e[178];const xi=al;let Ji;e[179]!==Ii||e[180]!==xi||e[181]!==xr?(Ji={apply:Ii,toggle:xr,clear:xi},e[179]=Ii,e[180]=xi,e[181]=xr,e[182]=Ji):Ji=e[182];const cl=Ji;let Ao;e[183]!==S||e[184]!==gt||e[185]!==re||e[186]!==hr||e[187]!==Lt||e[188]!==hn?(Ao=()=>{re||hr({entireItems:S,filteration:gt,pagination:Lt,sortation:hn})},e[183]=S,e[184]=gt,e[185]=re,e[186]=hr,e[187]=Lt,e[188]=hn,e[189]=Ao):Ao=e[189],W3(Ao);let Hi;e[190]!==Re?(Hi=$n.map(Re,he=>{const[Ve]=he;return Re[Ve].minWidth??jd}).reduce(Pk,0),e[190]=Re,e[191]=Hi):Hi=e[191];const zo=Hi,Qi=Q!==void 0;let qi;e[192]!==zo?(qi={minWidth:zo},e[192]=zo,e[193]=qi):qi=e[193];let go;e[194]!==ge||e[195]!==me||e[196]!==Jt||e[197]!==Re||e[198]!==cl||e[199]!==Ie||e[200]!==gt||e[201]!==bn||e[202]!==Qi||e[203]!==se||e[204]!==ue||e[205]!==X||e[206]!==Zo||e[207]!==Gr||e[208]!==N||e[209]!==Oe||e[210]!==xn||e[211]!==hn||e[212]!==_||e[213]!==Bt||e[214]!==zt||e[215]!==g?(go=!X&&M.jsx(kk,{defs:Re,filterF:cl,filterType:Ie,hasToggleFilteration:Bt!==void 0,isFiltered:bn,isRowRendered:Qi,noCount:se,noFilter:ue,placeholder:N,resources:Oe,title:_,TopLeftAddon:ge,TopRightAddon:me,totalCount:zt,useCheck:g&&Jt?[Jt,xn]:void 0,useFilteration:[gt,Zo],useSortation:[hn,Gr]}),e[194]=ge,e[195]=me,e[196]=Jt,e[197]=Re,e[198]=cl,e[199]=Ie,e[200]=gt,e[201]=bn,e[202]=Qi,e[203]=se,e[204]=ue,e[205]=X,e[206]=Zo,e[207]=Gr,e[208]=N,e[209]=Oe,e[210]=xn,e[211]=hn,e[212]=_,e[213]=Bt,e[214]=zt,e[215]=g,e[216]=go):go=e[216];let Jn;e[217]!==Gr||e[218]!==hn?(Jn=[hn,Gr],e[217]=Gr,e[218]=hn,e[219]=Jn):Jn=e[219];let Ro;e[220]===Symbol.for("react.memo_cache_sentinel")?(Ro=Et=>Le.current=Et,e[220]=Ro):Ro=e[220];let ai;e[221]!==Q||e[222]!==xt||e[223]!==pr||e[224]!==w||e[225]!==Te||e[226]!==An||e[227]!==Qi||e[228]!==a||e[229]!==te||e[230]!==$||e[231]!==vt||e[232]!==Lt||e[233]!==o||e[234]!==Oe||e[235]!==Fe||e[236]!==h||e[237]!==fe||e[238]!==Jn||e[239]!==l?(ai=M.jsx(QI,{appliedFilteration:xt,defs:pr,isEqual:Te,isLoading:An,isRowRendered:Qi,isSelectMulti:a,isTableDisabled:w,noDefHeader:te,noMarking:$,pagedItems:vt,pagination:Lt,resources:Oe,rowHeight:Fe,RowRenderer:Q,rProps:o,selectDisabled:h,showRows:fe,useSelect:l,useSortation:Jn,onScrollToSelectedReady:Ro}),e[221]=Q,e[222]=xt,e[223]=pr,e[224]=w,e[225]=Te,e[226]=An,e[227]=Qi,e[228]=a,e[229]=te,e[230]=$,e[231]=vt,e[232]=Lt,e[233]=o,e[234]=Oe,e[235]=Fe,e[236]=h,e[237]=fe,e[238]=Jn,e[239]=l,e[240]=ai):ai=e[240];let Io;e[241]!==ne||e[242]!==Eo||e[243]!==Rt||e[244]!==Lt||e[245]!==on?(Io=!ne&&M.jsx(ik,{pageF:Eo,pages:Rt,pagination:Lt,rangedPages:on}),e[241]=ne,e[242]=Eo,e[243]=Rt,e[244]=Lt,e[245]=on,e[246]=Io):Io=e[246];let Qn;return e[247]!==w||e[248]!==qi||e[249]!==go||e[250]!==ai||e[251]!==Io?(Qn=M.jsxs(zi,{className:kI.ATable,isDisabled:w,style:qi,children:[go,ai,Io]}),e[247]=w,e[248]=qi,e[249]=go,e[250]=ai,e[251]=Io,e[252]=Qn):Qn=e[252],Qn},Lk=n=>{const{defKey:e,item:t}=n;if($n.hasKey(t,e)){const r=t[e];return $n.isReactNode(r)?r:null}else return null};function j2(n){const e={...n};for(const t in e)e[t].value=void 0;return e}function Ok(n){return n.stopPropagation()}function Pk(n,e){return n+e}const Dk="_AText_1asz6_1",Nk={AText:Dk},V3=n=>{const e=Gn.c(12),{text:t,styled:r,style:i}=n;let o;if(e[0]!==i||e[1]!==r||e[2]!==t){e:{if(t)if(r)if(i){if(r===!0)if(i==="bold"){let g;e[4]!==t?(g=M.jsx("b",{children:t}),e[4]=t,e[5]=g):g=e[5],o=g;break e}else{let g;e[6]!==i||e[7]!==t?(g=M.jsx("span",{style:i,children:t}),e[6]=i,e[7]=t,e[8]=g):g=e[8],o=g;break e}else if(typeof r=="string"){const g=t.split(r);if(i==="bold"){o=g.map((m,x)=>M.jsxs(B.Fragment,{children:[p0(m),x<g.length-1?M.jsx("b",{children:p0(r)}):""]},x));break e}o=g.map((m,x)=>M.jsxs(B.Fragment,{children:[p0(m),x<g.length-1&&M.jsx("span",{style:i,children:p0(r)})]},x));break e}}else{o=t;break e}else{o=t;break e}else{o="";break e}o=void 0}e[0]=i,e[1]=r,e[2]=t,e[3]=o}else o=e[3];const l=o;let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=dt.clsx("Body1Reading",Nk.AText,"NoSelect"),e[9]=a):a=e[9];let h;return e[10]!==l?(h=M.jsx("div",{className:a,children:l}),e[10]=l,e[11]=h):h=e[11],h};function p0(n){const e=n.split(`
287
+ `);return e.map((t,r)=>M.jsxs(B.Fragment,{children:[t,r!==e.length-1&&M.jsx("br",{})]},r))}const Fk="_Base_cpm4t_7",Bk="_ATextArea_cpm4t_11",zk="_Primary_cpm4t_34",Hk="_UnAvailable_cpm4t_39",Wk="_Secondary_cpm4t_47",Uk="_ReadOnly_cpm4t_59",v0={Base:Fk,ATextArea:Bk,Primary:zk,UnAvailable:Hk,Secondary:Wk,ReadOnly:Uk,Error:"_Error_cpm4t_66"},Gk=["Primary","Secondary","ReadOnly","Error"],Yk=n=>{const e=Gn.c(60);let t,r,i,o,l,a,h,g,m,x,w,_,S;if(e[0]!==n){const{onEnterPress:xe,errorMessage:Oe,type:Le,textAreaRef:He,useValue:Te,rows:ke,isReadonly:Be,placeholder:rt,maxLength:Re,tabIndex:ut,autoFocus:qe,textAreaProps:ot,...st}=n;a=xe,r=Oe,_=He,S=Te,g=ke,i=Be,h=rt,l=Re,x=ut,t=qe,w=ot,o=Le===void 0?"Primary":Le,m=Bg(st),e[0]=n,e[1]=t,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=a,e[7]=h,e[8]=g,e[9]=m,e[10]=x,e[11]=w,e[12]=_,e[13]=S}else t=e[1],r=e[2],i=e[3],o=e[4],l=e[5],a=e[6],h=e[7],g=e[8],m=e[9],x=e[10],w=e[11],_=e[12],S=e[13];const[R,k]=m;let O,P,z,H;e[14]!==R?({wrapId:P,wrapProps:z,labelProps:O,...H}=R,e[14]=R,e[15]=O,e[16]=P,e[17]=z,e[18]=H):(O=e[15],P=e[16],z=e[17],H=e[18]);let G;Vk(r)?G="Error":G=o;const N=G;let J;N==="ReadOnly"?J=!0:J=i;const Y=J,K=k.isDisabled||k.isLoading,[fe,X]=Fo(S,"");let te;e[19]!==X?(te=xe=>{X&&X(xe)},e[19]=X,e[20]=te):te=e[20];const ne=te;let ue;e[21]!==ne||e[22]!==w||e[23]!==K?(ue=xe=>{var Oe;K||(ne(xe.target.value),(Oe=w==null?void 0:w.onChange)==null||Oe.call(w,xe))},e[21]=ne,e[22]=w,e[23]=K,e[24]=ue):ue=e[24];const se=ue;let $;e[25]!==a||e[26]!==w||e[27]!==K?($=xe=>{var Oe;if(!K){if((Oe=w==null?void 0:w.onKeyDown)==null||Oe.call(w,xe),xe.key==="Tab"){const Le=xe.currentTarget.selectionStart,He=xe.currentTarget.selectionEnd;xe.currentTarget.value=xe.currentTarget.value.substring(0,Le)+" "+xe.currentTarget.value.substring(He),xe.currentTarget.selectionStart=xe.currentTarget.selectionEnd=Le+1,xe.preventDefault()}else xe.key==="Enter"&&(a==null||a(xe.currentTarget.value),xe.stopPropagation());xe.key!=="Escape"&&xe.stopPropagation()}},e[25]=a,e[26]=w,e[27]=K,e[28]=$):$=e[28];const re=$;let ge;e[29]!==O||e[30]!==P||e[31]!==z||e[32]!==H?(ge={wrapId:P,wrapProps:z,labelProps:O,...H},e[29]=O,e[30]=P,e[31]=z,e[32]=H,e[33]=ge):ge=e[33];let me;e[34]!==k.className?(me=dt.clsx(v0.Base,k.className),e[34]=k.className,e[35]=me):me=e[35];let oe;e[36]!==(w==null?void 0:w.className)||e[37]!==N||e[38]!==K?(oe=dt.clsx(v0.ATextArea,v0[N],K&&v0.UnAvailable,w==null?void 0:w.className),e[36]=w==null?void 0:w.className,e[37]=N,e[38]=K,e[39]=oe):oe=e[39];const Q=k.isDisabled||k.isLoading?-1:x;let pe;e[40]!==t||e[41]!==Y||e[42]!==l||e[43]!==se||e[44]!==re||e[45]!==h||e[46]!==g||e[47]!==Q||e[48]!==oe||e[49]!==w||e[50]!==_||e[51]!==fe?(pe=M.jsx("textarea",{...w,ref:_,autoFocus:t,className:oe,maxLength:l,placeholder:h,readOnly:Y,rows:g,tabIndex:Q,value:fe,onChange:se,onKeyDown:re}),e[40]=t,e[41]=Y,e[42]=l,e[43]=se,e[44]=re,e[45]=h,e[46]=g,e[47]=Q,e[48]=oe,e[49]=w,e[50]=_,e[51]=fe,e[52]=pe):pe=e[52];let Ie;e[53]!==k||e[54]!==pe||e[55]!==me?(Ie=M.jsx(zi,{...k,className:me,children:pe}),e[53]=k,e[54]=pe,e[55]=me,e[56]=Ie):Ie=e[56];let Fe;return e[57]!==Ie||e[58]!==ge?(Fe=M.jsx(lg,{...ge,children:Ie}),e[57]=Ie,e[58]=ge,e[59]=Fe):Fe=e[59],Fe};function Vk(n){return Array.isArray(n)?n.filter(Boolean).length>0:!!n}/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:Z3,setPrototypeOf:$2,isFrozen:Zk,getPrototypeOf:Xk,getOwnPropertyDescriptor:Kk}=Object;let{freeze:Ou,seal:vh,create:My}=Object,{apply:Ly,construct:Oy}=typeof Reflect<"u"&&Reflect;Ou||(Ou=function(e){return e});vh||(vh=function(e){return e});Ly||(Ly=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});Oy||(Oy=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const b0=Pu(Array.prototype.forEach),Jk=Pu(Array.prototype.lastIndexOf),ex=Pu(Array.prototype.pop),tp=Pu(Array.prototype.push),Qk=Pu(Array.prototype.splice),Y0=Pu(String.prototype.toLowerCase),ab=Pu(String.prototype.toString),cb=Pu(String.prototype.match),np=Pu(String.prototype.replace),qk=Pu(String.prototype.indexOf),jk=Pu(String.prototype.trim),Ah=Pu(Object.prototype.hasOwnProperty),Mu=Pu(RegExp.prototype.test),rp=$k(TypeError);function Pu(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Ly(n,e,r)}}function $k(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Oy(n,t)}}function Ti(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y0;$2&&$2(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(Zk(e)||(e[r]=o),i=o)}n[i]=!0}return n}function e7(n){for(let e=0;e<n.length;e++)Ah(n,e)||(n[e]=null);return n}function Cd(n){const e=My(null);for(const[t,r]of Z3(n))Ah(n,t)&&(Array.isArray(r)?e[t]=e7(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Cd(r):e[t]=r);return e}function ip(n,e){for(;n!==null;){const r=Kk(n,e);if(r){if(r.get)return Pu(r.get);if(typeof r.value=="function")return Pu(r.value)}n=Xk(n)}function t(){return null}return t}const tx=Ou(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ub=Ou(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fb=Ou(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),t7=Ou(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hb=Ou(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),n7=Ou(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nx=Ou(["#text"]),rx=Ou(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),db=Ou(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ix=Ou(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),y0=Ou(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),r7=vh(/\{\{[\w\W]*|[\w\W]*\}\}/gm),i7=vh(/<%[\w\W]*|[\w\W]*%>/gm),o7=vh(/\$\{[\w\W]*/gm),l7=vh(/^data-[\-\w.\u00B7-\uFFFF]+$/),s7=vh(/^aria-[\-\w]+$/),X3=vh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),a7=vh(/^(?:\w+script|data):/i),c7=vh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K3=vh(/^html$/i),u7=vh(/^[a-z][.\w]*(-[.\w]+)+$/i);var ox=Object.freeze({__proto__:null,ARIA_ATTR:s7,ATTR_WHITESPACE:c7,CUSTOM_ELEMENT:u7,DATA_ATTR:l7,DOCTYPE_NAME:K3,ERB_EXPR:i7,IS_ALLOWED_URI:X3,IS_SCRIPT_OR_DATA:a7,MUSTACHE_EXPR:r7,TMPLIT_EXPR:o7});const op={element:1,text:3,progressingInstruction:7,comment:8,document:9},f7=function(){return typeof window>"u"?null:window},h7=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},lx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function J3(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f7();const e=Pt=>J3(Pt);if(e.version="3.3.0",e.removed=[],!n||!n.document||n.document.nodeType!==op.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:a,Element:h,NodeFilter:g,NamedNodeMap:m=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:x,DOMParser:w,trustedTypes:_}=n,S=h.prototype,R=ip(S,"cloneNode"),k=ip(S,"remove"),O=ip(S,"nextSibling"),P=ip(S,"childNodes"),z=ip(S,"parentNode");if(typeof l=="function"){const Pt=t.createElement("template");Pt.content&&Pt.content.ownerDocument&&(t=Pt.content.ownerDocument)}let H,G="";const{implementation:N,createNodeIterator:J,createDocumentFragment:Y,getElementsByTagName:K}=t,{importNode:fe}=r;let X=lx();e.isSupported=typeof Z3=="function"&&typeof z=="function"&&N&&N.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:te,ERB_EXPR:ne,TMPLIT_EXPR:ue,DATA_ATTR:se,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:me}=ox;let{IS_ALLOWED_URI:oe}=ox,Q=null;const pe=Ti({},[...tx,...ub,...fb,...hb,...nx]);let Ie=null;const Fe=Ti({},[...rx,...db,...ix,...y0]);let xe=Object.seal(My(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Le=null;const He=Object.seal(My(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,ke=!0,Be=!1,rt=!0,Re=!1,ut=!0,qe=!1,ot=!1,st=!1,bt=!1,Mt=!1,Bt=!1,at=!0,Ye=!1;const Tt="user-content-";let Ut=!0,gt=!1,Ht={},xt=null;const pn=Ti({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $t=null;const sn=Ti({},["audio","video","img","source","image","track"]);let Xt=null;const bn=Ti({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hn="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let We=vn,Ce=!1,it=null;const Ct=Ti({},[hn,Rn,vn],ab);let Qt=Ti({},["mi","mo","mn","ms","mtext"]),Yt=Ti({},["annotation-xml"]);const yn=Ti({},["title","style","font","a","script"]);let gn=null;const lt=["application/xhtml+xml","text/html"],kt="text/html";let vt=null,zt=null;const Lt=t.createElement("form"),yt=function(Se){return Se instanceof RegExp||Se instanceof Function},Rt=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(zt&&zt===Se)){if((!Se||typeof Se!="object")&&(Se={}),Se=Cd(Se),gn=lt.indexOf(Se.PARSER_MEDIA_TYPE)===-1?kt:Se.PARSER_MEDIA_TYPE,vt=gn==="application/xhtml+xml"?ab:Y0,Q=Ah(Se,"ALLOWED_TAGS")?Ti({},Se.ALLOWED_TAGS,vt):pe,Ie=Ah(Se,"ALLOWED_ATTR")?Ti({},Se.ALLOWED_ATTR,vt):Fe,it=Ah(Se,"ALLOWED_NAMESPACES")?Ti({},Se.ALLOWED_NAMESPACES,ab):Ct,Xt=Ah(Se,"ADD_URI_SAFE_ATTR")?Ti(Cd(bn),Se.ADD_URI_SAFE_ATTR,vt):bn,$t=Ah(Se,"ADD_DATA_URI_TAGS")?Ti(Cd(sn),Se.ADD_DATA_URI_TAGS,vt):sn,xt=Ah(Se,"FORBID_CONTENTS")?Ti({},Se.FORBID_CONTENTS,vt):pn,Oe=Ah(Se,"FORBID_TAGS")?Ti({},Se.FORBID_TAGS,vt):Cd({}),Le=Ah(Se,"FORBID_ATTR")?Ti({},Se.FORBID_ATTR,vt):Cd({}),Ht=Ah(Se,"USE_PROFILES")?Se.USE_PROFILES:!1,Te=Se.ALLOW_ARIA_ATTR!==!1,ke=Se.ALLOW_DATA_ATTR!==!1,Be=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,rt=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Re=Se.SAFE_FOR_TEMPLATES||!1,ut=Se.SAFE_FOR_XML!==!1,qe=Se.WHOLE_DOCUMENT||!1,bt=Se.RETURN_DOM||!1,Mt=Se.RETURN_DOM_FRAGMENT||!1,Bt=Se.RETURN_TRUSTED_TYPE||!1,st=Se.FORCE_BODY||!1,at=Se.SANITIZE_DOM!==!1,Ye=Se.SANITIZE_NAMED_PROPS||!1,Ut=Se.KEEP_CONTENT!==!1,gt=Se.IN_PLACE||!1,oe=Se.ALLOWED_URI_REGEXP||X3,We=Se.NAMESPACE||vn,Qt=Se.MATHML_TEXT_INTEGRATION_POINTS||Qt,Yt=Se.HTML_INTEGRATION_POINTS||Yt,xe=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&yt(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&yt(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(ke=!1),Mt&&(bt=!0),Ht&&(Q=Ti({},nx),Ie=[],Ht.html===!0&&(Ti(Q,tx),Ti(Ie,rx)),Ht.svg===!0&&(Ti(Q,ub),Ti(Ie,db),Ti(Ie,y0)),Ht.svgFilters===!0&&(Ti(Q,fb),Ti(Ie,db),Ti(Ie,y0)),Ht.mathMl===!0&&(Ti(Q,hb),Ti(Ie,ix),Ti(Ie,y0))),Se.ADD_TAGS&&(typeof Se.ADD_TAGS=="function"?He.tagCheck=Se.ADD_TAGS:(Q===pe&&(Q=Cd(Q)),Ti(Q,Se.ADD_TAGS,vt))),Se.ADD_ATTR&&(typeof Se.ADD_ATTR=="function"?He.attributeCheck=Se.ADD_ATTR:(Ie===Fe&&(Ie=Cd(Ie)),Ti(Ie,Se.ADD_ATTR,vt))),Se.ADD_URI_SAFE_ATTR&&Ti(Xt,Se.ADD_URI_SAFE_ATTR,vt),Se.FORBID_CONTENTS&&(xt===pn&&(xt=Cd(xt)),Ti(xt,Se.FORBID_CONTENTS,vt)),Ut&&(Q["#text"]=!0),qe&&Ti(Q,["html","head","body"]),Q.table&&(Ti(Q,["tbody"]),delete Oe.tbody),Se.TRUSTED_TYPES_POLICY){if(typeof Se.TRUSTED_TYPES_POLICY.createHTML!="function")throw rp('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Se.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rp('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');H=Se.TRUSTED_TYPES_POLICY,G=H.createHTML("")}else H===void 0&&(H=h7(_,i)),H!==null&&typeof G=="string"&&(G=H.createHTML(""));Ou&&Ou(Se),zt=Se}},on=Ti({},[...ub,...fb,...t7]),En=Ti({},[...hb,...n7]),Jt=function(Se){let tt=z(Se);(!tt||!tt.tagName)&&(tt={namespaceURI:We,tagName:"template"});const At=Y0(Se.tagName),Sn=Y0(tt.tagName);return it[Se.namespaceURI]?Se.namespaceURI===Rn?tt.namespaceURI===vn?At==="svg":tt.namespaceURI===hn?At==="svg"&&(Sn==="annotation-xml"||Qt[Sn]):!!on[At]:Se.namespaceURI===hn?tt.namespaceURI===vn?At==="math":tt.namespaceURI===Rn?At==="math"&&Yt[Sn]:!!En[At]:Se.namespaceURI===vn?tt.namespaceURI===Rn&&!Yt[Sn]||tt.namespaceURI===hn&&!Qt[Sn]?!1:!En[At]&&(yn[At]||!on[At]):!!(gn==="application/xhtml+xml"&&it[Se.namespaceURI]):!1},xn=function(Se){tp(e.removed,{element:Se});try{z(Se).removeChild(Se)}catch{k(Se)}},_n=function(Se,tt){try{tp(e.removed,{attribute:tt.getAttributeNode(Se),from:tt})}catch{tp(e.removed,{attribute:null,from:tt})}if(tt.removeAttribute(Se),Se==="is")if(bt||Mt)try{xn(tt)}catch{}else try{tt.setAttribute(Se,"")}catch{}},zn=function(Se){let tt=null,At=null;if(st)Se="<remove></remove>"+Se;else{const Yn=cb(Se,/^[\r\n\t ]+/);At=Yn&&Yn[0]}gn==="application/xhtml+xml"&&We===vn&&(Se='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Se+"</body></html>");const Sn=H?H.createHTML(Se):Se;if(We===vn)try{tt=new w().parseFromString(Sn,gn)}catch{}if(!tt||!tt.documentElement){tt=N.createDocument(We,"template",null);try{tt.documentElement.innerHTML=Ce?G:Sn}catch{}}const In=tt.body||tt.documentElement;return Se&&At&&In.insertBefore(t.createTextNode(At),In.childNodes[0]||null),We===vn?K.call(tt,qe?"html":"body")[0]:qe?tt.documentElement:In},er=function(Se){return J.call(Se.ownerDocument||Se,Se,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},wn=function(Se){return Se instanceof x&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof m)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},ri=function(Se){return typeof a=="function"&&Se instanceof a};function $e(Pt,Se,tt){b0(Pt,At=>{At.call(e,Se,tt,zt)})}const tn=function(Se){let tt=null;if($e(X.beforeSanitizeElements,Se,null),wn(Se))return xn(Se),!0;const At=vt(Se.nodeName);if($e(X.uponSanitizeElement,Se,{tagName:At,allowedTags:Q}),ut&&Se.hasChildNodes()&&!ri(Se.firstElementChild)&&Mu(/<[/\w!]/g,Se.innerHTML)&&Mu(/<[/\w!]/g,Se.textContent)||Se.nodeType===op.progressingInstruction||ut&&Se.nodeType===op.comment&&Mu(/<[/\w]/g,Se.data))return xn(Se),!0;if(!(He.tagCheck instanceof Function&&He.tagCheck(At))&&(!Q[At]||Oe[At])){if(!Oe[At]&&Nn(At)&&(xe.tagNameCheck instanceof RegExp&&Mu(xe.tagNameCheck,At)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(At)))return!1;if(Ut&&!xt[At]){const Sn=z(Se)||Se.parentNode,In=P(Se)||Se.childNodes;if(In&&Sn){const Yn=In.length;for(let lr=Yn-1;lr>=0;--lr){const pr=R(In[lr],!0);pr.__removalCount=(Se.__removalCount||0)+1,Sn.insertBefore(pr,O(Se))}}}return xn(Se),!0}return Se instanceof h&&!Jt(Se)||(At==="noscript"||At==="noembed"||At==="noframes")&&Mu(/<\/no(script|embed|frames)/i,Se.innerHTML)?(xn(Se),!0):(Re&&Se.nodeType===op.text&&(tt=Se.textContent,b0([te,ne,ue],Sn=>{tt=np(tt,Sn," ")}),Se.textContent!==tt&&(tp(e.removed,{element:Se.cloneNode()}),Se.textContent=tt)),$e(X.afterSanitizeElements,Se,null),!1)},ln=function(Se,tt,At){if(at&&(tt==="id"||tt==="name")&&(At in t||At in Lt))return!1;if(!(ke&&!Le[tt]&&Mu(se,tt))){if(!(Te&&Mu($,tt))){if(!(He.attributeCheck instanceof Function&&He.attributeCheck(tt,Se))){if(!Ie[tt]||Le[tt]){if(!(Nn(Se)&&(xe.tagNameCheck instanceof RegExp&&Mu(xe.tagNameCheck,Se)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Se))&&(xe.attributeNameCheck instanceof RegExp&&Mu(xe.attributeNameCheck,tt)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(tt,Se))||tt==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&Mu(xe.tagNameCheck,At)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(At))))return!1}else if(!Xt[tt]){if(!Mu(oe,np(At,ge,""))){if(!((tt==="src"||tt==="xlink:href"||tt==="href")&&Se!=="script"&&qk(At,"data:")===0&&$t[Se])){if(!(Be&&!Mu(re,np(At,ge,"")))){if(At)return!1}}}}}}}return!0},Nn=function(Se){return Se!=="annotation-xml"&&cb(Se,me)},yr=function(Se){$e(X.beforeSanitizeAttributes,Se,null);const{attributes:tt}=Se;if(!tt||wn(Se))return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie,forceKeepAttr:void 0};let Sn=tt.length;for(;Sn--;){const In=tt[Sn],{name:Yn,namespaceURI:lr,value:pr}=In,On=vt(Yn),tr=pr;let An=Yn==="value"?tr:jk(tr);if(At.attrName=On,At.attrValue=An,At.keepAttr=!0,At.forceKeepAttr=void 0,$e(X.uponSanitizeAttribute,Se,At),An=At.attrValue,Ye&&(On==="id"||On==="name")&&(_n(Yn,Se),An=Tt+An),ut&&Mu(/((--!?|])>)|<\/(style|title|textarea)/i,An)){_n(Yn,Se);continue}if(On==="attributename"&&cb(An,"href")){_n(Yn,Se);continue}if(At.forceKeepAttr)continue;if(!At.keepAttr){_n(Yn,Se);continue}if(!rt&&Mu(/\/>/i,An)){_n(Yn,Se);continue}Re&&b0([te,ne,ue],hr=>{An=np(An,hr," ")});const sr=vt(Se.nodeName);if(!ln(sr,On,An)){_n(Yn,Se);continue}if(H&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!lr)switch(_.getAttributeType(sr,On)){case"TrustedHTML":{An=H.createHTML(An);break}case"TrustedScriptURL":{An=H.createScriptURL(An);break}}if(An!==tr)try{lr?Se.setAttributeNS(lr,Yn,An):Se.setAttribute(Yn,An),wn(Se)?xn(Se):ex(e.removed)}catch{_n(Yn,Se)}}$e(X.afterSanitizeAttributes,Se,null)},Ln=function Pt(Se){let tt=null;const At=er(Se);for($e(X.beforeSanitizeShadowDOM,Se,null);tt=At.nextNode();)$e(X.uponSanitizeShadowNode,tt,null),tn(tt),yr(tt),tt.content instanceof o&&Pt(tt.content);$e(X.afterSanitizeShadowDOM,Se,null)};return e.sanitize=function(Pt){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=null,At=null,Sn=null,In=null;if(Ce=!Pt,Ce&&(Pt="<!-->"),typeof Pt!="string"&&!ri(Pt))if(typeof Pt.toString=="function"){if(Pt=Pt.toString(),typeof Pt!="string")throw rp("dirty is not a string, aborting")}else throw rp("toString is not a function");if(!e.isSupported)return Pt;if(ot||Rt(Se),e.removed=[],typeof Pt=="string"&&(gt=!1),gt){if(Pt.nodeName){const pr=vt(Pt.nodeName);if(!Q[pr]||Oe[pr])throw rp("root node is forbidden and cannot be sanitized in-place")}}else if(Pt instanceof a)tt=zn("<!---->"),At=tt.ownerDocument.importNode(Pt,!0),At.nodeType===op.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?tt=At:tt.appendChild(At);else{if(!bt&&!Re&&!qe&&Pt.indexOf("<")===-1)return H&&Bt?H.createHTML(Pt):Pt;if(tt=zn(Pt),!tt)return bt?null:Bt?G:""}tt&&st&&xn(tt.firstChild);const Yn=er(gt?Pt:tt);for(;Sn=Yn.nextNode();)tn(Sn),yr(Sn),Sn.content instanceof o&&Ln(Sn.content);if(gt)return Pt;if(bt){if(Mt)for(In=Y.call(tt.ownerDocument);tt.firstChild;)In.appendChild(tt.firstChild);else In=tt;return(Ie.shadowroot||Ie.shadowrootmode)&&(In=fe.call(r,In,!0)),In}let lr=qe?tt.outerHTML:tt.innerHTML;return qe&&Q["!doctype"]&&tt.ownerDocument&&tt.ownerDocument.doctype&&tt.ownerDocument.doctype.name&&Mu(K3,tt.ownerDocument.doctype.name)&&(lr="<!DOCTYPE "+tt.ownerDocument.doctype.name+`>
288
+ `+lr),Re&&b0([te,ne,ue],pr=>{lr=np(lr,pr," ")}),H&&Bt?H.createHTML(lr):lr},e.setConfig=function(){let Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rt(Pt),ot=!0},e.clearConfig=function(){zt=null,ot=!1},e.isValidAttribute=function(Pt,Se,tt){zt||Rt({});const At=vt(Pt),Sn=vt(Se);return ln(At,Sn,tt)},e.addHook=function(Pt,Se){typeof Se=="function"&&tp(X[Pt],Se)},e.removeHook=function(Pt,Se){if(Se!==void 0){const tt=Jk(X[Pt],Se);return tt===-1?void 0:Qk(X[Pt],tt,1)[0]}return ex(X[Pt])},e.removeHooks=function(Pt){X[Pt]=[]},e.removeAllHooks=function(){X=lx()},e}var d7=J3(),m0={exports:{}},gb,sx;function g7(){if(sx)return gb;sx=1;var n=-1,e=1,t=0;function r(X,te,ne,ue,se){if(X===te)return X?[[t,X]]:[];if(ne!=null){var $=K(X,te,ne);if($)return $}var re=a(X,te),ge=X.substring(0,re);X=X.substring(re),te=te.substring(re),re=g(X,te);var me=X.substring(X.length-re);X=X.substring(0,X.length-re),te=te.substring(0,te.length-re);var oe=i(X,te);return ge&&oe.unshift([t,ge]),me&&oe.push([t,me]),P(oe,se),ue&&x(oe),oe}function i(X,te){var ne;if(!X)return[[e,te]];if(!te)return[[n,X]];var ue=X.length>te.length?X:te,se=X.length>te.length?te:X,$=ue.indexOf(se);if($!==-1)return ne=[[e,ue.substring(0,$)],[t,se],[e,ue.substring($+se.length)]],X.length>te.length&&(ne[0][0]=ne[2][0]=n),ne;if(se.length===1)return[[n,X],[e,te]];var re=m(X,te);if(re){var ge=re[0],me=re[1],oe=re[2],Q=re[3],pe=re[4],Ie=r(ge,oe),Fe=r(me,Q);return Ie.concat([[t,pe]],Fe)}return o(X,te)}function o(X,te){for(var ne=X.length,ue=te.length,se=Math.ceil((ne+ue)/2),$=se,re=2*se,ge=new Array(re),me=new Array(re),oe=0;oe<re;oe++)ge[oe]=-1,me[oe]=-1;ge[$+1]=0,me[$+1]=0;for(var Q=ne-ue,pe=Q%2!==0,Ie=0,Fe=0,xe=0,Oe=0,Le=0;Le<se;Le++){for(var He=-Le+Ie;He<=Le-Fe;He+=2){var Te=$+He,ke;He===-Le||He!==Le&&ge[Te-1]<ge[Te+1]?ke=ge[Te+1]:ke=ge[Te-1]+1;for(var Be=ke-He;ke<ne&&Be<ue&&X.charAt(ke)===te.charAt(Be);)ke++,Be++;if(ge[Te]=ke,ke>ne)Fe+=2;else if(Be>ue)Ie+=2;else if(pe){var rt=$+Q-He;if(rt>=0&&rt<re&&me[rt]!==-1){var Re=ne-me[rt];if(ke>=Re)return l(X,te,ke,Be)}}}for(var ut=-Le+xe;ut<=Le-Oe;ut+=2){var rt=$+ut,Re;ut===-Le||ut!==Le&&me[rt-1]<me[rt+1]?Re=me[rt+1]:Re=me[rt-1]+1;for(var qe=Re-ut;Re<ne&&qe<ue&&X.charAt(ne-Re-1)===te.charAt(ue-qe-1);)Re++,qe++;if(me[rt]=Re,Re>ne)Oe+=2;else if(qe>ue)xe+=2;else if(!pe){var Te=$+Q-ut;if(Te>=0&&Te<re&&ge[Te]!==-1){var ke=ge[Te],Be=$+ke-Te;if(Re=ne-Re,ke>=Re)return l(X,te,ke,Be)}}}}return[[n,X],[e,te]]}function l(X,te,ne,ue){var se=X.substring(0,ne),$=te.substring(0,ue),re=X.substring(ne),ge=te.substring(ue),me=r(se,$),oe=r(re,ge);return me.concat(oe)}function a(X,te){if(!X||!te||X.charAt(0)!==te.charAt(0))return 0;for(var ne=0,ue=Math.min(X.length,te.length),se=ue,$=0;ne<se;)X.substring($,se)==te.substring($,se)?(ne=se,$=ne):ue=se,se=Math.floor((ue-ne)/2+ne);return z(X.charCodeAt(se-1))&&se--,se}function h(X,te){var ne=X.length,ue=te.length;if(ne==0||ue==0)return 0;ne>ue?X=X.substring(ne-ue):ne<ue&&(te=te.substring(0,ne));var se=Math.min(ne,ue);if(X==te)return se;for(var $=0,re=1;;){var ge=X.substring(se-re),me=te.indexOf(ge);if(me==-1)return $;re+=me,(me==0||X.substring(se-re)==te.substring(0,re))&&($=re,re++)}}function g(X,te){if(!X||!te||X.slice(-1)!==te.slice(-1))return 0;for(var ne=0,ue=Math.min(X.length,te.length),se=ue,$=0;ne<se;)X.substring(X.length-se,X.length-$)==te.substring(te.length-se,te.length-$)?(ne=se,$=ne):ue=se,se=Math.floor((ue-ne)/2+ne);return H(X.charCodeAt(X.length-se))&&se--,se}function m(X,te){var ne=X.length>te.length?X:te,ue=X.length>te.length?te:X;if(ne.length<4||ue.length*2<ne.length)return null;function se(Fe,xe,Oe){for(var Le=Fe.substring(Oe,Oe+Math.floor(Fe.length/4)),He=-1,Te="",ke,Be,rt,Re;(He=xe.indexOf(Le,He+1))!==-1;){var ut=a(Fe.substring(Oe),xe.substring(He)),qe=g(Fe.substring(0,Oe),xe.substring(0,He));Te.length<qe+ut&&(Te=xe.substring(He-qe,He)+xe.substring(He,He+ut),ke=Fe.substring(0,Oe-qe),Be=Fe.substring(Oe+ut),rt=xe.substring(0,He-qe),Re=xe.substring(He+ut))}return Te.length*2>=Fe.length?[ke,Be,rt,Re,Te]:null}var $=se(ne,ue,Math.ceil(ne.length/4)),re=se(ne,ue,Math.ceil(ne.length/2)),ge;if(!$&&!re)return null;re?$?ge=$[4].length>re[4].length?$:re:ge=re:ge=$;var me,oe,Q,pe;X.length>te.length?(me=ge[0],oe=ge[1],Q=ge[2],pe=ge[3]):(Q=ge[0],pe=ge[1],me=ge[2],oe=ge[3]);var Ie=ge[4];return[me,oe,Q,pe,Ie]}function x(X){for(var te=!1,ne=[],ue=0,se=null,$=0,re=0,ge=0,me=0,oe=0;$<X.length;)X[$][0]==t?(ne[ue++]=$,re=me,ge=oe,me=0,oe=0,se=X[$][1]):(X[$][0]==e?me+=X[$][1].length:oe+=X[$][1].length,se&&se.length<=Math.max(re,ge)&&se.length<=Math.max(me,oe)&&(X.splice(ne[ue-1],0,[n,se]),X[ne[ue-1]+1][0]=e,ue--,ue--,$=ue>0?ne[ue-1]:-1,re=0,ge=0,me=0,oe=0,se=null,te=!0)),$++;for(te&&P(X),O(X),$=1;$<X.length;){if(X[$-1][0]==n&&X[$][0]==e){var Q=X[$-1][1],pe=X[$][1],Ie=h(Q,pe),Fe=h(pe,Q);Ie>=Fe?(Ie>=Q.length/2||Ie>=pe.length/2)&&(X.splice($,0,[t,pe.substring(0,Ie)]),X[$-1][1]=Q.substring(0,Q.length-Ie),X[$+1][1]=pe.substring(Ie),$++):(Fe>=Q.length/2||Fe>=pe.length/2)&&(X.splice($,0,[t,Q.substring(0,Fe)]),X[$-1][0]=e,X[$-1][1]=pe.substring(0,pe.length-Fe),X[$+1][0]=n,X[$+1][1]=Q.substring(Fe),$++),$++}$++}}var w=/[^a-zA-Z0-9]/,_=/\s/,S=/[\r\n]/,R=/\n\r?\n$/,k=/^\r?\n\r?\n/;function O(X){function te(Fe,xe){if(!Fe||!xe)return 6;var Oe=Fe.charAt(Fe.length-1),Le=xe.charAt(0),He=Oe.match(w),Te=Le.match(w),ke=He&&Oe.match(_),Be=Te&&Le.match(_),rt=ke&&Oe.match(S),Re=Be&&Le.match(S),ut=rt&&Fe.match(R),qe=Re&&xe.match(k);return ut||qe?5:rt||Re?4:He&&!ke&&Be?3:ke||Be?2:He||Te?1:0}for(var ne=1;ne<X.length-1;){if(X[ne-1][0]==t&&X[ne+1][0]==t){var ue=X[ne-1][1],se=X[ne][1],$=X[ne+1][1],re=g(ue,se);if(re){var ge=se.substring(se.length-re);ue=ue.substring(0,ue.length-re),se=ge+se.substring(0,se.length-re),$=ge+$}for(var me=ue,oe=se,Q=$,pe=te(ue,se)+te(se,$);se.charAt(0)===$.charAt(0);){ue+=se.charAt(0),se=se.substring(1)+$.charAt(0),$=$.substring(1);var Ie=te(ue,se)+te(se,$);Ie>=pe&&(pe=Ie,me=ue,oe=se,Q=$)}X[ne-1][1]!=me&&(me?X[ne-1][1]=me:(X.splice(ne-1,1),ne--),X[ne][1]=oe,Q?X[ne+1][1]=Q:(X.splice(ne+1,1),ne--))}ne++}}function P(X,te){X.push([t,""]);for(var ne=0,ue=0,se=0,$="",re="",ge;ne<X.length;){if(ne<X.length-1&&!X[ne][1]){X.splice(ne,1);continue}switch(X[ne][0]){case e:se++,re+=X[ne][1],ne++;break;case n:ue++,$+=X[ne][1],ne++;break;case t:var me=ne-se-ue-1;if(te){if(me>=0&&N(X[me][1])){var oe=X[me][1].slice(-1);if(X[me][1]=X[me][1].slice(0,-1),$=oe+$,re=oe+re,!X[me][1]){X.splice(me,1),ne--;var Q=me-1;X[Q]&&X[Q][0]===e&&(se++,re=X[Q][1]+re,Q--),X[Q]&&X[Q][0]===n&&(ue++,$=X[Q][1]+$,Q--),me=Q}}if(G(X[ne][1])){var oe=X[ne][1].charAt(0);X[ne][1]=X[ne][1].slice(1),$+=oe,re+=oe}}if(ne<X.length-1&&!X[ne][1]){X.splice(ne,1);break}if($.length>0||re.length>0){$.length>0&&re.length>0&&(ge=a(re,$),ge!==0&&(me>=0?X[me][1]+=re.substring(0,ge):(X.splice(0,0,[t,re.substring(0,ge)]),ne++),re=re.substring(ge),$=$.substring(ge)),ge=g(re,$),ge!==0&&(X[ne][1]=re.substring(re.length-ge)+X[ne][1],re=re.substring(0,re.length-ge),$=$.substring(0,$.length-ge)));var pe=se+ue;$.length===0&&re.length===0?(X.splice(ne-pe,pe),ne=ne-pe):$.length===0?(X.splice(ne-pe,pe,[e,re]),ne=ne-pe+1):re.length===0?(X.splice(ne-pe,pe,[n,$]),ne=ne-pe+1):(X.splice(ne-pe,pe,[n,$],[e,re]),ne=ne-pe+2)}ne!==0&&X[ne-1][0]===t?(X[ne-1][1]+=X[ne][1],X.splice(ne,1)):ne++,se=0,ue=0,$="",re="";break}}X[X.length-1][1]===""&&X.pop();var Ie=!1;for(ne=1;ne<X.length-1;)X[ne-1][0]===t&&X[ne+1][0]===t&&(X[ne][1].substring(X[ne][1].length-X[ne-1][1].length)===X[ne-1][1]?(X[ne][1]=X[ne-1][1]+X[ne][1].substring(0,X[ne][1].length-X[ne-1][1].length),X[ne+1][1]=X[ne-1][1]+X[ne+1][1],X.splice(ne-1,1),Ie=!0):X[ne][1].substring(0,X[ne+1][1].length)==X[ne+1][1]&&(X[ne-1][1]+=X[ne+1][1],X[ne][1]=X[ne][1].substring(X[ne+1][1].length)+X[ne+1][1],X.splice(ne+1,1),Ie=!0)),ne++;Ie&&P(X,te)}function z(X){return X>=55296&&X<=56319}function H(X){return X>=56320&&X<=57343}function G(X){return H(X.charCodeAt(0))}function N(X){return z(X.charCodeAt(X.length-1))}function J(X){for(var te=[],ne=0;ne<X.length;ne++)X[ne][1].length>0&&te.push(X[ne]);return te}function Y(X,te,ne,ue){return N(X)||G(ue)?null:J([[t,X],[n,te],[e,ne],[t,ue]])}function K(X,te,ne){var ue=typeof ne=="number"?{index:ne,length:0}:ne.oldRange,se=typeof ne=="number"?null:ne.newRange,$=X.length,re=te.length;if(ue.length===0&&(se===null||se.length===0)){var ge=ue.index,me=X.slice(0,ge),oe=X.slice(ge),Q=se?se.index:null;e:{var pe=ge+re-$;if(Q!==null&&Q!==pe||pe<0||pe>re)break e;var Ie=te.slice(0,pe),Fe=te.slice(pe);if(Fe!==oe)break e;var xe=Math.min(ge,pe),Oe=me.slice(0,xe),Le=Ie.slice(0,xe);if(Oe!==Le)break e;var He=me.slice(xe),Te=Ie.slice(xe);return Y(Oe,He,Te,oe)}e:{if(Q!==null&&Q!==ge)break e;var ke=ge,Ie=te.slice(0,ke),Fe=te.slice(ke);if(Ie!==me)break e;var Be=Math.min($-ke,re-ke),rt=oe.slice(oe.length-Be),Re=Fe.slice(Fe.length-Be);if(rt!==Re)break e;var He=oe.slice(0,oe.length-Be),Te=Fe.slice(0,Fe.length-Be);return Y(me,He,Te,rt)}}if(ue.length>0&&se&&se.length===0)e:{var Oe=X.slice(0,ue.index),rt=X.slice(ue.index+ue.length),xe=Oe.length,Be=rt.length;if(re<xe+Be)break e;var Le=te.slice(0,xe),Re=te.slice(re-Be);if(Oe!==Le||rt!==Re)break e;var He=X.slice(xe,$-Be),Te=te.slice(xe,re-Be);return Y(Oe,He,Te,rt)}return null}function fe(X,te,ne,ue){return r(X,te,ne,ue,!0)}return fe.INSERT=e,fe.DELETE=n,fe.EQUAL=t,gb=fe,gb}var vp={exports:{}};vp.exports;var ax;function Q3(){return ax||(ax=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",l="[object Array]",a="[object Boolean]",h="[object Date]",g="[object Error]",m="[object Function]",x="[object GeneratorFunction]",w="[object Map]",_="[object Number]",S="[object Object]",R="[object Promise]",k="[object RegExp]",O="[object Set]",P="[object String]",z="[object Symbol]",H="[object WeakMap]",G="[object ArrayBuffer]",N="[object DataView]",J="[object Float32Array]",Y="[object Float64Array]",K="[object Int8Array]",fe="[object Int16Array]",X="[object Int32Array]",te="[object Uint8Array]",ne="[object Uint8ClampedArray]",ue="[object Uint16Array]",se="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,re=/\w*$/,ge=/^\[object .+?Constructor\]$/,me=/^(?:0|[1-9]\d*)$/,oe={};oe[o]=oe[l]=oe[G]=oe[N]=oe[a]=oe[h]=oe[J]=oe[Y]=oe[K]=oe[fe]=oe[X]=oe[w]=oe[_]=oe[S]=oe[k]=oe[O]=oe[P]=oe[z]=oe[te]=oe[ne]=oe[ue]=oe[se]=!0,oe[g]=oe[m]=oe[H]=!1;var Q=typeof jh=="object"&&jh&&jh.Object===Object&&jh,pe=typeof self=="object"&&self&&self.Object===Object&&self,Ie=Q||pe||Function("return this")(),Fe=e&&!e.nodeType&&e,xe=Fe&&!0&&n&&!n.nodeType&&n,Oe=xe&&xe.exports===Fe;function Le(he,Ve){return he.set(Ve[0],Ve[1]),he}function He(he,Ve){return he.add(Ve),he}function Te(he,Ve){for(var _t=-1,rn=he?he.length:0;++_t<rn&&Ve(he[_t],_t,he)!==!1;);return he}function ke(he,Ve){for(var _t=-1,rn=Ve.length,pi=he.length;++_t<rn;)he[pi+_t]=Ve[_t];return he}function Be(he,Ve,_t,rn){for(var pi=-1,lo=he?he.length:0;++pi<lo;)_t=Ve(_t,he[pi],pi,he);return _t}function rt(he,Ve){for(var _t=-1,rn=Array(he);++_t<he;)rn[_t]=Ve(_t);return rn}function Re(he,Ve){return he==null?void 0:he[Ve]}function ut(he){var Ve=!1;if(he!=null&&typeof he.toString!="function")try{Ve=!!(he+"")}catch{}return Ve}function qe(he){var Ve=-1,_t=Array(he.size);return he.forEach(function(rn,pi){_t[++Ve]=[pi,rn]}),_t}function ot(he,Ve){return function(_t){return he(Ve(_t))}}function st(he){var Ve=-1,_t=Array(he.size);return he.forEach(function(rn){_t[++Ve]=rn}),_t}var bt=Array.prototype,Mt=Function.prototype,Bt=Object.prototype,at=Ie["__core-js_shared__"],Ye=(function(){var he=/[^.]+$/.exec(at&&at.keys&&at.keys.IE_PROTO||"");return he?"Symbol(src)_1."+he:""})(),Tt=Mt.toString,Ut=Bt.hasOwnProperty,gt=Bt.toString,Ht=RegExp("^"+Tt.call(Ut).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xt=Oe?Ie.Buffer:void 0,pn=Ie.Symbol,$t=Ie.Uint8Array,sn=ot(Object.getPrototypeOf,Object),Xt=Object.create,bn=Bt.propertyIsEnumerable,hn=bt.splice,Rn=Object.getOwnPropertySymbols,vn=xt?xt.isBuffer:void 0,We=ot(Object.keys,Object),Ce=gi(Ie,"DataView"),it=gi(Ie,"Map"),Ct=gi(Ie,"Promise"),Qt=gi(Ie,"Set"),Yt=gi(Ie,"WeakMap"),yn=gi(Object,"create"),gn=xi(Ce),lt=xi(it),kt=xi(Ct),vt=xi(Qt),zt=xi(Yt),Lt=pn?pn.prototype:void 0,yt=Lt?Lt.valueOf:void 0;function Rt(he){var Ve=-1,_t=he?he.length:0;for(this.clear();++Ve<_t;){var rn=he[Ve];this.set(rn[0],rn[1])}}function on(){this.__data__=yn?yn(null):{}}function En(he){return this.has(he)&&delete this.__data__[he]}function Jt(he){var Ve=this.__data__;if(yn){var _t=Ve[he];return _t===r?void 0:_t}return Ut.call(Ve,he)?Ve[he]:void 0}function xn(he){var Ve=this.__data__;return yn?Ve[he]!==void 0:Ut.call(Ve,he)}function _n(he,Ve){var _t=this.__data__;return _t[he]=yn&&Ve===void 0?r:Ve,this}Rt.prototype.clear=on,Rt.prototype.delete=En,Rt.prototype.get=Jt,Rt.prototype.has=xn,Rt.prototype.set=_n;function zn(he){var Ve=-1,_t=he?he.length:0;for(this.clear();++Ve<_t;){var rn=he[Ve];this.set(rn[0],rn[1])}}function er(){this.__data__=[]}function wn(he){var Ve=this.__data__,_t=tr(Ve,he);if(_t<0)return!1;var rn=Ve.length-1;return _t==rn?Ve.pop():hn.call(Ve,_t,1),!0}function ri(he){var Ve=this.__data__,_t=tr(Ve,he);return _t<0?void 0:Ve[_t][1]}function $e(he){return tr(this.__data__,he)>-1}function tn(he,Ve){var _t=this.__data__,rn=tr(_t,he);return rn<0?_t.push([he,Ve]):_t[rn][1]=Ve,this}zn.prototype.clear=er,zn.prototype.delete=wn,zn.prototype.get=ri,zn.prototype.has=$e,zn.prototype.set=tn;function ln(he){var Ve=-1,_t=he?he.length:0;for(this.clear();++Ve<_t;){var rn=he[Ve];this.set(rn[0],rn[1])}}function Nn(){this.__data__={hash:new Rt,map:new(it||zn),string:new Rt}}function yr(he){return Er(this,he).delete(he)}function Ln(he){return Er(this,he).get(he)}function Pt(he){return Er(this,he).has(he)}function Se(he,Ve){return Er(this,he).set(he,Ve),this}ln.prototype.clear=Nn,ln.prototype.delete=yr,ln.prototype.get=Ln,ln.prototype.has=Pt,ln.prototype.set=Se;function tt(he){this.__data__=new zn(he)}function At(){this.__data__=new zn}function Sn(he){return this.__data__.delete(he)}function In(he){return this.__data__.get(he)}function Yn(he){return this.__data__.has(he)}function lr(he,Ve){var _t=this.__data__;if(_t instanceof zn){var rn=_t.__data__;if(!it||rn.length<t-1)return rn.push([he,Ve]),this;_t=this.__data__=new ln(rn)}return _t.set(he,Ve),this}tt.prototype.clear=At,tt.prototype.delete=Sn,tt.prototype.get=In,tt.prototype.has=Yn,tt.prototype.set=lr;function pr(he,Ve){var _t=Hi(he)||Ao(he)?rt(he.length,String):[],rn=_t.length,pi=!!rn;for(var lo in he)Ut.call(he,lo)&&!(pi&&(lo=="length"||Ii(lo,rn)))&&_t.push(lo);return _t}function On(he,Ve,_t){var rn=he[Ve];(!(Ut.call(he,Ve)&&cl(rn,_t))||_t===void 0&&!(Ve in he))&&(he[Ve]=_t)}function tr(he,Ve){for(var _t=he.length;_t--;)if(cl(he[_t][0],Ve))return _t;return-1}function An(he,Ve){return he&&fr(Ve,Io(Ve),he)}function sr(he,Ve,_t,rn,pi,lo,ul){var po;if(rn&&(po=lo?rn(he,pi,lo,ul):rn(he)),po!==void 0)return po;if(!Ro(he))return he;var Wi=Hi(he);if(Wi){if(po=Bo(he),!Ve)return Pr(he,po)}else{var so=Dr(he),Ll=so==m||so==x;if(qi(he))return Ki(he,Ve);if(so==S||so==o||Ll&&!lo){if(ut(he))return lo?he:{};if(po=Eo(Ll?{}:he),!Ve)return ar(he,An(po,he))}else{if(!oe[so])return lo?he:{};po=To(he,so,sr,Ve)}}ul||(ul=new tt);var Ql=ul.get(he);if(Ql)return Ql;if(ul.set(he,po),!Wi)var sc=_t?Nr(he):Io(he);return Te(sc||he,function(fl,za){sc&&(za=fl,fl=he[za]),On(po,za,sr(fl,Ve,_t,rn,za,he,ul))}),po}function hr(he){return Ro(he)?Xt(he):{}}function ho(he,Ve,_t){var rn=Ve(he);return Hi(he)?rn:ke(rn,_t(he))}function So(he){return gt.call(he)}function oo(he){if(!Ro(he)||xr(he))return!1;var Ve=go(he)||ut(he)?Ht:ge;return Ve.test(xi(he))}function sl(he){if(!al(he))return We(he);var Ve=[];for(var _t in Object(he))Ut.call(he,_t)&&_t!="constructor"&&Ve.push(_t);return Ve}function Ki(he,Ve){if(Ve)return he.slice();var _t=new he.constructor(he.length);return he.copy(_t),_t}function Ai(he){var Ve=new he.constructor(he.byteLength);return new $t(Ve).set(new $t(he)),Ve}function Jl(he,Ve){var _t=Ve?Ai(he.buffer):he.buffer;return new he.constructor(_t,he.byteOffset,he.byteLength)}function Zo(he,Ve,_t){var rn=Ve?_t(qe(he),!0):qe(he);return Be(rn,Le,new he.constructor)}function xo(he){var Ve=new he.constructor(he.source,re.exec(he));return Ve.lastIndex=he.lastIndex,Ve}function Gr(he,Ve,_t){var rn=Ve?_t(st(he),!0):st(he);return Be(rn,He,new he.constructor)}function cn(he){return yt?Object(yt.call(he)):{}}function Cn(he,Ve){var _t=Ve?Ai(he.buffer):he.buffer;return new he.constructor(_t,he.byteOffset,he.length)}function Pr(he,Ve){var _t=-1,rn=he.length;for(Ve||(Ve=Array(rn));++_t<rn;)Ve[_t]=he[_t];return Ve}function fr(he,Ve,_t,rn){_t||(_t={});for(var pi=-1,lo=Ve.length;++pi<lo;){var ul=Ve[pi],po=void 0;On(_t,ul,po===void 0?he[ul]:po)}return _t}function ar(he,Ve){return fr(he,Ri(he),Ve)}function Nr(he){return ho(he,Io,Ri)}function Er(he,Ve){var _t=he.__data__;return Vr(Ve)?_t[typeof Ve=="string"?"string":"hash"]:_t.map}function gi(he,Ve){var _t=Re(he,Ve);return oo(_t)?_t:void 0}var Ri=Rn?ot(Rn,Object):Qn,Dr=So;(Ce&&Dr(new Ce(new ArrayBuffer(1)))!=N||it&&Dr(new it)!=w||Ct&&Dr(Ct.resolve())!=R||Qt&&Dr(new Qt)!=O||Yt&&Dr(new Yt)!=H)&&(Dr=function(he){var Ve=gt.call(he),_t=Ve==S?he.constructor:void 0,rn=_t?xi(_t):void 0;if(rn)switch(rn){case gn:return N;case lt:return w;case kt:return R;case vt:return O;case zt:return H}return Ve});function Bo(he){var Ve=he.length,_t=he.constructor(Ve);return Ve&&typeof he[0]=="string"&&Ut.call(he,"index")&&(_t.index=he.index,_t.input=he.input),_t}function Eo(he){return typeof he.constructor=="function"&&!al(he)?hr(sn(he)):{}}function To(he,Ve,_t,rn){var pi=he.constructor;switch(Ve){case G:return Ai(he);case a:case h:return new pi(+he);case N:return Jl(he,rn);case J:case Y:case K:case fe:case X:case te:case ne:case ue:case se:return Cn(he,rn);case w:return Zo(he,rn,_t);case _:case P:return new pi(he);case k:return xo(he);case O:return Gr(he,rn,_t);case z:return cn(he)}}function Ii(he,Ve){return Ve=Ve??i,!!Ve&&(typeof he=="number"||me.test(he))&&he>-1&&he%1==0&&he<Ve}function Vr(he){var Ve=typeof he;return Ve=="string"||Ve=="number"||Ve=="symbol"||Ve=="boolean"?he!=="__proto__":he===null}function xr(he){return!!Ye&&Ye in he}function al(he){var Ve=he&&he.constructor,_t=typeof Ve=="function"&&Ve.prototype||Bt;return he===_t}function xi(he){if(he!=null){try{return Tt.call(he)}catch{}try{return he+""}catch{}}return""}function Ji(he){return sr(he,!0,!0)}function cl(he,Ve){return he===Ve||he!==he&&Ve!==Ve}function Ao(he){return Qi(he)&&Ut.call(he,"callee")&&(!bn.call(he,"callee")||gt.call(he)==o)}var Hi=Array.isArray;function zo(he){return he!=null&&Jn(he.length)&&!go(he)}function Qi(he){return ai(he)&&zo(he)}var qi=vn||Et;function go(he){var Ve=Ro(he)?gt.call(he):"";return Ve==m||Ve==x}function Jn(he){return typeof he=="number"&&he>-1&&he%1==0&&he<=i}function Ro(he){var Ve=typeof he;return!!he&&(Ve=="object"||Ve=="function")}function ai(he){return!!he&&typeof he=="object"}function Io(he){return zo(he)?pr(he):sl(he)}function Qn(){return[]}function Et(){return!1}n.exports=Ji})(vp,vp.exports)),vp.exports}var pb,cx;function q3(){return cx||(cx=1,pb=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(i=r;i--!==0;)if(!n(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){var l=o[i];if(!n(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}),pb}var x0={},ux;function p7(){if(ux)return x0;ux=1,Object.defineProperty(x0,"__esModule",{value:!0});const n=Q3(),e=q3();var t;return(function(r){function i(h={},g={},m=!1){typeof h!="object"&&(h={}),typeof g!="object"&&(g={});let x=n(g);m||(x=Object.keys(x).reduce((w,_)=>(x[_]!=null&&(w[_]=x[_]),w),{}));for(const w in h)h[w]!==void 0&&g[w]===void 0&&(x[w]=h[w]);return Object.keys(x).length>0?x:void 0}r.compose=i;function o(h={},g={}){typeof h!="object"&&(h={}),typeof g!="object"&&(g={});const m=Object.keys(h).concat(Object.keys(g)).reduce((x,w)=>(e(h[w],g[w])||(x[w]=g[w]===void 0?null:g[w]),x),{});return Object.keys(m).length>0?m:void 0}r.diff=o;function l(h={},g={}){h=h||{};const m=Object.keys(g).reduce((x,w)=>(g[w]!==h[w]&&h[w]!==void 0&&(x[w]=g[w]),x),{});return Object.keys(h).reduce((x,w)=>(h[w]!==g[w]&&g[w]===void 0&&(x[w]=null),x),m)}r.invert=l;function a(h,g,m=!1){if(typeof h!="object")return g;if(typeof g!="object")return;if(!m)return g;const x=Object.keys(g).reduce((w,_)=>(h[_]===void 0&&(w[_]=g[_]),w),{});return Object.keys(x).length>0?x:void 0}r.transform=a})(t||(t={})),x0.default=t,x0}var w0={},fx;function j3(){if(fx)return w0;fx=1,Object.defineProperty(w0,"__esModule",{value:!0});var n;return(function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t})(n||(n={})),w0.default=n,w0}var C0={},hx;function v7(){if(hx)return C0;hx=1,Object.defineProperty(C0,"__esModule",{value:!0});const n=j3();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const i=this.ops[this.index];if(i){const o=this.offset,l=n.default.length(i);if(r>=l-o?(r=l-o,this.index+=1,this.offset=0):this.offset+=r,typeof i.delete=="number")return{delete:r};{const a={};return i.attributes&&(a.attributes=i.attributes),typeof i.retain=="number"?a.retain=r:typeof i.retain=="object"&&i.retain!==null?a.retain=i.retain:typeof i.insert=="string"?a.insert=i.insert.substr(o,r):a.insert=i.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,i=this.index,o=this.next(),l=this.ops.slice(this.index);return this.offset=r,this.index=i,[o].concat(l)}}else return[]}}return C0.default=e,C0}var dx;function b7(){return dx||(dx=1,(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=g7(),r=Q3(),i=q3(),o=p7();e.AttributeMap=o.default;const l=j3();e.Op=l.default;const a=v7();e.OpIterator=a.default;const h="\0",g=(x,w)=>{if(typeof x!="object"||x===null)throw new Error(`cannot retain a ${typeof x}`);if(typeof w!="object"||w===null)throw new Error(`cannot retain a ${typeof w}`);const _=Object.keys(x)[0];if(!_||_!==Object.keys(w)[0])throw new Error(`embed types not matched: ${_} != ${Object.keys(w)[0]}`);return[_,x[_],w[_]]};class m{constructor(w){Array.isArray(w)?this.ops=w:w!=null&&Array.isArray(w.ops)?this.ops=w.ops:this.ops=[]}static registerEmbed(w,_){this.handlers[w]=_}static unregisterEmbed(w){delete this.handlers[w]}static getHandler(w){const _=this.handlers[w];if(!_)throw new Error(`no handlers for embed type "${w}"`);return _}insert(w,_){const S={};return typeof w=="string"&&w.length===0?this:(S.insert=w,_!=null&&typeof _=="object"&&Object.keys(_).length>0&&(S.attributes=_),this.push(S))}delete(w){return w<=0?this:this.push({delete:w})}retain(w,_){if(typeof w=="number"&&w<=0)return this;const S={retain:w};return _!=null&&typeof _=="object"&&Object.keys(_).length>0&&(S.attributes=_),this.push(S)}push(w){let _=this.ops.length,S=this.ops[_-1];if(w=r(w),typeof S=="object"){if(typeof w.delete=="number"&&typeof S.delete=="number")return this.ops[_-1]={delete:S.delete+w.delete},this;if(typeof S.delete=="number"&&w.insert!=null&&(_-=1,S=this.ops[_-1],typeof S!="object"))return this.ops.unshift(w),this;if(i(w.attributes,S.attributes)){if(typeof w.insert=="string"&&typeof S.insert=="string")return this.ops[_-1]={insert:S.insert+w.insert},typeof w.attributes=="object"&&(this.ops[_-1].attributes=w.attributes),this;if(typeof w.retain=="number"&&typeof S.retain=="number")return this.ops[_-1]={retain:S.retain+w.retain},typeof w.attributes=="object"&&(this.ops[_-1].attributes=w.attributes),this}}return _===this.ops.length?this.ops.push(w):this.ops.splice(_,0,w),this}chop(){const w=this.ops[this.ops.length-1];return w&&typeof w.retain=="number"&&!w.attributes&&this.ops.pop(),this}filter(w){return this.ops.filter(w)}forEach(w){this.ops.forEach(w)}map(w){return this.ops.map(w)}partition(w){const _=[],S=[];return this.forEach(R=>{(w(R)?_:S).push(R)}),[_,S]}reduce(w,_){return this.ops.reduce(w,_)}changeLength(){return this.reduce((w,_)=>_.insert?w+l.default.length(_):_.delete?w-_.delete:w,0)}length(){return this.reduce((w,_)=>w+l.default.length(_),0)}slice(w=0,_=1/0){const S=[],R=new a.default(this.ops);let k=0;for(;k<_&&R.hasNext();){let O;k<w?O=R.next(w-k):(O=R.next(_-k),S.push(O)),k+=l.default.length(O)}return new m(S)}compose(w){const _=new a.default(this.ops),S=new a.default(w.ops),R=[],k=S.peek();if(k!=null&&typeof k.retain=="number"&&k.attributes==null){let P=k.retain;for(;_.peekType()==="insert"&&_.peekLength()<=P;)P-=_.peekLength(),R.push(_.next());k.retain-P>0&&S.next(k.retain-P)}const O=new m(R);for(;_.hasNext()||S.hasNext();)if(S.peekType()==="insert")O.push(S.next());else if(_.peekType()==="delete")O.push(_.next());else{const P=Math.min(_.peekLength(),S.peekLength()),z=_.next(P),H=S.next(P);if(H.retain){const G={};if(typeof z.retain=="number")G.retain=typeof H.retain=="number"?P:H.retain;else if(typeof H.retain=="number")z.retain==null?G.insert=z.insert:G.retain=z.retain;else{const J=z.retain==null?"insert":"retain",[Y,K,fe]=g(z[J],H.retain),X=m.getHandler(Y);G[J]={[Y]:X.compose(K,fe,J==="retain")}}const N=o.default.compose(z.attributes,H.attributes,typeof z.retain=="number");if(N&&(G.attributes=N),O.push(G),!S.hasNext()&&i(O.ops[O.ops.length-1],G)){const J=new m(_.rest());return O.concat(J).chop()}}else typeof H.delete=="number"&&(typeof z.retain=="number"||typeof z.retain=="object"&&z.retain!==null)&&O.push(H)}return O.chop()}concat(w){const _=new m(this.ops.slice());return w.ops.length>0&&(_.push(w.ops[0]),_.ops=_.ops.concat(w.ops.slice(1))),_}diff(w,_){if(this.ops===w.ops)return new m;const S=[this,w].map(z=>z.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:h;const G=z===w?"on":"with";throw new Error("diff() called "+G+" non-document")}).join("")),R=new m,k=t(S[0],S[1],_,!0),O=new a.default(this.ops),P=new a.default(w.ops);return k.forEach(z=>{let H=z[1].length;for(;H>0;){let G=0;switch(z[0]){case t.INSERT:G=Math.min(P.peekLength(),H),R.push(P.next(G));break;case t.DELETE:G=Math.min(H,O.peekLength()),O.next(G),R.delete(G);break;case t.EQUAL:G=Math.min(O.peekLength(),P.peekLength(),H);const N=O.next(G),J=P.next(G);i(N.insert,J.insert)?R.retain(G,o.default.diff(N.attributes,J.attributes)):R.push(J).delete(G);break}H-=G}}),R.chop()}eachLine(w,_=`
289
+ `){const S=new a.default(this.ops);let R=new m,k=0;for(;S.hasNext();){if(S.peekType()!=="insert")return;const O=S.peek(),P=l.default.length(O)-S.peekLength(),z=typeof O.insert=="string"?O.insert.indexOf(_,P)-P:-1;if(z<0)R.push(S.next());else if(z>0)R.push(S.next(z));else{if(w(R,S.next(1).attributes||{},k)===!1)return;k+=1,R=new m}}R.length()>0&&w(R,{},k)}invert(w){const _=new m;return this.reduce((S,R)=>{if(R.insert)_.delete(l.default.length(R));else{if(typeof R.retain=="number"&&R.attributes==null)return _.retain(R.retain),S+R.retain;if(R.delete||typeof R.retain=="number"){const k=R.delete||R.retain;return w.slice(S,S+k).forEach(P=>{R.delete?_.push(P):R.retain&&R.attributes&&_.retain(l.default.length(P),o.default.invert(R.attributes,P.attributes))}),S+k}else if(typeof R.retain=="object"&&R.retain!==null){const k=w.slice(S,S+1),O=new a.default(k.ops).next(),[P,z,H]=g(R.retain,O.insert),G=m.getHandler(P);return _.retain({[P]:G.invert(z,H)},o.default.invert(R.attributes,O.attributes)),S+1}}return S},0),_.chop()}transform(w,_=!1){if(_=!!_,typeof w=="number")return this.transformPosition(w,_);const S=w,R=new a.default(this.ops),k=new a.default(S.ops),O=new m;for(;R.hasNext()||k.hasNext();)if(R.peekType()==="insert"&&(_||k.peekType()!=="insert"))O.retain(l.default.length(R.next()));else if(k.peekType()==="insert")O.push(k.next());else{const P=Math.min(R.peekLength(),k.peekLength()),z=R.next(P),H=k.next(P);if(z.delete)continue;if(H.delete)O.push(H);else{const G=z.retain,N=H.retain;let J=typeof N=="object"&&N!==null?N:P;if(typeof G=="object"&&G!==null&&typeof N=="object"&&N!==null){const Y=Object.keys(G)[0];if(Y===Object.keys(N)[0]){const K=m.getHandler(Y);K&&(J={[Y]:K.transform(G[Y],N[Y],_)})}}O.retain(J,o.default.transform(z.attributes,H.attributes,_))}}return O.chop()}transformPosition(w,_=!1){_=!!_;const S=new a.default(this.ops);let R=0;for(;S.hasNext()&&R<=w;){const k=S.peekLength(),O=S.peekType();if(S.next(),O==="delete"){w-=Math.min(k,w-R);continue}else O==="insert"&&(R<w||!_)&&(w+=k);R+=k}return w}}m.Op=l.default,m.OpIterator=a.default,m.AttributeMap=o.default,m.handlers={},e.default=m,n.exports=m,n.exports.default=m})(m0,m0.exports)),m0.exports}var ph=b7();const Xn=L1(ph);var $3=typeof global=="object"&&global&&global.Object===Object&&global,y7=typeof self=="object"&&self&&self.Object===Object&&self,sd=$3||y7||Function("return this")(),ag=sd.Symbol,e4=Object.prototype,m7=e4.hasOwnProperty,x7=e4.toString,lp=ag?ag.toStringTag:void 0;function w7(n){var e=m7.call(n,lp),t=n[lp];try{n[lp]=void 0;var r=!0}catch{}var i=x7.call(n);return r&&(e?n[lp]=t:delete n[lp]),i}var C7=Object.prototype,_7=C7.toString;function S7(n){return _7.call(n)}var E7="[object Null]",T7="[object Undefined]",gx=ag?ag.toStringTag:void 0;function P1(n){return n==null?n===void 0?T7:E7:gx&&gx in Object(n)?w7(n):S7(n)}function Ad(n){return n!=null&&typeof n=="object"}var Pg=Array.isArray;function fg(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function t4(n){return n}var A7="[object AsyncFunction]",R7="[object Function]",I7="[object GeneratorFunction]",k7="[object Proxy]";function Rm(n){if(!fg(n))return!1;var e=P1(n);return e==R7||e==I7||e==A7||e==k7}var vb=sd["__core-js_shared__"],px=(function(){var n=/[^.]+$/.exec(vb&&vb.keys&&vb.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function M7(n){return!!px&&px in n}var L7=Function.prototype,O7=L7.toString;function Hg(n){if(n!=null){try{return O7.call(n)}catch{}try{return n+""}catch{}}return""}var P7=/[\\^$.*+?()[\]{}|]/g,D7=/^\[object .+?Constructor\]$/,N7=Function.prototype,F7=Object.prototype,B7=N7.toString,z7=F7.hasOwnProperty,H7=RegExp("^"+B7.call(z7).replace(P7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function W7(n){if(!fg(n)||M7(n))return!1;var e=Rm(n)?H7:D7;return e.test(Hg(n))}function U7(n,e){return n==null?void 0:n[e]}function Wg(n,e){var t=U7(n,e);return W7(t)?t:void 0}var Py=Wg(sd,"WeakMap"),vx=Object.create,G7=(function(){function n(){}return function(e){if(!fg(e))return{};if(vx)return vx(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function Y7(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function V7(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var Z7=800,X7=16,K7=Date.now;function J7(n){var e=0,t=0;return function(){var r=K7(),i=X7-(r-t);if(t=r,i>0){if(++e>=Z7)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function Q7(n){return function(){return n}}var iv=(function(){try{var n=Wg(Object,"defineProperty");return n({},"",{}),n}catch{}})(),q7=iv?function(n,e){return iv(n,"toString",{configurable:!0,enumerable:!1,value:Q7(e),writable:!0})}:t4,j7=J7(q7);function $7(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var eM=9007199254740991,tM=/^(?:0|[1-9]\d*)$/;function n4(n,e){var t=typeof n;return e=e??eM,!!e&&(t=="number"||t!="symbol"&&tM.test(n))&&n>-1&&n%1==0&&n<e}function Im(n,e,t){e=="__proto__"&&iv?iv(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Wp(n,e){return n===e||n!==n&&e!==e}var nM=Object.prototype,rM=nM.hasOwnProperty;function r4(n,e,t){var r=n[e];(!(rM.call(n,e)&&Wp(r,t))||t===void 0&&!(e in n))&&Im(n,e,t)}function iM(n,e,t,r){var i=!t;t||(t={});for(var o=-1,l=e.length;++o<l;){var a=e[o],h=void 0;h===void 0&&(h=n[a]),i?Im(t,a,h):r4(t,a,h)}return t}var bx=Math.max;function oM(n,e,t){return e=bx(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,o=bx(r.length-e,0),l=Array(o);++i<o;)l[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(l),Y7(n,this,a)}}function lM(n,e){return j7(oM(n,e,t4),n+"")}var sM=9007199254740991;function i4(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=sM}function Av(n){return n!=null&&i4(n.length)&&!Rm(n)}function aM(n,e,t){if(!fg(t))return!1;var r=typeof e;return(r=="number"?Av(t)&&n4(e,t.length):r=="string"&&e in t)?Wp(t[e],n):!1}function cM(n){return lM(function(e,t){var r=-1,i=t.length,o=i>1?t[i-1]:void 0,l=i>2?t[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,l&&aM(t[0],t[1],l)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,o)}return e})}var uM=Object.prototype;function km(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||uM;return n===t}function fM(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var hM="[object Arguments]";function yx(n){return Ad(n)&&P1(n)==hM}var o4=Object.prototype,dM=o4.hasOwnProperty,gM=o4.propertyIsEnumerable,Dy=yx((function(){return arguments})())?yx:function(n){return Ad(n)&&dM.call(n,"callee")&&!gM.call(n,"callee")};function pM(){return!1}var l4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mx=l4&&typeof module=="object"&&module&&!module.nodeType&&module,vM=mx&&mx.exports===l4,xx=vM?sd.Buffer:void 0,bM=xx?xx.isBuffer:void 0,Rp=bM||pM,yM="[object Arguments]",mM="[object Array]",xM="[object Boolean]",wM="[object Date]",CM="[object Error]",_M="[object Function]",SM="[object Map]",EM="[object Number]",TM="[object Object]",AM="[object RegExp]",RM="[object Set]",IM="[object String]",kM="[object WeakMap]",MM="[object ArrayBuffer]",LM="[object DataView]",OM="[object Float32Array]",PM="[object Float64Array]",DM="[object Int8Array]",NM="[object Int16Array]",FM="[object Int32Array]",BM="[object Uint8Array]",zM="[object Uint8ClampedArray]",HM="[object Uint16Array]",WM="[object Uint32Array]",Xl={};Xl[OM]=Xl[PM]=Xl[DM]=Xl[NM]=Xl[FM]=Xl[BM]=Xl[zM]=Xl[HM]=Xl[WM]=!0;Xl[yM]=Xl[mM]=Xl[MM]=Xl[xM]=Xl[LM]=Xl[wM]=Xl[CM]=Xl[_M]=Xl[SM]=Xl[EM]=Xl[TM]=Xl[AM]=Xl[RM]=Xl[IM]=Xl[kM]=!1;function UM(n){return Ad(n)&&i4(n.length)&&!!Xl[P1(n)]}function Mm(n){return function(e){return n(e)}}var s4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yp=s4&&typeof module=="object"&&module&&!module.nodeType&&module,GM=yp&&yp.exports===s4,bb=GM&&$3.process,C1=(function(){try{var n=yp&&yp.require&&yp.require("util").types;return n||bb&&bb.binding&&bb.binding("util")}catch{}})(),wx=C1&&C1.isTypedArray,Lm=wx?Mm(wx):UM,YM=Object.prototype,VM=YM.hasOwnProperty;function a4(n,e){var t=Pg(n),r=!t&&Dy(n),i=!t&&!r&&Rp(n),o=!t&&!r&&!i&&Lm(n),l=t||r||i||o,a=l?fM(n.length,String):[],h=a.length;for(var g in n)(e||VM.call(n,g))&&!(l&&(g=="length"||i&&(g=="offset"||g=="parent")||o&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||n4(g,h)))&&a.push(g);return a}function c4(n,e){return function(t){return n(e(t))}}var ZM=c4(Object.keys,Object),XM=Object.prototype,KM=XM.hasOwnProperty;function JM(n){if(!km(n))return ZM(n);var e=[];for(var t in Object(n))KM.call(n,t)&&t!="constructor"&&e.push(t);return e}function QM(n){return Av(n)?a4(n):JM(n)}function qM(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var jM=Object.prototype,$M=jM.hasOwnProperty;function eL(n){if(!fg(n))return qM(n);var e=km(n),t=[];for(var r in n)r=="constructor"&&(e||!$M.call(n,r))||t.push(r);return t}function u4(n){return Av(n)?a4(n,!0):eL(n)}var Ip=Wg(Object,"create");function tL(){this.__data__=Ip?Ip(null):{},this.size=0}function nL(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var rL="__lodash_hash_undefined__",iL=Object.prototype,oL=iL.hasOwnProperty;function lL(n){var e=this.__data__;if(Ip){var t=e[n];return t===rL?void 0:t}return oL.call(e,n)?e[n]:void 0}var sL=Object.prototype,aL=sL.hasOwnProperty;function cL(n){var e=this.__data__;return Ip?e[n]!==void 0:aL.call(e,n)}var uL="__lodash_hash_undefined__";function fL(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ip&&e===void 0?uL:e,this}function Dg(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Dg.prototype.clear=tL;Dg.prototype.delete=nL;Dg.prototype.get=lL;Dg.prototype.has=cL;Dg.prototype.set=fL;function hL(){this.__data__=[],this.size=0}function Rv(n,e){for(var t=n.length;t--;)if(Wp(n[t][0],e))return t;return-1}var dL=Array.prototype,gL=dL.splice;function pL(n){var e=this.__data__,t=Rv(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():gL.call(e,t,1),--this.size,!0}function vL(n){var e=this.__data__,t=Rv(e,n);return t<0?void 0:e[t][1]}function bL(n){return Rv(this.__data__,n)>-1}function yL(n,e){var t=this.__data__,r=Rv(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function kd(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}kd.prototype.clear=hL;kd.prototype.delete=pL;kd.prototype.get=vL;kd.prototype.has=bL;kd.prototype.set=yL;var kp=Wg(sd,"Map");function mL(){this.size=0,this.__data__={hash:new Dg,map:new(kp||kd),string:new Dg}}function xL(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Iv(n,e){var t=n.__data__;return xL(e)?t[typeof e=="string"?"string":"hash"]:t.map}function wL(n){var e=Iv(this,n).delete(n);return this.size-=e?1:0,e}function CL(n){return Iv(this,n).get(n)}function _L(n){return Iv(this,n).has(n)}function SL(n,e){var t=Iv(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Ug(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ug.prototype.clear=mL;Ug.prototype.delete=wL;Ug.prototype.get=CL;Ug.prototype.has=_L;Ug.prototype.set=SL;function EL(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var f4=c4(Object.getPrototypeOf,Object),TL="[object Object]",AL=Function.prototype,RL=Object.prototype,h4=AL.toString,IL=RL.hasOwnProperty,kL=h4.call(Object);function ML(n){if(!Ad(n)||P1(n)!=TL)return!1;var e=f4(n);if(e===null)return!0;var t=IL.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&h4.call(t)==kL}function LL(){this.__data__=new kd,this.size=0}function OL(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function PL(n){return this.__data__.get(n)}function DL(n){return this.__data__.has(n)}var NL=200;function FL(n,e){var t=this.__data__;if(t instanceof kd){var r=t.__data__;if(!kp||r.length<NL-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Ug(r)}return t.set(n,e),this.size=t.size,this}function $h(n){var e=this.__data__=new kd(n);this.size=e.size}$h.prototype.clear=LL;$h.prototype.delete=OL;$h.prototype.get=PL;$h.prototype.has=DL;$h.prototype.set=FL;var d4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cx=d4&&typeof module=="object"&&module&&!module.nodeType&&module,BL=Cx&&Cx.exports===d4,_x=BL?sd.Buffer:void 0,Sx=_x?_x.allocUnsafe:void 0;function g4(n,e){if(e)return n.slice();var t=n.length,r=Sx?Sx(t):new n.constructor(t);return n.copy(r),r}function zL(n,e){for(var t=-1,r=n==null?0:n.length,i=0,o=[];++t<r;){var l=n[t];e(l,t,n)&&(o[i++]=l)}return o}function HL(){return[]}var WL=Object.prototype,UL=WL.propertyIsEnumerable,Ex=Object.getOwnPropertySymbols,GL=Ex?function(n){return n==null?[]:(n=Object(n),zL(Ex(n),function(e){return UL.call(n,e)}))}:HL;function YL(n,e,t){var r=e(n);return Pg(n)?r:EL(r,t(n))}function Ny(n){return YL(n,QM,GL)}var Fy=Wg(sd,"DataView"),By=Wg(sd,"Promise"),zy=Wg(sd,"Set"),Tx="[object Map]",VL="[object Object]",Ax="[object Promise]",Rx="[object Set]",Ix="[object WeakMap]",kx="[object DataView]",ZL=Hg(Fy),XL=Hg(kp),KL=Hg(By),JL=Hg(zy),QL=Hg(Py),Ih=P1;(Fy&&Ih(new Fy(new ArrayBuffer(1)))!=kx||kp&&Ih(new kp)!=Tx||By&&Ih(By.resolve())!=Ax||zy&&Ih(new zy)!=Rx||Py&&Ih(new Py)!=Ix)&&(Ih=function(n){var e=P1(n),t=e==VL?n.constructor:void 0,r=t?Hg(t):"";if(r)switch(r){case ZL:return kx;case XL:return Tx;case KL:return Ax;case JL:return Rx;case QL:return Ix}return e});var qL=Object.prototype,jL=qL.hasOwnProperty;function $L(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&jL.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var ov=sd.Uint8Array;function Om(n){var e=new n.constructor(n.byteLength);return new ov(e).set(new ov(n)),e}function eO(n,e){var t=Om(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var tO=/\w*$/;function nO(n){var e=new n.constructor(n.source,tO.exec(n));return e.lastIndex=n.lastIndex,e}var Mx=ag?ag.prototype:void 0,Lx=Mx?Mx.valueOf:void 0;function rO(n){return Lx?Object(Lx.call(n)):{}}function p4(n,e){var t=e?Om(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var iO="[object Boolean]",oO="[object Date]",lO="[object Map]",sO="[object Number]",aO="[object RegExp]",cO="[object Set]",uO="[object String]",fO="[object Symbol]",hO="[object ArrayBuffer]",dO="[object DataView]",gO="[object Float32Array]",pO="[object Float64Array]",vO="[object Int8Array]",bO="[object Int16Array]",yO="[object Int32Array]",mO="[object Uint8Array]",xO="[object Uint8ClampedArray]",wO="[object Uint16Array]",CO="[object Uint32Array]";function _O(n,e,t){var r=n.constructor;switch(e){case hO:return Om(n);case iO:case oO:return new r(+n);case dO:return eO(n);case gO:case pO:case vO:case bO:case yO:case mO:case xO:case wO:case CO:return p4(n,t);case lO:return new r;case sO:case uO:return new r(n);case aO:return nO(n);case cO:return new r;case fO:return rO(n)}}function v4(n){return typeof n.constructor=="function"&&!km(n)?G7(f4(n)):{}}var SO="[object Map]";function EO(n){return Ad(n)&&Ih(n)==SO}var Ox=C1&&C1.isMap,TO=Ox?Mm(Ox):EO,AO="[object Set]";function RO(n){return Ad(n)&&Ih(n)==AO}var Px=C1&&C1.isSet,IO=Px?Mm(Px):RO,kO=1,b4="[object Arguments]",MO="[object Array]",LO="[object Boolean]",OO="[object Date]",PO="[object Error]",y4="[object Function]",DO="[object GeneratorFunction]",NO="[object Map]",FO="[object Number]",m4="[object Object]",BO="[object RegExp]",zO="[object Set]",HO="[object String]",WO="[object Symbol]",UO="[object WeakMap]",GO="[object ArrayBuffer]",YO="[object DataView]",VO="[object Float32Array]",ZO="[object Float64Array]",XO="[object Int8Array]",KO="[object Int16Array]",JO="[object Int32Array]",QO="[object Uint8Array]",qO="[object Uint8ClampedArray]",jO="[object Uint16Array]",$O="[object Uint32Array]",kl={};kl[b4]=kl[MO]=kl[GO]=kl[YO]=kl[LO]=kl[OO]=kl[VO]=kl[ZO]=kl[XO]=kl[KO]=kl[JO]=kl[NO]=kl[FO]=kl[m4]=kl[BO]=kl[zO]=kl[HO]=kl[WO]=kl[QO]=kl[qO]=kl[jO]=kl[$O]=!0;kl[PO]=kl[y4]=kl[UO]=!1;function V0(n,e,t,r,i,o){var l,a=e&kO;if(l!==void 0)return l;if(!fg(n))return n;var h=Pg(n);if(h)l=$L(n);else{var g=Ih(n),m=g==y4||g==DO;if(Rp(n))return g4(n,a);if(g==m4||g==b4||m&&!i)l=m?{}:v4(n);else{if(!kl[g])return i?n:{};l=_O(n,g,a)}}o||(o=new $h);var x=o.get(n);if(x)return x;o.set(n,l),IO(n)?n.forEach(function(S){l.add(V0(S,e,t,S,n,o))}):TO(n)&&n.forEach(function(S,R){l.set(R,V0(S,e,t,R,n,o))});var w=Ny,_=h?void 0:w(n);return $7(_||n,function(S,R){_&&(R=S,S=n[R]),r4(l,R,V0(S,e,t,R,n,o))}),l}var eP=1,tP=4;function g1(n){return V0(n,eP|tP)}var nP="__lodash_hash_undefined__";function rP(n){return this.__data__.set(n,nP),this}function iP(n){return this.__data__.has(n)}function lv(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Ug;++e<t;)this.add(n[e])}lv.prototype.add=lv.prototype.push=rP;lv.prototype.has=iP;function oP(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function lP(n,e){return n.has(e)}var sP=1,aP=2;function x4(n,e,t,r,i,o){var l=t&sP,a=n.length,h=e.length;if(a!=h&&!(l&&h>a))return!1;var g=o.get(n),m=o.get(e);if(g&&m)return g==e&&m==n;var x=-1,w=!0,_=t&aP?new lv:void 0;for(o.set(n,e),o.set(e,n);++x<a;){var S=n[x],R=e[x];if(r)var k=l?r(R,S,x,e,n,o):r(S,R,x,n,e,o);if(k!==void 0){if(k)continue;w=!1;break}if(_){if(!oP(e,function(O,P){if(!lP(_,P)&&(S===O||i(S,O,t,r,o)))return _.push(P)})){w=!1;break}}else if(!(S===R||i(S,R,t,r,o))){w=!1;break}}return o.delete(n),o.delete(e),w}function cP(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function uP(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var fP=1,hP=2,dP="[object Boolean]",gP="[object Date]",pP="[object Error]",vP="[object Map]",bP="[object Number]",yP="[object RegExp]",mP="[object Set]",xP="[object String]",wP="[object Symbol]",CP="[object ArrayBuffer]",_P="[object DataView]",Dx=ag?ag.prototype:void 0,yb=Dx?Dx.valueOf:void 0;function SP(n,e,t,r,i,o,l){switch(t){case _P:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case CP:return!(n.byteLength!=e.byteLength||!o(new ov(n),new ov(e)));case dP:case gP:case bP:return Wp(+n,+e);case pP:return n.name==e.name&&n.message==e.message;case yP:case xP:return n==e+"";case vP:var a=cP;case mP:var h=r&fP;if(a||(a=uP),n.size!=e.size&&!h)return!1;var g=l.get(n);if(g)return g==e;r|=hP,l.set(n,e);var m=x4(a(n),a(e),r,i,o,l);return l.delete(n),m;case wP:if(yb)return yb.call(n)==yb.call(e)}return!1}var EP=1,TP=Object.prototype,AP=TP.hasOwnProperty;function RP(n,e,t,r,i,o){var l=t&EP,a=Ny(n),h=a.length,g=Ny(e),m=g.length;if(h!=m&&!l)return!1;for(var x=h;x--;){var w=a[x];if(!(l?w in e:AP.call(e,w)))return!1}var _=o.get(n),S=o.get(e);if(_&&S)return _==e&&S==n;var R=!0;o.set(n,e),o.set(e,n);for(var k=l;++x<h;){w=a[x];var O=n[w],P=e[w];if(r)var z=l?r(P,O,w,e,n,o):r(O,P,w,n,e,o);if(!(z===void 0?O===P||i(O,P,t,r,o):z)){R=!1;break}k||(k=w=="constructor")}if(R&&!k){var H=n.constructor,G=e.constructor;H!=G&&"constructor"in n&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof G=="function"&&G instanceof G)&&(R=!1)}return o.delete(n),o.delete(e),R}var IP=1,Nx="[object Arguments]",Fx="[object Array]",_0="[object Object]",kP=Object.prototype,Bx=kP.hasOwnProperty;function MP(n,e,t,r,i,o){var l=Pg(n),a=Pg(e),h=l?Fx:Ih(n),g=a?Fx:Ih(e);h=h==Nx?_0:h,g=g==Nx?_0:g;var m=h==_0,x=g==_0,w=h==g;if(w&&Rp(n)){if(!Rp(e))return!1;l=!0,m=!1}if(w&&!m)return o||(o=new $h),l||Lm(n)?x4(n,e,t,r,i,o):SP(n,e,h,t,r,i,o);if(!(t&IP)){var _=m&&Bx.call(n,"__wrapped__"),S=x&&Bx.call(e,"__wrapped__");if(_||S){var R=_?n.value():n,k=S?e.value():e;return o||(o=new $h),i(R,k,t,r,o)}}return w?(o||(o=new $h),RP(n,e,t,r,i,o)):!1}function w4(n,e,t,r,i){return n===e?!0:n==null||e==null||!Ad(n)&&!Ad(e)?n!==n&&e!==e:MP(n,e,t,r,w4,i)}function LP(n){return function(e,t,r){for(var i=-1,o=Object(e),l=r(e),a=l.length;a--;){var h=l[++i];if(t(o[h],h,o)===!1)break}return e}}var OP=LP();function Hy(n,e,t){(t!==void 0&&!Wp(n[e],t)||t===void 0&&!(e in n))&&Im(n,e,t)}function PP(n){return Ad(n)&&Av(n)}function Wy(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function DP(n){return iM(n,u4(n))}function NP(n,e,t,r,i,o,l){var a=Wy(n,t),h=Wy(e,t),g=l.get(h);if(g){Hy(n,t,g);return}var m=o?o(a,h,t+"",n,e,l):void 0,x=m===void 0;if(x){var w=Pg(h),_=!w&&Rp(h),S=!w&&!_&&Lm(h);m=h,w||_||S?Pg(a)?m=a:PP(a)?m=V7(a):_?(x=!1,m=g4(h,!0)):S?(x=!1,m=p4(h,!0)):m=[]:ML(h)||Dy(h)?(m=a,Dy(a)?m=DP(a):(!fg(a)||Rm(a))&&(m=v4(h))):x=!1}x&&(l.set(h,m),i(m,h,r,o,l),l.delete(h)),Hy(n,t,m)}function C4(n,e,t,r,i){n!==e&&OP(e,function(o,l){if(i||(i=new $h),fg(o))NP(n,e,l,t,C4,r,i);else{var a=r?r(Wy(n,l),o,l+"",n,e,i):void 0;a===void 0&&(a=o),Hy(n,l,a)}},u4)}function $d(n,e){return w4(n,e)}var og=cM(function(n,e,t){C4(n,e,t)}),Kn=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(Kn||{});class rd{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const i=Kn.TYPE&Kn.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Kn.LEVEL|i:Kn.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class p1 extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const _4=class Uy{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const i=this.query(t);if(i==null)throw new p1(`Unable to create ${t} blot`);const o=i,l=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:o.create(r),a=new o(e,l,r);return Uy.blots.set(a.domNode,a),a}find(e,t=!1){return Uy.find(e,t)}query(e,t=Kn.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Kn.LEVEL&Kn.BLOCK?r=this.types.block:e&Kn.LEVEL&Kn.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&Kn.LEVEL&r.scope&&t&Kn.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,i="attrName"in t;if(!r&&!i)throw new p1("Invalid definition");if(r&&t.blotName==="abstract")throw new p1("Cannot register abstract class");const o=r?t.blotName:i?t.attrName:void 0;return this.types[o]=t,i?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(l=>l.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(l=>{(this.tags[l]==null||t.className==null)&&(this.tags[l]=t)}))),t})}};_4.blots=new WeakMap;let _1=_4;function zx(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class FP extends rd{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){zx(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(zx(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Bh=FP;function mb(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class BP extends rd{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[mb(this.keyName)]=t,!0):!1}remove(e){e.style[mb(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[mb(this.keyName)];return this.canAdd(e,t)?t:""}}const hg=BP;class zP{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=_1.find(this.domNode);if(e==null)return;const t=rd.keys(this.domNode),r=Bh.keys(this.domNode),i=hg.keys(this.domNode);t.concat(r).concat(i).forEach(o=>{const l=e.scroll.query(o,Kn.ATTRIBUTE);l instanceof rd&&(this.attributes[l.attrName]=l)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const kv=zP,S4=class{constructor(e,t){this.scroll=e,this.domNode=t,_1.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new p1("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),_1.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,i){const o=this.isolate(e,t);if(this.scroll.query(r,Kn.BLOT)!=null&&i)o.wrap(r,i);else if(this.scroll.query(r,Kn.ATTRIBUTE)!=null){const l=this.scroll.create(this.statics.scope);o.wrap(l),l.format(r,i)}}insertAt(e,t,r){const i=r==null?this.scroll.create("text",t):this.scroll.create(t,r),o=this.split(e);this.parent.insertBefore(i,o||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new p1(`Cannot wrap ${e}`);return r.appendChild(this),r}};S4.blotName="abstract";let E4=S4;const T4=class extends E4{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};T4.scope=Kn.INLINE_BLOT;let HP=T4;const lu=HP;class WP{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),i=0;for(;r;){if(r===e)return i;i+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let i=r();for(;i;){const o=i.length();if(e<o||t&&e===o&&(i.next==null||i.next.length()!==0))return[i,e];e-=o,i=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[i,o]=this.find(e);let l=e-o;const a=this.iterator(i);let h=a();for(;h&&l<e+t;){const g=h.length();e>l?r(h,e-l,Math.min(t,l+g-e)):r(h,0,Math.min(g,e+t-l)),l+=g,h=a()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let i=r();for(;i;)t=e(t,i),i=r();return t}}function Hx(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(Kn.INLINE);return Array.from(n.childNodes).forEach(i=>{r.domNode.appendChild(i)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const A4=class Kd extends E4{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Kd.uiClass&&this.uiNode.classList.add(Kd.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new WP,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Hx(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof p1)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,i,o)=>{r.deleteAt(i,o)})}descendant(e,t=0){const[r,i]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof Kd?r.descendant(e,i):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let i=[],o=r;return this.children.forEachAt(t,r,(l,a,h)=>{(e.blotName==null&&e(l)||e.blotName!=null&&l instanceof e)&&i.push(l),l instanceof Kd&&(i=i.concat(l.descendants(e,a,o))),o-=h}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===Kn.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof Kd?t.unwrap():t.remove())})}formatAt(e,t,r,i){this.children.forEachAt(e,t,(o,l,a)=>{o.formatAt(l,a,r,i)})}insertAt(e,t,r){const[i,o]=this.children.find(e);if(i)i.insertAt(o,t,r);else{const l=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(l)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,i]=this.children.find(e,t),o=[[this,e]];return r instanceof Kd?o.concat(r.path(i,t)):(r!=null&&o.push([r,i]),o)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof Kd&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,o,l)=>{const a=i.split(o,t);a!=null&&r.appendChild(a)}),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],i=[];e.forEach(o=>{o.target===this.domNode&&o.type==="childList"&&(r.push(...o.addedNodes),i.push(...o.removedNodes))}),i.forEach(o=>{if(o.parentNode!=null&&o.tagName!=="IFRAME"&&document.body.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const l=this.scroll.find(o);l!=null&&(l.domNode.parentNode==null||l.domNode.parentNode===this.domNode)&&l.detach()}),r.filter(o=>o.parentNode===this.domNode&&o!==this.uiNode).sort((o,l)=>o===l?0:o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(o=>{let l=null;o.nextSibling!=null&&(l=this.scroll.find(o.nextSibling));const a=Hx(o,this.scroll);(a.next!==l||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,l||void 0))}),this.enforceAllowedChildren()}};A4.uiClass="";let UP=A4;const Lh=UP;function GP(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const n1=class r1 extends Lh{static create(e){return super.create(e)}static formats(e,t){const r=t.query(r1.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kv(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof r1||(r=r.wrap(r1.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Kn.INLINE);if(r==null)return;r instanceof rd?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.formats()[r]!=null||this.scroll.query(r,Kn.ATTRIBUTE)?this.isolate(e,t).format(r,i):super.formatAt(e,t,r,i)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof r1&&r.prev===this&&GP(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof r1&&this.attributes.move(r),r}};n1.allowedChildren=[n1,lu],n1.blotName="inline",n1.scope=Kn.INLINE_BLOT,n1.tagName="SPAN";let YP=n1;const Pm=YP,i1=class Gy extends Lh{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Gy.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kv(this.domNode)}format(e,t){const r=this.scroll.query(e,Kn.BLOCK);r!=null&&(r instanceof rd?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Gy.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.scroll.query(r,Kn.BLOCK)!=null?this.format(r,i):super.formatAt(e,t,r,i)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Kn.INLINE)!=null)super.insertAt(e,t,r);else{const i=this.split(e);if(i!=null){const o=this.scroll.create(t,r);i.parent.insertBefore(o,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};i1.blotName="block",i1.scope=Kn.BLOCK_BLOT,i1.tagName="P",i1.allowedChildren=[Pm,i1,lu];let VP=i1;const Mp=VP,Yy=class extends Lh{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,i){super.formatAt(e,t,r,i),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Yy.blotName="container",Yy.scope=Kn.BLOCK_BLOT;let ZP=Yy;const Mv=ZP;class XP extends lu{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,i){e===0&&t===this.length()?this.format(r,i):super.formatAt(e,t,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const zf=XP,KP={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},JP=100,o1=class extends Lh{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,KP),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=Kn.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,i){this.update(),super.formatAt(e,t,r,i)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const o=(h,g=!0)=>{h==null||h===this||h.domNode.parentNode!=null&&(r.has(h.domNode)||r.set(h.domNode,[]),g&&o(h.parent))},l=h=>{r.has(h.domNode)&&(h instanceof Lh&&h.children.forEach(l),r.delete(h.domNode),h.optimize(t))};let a=e;for(let h=0;a.length>0;h+=1){if(h>=JP)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(g=>{const m=this.find(g.target,!0);m!=null&&(m.domNode===g.target&&(g.type==="childList"?(o(this.find(g.previousSibling,!1)),Array.from(g.addedNodes).forEach(x=>{const w=this.find(x,!1);o(w,!1),w instanceof Lh&&w.children.forEach(_=>{o(_,!1)})})):g.type==="attributes"&&o(m.prev)),o(m))}),this.children.forEach(l),a=Array.from(this.observer.takeRecords()),i=a.slice();i.length>0;)e.push(i.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const o=this.find(i.target,!0);return o==null?null:r.has(o.domNode)?(r.get(o.domNode).push(i),null):(r.set(o.domNode,[i]),o)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};o1.blotName="scroll",o1.defaultChild=Mp,o1.allowedChildren=[Mp,Mv],o1.scope=Kn.BLOCK_BLOT,o1.tagName="DIV";let QP=o1;const Dm=QP,Vy=class R4 extends lu{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof R4&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Vy.blotName="text",Vy.scope=Kn.INLINE_BLOT;let qP=Vy;const sv=qP,jP=Object.freeze(Object.defineProperty({__proto__:null,Attributor:rd,AttributorStore:kv,BlockBlot:Mp,ClassAttributor:Bh,ContainerBlot:Mv,EmbedBlot:zf,InlineBlot:Pm,LeafBlot:lu,ParentBlot:Lh,Registry:_1,Scope:Kn,ScrollBlot:Dm,StyleAttributor:hg,TextBlot:sv},Symbol.toStringTag,{value:"Module"}));class zh extends zf{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}zh.blotName="break";zh.tagName="BR";let Ph=class extends sv{};const $P={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Lv(n){return n.replace(/[&<>"']/g,e=>$P[e])}const Xh=class Xh extends Pm{static compare(e,t){const r=Xh.order.indexOf(e),i=Xh.order.indexOf(t);return r>=0||i>=0?r-i:e===t?0:e<t?-1:1}formatAt(e,t,r,i){if(Xh.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Kn.BLOT)){const o=this.isolate(e,t);i&&o.wrap(r,i)}else super.formatAt(e,t,r,i)}optimize(e){if(super.optimize(e),this.parent instanceof Xh&&Xh.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};Ee(Xh,"allowedChildren",[Xh,zh,zf,Ph]),Ee(Xh,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let id=Xh;const Wx=1;class kc extends Mp{constructor(){super(...arguments);Ee(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=I4(this)),this.cache.delta}deleteAt(t,r){super.deleteAt(t,r),this.cache={}}formatAt(t,r,i,o){r<=0||(this.scroll.query(i,Kn.BLOCK)?t+r===this.length()&&this.format(i,o):super.formatAt(t,Math.min(r,this.length()-t-1),i,o),this.cache={})}insertAt(t,r,i){if(i!=null){super.insertAt(t,r,i),this.cache={};return}if(r.length===0)return;const o=r.split(`
290
290
  `),l=o.shift();l.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),l):this.children.tail.insertAt(this.children.tail.length(),l),this.cache={});let a=this;o.reduce((h,g)=>(a=a.split(h,!0),a.insertAt(0,g),g.length),t+l.length)}insertBefore(t,r){const{head:i}=this.children;super.insertBefore(t,r),i instanceof zh&&i.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Wx),this.cache.length}moveChildren(t,r){super.moveChildren(t,r),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(t===0||t>=this.length()-Wx)){const o=this.clone();return t===0?(this.parent.insertBefore(o,this),this):(this.parent.insertBefore(o,this.next),o)}const i=super.split(t,r);return this.cache={},i}}kc.blotName="block";kc.tagName="P";kc.defaultChild=zh;kc.allowedChildren=[zh,id,zf,Ph];let gh=class extends zf{attach(){super.attach(),this.attributes=new kv(this.domNode)}delta(){return new Xn().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,Kn.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,i){this.format(r,i)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const i=t.split(`
291
291
  `),o=i.pop(),l=i.map(h=>{const g=this.scroll.create(kc.blotName);return g.insertAt(0,h),g}),a=this.split(e);l.forEach(h=>{this.parent.insertBefore(h,a)}),o&&this.parent.insertBefore(this.scroll.create("text",o),a)}};gh.scope=Kn.BLOCK_BLOT;function I4(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(lu).reduce((t,r)=>r.length()===0?t:t.insert(r.value(),hh(r,{},e)),new Xn).insert(`
292
- `,hh(n))}function hh(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:hh(n.parent,e,t)}const ch=class ch extends zf{static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(ch.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==Kn.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=ch.CONTENTS.length,r.optimize(),r.formatAt(i,ch.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Ph?this.prev:null,r=t?t.length():0,i=this.next instanceof Ph?this.next:null,o=i?i.text:"",{textNode:l}=this,a=l.data.split(ch.CONTENTS).join("");l.data=ch.CONTENTS;let h;if(t)h=t,(a||i)&&(t.insertAt(t.length(),a+o),i&&i.remove());else if(i)h=i,i.insertAt(0,a);else{const g=document.createTextNode(a);h=this.scroll.create(g),this.parent.insertBefore(h,this)}if(this.remove(),e){const g=(w,_)=>t&&w===t.domNode?_:w===l?r+_-1:i&&w===i.domNode?r+a.length+_:null,m=g(e.start.node,e.start.offset),x=g(e.end.node,e.end.offset);if(m!==null&&x!==null)return{startNode:h.domNode,startOffset:m,endNode:h.domNode,endOffset:x}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=ch.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};Ee(ch,"blotName","cursor"),Ee(ch,"className","ql-cursor"),Ee(ch,"tagName","span"),Ee(ch,"CONTENTS","\uFEFF");let S1=ch;var xb={exports:{}},Ux;function $P(){return Ux||(Ux=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(h,g,m){this.fn=h,this.context=g,this.once=m||!1}function o(h,g,m,x,w){if(typeof m!="function")throw new TypeError("The listener must be a function");var _=new i(m,x||h,w),S=t?t+g:g;return h._events[S]?h._events[S].fn?h._events[S]=[h._events[S],_]:h._events[S].push(_):(h._events[S]=_,h._eventsCount++),h}function l(h,g){--h._eventsCount===0?h._events=new r:delete h._events[g]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var g=[],m,x;if(this._eventsCount===0)return g;for(x in m=this._events)e.call(m,x)&&g.push(t?x.slice(1):x);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(m)):g},a.prototype.listeners=function(g){var m=t?t+g:g,x=this._events[m];if(!x)return[];if(x.fn)return[x.fn];for(var w=0,_=x.length,S=new Array(_);w<_;w++)S[w]=x[w].fn;return S},a.prototype.listenerCount=function(g){var m=t?t+g:g,x=this._events[m];return x?x.fn?1:x.length:0},a.prototype.emit=function(g,m,x,w,_,S){var R=t?t+g:g;if(!this._events[R])return!1;var k=this._events[R],O=arguments.length,P,z;if(k.fn){switch(k.once&&this.removeListener(g,k.fn,void 0,!0),O){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,m),!0;case 3:return k.fn.call(k.context,m,x),!0;case 4:return k.fn.call(k.context,m,x,w),!0;case 5:return k.fn.call(k.context,m,x,w,_),!0;case 6:return k.fn.call(k.context,m,x,w,_,S),!0}for(z=1,P=new Array(O-1);z<O;z++)P[z-1]=arguments[z];k.fn.apply(k.context,P)}else{var H=k.length,G;for(z=0;z<H;z++)switch(k[z].once&&this.removeListener(g,k[z].fn,void 0,!0),O){case 1:k[z].fn.call(k[z].context);break;case 2:k[z].fn.call(k[z].context,m);break;case 3:k[z].fn.call(k[z].context,m,x);break;case 4:k[z].fn.call(k[z].context,m,x,w);break;default:if(!P)for(G=1,P=new Array(O-1);G<O;G++)P[G-1]=arguments[G];k[z].fn.apply(k[z].context,P)}}return!0},a.prototype.on=function(g,m,x){return o(this,g,m,x,!1)},a.prototype.once=function(g,m,x){return o(this,g,m,x,!0)},a.prototype.removeListener=function(g,m,x,w){var _=t?t+g:g;if(!this._events[_])return this;if(!m)return l(this,_),this;var S=this._events[_];if(S.fn)S.fn===m&&(!w||S.once)&&(!x||S.context===x)&&l(this,_);else{for(var R=0,k=[],O=S.length;R<O;R++)(S[R].fn!==m||w&&!S[R].once||x&&S[R].context!==x)&&k.push(S[R]);k.length?this._events[_]=k.length===1?k[0]:k:l(this,_)}return this},a.prototype.removeAllListeners=function(g){var m;return g?(m=t?t+g:g,this._events[m]&&l(this,m)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a})(xb)),xb.exports}var eD=$P();const tD=L1(eD),Zy=new WeakMap,Xy=["error","warn","log","info"];let Ky="warn";function k4(n){if(Ky&&Xy.indexOf(n)<=Xy.indexOf(Ky)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function Md(n){return Xy.reduce((e,t)=>(e[t]=k4.bind(console,t,n),e),{})}Md.level=n=>{Ky=n};k4.level=Md.level;const wb=Md("quill:events"),nD=["selectionchange","mousedown","mouseup","click"];nD.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(i=>{const o=Zy.get(i);o&&o.emitter&&o.emitter.handleDOM(...t)})})});class Hn extends tD{constructor(){super(),this.domListeners={},this.on("error",wb.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return wb.log.call(wb,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];(this.domListeners[e.type]||[]).forEach(o=>{let{node:l,handler:a}=o;(e.target===l||l.contains(e.target))&&a(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}Ee(Hn,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),Ee(Hn,"sources",{API:"api",SILENT:"silent",USER:"user"});const Cb=Md("quill:selection");class Ng{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class rD{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Ng(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Hn.sources.USER),1)}),this.emitter.on(Hn.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Hn.events.SCROLL_UPDATE,(i,o)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const l=o.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(l?Hn.sources.SILENT:i)}catch{}})}),this.emitter.on(Hn.events.SCROLL_OPTIMIZE,(r,i)=>{if(i.range){const{startNode:o,startOffset:l,endNode:a,endOffset:h}=i.range;this.setNativeRange(o,l,a,h),this.update(Hn.sources.SILENT)}}),this.update(Hn.sources.SILENT)}handleComposition(){this.emitter.on(Hn.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Hn.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Hn.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Kn.BLOCK))){if(r.start.node!==this.cursor.textNode){const i=this.scroll.find(r.start.node,!1);if(i==null)return;if(i instanceof lu){const o=i.split(r.start.offset);i.parent.insertBefore(this.cursor,o)}else i.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let i,[o,l]=this.scroll.leaf(e);if(o==null)return null;if(t>0&&l===o.length()){const[m]=this.scroll.leaf(e+1);if(m){const[x]=this.scroll.line(e),[w]=this.scroll.line(e+1);x===w&&(o=m,l=0)}}[i,l]=o.position(l,!0);const a=document.createRange();if(t>0)return a.setStart(i,l),[o,l]=this.scroll.leaf(e+t),o==null?null:([i,l]=o.position(l,!0),a.setEnd(i,l),a.getBoundingClientRect());let h="left",g;if(i instanceof Text){if(!i.data.length)return null;l<i.data.length?(a.setStart(i,l),a.setEnd(i,l+1)):(a.setStart(i,l-1),a.setEnd(i,l),h="right"),g=a.getBoundingClientRect()}else{if(!(o.domNode instanceof Element))return null;g=o.domNode.getBoundingClientRect(),l>0&&(h="right")}return{bottom:g.top+g.height,height:g.height,left:g[h],right:g[h],top:g.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return Cb.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&_b(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map(l=>{const[a,h]=l,g=this.scroll.find(a,!0),m=g.offset(this.scroll);return h===0?m:g instanceof lu?m+g.index(a,h):m+g.length()}),i=Math.min(Math.max(...r),this.scroll.length()-1),o=Math.min(i,...r);return new Ng(o,i-o)}normalizeNative(e){if(!_b(this.root,e.startContainer)||!e.collapsed&&!_b(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(r=>{let{node:i,offset:o}=r;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>o)i=i.childNodes[o],o=0;else if(i.childNodes.length===o)i=i.lastChild,i instanceof Text?o=i.data.length:i.childNodes.length>0?o=i.childNodes.length:o=i.childNodes.length+1;else break;r.node=i,r.offset=o}),t}rangeToNative(e){const t=this.scroll.length(),r=(i,o)=>{i=Math.min(t-1,i);const[l,a]=this.scroll.leaf(i);return l?l.position(a,o):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Cb.info("setNativeRange",e,t,r,i),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const l=document.getSelection();if(l!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||o||e!==a.startContainer||t!==a.startOffset||r!==a.endContainer||i!==a.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(i=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const h=document.createRange();h.setStart(e,t),h.setEnd(r,i),l.removeAllRanges(),l.addRange(h)}}else l.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hn.sources.API;if(typeof t=="string"&&(r=t,t=!1),Cb.info("setRange",e),e!=null){const i=this.rangeToNative(e);this.setNativeRange(...i,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hn.sources.USER;const t=this.lastRange,[r,i]=this.getRange();if(this.lastRange=r,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!$d(t,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const o=[Hn.events.SELECTION_CHANGE,g1(this.lastRange),g1(t),e];this.emitter.emit(Hn.events.EDITOR_CHANGE,...o),e!==Hn.sources.SILENT&&this.emitter.emit(...o)}}}function _b(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const iD=/^[ -~]*$/;class oD{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=Gx(e),i=new Xn;return sD(r.ops.slice()).reduce((l,a)=>{const h=ph.Op.length(a);let g=a.attributes||{},m=!1,x=!1;if(a.insert!=null){if(i.retain(h),typeof a.insert=="string"){const S=a.insert;x=!S.endsWith(`
292
+ `,hh(n))}function hh(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:hh(n.parent,e,t)}const ch=class ch extends zf{static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(ch.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==Kn.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=ch.CONTENTS.length,r.optimize(),r.formatAt(i,ch.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Ph?this.prev:null,r=t?t.length():0,i=this.next instanceof Ph?this.next:null,o=i?i.text:"",{textNode:l}=this,a=l.data.split(ch.CONTENTS).join("");l.data=ch.CONTENTS;let h;if(t)h=t,(a||i)&&(t.insertAt(t.length(),a+o),i&&i.remove());else if(i)h=i,i.insertAt(0,a);else{const g=document.createTextNode(a);h=this.scroll.create(g),this.parent.insertBefore(h,this)}if(this.remove(),e){const g=(w,_)=>t&&w===t.domNode?_:w===l?r+_-1:i&&w===i.domNode?r+a.length+_:null,m=g(e.start.node,e.start.offset),x=g(e.end.node,e.end.offset);if(m!==null&&x!==null)return{startNode:h.domNode,startOffset:m,endNode:h.domNode,endOffset:x}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=ch.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};Ee(ch,"blotName","cursor"),Ee(ch,"className","ql-cursor"),Ee(ch,"tagName","span"),Ee(ch,"CONTENTS","\uFEFF");let S1=ch;var xb={exports:{}},Ux;function eD(){return Ux||(Ux=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(h,g,m){this.fn=h,this.context=g,this.once=m||!1}function o(h,g,m,x,w){if(typeof m!="function")throw new TypeError("The listener must be a function");var _=new i(m,x||h,w),S=t?t+g:g;return h._events[S]?h._events[S].fn?h._events[S]=[h._events[S],_]:h._events[S].push(_):(h._events[S]=_,h._eventsCount++),h}function l(h,g){--h._eventsCount===0?h._events=new r:delete h._events[g]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var g=[],m,x;if(this._eventsCount===0)return g;for(x in m=this._events)e.call(m,x)&&g.push(t?x.slice(1):x);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(m)):g},a.prototype.listeners=function(g){var m=t?t+g:g,x=this._events[m];if(!x)return[];if(x.fn)return[x.fn];for(var w=0,_=x.length,S=new Array(_);w<_;w++)S[w]=x[w].fn;return S},a.prototype.listenerCount=function(g){var m=t?t+g:g,x=this._events[m];return x?x.fn?1:x.length:0},a.prototype.emit=function(g,m,x,w,_,S){var R=t?t+g:g;if(!this._events[R])return!1;var k=this._events[R],O=arguments.length,P,z;if(k.fn){switch(k.once&&this.removeListener(g,k.fn,void 0,!0),O){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,m),!0;case 3:return k.fn.call(k.context,m,x),!0;case 4:return k.fn.call(k.context,m,x,w),!0;case 5:return k.fn.call(k.context,m,x,w,_),!0;case 6:return k.fn.call(k.context,m,x,w,_,S),!0}for(z=1,P=new Array(O-1);z<O;z++)P[z-1]=arguments[z];k.fn.apply(k.context,P)}else{var H=k.length,G;for(z=0;z<H;z++)switch(k[z].once&&this.removeListener(g,k[z].fn,void 0,!0),O){case 1:k[z].fn.call(k[z].context);break;case 2:k[z].fn.call(k[z].context,m);break;case 3:k[z].fn.call(k[z].context,m,x);break;case 4:k[z].fn.call(k[z].context,m,x,w);break;default:if(!P)for(G=1,P=new Array(O-1);G<O;G++)P[G-1]=arguments[G];k[z].fn.apply(k[z].context,P)}}return!0},a.prototype.on=function(g,m,x){return o(this,g,m,x,!1)},a.prototype.once=function(g,m,x){return o(this,g,m,x,!0)},a.prototype.removeListener=function(g,m,x,w){var _=t?t+g:g;if(!this._events[_])return this;if(!m)return l(this,_),this;var S=this._events[_];if(S.fn)S.fn===m&&(!w||S.once)&&(!x||S.context===x)&&l(this,_);else{for(var R=0,k=[],O=S.length;R<O;R++)(S[R].fn!==m||w&&!S[R].once||x&&S[R].context!==x)&&k.push(S[R]);k.length?this._events[_]=k.length===1?k[0]:k:l(this,_)}return this},a.prototype.removeAllListeners=function(g){var m;return g?(m=t?t+g:g,this._events[m]&&l(this,m)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a})(xb)),xb.exports}var tD=eD();const nD=L1(tD),Zy=new WeakMap,Xy=["error","warn","log","info"];let Ky="warn";function k4(n){if(Ky&&Xy.indexOf(n)<=Xy.indexOf(Ky)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function Md(n){return Xy.reduce((e,t)=>(e[t]=k4.bind(console,t,n),e),{})}Md.level=n=>{Ky=n};k4.level=Md.level;const wb=Md("quill:events"),rD=["selectionchange","mousedown","mouseup","click"];rD.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(i=>{const o=Zy.get(i);o&&o.emitter&&o.emitter.handleDOM(...t)})})});class Hn extends nD{constructor(){super(),this.domListeners={},this.on("error",wb.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return wb.log.call(wb,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];(this.domListeners[e.type]||[]).forEach(o=>{let{node:l,handler:a}=o;(e.target===l||l.contains(e.target))&&a(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}Ee(Hn,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),Ee(Hn,"sources",{API:"api",SILENT:"silent",USER:"user"});const Cb=Md("quill:selection");class Ng{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class iD{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Ng(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Hn.sources.USER),1)}),this.emitter.on(Hn.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Hn.events.SCROLL_UPDATE,(i,o)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const l=o.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(l?Hn.sources.SILENT:i)}catch{}})}),this.emitter.on(Hn.events.SCROLL_OPTIMIZE,(r,i)=>{if(i.range){const{startNode:o,startOffset:l,endNode:a,endOffset:h}=i.range;this.setNativeRange(o,l,a,h),this.update(Hn.sources.SILENT)}}),this.update(Hn.sources.SILENT)}handleComposition(){this.emitter.on(Hn.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Hn.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Hn.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Kn.BLOCK))){if(r.start.node!==this.cursor.textNode){const i=this.scroll.find(r.start.node,!1);if(i==null)return;if(i instanceof lu){const o=i.split(r.start.offset);i.parent.insertBefore(this.cursor,o)}else i.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let i,[o,l]=this.scroll.leaf(e);if(o==null)return null;if(t>0&&l===o.length()){const[m]=this.scroll.leaf(e+1);if(m){const[x]=this.scroll.line(e),[w]=this.scroll.line(e+1);x===w&&(o=m,l=0)}}[i,l]=o.position(l,!0);const a=document.createRange();if(t>0)return a.setStart(i,l),[o,l]=this.scroll.leaf(e+t),o==null?null:([i,l]=o.position(l,!0),a.setEnd(i,l),a.getBoundingClientRect());let h="left",g;if(i instanceof Text){if(!i.data.length)return null;l<i.data.length?(a.setStart(i,l),a.setEnd(i,l+1)):(a.setStart(i,l-1),a.setEnd(i,l),h="right"),g=a.getBoundingClientRect()}else{if(!(o.domNode instanceof Element))return null;g=o.domNode.getBoundingClientRect(),l>0&&(h="right")}return{bottom:g.top+g.height,height:g.height,left:g[h],right:g[h],top:g.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return Cb.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&_b(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map(l=>{const[a,h]=l,g=this.scroll.find(a,!0),m=g.offset(this.scroll);return h===0?m:g instanceof lu?m+g.index(a,h):m+g.length()}),i=Math.min(Math.max(...r),this.scroll.length()-1),o=Math.min(i,...r);return new Ng(o,i-o)}normalizeNative(e){if(!_b(this.root,e.startContainer)||!e.collapsed&&!_b(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(r=>{let{node:i,offset:o}=r;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>o)i=i.childNodes[o],o=0;else if(i.childNodes.length===o)i=i.lastChild,i instanceof Text?o=i.data.length:i.childNodes.length>0?o=i.childNodes.length:o=i.childNodes.length+1;else break;r.node=i,r.offset=o}),t}rangeToNative(e){const t=this.scroll.length(),r=(i,o)=>{i=Math.min(t-1,i);const[l,a]=this.scroll.leaf(i);return l?l.position(a,o):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Cb.info("setNativeRange",e,t,r,i),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const l=document.getSelection();if(l!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||o||e!==a.startContainer||t!==a.startOffset||r!==a.endContainer||i!==a.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(i=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const h=document.createRange();h.setStart(e,t),h.setEnd(r,i),l.removeAllRanges(),l.addRange(h)}}else l.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hn.sources.API;if(typeof t=="string"&&(r=t,t=!1),Cb.info("setRange",e),e!=null){const i=this.rangeToNative(e);this.setNativeRange(...i,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hn.sources.USER;const t=this.lastRange,[r,i]=this.getRange();if(this.lastRange=r,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!$d(t,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const o=[Hn.events.SELECTION_CHANGE,g1(this.lastRange),g1(t),e];this.emitter.emit(Hn.events.EDITOR_CHANGE,...o),e!==Hn.sources.SILENT&&this.emitter.emit(...o)}}}function _b(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const oD=/^[ -~]*$/;class lD{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=Gx(e),i=new Xn;return aD(r.ops.slice()).reduce((l,a)=>{const h=ph.Op.length(a);let g=a.attributes||{},m=!1,x=!1;if(a.insert!=null){if(i.retain(h),typeof a.insert=="string"){const S=a.insert;x=!S.endsWith(`
293
293
  `)&&(t<=l||!!this.scroll.descendant(gh,l)[0]),this.scroll.insertAt(l,S);const[R,k]=this.scroll.line(l);let O=og({},hh(R));if(R instanceof kc){const[P]=R.descendant(lu,k);P&&(O=og(O,hh(P)))}g=ph.AttributeMap.diff(O,g)||{}}else if(typeof a.insert=="object"){const S=Object.keys(a.insert)[0];if(S==null)return l;const R=this.scroll.query(S,Kn.INLINE)!=null;if(R)(t<=l||this.scroll.descendant(gh,l)[0])&&(x=!0);else if(l>0){const[k,O]=this.scroll.descendant(lu,l-1);k instanceof Ph?k.value()[O]!==`
294
- `&&(m=!0):k instanceof zf&&k.statics.scope===Kn.INLINE_BLOT&&(m=!0)}if(this.scroll.insertAt(l,S,a.insert[S]),R){const[k]=this.scroll.descendant(lu,l);if(k){const O=og({},hh(k));g=ph.AttributeMap.diff(O,g)||{}}}}t+=h}else if(i.push(a),a.retain!==null&&typeof a.retain=="object"){const S=Object.keys(a.retain)[0];if(S==null)return l;this.scroll.updateEmbedAt(l,S,a.retain[S])}Object.keys(g).forEach(S=>{this.scroll.formatAt(l,h,S,g[S])});const w=m?1:0,_=x?1:0;return t+=w+_,i.retain(w),i.delete(_),l+h+w+_},0),i.reduce((l,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(l,a.delete),l):l+ph.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new Xn().retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(o=>{this.scroll.lines(e,Math.max(t,1)).forEach(l=>{l.format(o,r[o])})}),this.scroll.optimize();const i=new Xn().retain(e).retain(t,g1(r));return this.update(i)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(o=>{this.scroll.formatAt(e,t,o,r[o])});const i=new Xn().retain(e).retain(t,g1(r));return this.update(i)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new Xn)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],i=[];t===0?this.scroll.path(e).forEach(a=>{const[h]=a;h instanceof kc?r.push(h):h instanceof lu&&i.push(h)}):(r=this.scroll.lines(e,t),i=this.scroll.descendants(lu,e,t));const[o,l]=[r,i].map(a=>{const h=a.shift();if(h==null)return{};let g=hh(h);for(;Object.keys(g).length>0;){const m=a.shift();if(m==null)return g;g=lD(hh(m),g)}return g});return{...o,...l}}getHTML(e,t){const[r,i]=this.scroll.line(e);if(r){const o=r.length();return r.length()>=i+t&&!(i===0&&t===o)?Lp(r,i,t,!0):Lp(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,t){const r=Gx(t),i=new Xn().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(i)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update(new Xn().retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
294
+ `&&(m=!0):k instanceof zf&&k.statics.scope===Kn.INLINE_BLOT&&(m=!0)}if(this.scroll.insertAt(l,S,a.insert[S]),R){const[k]=this.scroll.descendant(lu,l);if(k){const O=og({},hh(k));g=ph.AttributeMap.diff(O,g)||{}}}}t+=h}else if(i.push(a),a.retain!==null&&typeof a.retain=="object"){const S=Object.keys(a.retain)[0];if(S==null)return l;this.scroll.updateEmbedAt(l,S,a.retain[S])}Object.keys(g).forEach(S=>{this.scroll.formatAt(l,h,S,g[S])});const w=m?1:0,_=x?1:0;return t+=w+_,i.retain(w),i.delete(_),l+h+w+_},0),i.reduce((l,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(l,a.delete),l):l+ph.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new Xn().retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(o=>{this.scroll.lines(e,Math.max(t,1)).forEach(l=>{l.format(o,r[o])})}),this.scroll.optimize();const i=new Xn().retain(e).retain(t,g1(r));return this.update(i)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(o=>{this.scroll.formatAt(e,t,o,r[o])});const i=new Xn().retain(e).retain(t,g1(r));return this.update(i)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new Xn)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],i=[];t===0?this.scroll.path(e).forEach(a=>{const[h]=a;h instanceof kc?r.push(h):h instanceof lu&&i.push(h)}):(r=this.scroll.lines(e,t),i=this.scroll.descendants(lu,e,t));const[o,l]=[r,i].map(a=>{const h=a.shift();if(h==null)return{};let g=hh(h);for(;Object.keys(g).length>0;){const m=a.shift();if(m==null)return g;g=sD(hh(m),g)}return g});return{...o,...l}}getHTML(e,t){const[r,i]=this.scroll.line(e);if(r){const o=r.length();return r.length()>=i+t&&!(i===0&&t===o)?Lp(r,i,t,!0):Lp(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,t){const r=Gx(t),i=new Xn().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(i)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update(new Xn().retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
295
295
  `).replace(/\r/g,`
296
296
  `),this.scroll.insertAt(e,t),Object.keys(r).forEach(i=>{this.scroll.formatAt(e,t.length,i,r[i])}),this.update(new Xn().retain(e).insert(t,g1(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==kc.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof zh}removeFormat(e,t){const r=this.getText(e,t),[i,o]=this.scroll.line(e+t);let l=0,a=new Xn;i!=null&&(l=i.length()-o,a=i.delta().slice(o,o+l-1).insert(`
297
- `));const g=this.getContents(e,t+l).diff(new Xn().insert(r).concat(a)),m=new Xn().retain(e).concat(g);return this.applyDelta(m)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const i=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(iD)&&this.scroll.find(t[0].target)){const o=this.scroll.find(t[0].target),l=hh(o),a=o.offset(this.scroll),h=t[0].oldValue.replace(S1.CONTENTS,""),g=new Xn().insert(h),m=new Xn().insert(o.value()),x=r&&{oldRange:Yx(r.oldRange,-a),newRange:Yx(r.newRange,-a)};e=new Xn().retain(a).concat(g.diff(m,x)).reduce((_,S)=>S.insert?_.insert(S.insert,l):_.push(S),new Xn),this.delta=i.compose(e)}else this.delta=this.getDelta(),(!e||!$d(i.compose(e),this.delta))&&(e=i.diff(this.delta,r));return e}}function l1(n,e,t){if(n.length===0){const[_]=Sb(t.pop());return e<=0?`</li></${_}>`:`</li></${_}>${l1([],e-1,t)}`}const[{child:r,offset:i,length:o,indent:l,type:a},...h]=n,[g,m]=Sb(a);if(l>e)return t.push(a),l===e+1?`<${g}><li${m}>${Lp(r,i,o)}${l1(h,l,t)}`:`<${g}><li>${l1(n,e+1,t)}`;const x=t[t.length-1];if(l===e&&a===x)return`</li><li${m}>${Lp(r,i,o)}${l1(h,l,t)}`;const[w]=Sb(t.pop());return`</li></${w}>${l1(n,e-1,t)}`}function Lp(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof Ph)return Lv(n.value().slice(e,e+t)).replaceAll(" ","&nbsp;");if(n instanceof Lh){if(n.statics.blotName==="list-container"){const g=[];return n.children.forEachAt(e,t,(m,x,w)=>{const _="formats"in m&&typeof m.formats=="function"?m.formats():{};g.push({child:m,offset:x,length:w,indent:_.indent||0,type:_.list})}),l1(g,-1,[])}const i=[];if(n.children.forEachAt(e,t,(g,m,x)=>{i.push(Lp(g,m,x))}),r||n.statics.blotName==="list")return i.join("");const{outerHTML:o,innerHTML:l}=n.domNode,[a,h]=o.split(`>${l}<`);return a==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${h}`:`${a}>${i.join("")}<${h}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function lD(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const i=e[r];return i===n[r]?t[r]=i:Array.isArray(i)?i.indexOf(n[r])<0?t[r]=i.concat([n[r]]):t[r]=i:t[r]=[i,n[r]],t},{})}function Sb(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Gx(n){return n.reduce((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`
297
+ `));const g=this.getContents(e,t+l).diff(new Xn().insert(r).concat(a)),m=new Xn().retain(e).concat(g);return this.applyDelta(m)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const i=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(oD)&&this.scroll.find(t[0].target)){const o=this.scroll.find(t[0].target),l=hh(o),a=o.offset(this.scroll),h=t[0].oldValue.replace(S1.CONTENTS,""),g=new Xn().insert(h),m=new Xn().insert(o.value()),x=r&&{oldRange:Yx(r.oldRange,-a),newRange:Yx(r.newRange,-a)};e=new Xn().retain(a).concat(g.diff(m,x)).reduce((_,S)=>S.insert?_.insert(S.insert,l):_.push(S),new Xn),this.delta=i.compose(e)}else this.delta=this.getDelta(),(!e||!$d(i.compose(e),this.delta))&&(e=i.diff(this.delta,r));return e}}function l1(n,e,t){if(n.length===0){const[_]=Sb(t.pop());return e<=0?`</li></${_}>`:`</li></${_}>${l1([],e-1,t)}`}const[{child:r,offset:i,length:o,indent:l,type:a},...h]=n,[g,m]=Sb(a);if(l>e)return t.push(a),l===e+1?`<${g}><li${m}>${Lp(r,i,o)}${l1(h,l,t)}`:`<${g}><li>${l1(n,e+1,t)}`;const x=t[t.length-1];if(l===e&&a===x)return`</li><li${m}>${Lp(r,i,o)}${l1(h,l,t)}`;const[w]=Sb(t.pop());return`</li></${w}>${l1(n,e-1,t)}`}function Lp(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof Ph)return Lv(n.value().slice(e,e+t)).replaceAll(" ","&nbsp;");if(n instanceof Lh){if(n.statics.blotName==="list-container"){const g=[];return n.children.forEachAt(e,t,(m,x,w)=>{const _="formats"in m&&typeof m.formats=="function"?m.formats():{};g.push({child:m,offset:x,length:w,indent:_.indent||0,type:_.list})}),l1(g,-1,[])}const i=[];if(n.children.forEachAt(e,t,(g,m,x)=>{i.push(Lp(g,m,x))}),r||n.statics.blotName==="list")return i.join("");const{outerHTML:o,innerHTML:l}=n.domNode,[a,h]=o.split(`>${l}<`);return a==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${h}`:`${a}>${i.join("")}<${h}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function sD(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const i=e[r];return i===n[r]?t[r]=i:Array.isArray(i)?i.indexOf(n[r])<0?t[r]=i.concat([n[r]]):t[r]=i:t[r]=[i,n[r]],t},{})}function Sb(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Gx(n){return n.reduce((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`
298
298
  `).replace(/\r/g,`
299
- `);return e.insert(r,t.attributes)}return e.push(t)},new Xn)}function Yx(n,e){let{index:t,length:r}=n;return new Ng(t+e,r)}function sD(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
299
+ `);return e.insert(r,t.attributes)}return e.push(t)},new Xn)}function Yx(n,e){let{index:t,length:r}=n;return new Ng(t+e,r)}function aD(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
300
300
  `).forEach((i,o)=>{o&&e.push({insert:`
301
- `,attributes:t.attributes}),i&&e.push({insert:i,attributes:t.attributes})}):e.push(t)}),e}class Hh{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}Ee(Hh,"DEFAULTS",{});const S0="\uFEFF";class Nm extends zf{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(S0),this.rightGuard=document.createTextNode(S0),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,r;const i=e.data.split(S0).join("");if(e===this.leftGuard)if(this.prev instanceof Ph){const o=this.prev.length();this.prev.insertAt(o,i),t={startNode:this.prev.domNode,startOffset:o+i.length}}else r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:i.length};else e===this.rightGuard&&(this.next instanceof Ph?(this.next.insertAt(0,i),t={startNode:this.next.domNode,startOffset:i.length}):(r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:i.length}));return e.data=S0,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const i=this.restore(r.target);i&&(t.range=i)}})}}class aD{constructor(e,t){Ee(this,"isComposing",!1);this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof Nm)&&(this.emitter.emit(Hn.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Hn.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Hn.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Hn.events.COMPOSITION_END,e),this.isComposing=!1}}const _p=class _p{constructor(e,t){Ee(this,"modules",{});this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}};Ee(_p,"DEFAULTS",{modules:{}}),Ee(_p,"themes",{default:_p});let E1=_p;const cD=n=>n.parentElement||n.getRootNode().host||null,uD=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},E0=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},Vx=(n,e,t,r,i,o)=>n<t&&e>r?0:n<t?-(t-n+i):e>r?e-n>r-t?n+i-t:e-r+o:0,fD=(n,e)=>{var o,l,a;const t=n.ownerDocument;let r=e,i=n;for(;i;){const h=i===t.body,g=h?{top:0,right:((o=window.visualViewport)==null?void 0:o.width)??t.documentElement.clientWidth,bottom:((l=window.visualViewport)==null?void 0:l.height)??t.documentElement.clientHeight,left:0}:uD(i),m=getComputedStyle(i),x=Vx(r.left,r.right,g.left,g.right,E0(m.scrollPaddingLeft),E0(m.scrollPaddingRight)),w=Vx(r.top,r.bottom,g.top,g.bottom,E0(m.scrollPaddingTop),E0(m.scrollPaddingBottom));if(x||w)if(h)(a=t.defaultView)==null||a.scrollBy(x,w);else{const{scrollLeft:_,scrollTop:S}=i;w&&(i.scrollTop+=w),x&&(i.scrollLeft+=x);const R=i.scrollLeft-_,k=i.scrollTop-S;r={left:r.left-R,top:r.top-k,right:r.right-R,bottom:r.bottom-k}}i=h||m.position==="fixed"?null:cD(i)}},hD=100,dD=["block","break","cursor","inline","scroll","text"],gD=(n,e,t)=>{const r=new _1;return dD.forEach(i=>{const o=e.query(i);o&&r.register(o)}),n.forEach(i=>{let o=e.query(i);o||t.error(`Cannot register "${i}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;o;)if(r.register(o),o="blotName"in o?o.requiredContainer??null:null,l+=1,l>hD){t.error(`Cycle detected in registering blot requiredContainer: "${i}"`);break}}),r},v1=Md("quill"),T0=new _1;Lh.uiClass="ql-ui";const Rh=class Rh{static debug(e){e===!0&&(e="log"),Md.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Zy.get(e)||T0.find(e,t)}static import(e){return this.imports[e]==null&&v1.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach(i=>{this.register(i,e[i],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&v1.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&T0.register(t),typeof t.register=="function"&&t.register(T0)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=pD(e,t),this.container=this.options.container,this.container==null){v1.error("Invalid Quill container",e);return}this.options.debug&&Rh.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Zy.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Hn;const i=Dm.blotName,o=this.options.registry.query(i);if(!o||!("blotName"in o))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new o(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new oD(this.scroll),this.selection=new rD(this.scroll,this.emitter),this.composition=new aD(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Hn.events.EDITOR_CHANGE,l=>{l===Hn.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Hn.events.SCROLL_UPDATE,(l,a)=>{const h=this.selection.lastRange,[g]=this.selection.getRange(),m=h&&g?{oldRange:h,newRange:g}:void 0;Eh.call(this,()=>this.editor.update(null,a,m),l)}),this.emitter.on(Hn.events.SCROLL_EMBED_UPDATE,(l,a)=>{const h=this.selection.lastRange,[g]=this.selection.getRange(),m=h&&g?{oldRange:h,newRange:g}:void 0;Eh.call(this,()=>{const x=new Xn().retain(l.offset(this)).retain({[l.statics.blotName]:a});return this.editor.update(x,[],m)},Rh.sources.USER)}),r){const l=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
302
- `});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=wd(e,t,r),Eh.call(this,()=>this.editor.deleteText(e,t),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hn.sources.API;return Eh.call(this,()=>{const i=this.getSelection(!0);let o=new Xn;if(i==null)return o;if(this.scroll.query(e,Kn.BLOCK))o=this.editor.formatLine(i.index,i.length,{[e]:t});else{if(i.length===0)return this.selection.format(e,t),o;o=this.editor.formatText(i.index,i.length,{[e]:t})}return this.setSelection(i,Hn.sources.SILENT),o},r)}formatLine(e,t,r,i,o){let l;return[e,t,l,o]=wd(e,t,r,i,o),Eh.call(this,()=>this.editor.formatLine(e,t,l),o,e,0)}formatText(e,t,r,i,o){let l;return[e,t,l,o]=wd(e,t,r,i,o),Eh.call(this,()=>this.editor.formatText(e,t,l),o,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const i=this.container.getBoundingClientRect();return{bottom:r.bottom-i.top,height:r.height,left:r.left-i.left,right:r.right-i.left,top:r.top-i.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=wd(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=wd(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=wd(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Rh.sources.API;return Eh.call(this,()=>this.editor.insertEmbed(e,t,r),i,e)}insertText(e,t,r,i,o){let l;return[e,,l,o]=wd(e,0,r,i,o),Eh.call(this,()=>this.editor.insertText(e,t,l),o,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,r){return[e,t,,r]=wd(e,t,r),Eh.call(this,()=>this.editor.removeFormat(e,t),r,e)}scrollRectIntoView(e){fD(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.sources.API;return Eh.call(this,()=>{e=new Xn(e);const r=this.getLength(),i=this.editor.deleteText(0,r),o=this.editor.insertContents(0,e),l=this.editor.deleteText(this.getLength()-1,1);return i.compose(o).compose(l)},t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||Rh.sources.API):([e,t,,r]=wd(e,t,r),this.selection.setRange(new Ng(Math.max(0,e),t),r),r!==Hn.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.sources.API;const r=new Xn().insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hn.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.sources.API;return Eh.call(this,()=>(e=new Xn(e),this.editor.applyDelta(e)),t,!0)}};Ee(Rh,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:T0,theme:"default"}),Ee(Rh,"events",Hn.events),Ee(Rh,"sources",Hn.sources),Ee(Rh,"version","2.0.3"),Ee(Rh,"imports",{delta:Xn,parchment:qP,"core/module":Hh,"core/theme":E1});let Xe=Rh;function Zx(n){return typeof n=="string"?document.querySelector(n):n}function Eb(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,i]=t;return{...e,[r]:i===!0?{}:i}},{})}function Xx(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function pD(n,e){const t=Zx(n);if(!t)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===Xe.DEFAULTS.theme?E1:Xe.import(`themes/${e.theme}`);if(!i)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:o,...l}=Xe.DEFAULTS,{modules:a,...h}=i.DEFAULTS;let g=Eb(e.modules);g!=null&&g.toolbar&&g.toolbar.constructor!==Object&&(g={...g,toolbar:{container:g.toolbar}});const m=og({},Eb(o),Eb(a),g),x={...l,...Xx(h),...Xx(e)};let w=e.registry;return w?e.formats&&v1.warn('Ignoring "formats" option because "registry" is specified'):w=e.formats?gD(e.formats,x.registry,v1):x.registry,{...x,registry:w,container:t,theme:i,modules:Object.entries(m).reduce((_,S)=>{let[R,k]=S;if(!k)return _;const O=Xe.import(`modules/${R}`);return O==null?(v1.error(`Cannot load ${R} module. Are you sure you registered it?`),_):{..._,[R]:og({},O.DEFAULTS||{},k)}},{}),bounds:Zx(x.bounds)}}function Eh(n,e,t,r){if(!this.isEnabled()&&e===Hn.sources.USER&&!this.allowReadOnlyEdits)return new Xn;let i=t==null?null:this.getSelection();const o=this.editor.delta,l=n();if(i!=null&&(t===!0&&(t=i.index),r==null?i=Kx(i,l,e):r!==0&&(i=Kx(i,t,r,e)),this.setSelection(i,Hn.sources.SILENT)),l.length()>0){const a=[Hn.events.TEXT_CHANGE,l,o,e];this.emitter.emit(Hn.events.EDITOR_CHANGE,...a),e!==Hn.sources.SILENT&&this.emitter.emit(...a)}return l}function wd(n,e,t,r,i){let o={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(i=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(i=r,r=t,t=e,e=0),typeof t=="object"?(o=t,i=r):typeof t=="string"&&(r!=null?o[t]=r:i=t),i=i||Hn.sources.API,[n,e,o,i]}function Kx(n,e,t,r){const i=typeof t=="number"?t:0;if(n==null)return null;let o,l;return e&&typeof e.transformPosition=="function"?[o,l]=[n.index,n.index+n.length].map(a=>e.transformPosition(a,r!==Hn.sources.USER)):[o,l]=[n.index,n.index+n.length].map(a=>a<e||a===e&&r===Hn.sources.USER?a:i>=0?a+i:Math.max(e,a+i)),new Ng(o,l-o)}class Gg extends Mv{}function Jx(n){return n instanceof kc||n instanceof gh}function Qx(n){return typeof n.updateContent=="function"}class s1 extends Dm{constructor(e,t,r){let{emitter:i}=r;super(e,t),this.emitter=i,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",o=>this.handleDragStart(o))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Hn.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Hn.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Hn.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,i]=this.line(e),[o]=this.line(e+t);if(super.deleteAt(e,t),o!=null&&r!==o&&i>0){if(r instanceof gh||o instanceof gh){this.optimize();return}const l=o.children.head instanceof zh?null:o.children.head;r.moveChildren(o,l),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,r,i){super.formatAt(e,t,r,i),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,Kn.BLOCK)==null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i),r==null&&t.endsWith(`
301
+ `,attributes:t.attributes}),i&&e.push({insert:i,attributes:t.attributes})}):e.push(t)}),e}class Hh{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}Ee(Hh,"DEFAULTS",{});const S0="\uFEFF";class Nm extends zf{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(S0),this.rightGuard=document.createTextNode(S0),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,r;const i=e.data.split(S0).join("");if(e===this.leftGuard)if(this.prev instanceof Ph){const o=this.prev.length();this.prev.insertAt(o,i),t={startNode:this.prev.domNode,startOffset:o+i.length}}else r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:i.length};else e===this.rightGuard&&(this.next instanceof Ph?(this.next.insertAt(0,i),t={startNode:this.next.domNode,startOffset:i.length}):(r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:i.length}));return e.data=S0,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const i=this.restore(r.target);i&&(t.range=i)}})}}class cD{constructor(e,t){Ee(this,"isComposing",!1);this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof Nm)&&(this.emitter.emit(Hn.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Hn.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Hn.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Hn.events.COMPOSITION_END,e),this.isComposing=!1}}const _p=class _p{constructor(e,t){Ee(this,"modules",{});this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}};Ee(_p,"DEFAULTS",{modules:{}}),Ee(_p,"themes",{default:_p});let E1=_p;const uD=n=>n.parentElement||n.getRootNode().host||null,fD=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},E0=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},Vx=(n,e,t,r,i,o)=>n<t&&e>r?0:n<t?-(t-n+i):e>r?e-n>r-t?n+i-t:e-r+o:0,hD=(n,e)=>{var o,l,a;const t=n.ownerDocument;let r=e,i=n;for(;i;){const h=i===t.body,g=h?{top:0,right:((o=window.visualViewport)==null?void 0:o.width)??t.documentElement.clientWidth,bottom:((l=window.visualViewport)==null?void 0:l.height)??t.documentElement.clientHeight,left:0}:fD(i),m=getComputedStyle(i),x=Vx(r.left,r.right,g.left,g.right,E0(m.scrollPaddingLeft),E0(m.scrollPaddingRight)),w=Vx(r.top,r.bottom,g.top,g.bottom,E0(m.scrollPaddingTop),E0(m.scrollPaddingBottom));if(x||w)if(h)(a=t.defaultView)==null||a.scrollBy(x,w);else{const{scrollLeft:_,scrollTop:S}=i;w&&(i.scrollTop+=w),x&&(i.scrollLeft+=x);const R=i.scrollLeft-_,k=i.scrollTop-S;r={left:r.left-R,top:r.top-k,right:r.right-R,bottom:r.bottom-k}}i=h||m.position==="fixed"?null:uD(i)}},dD=100,gD=["block","break","cursor","inline","scroll","text"],pD=(n,e,t)=>{const r=new _1;return gD.forEach(i=>{const o=e.query(i);o&&r.register(o)}),n.forEach(i=>{let o=e.query(i);o||t.error(`Cannot register "${i}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;o;)if(r.register(o),o="blotName"in o?o.requiredContainer??null:null,l+=1,l>dD){t.error(`Cycle detected in registering blot requiredContainer: "${i}"`);break}}),r},v1=Md("quill"),T0=new _1;Lh.uiClass="ql-ui";const Rh=class Rh{static debug(e){e===!0&&(e="log"),Md.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Zy.get(e)||T0.find(e,t)}static import(e){return this.imports[e]==null&&v1.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach(i=>{this.register(i,e[i],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&v1.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&T0.register(t),typeof t.register=="function"&&t.register(T0)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=vD(e,t),this.container=this.options.container,this.container==null){v1.error("Invalid Quill container",e);return}this.options.debug&&Rh.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Zy.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Hn;const i=Dm.blotName,o=this.options.registry.query(i);if(!o||!("blotName"in o))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new o(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new lD(this.scroll),this.selection=new iD(this.scroll,this.emitter),this.composition=new cD(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Hn.events.EDITOR_CHANGE,l=>{l===Hn.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Hn.events.SCROLL_UPDATE,(l,a)=>{const h=this.selection.lastRange,[g]=this.selection.getRange(),m=h&&g?{oldRange:h,newRange:g}:void 0;Eh.call(this,()=>this.editor.update(null,a,m),l)}),this.emitter.on(Hn.events.SCROLL_EMBED_UPDATE,(l,a)=>{const h=this.selection.lastRange,[g]=this.selection.getRange(),m=h&&g?{oldRange:h,newRange:g}:void 0;Eh.call(this,()=>{const x=new Xn().retain(l.offset(this)).retain({[l.statics.blotName]:a});return this.editor.update(x,[],m)},Rh.sources.USER)}),r){const l=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
302
+ `});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=wd(e,t,r),Eh.call(this,()=>this.editor.deleteText(e,t),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hn.sources.API;return Eh.call(this,()=>{const i=this.getSelection(!0);let o=new Xn;if(i==null)return o;if(this.scroll.query(e,Kn.BLOCK))o=this.editor.formatLine(i.index,i.length,{[e]:t});else{if(i.length===0)return this.selection.format(e,t),o;o=this.editor.formatText(i.index,i.length,{[e]:t})}return this.setSelection(i,Hn.sources.SILENT),o},r)}formatLine(e,t,r,i,o){let l;return[e,t,l,o]=wd(e,t,r,i,o),Eh.call(this,()=>this.editor.formatLine(e,t,l),o,e,0)}formatText(e,t,r,i,o){let l;return[e,t,l,o]=wd(e,t,r,i,o),Eh.call(this,()=>this.editor.formatText(e,t,l),o,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const i=this.container.getBoundingClientRect();return{bottom:r.bottom-i.top,height:r.height,left:r.left-i.left,right:r.right-i.left,top:r.top-i.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=wd(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=wd(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=wd(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Rh.sources.API;return Eh.call(this,()=>this.editor.insertEmbed(e,t,r),i,e)}insertText(e,t,r,i,o){let l;return[e,,l,o]=wd(e,0,r,i,o),Eh.call(this,()=>this.editor.insertText(e,t,l),o,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,r){return[e,t,,r]=wd(e,t,r),Eh.call(this,()=>this.editor.removeFormat(e,t),r,e)}scrollRectIntoView(e){hD(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.sources.API;return Eh.call(this,()=>{e=new Xn(e);const r=this.getLength(),i=this.editor.deleteText(0,r),o=this.editor.insertContents(0,e),l=this.editor.deleteText(this.getLength()-1,1);return i.compose(o).compose(l)},t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||Rh.sources.API):([e,t,,r]=wd(e,t,r),this.selection.setRange(new Ng(Math.max(0,e),t),r),r!==Hn.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.sources.API;const r=new Xn().insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hn.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.sources.API;return Eh.call(this,()=>(e=new Xn(e),this.editor.applyDelta(e)),t,!0)}};Ee(Rh,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:T0,theme:"default"}),Ee(Rh,"events",Hn.events),Ee(Rh,"sources",Hn.sources),Ee(Rh,"version","2.0.3"),Ee(Rh,"imports",{delta:Xn,parchment:jP,"core/module":Hh,"core/theme":E1});let Xe=Rh;function Zx(n){return typeof n=="string"?document.querySelector(n):n}function Eb(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,i]=t;return{...e,[r]:i===!0?{}:i}},{})}function Xx(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function vD(n,e){const t=Zx(n);if(!t)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===Xe.DEFAULTS.theme?E1:Xe.import(`themes/${e.theme}`);if(!i)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:o,...l}=Xe.DEFAULTS,{modules:a,...h}=i.DEFAULTS;let g=Eb(e.modules);g!=null&&g.toolbar&&g.toolbar.constructor!==Object&&(g={...g,toolbar:{container:g.toolbar}});const m=og({},Eb(o),Eb(a),g),x={...l,...Xx(h),...Xx(e)};let w=e.registry;return w?e.formats&&v1.warn('Ignoring "formats" option because "registry" is specified'):w=e.formats?pD(e.formats,x.registry,v1):x.registry,{...x,registry:w,container:t,theme:i,modules:Object.entries(m).reduce((_,S)=>{let[R,k]=S;if(!k)return _;const O=Xe.import(`modules/${R}`);return O==null?(v1.error(`Cannot load ${R} module. Are you sure you registered it?`),_):{..._,[R]:og({},O.DEFAULTS||{},k)}},{}),bounds:Zx(x.bounds)}}function Eh(n,e,t,r){if(!this.isEnabled()&&e===Hn.sources.USER&&!this.allowReadOnlyEdits)return new Xn;let i=t==null?null:this.getSelection();const o=this.editor.delta,l=n();if(i!=null&&(t===!0&&(t=i.index),r==null?i=Kx(i,l,e):r!==0&&(i=Kx(i,t,r,e)),this.setSelection(i,Hn.sources.SILENT)),l.length()>0){const a=[Hn.events.TEXT_CHANGE,l,o,e];this.emitter.emit(Hn.events.EDITOR_CHANGE,...a),e!==Hn.sources.SILENT&&this.emitter.emit(...a)}return l}function wd(n,e,t,r,i){let o={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(i=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(i=r,r=t,t=e,e=0),typeof t=="object"?(o=t,i=r):typeof t=="string"&&(r!=null?o[t]=r:i=t),i=i||Hn.sources.API,[n,e,o,i]}function Kx(n,e,t,r){const i=typeof t=="number"?t:0;if(n==null)return null;let o,l;return e&&typeof e.transformPosition=="function"?[o,l]=[n.index,n.index+n.length].map(a=>e.transformPosition(a,r!==Hn.sources.USER)):[o,l]=[n.index,n.index+n.length].map(a=>a<e||a===e&&r===Hn.sources.USER?a:i>=0?a+i:Math.max(e,a+i)),new Ng(o,l-o)}class Gg extends Mv{}function Jx(n){return n instanceof kc||n instanceof gh}function Qx(n){return typeof n.updateContent=="function"}class s1 extends Dm{constructor(e,t,r){let{emitter:i}=r;super(e,t),this.emitter=i,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",o=>this.handleDragStart(o))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Hn.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Hn.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Hn.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,i]=this.line(e),[o]=this.line(e+t);if(super.deleteAt(e,t),o!=null&&r!==o&&i>0){if(r instanceof gh||o instanceof gh){this.optimize();return}const l=o.children.head instanceof zh?null:o.children.head;r.moveChildren(o,l),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,r,i){super.formatAt(e,t,r,i),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,Kn.BLOCK)==null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i),r==null&&t.endsWith(`
303
303
  `)?i.insertAt(0,t.slice(0,-1),r):i.insertAt(0,t,r)}else{const i=this.scroll.create(t,r);this.appendChild(i)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===Kn.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat(new Xn().insert(`
304
304
  `))),i=r.pop();if(i==null)return;this.batchStart();const o=r.shift();if(o){const h=o.type==="block"&&(o.delta.length()===0||!this.descendant(gh,e)[0]&&e<this.length()),g=o.type==="block"?o.delta:new Xn().insert({[o.key]:o.value});Tb(this,e,g);const m=o.type==="block"?1:0,x=e+g.length()+m;h&&this.insertAt(x-1,`
305
305
  `);const w=hh(this.line(e)[0]),_=ph.AttributeMap.diff(w,o.attributes)||{};Object.keys(_).forEach(S=>{this.formatAt(x-1,1,S,_[S])}),e=x}let[l,a]=this.children.find(e);if(r.length&&(l&&(l=l.split(a),a=0),r.forEach(h=>{if(h.type==="block"){const g=this.createBlock(h.attributes,l||void 0);Tb(g,0,h.delta)}else{const g=this.create(h.key,h.value);this.insertBefore(g,l||void 0),Object.keys(h.attributes).forEach(m=>{g.format(m,h.attributes[m])})}})),i.type==="block"&&i.delta.length()){const h=l?l.offset(l.scroll)+a:this.length();Tb(this,h,i.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[r,i]=t;return r instanceof lu?[r,i]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Jx,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(i,o,l)=>{let a=[],h=l;return i.children.forEachAt(o,l,(g,m,x)=>{Jx(g)?a.push(g):g instanceof Mv&&(a=a.concat(r(g,m,h))),h-=x}),a};return r(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Hn.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=Hn.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:i}=r;const o=this.find(i,!0);return o&&!Qx(o)}),e.length>0&&this.emitter.emit(Hn.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Hn.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[i]=this.descendant(o=>o instanceof gh,e);i&&i.statics.blotName===t&&Qx(i)&&i.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new Xn;return e.forEach(i=>{const o=i==null?void 0:i.insert;if(o)if(typeof o=="string"){const l=o.split(`
306
- `);l.slice(0,-1).forEach(h=>{r.insert(h,i.attributes),t.push({type:"block",delta:r,attributes:i.attributes??{}}),r=new Xn});const a=l[l.length-1];a&&r.insert(a,i.attributes)}else{const l=Object.keys(o)[0];if(!l)return;this.query(l,Kn.INLINE)?r.push(i):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new Xn,t.push({type:"blockEmbed",key:l,value:o[l],attributes:i.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const i={};Object.entries(e).forEach(a=>{let[h,g]=a;this.query(h,Kn.BLOCK&Kn.BLOT)!=null?r=h:i[h]=g});const o=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(o,t||void 0);const l=o.length();return Object.entries(i).forEach(a=>{let[h,g]=a;o.formatAt(0,l,h,g)}),o}}Ee(s1,"blotName","scroll"),Ee(s1,"className","ql-editor"),Ee(s1,"tagName","DIV"),Ee(s1,"defaultChild",kc),Ee(s1,"allowedChildren",[kc,gh,Gg]);function Tb(n,e,t){t.reduce((r,i)=>{const o=ph.Op.length(i);let l=i.attributes||{};if(i.insert!=null){if(typeof i.insert=="string"){const a=i.insert;n.insertAt(r,a);const[h]=n.descendant(lu,r),g=hh(h);l=ph.AttributeMap.diff(g,l)||{}}else if(typeof i.insert=="object"){const a=Object.keys(i.insert)[0];if(a==null)return r;if(n.insertAt(r,a,i.insert[a]),n.scroll.query(a,Kn.INLINE)!=null){const[g]=n.descendant(lu,r),m=hh(g);l=ph.AttributeMap.diff(m,l)||{}}}}return Object.keys(l).forEach(a=>{n.formatAt(r,o,a,l[a])}),r+o},e)}const Fm={scope:Kn.BLOCK,whitelist:["right","center","justify"]},vD=new rd("align","align",Fm),M4=new Bh("align","ql-align",Fm),L4=new hg("align","text-align",Fm);class O4 extends hg{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(i=>`00${parseInt(i,10).toString(16)}`.slice(-2)).join("")}`):t}}const bD=new Bh("color","ql-color",{scope:Kn.INLINE}),Bm=new O4("color","color",{scope:Kn.INLINE}),yD=new Bh("background","ql-bg",{scope:Kn.INLINE}),zm=new O4("background","background-color",{scope:Kn.INLINE});class Yg extends Gg{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
306
+ `);l.slice(0,-1).forEach(h=>{r.insert(h,i.attributes),t.push({type:"block",delta:r,attributes:i.attributes??{}}),r=new Xn});const a=l[l.length-1];a&&r.insert(a,i.attributes)}else{const l=Object.keys(o)[0];if(!l)return;this.query(l,Kn.INLINE)?r.push(i):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new Xn,t.push({type:"blockEmbed",key:l,value:o[l],attributes:i.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const i={};Object.entries(e).forEach(a=>{let[h,g]=a;this.query(h,Kn.BLOCK&Kn.BLOT)!=null?r=h:i[h]=g});const o=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(o,t||void 0);const l=o.length();return Object.entries(i).forEach(a=>{let[h,g]=a;o.formatAt(0,l,h,g)}),o}}Ee(s1,"blotName","scroll"),Ee(s1,"className","ql-editor"),Ee(s1,"tagName","DIV"),Ee(s1,"defaultChild",kc),Ee(s1,"allowedChildren",[kc,gh,Gg]);function Tb(n,e,t){t.reduce((r,i)=>{const o=ph.Op.length(i);let l=i.attributes||{};if(i.insert!=null){if(typeof i.insert=="string"){const a=i.insert;n.insertAt(r,a);const[h]=n.descendant(lu,r),g=hh(h);l=ph.AttributeMap.diff(g,l)||{}}else if(typeof i.insert=="object"){const a=Object.keys(i.insert)[0];if(a==null)return r;if(n.insertAt(r,a,i.insert[a]),n.scroll.query(a,Kn.INLINE)!=null){const[g]=n.descendant(lu,r),m=hh(g);l=ph.AttributeMap.diff(m,l)||{}}}}return Object.keys(l).forEach(a=>{n.formatAt(r,o,a,l[a])}),r+o},e)}const Fm={scope:Kn.BLOCK,whitelist:["right","center","justify"]},bD=new rd("align","align",Fm),M4=new Bh("align","ql-align",Fm),L4=new hg("align","text-align",Fm);class O4 extends hg{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(i=>`00${parseInt(i,10).toString(16)}`.slice(-2)).join("")}`):t}}const yD=new Bh("color","ql-color",{scope:Kn.INLINE}),Bm=new O4("color","color",{scope:Kn.INLINE}),mD=new Bh("background","ql-bg",{scope:Kn.INLINE}),zm=new O4("background","background-color",{scope:Kn.INLINE});class Yg extends Gg{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
307
307
  `).slice(e,e+t)}html(e,t){return`<pre>
308
308
  ${Lv(this.code(e,t))}
309
- </pre>`}}class au extends kc{static register(){Xe.register(Yg)}}Ee(au,"TAB"," ");class Hm extends id{}Hm.blotName="code";Hm.tagName="CODE";au.blotName="code-block";au.className="ql-code-block";au.tagName="DIV";Yg.blotName="code-block-container";Yg.className="ql-code-block-container";Yg.tagName="DIV";Yg.allowedChildren=[au];au.allowedChildren=[Ph,zh,S1];au.requiredContainer=Yg;const Wm={scope:Kn.BLOCK,whitelist:["rtl"]},P4=new rd("direction","dir",Wm),D4=new Bh("direction","ql-direction",Wm),N4=new hg("direction","direction",Wm),F4={scope:Kn.INLINE,whitelist:["serif","monospace"]},B4=new Bh("font","ql-font",F4);class mD extends hg{value(e){return super.value(e).replace(/["']/g,"")}}const z4=new mD("font","font-family",F4),H4=new Bh("size","ql-size",{scope:Kn.INLINE,whitelist:["small","large","huge"]}),W4=new hg("size","font-size",{scope:Kn.INLINE,whitelist:["10px","18px","32px"]}),xD=Md("quill:keyboard"),wD=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";let U4=class G4 extends Hh{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!t[r]!==e[r]&&t[r]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=_D(e);if(i==null){xD.warn("Attempted to add invalid keyboard binding",i);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(i.key)?i.key:[i.key]).forEach(l=>{const a={...i,key:l,...t,...r};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const i=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(O=>G4.match(e,O));if(i.length===0)return;const o=Xe.find(e.target,!0);if(o&&o.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[a,h]=this.quill.getLine(l.index),[g,m]=this.quill.getLeaf(l.index),[x,w]=l.length===0?[g,m]:this.quill.getLeaf(l.index+l.length),_=g instanceof sv?g.value().slice(0,m):"",S=x instanceof sv?x.value().slice(w):"",R={collapsed:l.length===0,empty:l.length===0&&a.length()<=1,format:this.quill.getFormat(l),line:a,offset:h,prefix:_,suffix:S,event:e};i.some(O=>{if(O.collapsed!=null&&O.collapsed!==R.collapsed||O.empty!=null&&O.empty!==R.empty||O.offset!=null&&O.offset!==R.offset)return!1;if(Array.isArray(O.format)){if(O.format.every(P=>R.format[P]==null))return!1}else if(typeof O.format=="object"&&!Object.keys(O.format).every(P=>O.format[P]===!0?R.format[P]!=null:O.format[P]===!1?R.format[P]==null:$d(O.format[P],R.format[P])))return!1;return O.prefix!=null&&!O.prefix.test(R.prefix)||O.suffix!=null&&!O.suffix.test(R.suffix)?!1:O.handler.call(this,l,R,O)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let i={};const[o]=this.quill.getLine(e.index);let l=new Xn().retain(e.index-r).delete(r);if(t.offset===0){const[a]=this.quill.getLine(e.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const g=o.formats(),m=this.quill.getFormat(e.index-1,1);if(i=ph.AttributeMap.diff(g,m)||{},Object.keys(i).length>0){const x=new Xn().retain(e.index+o.length()-2).retain(1,i);l=l.compose(x)}}}this.quill.updateContents(l,Xe.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let i={};const[o]=this.quill.getLine(e.index);let l=new Xn().retain(e.index).delete(r);if(t.offset>=o.length()-1){const[a]=this.quill.getLine(e.index+1);if(a){const h=o.formats(),g=this.quill.getFormat(e.index,1);i=ph.AttributeMap.diff(h,g)||{},Object.keys(i).length>0&&(l=l.retain(a.length()-1).retain(1,i))}}this.quill.updateContents(l,Xe.sources.USER),this.quill.focus()}handleDeleteRange(e){Um({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((o,l)=>(this.quill.scroll.query(l,Kn.BLOCK)&&!Array.isArray(t.format[l])&&(o[l]=t.format[l]),o),{}),i=new Xn().retain(e.index).delete(e.length).insert(`
310
- `,r);this.quill.updateContents(i,Xe.sources.USER),this.quill.setSelection(e.index+1,Xe.sources.SILENT),this.quill.focus()}};const CD={bindings:{bold:Ab("bold"),italic:Ab("italic"),underline:Ab("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",Xe.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",Xe.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",Xe.sources.USER):e.format.list!=null&&this.quill.format("list",!1,Xe.sources.USER)}},"indent code-block":qx(!0),"outdent code-block":qx(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,Xe.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new Xn().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(t,Xe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,Xe.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Xe.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,Xe.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},i=new Xn().retain(n.index).insert(`
309
+ </pre>`}}class au extends kc{static register(){Xe.register(Yg)}}Ee(au,"TAB"," ");class Hm extends id{}Hm.blotName="code";Hm.tagName="CODE";au.blotName="code-block";au.className="ql-code-block";au.tagName="DIV";Yg.blotName="code-block-container";Yg.className="ql-code-block-container";Yg.tagName="DIV";Yg.allowedChildren=[au];au.allowedChildren=[Ph,zh,S1];au.requiredContainer=Yg;const Wm={scope:Kn.BLOCK,whitelist:["rtl"]},P4=new rd("direction","dir",Wm),D4=new Bh("direction","ql-direction",Wm),N4=new hg("direction","direction",Wm),F4={scope:Kn.INLINE,whitelist:["serif","monospace"]},B4=new Bh("font","ql-font",F4);class xD extends hg{value(e){return super.value(e).replace(/["']/g,"")}}const z4=new xD("font","font-family",F4),H4=new Bh("size","ql-size",{scope:Kn.INLINE,whitelist:["small","large","huge"]}),W4=new hg("size","font-size",{scope:Kn.INLINE,whitelist:["10px","18px","32px"]}),wD=Md("quill:keyboard"),CD=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";let U4=class G4 extends Hh{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!t[r]!==e[r]&&t[r]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=SD(e);if(i==null){wD.warn("Attempted to add invalid keyboard binding",i);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(i.key)?i.key:[i.key]).forEach(l=>{const a={...i,key:l,...t,...r};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const i=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(O=>G4.match(e,O));if(i.length===0)return;const o=Xe.find(e.target,!0);if(o&&o.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[a,h]=this.quill.getLine(l.index),[g,m]=this.quill.getLeaf(l.index),[x,w]=l.length===0?[g,m]:this.quill.getLeaf(l.index+l.length),_=g instanceof sv?g.value().slice(0,m):"",S=x instanceof sv?x.value().slice(w):"",R={collapsed:l.length===0,empty:l.length===0&&a.length()<=1,format:this.quill.getFormat(l),line:a,offset:h,prefix:_,suffix:S,event:e};i.some(O=>{if(O.collapsed!=null&&O.collapsed!==R.collapsed||O.empty!=null&&O.empty!==R.empty||O.offset!=null&&O.offset!==R.offset)return!1;if(Array.isArray(O.format)){if(O.format.every(P=>R.format[P]==null))return!1}else if(typeof O.format=="object"&&!Object.keys(O.format).every(P=>O.format[P]===!0?R.format[P]!=null:O.format[P]===!1?R.format[P]==null:$d(O.format[P],R.format[P])))return!1;return O.prefix!=null&&!O.prefix.test(R.prefix)||O.suffix!=null&&!O.suffix.test(R.suffix)?!1:O.handler.call(this,l,R,O)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let i={};const[o]=this.quill.getLine(e.index);let l=new Xn().retain(e.index-r).delete(r);if(t.offset===0){const[a]=this.quill.getLine(e.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const g=o.formats(),m=this.quill.getFormat(e.index-1,1);if(i=ph.AttributeMap.diff(g,m)||{},Object.keys(i).length>0){const x=new Xn().retain(e.index+o.length()-2).retain(1,i);l=l.compose(x)}}}this.quill.updateContents(l,Xe.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let i={};const[o]=this.quill.getLine(e.index);let l=new Xn().retain(e.index).delete(r);if(t.offset>=o.length()-1){const[a]=this.quill.getLine(e.index+1);if(a){const h=o.formats(),g=this.quill.getFormat(e.index,1);i=ph.AttributeMap.diff(h,g)||{},Object.keys(i).length>0&&(l=l.retain(a.length()-1).retain(1,i))}}this.quill.updateContents(l,Xe.sources.USER),this.quill.focus()}handleDeleteRange(e){Um({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((o,l)=>(this.quill.scroll.query(l,Kn.BLOCK)&&!Array.isArray(t.format[l])&&(o[l]=t.format[l]),o),{}),i=new Xn().retain(e.index).delete(e.length).insert(`
310
+ `,r);this.quill.updateContents(i,Xe.sources.USER),this.quill.setSelection(e.index+1,Xe.sources.SILENT),this.quill.focus()}};const _D={bindings:{bold:Ab("bold"),italic:Ab("italic"),underline:Ab("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",Xe.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",Xe.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",Xe.sources.USER):e.format.list!=null&&this.quill.format("list",!1,Xe.sources.USER)}},"indent code-block":qx(!0),"outdent code-block":qx(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,Xe.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new Xn().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(t,Xe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,Xe.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Xe.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,Xe.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},i=new Xn().retain(n.index).insert(`
311
311
  `,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,Xe.sources.USER),this.quill.setSelection(n.index+1,Xe.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),i=new Xn().retain(n.index).insert(`
312
- `,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,Xe.sources.USER),this.quill.setSelection(n.index+1,Xe.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,r,i,o]=e.getTable(n),l=SD(t,r,i,o);if(l==null)return;let a=t.offset();if(l<0){const h=new Xn().retain(a).insert(`
312
+ `,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,Xe.sources.USER),this.quill.setSelection(n.index+1,Xe.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,r,i,o]=e.getTable(n),l=ED(t,r,i,o);if(l==null)return;let a=t.offset();if(l<0){const h=new Xn().retain(a).insert(`
313
313
  `);this.quill.updateContents(h,Xe.sources.USER),this.quill.setSelection(n.index+1,n.length,Xe.sources.SILENT)}else if(l>0){a+=t.length();const h=new Xn().retain(a).insert(`
314
- `);this.quill.updateContents(h,Xe.sources.USER),this.quill.setSelection(a,Xe.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,i=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(i-1,Xe.sources.USER):this.quill.setSelection(i+r.length(),Xe.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,i]=this.quill.getLine(n.index);if(i>t)return!0;let o;switch(e.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(n.index," ",Xe.sources.USER),this.quill.history.cutoff();const l=new Xn().retain(n.index-i).delete(t+1).retain(r.length()-2-i).retain(1,{list:o});return this.quill.updateContents(l,Xe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,Xe.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,i=e;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const o=new Xn().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(o,Xe.sources.USER),this.quill.setSelection(n.index-1,Xe.sources.SILENT),!1}return!0}},"embed left":A0("ArrowLeft",!1),"embed left shift":A0("ArrowLeft",!0),"embed right":A0("ArrowRight",!1),"embed right shift":A0("ArrowRight",!0),"table down":jx(!1),"table up":jx(!0)}};U4.DEFAULTS=CD;function qx(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const i=this.quill.scroll.query("code-block"),{TAB:o}=i;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,o,Xe.sources.USER),this.quill.setSelection(e.index+o.length,Xe.sources.SILENT);return}const l=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:a,length:h}=e;l.forEach((g,m)=>{n?(g.insertAt(0,o),m===0?a+=o.length:h+=o.length):g.domNode.textContent.startsWith(o)&&(g.deleteAt(0,o.length),m===0?a-=o.length:h-=o.length)}),this.quill.update(Xe.sources.USER),this.quill.setSelection(a,h,Xe.sources.SILENT)}}}function A0(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:i}=r;n==="ArrowRight"&&(i+=r.length+1);const[o]=this.quill.getLeaf(i);return o instanceof zf?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,Xe.sources.USER):this.quill.setSelection(r.index-1,Xe.sources.USER):e?this.quill.setSelection(r.index,r.length+1,Xe.sources.USER):this.quill.setSelection(r.index+r.length+1,Xe.sources.USER),!1):!0}}}function Ab(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],Xe.sources.USER)}}}function jx(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",i=t.line,o=i.parent[r];if(o!=null){if(o.statics.blotName==="table-row"){let l=o.children.head,a=i;for(;a.prev!=null;)a=a.prev,l=l.next;const h=l.offset(this.quill.scroll)+Math.min(t.offset,l.length()-1);this.quill.setSelection(h,0,Xe.sources.USER)}}else{const l=i.table()[r];l!=null&&(n?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,Xe.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,Xe.sources.USER))}return!1}}}function _D(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=g1(n);else return null;return n.shortKey&&(n[wD]=n.shortKey,delete n.shortKey),n}function Um(n){let{quill:e,range:t}=n;const r=e.getLines(t);let i={};if(r.length>1){const o=r[0].formats(),l=r[r.length-1].formats();i=ph.AttributeMap.diff(l,o)||{}}e.deleteText(t,Xe.sources.USER),Object.keys(i).length>0&&e.formatLine(t.index,1,i,Xe.sources.USER),e.setSelection(t.index,Xe.sources.SILENT)}function SD(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const ED=/font-weight:\s*normal/,TD=["P","OL","UL"],$x=n=>n&&TD.includes(n.tagName),AD=n=>{Array.from(n.querySelectorAll("br")).filter(e=>$x(e.previousElementSibling)&&$x(e.nextElementSibling)).forEach(e=>{var t;(t=e.parentNode)==null||t.removeChild(e)})},RD=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var t;return(t=e.getAttribute("style"))==null?void 0:t.match(ED)}).forEach(e=>{var r;const t=n.createDocumentFragment();t.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(t,e)})};function ID(n){n.querySelector('[id^="docs-internal-guid-"]')&&(RD(n),AD(n))}const kD=/\bmso-list:[^;]*ignore/i,MD=/\bmso-list:[^;]*\bl(\d+)/i,LD=/\bmso-list:[^;]*\blevel(\d+)/i,OD=(n,e)=>{const t=n.getAttribute("style"),r=t==null?void 0:t.match(MD);if(!r)return null;const i=Number(r[1]),o=t==null?void 0:t.match(LD),l=o?Number(o[1]):1,a=new RegExp(`@list l${i}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),h=e.match(a),g=h&&h[1]==="bullet"?"bullet":"ordered";return{id:i,indent:l,type:g,element:n}},PD=n=>{var l,a;const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(h=>{(h.getAttribute("style")||"").match(kD)?t.push(h):r.push(h)}),t.forEach(h=>{var g;return(g=h.parentNode)==null?void 0:g.removeChild(h)});const i=n.documentElement.innerHTML,o=r.map(h=>OD(h,i)).filter(h=>h);for(;o.length;){const h=[];let g=o.shift();for(;g;)h.push(g),g=o.length&&((l=o[0])==null?void 0:l.element)===g.element.nextElementSibling&&o[0].id===g.id?o.shift():null;const m=document.createElement("ul");h.forEach(_=>{const S=document.createElement("li");S.setAttribute("data-list",_.type),_.indent>1&&S.setAttribute("class",`ql-indent-${_.indent-1}`),S.innerHTML=_.element.innerHTML,m.appendChild(S)});const x=(a=h[0])==null?void 0:a.element,{parentNode:w}=x??{};x&&(w==null||w.replaceChild(m,x)),h.slice(1).forEach(_=>{let{element:S}=_;w==null||w.removeChild(S)})}};function DD(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&PD(n)}const ND=[DD,ID],FD=n=>{n.documentElement&&ND.forEach(e=>{e(n)})},BD=Md("quill:clipboard"),zD=[[Node.TEXT_NODE,jD],[Node.TEXT_NODE,tw],["br",VD],[Node.ELEMENT_NODE,tw],[Node.ELEMENT_NODE,YD],[Node.ELEMENT_NODE,GD],[Node.ELEMENT_NODE,QD],["li",KD],["ol, ul",JD],["pre",ZD],["tr",qD],["b",Rb("bold")],["i",Rb("italic")],["strike",Rb("strike")],["style",XD]],HD=[vD,P4].reduce((n,e)=>(n[e.keyName]=e,n),{}),ew=[L4,zm,Bm,N4,z4,W4].reduce((n,e)=>(n[e.keyName]=e,n),{});var Iy;let WD=(Iy=class extends Hh{constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],zD.concat(this.options.matchers??[]).forEach(r=>{let[i,o]=r;this.addMatcher(i,o)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i[au.blotName])return new Xn().insert(r||"",{[au.blotName]:i[au.blotName]});if(!t)return new Xn().insert(r||"",i);const o=this.convertHTML(t);return Up(o,`
315
- `)&&(o.ops[o.ops.length-1].attributes==null||i.table)?o.compose(new Xn().retain(o.length()-1).delete(1)):o}normalizeHTML(e){FD(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,i=new WeakMap,[o,l]=this.prepareMatching(r,i);return Gm(this.quill.scroll,r,o,l,i)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xe.sources.API;if(typeof e=="string"){const i=this.convert({html:e,text:""});this.quill.setContents(i,t),this.quill.setSelection(0,Xe.sources.SILENT)}else{const i=this.convert({html:t,text:""});this.quill.updateContents(new Xn().retain(e).concat(i),r),this.quill.setSelection(e+i.length(),Xe.sources.SILENT)}}onCaptureCopy(e){var l,a;let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:i,text:o}=this.onCopy(r,t);(l=e.clipboardData)==null||l.setData("text/plain",o),(a=e.clipboardData)==null||a.setData("text/html",i),t&&Um({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
316
- `)}onCapturePaste(e){var l,a,h,g,m;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=(l=e.clipboardData)==null?void 0:l.getData("text/html");let i=(a=e.clipboardData)==null?void 0:a.getData("text/plain");if(!r&&!i){const x=(h=e.clipboardData)==null?void 0:h.getData("text/uri-list");x&&(i=this.normalizeURIList(x))}const o=Array.from(((g=e.clipboardData)==null?void 0:g.files)||[]);if(!r&&o.length>0){this.quill.uploader.upload(t,o);return}if(r&&o.length>0){const x=new DOMParser().parseFromString(r,"text/html");if(x.body.childElementCount===1&&((m=x.body.firstElementChild)==null?void 0:m.tagName)==="IMG"){this.quill.uploader.upload(t,o);return}}this.onPaste(t,{html:r,text:i})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:i}=t;const o=this.quill.getFormat(e.index),l=this.convert({text:r,html:i},o);BD.log("onPaste",l,{text:r,html:i});const a=new Xn().retain(e.index).delete(e.length).concat(l);this.quill.updateContents(a,Xe.sources.USER),this.quill.setSelection(a.length()-e.length,Xe.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],i=[];return this.matchers.forEach(o=>{const[l,a]=o;switch(l){case Node.TEXT_NODE:i.push(a);break;case Node.ELEMENT_NODE:r.push(a);break;default:Array.from(e.querySelectorAll(l)).forEach(h=>{if(t.has(h)){const g=t.get(h);g==null||g.push(a)}else t.set(h,[a])});break}}),[r,i]}},Ee(Iy,"DEFAULTS",{matchers:[]}),Iy);function Vg(n,e,t,r){return r.query(e)?n.reduce((i,o)=>{if(!o.insert)return i;if(o.attributes&&o.attributes[e])return i.push(o);const l=t?{[e]:t}:{};return i.insert(o.insert,{...l,...o.attributes})},new Xn):n}function Up(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const i=n.ops[r];if(typeof i.insert!="string")break;t=i.insert+t}return t.slice(-1*e.length)===e}function ng(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof zf?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function UD(n,e){return n.previousElementSibling&&n.nextElementSibling&&!ng(n.previousElementSibling,e)&&!ng(n.nextElementSibling,e)}const R0=new WeakMap;function Y4(n){return n==null?!1:(R0.has(n)||(n.tagName==="PRE"?R0.set(n,!0):R0.set(n,Y4(n.parentNode))),R0.get(n))}function Gm(n,e,t,r,i){return e.nodeType===e.TEXT_NODE?r.reduce((o,l)=>l(e,o,n),new Xn):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((o,l)=>{let a=Gm(n,l,t,r,i);return l.nodeType===e.ELEMENT_NODE&&(a=t.reduce((h,g)=>g(l,h,n),a),a=(i.get(l)||[]).reduce((h,g)=>g(l,h,n),a)),o.concat(a)},new Xn):new Xn}function Rb(n){return(e,t,r)=>Vg(t,n,!0,r)}function GD(n,e,t){const r=rd.keys(n),i=Bh.keys(n),o=hg.keys(n),l={};return r.concat(i).concat(o).forEach(a=>{let h=t.query(a,Kn.ATTRIBUTE);h!=null&&(l[h.attrName]=h.value(n),l[h.attrName])||(h=HD[a],h!=null&&(h.attrName===a||h.keyName===a)&&(l[h.attrName]=h.value(n)||void 0),h=ew[a],h!=null&&(h.attrName===a||h.keyName===a)&&(h=ew[a],l[h.attrName]=h.value(n)||void 0))}),Object.entries(l).reduce((a,h)=>{let[g,m]=h;return Vg(a,g,m,t)},e)}function YD(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof zf){const i={},o=r.value(n);if(o!=null)return i[r.blotName]=o,new Xn().insert(i,r.formats(n,t))}else if(r.prototype instanceof Mp&&!Up(e,`
314
+ `);this.quill.updateContents(h,Xe.sources.USER),this.quill.setSelection(a,Xe.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,i=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(i-1,Xe.sources.USER):this.quill.setSelection(i+r.length(),Xe.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,i]=this.quill.getLine(n.index);if(i>t)return!0;let o;switch(e.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(n.index," ",Xe.sources.USER),this.quill.history.cutoff();const l=new Xn().retain(n.index-i).delete(t+1).retain(r.length()-2-i).retain(1,{list:o});return this.quill.updateContents(l,Xe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,Xe.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,i=e;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const o=new Xn().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(o,Xe.sources.USER),this.quill.setSelection(n.index-1,Xe.sources.SILENT),!1}return!0}},"embed left":A0("ArrowLeft",!1),"embed left shift":A0("ArrowLeft",!0),"embed right":A0("ArrowRight",!1),"embed right shift":A0("ArrowRight",!0),"table down":jx(!1),"table up":jx(!0)}};U4.DEFAULTS=_D;function qx(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const i=this.quill.scroll.query("code-block"),{TAB:o}=i;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,o,Xe.sources.USER),this.quill.setSelection(e.index+o.length,Xe.sources.SILENT);return}const l=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:a,length:h}=e;l.forEach((g,m)=>{n?(g.insertAt(0,o),m===0?a+=o.length:h+=o.length):g.domNode.textContent.startsWith(o)&&(g.deleteAt(0,o.length),m===0?a-=o.length:h-=o.length)}),this.quill.update(Xe.sources.USER),this.quill.setSelection(a,h,Xe.sources.SILENT)}}}function A0(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:i}=r;n==="ArrowRight"&&(i+=r.length+1);const[o]=this.quill.getLeaf(i);return o instanceof zf?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,Xe.sources.USER):this.quill.setSelection(r.index-1,Xe.sources.USER):e?this.quill.setSelection(r.index,r.length+1,Xe.sources.USER):this.quill.setSelection(r.index+r.length+1,Xe.sources.USER),!1):!0}}}function Ab(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],Xe.sources.USER)}}}function jx(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",i=t.line,o=i.parent[r];if(o!=null){if(o.statics.blotName==="table-row"){let l=o.children.head,a=i;for(;a.prev!=null;)a=a.prev,l=l.next;const h=l.offset(this.quill.scroll)+Math.min(t.offset,l.length()-1);this.quill.setSelection(h,0,Xe.sources.USER)}}else{const l=i.table()[r];l!=null&&(n?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,Xe.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,Xe.sources.USER))}return!1}}}function SD(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=g1(n);else return null;return n.shortKey&&(n[CD]=n.shortKey,delete n.shortKey),n}function Um(n){let{quill:e,range:t}=n;const r=e.getLines(t);let i={};if(r.length>1){const o=r[0].formats(),l=r[r.length-1].formats();i=ph.AttributeMap.diff(l,o)||{}}e.deleteText(t,Xe.sources.USER),Object.keys(i).length>0&&e.formatLine(t.index,1,i,Xe.sources.USER),e.setSelection(t.index,Xe.sources.SILENT)}function ED(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const TD=/font-weight:\s*normal/,AD=["P","OL","UL"],$x=n=>n&&AD.includes(n.tagName),RD=n=>{Array.from(n.querySelectorAll("br")).filter(e=>$x(e.previousElementSibling)&&$x(e.nextElementSibling)).forEach(e=>{var t;(t=e.parentNode)==null||t.removeChild(e)})},ID=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var t;return(t=e.getAttribute("style"))==null?void 0:t.match(TD)}).forEach(e=>{var r;const t=n.createDocumentFragment();t.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(t,e)})};function kD(n){n.querySelector('[id^="docs-internal-guid-"]')&&(ID(n),RD(n))}const MD=/\bmso-list:[^;]*ignore/i,LD=/\bmso-list:[^;]*\bl(\d+)/i,OD=/\bmso-list:[^;]*\blevel(\d+)/i,PD=(n,e)=>{const t=n.getAttribute("style"),r=t==null?void 0:t.match(LD);if(!r)return null;const i=Number(r[1]),o=t==null?void 0:t.match(OD),l=o?Number(o[1]):1,a=new RegExp(`@list l${i}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),h=e.match(a),g=h&&h[1]==="bullet"?"bullet":"ordered";return{id:i,indent:l,type:g,element:n}},DD=n=>{var l,a;const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(h=>{(h.getAttribute("style")||"").match(MD)?t.push(h):r.push(h)}),t.forEach(h=>{var g;return(g=h.parentNode)==null?void 0:g.removeChild(h)});const i=n.documentElement.innerHTML,o=r.map(h=>PD(h,i)).filter(h=>h);for(;o.length;){const h=[];let g=o.shift();for(;g;)h.push(g),g=o.length&&((l=o[0])==null?void 0:l.element)===g.element.nextElementSibling&&o[0].id===g.id?o.shift():null;const m=document.createElement("ul");h.forEach(_=>{const S=document.createElement("li");S.setAttribute("data-list",_.type),_.indent>1&&S.setAttribute("class",`ql-indent-${_.indent-1}`),S.innerHTML=_.element.innerHTML,m.appendChild(S)});const x=(a=h[0])==null?void 0:a.element,{parentNode:w}=x??{};x&&(w==null||w.replaceChild(m,x)),h.slice(1).forEach(_=>{let{element:S}=_;w==null||w.removeChild(S)})}};function ND(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&DD(n)}const FD=[ND,kD],BD=n=>{n.documentElement&&FD.forEach(e=>{e(n)})},zD=Md("quill:clipboard"),HD=[[Node.TEXT_NODE,$D],[Node.TEXT_NODE,tw],["br",ZD],[Node.ELEMENT_NODE,tw],[Node.ELEMENT_NODE,VD],[Node.ELEMENT_NODE,YD],[Node.ELEMENT_NODE,qD],["li",JD],["ol, ul",QD],["pre",XD],["tr",jD],["b",Rb("bold")],["i",Rb("italic")],["strike",Rb("strike")],["style",KD]],WD=[bD,P4].reduce((n,e)=>(n[e.keyName]=e,n),{}),ew=[L4,zm,Bm,N4,z4,W4].reduce((n,e)=>(n[e.keyName]=e,n),{});var Iy;let UD=(Iy=class extends Hh{constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],HD.concat(this.options.matchers??[]).forEach(r=>{let[i,o]=r;this.addMatcher(i,o)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i[au.blotName])return new Xn().insert(r||"",{[au.blotName]:i[au.blotName]});if(!t)return new Xn().insert(r||"",i);const o=this.convertHTML(t);return Up(o,`
315
+ `)&&(o.ops[o.ops.length-1].attributes==null||i.table)?o.compose(new Xn().retain(o.length()-1).delete(1)):o}normalizeHTML(e){BD(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,i=new WeakMap,[o,l]=this.prepareMatching(r,i);return Gm(this.quill.scroll,r,o,l,i)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xe.sources.API;if(typeof e=="string"){const i=this.convert({html:e,text:""});this.quill.setContents(i,t),this.quill.setSelection(0,Xe.sources.SILENT)}else{const i=this.convert({html:t,text:""});this.quill.updateContents(new Xn().retain(e).concat(i),r),this.quill.setSelection(e+i.length(),Xe.sources.SILENT)}}onCaptureCopy(e){var l,a;let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:i,text:o}=this.onCopy(r,t);(l=e.clipboardData)==null||l.setData("text/plain",o),(a=e.clipboardData)==null||a.setData("text/html",i),t&&Um({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
316
+ `)}onCapturePaste(e){var l,a,h,g,m;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=(l=e.clipboardData)==null?void 0:l.getData("text/html");let i=(a=e.clipboardData)==null?void 0:a.getData("text/plain");if(!r&&!i){const x=(h=e.clipboardData)==null?void 0:h.getData("text/uri-list");x&&(i=this.normalizeURIList(x))}const o=Array.from(((g=e.clipboardData)==null?void 0:g.files)||[]);if(!r&&o.length>0){this.quill.uploader.upload(t,o);return}if(r&&o.length>0){const x=new DOMParser().parseFromString(r,"text/html");if(x.body.childElementCount===1&&((m=x.body.firstElementChild)==null?void 0:m.tagName)==="IMG"){this.quill.uploader.upload(t,o);return}}this.onPaste(t,{html:r,text:i})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:i}=t;const o=this.quill.getFormat(e.index),l=this.convert({text:r,html:i},o);zD.log("onPaste",l,{text:r,html:i});const a=new Xn().retain(e.index).delete(e.length).concat(l);this.quill.updateContents(a,Xe.sources.USER),this.quill.setSelection(a.length()-e.length,Xe.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],i=[];return this.matchers.forEach(o=>{const[l,a]=o;switch(l){case Node.TEXT_NODE:i.push(a);break;case Node.ELEMENT_NODE:r.push(a);break;default:Array.from(e.querySelectorAll(l)).forEach(h=>{if(t.has(h)){const g=t.get(h);g==null||g.push(a)}else t.set(h,[a])});break}}),[r,i]}},Ee(Iy,"DEFAULTS",{matchers:[]}),Iy);function Vg(n,e,t,r){return r.query(e)?n.reduce((i,o)=>{if(!o.insert)return i;if(o.attributes&&o.attributes[e])return i.push(o);const l=t?{[e]:t}:{};return i.insert(o.insert,{...l,...o.attributes})},new Xn):n}function Up(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const i=n.ops[r];if(typeof i.insert!="string")break;t=i.insert+t}return t.slice(-1*e.length)===e}function ng(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof zf?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function GD(n,e){return n.previousElementSibling&&n.nextElementSibling&&!ng(n.previousElementSibling,e)&&!ng(n.nextElementSibling,e)}const R0=new WeakMap;function Y4(n){return n==null?!1:(R0.has(n)||(n.tagName==="PRE"?R0.set(n,!0):R0.set(n,Y4(n.parentNode))),R0.get(n))}function Gm(n,e,t,r,i){return e.nodeType===e.TEXT_NODE?r.reduce((o,l)=>l(e,o,n),new Xn):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((o,l)=>{let a=Gm(n,l,t,r,i);return l.nodeType===e.ELEMENT_NODE&&(a=t.reduce((h,g)=>g(l,h,n),a),a=(i.get(l)||[]).reduce((h,g)=>g(l,h,n),a)),o.concat(a)},new Xn):new Xn}function Rb(n){return(e,t,r)=>Vg(t,n,!0,r)}function YD(n,e,t){const r=rd.keys(n),i=Bh.keys(n),o=hg.keys(n),l={};return r.concat(i).concat(o).forEach(a=>{let h=t.query(a,Kn.ATTRIBUTE);h!=null&&(l[h.attrName]=h.value(n),l[h.attrName])||(h=WD[a],h!=null&&(h.attrName===a||h.keyName===a)&&(l[h.attrName]=h.value(n)||void 0),h=ew[a],h!=null&&(h.attrName===a||h.keyName===a)&&(h=ew[a],l[h.attrName]=h.value(n)||void 0))}),Object.entries(l).reduce((a,h)=>{let[g,m]=h;return Vg(a,g,m,t)},e)}function VD(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof zf){const i={},o=r.value(n);if(o!=null)return i[r.blotName]=o,new Xn().insert(i,r.formats(n,t))}else if(r.prototype instanceof Mp&&!Up(e,`
317
317
  `)&&e.insert(`
318
- `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Vg(e,r.blotName,r.formats(n,t),t);return e}function VD(n,e){return Up(e,`
318
+ `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Vg(e,r.blotName,r.formats(n,t),t);return e}function ZD(n,e){return Up(e,`
319
319
  `)||e.insert(`
320
- `),e}function ZD(n,e,t){const r=t.query("code-block"),i=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Vg(e,"code-block",i,t)}function XD(){return new Xn}function KD(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Up(e,`
321
- `))return e;let i=-1,o=n.parentNode;for(;o!=null;)["OL","UL"].includes(o.tagName)&&(i+=1),o=o.parentNode;return i<=0?e:e.reduce((l,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?l.push(a):l.insert(a.insert,{indent:i,...a.attributes||{}}):l,new Xn)}function JD(n,e,t){const r=n;let i=r.tagName==="OL"?"ordered":"bullet";const o=r.getAttribute("data-checked");return o&&(i=o==="true"?"checked":"unchecked"),Vg(e,"list",i,t)}function tw(n,e,t){if(!Up(e,`
320
+ `),e}function XD(n,e,t){const r=t.query("code-block"),i=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Vg(e,"code-block",i,t)}function KD(){return new Xn}function JD(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Up(e,`
321
+ `))return e;let i=-1,o=n.parentNode;for(;o!=null;)["OL","UL"].includes(o.tagName)&&(i+=1),o=o.parentNode;return i<=0?e:e.reduce((l,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?l.push(a):l.insert(a.insert,{indent:i,...a.attributes||{}}):l,new Xn)}function QD(n,e,t){const r=n;let i=r.tagName==="OL"?"ordered":"bullet";const o=r.getAttribute("data-checked");return o&&(i=o==="true"?"checked":"unchecked"),Vg(e,"list",i,t)}function tw(n,e,t){if(!Up(e,`
322
322
  `)){if(ng(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`
323
323
  `);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(ng(r,t))return e.insert(`
324
324
  `);const i=t.query(r);if(i&&i.prototype instanceof gh)return e.insert(`
325
- `);r=r.firstChild}}}return e}function QD(n,e,t){var o;const r={},i=n.style||{};return i.fontStyle==="italic"&&(r.italic=!0),i.textDecoration==="underline"&&(r.underline=!0),i.textDecoration==="line-through"&&(r.strike=!0),((o=i.fontWeight)!=null&&o.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((l,a)=>{let[h,g]=a;return Vg(l,h,g,t)},e),parseFloat(i.textIndent||0)>0?new Xn().insert(" ").concat(e):e}function qD(n,e,t){var i,o;const r=((i=n.parentElement)==null?void 0:i.tagName)==="TABLE"?n.parentElement:(o=n.parentElement)==null?void 0:o.parentElement;if(r!=null){const a=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Vg(e,"table",a,t)}return e}function jD(n,e,t){var i;let r=n.data;if(((i=n.parentElement)==null?void 0:i.tagName)==="O:P")return e.insert(r.trim());if(!Y4(n)){if(r.trim().length===0&&r.includes(`
326
- `)&&!UD(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&ng(n.parentElement,t)||n.previousSibling instanceof Element&&ng(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&ng(n.parentElement,t)||n.nextSibling instanceof Element&&ng(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class V4 extends Hh{constructor(t,r){super(t,r);Ee(this,"lastRecorded",0);Ee(this,"ignoreChange",!1);Ee(this,"stack",{undo:[],redo:[]});Ee(this,"currentRange",null);this.quill.on(Xe.events.EDITOR_CHANGE,(i,o,l,a)=>{i===Xe.events.SELECTION_CHANGE?o&&a!==Xe.sources.SILENT&&(this.currentRange=o):i===Xe.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===Xe.sources.USER?this.record(o,l):this.transform(o)),this.currentRange=Jy(this.currentRange,o))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",i=>{i.inputType==="historyUndo"?(this.undo(),i.preventDefault()):i.inputType==="historyRedo"&&(this.redo(),i.preventDefault())})}change(t,r){if(this.stack[t].length===0)return;const i=this.stack[t].pop();if(!i)return;const o=this.quill.getContents(),l=i.delta.invert(o);this.stack[r].push({delta:l,range:Jy(i.range,l)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i.delta,Xe.sources.USER),this.ignoreChange=!1,this.restoreSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,r){if(t.ops.length===0)return;this.stack.redo=[];let i=t.invert(r),o=this.currentRange;const l=Date.now();if(this.lastRecorded+this.options.delay>l&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(i=i.compose(a.delta),o=a.range)}else this.lastRecorded=l;i.length()!==0&&(this.stack.undo.push({delta:i,range:o}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){nw(this.stack.undo,t),nw(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,Xe.sources.USER);else{const r=eN(this.quill.scroll,t.delta);this.quill.setSelection(r,Xe.sources.USER)}}}Ee(V4,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function nw(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const i=n[r];n[r]={delta:t.transform(i.delta,!0),range:i.range&&Jy(i.range,t)},t=i.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function $D(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
327
- `):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,Kn.BLOCK)!=null):!1}function eN(n,e){const t=e.reduce((i,o)=>i+(o.delete||0),0);let r=e.length()-t;return $D(n,e)&&(r-=1),r}function Jy(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class Z4 extends Hh{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{var l;r.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);i=document.createRange(),i.setStart(a.offsetNode,a.offset),i.setEnd(a.offsetNode,a.offset)}const o=i&&e.selection.normalizeNative(i);if(o){const a=e.selection.normalizedToRange(o);(l=r.dataTransfer)!=null&&l.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(i=>{var o;i&&((o=this.options.mimetypes)!=null&&o.includes(i.type))&&r.push(i)}),r.length>0&&this.options.handler.call(this,e,r)}}Z4.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(i=>{const o=new FileReader;o.onload=()=>{i(o.result)},o.readAsDataURL(r)}));Promise.all(t).then(r=>{const i=r.reduce((o,l)=>o.insert({image:l}),new Xn().retain(n.index).delete(n.length));this.quill.updateContents(i,Hn.sources.USER),this.quill.setSelection(n.index+r.length,Hn.sources.SILENT)})}};const tN=["insertText","insertReplacementText"];class nN extends Hh{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(Xe.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Um({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new Xn().retain(e.index).insert(t,r),Xe.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,Xe.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!tN.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=rN(e);if(r==null)return;const i=this.quill.selection.normalizeNative(t),o=i?this.quill.selection.normalizedToRange(i):null;o&&this.replaceText(o,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function rN(n){var e;return typeof n.data=="string"?n.data:(e=n.dataTransfer)!=null&&e.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const iN=/Mac/i.test(navigator.platform),oN=100,lN=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||iN&&n.key==="a"&&n.ctrlKey===!0);class sN extends Hh{constructor(t,r){super(t,r);Ee(this,"isListening",!1);Ee(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,r){let{line:i,event:o}=r;if(!(i instanceof Lh)||!i.uiNode)return!0;const l=getComputedStyle(i.domNode).direction==="rtl";return l&&o.key!=="ArrowRight"||!l&&o.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(o.shiftKey?1:0),Xe.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&lN(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+oN,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const r=t.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const i=this.quill.scroll.find(r.startContainer);if(!(i instanceof Lh)||!i.uiNode)return;const o=document.createRange();o.setStartAfter(i.uiNode),o.setEndAfter(i.uiNode),t.removeAllRanges(),t.addRange(o)}}Xe.register({"blots/block":kc,"blots/block/embed":gh,"blots/break":zh,"blots/container":Gg,"blots/cursor":S1,"blots/embed":Nm,"blots/inline":id,"blots/scroll":s1,"blots/text":Ph,"modules/clipboard":WD,"modules/history":V4,"modules/keyboard":U4,"modules/uploader":Z4,"modules/input":nN,"modules/uiNode":sN});class aN extends Bh{add(e,t){let r=0;if(t==="+1"||t==="-1"){const i=this.value(e)||0;r=t==="+1"?i+1:i-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const cN=new aN("indent","ql-indent",{scope:Kn.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Qy extends kc{}Ee(Qy,"blotName","blockquote"),Ee(Qy,"tagName","blockquote");class qy extends kc{static formats(e){return this.tagName.indexOf(e.tagName)+1}}Ee(qy,"blotName","header"),Ee(qy,"tagName",["H1","H2","H3","H4","H5","H6"]);class Gp extends Gg{}Gp.blotName="list-container";Gp.tagName="OL";class Yp extends kc{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){Xe.register(Gp)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),i=o=>{if(!e.isEnabled())return;const l=this.statics.formats(t,e);l==="checked"?(this.format("list","unchecked"),o.preventDefault()):l==="unchecked"&&(this.format("list","checked"),o.preventDefault())};r.addEventListener("mousedown",i),r.addEventListener("touchstart",i),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Yp.blotName="list";Yp.tagName="LI";Gp.allowedChildren=[Yp];Yp.requiredContainer=Gp;class Op extends id{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}Ee(Op,"blotName","bold"),Ee(Op,"tagName",["STRONG","B"]);class jy extends Op{}Ee(jy,"blotName","italic"),Ee(jy,"tagName",["EM","I"]);class rg extends id{static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return X4(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}Ee(rg,"blotName","link"),Ee(rg,"tagName","A"),Ee(rg,"SANITIZED_URL","about:blank"),Ee(rg,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function X4(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class $y extends id{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}Ee($y,"blotName","script"),Ee($y,"tagName",["SUB","SUP"]);class em extends Op{}Ee(em,"blotName","strike"),Ee(em,"tagName",["S","STRIKE"]);class tm extends id{}Ee(tm,"blotName","underline"),Ee(tm,"tagName","U");class Z0 extends Nm{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}Ee(Z0,"blotName","formula"),Ee(Z0,"className","ql-formula"),Ee(Z0,"tagName","SPAN");const rw=["alt","height","width"];var z0;let uN=(z0=class extends zf{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return rw.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return X4(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){rw.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},Ee(z0,"blotName","image"),Ee(z0,"tagName","IMG"),z0);const iw=["height","width"];class X0 extends gh{static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return iw.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return rg.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){iw.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}Ee(X0,"blotName","video"),Ee(X0,"className","ql-video"),Ee(X0,"tagName","IFRAME");const bp=new Bh("code-token","hljs",{scope:Kn.INLINE});class Rd extends id{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(au.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),bp.add(this.domNode,r)}format(e,t){e!==Rd.blotName?super.format(e,t):t?bp.add(this.domNode,t):(bp.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),bp.value(this.domNode)||this.unwrap()}}Rd.blotName="code-token";Rd.className="ql-token";class dh extends au{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Rd.blotName,!1),super.replaceWith(e,t)}}class mp extends Yg{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===dh.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,i){r===dh.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,i)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(`
325
+ `);r=r.firstChild}}}return e}function qD(n,e,t){var o;const r={},i=n.style||{};return i.fontStyle==="italic"&&(r.italic=!0),i.textDecoration==="underline"&&(r.underline=!0),i.textDecoration==="line-through"&&(r.strike=!0),((o=i.fontWeight)!=null&&o.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((l,a)=>{let[h,g]=a;return Vg(l,h,g,t)},e),parseFloat(i.textIndent||0)>0?new Xn().insert(" ").concat(e):e}function jD(n,e,t){var i,o;const r=((i=n.parentElement)==null?void 0:i.tagName)==="TABLE"?n.parentElement:(o=n.parentElement)==null?void 0:o.parentElement;if(r!=null){const a=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Vg(e,"table",a,t)}return e}function $D(n,e,t){var i;let r=n.data;if(((i=n.parentElement)==null?void 0:i.tagName)==="O:P")return e.insert(r.trim());if(!Y4(n)){if(r.trim().length===0&&r.includes(`
326
+ `)&&!GD(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&ng(n.parentElement,t)||n.previousSibling instanceof Element&&ng(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&ng(n.parentElement,t)||n.nextSibling instanceof Element&&ng(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class V4 extends Hh{constructor(t,r){super(t,r);Ee(this,"lastRecorded",0);Ee(this,"ignoreChange",!1);Ee(this,"stack",{undo:[],redo:[]});Ee(this,"currentRange",null);this.quill.on(Xe.events.EDITOR_CHANGE,(i,o,l,a)=>{i===Xe.events.SELECTION_CHANGE?o&&a!==Xe.sources.SILENT&&(this.currentRange=o):i===Xe.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===Xe.sources.USER?this.record(o,l):this.transform(o)),this.currentRange=Jy(this.currentRange,o))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",i=>{i.inputType==="historyUndo"?(this.undo(),i.preventDefault()):i.inputType==="historyRedo"&&(this.redo(),i.preventDefault())})}change(t,r){if(this.stack[t].length===0)return;const i=this.stack[t].pop();if(!i)return;const o=this.quill.getContents(),l=i.delta.invert(o);this.stack[r].push({delta:l,range:Jy(i.range,l)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i.delta,Xe.sources.USER),this.ignoreChange=!1,this.restoreSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,r){if(t.ops.length===0)return;this.stack.redo=[];let i=t.invert(r),o=this.currentRange;const l=Date.now();if(this.lastRecorded+this.options.delay>l&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(i=i.compose(a.delta),o=a.range)}else this.lastRecorded=l;i.length()!==0&&(this.stack.undo.push({delta:i,range:o}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){nw(this.stack.undo,t),nw(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,Xe.sources.USER);else{const r=tN(this.quill.scroll,t.delta);this.quill.setSelection(r,Xe.sources.USER)}}}Ee(V4,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function nw(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const i=n[r];n[r]={delta:t.transform(i.delta,!0),range:i.range&&Jy(i.range,t)},t=i.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function eN(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
327
+ `):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,Kn.BLOCK)!=null):!1}function tN(n,e){const t=e.reduce((i,o)=>i+(o.delete||0),0);let r=e.length()-t;return eN(n,e)&&(r-=1),r}function Jy(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class Z4 extends Hh{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{var l;r.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);i=document.createRange(),i.setStart(a.offsetNode,a.offset),i.setEnd(a.offsetNode,a.offset)}const o=i&&e.selection.normalizeNative(i);if(o){const a=e.selection.normalizedToRange(o);(l=r.dataTransfer)!=null&&l.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(i=>{var o;i&&((o=this.options.mimetypes)!=null&&o.includes(i.type))&&r.push(i)}),r.length>0&&this.options.handler.call(this,e,r)}}Z4.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(i=>{const o=new FileReader;o.onload=()=>{i(o.result)},o.readAsDataURL(r)}));Promise.all(t).then(r=>{const i=r.reduce((o,l)=>o.insert({image:l}),new Xn().retain(n.index).delete(n.length));this.quill.updateContents(i,Hn.sources.USER),this.quill.setSelection(n.index+r.length,Hn.sources.SILENT)})}};const nN=["insertText","insertReplacementText"];class rN extends Hh{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(Xe.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Um({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new Xn().retain(e.index).insert(t,r),Xe.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,Xe.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!nN.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=iN(e);if(r==null)return;const i=this.quill.selection.normalizeNative(t),o=i?this.quill.selection.normalizedToRange(i):null;o&&this.replaceText(o,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function iN(n){var e;return typeof n.data=="string"?n.data:(e=n.dataTransfer)!=null&&e.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const oN=/Mac/i.test(navigator.platform),lN=100,sN=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||oN&&n.key==="a"&&n.ctrlKey===!0);class aN extends Hh{constructor(t,r){super(t,r);Ee(this,"isListening",!1);Ee(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,r){let{line:i,event:o}=r;if(!(i instanceof Lh)||!i.uiNode)return!0;const l=getComputedStyle(i.domNode).direction==="rtl";return l&&o.key!=="ArrowRight"||!l&&o.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(o.shiftKey?1:0),Xe.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&sN(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+lN,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const r=t.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const i=this.quill.scroll.find(r.startContainer);if(!(i instanceof Lh)||!i.uiNode)return;const o=document.createRange();o.setStartAfter(i.uiNode),o.setEndAfter(i.uiNode),t.removeAllRanges(),t.addRange(o)}}Xe.register({"blots/block":kc,"blots/block/embed":gh,"blots/break":zh,"blots/container":Gg,"blots/cursor":S1,"blots/embed":Nm,"blots/inline":id,"blots/scroll":s1,"blots/text":Ph,"modules/clipboard":UD,"modules/history":V4,"modules/keyboard":U4,"modules/uploader":Z4,"modules/input":rN,"modules/uiNode":aN});class cN extends Bh{add(e,t){let r=0;if(t==="+1"||t==="-1"){const i=this.value(e)||0;r=t==="+1"?i+1:i-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const uN=new cN("indent","ql-indent",{scope:Kn.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Qy extends kc{}Ee(Qy,"blotName","blockquote"),Ee(Qy,"tagName","blockquote");class qy extends kc{static formats(e){return this.tagName.indexOf(e.tagName)+1}}Ee(qy,"blotName","header"),Ee(qy,"tagName",["H1","H2","H3","H4","H5","H6"]);class Gp extends Gg{}Gp.blotName="list-container";Gp.tagName="OL";class Yp extends kc{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){Xe.register(Gp)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),i=o=>{if(!e.isEnabled())return;const l=this.statics.formats(t,e);l==="checked"?(this.format("list","unchecked"),o.preventDefault()):l==="unchecked"&&(this.format("list","checked"),o.preventDefault())};r.addEventListener("mousedown",i),r.addEventListener("touchstart",i),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Yp.blotName="list";Yp.tagName="LI";Gp.allowedChildren=[Yp];Yp.requiredContainer=Gp;class Op extends id{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}Ee(Op,"blotName","bold"),Ee(Op,"tagName",["STRONG","B"]);class jy extends Op{}Ee(jy,"blotName","italic"),Ee(jy,"tagName",["EM","I"]);class rg extends id{static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return X4(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}Ee(rg,"blotName","link"),Ee(rg,"tagName","A"),Ee(rg,"SANITIZED_URL","about:blank"),Ee(rg,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function X4(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class $y extends id{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}Ee($y,"blotName","script"),Ee($y,"tagName",["SUB","SUP"]);class em extends Op{}Ee(em,"blotName","strike"),Ee(em,"tagName",["S","STRIKE"]);class tm extends id{}Ee(tm,"blotName","underline"),Ee(tm,"tagName","U");class Z0 extends Nm{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}Ee(Z0,"blotName","formula"),Ee(Z0,"className","ql-formula"),Ee(Z0,"tagName","SPAN");const rw=["alt","height","width"];var z0;let fN=(z0=class extends zf{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return rw.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return X4(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){rw.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},Ee(z0,"blotName","image"),Ee(z0,"tagName","IMG"),z0);const iw=["height","width"];class X0 extends gh{static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return iw.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return rg.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){iw.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}Ee(X0,"blotName","video"),Ee(X0,"className","ql-video"),Ee(X0,"tagName","IFRAME");const bp=new Bh("code-token","hljs",{scope:Kn.INLINE});class Rd extends id{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(au.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),bp.add(this.domNode,r)}format(e,t){e!==Rd.blotName?super.format(e,t):t?bp.add(this.domNode,t):(bp.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),bp.value(this.domNode)||this.unwrap()}}Rd.blotName="code-token";Rd.className="ql-token";class dh extends au{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Rd.blotName,!1),super.replaceWith(e,t)}}class mp extends Yg{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===dh.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,i){r===dh.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,i)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(`
328
328
  `)}
329
329
  `,o=dh.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==i){if(i.trim().length>0||this.cachedText==null){const l=this.children.reduce((h,g)=>h.concat(I4(g,!1)),new Xn),a=e(i,o);l.diff(a).reduce((h,g)=>{let{retain:m,attributes:x}=g;return m?(x&&Object.keys(x).forEach(w=>{[dh.blotName,Rd.blotName].includes(w)&&this.formatAt(h,m,w,x[w])}),h+m):h},0)}this.cachedText=i,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?dh.formats(r.domNode):"plain"}">
330
330
  ${Lv(this.code(e,t))}
331
- </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=dh.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}mp.allowedChildren=[dh];dh.requiredContainer=mp;dh.allowedChildren=[Rd,S1,Ph,zh];const fN=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class K4 extends Hh{static register(){Xe.register(Rd,!0),Xe.register(dh,!0),Xe.register(mp,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,i)=>{let{key:o}=i;return r[o]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Xe.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof mp))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:i,label:o}=r;const l=t.ownerDocument.createElement("option");l.textContent=o,l.setAttribute("value",i),t.appendChild(l)}),t.addEventListener("change",()=>{e.format(dh.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=dh.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(Xe.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(Xe.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(mp):[e]).forEach(o=>{o.highlight(this.highlightBlot,t)}),this.quill.update(Xe.sources.SILENT),r!=null&&this.quill.setSelection(r,Xe.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return Lv(e).split(`
331
+ </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=dh.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}mp.allowedChildren=[dh];dh.requiredContainer=mp;dh.allowedChildren=[Rd,S1,Ph,zh];const hN=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class K4 extends Hh{static register(){Xe.register(Rd,!0),Xe.register(dh,!0),Xe.register(mp,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,i)=>{let{key:o}=i;return r[o]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Xe.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof mp))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:i,label:o}=r;const l=t.ownerDocument.createElement("option");l.textContent=o,l.setAttribute("value",i),t.appendChild(l)}),t.addEventListener("change",()=>{e.format(dh.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=dh.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(Xe.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(Xe.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(mp):[e]).forEach(o=>{o.highlight(this.highlightBlot,t)}),this.quill.update(Xe.sources.SILENT),r!=null&&this.quill.setSelection(r,Xe.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return Lv(e).split(`
332
332
  `).reduce((i,o,l)=>(l!==0&&i.insert(`
333
- `,{[au.blotName]:t}),i.insert(o)),new Xn);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(au.className),r.innerHTML=fN(this.options.hljs,t,e),Gm(this.quill.scroll,r,[(i,o)=>{const l=bp.value(i);return l?o.compose(new Xn().retain(o.length(),{[Rd.blotName]:l})):o}],[(i,o)=>i.data.split(`
333
+ `,{[au.blotName]:t}),i.insert(o)),new Xn);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(au.className),r.innerHTML=hN(this.options.hljs,t,e),Gm(this.quill.scroll,r,[(i,o)=>{const l=bp.value(i);return l?o.compose(new Xn().retain(o.length(),{[Rd.blotName]:l})):o}],[(i,o)=>i.data.split(`
334
334
  `).reduce((l,a,h)=>(h!==0&&l.insert(`
335
- `,{[au.blotName]:t}),l.insert(a)),o)],new WeakMap)}}K4.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Sp=class Sp extends kc{static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Ym()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Sp.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};Ee(Sp,"blotName","table"),Ee(Sp,"tagName","TD");let Mh=Sp;class Id extends Gg{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),i=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===i.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),i=t.next.formats();if(r.table!==i.table){const o=this.splitAfter(t);o&&o.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}Ee(Id,"blotName","table-row"),Ee(Id,"tagName","TR");class ed extends Gg{}Ee(ed,"blotName","table-body"),Ee(ed,"tagName","TBODY");class T1 extends Gg{balanceCells(){const e=this.descendants(Id),t=e.reduce((r,i)=>Math.max(i.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let i;r.children.head!=null&&(i=Mh.formats(r.children.head.domNode));const o=this.scroll.create(Mh.blotName,i);r.appendChild(o),o.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(ed);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e);i!=null&&i.remove()})}insertColumn(e){const[t]=this.descendant(ed);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e),o=Mh.formats(r.children.head.domNode),l=this.scroll.create(Mh.blotName,o);r.insertBefore(l,i)})}insertRow(e){const[t]=this.descendant(ed);if(t==null||t.children.head==null)return;const r=Ym(),i=this.scroll.create(Id.blotName);t.children.head.children.forEach(()=>{const l=this.scroll.create(Mh.blotName,r);i.appendChild(l)});const o=t.children.at(e);t.insertBefore(i,o)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}Ee(T1,"blotName","table-container"),Ee(T1,"tagName","TABLE");T1.allowedChildren=[ed];ed.requiredContainer=T1;ed.allowedChildren=[Id];Id.requiredContainer=ed;Id.allowedChildren=[Mh];Mh.requiredContainer=Id;function Ym(){return`row-${Math.random().toString(36).slice(2,6)}`}class hN extends Hh{static register(){Xe.register(Mh),Xe.register(Id),Xe.register(ed),Xe.register(T1)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(T1).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(Xe.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(Xe.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(Xe.sources.USER),this.quill.setSelection(t,Xe.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==Mh.blotName)return[null,null,null,-1];const i=t.parent;return[i.parent.parent,i,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,i,o]=this.getTable(t);if(o==null)return;const l=o.cellOffset();r.insertColumn(l+e),this.quill.update(Xe.sources.USER);let a=i.rowOffset();e===0&&(a+=1),this.quill.setSelection(t.index+a,t.length,Xe.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,i,o]=this.getTable(t);if(o==null)return;const l=i.rowOffset();r.insertRow(l+e),this.quill.update(Xe.sources.USER),e>0?this.quill.setSelection(t,Xe.sources.SILENT):this.quill.setSelection(t.index+i.children.length,t.length,Xe.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const i=new Array(e).fill(0).reduce(o=>{const l=new Array(t).fill(`
336
- `).join("");return o.insert(l,{table:Ym()})},new Xn().retain(r.index));this.quill.updateContents(i,Xe.sources.USER),this.quill.setSelection(r.index,Xe.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Xe.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(Xe.events.TEXT_CHANGE,(r,i,o)=>{o===Xe.sources.USER&&this.balanceTables()}),!0):!1)})}}const ow=Md("quill:toolbar");let Vm=class extends Hh{constructor(e,t){var r,i;if(super(e,t),Array.isArray(this.options.container)){const o=document.createElement("div");o.setAttribute("role","toolbar"),dN(o,this.options.container),(i=(r=e.container)==null?void 0:r.parentNode)==null||i.insertBefore(o,e.container),this.container=o}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){ow.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(o=>{var a;const l=(a=this.options.handlers)==null?void 0:a[o];l&&this.addHandler(o,l)}),Array.from(this.container.querySelectorAll("button, select")).forEach(o=>{this.attach(o)}),this.quill.on(Xe.events.EDITOR_CHANGE,()=>{const[o]=this.quill.selection.getRange();this.update(o)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(i=>i.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){ow.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,i=>{let o;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const a=e.options[e.selectedIndex];a.hasAttribute("selected")?o=!1:o=a.value||!1}else e.classList.contains("ql-active")?o=!1:o=e.value||!e.hasAttribute("value"),i.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,o);else if(this.quill.scroll.query(t).prototype instanceof zf){if(o=prompt(`Enter ${t}`),!o)return;this.quill.updateContents(new Xn().retain(l.index).delete(l.length).insert({[t]:o}),Xe.sources.USER)}else this.quill.format(t,o,Xe.sources.USER);this.update(l)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[i,o]=r;if(o.tagName==="SELECT"){let l=null;if(e==null)l=null;else if(t[i]==null)l=o.querySelector("option[selected]");else if(!Array.isArray(t[i])){let a=t[i];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),l=o.querySelector(`option[value="${a}"]`)}l==null?(o.value="",o.selectedIndex=-1):l.selected=!0}else if(e==null)o.classList.remove("ql-active"),o.setAttribute("aria-pressed","false");else if(o.hasAttribute("value")){const l=t[i],a=l===o.getAttribute("value")||l!=null&&l.toString()===o.getAttribute("value")||l==null&&!o.getAttribute("value");o.classList.toggle("ql-active",a),o.setAttribute("aria-pressed",a.toString())}else{const l=t[i]!=null;o.classList.toggle("ql-active",l),o.setAttribute("aria-pressed",l.toString())}})}};Vm.DEFAULTS={};function lw(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function dN(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(i=>{if(typeof i=="string")lw(r,i);else{const o=Object.keys(i)[0],l=i[o];Array.isArray(l)?gN(r,o,l):lw(r,o,l)}}),n.appendChild(r)})}function gN(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(i=>{const o=document.createElement("option");i!==!1?o.setAttribute("value",String(i)):o.setAttribute("selected","selected"),r.appendChild(o)}),n.appendChild(r)}Vm.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,Kn.INLINE)!=null&&this.quill.format(t,!1,Xe.sources.USER)})}else this.quill.removeFormat(n.index,n.length,Xe.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",Xe.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,Xe.sources.USER),this.quill.format("direction",n,Xe.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let i=n==="+1"?1:-1;t.direction==="rtl"&&(i*=-1),this.quill.format("indent",r+i,Xe.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,Xe.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,Xe.sources.USER):this.quill.format("list","unchecked",Xe.sources.USER):this.quill.format("list",n,Xe.sources.USER)}}};const pN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',vN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',bN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',yN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',mN='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',xN='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',wN='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',CN='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',sw='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',_N='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',SN='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',EN='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',TN='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',AN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',RN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',IN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',kN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',MN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',LN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',ON='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',PN='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',DN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',NN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',FN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',BN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',zN='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',HN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',WN='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',UN='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',GN='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',YN='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',VN='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',ZN='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Pp={align:{"":pN,center:vN,right:bN,justify:yN},background:mN,blockquote:xN,bold:wN,clean:CN,code:sw,"code-block":sw,color:_N,direction:{"":SN,rtl:EN},formula:TN,header:{1:AN,2:RN,3:IN,4:kN,5:MN,6:LN},italic:ON,image:PN,indent:{"+1":DN,"-1":NN},link:FN,list:{bullet:BN,check:zN,ordered:HN},script:{sub:WN,super:UN},strike:GN,table:YN,underline:VN,video:ZN},XN='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let aw=0;function cw(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Ov{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),cw(this.label,"aria-expanded"),cw(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",i=>{switch(i.key){case"Enter":this.selectItem(t,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=XN,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${aw}`,aw+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class J4 extends Ov{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),i=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=i:r.style.fill=i)}}class Q4 extends Ov{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const KN=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class q4{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,KN(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect();let l=0;if(o.right>i.right&&(l=i.right-o.right,this.root.style.left=`${t+l}px`),o.left<i.left&&(l=i.left-o.left,this.root.style.left=`${t+l}px`),o.bottom>i.bottom){const a=o.bottom-o.top,h=e.bottom-e.top+a;this.root.style.top=`${r-h}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const JN=[!1,"center","right","justify"],QN=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],qN=[!1,"serif","monospace"],jN=["1","2","3",!1],$N=["small",!1,"large","huge"];class Vp extends E1{constructor(e,t){super(e,t);const r=i=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(o=>{o.container.contains(i.target)||o.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(o=>{if(o.startsWith("ql-")&&(o=o.slice(3),t[o]!=null))if(o==="direction")r.innerHTML=t[o][""]+t[o].rtl;else if(typeof t[o]=="string")r.innerHTML=t[o];else{const l=r.value||"";l!=null&&t[o][l]&&(r.innerHTML=t[o][l])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&sp(i,JN),typeof t.align=="object"))return new Q4(i,t.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const o=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&sp(i,QN,o==="background"?"#ffffff":"#000000"),new J4(i,t[o])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?sp(i,qN):i.classList.contains("ql-header")?sp(i,jN):i.classList.contains("ql-size")&&sp(i,$N)),new Ov(i)});const r=()=>{this.pickers.forEach(i=>{i.update()})};this.quill.on(Hn.events.EDITOR_CHANGE,r)}}Vp.DEFAULTS=og({},E1.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class j4 extends q4{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Hn.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Hn.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=eF(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,Hn.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Hn.sources.USER),this.quill.setSelection(r+2,Hn.sources.USER)}break}}this.textbox.value="",this.hide()}}function eF(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function sp(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const i=document.createElement("option");r===t?i.setAttribute("selected","selected"):i.setAttribute("value",String(r)),n.appendChild(i)})}const tF=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class $4 extends j4{constructor(e,t){super(e,t),this.quill.on(Hn.events.EDITOR_CHANGE,(r,i,o,l)=>{if(r===Hn.events.SELECTION_CHANGE)if(i!=null&&i.length>0&&l===Hn.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(i.index,i.length);if(a.length===1){const h=this.quill.getBounds(i);h!=null&&this.position(h)}else{const h=a[a.length-1],g=this.quill.getIndex(h),m=Math.min(h.length()-1,i.index+i.length-g),x=this.quill.getBounds(new Ng(g,m));x!=null&&this.position(x)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Hn.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}Ee($4,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class e_ extends Vp{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=tF),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new $4(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Pp),this.buildPickers(e.container.querySelectorAll("select"),Pp))}}e_.DEFAULTS=og({},Vp.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Xe.sources.USER)}}}}});const nF=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class t_ extends j4{constructor(){super(...arguments);Ee(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,Hn.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(Hn.events.SELECTION_CHANGE,(t,r,i)=>{if(t!=null){if(t.length===0&&i===Hn.sources.USER){const[o,l]=this.quill.scroll.descendant(rg,t.index);if(o!=null){this.linkRange=new Ng(t.index-l,o.length());const a=rg.formats(o.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const h=this.quill.getBounds(this.linkRange);h!=null&&this.position(h);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}Ee(t_,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class n_ extends Vp{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=nF),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Pp),this.buildPickers(e.container.querySelectorAll("select"),Pp),this.tooltip=new t_(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}n_.DEFAULTS=og({},Vp.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,Xe.sources.USER)}}}}});Xe.register({"attributors/attribute/direction":P4,"attributors/class/align":M4,"attributors/class/background":yD,"attributors/class/color":bD,"attributors/class/direction":D4,"attributors/class/font":B4,"attributors/class/size":H4,"attributors/style/align":L4,"attributors/style/background":zm,"attributors/style/color":Bm,"attributors/style/direction":N4,"attributors/style/font":z4,"attributors/style/size":W4},!0);Xe.register({"formats/align":M4,"formats/direction":D4,"formats/indent":cN,"formats/background":zm,"formats/color":Bm,"formats/font":B4,"formats/size":H4,"formats/blockquote":Qy,"formats/code-block":au,"formats/header":qy,"formats/list":Yp,"formats/bold":Op,"formats/code":Hm,"formats/italic":jy,"formats/link":rg,"formats/script":$y,"formats/strike":em,"formats/underline":tm,"formats/formula":Z0,"formats/image":uN,"formats/video":X0,"modules/syntax":K4,"modules/table":hN,"modules/toolbar":Vm,"themes/bubble":e_,"themes/snow":n_,"ui/icons":Pp,"ui/picker":Ov,"ui/icon-picker":Q4,"ui/color-picker":J4,"ui/tooltip":q4},!0);class Pv extends B.Component{constructor(e){super(e),this.editingAreaRef=B.createRef(),this.containerRef=B.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],this.state={generation:0},this.selection=null,this.onEditorChange=(r,i,o,l)=>{var a,h;r==="text-change"?(a=this.onEditorChangeText)==null||a.call(this,this.editor.root.innerHTML,i,l,this.unprivilegedEditor):r==="selection-change"&&((h=this.onEditorChangeSelection)==null||h.call(this,i,l,this.unprivilegedEditor))};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(B.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(B.Children.count(e.children)){const t=B.Children.only(e.children);if((t==null?void 0:t.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){const r=this.getEditorContents(),i=e.value??"";this.isEqualValue(i,r)||this.setEditorContents(this.editor,i)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(r=>!$d(e[r],this.props[r]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!$d(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){const r=this.editor.getContents(),i=this.editor.getSelection();this.regenerationSnapshot={delta:r,selection:i},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){const{delta:r,selection:i}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const o=this.editor;o.setContents(r),uw(()=>this.setEditorSelection(o,i))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){var r,i;if(!this.editor)return;this.unhookEditor(this.editor);const e=(r=this.props.modules)==null?void 0:r.toolbar;if(!(typeof e=="object"&&e&&"container"in e&&typeof e.container=="string"||typeof e=="string")){const o=(i=this.containerRef.current)==null?void 0:i.querySelector(".ql-toolbar");o&&o.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(e,t){const r=new Xe(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(r,t.tabIndex),this.hookEditor(r),r}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)}unhookEditor(e){e.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?$d(e.ops,t.ops):$d(e,t)}setEditorContents(e,t){this.value=t;const r=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),uw(()=>this.setEditorSelection(e,r))}setEditorSelection(e,t){if(this.selection=t,t){const r=e.getLength();t.index=Math.max(0,Math.min(t.index,r-1)),t.length=Math.max(0,Math.min(t.length,r-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){var r;(r=e==null?void 0:e.scroll)!=null&&r.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){const t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){const e=this.editingAreaRef.current;if(!e)throw new Error("Cannot find element for editing area");if(e.nodeType===3)throw new Error("Editing area cannot be a text node");return e}renderEditingArea(){const{children:e,preserveWhitespace:t}=this.props,{generation:r}=this.state,i={key:r,ref:this.editingAreaRef};return B.Children.count(e)?B.cloneElement(B.Children.only(e),i):t?B.createElement("pre",{...i}):B.createElement("div",{...i})}render(){return B.createElement("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,key:this.state.generation,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())}onEditorChangeText(e,t,r,i){var l,a;if(!this.editor)return;const o=this.isDelta(this.value)?i.getContents():i.getHTML();o!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=o,(a=(l=this.props).onChange)==null||a.call(l,e,t,r,i))}onEditorChangeSelection(e,t,r){var a,h,g,m,x,w;if(!this.editor)return;const i=this.getEditorSelection(),o=!i&&e,l=i&&!e;$d(e,i)||(this.selection=e,(h=(a=this.props).onChangeSelection)==null||h.call(a,e,t,r),o?(m=(g=this.props).onFocus)==null||m.call(g,e,t,r):l&&((w=(x=this.props).onBlur)==null||w.call(x,i,t,r)))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}Pv.displayName="React Quill";Pv.Quill=Xe;Pv.defaultProps={theme:"snow",modules:{},readOnly:!1};function uw(n){Promise.resolve().then(n)}class r_{constructor(e,t={}){Ee(this,"quill");Ee(this,"options");Ee(this,"_toolbarEl",null);Ee(this,"_button",null);Ee(this,"_resizeObserver",null);Ee(this,"_placeholder",null);if(this.quill=e,this.options=t,this.options.type==="Raw")return;if(this.options.type==="ReadOnly"){this._createButton();return}const r=e.getModule("toolbar");if(!r){console.warn("Toolbar module not found");return}if(this._toolbarEl=r.container,!this._toolbarEl){console.warn("Toolbar container not found");return}this._createButton()}_createButton(){switch(this.options.type){case"ReadOnly":this._createReadOnlyButton();break;case"Error":case"Primary":this._createToolbarButton();break}}_createToolbarButton(){this._toolbarEl&&(!this.options.maximize||!this.options.minimize||(this._button=document.createElement("button"),this._button.type="button",this._button.classList.add("ql-fullscreen","ql-right-action"),this._button.onclick=this._toggleFullscreen.bind(this),this._button.innerHTML=this.options.maximize??"",this._button.title=this.options.buttonTitle||"",this._toolbarEl.classList.add("ql-toolbar-has-right-action"),this._toolbarEl.append(this._button)))}_createReadOnlyButton(){var r;const e=(r=this.quill.root)==null?void 0:r.closest(".ql-container");if(!e||!this.options.maximize||!this.options.minimize)return;this._button=document.createElement("button"),this._button.type="button",this._button.classList.add("ql-fullscreen","ql-readonly-fullscreen"),this._button.onclick=this._toggleFullscreen.bind(this),this._button.innerHTML=this.options.maximize??"",this._button.title=this.options.buttonTitle||"",e.appendChild(this._button),this._checkScrollbar(),requestAnimationFrame(()=>this._checkScrollbar());const t=this.quill.root;this._resizeObserver=new ResizeObserver(()=>this._checkScrollbar()),this._resizeObserver.observe(t)}_checkScrollbar(){const e=this.quill.root,t=e==null?void 0:e.closest(".ql-container");if(!e||!t||!this._button)return;e.scrollHeight>e.clientHeight?(t.classList.add("ql-has-v-scrollbar"),this._button.style.removeProperty("right")):(t.classList.remove("ql-has-v-scrollbar"),this._button.style.removeProperty("right"))}_toggleFullscreen(e){var o,l;e.preventDefault();const t=(o=this.quill.root)==null?void 0:o.closest(".ql-container");if(!t)throw new Error("Quill editor container not exist");let r=t.closest(".ql-editor-wrap");if(r){if(t instanceof HTMLElement&&(t.classList.remove("is-fullscreen"),t.style.height=""),this._placeholder){const a=t.parentElement;this._placeholder.after(a),this._placeholder.remove(),this._placeholder=null}r.remove(),this._button&&(this._button.classList.remove("ql-active"),this._button.innerHTML=this.options.maximize??""),document.documentElement.style.removeProperty("overflow");return}if(r=document.createElement("div"),r.classList.add("ql-editor-wrap"),t instanceof HTMLElement){const a=((l=this._toolbarEl)==null?void 0:l.offsetHeight)||0;t.style.height=`calc(100% - ${a}px)`,t.classList.add("is-fullscreen")}const i=t.parentElement;this._placeholder=document.createComment("ql-fullscreen-placeholder"),i.after(this._placeholder),r.append(i),document.body.append(r),this._button&&(this._button.classList.add("ql-active"),this._button.innerHTML=this.options.minimize??""),document.documentElement.style.overflow="hidden"}}window.QuillToggleFullscreenButton=r_;var Ib={exports:{}},fw;function rF(){return fw||(fw=1,(function(n,e){(function(t,r){n.exports=r()})(window,(function(){return(function(t){var r={};function i(o){if(r[o])return r[o].exports;var l=r[o]={i:o,l:!1,exports:{}};return t[o].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=t,i.c=r,i.d=function(o,l,a){i.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:a})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,l){if(1&l&&(o=i(o)),8&l||4&l&&typeof o=="object"&&o&&o.__esModule)return o;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:o}),2&l&&typeof o!="string")for(var h in o)i.d(a,h,(function(g){return o[g]}).bind(null,h));return a},i.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(l,"a",l),l},i.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},i.p="",i(i.s=17)})([function(t,r,i){var o=i(7),l=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",a=Object.prototype.toString,h=Array.prototype.concat,g=Object.defineProperty,m=i(25)(),x=g&&m,w=function(S,R,k,O){var P;(!(R in S)||typeof(P=O)=="function"&&a.call(P)==="[object Function]"&&O())&&(x?g(S,R,{configurable:!0,enumerable:!1,value:k,writable:!0}):S[R]=k)},_=function(S,R){var k=arguments.length>2?arguments[2]:{},O=o(R);l&&(O=h.call(O,Object.getOwnPropertySymbols(R)));for(var P=0;P<O.length;P+=1)w(S,O[P],R[O[P]],k[O[P]])};_.supportsDescriptors=!!x,t.exports=_},function(t,r,i){var o=i(9);t.exports=function(){return o()&&!!Symbol.toStringTag}},function(t,r,i){var o=SyntaxError,l=Function,a=TypeError,h=function(ne){try{return l('"use strict"; return ('+ne+").constructor;")()}catch{}},g=Object.getOwnPropertyDescriptor;if(g)try{g({},"")}catch{g=null}var m=function(){throw new a},x=g?(function(){try{return m}catch{try{return g(arguments,"callee").get}catch{return m}}})():m,w=i(21)(),_=Object.getPrototypeOf||function(ne){return ne.__proto__},S={},R=typeof Uint8Array>"u"?void 0:_(Uint8Array),k={"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":w?_([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":S,"%AsyncGenerator%":S,"%AsyncGeneratorFunction%":S,"%AsyncIteratorPrototype%":S,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":S,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w?_(_([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&w?_(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&w?_(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w?_(""[Symbol.iterator]()):void 0,"%Symbol%":w?Symbol:void 0,"%SyntaxError%":o,"%ThrowTypeError%":x,"%TypedArray%":R,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet},O={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=i(3),z=i(23),H=P.call(Function.call,Array.prototype.concat),G=P.call(Function.apply,Array.prototype.splice),N=P.call(Function.call,String.prototype.replace),J=P.call(Function.call,String.prototype.slice),Y=P.call(Function.call,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fe=/\\(\\)?/g,X=function(ne){var ue=J(ne,0,1),se=J(ne,-1);if(ue==="%"&&se!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(se==="%"&&ue!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var $=[];return N(ne,K,(function(re,ge,me,oe){$[$.length]=me?N(oe,fe,"$1"):ge||re})),$},te=function(ne,ue){var se,$=ne;if(z(O,$)&&($="%"+(se=O[$])[0]+"%"),z(k,$)){var re=k[$];if(re===S&&(re=(function ge(me){var oe;if(me==="%AsyncFunction%")oe=h("async function () {}");else if(me==="%GeneratorFunction%")oe=h("function* () {}");else if(me==="%AsyncGeneratorFunction%")oe=h("async function* () {}");else if(me==="%AsyncGenerator%"){var Q=ge("%AsyncGeneratorFunction%");Q&&(oe=Q.prototype)}else if(me==="%AsyncIteratorPrototype%"){var pe=ge("%AsyncGenerator%");pe&&(oe=_(pe.prototype))}return k[me]=oe,oe})($)),re===void 0&&!ue)throw new a("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:se,name:$,value:re}}throw new o("intrinsic "+ne+" does not exist!")};t.exports=function(ne,ue){if(typeof ne!="string"||ne.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ue!="boolean")throw new a('"allowMissing" argument must be a boolean');if(Y(/^%?[^%]*%?$/g,ne)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var se=X(ne),$=se.length>0?se[0]:"",re=te("%"+$+"%",ue),ge=re.name,me=re.value,oe=!1,Q=re.alias;Q&&($=Q[0],G(se,H([0,1],Q)));for(var pe=1,Ie=!0;pe<se.length;pe+=1){var Fe=se[pe],xe=J(Fe,0,1),Oe=J(Fe,-1);if((xe==='"'||xe==="'"||xe==="`"||Oe==='"'||Oe==="'"||Oe==="`")&&xe!==Oe)throw new o("property names with quotes must have matching quotes");if(Fe!=="constructor"&&Ie||(oe=!0),z(k,ge="%"+($+="."+Fe)+"%"))me=k[ge];else if(me!=null){if(!(Fe in me)){if(!ue)throw new a("base intrinsic for "+ne+" exists, but the property is not available.");return}if(g&&pe+1>=se.length){var Le=g(me,Fe);me=(Ie=!!Le)&&"get"in Le&&!("originalValue"in Le.get)?Le.get:me[Fe]}else Ie=z(me,Fe),me=me[Fe];Ie&&!oe&&(k[ge]=me)}}return me}},function(t,r,i){var o=i(22);t.exports=Function.prototype.bind||o},function(t,r,i){var o=i(3),l=i(2),a=l("%Function.prototype.apply%"),h=l("%Function.prototype.call%"),g=l("%Reflect.apply%",!0)||o.call(h,a),m=l("%Object.getOwnPropertyDescriptor%",!0),x=l("%Object.defineProperty%",!0),w=l("%Math.max%");if(x)try{x({},"a",{value:1})}catch{x=null}t.exports=function(S){var R=g(o,h,arguments);if(m&&x){var k=m(R,"length");k.configurable&&x(R,"length",{value:1+w(0,S.length-(arguments.length-1))})}return R};var _=function(){return g(o,a,arguments)};x?x(t.exports,"apply",{value:_}):t.exports.apply=_},function(t,r,i){var o=i(18),l=i(6),a=i(15),h=i(32),g="\0",m=function(x){Array.isArray(x)?this.ops=x:x!=null&&Array.isArray(x.ops)?this.ops=x.ops:this.ops=[]};m.prototype.insert=function(x,w){var _={};return x.length===0?this:(_.insert=x,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(_.attributes=w),this.push(_))},m.prototype.delete=function(x){return x<=0?this:this.push({delete:x})},m.prototype.retain=function(x,w){if(x<=0)return this;var _={retain:x};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(_.attributes=w),this.push(_)},m.prototype.push=function(x){var w=this.ops.length,_=this.ops[w-1];if(x=a(!0,{},x),typeof _=="object"){if(typeof x.delete=="number"&&typeof _.delete=="number")return this.ops[w-1]={delete:_.delete+x.delete},this;if(typeof _.delete=="number"&&x.insert!=null&&(w-=1,typeof(_=this.ops[w-1])!="object"))return this.ops.unshift(x),this;if(l(x.attributes,_.attributes)){if(typeof x.insert=="string"&&typeof _.insert=="string")return this.ops[w-1]={insert:_.insert+x.insert},typeof x.attributes=="object"&&(this.ops[w-1].attributes=x.attributes),this;if(typeof x.retain=="number"&&typeof _.retain=="number")return this.ops[w-1]={retain:_.retain+x.retain},typeof x.attributes=="object"&&(this.ops[w-1].attributes=x.attributes),this}}return w===this.ops.length?this.ops.push(x):this.ops.splice(w,0,x),this},m.prototype.chop=function(){var x=this.ops[this.ops.length-1];return x&&x.retain&&!x.attributes&&this.ops.pop(),this},m.prototype.filter=function(x){return this.ops.filter(x)},m.prototype.forEach=function(x){this.ops.forEach(x)},m.prototype.map=function(x){return this.ops.map(x)},m.prototype.partition=function(x){var w=[],_=[];return this.forEach((function(S){(x(S)?w:_).push(S)})),[w,_]},m.prototype.reduce=function(x,w){return this.ops.reduce(x,w)},m.prototype.changeLength=function(){return this.reduce((function(x,w){return w.insert?x+h.length(w):w.delete?x-w.delete:x}),0)},m.prototype.length=function(){return this.reduce((function(x,w){return x+h.length(w)}),0)},m.prototype.slice=function(x,w){x=x||0,typeof w!="number"&&(w=1/0);for(var _=[],S=h.iterator(this.ops),R=0;R<w&&S.hasNext();){var k;R<x?k=S.next(x-R):(k=S.next(w-R),_.push(k)),R+=h.length(k)}return new m(_)},m.prototype.compose=function(x){var w=h.iterator(this.ops),_=h.iterator(x.ops),S=[],R=_.peek();if(R!=null&&typeof R.retain=="number"&&R.attributes==null){for(var k=R.retain;w.peekType()==="insert"&&w.peekLength()<=k;)k-=w.peekLength(),S.push(w.next());R.retain-k>0&&_.next(R.retain-k)}for(var O=new m(S);w.hasNext()||_.hasNext();)if(_.peekType()==="insert")O.push(_.next());else if(w.peekType()==="delete")O.push(w.next());else{var P=Math.min(w.peekLength(),_.peekLength()),z=w.next(P),H=_.next(P);if(typeof H.retain=="number"){var G={};typeof z.retain=="number"?G.retain=P:G.insert=z.insert;var N=h.attributes.compose(z.attributes,H.attributes,typeof z.retain=="number");if(N&&(G.attributes=N),O.push(G),!_.hasNext()&&l(O.ops[O.ops.length-1],G)){var J=new m(w.rest());return O.concat(J).chop()}}else typeof H.delete=="number"&&typeof z.retain=="number"&&O.push(H)}return O.chop()},m.prototype.concat=function(x){var w=new m(this.ops.slice());return x.ops.length>0&&(w.push(x.ops[0]),w.ops=w.ops.concat(x.ops.slice(1))),w},m.prototype.diff=function(x,w){if(this.ops===x.ops)return new m;var _=[this,x].map((function(P){return P.map((function(z){if(z.insert!=null)return typeof z.insert=="string"?z.insert:g;throw new Error("diff() called "+(P===x?"on":"with")+" non-document")})).join("")})),S=new m,R=o(_[0],_[1],w),k=h.iterator(this.ops),O=h.iterator(x.ops);return R.forEach((function(P){for(var z=P[1].length;z>0;){var H=0;switch(P[0]){case o.INSERT:H=Math.min(O.peekLength(),z),S.push(O.next(H));break;case o.DELETE:H=Math.min(z,k.peekLength()),k.next(H),S.delete(H);break;case o.EQUAL:H=Math.min(k.peekLength(),O.peekLength(),z);var G=k.next(H),N=O.next(H);l(G.insert,N.insert)?S.retain(H,h.attributes.diff(G.attributes,N.attributes)):S.push(N).delete(H)}z-=H}})),S.chop()},m.prototype.eachLine=function(x,w){w=w||`
335
+ `,{[au.blotName]:t}),l.insert(a)),o)],new WeakMap)}}K4.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Sp=class Sp extends kc{static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Ym()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Sp.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};Ee(Sp,"blotName","table"),Ee(Sp,"tagName","TD");let Mh=Sp;class Id extends Gg{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),i=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===i.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),i=t.next.formats();if(r.table!==i.table){const o=this.splitAfter(t);o&&o.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}Ee(Id,"blotName","table-row"),Ee(Id,"tagName","TR");class ed extends Gg{}Ee(ed,"blotName","table-body"),Ee(ed,"tagName","TBODY");class T1 extends Gg{balanceCells(){const e=this.descendants(Id),t=e.reduce((r,i)=>Math.max(i.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let i;r.children.head!=null&&(i=Mh.formats(r.children.head.domNode));const o=this.scroll.create(Mh.blotName,i);r.appendChild(o),o.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(ed);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e);i!=null&&i.remove()})}insertColumn(e){const[t]=this.descendant(ed);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e),o=Mh.formats(r.children.head.domNode),l=this.scroll.create(Mh.blotName,o);r.insertBefore(l,i)})}insertRow(e){const[t]=this.descendant(ed);if(t==null||t.children.head==null)return;const r=Ym(),i=this.scroll.create(Id.blotName);t.children.head.children.forEach(()=>{const l=this.scroll.create(Mh.blotName,r);i.appendChild(l)});const o=t.children.at(e);t.insertBefore(i,o)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}Ee(T1,"blotName","table-container"),Ee(T1,"tagName","TABLE");T1.allowedChildren=[ed];ed.requiredContainer=T1;ed.allowedChildren=[Id];Id.requiredContainer=ed;Id.allowedChildren=[Mh];Mh.requiredContainer=Id;function Ym(){return`row-${Math.random().toString(36).slice(2,6)}`}class dN extends Hh{static register(){Xe.register(Mh),Xe.register(Id),Xe.register(ed),Xe.register(T1)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(T1).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(Xe.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(Xe.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(Xe.sources.USER),this.quill.setSelection(t,Xe.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==Mh.blotName)return[null,null,null,-1];const i=t.parent;return[i.parent.parent,i,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,i,o]=this.getTable(t);if(o==null)return;const l=o.cellOffset();r.insertColumn(l+e),this.quill.update(Xe.sources.USER);let a=i.rowOffset();e===0&&(a+=1),this.quill.setSelection(t.index+a,t.length,Xe.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,i,o]=this.getTable(t);if(o==null)return;const l=i.rowOffset();r.insertRow(l+e),this.quill.update(Xe.sources.USER),e>0?this.quill.setSelection(t,Xe.sources.SILENT):this.quill.setSelection(t.index+i.children.length,t.length,Xe.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const i=new Array(e).fill(0).reduce(o=>{const l=new Array(t).fill(`
336
+ `).join("");return o.insert(l,{table:Ym()})},new Xn().retain(r.index));this.quill.updateContents(i,Xe.sources.USER),this.quill.setSelection(r.index,Xe.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Xe.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(Xe.events.TEXT_CHANGE,(r,i,o)=>{o===Xe.sources.USER&&this.balanceTables()}),!0):!1)})}}const ow=Md("quill:toolbar");let Vm=class extends Hh{constructor(e,t){var r,i;if(super(e,t),Array.isArray(this.options.container)){const o=document.createElement("div");o.setAttribute("role","toolbar"),gN(o,this.options.container),(i=(r=e.container)==null?void 0:r.parentNode)==null||i.insertBefore(o,e.container),this.container=o}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){ow.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(o=>{var a;const l=(a=this.options.handlers)==null?void 0:a[o];l&&this.addHandler(o,l)}),Array.from(this.container.querySelectorAll("button, select")).forEach(o=>{this.attach(o)}),this.quill.on(Xe.events.EDITOR_CHANGE,()=>{const[o]=this.quill.selection.getRange();this.update(o)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(i=>i.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){ow.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,i=>{let o;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const a=e.options[e.selectedIndex];a.hasAttribute("selected")?o=!1:o=a.value||!1}else e.classList.contains("ql-active")?o=!1:o=e.value||!e.hasAttribute("value"),i.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,o);else if(this.quill.scroll.query(t).prototype instanceof zf){if(o=prompt(`Enter ${t}`),!o)return;this.quill.updateContents(new Xn().retain(l.index).delete(l.length).insert({[t]:o}),Xe.sources.USER)}else this.quill.format(t,o,Xe.sources.USER);this.update(l)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[i,o]=r;if(o.tagName==="SELECT"){let l=null;if(e==null)l=null;else if(t[i]==null)l=o.querySelector("option[selected]");else if(!Array.isArray(t[i])){let a=t[i];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),l=o.querySelector(`option[value="${a}"]`)}l==null?(o.value="",o.selectedIndex=-1):l.selected=!0}else if(e==null)o.classList.remove("ql-active"),o.setAttribute("aria-pressed","false");else if(o.hasAttribute("value")){const l=t[i],a=l===o.getAttribute("value")||l!=null&&l.toString()===o.getAttribute("value")||l==null&&!o.getAttribute("value");o.classList.toggle("ql-active",a),o.setAttribute("aria-pressed",a.toString())}else{const l=t[i]!=null;o.classList.toggle("ql-active",l),o.setAttribute("aria-pressed",l.toString())}})}};Vm.DEFAULTS={};function lw(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function gN(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(i=>{if(typeof i=="string")lw(r,i);else{const o=Object.keys(i)[0],l=i[o];Array.isArray(l)?pN(r,o,l):lw(r,o,l)}}),n.appendChild(r)})}function pN(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(i=>{const o=document.createElement("option");i!==!1?o.setAttribute("value",String(i)):o.setAttribute("selected","selected"),r.appendChild(o)}),n.appendChild(r)}Vm.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,Kn.INLINE)!=null&&this.quill.format(t,!1,Xe.sources.USER)})}else this.quill.removeFormat(n.index,n.length,Xe.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",Xe.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,Xe.sources.USER),this.quill.format("direction",n,Xe.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let i=n==="+1"?1:-1;t.direction==="rtl"&&(i*=-1),this.quill.format("indent",r+i,Xe.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,Xe.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,Xe.sources.USER):this.quill.format("list","unchecked",Xe.sources.USER):this.quill.format("list",n,Xe.sources.USER)}}};const vN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',bN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',yN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',mN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',xN='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',wN='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',CN='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',_N='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',sw='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',SN='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',EN='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',TN='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',AN='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',RN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',IN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',kN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',MN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',LN='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',ON='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',PN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',DN='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',NN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',FN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',BN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',zN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',HN='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',WN='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',UN='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',GN='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',YN='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',VN='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',ZN='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',XN='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Pp={align:{"":vN,center:bN,right:yN,justify:mN},background:xN,blockquote:wN,bold:CN,clean:_N,code:sw,"code-block":sw,color:SN,direction:{"":EN,rtl:TN},formula:AN,header:{1:RN,2:IN,3:kN,4:MN,5:LN,6:ON},italic:PN,image:DN,indent:{"+1":NN,"-1":FN},link:BN,list:{bullet:zN,check:HN,ordered:WN},script:{sub:UN,super:GN},strike:YN,table:VN,underline:ZN,video:XN},KN='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let aw=0;function cw(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Ov{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),cw(this.label,"aria-expanded"),cw(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",i=>{switch(i.key){case"Enter":this.selectItem(t,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=KN,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${aw}`,aw+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class J4 extends Ov{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),i=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=i:r.style.fill=i)}}class Q4 extends Ov{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const JN=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class q4{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,JN(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect();let l=0;if(o.right>i.right&&(l=i.right-o.right,this.root.style.left=`${t+l}px`),o.left<i.left&&(l=i.left-o.left,this.root.style.left=`${t+l}px`),o.bottom>i.bottom){const a=o.bottom-o.top,h=e.bottom-e.top+a;this.root.style.top=`${r-h}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const QN=[!1,"center","right","justify"],qN=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],jN=[!1,"serif","monospace"],$N=["1","2","3",!1],eF=["small",!1,"large","huge"];class Vp extends E1{constructor(e,t){super(e,t);const r=i=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(o=>{o.container.contains(i.target)||o.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(o=>{if(o.startsWith("ql-")&&(o=o.slice(3),t[o]!=null))if(o==="direction")r.innerHTML=t[o][""]+t[o].rtl;else if(typeof t[o]=="string")r.innerHTML=t[o];else{const l=r.value||"";l!=null&&t[o][l]&&(r.innerHTML=t[o][l])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&sp(i,QN),typeof t.align=="object"))return new Q4(i,t.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const o=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&sp(i,qN,o==="background"?"#ffffff":"#000000"),new J4(i,t[o])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?sp(i,jN):i.classList.contains("ql-header")?sp(i,$N):i.classList.contains("ql-size")&&sp(i,eF)),new Ov(i)});const r=()=>{this.pickers.forEach(i=>{i.update()})};this.quill.on(Hn.events.EDITOR_CHANGE,r)}}Vp.DEFAULTS=og({},E1.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class j4 extends q4{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Hn.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Hn.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=tF(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,Hn.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Hn.sources.USER),this.quill.setSelection(r+2,Hn.sources.USER)}break}}this.textbox.value="",this.hide()}}function tF(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function sp(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const i=document.createElement("option");r===t?i.setAttribute("selected","selected"):i.setAttribute("value",String(r)),n.appendChild(i)})}const nF=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class $4 extends j4{constructor(e,t){super(e,t),this.quill.on(Hn.events.EDITOR_CHANGE,(r,i,o,l)=>{if(r===Hn.events.SELECTION_CHANGE)if(i!=null&&i.length>0&&l===Hn.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(i.index,i.length);if(a.length===1){const h=this.quill.getBounds(i);h!=null&&this.position(h)}else{const h=a[a.length-1],g=this.quill.getIndex(h),m=Math.min(h.length()-1,i.index+i.length-g),x=this.quill.getBounds(new Ng(g,m));x!=null&&this.position(x)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Hn.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}Ee($4,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class e_ extends Vp{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=nF),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new $4(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Pp),this.buildPickers(e.container.querySelectorAll("select"),Pp))}}e_.DEFAULTS=og({},Vp.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Xe.sources.USER)}}}}});const rF=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class t_ extends j4{constructor(){super(...arguments);Ee(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,Hn.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(Hn.events.SELECTION_CHANGE,(t,r,i)=>{if(t!=null){if(t.length===0&&i===Hn.sources.USER){const[o,l]=this.quill.scroll.descendant(rg,t.index);if(o!=null){this.linkRange=new Ng(t.index-l,o.length());const a=rg.formats(o.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const h=this.quill.getBounds(this.linkRange);h!=null&&this.position(h);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}Ee(t_,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class n_ extends Vp{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=rF),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Pp),this.buildPickers(e.container.querySelectorAll("select"),Pp),this.tooltip=new t_(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}n_.DEFAULTS=og({},Vp.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,Xe.sources.USER)}}}}});Xe.register({"attributors/attribute/direction":P4,"attributors/class/align":M4,"attributors/class/background":mD,"attributors/class/color":yD,"attributors/class/direction":D4,"attributors/class/font":B4,"attributors/class/size":H4,"attributors/style/align":L4,"attributors/style/background":zm,"attributors/style/color":Bm,"attributors/style/direction":N4,"attributors/style/font":z4,"attributors/style/size":W4},!0);Xe.register({"formats/align":M4,"formats/direction":D4,"formats/indent":uN,"formats/background":zm,"formats/color":Bm,"formats/font":B4,"formats/size":H4,"formats/blockquote":Qy,"formats/code-block":au,"formats/header":qy,"formats/list":Yp,"formats/bold":Op,"formats/code":Hm,"formats/italic":jy,"formats/link":rg,"formats/script":$y,"formats/strike":em,"formats/underline":tm,"formats/formula":Z0,"formats/image":fN,"formats/video":X0,"modules/syntax":K4,"modules/table":dN,"modules/toolbar":Vm,"themes/bubble":e_,"themes/snow":n_,"ui/icons":Pp,"ui/picker":Ov,"ui/icon-picker":Q4,"ui/color-picker":J4,"ui/tooltip":q4},!0);class Pv extends B.Component{constructor(e){super(e),this.editingAreaRef=B.createRef(),this.containerRef=B.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],this.state={generation:0},this.selection=null,this.onEditorChange=(r,i,o,l)=>{var a,h;r==="text-change"?(a=this.onEditorChangeText)==null||a.call(this,this.editor.root.innerHTML,i,l,this.unprivilegedEditor):r==="selection-change"&&((h=this.onEditorChangeSelection)==null||h.call(this,i,l,this.unprivilegedEditor))};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(B.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(B.Children.count(e.children)){const t=B.Children.only(e.children);if((t==null?void 0:t.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){const r=this.getEditorContents(),i=e.value??"";this.isEqualValue(i,r)||this.setEditorContents(this.editor,i)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(r=>!$d(e[r],this.props[r]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!$d(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){const r=this.editor.getContents(),i=this.editor.getSelection();this.regenerationSnapshot={delta:r,selection:i},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){const{delta:r,selection:i}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const o=this.editor;o.setContents(r),uw(()=>this.setEditorSelection(o,i))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){var r,i;if(!this.editor)return;this.unhookEditor(this.editor);const e=(r=this.props.modules)==null?void 0:r.toolbar;if(!(typeof e=="object"&&e&&"container"in e&&typeof e.container=="string"||typeof e=="string")){const o=(i=this.containerRef.current)==null?void 0:i.querySelector(".ql-toolbar");o&&o.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(e,t){const r=new Xe(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(r,t.tabIndex),this.hookEditor(r),r}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)}unhookEditor(e){e.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?$d(e.ops,t.ops):$d(e,t)}setEditorContents(e,t){this.value=t;const r=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),uw(()=>this.setEditorSelection(e,r))}setEditorSelection(e,t){if(this.selection=t,t){const r=e.getLength();t.index=Math.max(0,Math.min(t.index,r-1)),t.length=Math.max(0,Math.min(t.length,r-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){var r;(r=e==null?void 0:e.scroll)!=null&&r.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){const t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){const e=this.editingAreaRef.current;if(!e)throw new Error("Cannot find element for editing area");if(e.nodeType===3)throw new Error("Editing area cannot be a text node");return e}renderEditingArea(){const{children:e,preserveWhitespace:t}=this.props,{generation:r}=this.state,i={key:r,ref:this.editingAreaRef};return B.Children.count(e)?B.cloneElement(B.Children.only(e),i):t?B.createElement("pre",{...i}):B.createElement("div",{...i})}render(){return B.createElement("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,key:this.state.generation,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())}onEditorChangeText(e,t,r,i){var l,a;if(!this.editor)return;const o=this.isDelta(this.value)?i.getContents():i.getHTML();o!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=o,(a=(l=this.props).onChange)==null||a.call(l,e,t,r,i))}onEditorChangeSelection(e,t,r){var a,h,g,m,x,w;if(!this.editor)return;const i=this.getEditorSelection(),o=!i&&e,l=i&&!e;$d(e,i)||(this.selection=e,(h=(a=this.props).onChangeSelection)==null||h.call(a,e,t,r),o?(m=(g=this.props).onFocus)==null||m.call(g,e,t,r):l&&((w=(x=this.props).onBlur)==null||w.call(x,i,t,r)))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}Pv.displayName="React Quill";Pv.Quill=Xe;Pv.defaultProps={theme:"snow",modules:{},readOnly:!1};function uw(n){Promise.resolve().then(n)}class r_{constructor(e,t={}){Ee(this,"quill");Ee(this,"options");Ee(this,"_toolbarEl",null);Ee(this,"_button",null);Ee(this,"_resizeObserver",null);Ee(this,"_placeholder",null);if(this.quill=e,this.options=t,this.options.type==="Raw")return;if(this.options.type==="ReadOnly"){this._createButton();return}const r=e.getModule("toolbar");if(!r){console.warn("Toolbar module not found");return}if(this._toolbarEl=r.container,!this._toolbarEl){console.warn("Toolbar container not found");return}this._createButton()}_createButton(){switch(this.options.type){case"ReadOnly":this._createReadOnlyButton();break;case"Error":case"Primary":this._createToolbarButton();break}}_createToolbarButton(){this._toolbarEl&&(!this.options.maximize||!this.options.minimize||(this._button=document.createElement("button"),this._button.type="button",this._button.classList.add("ql-fullscreen","ql-right-action"),this._button.onclick=this._toggleFullscreen.bind(this),this._button.innerHTML=this.options.maximize??"",this._button.title=this.options.buttonTitle||"",this._toolbarEl.classList.add("ql-toolbar-has-right-action"),this._toolbarEl.append(this._button)))}_createReadOnlyButton(){var r;const e=(r=this.quill.root)==null?void 0:r.closest(".ql-container");if(!e||!this.options.maximize||!this.options.minimize)return;this._button=document.createElement("button"),this._button.type="button",this._button.classList.add("ql-fullscreen","ql-readonly-fullscreen"),this._button.onclick=this._toggleFullscreen.bind(this),this._button.innerHTML=this.options.maximize??"",this._button.title=this.options.buttonTitle||"",e.appendChild(this._button),this._checkScrollbar(),requestAnimationFrame(()=>this._checkScrollbar());const t=this.quill.root;this._resizeObserver=new ResizeObserver(()=>this._checkScrollbar()),this._resizeObserver.observe(t)}_checkScrollbar(){const e=this.quill.root,t=e==null?void 0:e.closest(".ql-container");if(!e||!t||!this._button)return;e.scrollHeight>e.clientHeight?(t.classList.add("ql-has-v-scrollbar"),this._button.style.removeProperty("right")):(t.classList.remove("ql-has-v-scrollbar"),this._button.style.removeProperty("right"))}_toggleFullscreen(e){var o,l;e.preventDefault();const t=(o=this.quill.root)==null?void 0:o.closest(".ql-container");if(!t)throw new Error("Quill editor container not exist");let r=t.closest(".ql-editor-wrap");if(r){if(t instanceof HTMLElement&&(t.classList.remove("is-fullscreen"),t.style.height=""),this._placeholder){const a=t.parentElement;this._placeholder.after(a),this._placeholder.remove(),this._placeholder=null}r.remove(),this._button&&(this._button.classList.remove("ql-active"),this._button.innerHTML=this.options.maximize??""),document.documentElement.style.removeProperty("overflow");return}if(r=document.createElement("div"),r.classList.add("ql-editor-wrap"),t instanceof HTMLElement){const a=((l=this._toolbarEl)==null?void 0:l.offsetHeight)||0;t.style.height=`calc(100% - ${a}px)`,t.classList.add("is-fullscreen")}const i=t.parentElement;this._placeholder=document.createComment("ql-fullscreen-placeholder"),i.after(this._placeholder),r.append(i),document.body.append(r),this._button&&(this._button.classList.add("ql-active"),this._button.innerHTML=this.options.minimize??""),document.documentElement.style.overflow="hidden"}}window.QuillToggleFullscreenButton=r_;var Ib={exports:{}},fw;function iF(){return fw||(fw=1,(function(n,e){(function(t,r){n.exports=r()})(window,(function(){return(function(t){var r={};function i(o){if(r[o])return r[o].exports;var l=r[o]={i:o,l:!1,exports:{}};return t[o].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=t,i.c=r,i.d=function(o,l,a){i.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:a})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,l){if(1&l&&(o=i(o)),8&l||4&l&&typeof o=="object"&&o&&o.__esModule)return o;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:o}),2&l&&typeof o!="string")for(var h in o)i.d(a,h,(function(g){return o[g]}).bind(null,h));return a},i.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(l,"a",l),l},i.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},i.p="",i(i.s=17)})([function(t,r,i){var o=i(7),l=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",a=Object.prototype.toString,h=Array.prototype.concat,g=Object.defineProperty,m=i(25)(),x=g&&m,w=function(S,R,k,O){var P;(!(R in S)||typeof(P=O)=="function"&&a.call(P)==="[object Function]"&&O())&&(x?g(S,R,{configurable:!0,enumerable:!1,value:k,writable:!0}):S[R]=k)},_=function(S,R){var k=arguments.length>2?arguments[2]:{},O=o(R);l&&(O=h.call(O,Object.getOwnPropertySymbols(R)));for(var P=0;P<O.length;P+=1)w(S,O[P],R[O[P]],k[O[P]])};_.supportsDescriptors=!!x,t.exports=_},function(t,r,i){var o=i(9);t.exports=function(){return o()&&!!Symbol.toStringTag}},function(t,r,i){var o=SyntaxError,l=Function,a=TypeError,h=function(ne){try{return l('"use strict"; return ('+ne+").constructor;")()}catch{}},g=Object.getOwnPropertyDescriptor;if(g)try{g({},"")}catch{g=null}var m=function(){throw new a},x=g?(function(){try{return m}catch{try{return g(arguments,"callee").get}catch{return m}}})():m,w=i(21)(),_=Object.getPrototypeOf||function(ne){return ne.__proto__},S={},R=typeof Uint8Array>"u"?void 0:_(Uint8Array),k={"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":w?_([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":S,"%AsyncGenerator%":S,"%AsyncGeneratorFunction%":S,"%AsyncIteratorPrototype%":S,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":S,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w?_(_([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&w?_(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&w?_(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w?_(""[Symbol.iterator]()):void 0,"%Symbol%":w?Symbol:void 0,"%SyntaxError%":o,"%ThrowTypeError%":x,"%TypedArray%":R,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet},O={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=i(3),z=i(23),H=P.call(Function.call,Array.prototype.concat),G=P.call(Function.apply,Array.prototype.splice),N=P.call(Function.call,String.prototype.replace),J=P.call(Function.call,String.prototype.slice),Y=P.call(Function.call,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fe=/\\(\\)?/g,X=function(ne){var ue=J(ne,0,1),se=J(ne,-1);if(ue==="%"&&se!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(se==="%"&&ue!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var $=[];return N(ne,K,(function(re,ge,me,oe){$[$.length]=me?N(oe,fe,"$1"):ge||re})),$},te=function(ne,ue){var se,$=ne;if(z(O,$)&&($="%"+(se=O[$])[0]+"%"),z(k,$)){var re=k[$];if(re===S&&(re=(function ge(me){var oe;if(me==="%AsyncFunction%")oe=h("async function () {}");else if(me==="%GeneratorFunction%")oe=h("function* () {}");else if(me==="%AsyncGeneratorFunction%")oe=h("async function* () {}");else if(me==="%AsyncGenerator%"){var Q=ge("%AsyncGeneratorFunction%");Q&&(oe=Q.prototype)}else if(me==="%AsyncIteratorPrototype%"){var pe=ge("%AsyncGenerator%");pe&&(oe=_(pe.prototype))}return k[me]=oe,oe})($)),re===void 0&&!ue)throw new a("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:se,name:$,value:re}}throw new o("intrinsic "+ne+" does not exist!")};t.exports=function(ne,ue){if(typeof ne!="string"||ne.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ue!="boolean")throw new a('"allowMissing" argument must be a boolean');if(Y(/^%?[^%]*%?$/g,ne)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var se=X(ne),$=se.length>0?se[0]:"",re=te("%"+$+"%",ue),ge=re.name,me=re.value,oe=!1,Q=re.alias;Q&&($=Q[0],G(se,H([0,1],Q)));for(var pe=1,Ie=!0;pe<se.length;pe+=1){var Fe=se[pe],xe=J(Fe,0,1),Oe=J(Fe,-1);if((xe==='"'||xe==="'"||xe==="`"||Oe==='"'||Oe==="'"||Oe==="`")&&xe!==Oe)throw new o("property names with quotes must have matching quotes");if(Fe!=="constructor"&&Ie||(oe=!0),z(k,ge="%"+($+="."+Fe)+"%"))me=k[ge];else if(me!=null){if(!(Fe in me)){if(!ue)throw new a("base intrinsic for "+ne+" exists, but the property is not available.");return}if(g&&pe+1>=se.length){var Le=g(me,Fe);me=(Ie=!!Le)&&"get"in Le&&!("originalValue"in Le.get)?Le.get:me[Fe]}else Ie=z(me,Fe),me=me[Fe];Ie&&!oe&&(k[ge]=me)}}return me}},function(t,r,i){var o=i(22);t.exports=Function.prototype.bind||o},function(t,r,i){var o=i(3),l=i(2),a=l("%Function.prototype.apply%"),h=l("%Function.prototype.call%"),g=l("%Reflect.apply%",!0)||o.call(h,a),m=l("%Object.getOwnPropertyDescriptor%",!0),x=l("%Object.defineProperty%",!0),w=l("%Math.max%");if(x)try{x({},"a",{value:1})}catch{x=null}t.exports=function(S){var R=g(o,h,arguments);if(m&&x){var k=m(R,"length");k.configurable&&x(R,"length",{value:1+w(0,S.length-(arguments.length-1))})}return R};var _=function(){return g(o,a,arguments)};x?x(t.exports,"apply",{value:_}):t.exports.apply=_},function(t,r,i){var o=i(18),l=i(6),a=i(15),h=i(32),g="\0",m=function(x){Array.isArray(x)?this.ops=x:x!=null&&Array.isArray(x.ops)?this.ops=x.ops:this.ops=[]};m.prototype.insert=function(x,w){var _={};return x.length===0?this:(_.insert=x,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(_.attributes=w),this.push(_))},m.prototype.delete=function(x){return x<=0?this:this.push({delete:x})},m.prototype.retain=function(x,w){if(x<=0)return this;var _={retain:x};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(_.attributes=w),this.push(_)},m.prototype.push=function(x){var w=this.ops.length,_=this.ops[w-1];if(x=a(!0,{},x),typeof _=="object"){if(typeof x.delete=="number"&&typeof _.delete=="number")return this.ops[w-1]={delete:_.delete+x.delete},this;if(typeof _.delete=="number"&&x.insert!=null&&(w-=1,typeof(_=this.ops[w-1])!="object"))return this.ops.unshift(x),this;if(l(x.attributes,_.attributes)){if(typeof x.insert=="string"&&typeof _.insert=="string")return this.ops[w-1]={insert:_.insert+x.insert},typeof x.attributes=="object"&&(this.ops[w-1].attributes=x.attributes),this;if(typeof x.retain=="number"&&typeof _.retain=="number")return this.ops[w-1]={retain:_.retain+x.retain},typeof x.attributes=="object"&&(this.ops[w-1].attributes=x.attributes),this}}return w===this.ops.length?this.ops.push(x):this.ops.splice(w,0,x),this},m.prototype.chop=function(){var x=this.ops[this.ops.length-1];return x&&x.retain&&!x.attributes&&this.ops.pop(),this},m.prototype.filter=function(x){return this.ops.filter(x)},m.prototype.forEach=function(x){this.ops.forEach(x)},m.prototype.map=function(x){return this.ops.map(x)},m.prototype.partition=function(x){var w=[],_=[];return this.forEach((function(S){(x(S)?w:_).push(S)})),[w,_]},m.prototype.reduce=function(x,w){return this.ops.reduce(x,w)},m.prototype.changeLength=function(){return this.reduce((function(x,w){return w.insert?x+h.length(w):w.delete?x-w.delete:x}),0)},m.prototype.length=function(){return this.reduce((function(x,w){return x+h.length(w)}),0)},m.prototype.slice=function(x,w){x=x||0,typeof w!="number"&&(w=1/0);for(var _=[],S=h.iterator(this.ops),R=0;R<w&&S.hasNext();){var k;R<x?k=S.next(x-R):(k=S.next(w-R),_.push(k)),R+=h.length(k)}return new m(_)},m.prototype.compose=function(x){var w=h.iterator(this.ops),_=h.iterator(x.ops),S=[],R=_.peek();if(R!=null&&typeof R.retain=="number"&&R.attributes==null){for(var k=R.retain;w.peekType()==="insert"&&w.peekLength()<=k;)k-=w.peekLength(),S.push(w.next());R.retain-k>0&&_.next(R.retain-k)}for(var O=new m(S);w.hasNext()||_.hasNext();)if(_.peekType()==="insert")O.push(_.next());else if(w.peekType()==="delete")O.push(w.next());else{var P=Math.min(w.peekLength(),_.peekLength()),z=w.next(P),H=_.next(P);if(typeof H.retain=="number"){var G={};typeof z.retain=="number"?G.retain=P:G.insert=z.insert;var N=h.attributes.compose(z.attributes,H.attributes,typeof z.retain=="number");if(N&&(G.attributes=N),O.push(G),!_.hasNext()&&l(O.ops[O.ops.length-1],G)){var J=new m(w.rest());return O.concat(J).chop()}}else typeof H.delete=="number"&&typeof z.retain=="number"&&O.push(H)}return O.chop()},m.prototype.concat=function(x){var w=new m(this.ops.slice());return x.ops.length>0&&(w.push(x.ops[0]),w.ops=w.ops.concat(x.ops.slice(1))),w},m.prototype.diff=function(x,w){if(this.ops===x.ops)return new m;var _=[this,x].map((function(P){return P.map((function(z){if(z.insert!=null)return typeof z.insert=="string"?z.insert:g;throw new Error("diff() called "+(P===x?"on":"with")+" non-document")})).join("")})),S=new m,R=o(_[0],_[1],w),k=h.iterator(this.ops),O=h.iterator(x.ops);return R.forEach((function(P){for(var z=P[1].length;z>0;){var H=0;switch(P[0]){case o.INSERT:H=Math.min(O.peekLength(),z),S.push(O.next(H));break;case o.DELETE:H=Math.min(z,k.peekLength()),k.next(H),S.delete(H);break;case o.EQUAL:H=Math.min(k.peekLength(),O.peekLength(),z);var G=k.next(H),N=O.next(H);l(G.insert,N.insert)?S.retain(H,h.attributes.diff(G.attributes,N.attributes)):S.push(N).delete(H)}z-=H}})),S.chop()},m.prototype.eachLine=function(x,w){w=w||`
337
337
  `;for(var _=h.iterator(this.ops),S=new m,R=0;_.hasNext();){if(_.peekType()!=="insert")return;var k=_.peek(),O=h.length(k)-_.peekLength(),P=typeof k.insert=="string"?k.insert.indexOf(w,O)-O:-1;if(P<0)S.push(_.next());else if(P>0)S.push(_.next(P));else{if(x(S,_.next(1).attributes||{},R)===!1)return;R+=1,S=new m}}S.length()>0&&x(S,{},R)},m.prototype.transform=function(x,w){if(w=!!w,typeof x=="number")return this.transformPosition(x,w);for(var _=h.iterator(this.ops),S=h.iterator(x.ops),R=new m;_.hasNext()||S.hasNext();)if(_.peekType()!=="insert"||!w&&S.peekType()==="insert")if(S.peekType()==="insert")R.push(S.next());else{var k=Math.min(_.peekLength(),S.peekLength()),O=_.next(k),P=S.next(k);if(O.delete)continue;P.delete?R.push(P):R.retain(k,h.attributes.transform(O.attributes,P.attributes,w))}else R.retain(h.length(_.next()));return R.chop()},m.prototype.transformPosition=function(x,w){w=!!w;for(var _=h.iterator(this.ops),S=0;_.hasNext()&&S<=x;){var R=_.peekLength(),k=_.peekType();_.next(),k!=="delete"?(k==="insert"&&(S<x||!w)&&(x+=R),S+=R):x-=Math.min(R,x-S)}return x},t.exports=m},function(t,r,i){var o=i(7),l=i(20),a=i(24),h=i(27),g=i(28),m=i(31),x=Date.prototype.getTime;function w(R,k,O){var P=O||{};return!!(P.strict?a(R,k):R===k)||(!R||!k||typeof R!="object"&&typeof k!="object"?P.strict?a(R,k):R==k:(function(z,H,G){var N,J;if(typeof z!=typeof H||_(z)||_(H)||z.prototype!==H.prototype||l(z)!==l(H))return!1;var Y=h(z),K=h(H);if(Y!==K)return!1;if(Y||K)return z.source===H.source&&g(z)===g(H);if(m(z)&&m(H))return x.call(z)===x.call(H);var fe=S(z),X=S(H);if(fe!==X)return!1;if(fe||X){if(z.length!==H.length)return!1;for(N=0;N<z.length;N++)if(z[N]!==H[N])return!1;return!0}if(typeof z!=typeof H)return!1;try{var te=o(z),ne=o(H)}catch{return!1}if(te.length!==ne.length)return!1;for(te.sort(),ne.sort(),N=te.length-1;N>=0;N--)if(te[N]!=ne[N])return!1;for(N=te.length-1;N>=0;N--)if(J=te[N],!w(z[J],H[J],G))return!1;return!0})(R,k,P))}function _(R){return R==null}function S(R){return!(!R||typeof R!="object"||typeof R.length!="number")&&typeof R.copy=="function"&&typeof R.slice=="function"&&!(R.length>0&&typeof R[0]!="number")}t.exports=w},function(t,r,i){var o=Array.prototype.slice,l=i(8),a=Object.keys,h=a?function(m){return a(m)}:i(19),g=Object.keys;h.shim=function(){return Object.keys?(function(){var m=Object.keys(arguments);return m&&m.length===arguments.length})(1,2)||(Object.keys=function(m){return l(m)?g(o.call(m)):g(m)}):Object.keys=h,Object.keys||h},t.exports=h},function(t,r,i){var o=Object.prototype.toString;t.exports=function(l){var a=o.call(l),h=a==="[object Arguments]";return h||(h=a!=="[object Array]"&&l!==null&&typeof l=="object"&&typeof l.length=="number"&&l.length>=0&&o.call(l.callee)==="[object Function]"),h}},function(t,r,i){t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},l=Symbol("test"),a=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;for(l in o[l]=42,o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var h=Object.getOwnPropertySymbols(o);if(h.length!==1||h[0]!==l||!Object.prototype.propertyIsEnumerable.call(o,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var g=Object.getOwnPropertyDescriptor(o,l);if(g.value!==42||g.enumerable!==!0)return!1}return!0}},function(t,r,i){var o=i(2),l=i(4),a=l(o("String.prototype.indexOf"));t.exports=function(h,g){var m=o(h,!!g);return typeof m=="function"&&a(h,".prototype.")>-1?l(m):m}},function(t,r,i){var o=function(l){return l!=l};t.exports=function(l,a){return l===0&&a===0?1/l==1/a:l===a||!(!o(l)||!o(a))}},function(t,r,i){var o=i(11);t.exports=function(){return typeof Object.is=="function"?Object.is:o}},function(t,r,i){var o=i(29).functionsHaveConfigurableNames(),l=Object,a=TypeError;t.exports=function(){if(this!=null&&this!==l(this))throw new a("RegExp.prototype.flags getter called on non-object");var h="";return this.hasIndices&&(h+="d"),this.global&&(h+="g"),this.ignoreCase&&(h+="i"),this.multiline&&(h+="m"),this.dotAll&&(h+="s"),this.unicode&&(h+="u"),this.sticky&&(h+="y"),h},o&&Object.defineProperty&&Object.defineProperty(t.exports,"name",{value:"get flags"})},function(t,r,i){var o=i(13),l=i(0).supportsDescriptors,a=Object.getOwnPropertyDescriptor;t.exports=function(){if(l&&/a/gim.flags==="gim"){var h=a(RegExp.prototype,"flags");if(h&&typeof h.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var g="",m={};if(Object.defineProperty(m,"hasIndices",{get:function(){g+="d"}}),Object.defineProperty(m,"sticky",{get:function(){g+="y"}}),g==="dy")return h.get}}return o}},function(t,r,i){var o=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,h=Object.getOwnPropertyDescriptor,g=function(_){return typeof Array.isArray=="function"?Array.isArray(_):l.call(_)==="[object Array]"},m=function(_){if(!_||l.call(_)!=="[object Object]")return!1;var S,R=o.call(_,"constructor"),k=_.constructor&&_.constructor.prototype&&o.call(_.constructor.prototype,"isPrototypeOf");if(_.constructor&&!R&&!k)return!1;for(S in _);return S===void 0||o.call(_,S)},x=function(_,S){a&&S.name==="__proto__"?a(_,S.name,{enumerable:!0,configurable:!0,value:S.newValue,writable:!0}):_[S.name]=S.newValue},w=function(_,S){if(S==="__proto__"){if(!o.call(_,S))return;if(h)return h(_,S).value}return _[S]};t.exports=function _(){var S,R,k,O,P,z,H=arguments[0],G=1,N=arguments.length,J=!1;for(typeof H=="boolean"&&(J=H,H=arguments[1]||{},G=2),(H==null||typeof H!="object"&&typeof H!="function")&&(H={});G<N;++G)if((S=arguments[G])!=null)for(R in S)k=w(H,R),H!==(O=w(S,R))&&(J&&O&&(m(O)||(P=g(O)))?(P?(P=!1,z=k&&g(k)?k:[]):z=k&&m(k)?k:{},x(H,{name:R,newValue:_(J,z,O)})):O!==void 0&&x(H,{name:R,newValue:O}));return H}},function(t,r,i){const o=typeof URL>"u"?i(33).URL:URL,l=(h,g)=>g.some(m=>m instanceof RegExp?m.test(h):m===h),a=(h,g)=>{if(g={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...g},Reflect.has(g,"normalizeHttps"))throw new Error("options.normalizeHttps is renamed to options.forceHttp");if(Reflect.has(g,"normalizeHttp"))throw new Error("options.normalizeHttp is renamed to options.forceHttps");if(Reflect.has(g,"stripFragment"))throw new Error("options.stripFragment is renamed to options.stripHash");if(h=h.trim(),/^data:/i.test(h))return((w,{stripHash:_})=>{const S=w.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!S)throw new Error("Invalid URL: "+w);const R=S[1].split(";"),k=S[2],O=_?"":S[3];let P=!1;R[R.length-1]==="base64"&&(R.pop(),P=!0);const z=(R.shift()||"").toLowerCase(),H=[...R.map(G=>{let[N,J=""]=G.split("=").map(Y=>Y.trim());return N==="charset"&&(J=J.toLowerCase(),J==="us-ascii")?"":`${N}${J?"="+J:""}`}).filter(Boolean)];return P&&H.push("base64"),(H.length!==0||z&&z!=="text/plain")&&H.unshift(z),`data:${H.join(";")},${P?k.trim():k}${O?"#"+O:""}`})(h,g);const m=h.startsWith("//");!m&&/^\.*\//.test(h)||(h=h.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,g.defaultProtocol));const x=new o(h);if(g.forceHttp&&g.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(g.forceHttp&&x.protocol==="https:"&&(x.protocol="http:"),g.forceHttps&&x.protocol==="http:"&&(x.protocol="https:"),g.stripAuthentication&&(x.username="",x.password=""),g.stripHash&&(x.hash=""),x.pathname&&(x.pathname=x.pathname.replace(/((?!:).|^)\/{2,}/g,(w,_)=>/^(?!\/)/g.test(_)?_+"/":"/")),x.pathname&&(x.pathname=decodeURI(x.pathname)),g.removeDirectoryIndex===!0&&(g.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(g.removeDirectoryIndex)&&g.removeDirectoryIndex.length>0){let w=x.pathname.split("/");const _=w[w.length-1];l(_,g.removeDirectoryIndex)&&(w=w.slice(0,w.length-1),x.pathname=w.slice(1).join("/")+"/")}if(x.hostname&&(x.hostname=x.hostname.replace(/\.$/,""),g.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(x.hostname)&&(x.hostname=x.hostname.replace(/^www\./,""))),Array.isArray(g.removeQueryParameters))for(const w of[...x.searchParams.keys()])l(w,g.removeQueryParameters)&&x.searchParams.delete(w);return g.sortQueryParameters&&x.searchParams.sort(),g.removeTrailingSlash&&(x.pathname=x.pathname.replace(/\/$/,"")),h=x.toString(),!g.removeTrailingSlash&&x.pathname!=="/"||x.hash!==""||(h=h.replace(/\/$/,"")),m&&!g.normalizeProtocol&&(h=h.replace(/^http:\/\//,"//")),g.stripProtocol&&(h=h.replace(/^(?:https?:)?\/\//,"")),h};t.exports=a,t.exports.default=a},function(t,r,i){i.r(r),i.d(r,"default",(function(){return k}));var o=i(5),l=i.n(o),a=i(16),h=i.n(a);function g(O,P){return(function(z){if(Array.isArray(z))return z})(O)||(function(z,H){var G=z==null?null:typeof Symbol<"u"&&z[Symbol.iterator]||z["@@iterator"];if(G!=null){var N,J,Y=[],K=!0,fe=!1;try{for(G=G.call(z);!(K=(N=G.next()).done)&&(Y.push(N.value),!H||Y.length!==H);K=!0);}catch(X){fe=!0,J=X}finally{try{K||G.return==null||G.return()}finally{if(fe)throw J}}return Y}})(O,P)||(function(z,H){if(z){if(typeof z=="string")return m(z,H);var G=Object.prototype.toString.call(z).slice(8,-1);if(G==="Object"&&z.constructor&&(G=z.constructor.name),G==="Map"||G==="Set")return Array.from(z);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return m(z,H)}})(O,P)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
338
338
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function m(O,P){(P==null||P>O.length)&&(P=O.length);for(var z=0,H=new Array(P);z<P;z++)H[z]=O[z];return H}function x(O,P){var z=Object.keys(O);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(O);P&&(H=H.filter((function(G){return Object.getOwnPropertyDescriptor(O,G).enumerable}))),z.push.apply(z,H)}return z}function w(O){for(var P=1;P<arguments.length;P++){var z=arguments[P]!=null?arguments[P]:{};P%2?x(Object(z),!0).forEach((function(H){_(O,H,z[H])})):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(z)):x(Object(z)).forEach((function(H){Object.defineProperty(O,H,Object.getOwnPropertyDescriptor(z,H))}))}return O}function _(O,P,z){return P in O?Object.defineProperty(O,P,{value:z,enumerable:!0,configurable:!0,writable:!0}):O[P]=z,O}function S(O,P){for(var z=0;z<P.length;z++){var H=P[z];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(O,H.key,H)}}var R={globalRegularExpression:/(https?:\/\/|www\.)[\w-\.]+\.[\w-\.]+(\/([\S]+)?)?/gi,urlRegularExpression:/(https?:\/\/|www\.)[\w-\.]+\.[\w-\.]+(\/([\S]+)?)?/gi,globalMailRegularExpression:/([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi,mailRegularExpression:/([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi,normalizeRegularExpression:/(https?:\/\/|www\.)[\S]+/i,normalizeUrlOptions:{stripWWW:!1}},k=(function(){function O(H,G){var N=this;(function(J,Y){if(!(J instanceof Y))throw new TypeError("Cannot call a class as a function")})(this,O),this.quill=H,G=G||{},this.options=w(w({},R),G),this.urlNormalizer=function(J){return N.normalize(J)},this.mailNormalizer=function(J){return"mailto:".concat(J)},this.registerTypeListener(),this.registerPasteListener(),this.registerBlurListener()}var P,z;return P=O,(z=[{key:"registerPasteListener",value:function(){var H=this;this.quill.clipboard.addMatcher("A",(function(G,N){var J,Y=G.getAttribute("href"),K=(J=N.ops[0])===null||J===void 0?void 0:J.attributes;return(K==null?void 0:K.link)!=null&&(K.link=Y),N})),this.quill.clipboard.addMatcher(Node.TEXT_NODE,(function(G,N){if(typeof G.data=="string"){var J=H.options.globalRegularExpression,Y=H.options.globalMailRegularExpression;J.lastIndex=0,Y.lastIndex=0;for(var K=new l.a,fe=0,X=J.exec(G.data),te=Y.exec(G.data),ne=function(se,$,re){var ge=G.data.substring(fe,se.index);K.insert(ge);var me=se[0];return K.insert(me,{link:re(me)}),fe=$.lastIndex,$.exec(G.data)};X!==null||te!==null;)if(X===null)te=ne(te,Y,H.mailNormalizer);else if(te===null)X=ne(X,J,H.urlNormalizer);else if(te.index<=X.index){for(;X!==null&&X.index<Y.lastIndex;)X=J.exec(G.data);te=ne(te,Y,H.mailNormalizer)}else{for(;te!==null&&te.index<J.lastIndex;)te=Y.exec(G.data);X=ne(X,J,H.urlNormalizer)}if(fe>0){var ue=G.data.substring(fe);K.insert(ue),N.ops=K.ops}return N}}))}},{key:"registerTypeListener",value:function(){var H=this;this.quill.on("text-change",(function(G){var N=G.ops;if(!(!N||N.length<1||N.length>2)){var J=N[N.length-1];J.insert&&typeof J.insert=="string"&&J.insert.match(/\s/)&&H.checkTextForUrl(!!J.insert.match(/ |\t/))}}))}},{key:"registerBlurListener",value:function(){var H=this;this.quill.root.addEventListener("blur",(function(){H.checkTextForUrl()}))}},{key:"checkTextForUrl",value:function(){var H=arguments.length>0&&arguments[0]!==void 0&&arguments[0],G=this.quill.getSelection();if(G){var N=this.quill.getLeaf(G.index),J=g(N,1),Y=J[0],K=this.quill.getIndex(Y);if(Y.text){var fe=G.index-K,X=Y.text.slice(0,fe);if(X&&Y.parent.domNode.localName!=="a"){var te=Y.text[fe];if(te==null||!te.match(/\S/)){var ne=H?/\s\s$/:/\s$/;if(!X.match(ne)){var ue=X.match(this.options.urlRegularExpression),se=X.match(this.options.mailRegularExpression);ue?this.handleMatches(K,X,ue,this.urlNormalizer):se&&this.handleMatches(K,X,se,this.mailNormalizer)}}}}}}},{key:"handleMatches",value:function(H,G,N,J){var Y=N.pop(),K=G.lastIndexOf(Y);G.split(Y).pop().match(/\S/)||this.updateText(H+K,Y.trim(),J)}},{key:"updateText",value:function(H,G,N){var J=new l.a().retain(H).retain(G.length,{link:N(G)});this.quill.updateContents(J)}},{key:"normalize",value:function(H){if(this.options.normalizeRegularExpression.test(H))try{return h()(H,this.options.normalizeUrlOptions)}catch(G){console.error(G)}return H}}])&&S(P.prototype,z),Object.defineProperty(P,"prototype",{writable:!1}),O})();window!=null&&window.Quill&&window.Quill.register("modules/magicUrl",k)},function(t,r){function i(m,x,w){if(m==x)return m?[[0,m]]:[];(w<0||m.length<w)&&(w=null);var _=l(m,x),S=m.substring(0,_);_=a(m=m.substring(_),x=x.substring(_));var R=m.substring(m.length-_),k=(function(O,P){var z;if(!O)return[[1,P]];if(!P)return[[-1,O]];var H=O.length>P.length?O:P,G=O.length>P.length?P:O,N=H.indexOf(G);if(N!=-1)return z=[[1,H.substring(0,N)],[0,G],[1,H.substring(N+G.length)]],O.length>P.length&&(z[0][0]=z[2][0]=-1),z;if(G.length==1)return[[-1,O],[1,P]];var J=(function(se,$){var re=se.length>$.length?se:$,ge=se.length>$.length?$:se;if(re.length<4||2*ge.length<re.length)return null;function me(He,Te,ke){for(var Be,rt,Re,ut,qe=He.substring(ke,ke+Math.floor(He.length/4)),ot=-1,st="";(ot=Te.indexOf(qe,ot+1))!=-1;){var bt=l(He.substring(ke),Te.substring(ot)),Mt=a(He.substring(0,ke),Te.substring(0,ot));st.length<Mt+bt&&(st=Te.substring(ot-Mt,ot)+Te.substring(ot,ot+bt),Be=He.substring(0,ke-Mt),rt=He.substring(ke+bt),Re=Te.substring(0,ot-Mt),ut=Te.substring(ot+bt))}return 2*st.length>=He.length?[Be,rt,Re,ut,st]:null}var oe,Q,pe,Ie,Fe,xe=me(re,ge,Math.ceil(re.length/4)),Oe=me(re,ge,Math.ceil(re.length/2));if(!xe&&!Oe)return null;oe=Oe?xe&&xe[4].length>Oe[4].length?xe:Oe:xe,se.length>$.length?(Q=oe[0],pe=oe[1],Ie=oe[2],Fe=oe[3]):(Ie=oe[0],Fe=oe[1],Q=oe[2],pe=oe[3]);var Le=oe[4];return[Q,pe,Ie,Fe,Le]})(O,P);if(J){var Y=J[0],K=J[1],fe=J[2],X=J[3],te=J[4],ne=i(Y,fe),ue=i(K,X);return ne.concat([[0,te]],ue)}return(function(se,$){for(var re=se.length,ge=$.length,me=Math.ceil((re+ge)/2),oe=me,Q=2*me,pe=new Array(Q),Ie=new Array(Q),Fe=0;Fe<Q;Fe++)pe[Fe]=-1,Ie[Fe]=-1;pe[oe+1]=0,Ie[oe+1]=0;for(var xe=re-ge,Oe=xe%2!=0,Le=0,He=0,Te=0,ke=0,Be=0;Be<me;Be++){for(var rt=-Be+Le;rt<=Be-He;rt+=2){for(var Re=oe+rt,ut=(Mt=rt==-Be||rt!=Be&&pe[Re-1]<pe[Re+1]?pe[Re+1]:pe[Re-1]+1)-rt;Mt<re&&ut<ge&&se.charAt(Mt)==$.charAt(ut);)Mt++,ut++;if(pe[Re]=Mt,Mt>re)He+=2;else if(ut>ge)Le+=2;else if(Oe&&(st=oe+xe-rt)>=0&&st<Q&&Ie[st]!=-1){var qe=re-Ie[st];if(Mt>=qe)return o(se,$,Mt,ut)}}for(var ot=-Be+Te;ot<=Be-ke;ot+=2){for(var st=oe+ot,bt=(qe=ot==-Be||ot!=Be&&Ie[st-1]<Ie[st+1]?Ie[st+1]:Ie[st-1]+1)-ot;qe<re&&bt<ge&&se.charAt(re-qe-1)==$.charAt(ge-bt-1);)qe++,bt++;if(Ie[st]=qe,qe>re)ke+=2;else if(bt>ge)Te+=2;else if(!Oe&&(Re=oe+xe-ot)>=0&&Re<Q&&pe[Re]!=-1){var Mt=pe[Re];if(ut=oe+Mt-Re,Mt>=(qe=re-qe))return o(se,$,Mt,ut)}}}return[[-1,se],[1,$]]})(O,P)})(m=m.substring(0,m.length-_),x=x.substring(0,x.length-_));return S&&k.unshift([0,S]),R&&k.push([0,R]),(function O(P){P.push([0,""]);for(var z,H=0,G=0,N=0,J="",Y="";H<P.length;)switch(P[H][0]){case 1:N++,Y+=P[H][1],H++;break;case-1:G++,J+=P[H][1],H++;break;case 0:G+N>1?(G!==0&&N!==0&&((z=l(Y,J))!==0&&(H-G-N>0&&P[H-G-N-1][0]==0?P[H-G-N-1][1]+=Y.substring(0,z):(P.splice(0,0,[0,Y.substring(0,z)]),H++),Y=Y.substring(z),J=J.substring(z)),(z=a(Y,J))!==0&&(P[H][1]=Y.substring(Y.length-z)+P[H][1],Y=Y.substring(0,Y.length-z),J=J.substring(0,J.length-z))),G===0?P.splice(H-N,G+N,[1,Y]):N===0?P.splice(H-G,G+N,[-1,J]):P.splice(H-G-N,G+N,[-1,J],[1,Y]),H=H-G-N+(G?1:0)+(N?1:0)+1):H!==0&&P[H-1][0]==0?(P[H-1][1]+=P[H][1],P.splice(H,1)):H++,N=0,G=0,J="",Y=""}P[P.length-1][1]===""&&P.pop();var K=!1;for(H=1;H<P.length-1;)P[H-1][0]==0&&P[H+1][0]==0&&(P[H][1].substring(P[H][1].length-P[H-1][1].length)==P[H-1][1]?(P[H][1]=P[H-1][1]+P[H][1].substring(0,P[H][1].length-P[H-1][1].length),P[H+1][1]=P[H-1][1]+P[H+1][1],P.splice(H-1,1),K=!0):P[H][1].substring(0,P[H+1][1].length)==P[H+1][1]&&(P[H-1][1]+=P[H+1][1],P[H][1]=P[H][1].substring(P[H+1][1].length)+P[H+1][1],P.splice(H+1,1),K=!0)),H++;K&&O(P)})(k),w!=null&&(k=(function(O,P){var z=(function(K,fe){if(fe===0)return[0,K];for(var X=0,te=0;te<K.length;te++){var ne=K[te];if(ne[0]===-1||ne[0]===0){var ue=X+ne[1].length;if(fe===ue)return[te+1,K];if(fe<ue){K=K.slice();var se=fe-X,$=[ne[0],ne[1].slice(0,se)],re=[ne[0],ne[1].slice(se)];return K.splice(te,1,$,re),[te+1,K]}X=ue}}throw new Error("cursor_pos is out of bounds!")})(O,P),H=z[1],G=z[0],N=H[G],J=H[G+1];if(N==null||N[0]!==0)return O;if(J!=null&&N[1]+J[1]===J[1]+N[1])return H.splice(G,2,J,N),g(H,G,2);if(J!=null&&J[1].indexOf(N[1])===0){H.splice(G,2,[J[0],N[1]],[0,N[1]]);var Y=J[1].slice(N[1].length);return Y.length>0&&H.splice(G+2,0,[J[0],Y]),g(H,G,3)}return O})(k,w)),k=(function(O){for(var P=!1,z=function(J){return J.charCodeAt(0)>=56320&&J.charCodeAt(0)<=57343},H=2;H<O.length;H+=1)O[H-2][0]===0&&(G=O[H-2][1]).charCodeAt(G.length-1)>=55296&&G.charCodeAt(G.length-1)<=56319&&O[H-1][0]===-1&&z(O[H-1][1])&&O[H][0]===1&&z(O[H][1])&&(P=!0,O[H-1][1]=O[H-2][1].slice(-1)+O[H-1][1],O[H][1]=O[H-2][1].slice(-1)+O[H][1],O[H-2][1]=O[H-2][1].slice(0,-1));var G;if(!P)return O;var N=[];for(H=0;H<O.length;H+=1)O[H][1].length>0&&N.push(O[H]);return N})(k)}function o(m,x,w,_){var S=m.substring(0,w),R=x.substring(0,_),k=m.substring(w),O=x.substring(_),P=i(S,R),z=i(k,O);return P.concat(z)}function l(m,x){if(!m||!x||m.charAt(0)!=x.charAt(0))return 0;for(var w=0,_=Math.min(m.length,x.length),S=_,R=0;w<S;)m.substring(R,S)==x.substring(R,S)?R=w=S:_=S,S=Math.floor((_-w)/2+w);return S}function a(m,x){if(!m||!x||m.charAt(m.length-1)!=x.charAt(x.length-1))return 0;for(var w=0,_=Math.min(m.length,x.length),S=_,R=0;w<S;)m.substring(m.length-S,m.length-R)==x.substring(x.length-S,x.length-R)?R=w=S:_=S,S=Math.floor((_-w)/2+w);return S}var h=i;function g(m,x,w){for(var _=x+w-1;_>=0&&_>=x-1;_--)if(_+1<m.length){var S=m[_],R=m[_+1];S[0]===R[1]&&m.splice(_,2,[S[0],S[1]+R[1]])}return m}h.INSERT=1,h.DELETE=-1,h.EQUAL=0,t.exports=h},function(t,r,i){var o;if(!Object.keys){var l=Object.prototype.hasOwnProperty,a=Object.prototype.toString,h=i(8),g=Object.prototype.propertyIsEnumerable,m=!g.call({toString:null},"toString"),x=g.call((function(){}),"prototype"),w=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(k){var O=k.constructor;return O&&O.prototype===k},S={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},R=(function(){if(typeof window>"u")return!1;for(var k in window)try{if(!S["$"+k]&&l.call(window,k)&&window[k]!==null&&typeof window[k]=="object")try{_(window[k])}catch{return!0}}catch{return!0}return!1})();o=function(k){var O=k!==null&&typeof k=="object",P=a.call(k)==="[object Function]",z=h(k),H=O&&a.call(k)==="[object String]",G=[];if(!O&&!P&&!z)throw new TypeError("Object.keys called on a non-object");var N=x&&P;if(H&&k.length>0&&!l.call(k,0))for(var J=0;J<k.length;++J)G.push(String(J));if(z&&k.length>0)for(var Y=0;Y<k.length;++Y)G.push(String(Y));else for(var K in k)N&&K==="prototype"||!l.call(k,K)||G.push(String(K));if(m)for(var fe=(function(te){if(typeof window>"u"||!R)return _(te);try{return _(te)}catch{return!1}})(k),X=0;X<w.length;++X)fe&&w[X]==="constructor"||!l.call(k,w[X])||G.push(w[X]);return G}}t.exports=o},function(t,r,i){var o=i(1)(),l=i(10)("Object.prototype.toString"),a=function(m){return!(o&&m&&typeof m=="object"&&Symbol.toStringTag in m)&&l(m)==="[object Arguments]"},h=function(m){return!!a(m)||m!==null&&typeof m=="object"&&typeof m.length=="number"&&m.length>=0&&l(m)!=="[object Array]"&&l(m.callee)==="[object Function]"},g=(function(){return a(arguments)})();a.isLegacyArguments=h,t.exports=g?a:h},function(t,r,i){var o=typeof Symbol<"u"&&Symbol,l=i(9);t.exports=function(){return typeof o=="function"&&typeof Symbol=="function"&&typeof o("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&l()}},function(t,r,i){var o="Function.prototype.bind called on incompatible ",l=Array.prototype.slice,a=Object.prototype.toString;t.exports=function(h){var g=this;if(typeof g!="function"||a.call(g)!=="[object Function]")throw new TypeError(o+g);for(var m,x=l.call(arguments,1),w=function(){if(this instanceof m){var O=g.apply(this,x.concat(l.call(arguments)));return Object(O)===O?O:this}return g.apply(h,x.concat(l.call(arguments)))},_=Math.max(0,g.length-x.length),S=[],R=0;R<_;R++)S.push("$"+R);if(m=Function("binder","return function ("+S.join(",")+"){ return binder.apply(this,arguments); }")(w),g.prototype){var k=function(){};k.prototype=g.prototype,m.prototype=new k,k.prototype=null}return m}},function(t,r,i){var o=i(3);t.exports=o.call(Function.call,Object.prototype.hasOwnProperty)},function(t,r,i){var o=i(0),l=i(4),a=i(11),h=i(12),g=i(26),m=l(h(),Object);o(m,{getPolyfill:h,implementation:a,shim:g}),t.exports=m},function(t,r,i){var o=i(2)("%Object.defineProperty%",!0),l=function(){if(o)try{return o({},"a",{value:1}),!0}catch{return!1}return!1};l.hasArrayLengthDefineBug=function(){if(!l())return null;try{return o([],"length",{value:1}).length!==1}catch{return!0}},t.exports=l},function(t,r,i){var o=i(12),l=i(0);t.exports=function(){var a=o();return l(Object,{is:a},{is:function(){return Object.is!==a}}),a}},function(t,r,i){var o,l,a,h,g=i(10),m=i(1)();if(m){o=g("Object.prototype.hasOwnProperty"),l=g("RegExp.prototype.exec"),a={};var x=function(){throw a};h={toString:x,valueOf:x},typeof Symbol.toPrimitive=="symbol"&&(h[Symbol.toPrimitive]=x)}var w=g("Object.prototype.toString"),_=Object.getOwnPropertyDescriptor;t.exports=m?function(S){if(!S||typeof S!="object")return!1;var R=_(S,"lastIndex");if(!(R&&o(R,"value")))return!1;try{l(S,h)}catch(k){return k===a}}:function(S){return!(!S||typeof S!="object"&&typeof S!="function")&&w(S)==="[object RegExp]"}},function(t,r,i){var o=i(0),l=i(4),a=i(13),h=i(14),g=i(30),m=l(h());o(m,{getPolyfill:h,implementation:a,shim:g}),t.exports=m},function(t,r,i){var o=function(){return typeof(function(){}).name=="string"},l=Object.getOwnPropertyDescriptor;if(l)try{l([],"length")}catch{l=null}o.functionsHaveConfigurableNames=function(){if(!o()||!l)return!1;var h=l((function(){}),"name");return!!h&&!!h.configurable};var a=Function.prototype.bind;o.boundFunctionsHaveNames=function(){return o()&&typeof a=="function"&&(function(){}).bind().name!==""},t.exports=o},function(t,r,i){var o=i(0).supportsDescriptors,l=i(14),a=Object.getOwnPropertyDescriptor,h=Object.defineProperty,g=TypeError,m=Object.getPrototypeOf,x=/a/;t.exports=function(){if(!o||!m)throw new g("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var w=l(),_=m(x),S=a(_,"flags");return S&&S.get===w||h(_,"flags",{configurable:!0,enumerable:!1,get:w}),w}},function(t,r,i){var o=Date.prototype.getDay,l=Object.prototype.toString,a=i(1)();t.exports=function(h){return typeof h=="object"&&h!==null&&(a?(function(g){try{return o.call(g),!0}catch{return!1}})(h):l.call(h)==="[object Date]")}},function(t,r,i){var o=i(6),l=i(15),a={attributes:{compose:function(g,m,x){typeof g!="object"&&(g={}),typeof m!="object"&&(m={});var w=l(!0,{},m);for(var _ in x||(w=Object.keys(w).reduce((function(S,R){return w[R]!=null&&(S[R]=w[R]),S}),{})),g)g[_]!==void 0&&m[_]===void 0&&(w[_]=g[_]);return Object.keys(w).length>0?w:void 0},diff:function(g,m){typeof g!="object"&&(g={}),typeof m!="object"&&(m={});var x=Object.keys(g).concat(Object.keys(m)).reduce((function(w,_){return o(g[_],m[_])||(w[_]=m[_]===void 0?null:m[_]),w}),{});return Object.keys(x).length>0?x:void 0},transform:function(g,m,x){if(typeof g!="object")return m;if(typeof m=="object"){if(!x)return m;var w=Object.keys(m).reduce((function(_,S){return g[S]===void 0&&(_[S]=m[S]),_}),{});return Object.keys(w).length>0?w:void 0}}},iterator:function(g){return new h(g)},length:function(g){return typeof g.delete=="number"?g.delete:typeof g.retain=="number"?g.retain:typeof g.insert=="string"?g.insert.length:1}};function h(g){this.ops=g,this.index=0,this.offset=0}h.prototype.hasNext=function(){return this.peekLength()<1/0},h.prototype.next=function(g){g||(g=1/0);var m=this.ops[this.index];if(m){var x=this.offset,w=a.length(m);if(g>=w-x?(g=w-x,this.index+=1,this.offset=0):this.offset+=g,typeof m.delete=="number")return{delete:g};var _={};return m.attributes&&(_.attributes=m.attributes),typeof m.retain=="number"?_.retain=g:typeof m.insert=="string"?_.insert=m.insert.substr(x,g):_.insert=m.insert,_}return{retain:1/0}},h.prototype.peek=function(){return this.ops[this.index]},h.prototype.peekLength=function(){return this.ops[this.index]?a.length(this.ops[this.index])-this.offset:1/0},h.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},h.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var g=this.offset,m=this.index,x=this.next(),w=this.ops.slice(this.index);return this.offset=g,this.index=m,[x].concat(w)}return[]},t.exports=a},function(t,r,i){var o=i(34),l=i(37);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=G,r.resolve=function(N,J){return G(N,!1,!0).resolve(J)},r.resolveObject=function(N,J){return N?G(N,!1,!0).resolveObject(J):J},r.format=function(N){return l.isString(N)&&(N=G(N)),N instanceof a?N.format():a.prototype.format.call(N)},r.Url=a;var h=/^([a-z0-9.+-]+:)/i,g=/:[0-9]*$/,m=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,x=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
339
- `," "]),w=["'"].concat(x),_=["%","/","?",";","#"].concat(w),S=["/","?","#"],R=/^[+a-z0-9A-Z_-]{0,63}$/,k=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=i(38);function G(N,J,Y){if(N&&l.isObject(N)&&N instanceof a)return N;var K=new a;return K.parse(N,J,Y),K}a.prototype.parse=function(N,J,Y){if(!l.isString(N))throw new TypeError("Parameter 'url' must be a string, not "+typeof N);var K=N.indexOf("?"),fe=K!==-1&&K<N.indexOf("#")?"?":"#",X=N.split(fe);X[0]=X[0].replace(/\\/g,"/");var te=N=X.join(fe);if(te=te.trim(),!Y&&N.split("#").length===1){var ne=m.exec(te);if(ne)return this.path=te,this.href=te,this.pathname=ne[1],ne[2]?(this.search=ne[2],this.query=J?H.parse(this.search.substr(1)):this.search.substr(1)):J&&(this.search="",this.query={}),this}var ue=h.exec(te);if(ue){var se=(ue=ue[0]).toLowerCase();this.protocol=se,te=te.substr(ue.length)}if(Y||ue||te.match(/^\/\/[^@\/]+@[^@\/]+/)){var $=te.substr(0,2)==="//";!$||ue&&P[ue]||(te=te.substr(2),this.slashes=!0)}if(!P[ue]&&($||ue&&!z[ue])){for(var re,ge,me=-1,oe=0;oe<S.length;oe++)(Q=te.indexOf(S[oe]))!==-1&&(me===-1||Q<me)&&(me=Q);for((ge=me===-1?te.lastIndexOf("@"):te.lastIndexOf("@",me))!==-1&&(re=te.slice(0,ge),te=te.slice(ge+1),this.auth=decodeURIComponent(re)),me=-1,oe=0;oe<_.length;oe++){var Q;(Q=te.indexOf(_[oe]))!==-1&&(me===-1||Q<me)&&(me=Q)}me===-1&&(me=te.length),this.host=te.slice(0,me),te=te.slice(me),this.parseHost(),this.hostname=this.hostname||"";var pe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!pe)for(var Ie=this.hostname.split(/\./),Fe=(oe=0,Ie.length);oe<Fe;oe++){var xe=Ie[oe];if(xe&&!xe.match(R)){for(var Oe="",Le=0,He=xe.length;Le<He;Le++)xe.charCodeAt(Le)>127?Oe+="x":Oe+=xe[Le];if(!Oe.match(R)){var Te=Ie.slice(0,oe),ke=Ie.slice(oe+1),Be=xe.match(k);Be&&(Te.push(Be[1]),ke.unshift(Be[2])),ke.length&&(te="/"+ke.join(".")+te),this.hostname=Te.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),pe||(this.hostname=o.toASCII(this.hostname));var rt=this.port?":"+this.port:"",Re=this.hostname||"";this.host=Re+rt,this.href+=this.host,pe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),te[0]!=="/"&&(te="/"+te))}if(!O[se])for(oe=0,Fe=w.length;oe<Fe;oe++){var ut=w[oe];if(te.indexOf(ut)!==-1){var qe=encodeURIComponent(ut);qe===ut&&(qe=escape(ut)),te=te.split(ut).join(qe)}}var ot=te.indexOf("#");ot!==-1&&(this.hash=te.substr(ot),te=te.slice(0,ot));var st=te.indexOf("?");if(st!==-1?(this.search=te.substr(st),this.query=te.substr(st+1),J&&(this.query=H.parse(this.query)),te=te.slice(0,st)):J&&(this.search="",this.query={}),te&&(this.pathname=te),z[se]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){rt=this.pathname||"";var bt=this.search||"";this.path=rt+bt}return this.href=this.format(),this},a.prototype.format=function(){var N=this.auth||"";N&&(N=(N=encodeURIComponent(N)).replace(/%3A/i,":"),N+="@");var J=this.protocol||"",Y=this.pathname||"",K=this.hash||"",fe=!1,X="";this.host?fe=N+this.host:this.hostname&&(fe=N+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(fe+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(X=H.stringify(this.query));var te=this.search||X&&"?"+X||"";return J&&J.substr(-1)!==":"&&(J+=":"),this.slashes||(!J||z[J])&&fe!==!1?(fe="//"+(fe||""),Y&&Y.charAt(0)!=="/"&&(Y="/"+Y)):fe||(fe=""),K&&K.charAt(0)!=="#"&&(K="#"+K),te&&te.charAt(0)!=="?"&&(te="?"+te),J+fe+(Y=Y.replace(/[?#]/g,(function(ne){return encodeURIComponent(ne)})))+(te=te.replace("#","%23"))+K},a.prototype.resolve=function(N){return this.resolveObject(G(N,!1,!0)).format()},a.prototype.resolveObject=function(N){if(l.isString(N)){var J=new a;J.parse(N,!1,!0),N=J}for(var Y=new a,K=Object.keys(this),fe=0;fe<K.length;fe++){var X=K[fe];Y[X]=this[X]}if(Y.hash=N.hash,N.href==="")return Y.href=Y.format(),Y;if(N.slashes&&!N.protocol){for(var te=Object.keys(N),ne=0;ne<te.length;ne++){var ue=te[ne];ue!=="protocol"&&(Y[ue]=N[ue])}return z[Y.protocol]&&Y.hostname&&!Y.pathname&&(Y.path=Y.pathname="/"),Y.href=Y.format(),Y}if(N.protocol&&N.protocol!==Y.protocol){if(!z[N.protocol]){for(var se=Object.keys(N),$=0;$<se.length;$++){var re=se[$];Y[re]=N[re]}return Y.href=Y.format(),Y}if(Y.protocol=N.protocol,N.host||P[N.protocol])Y.pathname=N.pathname;else{for(var ge=(N.pathname||"").split("/");ge.length&&!(N.host=ge.shift()););N.host||(N.host=""),N.hostname||(N.hostname=""),ge[0]!==""&&ge.unshift(""),ge.length<2&&ge.unshift(""),Y.pathname=ge.join("/")}if(Y.search=N.search,Y.query=N.query,Y.host=N.host||"",Y.auth=N.auth,Y.hostname=N.hostname||N.host,Y.port=N.port,Y.pathname||Y.search){var me=Y.pathname||"",oe=Y.search||"";Y.path=me+oe}return Y.slashes=Y.slashes||N.slashes,Y.href=Y.format(),Y}var Q=Y.pathname&&Y.pathname.charAt(0)==="/",pe=N.host||N.pathname&&N.pathname.charAt(0)==="/",Ie=pe||Q||Y.host&&N.pathname,Fe=Ie,xe=Y.pathname&&Y.pathname.split("/")||[],Oe=(ge=N.pathname&&N.pathname.split("/")||[],Y.protocol&&!z[Y.protocol]);if(Oe&&(Y.hostname="",Y.port=null,Y.host&&(xe[0]===""?xe[0]=Y.host:xe.unshift(Y.host)),Y.host="",N.protocol&&(N.hostname=null,N.port=null,N.host&&(ge[0]===""?ge[0]=N.host:ge.unshift(N.host)),N.host=null),Ie=Ie&&(ge[0]===""||xe[0]==="")),pe)Y.host=N.host||N.host===""?N.host:Y.host,Y.hostname=N.hostname||N.hostname===""?N.hostname:Y.hostname,Y.search=N.search,Y.query=N.query,xe=ge;else if(ge.length)xe||(xe=[]),xe.pop(),xe=xe.concat(ge),Y.search=N.search,Y.query=N.query;else if(!l.isNullOrUndefined(N.search))return Oe&&(Y.hostname=Y.host=xe.shift(),(Be=!!(Y.host&&Y.host.indexOf("@")>0)&&Y.host.split("@"))&&(Y.auth=Be.shift(),Y.host=Y.hostname=Be.shift())),Y.search=N.search,Y.query=N.query,l.isNull(Y.pathname)&&l.isNull(Y.search)||(Y.path=(Y.pathname?Y.pathname:"")+(Y.search?Y.search:"")),Y.href=Y.format(),Y;if(!xe.length)return Y.pathname=null,Y.search?Y.path="/"+Y.search:Y.path=null,Y.href=Y.format(),Y;for(var Le=xe.slice(-1)[0],He=(Y.host||N.host||xe.length>1)&&(Le==="."||Le==="..")||Le==="",Te=0,ke=xe.length;ke>=0;ke--)(Le=xe[ke])==="."?xe.splice(ke,1):Le===".."?(xe.splice(ke,1),Te++):Te&&(xe.splice(ke,1),Te--);if(!Ie&&!Fe)for(;Te--;Te)xe.unshift("..");!Ie||xe[0]===""||xe[0]&&xe[0].charAt(0)==="/"||xe.unshift(""),He&&xe.join("/").substr(-1)!=="/"&&xe.push("");var Be,rt=xe[0]===""||xe[0]&&xe[0].charAt(0)==="/";return Oe&&(Y.hostname=Y.host=rt?"":xe.length?xe.shift():"",(Be=!!(Y.host&&Y.host.indexOf("@")>0)&&Y.host.split("@"))&&(Y.auth=Be.shift(),Y.host=Y.hostname=Be.shift())),(Ie=Ie||Y.host&&xe.length)&&!rt&&xe.unshift(""),xe.length?Y.pathname=xe.join("/"):(Y.pathname=null,Y.path=null),l.isNull(Y.pathname)&&l.isNull(Y.search)||(Y.path=(Y.pathname?Y.pathname:"")+(Y.search?Y.search:"")),Y.auth=N.auth||Y.auth,Y.slashes=Y.slashes||N.slashes,Y.href=Y.format(),Y},a.prototype.parseHost=function(){var N=this.host,J=g.exec(N);J&&((J=J[0])!==":"&&(this.port=J.substr(1)),N=N.substr(0,N.length-J.length)),N&&(this.hostname=N)}},function(t,r,i){(function(o,l){var a;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(h){r&&r.nodeType,o&&o.nodeType;var g=typeof l=="object"&&l;g.global!==g&&g.window!==g&&g.self;var m,x=2147483647,w=/^xn--/,_=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,O=String.fromCharCode;function P(X){throw new RangeError(R[X])}function z(X,te){for(var ne=X.length,ue=[];ne--;)ue[ne]=te(X[ne]);return ue}function H(X,te){var ne=X.split("@"),ue="";return ne.length>1&&(ue=ne[0]+"@",X=ne[1]),ue+z((X=X.replace(S,".")).split("."),te).join(".")}function G(X){for(var te,ne,ue=[],se=0,$=X.length;se<$;)(te=X.charCodeAt(se++))>=55296&&te<=56319&&se<$?(64512&(ne=X.charCodeAt(se++)))==56320?ue.push(((1023&te)<<10)+(1023&ne)+65536):(ue.push(te),se--):ue.push(te);return ue}function N(X){return z(X,(function(te){var ne="";return te>65535&&(ne+=O((te-=65536)>>>10&1023|55296),te=56320|1023&te),ne+=O(te)})).join("")}function J(X,te){return X+22+75*(X<26)-((te!=0)<<5)}function Y(X,te,ne){var ue=0;for(X=ne?k(X/700):X>>1,X+=k(X/te);X>455;ue+=36)X=k(X/35);return k(ue+36*X/(X+38))}function K(X){var te,ne,ue,se,$,re,ge,me,oe,Q,pe,Ie=[],Fe=X.length,xe=0,Oe=128,Le=72;for((ne=X.lastIndexOf("-"))<0&&(ne=0),ue=0;ue<ne;++ue)X.charCodeAt(ue)>=128&&P("not-basic"),Ie.push(X.charCodeAt(ue));for(se=ne>0?ne+1:0;se<Fe;){for($=xe,re=1,ge=36;se>=Fe&&P("invalid-input"),((me=(pe=X.charCodeAt(se++))-48<10?pe-22:pe-65<26?pe-65:pe-97<26?pe-97:36)>=36||me>k((x-xe)/re))&&P("overflow"),xe+=me*re,!(me<(oe=ge<=Le?1:ge>=Le+26?26:ge-Le));ge+=36)re>k(x/(Q=36-oe))&&P("overflow"),re*=Q;Le=Y(xe-$,te=Ie.length+1,$==0),k(xe/te)>x-Oe&&P("overflow"),Oe+=k(xe/te),xe%=te,Ie.splice(xe++,0,Oe)}return N(Ie)}function fe(X){var te,ne,ue,se,$,re,ge,me,oe,Q,pe,Ie,Fe,xe,Oe,Le=[];for(Ie=(X=G(X)).length,te=128,ne=0,$=72,re=0;re<Ie;++re)(pe=X[re])<128&&Le.push(O(pe));for(ue=se=Le.length,se&&Le.push("-");ue<Ie;){for(ge=x,re=0;re<Ie;++re)(pe=X[re])>=te&&pe<ge&&(ge=pe);for(ge-te>k((x-ne)/(Fe=ue+1))&&P("overflow"),ne+=(ge-te)*Fe,te=ge,re=0;re<Ie;++re)if((pe=X[re])<te&&++ne>x&&P("overflow"),pe==te){for(me=ne,oe=36;!(me<(Q=oe<=$?1:oe>=$+26?26:oe-$));oe+=36)Oe=me-Q,xe=36-Q,Le.push(O(J(Q+Oe%xe,0))),me=k(Oe/xe);Le.push(O(J(me,0))),$=Y(ne,Fe,ue==se),ne=0,++ue}++ne,++te}return Le.join("")}m={version:"1.4.1",ucs2:{decode:G,encode:N},decode:K,encode:fe,toASCII:function(X){return H(X,(function(te){return _.test(te)?"xn--"+fe(te):te}))},toUnicode:function(X){return H(X,(function(te){return w.test(te)?K(te.slice(4).toLowerCase()):te}))}},(a=(function(){return m}).call(r,i,r,o))===void 0||(o.exports=a)})()}).call(this,i(35)(t),i(36))},function(t,r){t.exports=function(i){return i.webpackPolyfill||(i.deprecate=function(){},i.paths=[],i.children||(i.children=[]),Object.defineProperty(i,"loaded",{enumerable:!0,get:function(){return i.l}}),Object.defineProperty(i,"id",{enumerable:!0,get:function(){return i.i}}),i.webpackPolyfill=1),i}},function(t,r){var i;i=(function(){return this})();try{i=i||new Function("return this")()}catch{typeof window=="object"&&(i=window)}t.exports=i},function(t,r,i){t.exports={isString:function(o){return typeof o=="string"},isObject:function(o){return typeof o=="object"&&o!==null},isNull:function(o){return o===null},isNullOrUndefined:function(o){return o==null}}},function(t,r,i){r.decode=r.parse=i(39),r.encode=r.stringify=i(40)},function(t,r,i){function o(a,h){return Object.prototype.hasOwnProperty.call(a,h)}t.exports=function(a,h,g,m){h=h||"&",g=g||"=";var x={};if(typeof a!="string"||a.length===0)return x;var w=/\+/g;a=a.split(h);var _=1e3;m&&typeof m.maxKeys=="number"&&(_=m.maxKeys);var S=a.length;_>0&&S>_&&(S=_);for(var R=0;R<S;++R){var k,O,P,z,H=a[R].replace(w,"%20"),G=H.indexOf(g);G>=0?(k=H.substr(0,G),O=H.substr(G+1)):(k=H,O=""),P=decodeURIComponent(k),z=decodeURIComponent(O),o(x,P)?l(x[P])?x[P].push(z):x[P]=[x[P],z]:x[P]=z}return x};var l=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}},function(t,r,i){var o=function(g){switch(typeof g){case"string":return g;case"boolean":return g?"true":"false";case"number":return isFinite(g)?g:"";default:return""}};t.exports=function(g,m,x,w){return m=m||"&",x=x||"=",g===null&&(g=void 0),typeof g=="object"?a(h(g),(function(_){var S=encodeURIComponent(o(_))+x;return l(g[_])?a(g[_],(function(R){return S+encodeURIComponent(o(R))})).join(m):S+encodeURIComponent(o(g[_]))})).join(m):w?encodeURIComponent(o(w))+x+encodeURIComponent(o(g)):""};var l=Array.isArray||function(g){return Object.prototype.toString.call(g)==="[object Array]"};function a(g,m){if(g.map)return g.map(m);for(var x=[],w=0;w<g.length;w++)x.push(m(g[w],w));return x}var h=Object.keys||function(g){var m=[];for(var x in g)Object.prototype.hasOwnProperty.call(g,x)&&m.push(x);return m}}])}))})(Ib)),Ib.exports}var iF=rF();const oF=L1(iF),Qe={container:"table-up-container",tableCaption:"table-up-caption",tableWrapper:"table-up",tableMain:"table-up-main",tableColgroup:"table-up-colgroup",tableCol:"table-up-col",tableBody:"table-up-body",tableRow:"table-up-row",tableCell:"table-up-cell",tableCellInner:"table-up-cell-inner"},Ss={colMinWidthPre:5,colMinWidthPx:40,colDefaultWidth:100,rowMinHeightPx:36},av={AFTER_TABLE_RESIZE:"after-table-resize"},kb={moduleName:"table-up"},lF=[["rgb(255, 255, 255)","rgb(0, 0, 0)","rgb(72, 83, 104)","rgb(41, 114, 244)","rgb(0, 163, 245)","rgb(49, 155, 98)","rgb(222, 60, 54)","rgb(248, 136, 37)","rgb(245, 196, 0)","rgb(153, 56, 215)"],["rgb(242, 242, 242)","rgb(127, 127, 127)","rgb(243, 245, 247)","rgb(229, 239, 255)","rgb(229, 246, 255)","rgb(234, 250, 241)","rgb(254, 233, 232)","rgb(254, 243, 235)","rgb(254, 249, 227)","rgb(253, 235, 255)"],["rgb(216, 216, 216)","rgb(89, 89, 89)","rgb(197, 202, 211)","rgb(199, 220, 255)","rgb(199, 236, 255)","rgb(195, 234, 213)","rgb(255, 201, 199)","rgb(255, 220, 196)","rgb(255, 238, 173)","rgb(242, 199, 255)"],["rgb(191, 191, 191)","rgb(63, 63, 63)","rgb(128, 139, 158)","rgb(153, 190, 255)","rgb(153, 221, 255)","rgb(152, 215, 182)","rgb(255, 156, 153)","rgb(255, 186, 132)","rgb(255, 226, 112)","rgb(213, 142, 255)"],["rgb(165, 165, 165)","rgb(38, 38, 38)","rgb(53, 59, 69)","rgb(20, 80, 184)","rgb(18, 116, 165)","rgb(39, 124, 79)","rgb(158, 30, 26)","rgb(184, 96, 20)","rgb(163, 130, 0)","rgb(94, 34, 129)"],["rgb(147, 147, 147)","rgb(13, 13, 13)","rgb(36, 39, 46)","rgb(12, 48, 110)","rgb(10, 65, 92)","rgb(24, 78, 50)","rgb(88, 17, 14)","rgb(92, 48, 10)","rgb(102, 82, 0)","rgb(59, 21, 81)"]],sF="table-up",aF=new Set([Qe.tableCellInner]),cF=n=>aF.has(n.statics.blotName);function i_(n){return n&&n.parent?cF(n.parent)?!0:i_(n.parent):!1}function cu(n,e=sF){let t=e?`${e}-`:"";return{b:()=>`${t}${n}`,be:r=>r?`${t}${n}__${r}`:"",bm:r=>r?`${t}${n}--${r}`:"",bem:(r,i)=>r&&i?`${t}${n}__${r}--${i}`:"",ns:r=>r?`${t}${r}`:"",bs:r=>r?`${t}${n}-${r}`:"",cv:r=>r?`--${t}${r}`:"",is:r=>`is-${r}`}}function Kl(n,e){let t=n.parent;for(;t&&t.statics.blotName!==e&&t!==n.scroll;)t=t.parent;if(t===n.scroll)throw Error(`${n.statics.blotName} must be a child of ${e}`);return t}function A1(n,e){let t=Array(e.length),r=new Map(e.map((o,l)=>[o,l])),i=n.parent;for(;i&&i!==n.scroll&&r.size!==0;){if(r.has(i.statics.blotName)){let o=r.get(i.statics.blotName);t[o]=i,r.delete(i.statics.blotName)}i=i.parent}if(r.size>0)throw Error(`${n.statics.blotName} must be a child of ${Array.from(r.keys()).join(", ")}`);return t}function hw(n){let e=new Map,t=n;for(;t&&t.statics.blotName!=="scroll";)e.set(t.statics.blotName,t),t=t.parent;return e}function uF(n,e){let t=[],r=n.children.iterator(),i=null;for(;i=r();)i instanceof e&&t.push(i);return t}function fF(n,e,t){for(let r of Object.getOwnPropertyNames(e))t&&t.test(r)||Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r));return n}function hF(n,e){let t=class extends n{constructor(...r){super(...r)}};for(let r of e)fF(t.prototype,r.prototype,/^constructor$/);return t}function I0(n,e){return n.prototype instanceof e}function b1(n,e){return n=Math.min(e,Math.max(0,Number.parseFloat(`${n}`))),Math.abs(n-e)<1e-6?1:n%e/Number.parseFloat(e)}function dw(n){return{h:Math.min(360,Math.max(0,n.h)),s:Math.min(100,Math.max(0,n.s)),b:Math.min(100,Math.max(0,n.b)),a:Math.min(1,Math.max(0,n.a))}}function dF(n){n=n.startsWith("#")?n.slice(1):n;let e=Number.parseInt(n.slice(0,2),16),t=Number.parseInt(n.slice(2,4),16),r=Number.parseInt(n.slice(4,6),16),i=Number((Number.parseInt(n.slice(6,8)||"ff",16)/255).toFixed(2));return{r:e,g:t,b:r,a:i}}function gw(n){let{r:e,g:t,b:r,a:i}=n;e=b1(e,255),t=b1(t,255),r=b1(r,255);let o=Math.max(e,t,r),l=Math.min(e,t,r),a,h=o,g=o-l,m=o===0?0:g/o;if(o===l)a=0;else{switch(o){case e:a=(t-r)/g+(t<r?6:0);break;case t:a=(r-e)/g+2;break;case r:a=(e-t)/g+4;break}a/=6}return{h:a*360,s:m*100,b:h*100,a:i}}function K0(n){let{h:e,s:t,b:r,a:i}=n;e=b1(e,360)*6,t=b1(t,100),r=b1(r,100);let o=Math.floor(e),l=e-o,a=r*(1-t),h=r*(1-l*t),g=r*(1-(1-l)*t),m=o%6,x=[r,h,a,a,g,r][m],w=[g,r,r,h,a,a][m],_=[a,a,g,r,r,h][m];return{r:Math.round(x*255),g:Math.round(w*255),b:Math.round(_*255),a:i}}function o_(n){let e=[n.r.toString(16),n.g.toString(16),n.b.toString(16),Math.round(n.a*255).toString(16)];for(let t in e)e[t].length===1&&(e[t]=`0${e[t]}`);return e.join("")}const pw=n=>o_(K0(n)),nm=n=>typeof n=="function",l_=Array.isArray,Lg=n=>typeof n=="string",gF=n=>typeof n=="number",k0=n=>typeof n=="object"&&!!n,pF=n=>!Number.isNaN(n)&&Number(n)>0,vF=n=>l_(n)?n:[n];function cv(n){let{type:e="default",content:t}=n||{},r=cu("button"),i=document.createElement("button");return i.classList.add(r.b(),e),t&&(Lg(t)?i.textContent=t:i.appendChild(t)),i}function bF(n={}){let e=230,t=150,r=10,i=gw(dF(n.color||"#ff0000")),o=cu("color-picker"),l=document.createElement("div");l.classList.add(o.b());let a=document.createElement("div");a.classList.add(o.be("content"));let h=document.createElement("div");h.classList.add(o.be("selector"));let g=document.createElement("div");g.classList.add(o.be("background")),h.appendChild(g);let m=document.createElement("div");m.classList.add(o.be("background-handle")),g.appendChild(m);let x=document.createElement("div");x.classList.add(o.be("alpha"));let w=document.createElement("div");w.classList.add(o.be("alpha-bg"));let _=document.createElement("div");_.classList.add(o.be("alpha-handle")),x.appendChild(w),x.appendChild(_);let S=document.createElement("div");S.classList.add(o.be("hue"));let R=document.createElement("div");R.classList.add(o.be("hue-handle")),S.appendChild(R);let k=document.createElement("div");k.classList.add(o.be("action"));let[O,P,z,H]=["r","g","b","a"].map(Oe=>{let Le=document.createElement("div");Le.classList.add(o.be("action-item"),Oe);let He=document.createElement("label");He.textContent=Oe.toUpperCase();let Te=document.createElement("input");return Te.classList.add(o.be("input")),Te.addEventListener("input",()=>{Te.value=Te.value.replaceAll(/[^0-9]/g,"")}),Te.addEventListener("change",()=>{let ke=Math.round(Number(Te.value));Oe==="a"&&(ke/=100);let Be=dw(gw(Object.assign({},K0(i),{[Oe]:ke})));se(Be),ue()}),Le.appendChild(He),Le.appendChild(Te),k.appendChild(Le),Te});a.appendChild(S),a.appendChild(h),a.appendChild(x),l.appendChild(a),l.appendChild(k);let G=!1,N=!1,J=!1;function Y(){let Oe=pw(i);for(let[Le,He]of[O,P,z].entries())He.value=String(Number.parseInt(Oe[Le*2]+Oe[Le*2+1],16));H.value=String((i.a*100).toFixed(0))}function K(){Object.assign(m.style,{left:`${Math.floor(e*i.s/100)}px`,top:`${Math.floor(t*(100-i.b)/100)}px`})}function fe(){h.style.backgroundColor=`#${o_(K0({h:i.h,s:100,b:100,a:1}))}`}function X(){R.style.top=`${Math.floor(t-t*i.h/360)}px`}function te(){_.style.left=`${i.a*100}%`}function ne(){let{r:Oe,g:Le,b:He}=K0(i);w.style.background=`linear-gradient(to right, rgba(${Oe}, ${Le}, ${He}, 0) 0%, rgba(${Oe}, ${Le}, ${He}, 1) 100%)`}function ue(){K(),fe(),X(),te(),ne(),Y()}function se(Oe){i=dw(Object.assign({},i,Oe)),Y(),n.onChange&&n.onChange(`#${pw(i)}`)}function $(Oe){let Le=h.getBoundingClientRect(),He=Le.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),Te=Le.left+document.body.scrollLeft,ke=Math.floor(100*Math.max(0,Math.min(e,Oe.pageX-Te))/e),Be=Math.floor(100*(t-Math.max(0,Math.min(t,Oe.pageY-He)))/t);se({s:ke,b:Be}),ue()}function re(Oe){let Le=S.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);se({h:Math.floor(360*(t-Math.max(0,Math.min(t,Oe.pageY-Le)))/t)}),ue()}function ge(Oe){let{pageX:Le}=Oe,He=x.getBoundingClientRect(),Te=Le-He.left;Te=Math.max(r/2,Te),Te=Math.min(Te,He.width-r/2),se({a:Math.round((Te-10/2)/(He.width-10)*100)/100}),ue()}function me(Oe){G&&(Oe.preventDefault(),$(Oe)),N&&(Oe.preventDefault(),re(Oe)),J&&(Oe.preventDefault(),ge(Oe))}function oe(){document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",oe),G=!1}function Q(Oe){document.addEventListener("mousemove",me),document.addEventListener("mouseup",oe),G=!0,$(Oe)}h.addEventListener("mousedown",Q);function pe(){document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",pe),N=!1}function Ie(Oe){document.addEventListener("mousemove",me),document.addEventListener("mouseup",pe),N=!0,re(Oe)}S.addEventListener("mousedown",Ie);function Fe(){document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",Fe),J=!1}function xe(Oe){document.addEventListener("mousemove",me),document.addEventListener("mouseup",Fe),J=!0,ge(Oe)}return x.addEventListener("mousedown",xe),ue(),l}let vw=8e3;function s_({child:n,target:e=document.body,beforeClose:t=()=>{}}={}){let r=cu("dialog"),i=e,o=document.createElement("div");o.classList.add(r.b()),o.style.zIndex=String(vw);let l=document.createElement("div");if(l.classList.add(r.be("overlay")),o.appendChild(l),n){let g=document.createElement("div");g.classList.add(r.be("content")),g.appendChild(n),l.appendChild(g),g.addEventListener("click",m=>{m.stopPropagation()})}let a=getComputedStyle(i).overflow;i.style.overflow="hidden",i.appendChild(o);let h=()=>{t(),o.remove(),i.style.overflow=a};return o.addEventListener("click",h),vw+=1,{dialog:o,close:h}}function bw(n,e){let t=cu("input");e.type||(e.type="text"),e.value||(e.value="");let r=document.createElement("div");if(r.classList.add(t.be("item")),n){let a=document.createElement("span");a.classList.add(t.be("label")),a.textContent=n,r.appendChild(a)}let i=document.createElement("div");i.classList.add(t.be("input"));let o=document.createElement("input");for(let a in e)o.setAttribute(a,e[a]);return(e.max||e.min)&&o.addEventListener("blur",()=>{e.max&&e.max<=Number(o.value)&&(o.value=String(e.max)),e.min&&e.min>=Number(o.value)&&(o.value=String(e.min))}),i.appendChild(o),r.appendChild(i),o.addEventListener("focus",()=>{i.classList.add("focus")}),o.addEventListener("blur",()=>{i.classList.remove("focus")}),{item:r,input:o,errorTip:a=>{let h;return i.classList.contains("error")?h=i.querySelector(`.${t.be("error-tip")}`):(h=document.createElement("span"),h.classList.add(t.be("error-tip")),i.appendChild(h)),h.textContent=a,i.classList.add("error"),{removeError:()=>{i.classList.remove("error"),h.remove()}}}}}async function yF(n={}){let e=cu("creator"),t=document.createElement("div");t.classList.add(e.b());let r=document.createElement("div");r.classList.add(e.be("input"));let{item:i,input:o,errorTip:l}=bw(n.rowText||"Row",{type:"number",value:String(n.row||""),max:99}),{item:a,input:h,errorTip:g}=bw(n.colText||"Column",{type:"number",value:String(n.col||""),max:99});r.appendChild(i),r.appendChild(a),t.appendChild(r);let m=document.createElement("div");m.classList.add(e.be("control"));let x=cv({type:"confirm",content:n.confirmText||"Confirm"}),w=cv({type:"default",content:n.cancelText||"Cancel"});m.appendChild(x),m.appendChild(w),t.appendChild(m);let _=(R=Number(o.value),k=Number(h.value))=>{if(Number.isNaN(R)||R<=0){l(n.notPositiveNumberError||"Please enter a positive integer");return}if(Number.isNaN(k)||k<=0){g(n.notPositiveNumberError||"Please enter a positive integer");return}return{row:R,col:k}},S=R=>{R.key==="Escape"&&(close(),document.removeEventListener("keydown",S))};return new Promise((R,k)=>{let{close:O}=s_({child:t,beforeClose:k});o.focus();for(let P of[o,h])P.addEventListener("keydown",z=>{if(z.key==="Enter"){let H=_();H&&(R(H),O())}});x.addEventListener("click",async()=>{let P=_();P&&(R(P),O())}),document.addEventListener("keydown",S),w.addEventListener("click",O)})}function mF(n={}){let e=cu("select-box"),t=document.createElement("div");t.classList.add(e.b());let r=document.createElement("div");r.classList.add(e.be("block"));for(let o=0;o<(n.row||8);o++)for(let l=0;l<(n.col||8);l++){let a=document.createElement("div");a.classList.add(e.be("item")),a.dataset.row=String(o+1),a.dataset.col=String(l+1),r.appendChild(a)}let i=()=>{let{row:o,col:l}=t.dataset;for(let h of Array.from(r.querySelectorAll(".active")))h.classList.remove("active");if(!o||!l)return;let a=Array.from(r.children);for(let h=0;h<a.length;h++){let{row:g,col:m}=a[h].dataset;if(g>o&&m>l)return;g<=o&&m<=l?a[h].classList.add("active"):a[h].classList.remove("active")}};if(r.addEventListener("mousemove",o=>{if(!o.target)return;let{row:l,col:a}=o.target.dataset;!l||!a||(t.dataset.row=l,t.dataset.col=a,i())}),r.addEventListener("mouseleave",()=>{t.removeAttribute("data-row"),t.removeAttribute("data-col"),i()}),r.addEventListener("click",()=>{let{row:o,col:l}=t.dataset;!o||!l||n.onSelect&&n.onSelect(Number(o),Number(l))}),t.appendChild(r),n.customBtn){let o=n.texts||{},l=document.createElement("div");l.classList.add(e.be("custom")),l.textContent=o.customBtnText||"Custom",l.addEventListener("click",async()=>{let a=await yF(o);a&&n.onSelect&&n.onSelect(a.row,a.col)}),t.appendChild(l)}return t}const uv=Math.min,Og=Math.max,fv=Math.round,M0=Math.floor,td=n=>({x:n,y:n}),xF={left:"right",right:"left",bottom:"top",top:"bottom"},wF={start:"end",end:"start"};function yw(n,e,t){return Og(n,uv(e,t))}function R1(n,e){return typeof n=="function"?n(e):n}function cg(n){return n.split("-")[0]}function Dv(n){return n.split("-")[1]}function Zm(n){return n==="x"?"y":"x"}function a_(n){return n==="y"?"height":"width"}function Ed(n){return["top","bottom"].includes(cg(n))?"y":"x"}function c_(n){return Zm(Ed(n))}function CF(n,e,t){t===void 0&&(t=!1);let r=Dv(n),i=c_(n),o=a_(i),l=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=hv(l)),[l,hv(l)]}function _F(n){let e=hv(n);return[rm(n),e,rm(e)]}function rm(n){return n.replace(/start|end/g,e=>wF[e])}function SF(n,e,t){let r=["left","right"],i=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?o:l;default:return[]}}function EF(n,e,t,r){let i=Dv(n),o=SF(cg(n),t==="start",r);return i&&(o=o.map(l=>l+"-"+i),e&&(o=o.concat(o.map(rm)))),o}function hv(n){return n.replace(/left|right|bottom|top/g,e=>xF[e])}function TF(n){return{top:0,right:0,bottom:0,left:0,...n}}function AF(n){return typeof n=="number"?{top:n,right:n,bottom:n,left:n}:TF(n)}function dv(n){let{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function mw(n,e,t){let{reference:r,floating:i}=n,o=Ed(e),l=c_(e),a=a_(l),h=cg(e),g=o==="y",m=r.x+r.width/2-i.width/2,x=r.y+r.height/2-i.height/2,w=r[a]/2-i[a]/2,_;switch(h){case"top":_={x:m,y:r.y-i.height};break;case"bottom":_={x:m,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:x};break;case"left":_={x:r.x-i.width,y:x};break;default:_={x:r.x,y:r.y}}switch(Dv(e)){case"start":_[l]-=w*(t&&g?-1:1);break;case"end":_[l]+=w*(t&&g?-1:1);break}return _}const RF=async(n,e,t)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=t,a=o.filter(Boolean),h=await(l.isRTL==null?void 0:l.isRTL(e)),g=await l.getElementRects({reference:n,floating:e,strategy:i}),{x:m,y:x}=mw(g,r,h),w=r,_={},S=0;for(let R=0;R<a.length;R++){let{name:k,fn:O}=a[R],{x:P,y:z,data:H,reset:G}=await O({x:m,y:x,initialPlacement:r,placement:w,strategy:i,middlewareData:_,rects:g,platform:l,elements:{reference:n,floating:e}});m=P??m,x=z??x,_={..._,[k]:{..._[k],...H}},G&&S<=50&&(S++,typeof G=="object"&&(G.placement&&(w=G.placement),G.rects&&(g=G.rects===!0?await l.getElementRects({reference:n,floating:e,strategy:i}):G.rects),{x:m,y:x}=mw(g,w,h)),R=-1)}return{x:m,y:x,placement:w,strategy:i,middlewareData:_}};async function u_(n,e){e===void 0&&(e={});let{x:t,y:r,platform:i,rects:o,elements:l,strategy:a}=n,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:x=!1,padding:w=0}=R1(e,n),_=AF(w),S=m==="floating"?"reference":"floating",R=l[x?S:m],k=dv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(R))??!0?R:R.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:h,rootBoundary:g,strategy:a})),O=m==="floating"?{x:t,y:r,width:o.floating.width,height:o.floating.height}:o.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),z=await(i.isElement==null?void 0:i.isElement(P))&&await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1},H=dv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:O,offsetParent:P,strategy:a}):O);return{top:(k.top-H.top+_.top)/z.y,bottom:(H.bottom-k.bottom+_.bottom)/z.y,left:(k.left-H.left+_.left)/z.x,right:(H.right-k.right+_.right)/z.x}}const IF=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var fe,X,te,ne;var t;let{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:a,elements:h}=e,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:S=!0,...R}=R1(n,e);if((t=i.arrow)!=null&&t.alignmentOffset)return{};let k=cg(r),O=Ed(l),P=cg(l)===l,z=await(a.isRTL==null?void 0:a.isRTL(h.floating)),H=x||(P||!S?[hv(l)]:_F(l)),G=_!=="none";!x&&G&&H.push(...EF(l,S,_,z));let N=[l,...H],J=await u_(e,R),Y=[],K=((fe=i.flip)==null?void 0:fe.overflows)||[];if(g&&Y.push(J[k]),m){let ue=CF(r,o,z);Y.push(J[ue[0]],J[ue[1]])}if(K=[...K,{placement:r,overflows:Y}],!Y.every(ue=>ue<=0)){let ue=(((X=i.flip)==null?void 0:X.index)||0)+1,se=N[ue];if(se&&(!(m==="alignment"?O!==Ed(se):!1)||K.every(ge=>ge.overflows[0]>0&&Ed(ge.placement)===O)))return{data:{index:ue,overflows:K},reset:{placement:se}};let $=(te=K.filter(re=>re.overflows[0]<=0).sort((re,ge)=>re.overflows[1]-ge.overflows[1])[0])==null?void 0:te.placement;if(!$)switch(w){case"bestFit":{let re=(ne=K.filter(ge=>{if(G){let me=Ed(ge.placement);return me===O||me==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(me=>me>0).reduce((me,oe)=>me+oe,0)]).sort((ge,me)=>ge[1]-me[1])[0])==null?void 0:ne[0];re&&($=re);break}case"initialPlacement":$=l;break}if(r!==$)return{reset:{placement:$}}}return{}}}};async function kF(n,e){let{placement:t,platform:r,elements:i}=n,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=cg(t),a=Dv(t),h=Ed(t)==="y",g=["left","top"].includes(l)?-1:1,m=o&&h?-1:1,x=R1(e,n),{mainAxis:w,crossAxis:_,alignmentAxis:S}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return a&&typeof S=="number"&&(_=a==="end"?S*-1:S),h?{x:_*m,y:w*g}:{x:w*g,y:_*m}}const MF=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var h;var t;let{x:r,y:i,placement:o,middlewareData:l}=e,a=await kF(e,n);return o===((h=l.offset)==null?void 0:h.placement)&&(t=l.arrow)!=null&&t.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:o}}}}},LF=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:a={fn:k=>{let{x:O,y:P}=k;return{x:O,y:P}}},...h}=R1(n,e),g={x:t,y:r},m=await u_(e,h),x=Ed(cg(i)),w=Zm(x),_=g[w],S=g[x];if(o){let k=w==="y"?"top":"left",O=w==="y"?"bottom":"right",P=_+m[k],z=_-m[O];_=yw(P,_,z)}if(l){let k=x==="y"?"top":"left",O=x==="y"?"bottom":"right",P=S+m[k],z=S-m[O];S=yw(P,S,z)}let R=a.fn({...e,[w]:_,[x]:S});return{...R,data:{x:R.x-t,y:R.y-r,enabled:{[w]:o,[x]:l}}}}}},OF=function(n){return n===void 0&&(n={}),{options:n,fn(e){var O,P;let{x:t,y:r,placement:i,rects:o,middlewareData:l}=e,{offset:a=0,mainAxis:h=!0,crossAxis:g=!0}=R1(n,e),m={x:t,y:r},x=Ed(i),w=Zm(x),_=m[w],S=m[x],R=R1(a,e),k=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:0,crossAxis:0,...R};if(h){let z=w==="y"?"height":"width",H=o.reference[w]-o.floating[z]+k.mainAxis,G=o.reference[w]+o.reference[z]-k.mainAxis;_<H?_=H:_>G&&(_=G)}if(g){let z=w==="y"?"width":"height",H=["top","left"].includes(cg(i)),G=o.reference[x]-o.floating[z]+(H&&((O=l.offset)==null?void 0:O[x])||0)+(H?0:k.crossAxis),N=o.reference[x]+o.reference[z]+(H?0:((P=l.offset)==null?void 0:P[x])||0)-(H?k.crossAxis:0);S<G?S=G:S>N&&(S=N)}return{[w]:_,[x]:S}}}};function Nv(){return typeof window<"u"}function D1(n){return f_(n)?(n.nodeName||"").toLowerCase():"#document"}function Bf(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function ad(n){var e;return(e=(f_(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function f_(n){return Nv()?n instanceof Node||n instanceof Bf(n).Node:!1}function Dh(n){return Nv()?n instanceof Element||n instanceof Bf(n).Element:!1}function od(n){return Nv()?n instanceof HTMLElement||n instanceof Bf(n).HTMLElement:!1}function xw(n){return!Nv()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Bf(n).ShadowRoot}function Zp(n){let{overflow:e,overflowX:t,overflowY:r,display:i}=Nh(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function PF(n){return["table","td","th"].includes(D1(n))}function Fv(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function Xm(n){let e=Km(),t=Dh(n)?Nh(n):n;return["transform","translate","scale","rotate","perspective"].some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function DF(n){let e=ug(n);for(;od(e)&&!I1(e);){if(Xm(e))return e;if(Fv(e))return null;e=ug(e)}return null}function Km(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function I1(n){return["html","body","#document"].includes(D1(n))}function Nh(n){return Bf(n).getComputedStyle(n)}function Bv(n){return Dh(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ug(n){if(D1(n)==="html")return n;let e=n.assignedSlot||n.parentNode||xw(n)&&n.host||ad(n);return xw(e)?e.host:e}function h_(n){let e=ug(n);return I1(e)?n.ownerDocument?n.ownerDocument.body:n.body:od(e)&&Zp(e)?e:h_(e)}function Dp(n,e,t){var l;e===void 0&&(e=[]),t===void 0&&(t=!0);let r=h_(n),i=r===((l=n.ownerDocument)==null?void 0:l.body),o=Bf(r);if(i){let a=im(o);return e.concat(o,o.visualViewport||[],Zp(r)?r:[],a&&t?Dp(a):[])}return e.concat(r,Dp(r,[],t))}function im(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function d_(n){let e=Nh(n),t=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=od(n),o=i?n.offsetWidth:t,l=i?n.offsetHeight:r,a=fv(t)!==o||fv(r)!==l;return a&&(t=o,r=l),{width:t,height:r,$:a}}function Jm(n){return Dh(n)?n:n.contextElement}function y1(n){let e=Jm(n);if(!od(e))return td(1);let t=e.getBoundingClientRect(),{width:r,height:i,$:o}=d_(e),l=(o?fv(t.width):t.width)/r,a=(o?fv(t.height):t.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const NF=td(0);function g_(n){let e=Bf(n);return!Km()||!e.visualViewport?NF:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function FF(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Bf(n)?!1:e}function Fg(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=n.getBoundingClientRect(),o=Jm(n),l=td(1);e&&(r?Dh(r)&&(l=y1(r)):l=y1(n));let a=FF(o,t,r)?g_(o):td(0),h=(i.left+a.x)/l.x,g=(i.top+a.y)/l.y,m=i.width/l.x,x=i.height/l.y;if(o){let w=Bf(o),_=r&&Dh(r)?Bf(r):r,S=w,R=im(S);for(;R&&r&&_!==S;){let k=y1(R),O=R.getBoundingClientRect(),P=Nh(R),z=O.left+(R.clientLeft+parseFloat(P.paddingLeft))*k.x,H=O.top+(R.clientTop+parseFloat(P.paddingTop))*k.y;h*=k.x,g*=k.y,m*=k.x,x*=k.y,h+=z,g+=H,S=Bf(R),R=im(S)}}return dv({width:m,height:x,x:h,y:g})}function Qm(n,e){let t=Bv(n).scrollLeft;return e?e.left+t:Fg(ad(n)).left+t}function p_(n,e,t){t===void 0&&(t=!1);let r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:Qm(n,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function BF(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n,o=i==="fixed",l=ad(r),a=e?Fv(e.floating):!1;if(r===l||a&&o)return t;let h={scrollLeft:0,scrollTop:0},g=td(1),m=td(0),x=od(r);if((x||!x&&!o)&&((D1(r)!=="body"||Zp(l))&&(h=Bv(r)),od(r))){let _=Fg(r);g=y1(r),m.x=_.x+r.clientLeft,m.y=_.y+r.clientTop}let w=l&&!x&&!o?p_(l,h,!0):td(0);return{width:t.width*g.x,height:t.height*g.y,x:t.x*g.x-h.scrollLeft*g.x+m.x+w.x,y:t.y*g.y-h.scrollTop*g.y+m.y+w.y}}function zF(n){return Array.from(n.getClientRects())}function HF(n){let e=ad(n),t=Bv(n),r=n.ownerDocument.body,i=Og(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Og(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),l=-t.scrollLeft+Qm(n),a=-t.scrollTop;return Nh(r).direction==="rtl"&&(l+=Og(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:a}}function WF(n,e){let t=Bf(n),r=ad(n),i=t.visualViewport,o=r.clientWidth,l=r.clientHeight,a=0,h=0;if(i){o=i.width,l=i.height;let g=Km();(!g||g&&e==="fixed")&&(a=i.offsetLeft,h=i.offsetTop)}return{width:o,height:l,x:a,y:h}}function UF(n,e){let t=Fg(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,o=od(n)?y1(n):td(1),l=n.clientWidth*o.x,a=n.clientHeight*o.y,h=i*o.x,g=r*o.y;return{width:l,height:a,x:h,y:g}}function ww(n,e,t){let r;if(e==="viewport")r=WF(n,t);else if(e==="document")r=HF(ad(n));else if(Dh(e))r=UF(e,t);else{let i=g_(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return dv(r)}function v_(n,e){let t=ug(n);return t===e||!Dh(t)||I1(t)?!1:Nh(t).position==="fixed"||v_(t,e)}function GF(n,e){let t=e.get(n);if(t)return t;let r=Dp(n,[],!1).filter(a=>Dh(a)&&D1(a)!=="body"),i=null,o=Nh(n).position==="fixed",l=o?ug(n):n;for(;Dh(l)&&!I1(l);){let a=Nh(l),h=Xm(l);!h&&a.position==="fixed"&&(i=null),(o?!h&&!i:!h&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Zp(l)&&!h&&v_(n,l))?r=r.filter(m=>m!==l):i=a,l=ug(l)}return e.set(n,r),r}function YF(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n,o=t==="clippingAncestors"?Fv(e)?[]:GF(e,this._c):[].concat(t),l=[...o,r],a=l[0],h=l.reduce((g,m)=>{let x=ww(e,m,i);return g.top=Og(x.top,g.top),g.right=uv(x.right,g.right),g.bottom=uv(x.bottom,g.bottom),g.left=Og(x.left,g.left),g},ww(e,a,i));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function VF(n){let{width:e,height:t}=d_(n);return{width:e,height:t}}function ZF(n,e,t){let r=od(e),i=ad(e),o=t==="fixed",l=Fg(n,!0,o,e),a={scrollLeft:0,scrollTop:0},h=td(0);function g(){h.x=Qm(i)}if(r||!r&&!o)if((D1(e)!=="body"||Zp(i))&&(a=Bv(e)),r){let _=Fg(e,!0,o,e);h.x=_.x+e.clientLeft,h.y=_.y+e.clientTop}else i&&g();o&&!r&&i&&g();let m=i&&!r&&!o?p_(i,a):td(0),x=l.left+a.scrollLeft-h.x-m.x,w=l.top+a.scrollTop-h.y-m.y;return{x,y:w,width:l.width,height:l.height}}function Mb(n){return Nh(n).position==="static"}function Cw(n,e){if(!od(n)||Nh(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return ad(n)===t&&(t=t.ownerDocument.body),t}function b_(n,e){let t=Bf(n);if(Fv(n))return t;if(!od(n)){let i=ug(n);for(;i&&!I1(i);){if(Dh(i)&&!Mb(i))return i;i=ug(i)}return t}let r=Cw(n,e);for(;r&&PF(r)&&Mb(r);)r=Cw(r,e);return r&&I1(r)&&Mb(r)&&!Xm(r)?t:r||DF(n)||t}const XF=async function(n){let e=this.getOffsetParent||b_,t=this.getDimensions,r=await t(n.floating);return{reference:ZF(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KF(n){return Nh(n).direction==="rtl"}const JF={convertOffsetParentRelativeRectToViewportRelativeRect:BF,getDocumentElement:ad,getClippingRect:YF,getOffsetParent:b_,getElementRects:XF,getClientRects:zF,getDimensions:VF,getScale:y1,isElement:Dh,isRTL:KF};function y_(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function QF(n,e){let t=null,r,i=ad(n);function o(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function l(a,h){a===void 0&&(a=!1),h===void 0&&(h=1),o();let g=n.getBoundingClientRect(),{left:m,top:x,width:w,height:_}=g;if(a||e(),!w||!_)return;let S=M0(x),R=M0(i.clientWidth-(m+w)),k=M0(i.clientHeight-(x+_)),O=M0(m),P=-S+"px "+-R+"px "+-k+"px "+-O+"px",z={rootMargin:P,threshold:Og(0,uv(1,h))||1},H=!0;function G(N){let J=N[0].intersectionRatio;if(J!==h){if(!H)return l();J?l(!1,J):r=setTimeout(()=>{l(!1,1e-7)},1e3)}J===1&&!y_(g,n.getBoundingClientRect())&&l(),H=!1}try{t=new IntersectionObserver(G,{...z,root:i.ownerDocument})}catch{t=new IntersectionObserver(G,z)}t.observe(n)}return l(!0),o}function qF(n,e,t,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,g=Jm(n),m=i||o?[...g?Dp(g):[],...Dp(e)]:[];m.forEach(O=>{i&&O.addEventListener("scroll",t,{passive:!0}),o&&O.addEventListener("resize",t)});let x=g&&a?QF(g,t):null,w=-1,_=null;l&&(_=new ResizeObserver(O=>{let[P]=O;P&&P.target===g&&_&&(_.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var z;(z=_)==null||z.observe(e)})),t()}),g&&!h&&_.observe(g),_.observe(e));let S,R=h?Fg(n):null;h&&k();function k(){let O=Fg(n);R&&!y_(R,O)&&t(),R=O,S=requestAnimationFrame(k)}return t(),()=>{var O;m.forEach(P=>{i&&P.removeEventListener("scroll",t),o&&P.removeEventListener("resize",t)}),x==null||x(),(O=_)==null||O.disconnect(),_=null,h&&cancelAnimationFrame(S)}}const m_=MF,x_=LF,w_=IF,C_=OF,__=(n,e,t)=>{let r=new Map,i={platform:JF,...t},o={...i.platform,_c:r};return RF(n,e,{...i,platform:o})};function jF(n,e,t,r,i){return n.addEventListener("transitionend",t,r),setTimeout(()=>{t()},e)}const $F=4;let L0;function Lb(n,e={}){let{msg:t="",delay:r=150,content:i,direction:o="bottom",type:l="hover",container:a,onOpen:h,onClose:g,closed:m,onDestroy:x}=e,w=cu("tooltip");if(t||i){L0||(L0=document.createElement("div"),document.body.appendChild(L0));let _=a||L0,S=document.createElement("div");S.classList.add(w.b(),"hidden","transparent"),i?S.appendChild(i):t&&(S.textContent=t);let R,k,O,P=()=>{O&&O(),__(n,S,{placement:o,middleware:[w_(),x_({limiter:C_()}),m_($F)]}).then(({x:ue,y:se})=>{Object.assign(S.style,{left:`${ue}px`,top:`${se}px`})})},z=()=>{S.classList.add("hidden"),_.contains(S)&&_.removeChild(S),O&&O(),m&&m()},H=(ue=!1)=>{k&&clearTimeout(k),R=setTimeout(()=>{if(h){let se=h(ue);if(!ue&&se)return}_.appendChild(S),S.removeEventListener("transitionend",z),S.classList.remove("hidden"),O=qF(n,S,P),S.classList.remove("transparent")},r)},G=(ue=!1)=>{R&&clearTimeout(R),k=setTimeout(()=>{if(g){let se=g(ue);if(!ue&&se)return}jF(S,150,z,{once:!0}),S.classList.add("transparent")},r)},N=()=>{let ue=[n,S],se=G.bind(void 0,!1),$=H.bind(void 0,!1);return{prepare:()=>{for(let ge of ue)ge.addEventListener("mouseenter",$),ge.addEventListener("mouseleave",se)},show:H,hide:G,destroy:()=>{for(let ge of ue)ge.removeEventListener("mouseenter",$),ge.removeEventListener("mouseleave",se)}}},J=()=>{let ue=$=>{$.stopPropagation(),G(!1)},se=$=>{$.stopPropagation(),H(),document.removeEventListener("click",ue),document.addEventListener("click",ue,{once:!0})};return{prepare:()=>{S.addEventListener("click",$=>$.stopPropagation()),n.addEventListener("click",se)},show:H,hide:($=!1)=>{G($),document.removeEventListener("click",ue)},destroy:()=>{n.removeEventListener("click",se),document.removeEventListener("click",ue)}}},Y={hover:N,click:J},{prepare:K,show:fe,hide:X,destroy:te}=Y[l]();return K(),{show:fe,hide:X,destroy:()=>{X(!0),x&&x(),te(),O&&O(),S.remove()}}}return null}function eB(n,e,t=0,r=!0){let{x:i,y:o,x1:l,y1:a}=n,{x:h,y:g,x1:m,y1:x}=e,w,_;return r?(w=l<h+t||i-t>m,_=a<g+t||o-t>x):(w=l<=h+t||i-t>=m,_=a<=g+t||o-t>=x),!(w||_)}function tB(n,e){let t=e.getBoundingClientRect();return{x:n.x-t.x-e.scrollLeft,y:n.y-t.y-e.scrollTop,x1:n.x-t.x-e.scrollLeft+n.width,y1:n.y-t.y-e.scrollTop+n.height,width:n.width,height:n.height}}const O0=8;function nB(n){let{left:e,top:t,width:r,height:i}=n,{clientWidth:o,clientHeight:l}=document.documentElement,a=!1,h=!1;return e+r>o?(e=o-r-O0,a=!0):e<0&&(e=O0,a=!0),t+i>l?(t=l-i-O0,h=!0):t<0&&(t=O0,h=!0),{left:e,top:t,leftLimited:a,topLimited:h}}function rB(n,e={}){let t=Symbol("ignoreFirstBind"),r=new Set,i=new ResizeObserver(h=>{e.ignoreFirstBind&&h.some(g=>{let m=g.target,x=m[t];return m[t]=!0,!x})||n(h)}),o=i.observe;i.observe=(h,g)=>{r.add(h),o.call(i,h,g)};let l=i.unobserve;i.unobserve=h=>{r.has(h)&&(r.delete(h),h[t]=void 0),l.call(i,h)};let a=i.disconnect;return i.disconnect=()=>{for(let h of r.values())h[t]=void 0;a.call(i)},i}function gv(n,e){n.addEventListener("scroll",e),this.scrollHandler.push([n,e])}function J0(){for(let n=0;n<this.scrollHandler.length;n++){let[e,t]=this.scrollHandler[n];e.removeEventListener("scroll",t)}this.scrollHandler=[]}function ap(n){return{y:n.scrollTop,x:n.scrollLeft}}function pv(n){let e={},t=n.trim().split(";");for(let r=0;r<t.length;r++){let i=t[r].trim();if(!i)continue;let o=i.indexOf(":");if(o===-1)continue;let l=i.slice(0,Math.max(0,o)).trim(),a=i.slice(Math.max(0,o+1)).trim();e[k1(l)]=a}return e}function om(n){return Object.entries(n).map(([e,t])=>`${iB(e)}: ${t};`).join(" ")}function iB(n){return n.replaceAll(/([A-Z])/g," $1").trim().split(" ").join("-").toLowerCase()}function k1(n){return n.replaceAll(/-(\w)/g,(e,t)=>t.toUpperCase())}const Fa=()=>Math.random().toString(36).slice(2);function S_(n,e){let t;return function(...r){t&&clearTimeout(t),t=setTimeout(()=>{n.apply(this,r)},e)}}const Ob=Xe.import("parchment"),_w=Xe.import("blots/container"),oB=Xe.import("blots/block"),lB=Xe.import("blots/block/embed");var uh,dg=(uh=class extends _w{static create(e){let t=document.createElement(this.tagName);return this.className&&t.classList.add(this.className),t}optimize(e){if(this.children.length===0)if(this.statics.defaultChild!=null){let t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove();this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}enforceAllowedChildren(){this.children.forEach(e=>{this.statics.allowedChildren.some(r=>e instanceof r)||(e.statics.scope===Ob.Scope.BLOCK_BLOT?(e.parent instanceof uh?(e.next!=null&&e.parent.splitAfter(e),e.prev!=null&&e.parent.splitAfter(e.prev)):(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev)),e.parent.unwrap()):e instanceof Ob.ParentBlot?e.unwrap():e.remove())})}},Ee(uh,"tagName"),Ee(uh,"blotName",Qe.container),Ee(uh,"scope",Ob.Scope.BLOCK_BLOT),Ee(uh,"allowedChildren",[oB,lB,_w]),Ee(uh,"requiredContainer"),Ee(uh,"defaultChild"),uh);const ig=n=>pF(n)?n:1,Sw=Xe.import("blots/block"),sB=Xe.import("blots/block/embed");var Zd,cf=(Zd=class extends dg{static isAllowStyle(n){let e=k1(n);for(let t of this.allowStyle)if(e.startsWith(k1(t)))return!0;return!1}static create(n){let{tableId:e,rowId:t,colId:r,rowspan:i,colspan:o,style:l,emptyRow:a,tag:h="td"}=n,g=super.create();g.dataset.tableId=e,g.dataset.rowId=t,g.dataset.colId=r,g.dataset.rowspan=String(ig(i)),g.dataset.colspan=String(ig(o)),g.dataset.tag=h,l&&(g.dataset.style=l);try{a&&(g.dataset.emptyRow=JSON.stringify(a))}catch{}return g}static formats(n){let{tableId:e,rowId:t,colId:r,rowspan:i,colspan:o,style:l,emptyRow:a,tag:h="td"}=n.dataset,g={tableId:String(e),rowId:String(t),colId:String(r),rowspan:Number(ig(i)),colspan:Number(ig(o)),tag:h};l&&(g.style=l);try{a&&(g.emptyRow=JSON.parse(a))}catch{}return g}constructor(n,e,t){super(n,e),e.setAttribute("contenteditable",String(n.isEnabled()))}setFormatValue(n,e,t=!1){if(t){if(!this.statics.isAllowStyle(n))return;this.parent&&this.parent.statics.blotName===Qe.tableCell&&this.parent.setFormatValue(n,e)}else{if(!this.statics.allowDataAttrs.has(n))return;let r=`data-${n}`;e?this.domNode.setAttribute(r,e):this.domNode.removeAttribute(r),this.parent&&this.parent.statics.blotName===Qe.tableCell&&this.parent.setFormatValue(n,e)}this.clearCache()}clearCache(){let n=this.descendants(Sw,0);for(let e of n)e.cache={}}get tableId(){return this.domNode.dataset.tableId}get rowId(){return this.domNode.dataset.rowId}set rowId(n){this.setFormatValue("row-id",n)}get colId(){return this.domNode.dataset.colId}set colId(n){this.setFormatValue("col-id",n)}get rowspan(){return Number(this.domNode.dataset.rowspan)}set rowspan(n){this.setFormatValue("rowspan",n)}get colspan(){return Number(this.domNode.dataset.colspan)}set colspan(n){this.setFormatValue("colspan",n)}get emptyRow(){try{return JSON.parse(this.domNode.dataset.emptyRow)}catch{return[]}}set emptyRow(n){if(this.emptyRow.toString()!==n.toString())try{n.length>0?this.setFormatValue("empty-row",JSON.stringify(n),!1):this.setFormatValue("empty-row",null,!1)}catch{this.setFormatValue("empty-row",null,!1)}}getColumnIndex(){return Kl(this,Qe.tableMain).getColIds().indexOf(this.colId)}setStyleByString(n){let e=pv(n);for(let[t,r]of Object.entries(e))this.setFormatValue(t,r,!0)}convertTableCell(){this.parent.statics.blotName===Qe.tableCell&&(this.parent.convertTableCell(),this.clearCache())}formatAt(n,e,t,r){this.children.length===0&&(this.appendChild(this.scroll.create(this.statics.defaultChild.blotName)),e+=1),super.formatAt(n,e,t,r),r&&r.style&&this.setStyleByString(r.style)}insertAt(n,e,t){let[r]=this.children.find(n);if(!r&&this.statics.defaultChild){let i=this.scroll.create(this.statics.defaultChild.blotName||"block");this.appendChild(i)}super.insertAt(n,e,t)}formats(){let n=this.statics.formats(this.domNode);return{[this.statics.blotName]:n}}checkMerge(){let{colId:n,rowId:e,colspan:t,rowspan:r}=this,i=this.next;return i!==null&&i.statics.blotName===this.statics.blotName&&i.rowId===e&&i.colId===n&&i.colspan===t&&i.rowspan===r}optimize(){let n=this.parent,e=this.statics.formats(this.domNode);if(this.prev&&this.prev instanceof sB){let r=this.prev;if(this.insertBefore(r,this.children.head),this.length()<=1){let i=this.scroll.create("block");this.insertBefore(i,r.next)}}let t=n!==null&&n.statics.blotName!==Qe.tableCell;if(t&&(this.wrap(Qe.tableCell,e),this.children.length===0)){let r=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(r)}this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove()),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0?this.remove():this.domNode.dataset.style&&t&&n.domNode.style.cssText!==this.domNode.dataset.style&&this.setStyleByString(this.domNode.dataset.style)}insertBefore(n,e){if(n.statics.blotName===this.statics.blotName){let t=n,r=this.statics.formats(t.domNode),i=this.statics.formats(this.domNode);if(Object.entries(i).every(([l,a])=>String(a)===String(r[l]))){let l=this.split(e?e.offset():0);return this.parent.insertBefore(t,l)}else{let[l,a]=A1(this,[Qe.tableRow,Qe.tableCell]);if(e){let h=e.offset(),g=this.length();if(h+1<g){let m=this.scroll.create(Qe.tableCellInner,i);this.children.forEachAt(h+1,this.length(),x=>{m.appendChild(x)}),l.insertBefore(m.wrap(Qe.tableCell,i),a.next)}}if(this.rowId!==t.rowId){if(e){let m=e.offset(l);l.split(m)}else if(a.next){let m=a.next.offset(l);l.split(m)}let h=this.scroll.create(Qe.tableRow,r),g=this.scroll.create(Qe.tableCell,r);return g.appendChild(t),h.appendChild(g),l.parent.insertBefore(h,l.next)}return l.insertBefore(t.wrap(Qe.tableCell,r),e?a:a.next)}}else if(n.statics.blotName===Qe.tableCol){try{let t=Kl(this,Qe.tableBody),r=this.offset(t),i=t.split(r);t.parent.insertBefore(n,i),n.optimize({})}catch{console.warn("TableCellInner not in TableBody")}return}super.insertBefore(n,e)}},Ee(Zd,"blotName",Qe.tableCellInner),Ee(Zd,"tagName","div"),Ee(Zd,"className","ql-table-cell-inner"),Ee(Zd,"allowDataAttrs",new Set(["table-id","row-id","col-id","rowspan","colspan","empty-row"])),Ee(Zd,"defaultChild",Sw),Ee(Zd,"allowStyle",new Set(["background-color","border","height"])),Zd),up,qh=(up=class extends dg{static create(n){let e=super.create();return e.dataset.tableId=n.tableId,e.dataset.rowId=n.rowId,e}get rowId(){return this.domNode.dataset.rowId}get tableId(){return this.domNode.dataset.tableId}setHeight(n){this.foreachCellInner(e=>{e.setFormatValue("height",n,!0)})}getCellByColId(n,e){let t=Kl(this,Qe.tableMain),r=t.getColIds(),i=r.indexOf(n),o=this.children.iterator(),l=null;for(;l=o();){if(l.colId===n)return l;let a=r.indexOf(l.colId);if(a<i&&a+l.colspan>i)return l}return this[e]&&this[e].statics.blotName===Qe.tableRow?this[e].getCellByColId(n,e):null}insertCell(n,e){let t=[],r=this.children.iterator(),i=0,o;for(;(o=r())&&(i+=o.colspan,!(i>n));)if(o.rowspan!==1)for(let l=0;l<o.rowspan-1;l++)t[l]=(t[l]||0)+o.colspan;if(o&&i-o.colspan<n){let l=o.getCellInner();l.colspan+=1,o.rowspan!==1&&(t.skipRowNum=o.rowspan-1)}else{let l=this.scroll.create(Qe.tableCell,e),a=this.scroll.create(Qe.tableCellInner,e),h=this.scroll.create("block");h.appendChild(this.scroll.create("break")),a.appendChild(h),l.appendChild(a),this.insertBefore(l,o)}return t}getCellByColumIndex(n){let e=[],t=null,r=0;if(n<0)return[t,r,e];let i=this.children.iterator();for(;t=i();){if(r+=t.colspan,t.rowspan!==1)for(let o=0;o<t.rowspan-1;o++)e[o]=(e[o]||0)+t.colspan;if(r>n)break}return[t,r,e]}removeCell(n){if(n<0)return[];let e=this.getCellByColumIndex(n),[t,r]=e,i=e[2];if(!t)return i;if(r-t.colspan<n||t.colspan>1){let[o]=t.descendants(cf);if(t.colspan!==1&&n===r-t.colspan){let l=Kl(this,Qe.tableMain),a=l.getColIds();o.colId=a[a.indexOf(o.colId)+1]}t.rowspan!==1&&(i.skipRowNum=t.rowspan-1),--o.colspan}else t.remove();return i}foreachCellInner(n){let e=this.children.iterator(),t=0,r;for(;r=e();){let[i]=r.descendants(cf);if(n(i,t++))break}}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.rowId===this.rowId}optimize(n){let e=this.parent,{tableId:t}=this;e!==null&&e.statics.blotName!==Qe.tableBody&&this.wrap(Qe.tableBody,t),this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName),this.enforceAllowedChildren(),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}},Ee(up,"blotName",Qe.tableRow),Ee(up,"tagName","tr"),Ee(up,"className","ql-table-row"),up),H0,eg=(H0=class extends dg{static create(n){let e=super.create();return e.dataset.tableId=n,e}get tableId(){return this.domNode.dataset.tableId}insertRow(n){let e=Kl(this,Qe.tableMain);if(!e)return;let t=e.getColIds(),r=this.descendants(qh),i=new Set(t),o=0;for(let g of r){if(o===n)break;g.foreachCellInner(m=>{if(o+m.rowspan>n&&(m.rowspan+=1,i.delete(m.colId),m.colspan!==1)){let x=t.indexOf(m.colId);for(let w=0;w<m.colspan-1;w++)i.delete(t[x+w+1])}}),o+=1}let l=e.tableId,a=Fa(),h=this.scroll.create(Qe.tableRow,{tableId:l,rowId:a});for(let g of i){let m=this.scroll.create("break"),x=m.wrap("block"),w=x.wrap(Qe.tableCellInner,{tableId:l,rowId:a,colId:g,rowspan:1,colspan:1}),_=w.wrap(Qe.tableCell,{tableId:l,rowId:a,colId:g,rowspan:1,colspan:1});h.appendChild(_)}this.insertBefore(h,r[n]||null)}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===this.tableId}optimize(n){let e=this.parent;if(e!==null&&e.statics.blotName!==Qe.tableMain){let{tableId:t}=this;this.wrap(Qe.tableMain,{tableId:t})}super.optimize(n)}},Ee(H0,"blotName",Qe.tableBody),Ee(H0,"tagName","tbody"),H0);const aB=Xe.import("parchment"),cB=Xe.import("blots/block"),uB=Xe.import("blots/container");var lm=class extends cB{replaceWith(n,e){let t=Lg(n)?this.scroll.create(n,e):n;if(t instanceof aB.ParentBlot)if(t.statics.blotName===Qe.tableCellInner){try{let i=Kl(this,Qe.tableCellInner),o=i.formats(),l=t.formats();if(Object.keys(o).every(h=>JSON.stringify(o[h])===JSON.stringify(l[h])))return i}catch{}let r=this.parent;if(r.statics.blotName===Qe.tableCellInner){if(r==null||r.insertBefore(t,this.prev?null:this.next),r.statics.blotName===Qe.tableCellInner){let i=this;for(;i;){let o=i.next;t.appendChild(i),i=o}}else t.appendChild(this);if(r&&r.length()===0){r.remove(),r.parent.statics.blotName===Qe.tableCell&&r.parent.length()===0&&r.parent.remove();let i=r.parent.parent;i.statics.blotName===Qe.tableRow&&i.children.length===0&&i.remove()}}else r instanceof uB?r.parent.insertBefore(t,r):r==null||r.insertBefore(t,this.next),t.appendChild(this);return t}else this.moveChildren(t);return this.parent!=null&&(this.parent.insertBefore(t,this.next),this.remove()),this.attributes.copy(t),t}format(n,e){if(n===Qe.tableCellInner&&this.parent.statics.blotName===n&&!e)try{Kl(this,Qe.tableCellInner).unwrap()}catch{console.error("unwrap TableCellInner error")}else super.format(n,e)}};const fB=Xe.import("blots/block/embed");var Ew=class extends fB{delta(){let n=super.delta(),e=sm(this);return e[Qe.tableCellInner]&&n.insert(`
340
- `,{[Qe.tableCellInner]:e[Qe.tableCellInner]}),n}length(){return sm(this)[Qe.tableCellInner]&&(!this.next||this.next.length()<=1)?super.length()+1:super.length()}};function sm(n,e={},t=!0){return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:sm(n.parent,e,t)}const Tw=Xe.import("parchment"),hB=Xe.import("blots/scroll");var dB=class extends hB{enable(n=!0){let e=Xe.import(`formats/${Qe.tableCellInner}`),t=this.domNode.querySelectorAll(`.${e.className}`);for(let o of Array.from(t))o.setAttribute("contenteditable",String(!!n));let r=Xe.import(`formats/${Qe.tableCaption}`),i=this.domNode.querySelectorAll(`.${r.className}`);for(let o of Array.from(i))o.setAttribute("contenteditable",String(!!n));super.enable(n)}createBlock(n,e){let t,r={};if(n[Qe.tableCellInner])t=Qe.tableCellInner;else for(let[l,a]of Object.entries(n))this.query(l,Tw.Scope.BLOCK&Tw.Scope.BLOT)!=null?t=l:r[l]=a;t===Qe.tableCellInner&&(r={...n},delete r[t]);let i=this.create(t||this.statics.defaultChild.blotName,t?n[t]:void 0);this.insertBefore(i,e||void 0);let o=i.length();i instanceof cf&&o===0&&(o+=1);for(let[l,a]of Object.entries(r))i.formatAt(0,o,l,a);return i}},gB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\r
339
+ `," "]),w=["'"].concat(x),_=["%","/","?",";","#"].concat(w),S=["/","?","#"],R=/^[+a-z0-9A-Z_-]{0,63}$/,k=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=i(38);function G(N,J,Y){if(N&&l.isObject(N)&&N instanceof a)return N;var K=new a;return K.parse(N,J,Y),K}a.prototype.parse=function(N,J,Y){if(!l.isString(N))throw new TypeError("Parameter 'url' must be a string, not "+typeof N);var K=N.indexOf("?"),fe=K!==-1&&K<N.indexOf("#")?"?":"#",X=N.split(fe);X[0]=X[0].replace(/\\/g,"/");var te=N=X.join(fe);if(te=te.trim(),!Y&&N.split("#").length===1){var ne=m.exec(te);if(ne)return this.path=te,this.href=te,this.pathname=ne[1],ne[2]?(this.search=ne[2],this.query=J?H.parse(this.search.substr(1)):this.search.substr(1)):J&&(this.search="",this.query={}),this}var ue=h.exec(te);if(ue){var se=(ue=ue[0]).toLowerCase();this.protocol=se,te=te.substr(ue.length)}if(Y||ue||te.match(/^\/\/[^@\/]+@[^@\/]+/)){var $=te.substr(0,2)==="//";!$||ue&&P[ue]||(te=te.substr(2),this.slashes=!0)}if(!P[ue]&&($||ue&&!z[ue])){for(var re,ge,me=-1,oe=0;oe<S.length;oe++)(Q=te.indexOf(S[oe]))!==-1&&(me===-1||Q<me)&&(me=Q);for((ge=me===-1?te.lastIndexOf("@"):te.lastIndexOf("@",me))!==-1&&(re=te.slice(0,ge),te=te.slice(ge+1),this.auth=decodeURIComponent(re)),me=-1,oe=0;oe<_.length;oe++){var Q;(Q=te.indexOf(_[oe]))!==-1&&(me===-1||Q<me)&&(me=Q)}me===-1&&(me=te.length),this.host=te.slice(0,me),te=te.slice(me),this.parseHost(),this.hostname=this.hostname||"";var pe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!pe)for(var Ie=this.hostname.split(/\./),Fe=(oe=0,Ie.length);oe<Fe;oe++){var xe=Ie[oe];if(xe&&!xe.match(R)){for(var Oe="",Le=0,He=xe.length;Le<He;Le++)xe.charCodeAt(Le)>127?Oe+="x":Oe+=xe[Le];if(!Oe.match(R)){var Te=Ie.slice(0,oe),ke=Ie.slice(oe+1),Be=xe.match(k);Be&&(Te.push(Be[1]),ke.unshift(Be[2])),ke.length&&(te="/"+ke.join(".")+te),this.hostname=Te.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),pe||(this.hostname=o.toASCII(this.hostname));var rt=this.port?":"+this.port:"",Re=this.hostname||"";this.host=Re+rt,this.href+=this.host,pe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),te[0]!=="/"&&(te="/"+te))}if(!O[se])for(oe=0,Fe=w.length;oe<Fe;oe++){var ut=w[oe];if(te.indexOf(ut)!==-1){var qe=encodeURIComponent(ut);qe===ut&&(qe=escape(ut)),te=te.split(ut).join(qe)}}var ot=te.indexOf("#");ot!==-1&&(this.hash=te.substr(ot),te=te.slice(0,ot));var st=te.indexOf("?");if(st!==-1?(this.search=te.substr(st),this.query=te.substr(st+1),J&&(this.query=H.parse(this.query)),te=te.slice(0,st)):J&&(this.search="",this.query={}),te&&(this.pathname=te),z[se]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){rt=this.pathname||"";var bt=this.search||"";this.path=rt+bt}return this.href=this.format(),this},a.prototype.format=function(){var N=this.auth||"";N&&(N=(N=encodeURIComponent(N)).replace(/%3A/i,":"),N+="@");var J=this.protocol||"",Y=this.pathname||"",K=this.hash||"",fe=!1,X="";this.host?fe=N+this.host:this.hostname&&(fe=N+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(fe+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(X=H.stringify(this.query));var te=this.search||X&&"?"+X||"";return J&&J.substr(-1)!==":"&&(J+=":"),this.slashes||(!J||z[J])&&fe!==!1?(fe="//"+(fe||""),Y&&Y.charAt(0)!=="/"&&(Y="/"+Y)):fe||(fe=""),K&&K.charAt(0)!=="#"&&(K="#"+K),te&&te.charAt(0)!=="?"&&(te="?"+te),J+fe+(Y=Y.replace(/[?#]/g,(function(ne){return encodeURIComponent(ne)})))+(te=te.replace("#","%23"))+K},a.prototype.resolve=function(N){return this.resolveObject(G(N,!1,!0)).format()},a.prototype.resolveObject=function(N){if(l.isString(N)){var J=new a;J.parse(N,!1,!0),N=J}for(var Y=new a,K=Object.keys(this),fe=0;fe<K.length;fe++){var X=K[fe];Y[X]=this[X]}if(Y.hash=N.hash,N.href==="")return Y.href=Y.format(),Y;if(N.slashes&&!N.protocol){for(var te=Object.keys(N),ne=0;ne<te.length;ne++){var ue=te[ne];ue!=="protocol"&&(Y[ue]=N[ue])}return z[Y.protocol]&&Y.hostname&&!Y.pathname&&(Y.path=Y.pathname="/"),Y.href=Y.format(),Y}if(N.protocol&&N.protocol!==Y.protocol){if(!z[N.protocol]){for(var se=Object.keys(N),$=0;$<se.length;$++){var re=se[$];Y[re]=N[re]}return Y.href=Y.format(),Y}if(Y.protocol=N.protocol,N.host||P[N.protocol])Y.pathname=N.pathname;else{for(var ge=(N.pathname||"").split("/");ge.length&&!(N.host=ge.shift()););N.host||(N.host=""),N.hostname||(N.hostname=""),ge[0]!==""&&ge.unshift(""),ge.length<2&&ge.unshift(""),Y.pathname=ge.join("/")}if(Y.search=N.search,Y.query=N.query,Y.host=N.host||"",Y.auth=N.auth,Y.hostname=N.hostname||N.host,Y.port=N.port,Y.pathname||Y.search){var me=Y.pathname||"",oe=Y.search||"";Y.path=me+oe}return Y.slashes=Y.slashes||N.slashes,Y.href=Y.format(),Y}var Q=Y.pathname&&Y.pathname.charAt(0)==="/",pe=N.host||N.pathname&&N.pathname.charAt(0)==="/",Ie=pe||Q||Y.host&&N.pathname,Fe=Ie,xe=Y.pathname&&Y.pathname.split("/")||[],Oe=(ge=N.pathname&&N.pathname.split("/")||[],Y.protocol&&!z[Y.protocol]);if(Oe&&(Y.hostname="",Y.port=null,Y.host&&(xe[0]===""?xe[0]=Y.host:xe.unshift(Y.host)),Y.host="",N.protocol&&(N.hostname=null,N.port=null,N.host&&(ge[0]===""?ge[0]=N.host:ge.unshift(N.host)),N.host=null),Ie=Ie&&(ge[0]===""||xe[0]==="")),pe)Y.host=N.host||N.host===""?N.host:Y.host,Y.hostname=N.hostname||N.hostname===""?N.hostname:Y.hostname,Y.search=N.search,Y.query=N.query,xe=ge;else if(ge.length)xe||(xe=[]),xe.pop(),xe=xe.concat(ge),Y.search=N.search,Y.query=N.query;else if(!l.isNullOrUndefined(N.search))return Oe&&(Y.hostname=Y.host=xe.shift(),(Be=!!(Y.host&&Y.host.indexOf("@")>0)&&Y.host.split("@"))&&(Y.auth=Be.shift(),Y.host=Y.hostname=Be.shift())),Y.search=N.search,Y.query=N.query,l.isNull(Y.pathname)&&l.isNull(Y.search)||(Y.path=(Y.pathname?Y.pathname:"")+(Y.search?Y.search:"")),Y.href=Y.format(),Y;if(!xe.length)return Y.pathname=null,Y.search?Y.path="/"+Y.search:Y.path=null,Y.href=Y.format(),Y;for(var Le=xe.slice(-1)[0],He=(Y.host||N.host||xe.length>1)&&(Le==="."||Le==="..")||Le==="",Te=0,ke=xe.length;ke>=0;ke--)(Le=xe[ke])==="."?xe.splice(ke,1):Le===".."?(xe.splice(ke,1),Te++):Te&&(xe.splice(ke,1),Te--);if(!Ie&&!Fe)for(;Te--;Te)xe.unshift("..");!Ie||xe[0]===""||xe[0]&&xe[0].charAt(0)==="/"||xe.unshift(""),He&&xe.join("/").substr(-1)!=="/"&&xe.push("");var Be,rt=xe[0]===""||xe[0]&&xe[0].charAt(0)==="/";return Oe&&(Y.hostname=Y.host=rt?"":xe.length?xe.shift():"",(Be=!!(Y.host&&Y.host.indexOf("@")>0)&&Y.host.split("@"))&&(Y.auth=Be.shift(),Y.host=Y.hostname=Be.shift())),(Ie=Ie||Y.host&&xe.length)&&!rt&&xe.unshift(""),xe.length?Y.pathname=xe.join("/"):(Y.pathname=null,Y.path=null),l.isNull(Y.pathname)&&l.isNull(Y.search)||(Y.path=(Y.pathname?Y.pathname:"")+(Y.search?Y.search:"")),Y.auth=N.auth||Y.auth,Y.slashes=Y.slashes||N.slashes,Y.href=Y.format(),Y},a.prototype.parseHost=function(){var N=this.host,J=g.exec(N);J&&((J=J[0])!==":"&&(this.port=J.substr(1)),N=N.substr(0,N.length-J.length)),N&&(this.hostname=N)}},function(t,r,i){(function(o,l){var a;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(h){r&&r.nodeType,o&&o.nodeType;var g=typeof l=="object"&&l;g.global!==g&&g.window!==g&&g.self;var m,x=2147483647,w=/^xn--/,_=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,O=String.fromCharCode;function P(X){throw new RangeError(R[X])}function z(X,te){for(var ne=X.length,ue=[];ne--;)ue[ne]=te(X[ne]);return ue}function H(X,te){var ne=X.split("@"),ue="";return ne.length>1&&(ue=ne[0]+"@",X=ne[1]),ue+z((X=X.replace(S,".")).split("."),te).join(".")}function G(X){for(var te,ne,ue=[],se=0,$=X.length;se<$;)(te=X.charCodeAt(se++))>=55296&&te<=56319&&se<$?(64512&(ne=X.charCodeAt(se++)))==56320?ue.push(((1023&te)<<10)+(1023&ne)+65536):(ue.push(te),se--):ue.push(te);return ue}function N(X){return z(X,(function(te){var ne="";return te>65535&&(ne+=O((te-=65536)>>>10&1023|55296),te=56320|1023&te),ne+=O(te)})).join("")}function J(X,te){return X+22+75*(X<26)-((te!=0)<<5)}function Y(X,te,ne){var ue=0;for(X=ne?k(X/700):X>>1,X+=k(X/te);X>455;ue+=36)X=k(X/35);return k(ue+36*X/(X+38))}function K(X){var te,ne,ue,se,$,re,ge,me,oe,Q,pe,Ie=[],Fe=X.length,xe=0,Oe=128,Le=72;for((ne=X.lastIndexOf("-"))<0&&(ne=0),ue=0;ue<ne;++ue)X.charCodeAt(ue)>=128&&P("not-basic"),Ie.push(X.charCodeAt(ue));for(se=ne>0?ne+1:0;se<Fe;){for($=xe,re=1,ge=36;se>=Fe&&P("invalid-input"),((me=(pe=X.charCodeAt(se++))-48<10?pe-22:pe-65<26?pe-65:pe-97<26?pe-97:36)>=36||me>k((x-xe)/re))&&P("overflow"),xe+=me*re,!(me<(oe=ge<=Le?1:ge>=Le+26?26:ge-Le));ge+=36)re>k(x/(Q=36-oe))&&P("overflow"),re*=Q;Le=Y(xe-$,te=Ie.length+1,$==0),k(xe/te)>x-Oe&&P("overflow"),Oe+=k(xe/te),xe%=te,Ie.splice(xe++,0,Oe)}return N(Ie)}function fe(X){var te,ne,ue,se,$,re,ge,me,oe,Q,pe,Ie,Fe,xe,Oe,Le=[];for(Ie=(X=G(X)).length,te=128,ne=0,$=72,re=0;re<Ie;++re)(pe=X[re])<128&&Le.push(O(pe));for(ue=se=Le.length,se&&Le.push("-");ue<Ie;){for(ge=x,re=0;re<Ie;++re)(pe=X[re])>=te&&pe<ge&&(ge=pe);for(ge-te>k((x-ne)/(Fe=ue+1))&&P("overflow"),ne+=(ge-te)*Fe,te=ge,re=0;re<Ie;++re)if((pe=X[re])<te&&++ne>x&&P("overflow"),pe==te){for(me=ne,oe=36;!(me<(Q=oe<=$?1:oe>=$+26?26:oe-$));oe+=36)Oe=me-Q,xe=36-Q,Le.push(O(J(Q+Oe%xe,0))),me=k(Oe/xe);Le.push(O(J(me,0))),$=Y(ne,Fe,ue==se),ne=0,++ue}++ne,++te}return Le.join("")}m={version:"1.4.1",ucs2:{decode:G,encode:N},decode:K,encode:fe,toASCII:function(X){return H(X,(function(te){return _.test(te)?"xn--"+fe(te):te}))},toUnicode:function(X){return H(X,(function(te){return w.test(te)?K(te.slice(4).toLowerCase()):te}))}},(a=(function(){return m}).call(r,i,r,o))===void 0||(o.exports=a)})()}).call(this,i(35)(t),i(36))},function(t,r){t.exports=function(i){return i.webpackPolyfill||(i.deprecate=function(){},i.paths=[],i.children||(i.children=[]),Object.defineProperty(i,"loaded",{enumerable:!0,get:function(){return i.l}}),Object.defineProperty(i,"id",{enumerable:!0,get:function(){return i.i}}),i.webpackPolyfill=1),i}},function(t,r){var i;i=(function(){return this})();try{i=i||new Function("return this")()}catch{typeof window=="object"&&(i=window)}t.exports=i},function(t,r,i){t.exports={isString:function(o){return typeof o=="string"},isObject:function(o){return typeof o=="object"&&o!==null},isNull:function(o){return o===null},isNullOrUndefined:function(o){return o==null}}},function(t,r,i){r.decode=r.parse=i(39),r.encode=r.stringify=i(40)},function(t,r,i){function o(a,h){return Object.prototype.hasOwnProperty.call(a,h)}t.exports=function(a,h,g,m){h=h||"&",g=g||"=";var x={};if(typeof a!="string"||a.length===0)return x;var w=/\+/g;a=a.split(h);var _=1e3;m&&typeof m.maxKeys=="number"&&(_=m.maxKeys);var S=a.length;_>0&&S>_&&(S=_);for(var R=0;R<S;++R){var k,O,P,z,H=a[R].replace(w,"%20"),G=H.indexOf(g);G>=0?(k=H.substr(0,G),O=H.substr(G+1)):(k=H,O=""),P=decodeURIComponent(k),z=decodeURIComponent(O),o(x,P)?l(x[P])?x[P].push(z):x[P]=[x[P],z]:x[P]=z}return x};var l=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}},function(t,r,i){var o=function(g){switch(typeof g){case"string":return g;case"boolean":return g?"true":"false";case"number":return isFinite(g)?g:"";default:return""}};t.exports=function(g,m,x,w){return m=m||"&",x=x||"=",g===null&&(g=void 0),typeof g=="object"?a(h(g),(function(_){var S=encodeURIComponent(o(_))+x;return l(g[_])?a(g[_],(function(R){return S+encodeURIComponent(o(R))})).join(m):S+encodeURIComponent(o(g[_]))})).join(m):w?encodeURIComponent(o(w))+x+encodeURIComponent(o(g)):""};var l=Array.isArray||function(g){return Object.prototype.toString.call(g)==="[object Array]"};function a(g,m){if(g.map)return g.map(m);for(var x=[],w=0;w<g.length;w++)x.push(m(g[w],w));return x}var h=Object.keys||function(g){var m=[];for(var x in g)Object.prototype.hasOwnProperty.call(g,x)&&m.push(x);return m}}])}))})(Ib)),Ib.exports}var oF=iF();const lF=L1(oF),Qe={container:"table-up-container",tableCaption:"table-up-caption",tableWrapper:"table-up",tableMain:"table-up-main",tableColgroup:"table-up-colgroup",tableCol:"table-up-col",tableBody:"table-up-body",tableRow:"table-up-row",tableCell:"table-up-cell",tableCellInner:"table-up-cell-inner"},Ss={colMinWidthPre:5,colMinWidthPx:40,colDefaultWidth:100,rowMinHeightPx:36},av={AFTER_TABLE_RESIZE:"after-table-resize"},kb={moduleName:"table-up"},sF=[["rgb(255, 255, 255)","rgb(0, 0, 0)","rgb(72, 83, 104)","rgb(41, 114, 244)","rgb(0, 163, 245)","rgb(49, 155, 98)","rgb(222, 60, 54)","rgb(248, 136, 37)","rgb(245, 196, 0)","rgb(153, 56, 215)"],["rgb(242, 242, 242)","rgb(127, 127, 127)","rgb(243, 245, 247)","rgb(229, 239, 255)","rgb(229, 246, 255)","rgb(234, 250, 241)","rgb(254, 233, 232)","rgb(254, 243, 235)","rgb(254, 249, 227)","rgb(253, 235, 255)"],["rgb(216, 216, 216)","rgb(89, 89, 89)","rgb(197, 202, 211)","rgb(199, 220, 255)","rgb(199, 236, 255)","rgb(195, 234, 213)","rgb(255, 201, 199)","rgb(255, 220, 196)","rgb(255, 238, 173)","rgb(242, 199, 255)"],["rgb(191, 191, 191)","rgb(63, 63, 63)","rgb(128, 139, 158)","rgb(153, 190, 255)","rgb(153, 221, 255)","rgb(152, 215, 182)","rgb(255, 156, 153)","rgb(255, 186, 132)","rgb(255, 226, 112)","rgb(213, 142, 255)"],["rgb(165, 165, 165)","rgb(38, 38, 38)","rgb(53, 59, 69)","rgb(20, 80, 184)","rgb(18, 116, 165)","rgb(39, 124, 79)","rgb(158, 30, 26)","rgb(184, 96, 20)","rgb(163, 130, 0)","rgb(94, 34, 129)"],["rgb(147, 147, 147)","rgb(13, 13, 13)","rgb(36, 39, 46)","rgb(12, 48, 110)","rgb(10, 65, 92)","rgb(24, 78, 50)","rgb(88, 17, 14)","rgb(92, 48, 10)","rgb(102, 82, 0)","rgb(59, 21, 81)"]],aF="table-up",cF=new Set([Qe.tableCellInner]),uF=n=>cF.has(n.statics.blotName);function i_(n){return n&&n.parent?uF(n.parent)?!0:i_(n.parent):!1}function cu(n,e=aF){let t=e?`${e}-`:"";return{b:()=>`${t}${n}`,be:r=>r?`${t}${n}__${r}`:"",bm:r=>r?`${t}${n}--${r}`:"",bem:(r,i)=>r&&i?`${t}${n}__${r}--${i}`:"",ns:r=>r?`${t}${r}`:"",bs:r=>r?`${t}${n}-${r}`:"",cv:r=>r?`--${t}${r}`:"",is:r=>`is-${r}`}}function Kl(n,e){let t=n.parent;for(;t&&t.statics.blotName!==e&&t!==n.scroll;)t=t.parent;if(t===n.scroll)throw Error(`${n.statics.blotName} must be a child of ${e}`);return t}function A1(n,e){let t=Array(e.length),r=new Map(e.map((o,l)=>[o,l])),i=n.parent;for(;i&&i!==n.scroll&&r.size!==0;){if(r.has(i.statics.blotName)){let o=r.get(i.statics.blotName);t[o]=i,r.delete(i.statics.blotName)}i=i.parent}if(r.size>0)throw Error(`${n.statics.blotName} must be a child of ${Array.from(r.keys()).join(", ")}`);return t}function hw(n){let e=new Map,t=n;for(;t&&t.statics.blotName!=="scroll";)e.set(t.statics.blotName,t),t=t.parent;return e}function fF(n,e){let t=[],r=n.children.iterator(),i=null;for(;i=r();)i instanceof e&&t.push(i);return t}function hF(n,e,t){for(let r of Object.getOwnPropertyNames(e))t&&t.test(r)||Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r));return n}function dF(n,e){let t=class extends n{constructor(...r){super(...r)}};for(let r of e)hF(t.prototype,r.prototype,/^constructor$/);return t}function I0(n,e){return n.prototype instanceof e}function b1(n,e){return n=Math.min(e,Math.max(0,Number.parseFloat(`${n}`))),Math.abs(n-e)<1e-6?1:n%e/Number.parseFloat(e)}function dw(n){return{h:Math.min(360,Math.max(0,n.h)),s:Math.min(100,Math.max(0,n.s)),b:Math.min(100,Math.max(0,n.b)),a:Math.min(1,Math.max(0,n.a))}}function gF(n){n=n.startsWith("#")?n.slice(1):n;let e=Number.parseInt(n.slice(0,2),16),t=Number.parseInt(n.slice(2,4),16),r=Number.parseInt(n.slice(4,6),16),i=Number((Number.parseInt(n.slice(6,8)||"ff",16)/255).toFixed(2));return{r:e,g:t,b:r,a:i}}function gw(n){let{r:e,g:t,b:r,a:i}=n;e=b1(e,255),t=b1(t,255),r=b1(r,255);let o=Math.max(e,t,r),l=Math.min(e,t,r),a,h=o,g=o-l,m=o===0?0:g/o;if(o===l)a=0;else{switch(o){case e:a=(t-r)/g+(t<r?6:0);break;case t:a=(r-e)/g+2;break;case r:a=(e-t)/g+4;break}a/=6}return{h:a*360,s:m*100,b:h*100,a:i}}function K0(n){let{h:e,s:t,b:r,a:i}=n;e=b1(e,360)*6,t=b1(t,100),r=b1(r,100);let o=Math.floor(e),l=e-o,a=r*(1-t),h=r*(1-l*t),g=r*(1-(1-l)*t),m=o%6,x=[r,h,a,a,g,r][m],w=[g,r,r,h,a,a][m],_=[a,a,g,r,r,h][m];return{r:Math.round(x*255),g:Math.round(w*255),b:Math.round(_*255),a:i}}function o_(n){let e=[n.r.toString(16),n.g.toString(16),n.b.toString(16),Math.round(n.a*255).toString(16)];for(let t in e)e[t].length===1&&(e[t]=`0${e[t]}`);return e.join("")}const pw=n=>o_(K0(n)),nm=n=>typeof n=="function",l_=Array.isArray,Lg=n=>typeof n=="string",pF=n=>typeof n=="number",k0=n=>typeof n=="object"&&!!n,vF=n=>!Number.isNaN(n)&&Number(n)>0,bF=n=>l_(n)?n:[n];function cv(n){let{type:e="default",content:t}=n||{},r=cu("button"),i=document.createElement("button");return i.classList.add(r.b(),e),t&&(Lg(t)?i.textContent=t:i.appendChild(t)),i}function yF(n={}){let e=230,t=150,r=10,i=gw(gF(n.color||"#ff0000")),o=cu("color-picker"),l=document.createElement("div");l.classList.add(o.b());let a=document.createElement("div");a.classList.add(o.be("content"));let h=document.createElement("div");h.classList.add(o.be("selector"));let g=document.createElement("div");g.classList.add(o.be("background")),h.appendChild(g);let m=document.createElement("div");m.classList.add(o.be("background-handle")),g.appendChild(m);let x=document.createElement("div");x.classList.add(o.be("alpha"));let w=document.createElement("div");w.classList.add(o.be("alpha-bg"));let _=document.createElement("div");_.classList.add(o.be("alpha-handle")),x.appendChild(w),x.appendChild(_);let S=document.createElement("div");S.classList.add(o.be("hue"));let R=document.createElement("div");R.classList.add(o.be("hue-handle")),S.appendChild(R);let k=document.createElement("div");k.classList.add(o.be("action"));let[O,P,z,H]=["r","g","b","a"].map(Oe=>{let Le=document.createElement("div");Le.classList.add(o.be("action-item"),Oe);let He=document.createElement("label");He.textContent=Oe.toUpperCase();let Te=document.createElement("input");return Te.classList.add(o.be("input")),Te.addEventListener("input",()=>{Te.value=Te.value.replaceAll(/[^0-9]/g,"")}),Te.addEventListener("change",()=>{let ke=Math.round(Number(Te.value));Oe==="a"&&(ke/=100);let Be=dw(gw(Object.assign({},K0(i),{[Oe]:ke})));se(Be),ue()}),Le.appendChild(He),Le.appendChild(Te),k.appendChild(Le),Te});a.appendChild(S),a.appendChild(h),a.appendChild(x),l.appendChild(a),l.appendChild(k);let G=!1,N=!1,J=!1;function Y(){let Oe=pw(i);for(let[Le,He]of[O,P,z].entries())He.value=String(Number.parseInt(Oe[Le*2]+Oe[Le*2+1],16));H.value=String((i.a*100).toFixed(0))}function K(){Object.assign(m.style,{left:`${Math.floor(e*i.s/100)}px`,top:`${Math.floor(t*(100-i.b)/100)}px`})}function fe(){h.style.backgroundColor=`#${o_(K0({h:i.h,s:100,b:100,a:1}))}`}function X(){R.style.top=`${Math.floor(t-t*i.h/360)}px`}function te(){_.style.left=`${i.a*100}%`}function ne(){let{r:Oe,g:Le,b:He}=K0(i);w.style.background=`linear-gradient(to right, rgba(${Oe}, ${Le}, ${He}, 0) 0%, rgba(${Oe}, ${Le}, ${He}, 1) 100%)`}function ue(){K(),fe(),X(),te(),ne(),Y()}function se(Oe){i=dw(Object.assign({},i,Oe)),Y(),n.onChange&&n.onChange(`#${pw(i)}`)}function $(Oe){let Le=h.getBoundingClientRect(),He=Le.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),Te=Le.left+document.body.scrollLeft,ke=Math.floor(100*Math.max(0,Math.min(e,Oe.pageX-Te))/e),Be=Math.floor(100*(t-Math.max(0,Math.min(t,Oe.pageY-He)))/t);se({s:ke,b:Be}),ue()}function re(Oe){let Le=S.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);se({h:Math.floor(360*(t-Math.max(0,Math.min(t,Oe.pageY-Le)))/t)}),ue()}function ge(Oe){let{pageX:Le}=Oe,He=x.getBoundingClientRect(),Te=Le-He.left;Te=Math.max(r/2,Te),Te=Math.min(Te,He.width-r/2),se({a:Math.round((Te-10/2)/(He.width-10)*100)/100}),ue()}function me(Oe){G&&(Oe.preventDefault(),$(Oe)),N&&(Oe.preventDefault(),re(Oe)),J&&(Oe.preventDefault(),ge(Oe))}function oe(){document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",oe),G=!1}function Q(Oe){document.addEventListener("mousemove",me),document.addEventListener("mouseup",oe),G=!0,$(Oe)}h.addEventListener("mousedown",Q);function pe(){document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",pe),N=!1}function Ie(Oe){document.addEventListener("mousemove",me),document.addEventListener("mouseup",pe),N=!0,re(Oe)}S.addEventListener("mousedown",Ie);function Fe(){document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",Fe),J=!1}function xe(Oe){document.addEventListener("mousemove",me),document.addEventListener("mouseup",Fe),J=!0,ge(Oe)}return x.addEventListener("mousedown",xe),ue(),l}let vw=8e3;function s_({child:n,target:e=document.body,beforeClose:t=()=>{}}={}){let r=cu("dialog"),i=e,o=document.createElement("div");o.classList.add(r.b()),o.style.zIndex=String(vw);let l=document.createElement("div");if(l.classList.add(r.be("overlay")),o.appendChild(l),n){let g=document.createElement("div");g.classList.add(r.be("content")),g.appendChild(n),l.appendChild(g),g.addEventListener("click",m=>{m.stopPropagation()})}let a=getComputedStyle(i).overflow;i.style.overflow="hidden",i.appendChild(o);let h=()=>{t(),o.remove(),i.style.overflow=a};return o.addEventListener("click",h),vw+=1,{dialog:o,close:h}}function bw(n,e){let t=cu("input");e.type||(e.type="text"),e.value||(e.value="");let r=document.createElement("div");if(r.classList.add(t.be("item")),n){let a=document.createElement("span");a.classList.add(t.be("label")),a.textContent=n,r.appendChild(a)}let i=document.createElement("div");i.classList.add(t.be("input"));let o=document.createElement("input");for(let a in e)o.setAttribute(a,e[a]);return(e.max||e.min)&&o.addEventListener("blur",()=>{e.max&&e.max<=Number(o.value)&&(o.value=String(e.max)),e.min&&e.min>=Number(o.value)&&(o.value=String(e.min))}),i.appendChild(o),r.appendChild(i),o.addEventListener("focus",()=>{i.classList.add("focus")}),o.addEventListener("blur",()=>{i.classList.remove("focus")}),{item:r,input:o,errorTip:a=>{let h;return i.classList.contains("error")?h=i.querySelector(`.${t.be("error-tip")}`):(h=document.createElement("span"),h.classList.add(t.be("error-tip")),i.appendChild(h)),h.textContent=a,i.classList.add("error"),{removeError:()=>{i.classList.remove("error"),h.remove()}}}}}async function mF(n={}){let e=cu("creator"),t=document.createElement("div");t.classList.add(e.b());let r=document.createElement("div");r.classList.add(e.be("input"));let{item:i,input:o,errorTip:l}=bw(n.rowText||"Row",{type:"number",value:String(n.row||""),max:99}),{item:a,input:h,errorTip:g}=bw(n.colText||"Column",{type:"number",value:String(n.col||""),max:99});r.appendChild(i),r.appendChild(a),t.appendChild(r);let m=document.createElement("div");m.classList.add(e.be("control"));let x=cv({type:"confirm",content:n.confirmText||"Confirm"}),w=cv({type:"default",content:n.cancelText||"Cancel"});m.appendChild(x),m.appendChild(w),t.appendChild(m);let _=(R=Number(o.value),k=Number(h.value))=>{if(Number.isNaN(R)||R<=0){l(n.notPositiveNumberError||"Please enter a positive integer");return}if(Number.isNaN(k)||k<=0){g(n.notPositiveNumberError||"Please enter a positive integer");return}return{row:R,col:k}},S=R=>{R.key==="Escape"&&(close(),document.removeEventListener("keydown",S))};return new Promise((R,k)=>{let{close:O}=s_({child:t,beforeClose:k});o.focus();for(let P of[o,h])P.addEventListener("keydown",z=>{if(z.key==="Enter"){let H=_();H&&(R(H),O())}});x.addEventListener("click",async()=>{let P=_();P&&(R(P),O())}),document.addEventListener("keydown",S),w.addEventListener("click",O)})}function xF(n={}){let e=cu("select-box"),t=document.createElement("div");t.classList.add(e.b());let r=document.createElement("div");r.classList.add(e.be("block"));for(let o=0;o<(n.row||8);o++)for(let l=0;l<(n.col||8);l++){let a=document.createElement("div");a.classList.add(e.be("item")),a.dataset.row=String(o+1),a.dataset.col=String(l+1),r.appendChild(a)}let i=()=>{let{row:o,col:l}=t.dataset;for(let h of Array.from(r.querySelectorAll(".active")))h.classList.remove("active");if(!o||!l)return;let a=Array.from(r.children);for(let h=0;h<a.length;h++){let{row:g,col:m}=a[h].dataset;if(g>o&&m>l)return;g<=o&&m<=l?a[h].classList.add("active"):a[h].classList.remove("active")}};if(r.addEventListener("mousemove",o=>{if(!o.target)return;let{row:l,col:a}=o.target.dataset;!l||!a||(t.dataset.row=l,t.dataset.col=a,i())}),r.addEventListener("mouseleave",()=>{t.removeAttribute("data-row"),t.removeAttribute("data-col"),i()}),r.addEventListener("click",()=>{let{row:o,col:l}=t.dataset;!o||!l||n.onSelect&&n.onSelect(Number(o),Number(l))}),t.appendChild(r),n.customBtn){let o=n.texts||{},l=document.createElement("div");l.classList.add(e.be("custom")),l.textContent=o.customBtnText||"Custom",l.addEventListener("click",async()=>{let a=await mF(o);a&&n.onSelect&&n.onSelect(a.row,a.col)}),t.appendChild(l)}return t}const uv=Math.min,Og=Math.max,fv=Math.round,M0=Math.floor,td=n=>({x:n,y:n}),wF={left:"right",right:"left",bottom:"top",top:"bottom"},CF={start:"end",end:"start"};function yw(n,e,t){return Og(n,uv(e,t))}function R1(n,e){return typeof n=="function"?n(e):n}function cg(n){return n.split("-")[0]}function Dv(n){return n.split("-")[1]}function Zm(n){return n==="x"?"y":"x"}function a_(n){return n==="y"?"height":"width"}function Ed(n){return["top","bottom"].includes(cg(n))?"y":"x"}function c_(n){return Zm(Ed(n))}function _F(n,e,t){t===void 0&&(t=!1);let r=Dv(n),i=c_(n),o=a_(i),l=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=hv(l)),[l,hv(l)]}function SF(n){let e=hv(n);return[rm(n),e,rm(e)]}function rm(n){return n.replace(/start|end/g,e=>CF[e])}function EF(n,e,t){let r=["left","right"],i=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?o:l;default:return[]}}function TF(n,e,t,r){let i=Dv(n),o=EF(cg(n),t==="start",r);return i&&(o=o.map(l=>l+"-"+i),e&&(o=o.concat(o.map(rm)))),o}function hv(n){return n.replace(/left|right|bottom|top/g,e=>wF[e])}function AF(n){return{top:0,right:0,bottom:0,left:0,...n}}function RF(n){return typeof n=="number"?{top:n,right:n,bottom:n,left:n}:AF(n)}function dv(n){let{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function mw(n,e,t){let{reference:r,floating:i}=n,o=Ed(e),l=c_(e),a=a_(l),h=cg(e),g=o==="y",m=r.x+r.width/2-i.width/2,x=r.y+r.height/2-i.height/2,w=r[a]/2-i[a]/2,_;switch(h){case"top":_={x:m,y:r.y-i.height};break;case"bottom":_={x:m,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:x};break;case"left":_={x:r.x-i.width,y:x};break;default:_={x:r.x,y:r.y}}switch(Dv(e)){case"start":_[l]-=w*(t&&g?-1:1);break;case"end":_[l]+=w*(t&&g?-1:1);break}return _}const IF=async(n,e,t)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=t,a=o.filter(Boolean),h=await(l.isRTL==null?void 0:l.isRTL(e)),g=await l.getElementRects({reference:n,floating:e,strategy:i}),{x:m,y:x}=mw(g,r,h),w=r,_={},S=0;for(let R=0;R<a.length;R++){let{name:k,fn:O}=a[R],{x:P,y:z,data:H,reset:G}=await O({x:m,y:x,initialPlacement:r,placement:w,strategy:i,middlewareData:_,rects:g,platform:l,elements:{reference:n,floating:e}});m=P??m,x=z??x,_={..._,[k]:{..._[k],...H}},G&&S<=50&&(S++,typeof G=="object"&&(G.placement&&(w=G.placement),G.rects&&(g=G.rects===!0?await l.getElementRects({reference:n,floating:e,strategy:i}):G.rects),{x:m,y:x}=mw(g,w,h)),R=-1)}return{x:m,y:x,placement:w,strategy:i,middlewareData:_}};async function u_(n,e){e===void 0&&(e={});let{x:t,y:r,platform:i,rects:o,elements:l,strategy:a}=n,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:x=!1,padding:w=0}=R1(e,n),_=RF(w),S=m==="floating"?"reference":"floating",R=l[x?S:m],k=dv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(R))??!0?R:R.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:h,rootBoundary:g,strategy:a})),O=m==="floating"?{x:t,y:r,width:o.floating.width,height:o.floating.height}:o.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),z=await(i.isElement==null?void 0:i.isElement(P))&&await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1},H=dv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:O,offsetParent:P,strategy:a}):O);return{top:(k.top-H.top+_.top)/z.y,bottom:(H.bottom-k.bottom+_.bottom)/z.y,left:(k.left-H.left+_.left)/z.x,right:(H.right-k.right+_.right)/z.x}}const kF=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var fe,X,te,ne;var t;let{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:a,elements:h}=e,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:S=!0,...R}=R1(n,e);if((t=i.arrow)!=null&&t.alignmentOffset)return{};let k=cg(r),O=Ed(l),P=cg(l)===l,z=await(a.isRTL==null?void 0:a.isRTL(h.floating)),H=x||(P||!S?[hv(l)]:SF(l)),G=_!=="none";!x&&G&&H.push(...TF(l,S,_,z));let N=[l,...H],J=await u_(e,R),Y=[],K=((fe=i.flip)==null?void 0:fe.overflows)||[];if(g&&Y.push(J[k]),m){let ue=_F(r,o,z);Y.push(J[ue[0]],J[ue[1]])}if(K=[...K,{placement:r,overflows:Y}],!Y.every(ue=>ue<=0)){let ue=(((X=i.flip)==null?void 0:X.index)||0)+1,se=N[ue];if(se&&(!(m==="alignment"?O!==Ed(se):!1)||K.every(ge=>ge.overflows[0]>0&&Ed(ge.placement)===O)))return{data:{index:ue,overflows:K},reset:{placement:se}};let $=(te=K.filter(re=>re.overflows[0]<=0).sort((re,ge)=>re.overflows[1]-ge.overflows[1])[0])==null?void 0:te.placement;if(!$)switch(w){case"bestFit":{let re=(ne=K.filter(ge=>{if(G){let me=Ed(ge.placement);return me===O||me==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(me=>me>0).reduce((me,oe)=>me+oe,0)]).sort((ge,me)=>ge[1]-me[1])[0])==null?void 0:ne[0];re&&($=re);break}case"initialPlacement":$=l;break}if(r!==$)return{reset:{placement:$}}}return{}}}};async function MF(n,e){let{placement:t,platform:r,elements:i}=n,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=cg(t),a=Dv(t),h=Ed(t)==="y",g=["left","top"].includes(l)?-1:1,m=o&&h?-1:1,x=R1(e,n),{mainAxis:w,crossAxis:_,alignmentAxis:S}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return a&&typeof S=="number"&&(_=a==="end"?S*-1:S),h?{x:_*m,y:w*g}:{x:w*g,y:_*m}}const LF=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var h;var t;let{x:r,y:i,placement:o,middlewareData:l}=e,a=await MF(e,n);return o===((h=l.offset)==null?void 0:h.placement)&&(t=l.arrow)!=null&&t.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:o}}}}},OF=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:a={fn:k=>{let{x:O,y:P}=k;return{x:O,y:P}}},...h}=R1(n,e),g={x:t,y:r},m=await u_(e,h),x=Ed(cg(i)),w=Zm(x),_=g[w],S=g[x];if(o){let k=w==="y"?"top":"left",O=w==="y"?"bottom":"right",P=_+m[k],z=_-m[O];_=yw(P,_,z)}if(l){let k=x==="y"?"top":"left",O=x==="y"?"bottom":"right",P=S+m[k],z=S-m[O];S=yw(P,S,z)}let R=a.fn({...e,[w]:_,[x]:S});return{...R,data:{x:R.x-t,y:R.y-r,enabled:{[w]:o,[x]:l}}}}}},PF=function(n){return n===void 0&&(n={}),{options:n,fn(e){var O,P;let{x:t,y:r,placement:i,rects:o,middlewareData:l}=e,{offset:a=0,mainAxis:h=!0,crossAxis:g=!0}=R1(n,e),m={x:t,y:r},x=Ed(i),w=Zm(x),_=m[w],S=m[x],R=R1(a,e),k=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:0,crossAxis:0,...R};if(h){let z=w==="y"?"height":"width",H=o.reference[w]-o.floating[z]+k.mainAxis,G=o.reference[w]+o.reference[z]-k.mainAxis;_<H?_=H:_>G&&(_=G)}if(g){let z=w==="y"?"width":"height",H=["top","left"].includes(cg(i)),G=o.reference[x]-o.floating[z]+(H&&((O=l.offset)==null?void 0:O[x])||0)+(H?0:k.crossAxis),N=o.reference[x]+o.reference[z]+(H?0:((P=l.offset)==null?void 0:P[x])||0)-(H?k.crossAxis:0);S<G?S=G:S>N&&(S=N)}return{[w]:_,[x]:S}}}};function Nv(){return typeof window<"u"}function D1(n){return f_(n)?(n.nodeName||"").toLowerCase():"#document"}function Bf(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function ad(n){var e;return(e=(f_(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function f_(n){return Nv()?n instanceof Node||n instanceof Bf(n).Node:!1}function Dh(n){return Nv()?n instanceof Element||n instanceof Bf(n).Element:!1}function od(n){return Nv()?n instanceof HTMLElement||n instanceof Bf(n).HTMLElement:!1}function xw(n){return!Nv()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Bf(n).ShadowRoot}function Zp(n){let{overflow:e,overflowX:t,overflowY:r,display:i}=Nh(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function DF(n){return["table","td","th"].includes(D1(n))}function Fv(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function Xm(n){let e=Km(),t=Dh(n)?Nh(n):n;return["transform","translate","scale","rotate","perspective"].some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function NF(n){let e=ug(n);for(;od(e)&&!I1(e);){if(Xm(e))return e;if(Fv(e))return null;e=ug(e)}return null}function Km(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function I1(n){return["html","body","#document"].includes(D1(n))}function Nh(n){return Bf(n).getComputedStyle(n)}function Bv(n){return Dh(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ug(n){if(D1(n)==="html")return n;let e=n.assignedSlot||n.parentNode||xw(n)&&n.host||ad(n);return xw(e)?e.host:e}function h_(n){let e=ug(n);return I1(e)?n.ownerDocument?n.ownerDocument.body:n.body:od(e)&&Zp(e)?e:h_(e)}function Dp(n,e,t){var l;e===void 0&&(e=[]),t===void 0&&(t=!0);let r=h_(n),i=r===((l=n.ownerDocument)==null?void 0:l.body),o=Bf(r);if(i){let a=im(o);return e.concat(o,o.visualViewport||[],Zp(r)?r:[],a&&t?Dp(a):[])}return e.concat(r,Dp(r,[],t))}function im(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function d_(n){let e=Nh(n),t=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=od(n),o=i?n.offsetWidth:t,l=i?n.offsetHeight:r,a=fv(t)!==o||fv(r)!==l;return a&&(t=o,r=l),{width:t,height:r,$:a}}function Jm(n){return Dh(n)?n:n.contextElement}function y1(n){let e=Jm(n);if(!od(e))return td(1);let t=e.getBoundingClientRect(),{width:r,height:i,$:o}=d_(e),l=(o?fv(t.width):t.width)/r,a=(o?fv(t.height):t.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const FF=td(0);function g_(n){let e=Bf(n);return!Km()||!e.visualViewport?FF:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function BF(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Bf(n)?!1:e}function Fg(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=n.getBoundingClientRect(),o=Jm(n),l=td(1);e&&(r?Dh(r)&&(l=y1(r)):l=y1(n));let a=BF(o,t,r)?g_(o):td(0),h=(i.left+a.x)/l.x,g=(i.top+a.y)/l.y,m=i.width/l.x,x=i.height/l.y;if(o){let w=Bf(o),_=r&&Dh(r)?Bf(r):r,S=w,R=im(S);for(;R&&r&&_!==S;){let k=y1(R),O=R.getBoundingClientRect(),P=Nh(R),z=O.left+(R.clientLeft+parseFloat(P.paddingLeft))*k.x,H=O.top+(R.clientTop+parseFloat(P.paddingTop))*k.y;h*=k.x,g*=k.y,m*=k.x,x*=k.y,h+=z,g+=H,S=Bf(R),R=im(S)}}return dv({width:m,height:x,x:h,y:g})}function Qm(n,e){let t=Bv(n).scrollLeft;return e?e.left+t:Fg(ad(n)).left+t}function p_(n,e,t){t===void 0&&(t=!1);let r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:Qm(n,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function zF(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n,o=i==="fixed",l=ad(r),a=e?Fv(e.floating):!1;if(r===l||a&&o)return t;let h={scrollLeft:0,scrollTop:0},g=td(1),m=td(0),x=od(r);if((x||!x&&!o)&&((D1(r)!=="body"||Zp(l))&&(h=Bv(r)),od(r))){let _=Fg(r);g=y1(r),m.x=_.x+r.clientLeft,m.y=_.y+r.clientTop}let w=l&&!x&&!o?p_(l,h,!0):td(0);return{width:t.width*g.x,height:t.height*g.y,x:t.x*g.x-h.scrollLeft*g.x+m.x+w.x,y:t.y*g.y-h.scrollTop*g.y+m.y+w.y}}function HF(n){return Array.from(n.getClientRects())}function WF(n){let e=ad(n),t=Bv(n),r=n.ownerDocument.body,i=Og(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Og(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),l=-t.scrollLeft+Qm(n),a=-t.scrollTop;return Nh(r).direction==="rtl"&&(l+=Og(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:a}}function UF(n,e){let t=Bf(n),r=ad(n),i=t.visualViewport,o=r.clientWidth,l=r.clientHeight,a=0,h=0;if(i){o=i.width,l=i.height;let g=Km();(!g||g&&e==="fixed")&&(a=i.offsetLeft,h=i.offsetTop)}return{width:o,height:l,x:a,y:h}}function GF(n,e){let t=Fg(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,o=od(n)?y1(n):td(1),l=n.clientWidth*o.x,a=n.clientHeight*o.y,h=i*o.x,g=r*o.y;return{width:l,height:a,x:h,y:g}}function ww(n,e,t){let r;if(e==="viewport")r=UF(n,t);else if(e==="document")r=WF(ad(n));else if(Dh(e))r=GF(e,t);else{let i=g_(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return dv(r)}function v_(n,e){let t=ug(n);return t===e||!Dh(t)||I1(t)?!1:Nh(t).position==="fixed"||v_(t,e)}function YF(n,e){let t=e.get(n);if(t)return t;let r=Dp(n,[],!1).filter(a=>Dh(a)&&D1(a)!=="body"),i=null,o=Nh(n).position==="fixed",l=o?ug(n):n;for(;Dh(l)&&!I1(l);){let a=Nh(l),h=Xm(l);!h&&a.position==="fixed"&&(i=null),(o?!h&&!i:!h&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Zp(l)&&!h&&v_(n,l))?r=r.filter(m=>m!==l):i=a,l=ug(l)}return e.set(n,r),r}function VF(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n,o=t==="clippingAncestors"?Fv(e)?[]:YF(e,this._c):[].concat(t),l=[...o,r],a=l[0],h=l.reduce((g,m)=>{let x=ww(e,m,i);return g.top=Og(x.top,g.top),g.right=uv(x.right,g.right),g.bottom=uv(x.bottom,g.bottom),g.left=Og(x.left,g.left),g},ww(e,a,i));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function ZF(n){let{width:e,height:t}=d_(n);return{width:e,height:t}}function XF(n,e,t){let r=od(e),i=ad(e),o=t==="fixed",l=Fg(n,!0,o,e),a={scrollLeft:0,scrollTop:0},h=td(0);function g(){h.x=Qm(i)}if(r||!r&&!o)if((D1(e)!=="body"||Zp(i))&&(a=Bv(e)),r){let _=Fg(e,!0,o,e);h.x=_.x+e.clientLeft,h.y=_.y+e.clientTop}else i&&g();o&&!r&&i&&g();let m=i&&!r&&!o?p_(i,a):td(0),x=l.left+a.scrollLeft-h.x-m.x,w=l.top+a.scrollTop-h.y-m.y;return{x,y:w,width:l.width,height:l.height}}function Mb(n){return Nh(n).position==="static"}function Cw(n,e){if(!od(n)||Nh(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return ad(n)===t&&(t=t.ownerDocument.body),t}function b_(n,e){let t=Bf(n);if(Fv(n))return t;if(!od(n)){let i=ug(n);for(;i&&!I1(i);){if(Dh(i)&&!Mb(i))return i;i=ug(i)}return t}let r=Cw(n,e);for(;r&&DF(r)&&Mb(r);)r=Cw(r,e);return r&&I1(r)&&Mb(r)&&!Xm(r)?t:r||NF(n)||t}const KF=async function(n){let e=this.getOffsetParent||b_,t=this.getDimensions,r=await t(n.floating);return{reference:XF(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JF(n){return Nh(n).direction==="rtl"}const QF={convertOffsetParentRelativeRectToViewportRelativeRect:zF,getDocumentElement:ad,getClippingRect:VF,getOffsetParent:b_,getElementRects:KF,getClientRects:HF,getDimensions:ZF,getScale:y1,isElement:Dh,isRTL:JF};function y_(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function qF(n,e){let t=null,r,i=ad(n);function o(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function l(a,h){a===void 0&&(a=!1),h===void 0&&(h=1),o();let g=n.getBoundingClientRect(),{left:m,top:x,width:w,height:_}=g;if(a||e(),!w||!_)return;let S=M0(x),R=M0(i.clientWidth-(m+w)),k=M0(i.clientHeight-(x+_)),O=M0(m),P=-S+"px "+-R+"px "+-k+"px "+-O+"px",z={rootMargin:P,threshold:Og(0,uv(1,h))||1},H=!0;function G(N){let J=N[0].intersectionRatio;if(J!==h){if(!H)return l();J?l(!1,J):r=setTimeout(()=>{l(!1,1e-7)},1e3)}J===1&&!y_(g,n.getBoundingClientRect())&&l(),H=!1}try{t=new IntersectionObserver(G,{...z,root:i.ownerDocument})}catch{t=new IntersectionObserver(G,z)}t.observe(n)}return l(!0),o}function jF(n,e,t,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,g=Jm(n),m=i||o?[...g?Dp(g):[],...Dp(e)]:[];m.forEach(O=>{i&&O.addEventListener("scroll",t,{passive:!0}),o&&O.addEventListener("resize",t)});let x=g&&a?qF(g,t):null,w=-1,_=null;l&&(_=new ResizeObserver(O=>{let[P]=O;P&&P.target===g&&_&&(_.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var z;(z=_)==null||z.observe(e)})),t()}),g&&!h&&_.observe(g),_.observe(e));let S,R=h?Fg(n):null;h&&k();function k(){let O=Fg(n);R&&!y_(R,O)&&t(),R=O,S=requestAnimationFrame(k)}return t(),()=>{var O;m.forEach(P=>{i&&P.removeEventListener("scroll",t),o&&P.removeEventListener("resize",t)}),x==null||x(),(O=_)==null||O.disconnect(),_=null,h&&cancelAnimationFrame(S)}}const m_=LF,x_=OF,w_=kF,C_=PF,__=(n,e,t)=>{let r=new Map,i={platform:QF,...t},o={...i.platform,_c:r};return IF(n,e,{...i,platform:o})};function $F(n,e,t,r,i){return n.addEventListener("transitionend",t,r),setTimeout(()=>{t()},e)}const eB=4;let L0;function Lb(n,e={}){let{msg:t="",delay:r=150,content:i,direction:o="bottom",type:l="hover",container:a,onOpen:h,onClose:g,closed:m,onDestroy:x}=e,w=cu("tooltip");if(t||i){L0||(L0=document.createElement("div"),document.body.appendChild(L0));let _=a||L0,S=document.createElement("div");S.classList.add(w.b(),"hidden","transparent"),i?S.appendChild(i):t&&(S.textContent=t);let R,k,O,P=()=>{O&&O(),__(n,S,{placement:o,middleware:[w_(),x_({limiter:C_()}),m_(eB)]}).then(({x:ue,y:se})=>{Object.assign(S.style,{left:`${ue}px`,top:`${se}px`})})},z=()=>{S.classList.add("hidden"),_.contains(S)&&_.removeChild(S),O&&O(),m&&m()},H=(ue=!1)=>{k&&clearTimeout(k),R=setTimeout(()=>{if(h){let se=h(ue);if(!ue&&se)return}_.appendChild(S),S.removeEventListener("transitionend",z),S.classList.remove("hidden"),O=jF(n,S,P),S.classList.remove("transparent")},r)},G=(ue=!1)=>{R&&clearTimeout(R),k=setTimeout(()=>{if(g){let se=g(ue);if(!ue&&se)return}$F(S,150,z,{once:!0}),S.classList.add("transparent")},r)},N=()=>{let ue=[n,S],se=G.bind(void 0,!1),$=H.bind(void 0,!1);return{prepare:()=>{for(let ge of ue)ge.addEventListener("mouseenter",$),ge.addEventListener("mouseleave",se)},show:H,hide:G,destroy:()=>{for(let ge of ue)ge.removeEventListener("mouseenter",$),ge.removeEventListener("mouseleave",se)}}},J=()=>{let ue=$=>{$.stopPropagation(),G(!1)},se=$=>{$.stopPropagation(),H(),document.removeEventListener("click",ue),document.addEventListener("click",ue,{once:!0})};return{prepare:()=>{S.addEventListener("click",$=>$.stopPropagation()),n.addEventListener("click",se)},show:H,hide:($=!1)=>{G($),document.removeEventListener("click",ue)},destroy:()=>{n.removeEventListener("click",se),document.removeEventListener("click",ue)}}},Y={hover:N,click:J},{prepare:K,show:fe,hide:X,destroy:te}=Y[l]();return K(),{show:fe,hide:X,destroy:()=>{X(!0),x&&x(),te(),O&&O(),S.remove()}}}return null}function tB(n,e,t=0,r=!0){let{x:i,y:o,x1:l,y1:a}=n,{x:h,y:g,x1:m,y1:x}=e,w,_;return r?(w=l<h+t||i-t>m,_=a<g+t||o-t>x):(w=l<=h+t||i-t>=m,_=a<=g+t||o-t>=x),!(w||_)}function nB(n,e){let t=e.getBoundingClientRect();return{x:n.x-t.x-e.scrollLeft,y:n.y-t.y-e.scrollTop,x1:n.x-t.x-e.scrollLeft+n.width,y1:n.y-t.y-e.scrollTop+n.height,width:n.width,height:n.height}}const O0=8;function rB(n){let{left:e,top:t,width:r,height:i}=n,{clientWidth:o,clientHeight:l}=document.documentElement,a=!1,h=!1;return e+r>o?(e=o-r-O0,a=!0):e<0&&(e=O0,a=!0),t+i>l?(t=l-i-O0,h=!0):t<0&&(t=O0,h=!0),{left:e,top:t,leftLimited:a,topLimited:h}}function iB(n,e={}){let t=Symbol("ignoreFirstBind"),r=new Set,i=new ResizeObserver(h=>{e.ignoreFirstBind&&h.some(g=>{let m=g.target,x=m[t];return m[t]=!0,!x})||n(h)}),o=i.observe;i.observe=(h,g)=>{r.add(h),o.call(i,h,g)};let l=i.unobserve;i.unobserve=h=>{r.has(h)&&(r.delete(h),h[t]=void 0),l.call(i,h)};let a=i.disconnect;return i.disconnect=()=>{for(let h of r.values())h[t]=void 0;a.call(i)},i}function gv(n,e){n.addEventListener("scroll",e),this.scrollHandler.push([n,e])}function J0(){for(let n=0;n<this.scrollHandler.length;n++){let[e,t]=this.scrollHandler[n];e.removeEventListener("scroll",t)}this.scrollHandler=[]}function ap(n){return{y:n.scrollTop,x:n.scrollLeft}}function pv(n){let e={},t=n.trim().split(";");for(let r=0;r<t.length;r++){let i=t[r].trim();if(!i)continue;let o=i.indexOf(":");if(o===-1)continue;let l=i.slice(0,Math.max(0,o)).trim(),a=i.slice(Math.max(0,o+1)).trim();e[k1(l)]=a}return e}function om(n){return Object.entries(n).map(([e,t])=>`${oB(e)}: ${t};`).join(" ")}function oB(n){return n.replaceAll(/([A-Z])/g," $1").trim().split(" ").join("-").toLowerCase()}function k1(n){return n.replaceAll(/-(\w)/g,(e,t)=>t.toUpperCase())}const Fa=()=>Math.random().toString(36).slice(2);function S_(n,e){let t;return function(...r){t&&clearTimeout(t),t=setTimeout(()=>{n.apply(this,r)},e)}}const Ob=Xe.import("parchment"),_w=Xe.import("blots/container"),lB=Xe.import("blots/block"),sB=Xe.import("blots/block/embed");var uh,dg=(uh=class extends _w{static create(e){let t=document.createElement(this.tagName);return this.className&&t.classList.add(this.className),t}optimize(e){if(this.children.length===0)if(this.statics.defaultChild!=null){let t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove();this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}enforceAllowedChildren(){this.children.forEach(e=>{this.statics.allowedChildren.some(r=>e instanceof r)||(e.statics.scope===Ob.Scope.BLOCK_BLOT?(e.parent instanceof uh?(e.next!=null&&e.parent.splitAfter(e),e.prev!=null&&e.parent.splitAfter(e.prev)):(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev)),e.parent.unwrap()):e instanceof Ob.ParentBlot?e.unwrap():e.remove())})}},Ee(uh,"tagName"),Ee(uh,"blotName",Qe.container),Ee(uh,"scope",Ob.Scope.BLOCK_BLOT),Ee(uh,"allowedChildren",[lB,sB,_w]),Ee(uh,"requiredContainer"),Ee(uh,"defaultChild"),uh);const ig=n=>vF(n)?n:1,Sw=Xe.import("blots/block"),aB=Xe.import("blots/block/embed");var Zd,cf=(Zd=class extends dg{static isAllowStyle(n){let e=k1(n);for(let t of this.allowStyle)if(e.startsWith(k1(t)))return!0;return!1}static create(n){let{tableId:e,rowId:t,colId:r,rowspan:i,colspan:o,style:l,emptyRow:a,tag:h="td"}=n,g=super.create();g.dataset.tableId=e,g.dataset.rowId=t,g.dataset.colId=r,g.dataset.rowspan=String(ig(i)),g.dataset.colspan=String(ig(o)),g.dataset.tag=h,l&&(g.dataset.style=l);try{a&&(g.dataset.emptyRow=JSON.stringify(a))}catch{}return g}static formats(n){let{tableId:e,rowId:t,colId:r,rowspan:i,colspan:o,style:l,emptyRow:a,tag:h="td"}=n.dataset,g={tableId:String(e),rowId:String(t),colId:String(r),rowspan:Number(ig(i)),colspan:Number(ig(o)),tag:h};l&&(g.style=l);try{a&&(g.emptyRow=JSON.parse(a))}catch{}return g}constructor(n,e,t){super(n,e),e.setAttribute("contenteditable",String(n.isEnabled()))}setFormatValue(n,e,t=!1){if(t){if(!this.statics.isAllowStyle(n))return;this.parent&&this.parent.statics.blotName===Qe.tableCell&&this.parent.setFormatValue(n,e)}else{if(!this.statics.allowDataAttrs.has(n))return;let r=`data-${n}`;e?this.domNode.setAttribute(r,e):this.domNode.removeAttribute(r),this.parent&&this.parent.statics.blotName===Qe.tableCell&&this.parent.setFormatValue(n,e)}this.clearCache()}clearCache(){let n=this.descendants(Sw,0);for(let e of n)e.cache={}}get tableId(){return this.domNode.dataset.tableId}get rowId(){return this.domNode.dataset.rowId}set rowId(n){this.setFormatValue("row-id",n)}get colId(){return this.domNode.dataset.colId}set colId(n){this.setFormatValue("col-id",n)}get rowspan(){return Number(this.domNode.dataset.rowspan)}set rowspan(n){this.setFormatValue("rowspan",n)}get colspan(){return Number(this.domNode.dataset.colspan)}set colspan(n){this.setFormatValue("colspan",n)}get emptyRow(){try{return JSON.parse(this.domNode.dataset.emptyRow)}catch{return[]}}set emptyRow(n){if(this.emptyRow.toString()!==n.toString())try{n.length>0?this.setFormatValue("empty-row",JSON.stringify(n),!1):this.setFormatValue("empty-row",null,!1)}catch{this.setFormatValue("empty-row",null,!1)}}getColumnIndex(){return Kl(this,Qe.tableMain).getColIds().indexOf(this.colId)}setStyleByString(n){let e=pv(n);for(let[t,r]of Object.entries(e))this.setFormatValue(t,r,!0)}convertTableCell(){this.parent.statics.blotName===Qe.tableCell&&(this.parent.convertTableCell(),this.clearCache())}formatAt(n,e,t,r){this.children.length===0&&(this.appendChild(this.scroll.create(this.statics.defaultChild.blotName)),e+=1),super.formatAt(n,e,t,r),r&&r.style&&this.setStyleByString(r.style)}insertAt(n,e,t){let[r]=this.children.find(n);if(!r&&this.statics.defaultChild){let i=this.scroll.create(this.statics.defaultChild.blotName||"block");this.appendChild(i)}super.insertAt(n,e,t)}formats(){let n=this.statics.formats(this.domNode);return{[this.statics.blotName]:n}}checkMerge(){let{colId:n,rowId:e,colspan:t,rowspan:r}=this,i=this.next;return i!==null&&i.statics.blotName===this.statics.blotName&&i.rowId===e&&i.colId===n&&i.colspan===t&&i.rowspan===r}optimize(){let n=this.parent,e=this.statics.formats(this.domNode);if(this.prev&&this.prev instanceof aB){let r=this.prev;if(this.insertBefore(r,this.children.head),this.length()<=1){let i=this.scroll.create("block");this.insertBefore(i,r.next)}}let t=n!==null&&n.statics.blotName!==Qe.tableCell;if(t&&(this.wrap(Qe.tableCell,e),this.children.length===0)){let r=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(r)}this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove()),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0?this.remove():this.domNode.dataset.style&&t&&n.domNode.style.cssText!==this.domNode.dataset.style&&this.setStyleByString(this.domNode.dataset.style)}insertBefore(n,e){if(n.statics.blotName===this.statics.blotName){let t=n,r=this.statics.formats(t.domNode),i=this.statics.formats(this.domNode);if(Object.entries(i).every(([l,a])=>String(a)===String(r[l]))){let l=this.split(e?e.offset():0);return this.parent.insertBefore(t,l)}else{let[l,a]=A1(this,[Qe.tableRow,Qe.tableCell]);if(e){let h=e.offset(),g=this.length();if(h+1<g){let m=this.scroll.create(Qe.tableCellInner,i);this.children.forEachAt(h+1,this.length(),x=>{m.appendChild(x)}),l.insertBefore(m.wrap(Qe.tableCell,i),a.next)}}if(this.rowId!==t.rowId){if(e){let m=e.offset(l);l.split(m)}else if(a.next){let m=a.next.offset(l);l.split(m)}let h=this.scroll.create(Qe.tableRow,r),g=this.scroll.create(Qe.tableCell,r);return g.appendChild(t),h.appendChild(g),l.parent.insertBefore(h,l.next)}return l.insertBefore(t.wrap(Qe.tableCell,r),e?a:a.next)}}else if(n.statics.blotName===Qe.tableCol){try{let t=Kl(this,Qe.tableBody),r=this.offset(t),i=t.split(r);t.parent.insertBefore(n,i),n.optimize({})}catch{console.warn("TableCellInner not in TableBody")}return}super.insertBefore(n,e)}},Ee(Zd,"blotName",Qe.tableCellInner),Ee(Zd,"tagName","div"),Ee(Zd,"className","ql-table-cell-inner"),Ee(Zd,"allowDataAttrs",new Set(["table-id","row-id","col-id","rowspan","colspan","empty-row"])),Ee(Zd,"defaultChild",Sw),Ee(Zd,"allowStyle",new Set(["background-color","border","height"])),Zd),up,qh=(up=class extends dg{static create(n){let e=super.create();return e.dataset.tableId=n.tableId,e.dataset.rowId=n.rowId,e}get rowId(){return this.domNode.dataset.rowId}get tableId(){return this.domNode.dataset.tableId}setHeight(n){this.foreachCellInner(e=>{e.setFormatValue("height",n,!0)})}getCellByColId(n,e){let t=Kl(this,Qe.tableMain),r=t.getColIds(),i=r.indexOf(n),o=this.children.iterator(),l=null;for(;l=o();){if(l.colId===n)return l;let a=r.indexOf(l.colId);if(a<i&&a+l.colspan>i)return l}return this[e]&&this[e].statics.blotName===Qe.tableRow?this[e].getCellByColId(n,e):null}insertCell(n,e){let t=[],r=this.children.iterator(),i=0,o;for(;(o=r())&&(i+=o.colspan,!(i>n));)if(o.rowspan!==1)for(let l=0;l<o.rowspan-1;l++)t[l]=(t[l]||0)+o.colspan;if(o&&i-o.colspan<n){let l=o.getCellInner();l.colspan+=1,o.rowspan!==1&&(t.skipRowNum=o.rowspan-1)}else{let l=this.scroll.create(Qe.tableCell,e),a=this.scroll.create(Qe.tableCellInner,e),h=this.scroll.create("block");h.appendChild(this.scroll.create("break")),a.appendChild(h),l.appendChild(a),this.insertBefore(l,o)}return t}getCellByColumIndex(n){let e=[],t=null,r=0;if(n<0)return[t,r,e];let i=this.children.iterator();for(;t=i();){if(r+=t.colspan,t.rowspan!==1)for(let o=0;o<t.rowspan-1;o++)e[o]=(e[o]||0)+t.colspan;if(r>n)break}return[t,r,e]}removeCell(n){if(n<0)return[];let e=this.getCellByColumIndex(n),[t,r]=e,i=e[2];if(!t)return i;if(r-t.colspan<n||t.colspan>1){let[o]=t.descendants(cf);if(t.colspan!==1&&n===r-t.colspan){let l=Kl(this,Qe.tableMain),a=l.getColIds();o.colId=a[a.indexOf(o.colId)+1]}t.rowspan!==1&&(i.skipRowNum=t.rowspan-1),--o.colspan}else t.remove();return i}foreachCellInner(n){let e=this.children.iterator(),t=0,r;for(;r=e();){let[i]=r.descendants(cf);if(n(i,t++))break}}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.rowId===this.rowId}optimize(n){let e=this.parent,{tableId:t}=this;e!==null&&e.statics.blotName!==Qe.tableBody&&this.wrap(Qe.tableBody,t),this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName),this.enforceAllowedChildren(),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}},Ee(up,"blotName",Qe.tableRow),Ee(up,"tagName","tr"),Ee(up,"className","ql-table-row"),up),H0,eg=(H0=class extends dg{static create(n){let e=super.create();return e.dataset.tableId=n,e}get tableId(){return this.domNode.dataset.tableId}insertRow(n){let e=Kl(this,Qe.tableMain);if(!e)return;let t=e.getColIds(),r=this.descendants(qh),i=new Set(t),o=0;for(let g of r){if(o===n)break;g.foreachCellInner(m=>{if(o+m.rowspan>n&&(m.rowspan+=1,i.delete(m.colId),m.colspan!==1)){let x=t.indexOf(m.colId);for(let w=0;w<m.colspan-1;w++)i.delete(t[x+w+1])}}),o+=1}let l=e.tableId,a=Fa(),h=this.scroll.create(Qe.tableRow,{tableId:l,rowId:a});for(let g of i){let m=this.scroll.create("break"),x=m.wrap("block"),w=x.wrap(Qe.tableCellInner,{tableId:l,rowId:a,colId:g,rowspan:1,colspan:1}),_=w.wrap(Qe.tableCell,{tableId:l,rowId:a,colId:g,rowspan:1,colspan:1});h.appendChild(_)}this.insertBefore(h,r[n]||null)}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===this.tableId}optimize(n){let e=this.parent;if(e!==null&&e.statics.blotName!==Qe.tableMain){let{tableId:t}=this;this.wrap(Qe.tableMain,{tableId:t})}super.optimize(n)}},Ee(H0,"blotName",Qe.tableBody),Ee(H0,"tagName","tbody"),H0);const cB=Xe.import("parchment"),uB=Xe.import("blots/block"),fB=Xe.import("blots/container");var lm=class extends uB{replaceWith(n,e){let t=Lg(n)?this.scroll.create(n,e):n;if(t instanceof cB.ParentBlot)if(t.statics.blotName===Qe.tableCellInner){try{let i=Kl(this,Qe.tableCellInner),o=i.formats(),l=t.formats();if(Object.keys(o).every(h=>JSON.stringify(o[h])===JSON.stringify(l[h])))return i}catch{}let r=this.parent;if(r.statics.blotName===Qe.tableCellInner){if(r==null||r.insertBefore(t,this.prev?null:this.next),r.statics.blotName===Qe.tableCellInner){let i=this;for(;i;){let o=i.next;t.appendChild(i),i=o}}else t.appendChild(this);if(r&&r.length()===0){r.remove(),r.parent.statics.blotName===Qe.tableCell&&r.parent.length()===0&&r.parent.remove();let i=r.parent.parent;i.statics.blotName===Qe.tableRow&&i.children.length===0&&i.remove()}}else r instanceof fB?r.parent.insertBefore(t,r):r==null||r.insertBefore(t,this.next),t.appendChild(this);return t}else this.moveChildren(t);return this.parent!=null&&(this.parent.insertBefore(t,this.next),this.remove()),this.attributes.copy(t),t}format(n,e){if(n===Qe.tableCellInner&&this.parent.statics.blotName===n&&!e)try{Kl(this,Qe.tableCellInner).unwrap()}catch{console.error("unwrap TableCellInner error")}else super.format(n,e)}};const hB=Xe.import("blots/block/embed");var Ew=class extends hB{delta(){let n=super.delta(),e=sm(this);return e[Qe.tableCellInner]&&n.insert(`
340
+ `,{[Qe.tableCellInner]:e[Qe.tableCellInner]}),n}length(){return sm(this)[Qe.tableCellInner]&&(!this.next||this.next.length()<=1)?super.length()+1:super.length()}};function sm(n,e={},t=!0){return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:sm(n.parent,e,t)}const Tw=Xe.import("parchment"),dB=Xe.import("blots/scroll");var gB=class extends dB{enable(n=!0){let e=Xe.import(`formats/${Qe.tableCellInner}`),t=this.domNode.querySelectorAll(`.${e.className}`);for(let o of Array.from(t))o.setAttribute("contenteditable",String(!!n));let r=Xe.import(`formats/${Qe.tableCaption}`),i=this.domNode.querySelectorAll(`.${r.className}`);for(let o of Array.from(i))o.setAttribute("contenteditable",String(!!n));super.enable(n)}createBlock(n,e){let t,r={};if(n[Qe.tableCellInner])t=Qe.tableCellInner;else for(let[l,a]of Object.entries(n))this.query(l,Tw.Scope.BLOCK&Tw.Scope.BLOT)!=null?t=l:r[l]=a;t===Qe.tableCellInner&&(r={...n},delete r[t]);let i=this.create(t||this.statics.defaultChild.blotName,t?n[t]:void 0);this.insertBefore(i,e||void 0);let o=i.length();i instanceof cf&&o===0&&(o+=1);for(let[l,a]of Object.entries(r))i.formatAt(0,o,l,a);return i}},pB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\r
341
341
  <!-- Icon from Tabler Icons by Paweł Kuna - https://github.com/tabler/tabler-icons/blob/master/LICENSE -->\r
342
342
  <path\r
343
343
  fill="none"\r
@@ -348,10 +348,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
348
348
  d="M7 3v18m3-15L7 3L4 6m16 12l-3 3l-3-3m3 3V3"\r
349
349
  />\r
350
350
  </svg>\r
351
- `;const pB=Xe.import("parchment"),vB=Xe.import("blots/inline"),bB=Xe.import("blots/text");var t1,Q0=(t1=class extends lm{static create(n){let{tableId:e}=n,t=super.create();return t.dataset.tableId=e,n.side==="bottom"&&(t.style.captionSide="bottom"),t}static formats(n){let{tableId:e}=n.dataset;return{tableId:String(e),side:n.style.captionSide==="bottom"?"bottom":"top"}}constructor(n,e,t){super(n,e),e.setAttribute("contenteditable",String(n.isEnabled())),this.attachUI(this.createUI()),this.domNode.addEventListener("mouseenter",()=>{this.scroll.isEnabled()&&(this.uiNode.style.display="flex")}),this.domNode.addEventListener("mouseleave",()=>{this.scroll.isEnabled()&&(this.uiNode.style.display="none")}),this.uiNode.style.display="none"}createUI(){let n=document.createElement("i");return n.classList.add("ql-table-caption--switch"),n.innerHTML=gB,n.addEventListener("click",()=>{this.scroll.isEnabled()&&(this.side=this.side==="top"?"bottom":"top")}),n}get tableId(){return this.domNode.dataset.tableId}set side(n){this.domNode.style.captionSide=n==="bottom"?"bottom":"top"}get side(){return this.domNode.style.captionSide==="bottom"?"bottom":"top"}format(n,e){(!this.scroll.query(n,pB.Scope.BLOCK_BLOT)||n===this.statics.blotName)&&super.format(n,e)}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===this.tableId}optimize(n){let e=this.parent;if(e!==null&&e.statics.blotName!==Qe.tableMain){let{tableId:t}=this;this.wrap(Qe.tableMain,{tableId:t})}this.children.length===0?this.remove():(super.optimize(n),this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove()))}},Ee(t1,"blotName",Qe.tableCaption),Ee(t1,"tagName","caption"),Ee(t1,"className","ql-table-caption"),Ee(t1,"allowedChildren",[vB,bB]),t1),Xd,Nf=(Xd=class extends dg{static isAllowStyle(n){let e=k1(n);for(let t of this.allowStyle)if(e.startsWith(k1(t)))return!0;return!1}static create(n){let{tableId:e,rowId:t,colId:r,rowspan:i,colspan:o,style:l,emptyRow:a,tag:h="td"}=n,g=document.createElement(h);g.classList.add(...vF(this.className)),g.dataset.tableId=e,g.dataset.rowId=t,g.dataset.colId=r,g.setAttribute("rowspan",String(ig(i))),g.setAttribute("colspan",String(ig(o))),l&&(g.style.cssText=l);try{a&&(g.dataset.emptyRow=JSON.stringify(a))}catch{}return g}static formats(n){let{tableId:e,rowId:t,colId:r,emptyRow:i}=n.dataset,o=Number(n.getAttribute("rowspan")),l=Number(n.getAttribute("colspan")),a={tableId:e,rowId:t,colId:r,rowspan:ig(o),colspan:ig(l),tag:n.tagName.toLowerCase()},h={};for(let m=0;m<n.style.length;m++){let x=n.style[m],w=n.style[x];this.isAllowStyle(String(x))&&!["initial","inherit"].includes(w)&&(h[x]=w)}let g=Object.entries(h);g.length>0&&(a.style=g.map(([m,x])=>`${m}: ${x}`).join(";"));try{i&&(a.emptyRow=JSON.parse(i))}catch{}return a}isChildHeadTableCellInner(){let n=this.children.head;return n&&n.statics.blotName===Qe.tableCellInner}setFormatValue(n,e){if(this.statics.allowAttrs.has(n)||this.statics.allowDataAttrs.has(n)){let r=n;this.statics.allowDataAttrs.has(n)&&(r=`data-${n}`),e?this.domNode.setAttribute(r,e):this.domNode.removeAttribute(r)}else this.statics.isAllowStyle(n)&&(Object.assign(this.domNode.style,{[n]:e}),n.startsWith("border")&&this.setStyleBoder(n,e));let t=this.children.head;this.isChildHeadTableCellInner()&&this.domNode.style.cssText&&this.domNode.style.cssText!==t.domNode.dataset.style&&(t.domNode.dataset.style=this.domNode.style.cssText)}setStyleBoder(n,e){let t=e||null;if(!(!["left","right","top","bottom"].some(l=>n.includes(l))&&n.startsWith("border-")))return;let i=this.getNearByCell("left").map(l=>l.descendant(cf,0)[0]).filter(Boolean);for(let l of i)l.setFormatValue(n.replace("border-","border-right-"),t,!0);let o=this.getNearByCell("top").map(l=>l.descendant(cf,0)[0]).filter(Boolean);for(let l of o)l.setFormatValue(n.replace("border-","border-bottom-"),t,!0)}getNearByCell(n){let e=[];try{let t=Kl(this,Qe.tableMain);e.push(...t.getColIds())}catch(t){console.error(`Cell is not in table! ${t}`)}if(e.length===0)return[];if(n==="left"){let t=new Set,r=this.parent;for(let i=0;i<this.rowspan&&r instanceof qh;i++){let o=r.children.iterator(),l=null;for(;l=o();){let a=e.indexOf(l.colId)+l.colspan;this.colId===e[a]&&t.add(l)}r=r.next}return Array.from(t)}else if(n==="top"){if(!(this.parent instanceof qh)||!this.parent.prev)return[];let t=new Set,r=this.getColumnIndex(),i=r+this.colspan,o=new Set(e.filter((h,g)=>g>=r&&g<i)),l=1,a=this.parent.prev;for(;a;){let h=!1,g=a.children.iterator(),m=null,x=0;for(;m=g();)o.has(m.colId)&&m.rowspan>=l&&(t.add(m),o.delete(m.colId)),x+=m.colspan,m.rowspan>=l&&(h=!0);if(!h&&x===e.length)break;a=a.prev,l+=1}return Array.from(t)}return[]}get tableId(){return this.domNode.dataset.tableId}get rowId(){return this.domNode.dataset.rowId}get colId(){return this.domNode.dataset.colId}get rowspan(){return Number(this.domNode.getAttribute("rowspan"))}get colspan(){return Number(this.domNode.getAttribute("colspan"))}get emptyRow(){try{return JSON.parse(this.domNode.dataset.emptyRow)}catch{return[]}}getColumnIndex(){return Kl(this,Qe.tableMain).getColIds().indexOf(this.colId)}getCellInner(){return this.children.head}convertTableCell(){let n=this.statics.formats(this.domNode),e=n.tag==="td"?"th":"td",t=this.children.head;this.isChildHeadTableCellInner()&&t.domNode.dataset.tag!==e&&(t.domNode.dataset.tag=e),this.replaceWith(Qe.tableCell,{...n,tag:e})}checkMerge(){let{colId:n,rowId:e,colspan:t,rowspan:r}=this,i=this.next;return i!==null&&i.statics.blotName===this.statics.blotName&&i.rowId===e&&i.colId===n&&i.colspan===t&&i.rowspan===r}optimize(n){let e=this.parent,{tableId:t,rowId:r}=this;if(e!==null&&e.statics.blotName!==Qe.tableRow&&this.wrap(Qe.tableRow,{tableId:t,rowId:r}),this.emptyRow.length>0)for(let i of this.emptyRow)this.parent.parent.insertBefore(this.scroll.create(Qe.tableRow,{tableId:this.tableId,rowId:i}),this.parent.next);super.optimize(n)}},Ee(Xd,"blotName",Qe.tableCell),Ee(Xd,"tagName","td"),Ee(Xd,"className","ql-table-cell"),Ee(Xd,"allowDataAttrs",new Set(["table-id","row-id","col-id","empty-row"])),Ee(Xd,"allowAttrs",new Set(["rowspan","colspan"])),Ee(Xd,"allowStyle",new Set(["background-color","border","height"])),Xd);const yB=Xe.import("blots/block/embed");var W0,Ig=(W0=class extends yB{static validWidth(n,e){let t=Number.parseFloat(String(n));return Number.isNaN(t)&&(t=Ss[e?"colMinWidthPre":"colMinWidthPx"]),`${t}${e?"%":"px"}`}static create(n){let{width:e,tableId:t,colId:r,full:i,align:o}=n,l=super.create();return l.setAttribute("width",this.validWidth(e,!!i)),i&&(l.dataset.full=String(i)),o&&o!=="left"&&(l.dataset.align=o),l.dataset.tableId=t,l.dataset.colId=r,l}static value(n){let{tableId:e,colId:t}=n.dataset,r=n.getAttribute("width")||String(Ss.colDefaultWidth),i=n.dataset.align,o=Object.hasOwn(n.dataset,"full"),l={tableId:String(e),colId:String(t),full:o,width:Number.parseFloat(r)};return i&&(l.align=i),l}get width(){let n=this.domNode.getAttribute("width");if(!n){if(n=this.domNode.getBoundingClientRect().width,this.full){let e=this.domNode.closest("table");return e?n/100*e.getBoundingClientRect().width:Ss[this.full?"colMinWidthPre":"colMinWidthPx"]}return n}return Number.parseFloat(String(n))}set width(n){let e=Number.parseFloat(String(n));Number.isNaN(e)&&(e=Ss[this.full?"colMinWidthPre":"colMinWidthPx"]),this.domNode.setAttribute("width",this.statics.validWidth(e,!!this.full))}get tableId(){return this.domNode.dataset.tableId}get colId(){return this.domNode.dataset.colId}get full(){return Object.hasOwn(this.domNode.dataset,"full")}set full(n){n?this.domNode.dataset.full="true":this.domNode.removeAttribute("data-full")}get align(){return this.domNode.dataset.align||""}set align(n){n==="right"||n==="center"?this.domNode.dataset.align=n:this.domNode.removeAttribute("data-align")}checkMerge(){let n=this.next,{tableId:e,colId:t}=this;return n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===e&&n.colId===t}optimize(n){let e=this.parent;if(e!=null&&e.statics.blotName!==Qe.tableColgroup){let r=this.statics.value(this.domNode);this.wrap(Qe.tableColgroup,r)}let t=Kl(this,Qe.tableColgroup);t.align=this.align,this.next!=null&&this.checkMerge()&&this.next.remove(),super.optimize(n);try{let r=Kl(this,Qe.tableColgroup),i=!0;r.children.forEach(o=>{i&&(i=o.full)}),r.full=i}catch{}}insertAt(n,e,t){if(t!=null){super.insertAt(n,e,t);return}try{let r=e.split(`
352
- `),i=r.pop(),o=Kl(this,Qe.tableColgroup),l=o.next,a=this.scroll,h=o.split(this.offset(o));if(l){let g=l.descendants(cf);if(g.length>0){let m=g[0],x=cf.formats(m.domNode),w=this.scroll.create(Qe.tableCellInner,x),_=w.wrap(Qe.tableCell,x),S=_.wrap(Qe.tableRow,x),R=S.wrap(Qe.tableBody,x.tableId);o.parent.insertBefore(R,h),a=w}}for(let g of r){let m=this.scroll.create("block");m.insertAt(0,g),a.appendChild(m)}if(i){let g=this.scroll.create("block");g.appendChild(this.scroll.create("text",i)),a.appendChild(g)}}catch{console.warn("TableCol not in TableColgroup")}}},Ee(W0,"blotName",Qe.tableCol),Ee(W0,"tagName","col"),W0),fp,Ff=(fp=class extends dg{static create(n){let e=super.create(),{tableId:t,full:r,align:i}=n;return e.dataset.tableId=t,i==="right"||i==="center"?e.dataset.align=i:e.removeAttribute("date-align"),r&&(e.dataset.full=String(r)),e.setAttribute("cellpadding","0"),e.setAttribute("cellspacing","0"),e}constructor(n,e,t){super(n,e),this.scroll=n,this.updateAlign()}colWidthFillTable(){if(this.full){Object.assign(this.domNode.style,{width:null});return}let n=this.getCols();if(!n)return;let e=n.reduce((t,r)=>r.width+t,0);if(!(e===0||Number.isNaN(e)))return this.domNode.style.width=`${e}px`,e}get tableId(){return this.domNode.dataset.tableId}get full(){return Object.hasOwn(this.domNode.dataset,"full")}set full(n){n?this.domNode.dataset.full="true":this.domNode.removeAttribute("data-full"),this.colWidthFillTable()}get align(){return this.domNode.dataset.align||""}set align(n){n==="right"||n==="center"?this.domNode.dataset.align=n:this.domNode.removeAttribute("data-align"),this.updateAlign()}setFull(){if(this.full)return;let n=this.getCols();if(n.length===0)return;let e=Math.floor(this.domNode.getBoundingClientRect().width);for(let t of n){let r=t.width/e*100;t.full=!0,t.width=r}}cancelFull(){if(!this.full)return;let n=this.getCols();if(n.length===0)return;let e=Math.floor(this.domNode.getBoundingClientRect().width);for(let t of n)t.full=!1,t.width=Math.max(t.width/100*e,Ss.colMinWidthPx)}updateAlign(){let n=this.align,e={marginLeft:null,marginRight:null};switch(n){case"center":e.marginLeft="auto",e.marginRight="auto";break;case"":case"left":e.marginRight="auto";break;case"right":e.marginLeft="auto";break}Object.assign(this.domNode.style,e)}getRows(){return Array.from(this.domNode.querySelectorAll(`${qh.tagName}`)).map(n=>this.scroll.find(n)).filter(Boolean)}getRowIds(){return this.getRows().map(n=>n.rowId)}getCols(){return this.descendants(Ig)}getColIds(){return this.getCols().map(n=>n.colId)}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.domNode.dataset.tableId===this.tableId}optimize(n){let e=this.parent;e!==null&&e.statics.blotName!==Qe.tableWrapper&&this.wrap(Qe.tableWrapper,this.tableId),super.optimize(n),this.mergeRow()}mergeRow(){if(!this.parent)return;let n=this.getRows(),e={};for(let t of n)e[t.rowId]||(e[t.rowId]=[]),e[t.rowId].push(t);for(let t of Object.values(e))for(let r=1;r<t.length;r++){let i=t[r];i.moveChildren(t[0]),i.remove()}}checkEmptyCol(n){if(n){let e=this.getRows().length,t=this.getCols(),r=this.descendants(cf);for(let i of r)if(i.colspan>1&&i.rowspan>=e){let o=t.findIndex(a=>a.colId===i.colId),l=t[o];for(let a=o+1;a<o+i.colspan;a++)t[a].remove(),l.width+=t[a].width;i.colspan=1}}}checkEmptyRow(n){let e=this.getRows(),t=new Set(e.map(r=>r.rowId));for(let r=e.length-1;r>=0;r--){let i=e[r];if(n){if(i.children.length===0){for(let o=1,l=r-1;l>=0;l--,o++)e[l].foreachCellInner(h=>{if(h.rowspan>o){--h.rowspan;let g=new Set(h.emptyRow);g.delete(i.rowId),h.emptyRow=Array.from(g)}});i.remove()}}else{if(i.children.length===0&&i.prev){let o=i.prev;for(;o&&o.children.length===0;)o=o.prev;o.foreachCellInner(l=>{let a=new Set(l.emptyRow);a.has(i.rowId)||(l.emptyRow=[i.rowId,...a])})}i.foreachCellInner(o=>{for(let l of o.emptyRow)t.has(l)||i.parent.insertBefore(this.scroll.create(Qe.tableRow,{tableId:this.tableId,rowId:l}),i.next)})}}}sortMergeChildren(){let n={[Qe.tableCaption]:[],[Qe.tableColgroup]:[],[Qe.tableBody]:[]};this.children.forEach(h=>{n[h.statics.blotName]&&n[h.statics.blotName].push(h)});for(let h of Object.values(n))for(let g=1;g<h.length;g++)h[g].moveChildren(h[0]);let e=n[Qe.tableCaption][0],t=n[Qe.tableColgroup][0],r=n[Qe.tableBody][0],i=e&&this.children.head!==e,o=t&&e&&e.next!==t,l=t&&!e&&this.children.head!==t,a=r&&this.children.tail!==r;if(i||o||l||a){let h=this.clone();e&&h.appendChild(e),t&&h.appendChild(t),r&&h.appendChild(r),this.children.forEach(g=>g.remove()),h.moveChildren(this)}}},Ee(fp,"blotName",Qe.tableMain),Ee(fp,"tagName","table"),Ee(fp,"className","ql-table"),fp),U0,Ag=(U0=class extends dg{static create(n){let e=super.create();return e.dataset.tableId=n.tableId,n.full&&(e.dataset.full=String(n.full)),n.align&&n.align!=="left"&&(e.dataset.align=n.align),e.setAttribute("contenteditable","false"),e}get tableId(){return this.domNode.dataset.tableId}get full(){return Object.hasOwn(this.domNode.dataset,"full")}set full(n){n?this.domNode.dataset.full="true":this.domNode.removeAttribute("data-full"),this.parent&&this.parent instanceof Ff&&(this.parent.full=n)}get align(){return this.domNode.dataset.align||""}set align(n){n==="right"||n==="center"?this.domNode.dataset.align=n:this.domNode.removeAttribute("data-align")}findCol(n){let e=this.children.iterator(),t=0,r;for(;(r=e())&&t!==n;)t++;return r}insertColByIndex(n,e){let t=this.parent;if(!(t instanceof Ff))throw TypeError("TableColgroupFormat should be child of TableFormat");let r=this.findCol(n),i=this.scroll.create(Qe.tableCol,e);if(t.full){let o=this.children.iterator(),l;for(;l=o();)if(l.width-i.width>=Ss.colMinWidthPre){l.width-=i.width;break}}this.insertBefore(i,r)}removeColByIndex(n){let e=this.parent;if(!(e instanceof Ff))throw TypeError("TableColgroupFormat should be child of TableMainFormat");let t=this.findCol(n);t&&(e.full&&(t.next?t.next.width+=t.width:t.prev&&(t.prev.width+=t.width)),t.remove(),e.colWidthFillTable())}checkMerge(){let n=this.next,e=this.parent;return e instanceof Ff&&!e.full&&e.colWidthFillTable(),n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===this.tableId}optimize(n){let e=this.parent,{tableId:t,full:r,align:i}=this;e!=null&&e.statics.blotName!==Qe.tableMain&&this.wrap(Qe.tableMain,{tableId:t,full:r,align:i});let o=Kl(this,Qe.tableMain);o.align=i,super.optimize(n)}},Ee(U0,"blotName",Qe.tableColgroup),Ee(U0,"tagName","colgroup"),U0);const mB=Xe.import("parchment");var hp,$g=(hp=class extends dg{constructor(e,t,r){super(e,t);Ee(this,"insertLineAround",()=>{(!this.prev||!this.isBlockLine(this.prev))&&this.parent.insertBefore(this.scroll.create("block"),this),(!this.next||!this.isBlockLine(this.next))&&this.parent.insertBefore(this.scroll.create("block"),this.next)});this.scroll=e,this.scroll.emitter.on(Xe.events.TEXT_CHANGE,this.insertLineAround)}static create(e){let t=super.create();return t.dataset.tableId=e,t.addEventListener("dragstart",r=>{r.preventDefault(),r.stopPropagation()},!0),t.addEventListener("drop",r=>{r.preventDefault()}),t.addEventListener("dragover",r=>{r.preventDefault(),r.dataTransfer.dropEffect="none"}),t.setAttribute("contenteditable","false"),t}get tableId(){return this.domNode.dataset.tableId}checkMerge(){let e=this.next;return e!==null&&e.statics.blotName===this.statics.blotName&&e.tableId===this.tableId}deleteAt(e,t){super.deleteAt(e,t);let r=this.descendants(eg),i=this.descendants(Ag);(r.length===0||i.length===0)&&this.remove()}remove(){super.remove(),this.scroll.emitter.off(Xe.events.TEXT_CHANGE,this.insertLineAround)}isBlockLine(e){return e instanceof mB.BlockBlot||new Set(["list-container","code-block-container"]).has(e.statics.blotName)}},Ee(hp,"blotName",Qe.tableWrapper),Ee(hp,"tagName","div"),Ee(hp,"className","ql-table-wrapper"),hp);function qm(n){let[e]=uF(n,eg);return e?{body:e,rect:e.domNode.getBoundingClientRect()}:{body:null,rect:null}}const cp=Xe.import("delta"),xB=Xe.import("modules/clipboard");function wB(n){let e=Number.parseFloat(n.getAttribute("width")||String(Ss.colDefaultWidth));if(Number.isNaN(e)){let t=n.style.width;e=t?Number.parseFloat(t):n.offsetWidth}return e}function CB(n,e){let t=Array(e).fill(Ss.colDefaultWidth),r=Array.from(n.querySelectorAll("tr"));for(let i of r){let o=Array.from(i.querySelectorAll("td"));for(let[l,a]of o.entries())if(l<e){let h=wB(a);t[l]=h||t[l]}else break}return t}var _B=class extends xB{constructor(e,t){super(e,t);Ee(this,"tableId",Fa());Ee(this,"rowId",Fa());Ee(this,"colIds",[]);Ee(this,"rowspanCount",[]);Ee(this,"cellCount",0);Ee(this,"colCount",0);this.quill=e,this.addMatcher("table",this.matchTable.bind(this)),this.addMatcher("tbody",this.matchTbody.bind(this)),this.addMatcher("colgroup",this.matchColgroup.bind(this)),this.addMatcher("col",this.matchCol.bind(this)),this.addMatcher("tr",this.matchTr.bind(this)),this.addMatcher("td",this.matchTd.bind(this)),this.addMatcher("th",this.matchTd.bind(this)),this.addMatcher("caption",this.matchCaption.bind(this)),this.addMatcher(Node.ELEMENT_NODE,this.matchTdAttributor.bind(this))}matchTable(e,t){if(t.ops.length===0)return t;let r=[],i=[],o=-1;for(let h=0;h<t.ops.length;h++){let{attributes:g,insert:m}=t.ops[h];if(!k0(m)&&g&&!g[Qe.tableCellInner]&&!g[Qe.tableCaption]){t.ops.splice(h,1),--h;continue}let{table:x,[Qe.tableCell]:w,..._}=g||{},S=k0(m)&&m[Qe.tableCol];S?i.push({insert:m}):r.push({attributes:_,insert:m}),!(_!=null&&_[Qe.tableCellInner])&&!(_!=null&&_[Qe.tableCaption])&&!S&&Lg(m)&&m.trim().length>0&&(o=h)}let l=CB(e,this.colIds.length),a=l.reduce((h,g,m)=>(i[m]?h.push(i[m]):h.push({insert:{[Qe.tableCol]:{tableId:this.tableId,colId:this.colIds[m],width:g,full:!1}}}),h),[]);return r.splice(o+1,0,...a),this.tableId=Fa(),this.colIds=[],this.rowspanCount=[],this.cellCount=0,this.colCount=0,new cp(r)}matchTbody(e,t){var o;let r=e.style.backgroundColor;if(r){for(let l of t.ops)if((o=l.attributes)!=null&&o[Qe.tableCellInner]){let{style:a,...h}=l.attributes[Qe.tableCellInner],g=pv(a||"");g.backgroundColor||(g.backgroundColor=r,l.attributes[Qe.tableCellInner]={...h,style:om(g)})}}let i=[];for(let l=t.ops.length-1;l>=0;l--){let a=t.ops[l];a.attributes&&(a.attributes[Qe.tableCellInner]?a.attributes[Qe.tableCellInner].rowspan===1?i=[]:i.length>0&&(a.attributes[Qe.tableCellInner].emptyRow||(a.attributes[Qe.tableCellInner].emptyRow=[]),a.attributes[Qe.tableCellInner].emptyRow.push(...i)):(i=[],i.push(Fa())))}return t}matchColgroup(e,t){let r=[];for(let i=0;i<t.ops.length;i++){let o=t.ops[i];o&&k0(o.insert)&&o.insert[Qe.tableCol]&&r.push(o)}return new cp(r)}matchCol(e,t){let r=Number(e.getAttribute("span")||1);Number.isNaN(r)&&(r=1);let i=new cp;for(let o=0;o<r;o++)this.colIds[this.colCount]=Fa(),i.insert({[Qe.tableCol]:Object.assign(Ig.value(e),{tableId:this.tableId,colId:this.colIds[this.colCount]})}),this.colCount+=1;return i}matchTr(e,t){this.rowId=Fa(),this.cellCount=0;for(let[r,i]of this.rowspanCount.entries())i.rowspan>0&&--i.rowspan,i.rowspan<=0&&(this.rowspanCount[r]={rowspan:0,colspan:0});for(let r of t.ops)if(r.attributes){let{background:i,[Qe.tableCellInner]:o}=r.attributes;if(o&&i){let{style:l=""}=o,a=pv(l);a.backgroundColor=i,r.attributes[Qe.tableCellInner].style=om(a)}}return t}matchTd(e,t){let r=e,i=Nf.formats(r);if(!this.colIds[this.cellCount]||!this.rowspanCount[this.cellCount])for(let h=this.cellCount;h>=0;h--)this.colIds[h]||(this.colIds[h]=Fa()),this.rowspanCount[h]||(this.rowspanCount[h]={rowspan:0,colspan:0});for(let h=this.cellCount;h<this.rowspanCount.length;h++){let{rowspan:g,colspan:m}=this.rowspanCount[h];if(g===0)break;this.cellCount+=m}i.rowspan>1&&(this.rowspanCount[this.cellCount]={rowspan:i.rowspan,colspan:i.colspan});let o=this.colIds[this.cellCount];this.cellCount+=i.colspan;let l=Object.assign(i,{tableId:this.tableId,rowId:this.rowId,colId:o});r.style.border==="none"&&(l.style=l.style.replaceAll(/border-(top|right|bottom|left)-style:none;?/g,""));let a=[];for(let h of t.ops){let{attributes:g={},...m}=h,{[Qe.tableCell]:x,...w}=g;a.push({...m,attributes:{...w,[Qe.tableCellInner]:l}})}return(a.length<=0||!Lg(a[a.length-1].insert)||!a[a.length-1].insert.endsWith(`
351
+ `;const vB=Xe.import("parchment"),bB=Xe.import("blots/inline"),yB=Xe.import("blots/text");var t1,Q0=(t1=class extends lm{static create(n){let{tableId:e}=n,t=super.create();return t.dataset.tableId=e,n.side==="bottom"&&(t.style.captionSide="bottom"),t}static formats(n){let{tableId:e}=n.dataset;return{tableId:String(e),side:n.style.captionSide==="bottom"?"bottom":"top"}}constructor(n,e,t){super(n,e),e.setAttribute("contenteditable",String(n.isEnabled())),this.attachUI(this.createUI()),this.domNode.addEventListener("mouseenter",()=>{this.scroll.isEnabled()&&(this.uiNode.style.display="flex")}),this.domNode.addEventListener("mouseleave",()=>{this.scroll.isEnabled()&&(this.uiNode.style.display="none")}),this.uiNode.style.display="none"}createUI(){let n=document.createElement("i");return n.classList.add("ql-table-caption--switch"),n.innerHTML=pB,n.addEventListener("click",()=>{this.scroll.isEnabled()&&(this.side=this.side==="top"?"bottom":"top")}),n}get tableId(){return this.domNode.dataset.tableId}set side(n){this.domNode.style.captionSide=n==="bottom"?"bottom":"top"}get side(){return this.domNode.style.captionSide==="bottom"?"bottom":"top"}format(n,e){(!this.scroll.query(n,vB.Scope.BLOCK_BLOT)||n===this.statics.blotName)&&super.format(n,e)}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===this.tableId}optimize(n){let e=this.parent;if(e!==null&&e.statics.blotName!==Qe.tableMain){let{tableId:t}=this;this.wrap(Qe.tableMain,{tableId:t})}this.children.length===0?this.remove():(super.optimize(n),this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove()))}},Ee(t1,"blotName",Qe.tableCaption),Ee(t1,"tagName","caption"),Ee(t1,"className","ql-table-caption"),Ee(t1,"allowedChildren",[bB,yB]),t1),Xd,Nf=(Xd=class extends dg{static isAllowStyle(n){let e=k1(n);for(let t of this.allowStyle)if(e.startsWith(k1(t)))return!0;return!1}static create(n){let{tableId:e,rowId:t,colId:r,rowspan:i,colspan:o,style:l,emptyRow:a,tag:h="td"}=n,g=document.createElement(h);g.classList.add(...bF(this.className)),g.dataset.tableId=e,g.dataset.rowId=t,g.dataset.colId=r,g.setAttribute("rowspan",String(ig(i))),g.setAttribute("colspan",String(ig(o))),l&&(g.style.cssText=l);try{a&&(g.dataset.emptyRow=JSON.stringify(a))}catch{}return g}static formats(n){let{tableId:e,rowId:t,colId:r,emptyRow:i}=n.dataset,o=Number(n.getAttribute("rowspan")),l=Number(n.getAttribute("colspan")),a={tableId:e,rowId:t,colId:r,rowspan:ig(o),colspan:ig(l),tag:n.tagName.toLowerCase()},h={};for(let m=0;m<n.style.length;m++){let x=n.style[m],w=n.style[x];this.isAllowStyle(String(x))&&!["initial","inherit"].includes(w)&&(h[x]=w)}let g=Object.entries(h);g.length>0&&(a.style=g.map(([m,x])=>`${m}: ${x}`).join(";"));try{i&&(a.emptyRow=JSON.parse(i))}catch{}return a}isChildHeadTableCellInner(){let n=this.children.head;return n&&n.statics.blotName===Qe.tableCellInner}setFormatValue(n,e){if(this.statics.allowAttrs.has(n)||this.statics.allowDataAttrs.has(n)){let r=n;this.statics.allowDataAttrs.has(n)&&(r=`data-${n}`),e?this.domNode.setAttribute(r,e):this.domNode.removeAttribute(r)}else this.statics.isAllowStyle(n)&&(Object.assign(this.domNode.style,{[n]:e}),n.startsWith("border")&&this.setStyleBoder(n,e));let t=this.children.head;this.isChildHeadTableCellInner()&&this.domNode.style.cssText&&this.domNode.style.cssText!==t.domNode.dataset.style&&(t.domNode.dataset.style=this.domNode.style.cssText)}setStyleBoder(n,e){let t=e||null;if(!(!["left","right","top","bottom"].some(l=>n.includes(l))&&n.startsWith("border-")))return;let i=this.getNearByCell("left").map(l=>l.descendant(cf,0)[0]).filter(Boolean);for(let l of i)l.setFormatValue(n.replace("border-","border-right-"),t,!0);let o=this.getNearByCell("top").map(l=>l.descendant(cf,0)[0]).filter(Boolean);for(let l of o)l.setFormatValue(n.replace("border-","border-bottom-"),t,!0)}getNearByCell(n){let e=[];try{let t=Kl(this,Qe.tableMain);e.push(...t.getColIds())}catch(t){console.error(`Cell is not in table! ${t}`)}if(e.length===0)return[];if(n==="left"){let t=new Set,r=this.parent;for(let i=0;i<this.rowspan&&r instanceof qh;i++){let o=r.children.iterator(),l=null;for(;l=o();){let a=e.indexOf(l.colId)+l.colspan;this.colId===e[a]&&t.add(l)}r=r.next}return Array.from(t)}else if(n==="top"){if(!(this.parent instanceof qh)||!this.parent.prev)return[];let t=new Set,r=this.getColumnIndex(),i=r+this.colspan,o=new Set(e.filter((h,g)=>g>=r&&g<i)),l=1,a=this.parent.prev;for(;a;){let h=!1,g=a.children.iterator(),m=null,x=0;for(;m=g();)o.has(m.colId)&&m.rowspan>=l&&(t.add(m),o.delete(m.colId)),x+=m.colspan,m.rowspan>=l&&(h=!0);if(!h&&x===e.length)break;a=a.prev,l+=1}return Array.from(t)}return[]}get tableId(){return this.domNode.dataset.tableId}get rowId(){return this.domNode.dataset.rowId}get colId(){return this.domNode.dataset.colId}get rowspan(){return Number(this.domNode.getAttribute("rowspan"))}get colspan(){return Number(this.domNode.getAttribute("colspan"))}get emptyRow(){try{return JSON.parse(this.domNode.dataset.emptyRow)}catch{return[]}}getColumnIndex(){return Kl(this,Qe.tableMain).getColIds().indexOf(this.colId)}getCellInner(){return this.children.head}convertTableCell(){let n=this.statics.formats(this.domNode),e=n.tag==="td"?"th":"td",t=this.children.head;this.isChildHeadTableCellInner()&&t.domNode.dataset.tag!==e&&(t.domNode.dataset.tag=e),this.replaceWith(Qe.tableCell,{...n,tag:e})}checkMerge(){let{colId:n,rowId:e,colspan:t,rowspan:r}=this,i=this.next;return i!==null&&i.statics.blotName===this.statics.blotName&&i.rowId===e&&i.colId===n&&i.colspan===t&&i.rowspan===r}optimize(n){let e=this.parent,{tableId:t,rowId:r}=this;if(e!==null&&e.statics.blotName!==Qe.tableRow&&this.wrap(Qe.tableRow,{tableId:t,rowId:r}),this.emptyRow.length>0)for(let i of this.emptyRow)this.parent.parent.insertBefore(this.scroll.create(Qe.tableRow,{tableId:this.tableId,rowId:i}),this.parent.next);super.optimize(n)}},Ee(Xd,"blotName",Qe.tableCell),Ee(Xd,"tagName","td"),Ee(Xd,"className","ql-table-cell"),Ee(Xd,"allowDataAttrs",new Set(["table-id","row-id","col-id","empty-row"])),Ee(Xd,"allowAttrs",new Set(["rowspan","colspan"])),Ee(Xd,"allowStyle",new Set(["background-color","border","height"])),Xd);const mB=Xe.import("blots/block/embed");var W0,Ig=(W0=class extends mB{static validWidth(n,e){let t=Number.parseFloat(String(n));return Number.isNaN(t)&&(t=Ss[e?"colMinWidthPre":"colMinWidthPx"]),`${t}${e?"%":"px"}`}static create(n){let{width:e,tableId:t,colId:r,full:i,align:o}=n,l=super.create();return l.setAttribute("width",this.validWidth(e,!!i)),i&&(l.dataset.full=String(i)),o&&o!=="left"&&(l.dataset.align=o),l.dataset.tableId=t,l.dataset.colId=r,l}static value(n){let{tableId:e,colId:t}=n.dataset,r=n.getAttribute("width")||String(Ss.colDefaultWidth),i=n.dataset.align,o=Object.hasOwn(n.dataset,"full"),l={tableId:String(e),colId:String(t),full:o,width:Number.parseFloat(r)};return i&&(l.align=i),l}get width(){let n=this.domNode.getAttribute("width");if(!n){if(n=this.domNode.getBoundingClientRect().width,this.full){let e=this.domNode.closest("table");return e?n/100*e.getBoundingClientRect().width:Ss[this.full?"colMinWidthPre":"colMinWidthPx"]}return n}return Number.parseFloat(String(n))}set width(n){let e=Number.parseFloat(String(n));Number.isNaN(e)&&(e=Ss[this.full?"colMinWidthPre":"colMinWidthPx"]),this.domNode.setAttribute("width",this.statics.validWidth(e,!!this.full))}get tableId(){return this.domNode.dataset.tableId}get colId(){return this.domNode.dataset.colId}get full(){return Object.hasOwn(this.domNode.dataset,"full")}set full(n){n?this.domNode.dataset.full="true":this.domNode.removeAttribute("data-full")}get align(){return this.domNode.dataset.align||""}set align(n){n==="right"||n==="center"?this.domNode.dataset.align=n:this.domNode.removeAttribute("data-align")}checkMerge(){let n=this.next,{tableId:e,colId:t}=this;return n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===e&&n.colId===t}optimize(n){let e=this.parent;if(e!=null&&e.statics.blotName!==Qe.tableColgroup){let r=this.statics.value(this.domNode);this.wrap(Qe.tableColgroup,r)}let t=Kl(this,Qe.tableColgroup);t.align=this.align,this.next!=null&&this.checkMerge()&&this.next.remove(),super.optimize(n);try{let r=Kl(this,Qe.tableColgroup),i=!0;r.children.forEach(o=>{i&&(i=o.full)}),r.full=i}catch{}}insertAt(n,e,t){if(t!=null){super.insertAt(n,e,t);return}try{let r=e.split(`
352
+ `),i=r.pop(),o=Kl(this,Qe.tableColgroup),l=o.next,a=this.scroll,h=o.split(this.offset(o));if(l){let g=l.descendants(cf);if(g.length>0){let m=g[0],x=cf.formats(m.domNode),w=this.scroll.create(Qe.tableCellInner,x),_=w.wrap(Qe.tableCell,x),S=_.wrap(Qe.tableRow,x),R=S.wrap(Qe.tableBody,x.tableId);o.parent.insertBefore(R,h),a=w}}for(let g of r){let m=this.scroll.create("block");m.insertAt(0,g),a.appendChild(m)}if(i){let g=this.scroll.create("block");g.appendChild(this.scroll.create("text",i)),a.appendChild(g)}}catch{console.warn("TableCol not in TableColgroup")}}},Ee(W0,"blotName",Qe.tableCol),Ee(W0,"tagName","col"),W0),fp,Ff=(fp=class extends dg{static create(n){let e=super.create(),{tableId:t,full:r,align:i}=n;return e.dataset.tableId=t,i==="right"||i==="center"?e.dataset.align=i:e.removeAttribute("date-align"),r&&(e.dataset.full=String(r)),e.setAttribute("cellpadding","0"),e.setAttribute("cellspacing","0"),e}constructor(n,e,t){super(n,e),this.scroll=n,this.updateAlign()}colWidthFillTable(){if(this.full){Object.assign(this.domNode.style,{width:null});return}let n=this.getCols();if(!n)return;let e=n.reduce((t,r)=>r.width+t,0);if(!(e===0||Number.isNaN(e)))return this.domNode.style.width=`${e}px`,e}get tableId(){return this.domNode.dataset.tableId}get full(){return Object.hasOwn(this.domNode.dataset,"full")}set full(n){n?this.domNode.dataset.full="true":this.domNode.removeAttribute("data-full"),this.colWidthFillTable()}get align(){return this.domNode.dataset.align||""}set align(n){n==="right"||n==="center"?this.domNode.dataset.align=n:this.domNode.removeAttribute("data-align"),this.updateAlign()}setFull(){if(this.full)return;let n=this.getCols();if(n.length===0)return;let e=Math.floor(this.domNode.getBoundingClientRect().width);for(let t of n){let r=t.width/e*100;t.full=!0,t.width=r}}cancelFull(){if(!this.full)return;let n=this.getCols();if(n.length===0)return;let e=Math.floor(this.domNode.getBoundingClientRect().width);for(let t of n)t.full=!1,t.width=Math.max(t.width/100*e,Ss.colMinWidthPx)}updateAlign(){let n=this.align,e={marginLeft:null,marginRight:null};switch(n){case"center":e.marginLeft="auto",e.marginRight="auto";break;case"":case"left":e.marginRight="auto";break;case"right":e.marginLeft="auto";break}Object.assign(this.domNode.style,e)}getRows(){return Array.from(this.domNode.querySelectorAll(`${qh.tagName}`)).map(n=>this.scroll.find(n)).filter(Boolean)}getRowIds(){return this.getRows().map(n=>n.rowId)}getCols(){return this.descendants(Ig)}getColIds(){return this.getCols().map(n=>n.colId)}checkMerge(){let n=this.next;return n!==null&&n.statics.blotName===this.statics.blotName&&n.domNode.dataset.tableId===this.tableId}optimize(n){let e=this.parent;e!==null&&e.statics.blotName!==Qe.tableWrapper&&this.wrap(Qe.tableWrapper,this.tableId),super.optimize(n),this.mergeRow()}mergeRow(){if(!this.parent)return;let n=this.getRows(),e={};for(let t of n)e[t.rowId]||(e[t.rowId]=[]),e[t.rowId].push(t);for(let t of Object.values(e))for(let r=1;r<t.length;r++){let i=t[r];i.moveChildren(t[0]),i.remove()}}checkEmptyCol(n){if(n){let e=this.getRows().length,t=this.getCols(),r=this.descendants(cf);for(let i of r)if(i.colspan>1&&i.rowspan>=e){let o=t.findIndex(a=>a.colId===i.colId),l=t[o];for(let a=o+1;a<o+i.colspan;a++)t[a].remove(),l.width+=t[a].width;i.colspan=1}}}checkEmptyRow(n){let e=this.getRows(),t=new Set(e.map(r=>r.rowId));for(let r=e.length-1;r>=0;r--){let i=e[r];if(n){if(i.children.length===0){for(let o=1,l=r-1;l>=0;l--,o++)e[l].foreachCellInner(h=>{if(h.rowspan>o){--h.rowspan;let g=new Set(h.emptyRow);g.delete(i.rowId),h.emptyRow=Array.from(g)}});i.remove()}}else{if(i.children.length===0&&i.prev){let o=i.prev;for(;o&&o.children.length===0;)o=o.prev;o.foreachCellInner(l=>{let a=new Set(l.emptyRow);a.has(i.rowId)||(l.emptyRow=[i.rowId,...a])})}i.foreachCellInner(o=>{for(let l of o.emptyRow)t.has(l)||i.parent.insertBefore(this.scroll.create(Qe.tableRow,{tableId:this.tableId,rowId:l}),i.next)})}}}sortMergeChildren(){let n={[Qe.tableCaption]:[],[Qe.tableColgroup]:[],[Qe.tableBody]:[]};this.children.forEach(h=>{n[h.statics.blotName]&&n[h.statics.blotName].push(h)});for(let h of Object.values(n))for(let g=1;g<h.length;g++)h[g].moveChildren(h[0]);let e=n[Qe.tableCaption][0],t=n[Qe.tableColgroup][0],r=n[Qe.tableBody][0],i=e&&this.children.head!==e,o=t&&e&&e.next!==t,l=t&&!e&&this.children.head!==t,a=r&&this.children.tail!==r;if(i||o||l||a){let h=this.clone();e&&h.appendChild(e),t&&h.appendChild(t),r&&h.appendChild(r),this.children.forEach(g=>g.remove()),h.moveChildren(this)}}},Ee(fp,"blotName",Qe.tableMain),Ee(fp,"tagName","table"),Ee(fp,"className","ql-table"),fp),U0,Ag=(U0=class extends dg{static create(n){let e=super.create();return e.dataset.tableId=n.tableId,n.full&&(e.dataset.full=String(n.full)),n.align&&n.align!=="left"&&(e.dataset.align=n.align),e.setAttribute("contenteditable","false"),e}get tableId(){return this.domNode.dataset.tableId}get full(){return Object.hasOwn(this.domNode.dataset,"full")}set full(n){n?this.domNode.dataset.full="true":this.domNode.removeAttribute("data-full"),this.parent&&this.parent instanceof Ff&&(this.parent.full=n)}get align(){return this.domNode.dataset.align||""}set align(n){n==="right"||n==="center"?this.domNode.dataset.align=n:this.domNode.removeAttribute("data-align")}findCol(n){let e=this.children.iterator(),t=0,r;for(;(r=e())&&t!==n;)t++;return r}insertColByIndex(n,e){let t=this.parent;if(!(t instanceof Ff))throw TypeError("TableColgroupFormat should be child of TableFormat");let r=this.findCol(n),i=this.scroll.create(Qe.tableCol,e);if(t.full){let o=this.children.iterator(),l;for(;l=o();)if(l.width-i.width>=Ss.colMinWidthPre){l.width-=i.width;break}}this.insertBefore(i,r)}removeColByIndex(n){let e=this.parent;if(!(e instanceof Ff))throw TypeError("TableColgroupFormat should be child of TableMainFormat");let t=this.findCol(n);t&&(e.full&&(t.next?t.next.width+=t.width:t.prev&&(t.prev.width+=t.width)),t.remove(),e.colWidthFillTable())}checkMerge(){let n=this.next,e=this.parent;return e instanceof Ff&&!e.full&&e.colWidthFillTable(),n!==null&&n.statics.blotName===this.statics.blotName&&n.tableId===this.tableId}optimize(n){let e=this.parent,{tableId:t,full:r,align:i}=this;e!=null&&e.statics.blotName!==Qe.tableMain&&this.wrap(Qe.tableMain,{tableId:t,full:r,align:i});let o=Kl(this,Qe.tableMain);o.align=i,super.optimize(n)}},Ee(U0,"blotName",Qe.tableColgroup),Ee(U0,"tagName","colgroup"),U0);const xB=Xe.import("parchment");var hp,$g=(hp=class extends dg{constructor(e,t,r){super(e,t);Ee(this,"insertLineAround",()=>{(!this.prev||!this.isBlockLine(this.prev))&&this.parent.insertBefore(this.scroll.create("block"),this),(!this.next||!this.isBlockLine(this.next))&&this.parent.insertBefore(this.scroll.create("block"),this.next)});this.scroll=e,this.scroll.emitter.on(Xe.events.TEXT_CHANGE,this.insertLineAround)}static create(e){let t=super.create();return t.dataset.tableId=e,t.addEventListener("dragstart",r=>{r.preventDefault(),r.stopPropagation()},!0),t.addEventListener("drop",r=>{r.preventDefault()}),t.addEventListener("dragover",r=>{r.preventDefault(),r.dataTransfer.dropEffect="none"}),t.setAttribute("contenteditable","false"),t}get tableId(){return this.domNode.dataset.tableId}checkMerge(){let e=this.next;return e!==null&&e.statics.blotName===this.statics.blotName&&e.tableId===this.tableId}deleteAt(e,t){super.deleteAt(e,t);let r=this.descendants(eg),i=this.descendants(Ag);(r.length===0||i.length===0)&&this.remove()}remove(){super.remove(),this.scroll.emitter.off(Xe.events.TEXT_CHANGE,this.insertLineAround)}isBlockLine(e){return e instanceof xB.BlockBlot||new Set(["list-container","code-block-container"]).has(e.statics.blotName)}},Ee(hp,"blotName",Qe.tableWrapper),Ee(hp,"tagName","div"),Ee(hp,"className","ql-table-wrapper"),hp);function qm(n){let[e]=fF(n,eg);return e?{body:e,rect:e.domNode.getBoundingClientRect()}:{body:null,rect:null}}const cp=Xe.import("delta"),wB=Xe.import("modules/clipboard");function CB(n){let e=Number.parseFloat(n.getAttribute("width")||String(Ss.colDefaultWidth));if(Number.isNaN(e)){let t=n.style.width;e=t?Number.parseFloat(t):n.offsetWidth}return e}function _B(n,e){let t=Array(e).fill(Ss.colDefaultWidth),r=Array.from(n.querySelectorAll("tr"));for(let i of r){let o=Array.from(i.querySelectorAll("td"));for(let[l,a]of o.entries())if(l<e){let h=CB(a);t[l]=h||t[l]}else break}return t}var SB=class extends wB{constructor(e,t){super(e,t);Ee(this,"tableId",Fa());Ee(this,"rowId",Fa());Ee(this,"colIds",[]);Ee(this,"rowspanCount",[]);Ee(this,"cellCount",0);Ee(this,"colCount",0);this.quill=e,this.addMatcher("table",this.matchTable.bind(this)),this.addMatcher("tbody",this.matchTbody.bind(this)),this.addMatcher("colgroup",this.matchColgroup.bind(this)),this.addMatcher("col",this.matchCol.bind(this)),this.addMatcher("tr",this.matchTr.bind(this)),this.addMatcher("td",this.matchTd.bind(this)),this.addMatcher("th",this.matchTd.bind(this)),this.addMatcher("caption",this.matchCaption.bind(this)),this.addMatcher(Node.ELEMENT_NODE,this.matchTdAttributor.bind(this))}matchTable(e,t){if(t.ops.length===0)return t;let r=[],i=[],o=-1;for(let h=0;h<t.ops.length;h++){let{attributes:g,insert:m}=t.ops[h];if(!k0(m)&&g&&!g[Qe.tableCellInner]&&!g[Qe.tableCaption]){t.ops.splice(h,1),--h;continue}let{table:x,[Qe.tableCell]:w,..._}=g||{},S=k0(m)&&m[Qe.tableCol];S?i.push({insert:m}):r.push({attributes:_,insert:m}),!(_!=null&&_[Qe.tableCellInner])&&!(_!=null&&_[Qe.tableCaption])&&!S&&Lg(m)&&m.trim().length>0&&(o=h)}let l=_B(e,this.colIds.length),a=l.reduce((h,g,m)=>(i[m]?h.push(i[m]):h.push({insert:{[Qe.tableCol]:{tableId:this.tableId,colId:this.colIds[m],width:g,full:!1}}}),h),[]);return r.splice(o+1,0,...a),this.tableId=Fa(),this.colIds=[],this.rowspanCount=[],this.cellCount=0,this.colCount=0,new cp(r)}matchTbody(e,t){var o;let r=e.style.backgroundColor;if(r){for(let l of t.ops)if((o=l.attributes)!=null&&o[Qe.tableCellInner]){let{style:a,...h}=l.attributes[Qe.tableCellInner],g=pv(a||"");g.backgroundColor||(g.backgroundColor=r,l.attributes[Qe.tableCellInner]={...h,style:om(g)})}}let i=[];for(let l=t.ops.length-1;l>=0;l--){let a=t.ops[l];a.attributes&&(a.attributes[Qe.tableCellInner]?a.attributes[Qe.tableCellInner].rowspan===1?i=[]:i.length>0&&(a.attributes[Qe.tableCellInner].emptyRow||(a.attributes[Qe.tableCellInner].emptyRow=[]),a.attributes[Qe.tableCellInner].emptyRow.push(...i)):(i=[],i.push(Fa())))}return t}matchColgroup(e,t){let r=[];for(let i=0;i<t.ops.length;i++){let o=t.ops[i];o&&k0(o.insert)&&o.insert[Qe.tableCol]&&r.push(o)}return new cp(r)}matchCol(e,t){let r=Number(e.getAttribute("span")||1);Number.isNaN(r)&&(r=1);let i=new cp;for(let o=0;o<r;o++)this.colIds[this.colCount]=Fa(),i.insert({[Qe.tableCol]:Object.assign(Ig.value(e),{tableId:this.tableId,colId:this.colIds[this.colCount]})}),this.colCount+=1;return i}matchTr(e,t){this.rowId=Fa(),this.cellCount=0;for(let[r,i]of this.rowspanCount.entries())i.rowspan>0&&--i.rowspan,i.rowspan<=0&&(this.rowspanCount[r]={rowspan:0,colspan:0});for(let r of t.ops)if(r.attributes){let{background:i,[Qe.tableCellInner]:o}=r.attributes;if(o&&i){let{style:l=""}=o,a=pv(l);a.backgroundColor=i,r.attributes[Qe.tableCellInner].style=om(a)}}return t}matchTd(e,t){let r=e,i=Nf.formats(r);if(!this.colIds[this.cellCount]||!this.rowspanCount[this.cellCount])for(let h=this.cellCount;h>=0;h--)this.colIds[h]||(this.colIds[h]=Fa()),this.rowspanCount[h]||(this.rowspanCount[h]={rowspan:0,colspan:0});for(let h=this.cellCount;h<this.rowspanCount.length;h++){let{rowspan:g,colspan:m}=this.rowspanCount[h];if(g===0)break;this.cellCount+=m}i.rowspan>1&&(this.rowspanCount[this.cellCount]={rowspan:i.rowspan,colspan:i.colspan});let o=this.colIds[this.cellCount];this.cellCount+=i.colspan;let l=Object.assign(i,{tableId:this.tableId,rowId:this.rowId,colId:o});r.style.border==="none"&&(l.style=l.style.replaceAll(/border-(top|right|bottom|left)-style:none;?/g,""));let a=[];for(let h of t.ops){let{attributes:g={},...m}=h,{[Qe.tableCell]:x,...w}=g;a.push({...m,attributes:{...w,[Qe.tableCellInner]:l}})}return(a.length<=0||!Lg(a[a.length-1].insert)||!a[a.length-1].insert.endsWith(`
353
353
  `))&&a.push({insert:`
354
- `,attributes:{[Qe.tableCellInner]:l}}),new cp(a)}matchTdAttributor(e,t){if(e.tagName.toLocaleLowerCase()==="td"){let i=[];for(let o of t.ops){let{attributes:l,...a}=o,h=l==null?void 0:l[Qe.tableCellInner];if(l&&h&&h.style){let{background:g,...m}=l,x=document.createElement("div");x.style.background=g;let w=document.createElement("div");if(w.style.cssText=h.style,x.style.background===w.style.backgroundColor){i.push({...a,attributes:{...m}});continue}}i.push(o)}return new cp(i)}return t}convert({html:e,text:t},r={}){let i=super.convert({html:e,text:t},r);if(r[Qe.tableCellInner])for(let o of i.ops){if(k0(o.insert)&&o.insert[Qe.tableCol]){o.insert="";continue}o.attributes||(o.attributes={}),o.attributes[Qe.tableCellInner]=r[Qe.tableCellInner]}return i}matchCaption(e,t){for(let r=0;r<t.ops.length;r++){let i=t.ops[r],{attributes:o}=i;o&&o[Qe.tableCaption]&&(o[Qe.tableCaption].tableId=this.tableId,i.attributes=o)}return t}},SB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
354
+ `,attributes:{[Qe.tableCellInner]:l}}),new cp(a)}matchTdAttributor(e,t){if(e.tagName.toLocaleLowerCase()==="td"){let i=[];for(let o of t.ops){let{attributes:l,...a}=o,h=l==null?void 0:l[Qe.tableCellInner];if(l&&h&&h.style){let{background:g,...m}=l,x=document.createElement("div");x.style.background=g;let w=document.createElement("div");if(w.style.cssText=h.style,x.style.background===w.style.backgroundColor){i.push({...a,attributes:{...m}});continue}}i.push(o)}return new cp(i)}return t}convert({html:e,text:t},r={}){let i=super.convert({html:e,text:t},r);if(r[Qe.tableCellInner])for(let o of i.ops){if(k0(o.insert)&&o.insert[Qe.tableCol]){o.insert="";continue}o.attributes||(o.attributes={}),o.attributes[Qe.tableCellInner]=r[Qe.tableCellInner]}return i}matchCaption(e,t){for(let r=0;r<t.ops.length;r++){let i=t.ops[r],{attributes:o}=i;o&&o[Qe.tableCaption]&&(o[Qe.tableCaption].tableId=this.tableId,i.attributes=o)}return t}},EB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
355
355
  <!-- Icon from Tabler Icons by Paweł Kuna - https://github.com/tabler/tabler-icons/blob/master/LICENSE -->
356
356
  <path
357
357
  fill="none"
@@ -362,7 +362,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
362
362
  d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6m-10 6H3m18 0h-7m-8-3l-3 3l3 3m12-6l3 3l-3 3"
363
363
  />
364
364
  </svg>
365
- `,EB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
365
+ `,TB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
366
366
  <path
367
367
  fill="none"
368
368
  stroke="currentColor"
@@ -372,7 +372,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
372
372
  d="m4 8l4-4m6 0L4 14m0 6L20 4m0 6L10 20m10-4l-4 4"
373
373
  />
374
374
  </svg>
375
- `,TB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
375
+ `,AB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
376
376
  <path
377
377
  fill="none"
378
378
  stroke="currentColor"
@@ -382,7 +382,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
382
382
  d="m12.01 16l-.01.011M12.01 12l-.01.011M12.01 8l-.01.011M8.01 12l-.01.011M16.01 12l-.01.011M21 3.6v16.8a.6.6 0 0 1-.6.6H3.6a.6.6 0 0 1-.6-.6V3.6a.6.6 0 0 1 .6-.6h16.8a.6.6 0 0 1 .6.6"
383
383
  />
384
384
  </svg>
385
- `,AB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 256 256">
385
+ `,RB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 256 256">
386
386
  <g fill="currentColor">
387
387
  <path d="M216 40v128h-48V88H88V40Z" opacity=".2" />
388
388
  <path
@@ -390,73 +390,73 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
390
390
  />
391
391
  </g>
392
392
  </svg>
393
- `,RB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
393
+ `,IB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
394
394
  <path
395
395
  fill="currentColor"
396
396
  d="m19.05 13.733l-1-1.733l-10.122 5.846l-.997-.576a3 3 0 0 0 .667-.769A3 3 0 1 0 3.5 17.599L5.928 19L3.5 20.402a3.034 3.034 0 1 0 3.44.323l.988-.57L14.59 24l1-1.73L9.928 19zM4.034 15.26a1 1 0 1 1 .466.607a1 1 0 0 1-.466-.607M5 22a1 1 0 1 1-.865 1.5A1 1 0 0 1 5 22m12 4h4v2h-4zm-7 0h4v2h-4z"
397
397
  />
398
398
  <path fill="currentColor" d="M28 28h-4v-2h4V4H7v4H5V4a2 2 0 0 1 2-2h21a2 2 0 0 1 2 2v22a2 2 0 0 1-2 2" />
399
399
  </svg>
400
- `,IB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
400
+ `,kB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
401
401
  <path
402
402
  fill="currentColor"
403
403
  d="M4 3h14a2 2 0 0 1 2 2v7.08a6 6 0 0 0-4.32.92H12v4h1.08c-.11.68-.11 1.35 0 2H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2m0 4v4h6V7zm8 0v4h6V7zm-8 6v4h6v-4zm11.94 5.5h2v-4h2v4h2l-3 3z"
404
404
  />
405
405
  </svg>
406
- `,kB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
406
+ `,MB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
407
407
  <path
408
408
  fill="currentColor"
409
409
  d="M4 3h14a2 2 0 0 1 2 2v7.08a6 6 0 0 0-4.32.92H12v4h1.08c-.11.68-.11 1.35 0 2H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2m0 4v4h6V7zm8 0v4h6V7zm-8 6v4h6v-4zm14.44 2v2h4v2h-4v2l-3-3z"
410
410
  />
411
411
  </svg>
412
- `,MB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
412
+ `,LB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
413
413
  <path
414
414
  fill="currentColor"
415
415
  d="M4 3h14a2 2 0 0 1 2 2v7.08a6 6 0 0 0-4.32.92H12v4h1.08c-.11.68-.11 1.35 0 2H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2m0 4v4h6V7zm8 0v4h6V7zm-8 6v4h6v-4zm15.44 8v-2h-4v-2h4v-2l3 3z"
416
416
  />
417
417
  </svg>
418
- `,LB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
418
+ `,OB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
419
419
  <path
420
420
  fill="currentColor"
421
421
  d="M4 3h14a2 2 0 0 1 2 2v7.08a6 6 0 0 0-4.32.92H12v4h1.08c-.11.68-.11 1.35 0 2H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2m0 4v4h6V7zm8 0v4h6V7zm-8 6v4h6v-4zm17.94 4.5h-2v4h-2v-4h-2l3-3z"
422
422
  />
423
423
  </svg>
424
- `,OB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
424
+ `,PB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
425
425
  <path
426
426
  fill="currentColor"
427
427
  d="M5 10H3V4h8v2H5zm14 8h-6v2h8v-6h-2zM5 18v-4H3v6h8v-2zM21 4h-8v2h6v4h2zM8 13v2l3-3l-3-3v2H3v2zm8-2V9l-3 3l3 3v-2h5v-2z"
428
428
  />
429
429
  </svg>
430
- `,PB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
430
+ `,DB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
431
431
  <path
432
432
  fill="currentColor"
433
433
  d="M4 2h7a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m0 8v4h7v-4zm0 6v4h7v-4zM4 4v4h7V4zm13.59 8L15 9.41L16.41 8L19 10.59L21.59 8L23 9.41L20.41 12L23 14.59L21.59 16L19 13.41L16.41 16L15 14.59z"
434
434
  />
435
435
  </svg>
436
- `,DB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
436
+ `,NB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
437
437
  <path
438
438
  fill="currentColor"
439
439
  d="M9.41 13L12 15.59L14.59 13L16 14.41L13.41 17L16 19.59L14.59 21L12 18.41L9.41 21L8 19.59L10.59 17L8 14.41zM22 9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2zM4 9h4V6H4zm6 0h4V6h-4zm6 0h4V6h-4z"
440
440
  />
441
441
  </svg>
442
- `,NB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
442
+ `,FB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
443
443
  <path
444
444
  fill="currentColor"
445
445
  d="m15.46 15.88l1.42-1.42L19 16.59l2.12-2.13l1.42 1.42L20.41 18l2.13 2.12l-1.42 1.42L19 19.41l-2.12 2.13l-1.42-1.42L17.59 18zM4 3h14a2 2 0 0 1 2 2v7.08a6 6 0 0 0-4.32.92H12v4h1.08c-.11.68-.11 1.35 0 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 4v4h6V7zm8 0v4h6V7zm-8 6v4h6v-4z"
446
446
  />
447
447
  </svg>
448
- `,FB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
448
+ `,BB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
449
449
  <path
450
450
  fill="currentColor"
451
451
  d="M19 14h2v6H3v-6h2v4h14zM3 4v6h2V6h14v4h2V4zm8 7v2H8v2l-3-3l3-3v2zm5 0V9l3 3l-3 3v-2h-3v-2z"
452
452
  />
453
453
  </svg>
454
- `,BB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
454
+ `,zB=`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
455
455
  <!-- Icon from TDesign Icons by TDesign - https://github.com/Tencent/tdesign-icons/blob/main/LICENSE -->
456
456
  <path fill="currentColor" d="M21 10v12h-2V12H5v10H3V10zm0-8v6H3V2zm-2 2H5v2h14z" />
457
457
  </svg>
458
- `;const zB="color-selector",io={Break:{name:"break"},CopyCell:{name:"CopyCell",tip:"Copy cell",icon:AB,handle:(n,e)=>{let t=n.getTextByCell(e),r=n.getHTMLByCell(e),i=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([r],{type:"text/html"})});navigator.clipboard.write([i]),n.hideTableTools()}},CutCell:{name:"CutCell",tip:"Cut cell",icon:RB,handle:(n,e)=>{let t=n.getTextByCell(e),r=n.getHTMLByCell(e,!0),i=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([r],{type:"text/html"})});navigator.clipboard.write([i]),n.hideTableTools()}},InsertTop:{name:"InsertTop",icon:LB,tip:"Insert row above",handle:(n,e)=>{n.appendRow(e,!1),n.hideTableTools()}},InsertRight:{name:"InsertRight",icon:MB,tip:"Insert column right",handle:(n,e)=>{n.appendCol(e,!0),n.hideTableTools()}},InsertBottom:{name:"InsertBottom",icon:IB,tip:"Insert row below",handle:(n,e)=>{n.appendRow(e,!0),n.hideTableTools()}},InsertLeft:{name:"InsertLeft",icon:kB,tip:"Insert column Left",handle:(n,e)=>{n.appendCol(e,!1),n.hideTableTools()}},MergeCell:{name:"MergeCell",icon:OB,tip:"Merge Cell",handle:(n,e)=>{n.mergeCells(e),n.hideTableTools()}},SplitCell:{name:"SplitCell",icon:FB,tip:"Split Cell",handle:(n,e)=>{n.splitCell(e),n.hideTableTools()}},DeleteRow:{name:"DeleteRow",icon:DB,tip:"Delete Row",handle:(n,e)=>{n.removeRow(e),n.hideTableTools()}},DeleteColumn:{name:"DeleteColumn",icon:PB,tip:"Delete Column",handle:(n,e)=>{n.removeCol(e),n.hideTableTools()}},DeleteTable:{name:"DeleteTable",icon:NB,tip:"Delete table",handle:(n,e)=>{n.deleteTable(e)}},BackgroundColor:{name:"BackgroundColor",icon:EB,isColorChoose:!0,tip:"Set background color",key:"background-color",handle:(n,e,t)=>{n.setCellAttrs(e,"background-color",t,!0)}},BorderColor:{name:"BorderColor",icon:TB,isColorChoose:!0,tip:"Set border color",key:"border-color",handle:(n,e,t)=>{n.setCellAttrs(e,"border-color",t,!0)}},SwitchWidth:{name:"SwitchWidth",icon:SB,tip:"Switch table width",handle:n=>{if(!n.table)return;let e=Xe.find(n.table);e&&(e.full?e.cancelFull():e.setFull())}},InsertCaption:{name:"InsertCaption",icon:BB,tip:"Insert table caption",handle:n=>{if(!n.table)return;let e=Xe.find(n.table);if(!e)return;let t=n.quill.scroll.create("text","Table Caption").wrap(Qe.tableCaption,{tableId:e.tableId});e.insertBefore(t,e.children.head)}}},P0=10,e1=cu("color-map"),Lu={selectWrapper:e1.b(),used:e1.bm("used"),item:e1.be("item"),btn:e1.be("btn"),map:e1.be("content"),mapRow:e1.be("content-row")};var HB=class{constructor(n,e,t){Ee(this,"usedColors",new Set);Ee(this,"options");Ee(this,"menu",null);Ee(this,"isMenuDisplay",!1);Ee(this,"isColorPicking",!1);Ee(this,"updateUsedColor");Ee(this,"tooltipItem",[]);Ee(this,"activeTooltip",null);Ee(this,"bem",cu("menu"));Ee(this,"colorItemClass",`color-${Fa()}`);Ee(this,"colorChooseTooltipOption",{direction:"top"});Ee(this,"updateWhenTextChange",()=>{this.isMenuDisplay&&this.update()});this.tableModule=n,this.quill=e,this.options=this.resolveOptions(t);try{let r=localStorage.getItem(this.options.localstorageKey)||"[]",i=JSON.parse(r);l_(i)||(i=[]),i.slice(-1*P0).map(o=>this.usedColors.add(o))}catch{}this.updateUsedColor=S_(r=>{if(!r)return;if(this.usedColors.add(r),this.usedColors.size>P0){let o=Array.from(this.usedColors).slice(-1*P0);this.usedColors.clear(),o.map(l=>this.usedColors.add(l))}localStorage.setItem(this.options.localstorageKey,JSON.stringify(Array.from(this.usedColors)));let i=Array.from(document.querySelectorAll(`.${this.colorItemClass}.${Lu.used}`));for(let o of i){let l=document.createElement("div");l.classList.add(Lu.item),l.style.backgroundColor=String(r),Array.from(o.querySelectorAll(`.${Lu.item}[style*="background-color: ${l.style.backgroundColor}"]`)).length<=0&&o.appendChild(l);let h=Array.from(o.querySelectorAll(`.${Lu.item}`)).slice(0,-1*P0);for(let g of h)g.remove()}},1e3),this.quill.on(Xe.events.TEXT_CHANGE,this.updateWhenTextChange)}resolveOptions(n){return Object.assign({tipText:!0,tools:[io.InsertTop,io.InsertRight,io.InsertBottom,io.InsertLeft,io.Break,io.MergeCell,io.SplitCell,io.Break,io.DeleteRow,io.DeleteColumn,io.DeleteTable,io.Break,io.BackgroundColor,io.BorderColor],localstorageKey:"__table-bg-used-color",defaultColorMap:lF},n)}buildTools(){let n=document.createElement("div");n.classList.add(this.bem.b()),Object.assign(n.style,{display:"flex"});for(let e of this.options.tools){let{name:t,icon:r,handle:i,isColorChoose:o,key:l,tip:a=""}=e,h=document.createElement("span");if(h.classList.add(this.bem.be("item")),t==="break")h.classList.add(this.bem.is("break"));else{let g=document.createElement("i");if(g.classList.add("icon"),nm(r)?g.appendChild(r(this.tableModule)):g.innerHTML=r,h.appendChild(g),o&&l){let x=this.createColorChoose(h,{name:t,icon:r,handle:i,isColorChoose:o,key:l,tip:a});this.tooltipItem.push(x),h.classList.add(zB)}else nm(i)&&h.addEventListener("click",x=>{this.quill.focus(),i(this.tableModule,this.getSelectedTds(),x)},!1);let m=this.tableModule.options.texts[t]||a;this.options.tipText&&m&&a&&this.createTipText(h,m)}n.appendChild(h)}return n}createColorChoose(n,{handle:e,key:t}){let r=document.createElement("div");if(r.classList.add(Lu.selectWrapper),this.options.defaultColorMap.length>0){let _=document.createElement("div");_.classList.add(Lu.map);for(let S of this.options.defaultColorMap){let R=document.createElement("div");R.classList.add(Lu.mapRow);for(let k of S){let O=document.createElement("div");O.classList.add(Lu.item),O.style.backgroundColor=k,R.appendChild(O)}_.appendChild(R)}r.appendChild(_)}let i=document.createElement("div");i.classList.add(Lu.mapRow),Object.assign(i.style,{marginTop:"4px"});let o=document.createElement("div");o.classList.add(Lu.btn,"transparent"),o.textContent=this.tableModule.options.texts.transparent,o.addEventListener("click",()=>{e(this.tableModule,this.getSelectedTds(),"transparent")});let l=document.createElement("div");l.classList.add(Lu.btn,"clear"),l.textContent=this.tableModule.options.texts.clear,l.addEventListener("click",()=>{e(this.tableModule,this.getSelectedTds(),null)});let a=document.createElement("div");a.classList.add(Lu.btn,"custom"),a.textContent=this.tableModule.options.texts.custom;let h=bF({onChange:_=>{e(this.tableModule,this.getSelectedTds(),_),this.updateUsedColor(_)}}),{hide:g,destroy:m}=Lb(a,{direction:"right",type:"click",content:h,container:a});i.appendChild(o),i.appendChild(l),i.appendChild(a),r.appendChild(i);let x=document.createElement("div");x.classList.add(Lu.used,this.colorItemClass);for(let _ of this.usedColors){let S=document.createElement("div");S.classList.add(Lu.item),S.style.backgroundColor=_,x.appendChild(S)}r.appendChild(x),r.addEventListener("click",_=>{_.stopPropagation(),g();let S=_.target,R=S.style.backgroundColor,k=this.getSelectedTds();if(S&&R&&k.length>0){if(this.tableModule.setCellAttrs(k,t,R,!0),!S.closest(`.${Lu.item}`))return;this.updateUsedColor(R)}});let w=Lb(n,{type:"click",content:r,onOpen:()=>(this.isMenuDisplay&&this.tableModule.tableSelection&&this.tableModule.tableSelection.hideDisplay(),this.setActiveTooltip(w),!1),onClose:()=>(this.isMenuDisplay&&this.tableModule.tableSelection&&(this.tableModule.tableSelection.updateWithSelectedTds(),this.tableModule.tableSelection.showDisplay()),r.contains(h)&&g(),this.activeTooltip===w&&(this.activeTooltip=null),!1),onDestroy:()=>{m(),this.activeTooltip===w&&(this.activeTooltip=null)},...this.colorChooseTooltipOption});return w.isColorPick=!0,w}setActiveTooltip(n){this.activeTooltip&&this.activeTooltip!==n&&this.activeTooltip.hide(!0),this.activeTooltip=n}getSelectedTds(){var n;return((n=this.tableModule.tableSelection)==null?void 0:n.selectedTds)||[]}createTipText(n,e){let t=Lb(n,{msg:e});t&&this.tooltipItem.push(t)}show(){!this.menu||!this.tableModule.tableSelection||!this.tableModule.tableSelection.boundary||(Object.assign(this.menu.style,{display:"flex"}),this.isMenuDisplay=!0,this.update())}update(){}hide(){this.menu&&Object.assign(this.menu.style,{display:"none"});for(let n of this.tooltipItem)n.hide(!0);this.isMenuDisplay=!1}destroy(){this.quill.off(Xe.events.TEXT_CHANGE,this.updateWhenTextChange),this.activeTooltip=null;for(let n of this.tooltipItem)n.destroy();this.menu&&(this.hide(),this.menu.remove(),this.menu=null)}},WB=class extends HB{constructor(n,e,t){super(n,e,t),this.tableModule=n,this.quill=e,this.menu=this.buildTools(),this.tableModule.addContainer(this.menu),this.show(),this.update()}update(){!this.isMenuDisplay||!this.menu||!this.tableModule.tableSelection||!this.tableModule.tableSelection.isDisplaySelection||(super.update(),__(this.tableModule.tableSelection.cellSelect,this.menu,{placement:"bottom",middleware:[w_(),x_({limiter:C_()}),m_(20)]}).then(({x:n,y:e})=>{Object.assign(this.menu.style,{left:`${n}px`,top:`${e}px`})}))}};const Np=n=>!n.full&&n.align==="right";var UB=class{constructor(n,e){Ee(this,"colIndex",-1);Ee(this,"tableMain");Ee(this,"dragging",!1);Ee(this,"dragColBreak",null);Ee(this,"handleColMouseUpFunc",this.handleColMouseUp.bind(this));Ee(this,"handleColMouseMoveFunc",this.handleColMouseMove.bind(this));Ee(this,"handleColMouseDownFunc",this.handleColMouseDown.bind(this));Ee(this,"rowIndex",-1);Ee(this,"dragRowBreak",null);Ee(this,"handleRowMouseUpFunc",this.handleRowMouseUp.bind(this));Ee(this,"handleRowMouseMoveFunc",this.handleRowMouseMove.bind(this));Ee(this,"handleRowMouseDownFunc",this.handleRowMouseDown.bind(this));Ee(this,"dragBEM",cu("drag-line"));this.tableModule=n,this.quill=e}findCurrentColIndex(n){return-1}colWidthChange(n,e,t){}async createConfirmDialog({message:n,confirm:e,cancel:t}){return new Promise(r=>{let i=document.createElement("div");Object.assign(i.style,{padding:"8px 12px",fontSize:"14px",lineHeight:"1.5"});let o=document.createElement("p");o.textContent=n;let l=document.createElement("div");Object.assign(l.style,{display:"flex",justifyContent:"flex-end",gap:"6px"});let a=cv({content:t}),h=cv({type:"confirm",content:e});l.appendChild(a),l.appendChild(h),i.appendChild(o),i.appendChild(l);let{close:g}=s_({child:i});a.addEventListener("click",()=>{r(!1),g()}),h.addEventListener("click",()=>{r(!0),g()})})}async handleColMouseUp(){if(!this.dragColBreak||!this.tableMain||this.colIndex===-1)return;let n=this.tableMain.getCols(),e=Number.parseInt(this.dragColBreak.dataset.w||"0"),t=this.tableMain.full,r=!1,i=[];if(t){let o=this.tableMain.domNode.getBoundingClientRect().width,l=e/o*100,a=n[this.colIndex].width;if(l<a){if(l=Math.max(Ss.colMinWidthPre,l),n[this.colIndex+1]||n[this.colIndex-1]){let h=n[this.colIndex+1]?this.colIndex+1:this.colIndex-1;i.push({index:h,width:n[h].width+a-l})}else l=100;r=!0,i.push({index:this.colIndex,width:l})}else if(n[this.colIndex+1]){let h=a+n[this.colIndex+1].width;l=Math.min(h-Ss.colMinWidthPre,l),r=!0,i.push({index:this.colIndex,width:l},{index:this.colIndex+1,width:h-l})}}else this.tableMain.domNode.style.width=`${Number.parseFloat(this.tableMain.domNode.style.width)-n[this.colIndex].domNode.getBoundingClientRect().width+e}px`,r=!0,i.push({index:this.colIndex,width:e});if(document.body.removeChild(this.dragColBreak),this.dragColBreak=null,document.removeEventListener("mouseup",this.handleColMouseUpFunc),document.removeEventListener("mousemove",this.handleColMouseMoveFunc),this.dragging=!1,r){let o=this.tableMain.domNode.getBoundingClientRect().width;if(t){let l=0,a=new Set(i.map(({index:h,width:g})=>(l+=g,h)));for(let[h,g]of n.entries())a.has(h)||(l+=g.width);if(l>100){if(!await this.createConfirmDialog({message:this.tableModule.options.texts.perWidthInsufficient,confirm:this.tableModule.options.texts.confirmText,cancel:this.tableModule.options.texts.cancelText}))return;this.tableMain.cancelFull(),t=!1;for(let[h,g]of i.entries()){let{width:m,index:x}=g;i[h]={index:x,width:m/100*o}}}}for(let{index:l,width:a}of i)n[l].width=`${Math.round(a)}${t?"%":"px"}`,this.colWidthChange(l,{px:Math.round(a/100*o),pre:Math.round(a)},t)}this.quill.emitter.emit(av.AFTER_TABLE_RESIZE)}getColumnRect(n){if(!this.tableMain)return null;let e=this.tableMain.getCols();if(n>=e.length)return null;let t=e[0].domNode.getBoundingClientRect().left;for(let o=0;o<n;o++){let l=e[o].domNode.getBoundingClientRect();t+=l.width}let r=e[n],i=r.domNode.getBoundingClientRect().width;return{left:t,right:t+i,width:i}}handleColMouseMove(n){if(n.preventDefault(),!this.dragColBreak||!this.tableMain||this.colIndex===-1)return;let e=this.tableMain.getCols(),t=this.getColumnRect(this.colIndex),r=this.tableMain.domNode.getBoundingClientRect(),i=n.clientX;if(this.tableMain.full){let l=Ss.colMinWidthPre/100*r.width,a=r.right;i>t.right&&e[this.colIndex+1]&&(a=Math.max(this.getColumnRect(this.colIndex+1).right-l,t.left+l));let h=t.left+l;i=Math.min(Math.max(i,h),a)}else Np(this.tableMain)?t.right-i<Ss.colMinWidthPx&&(i=t.right-Ss.colMinWidthPx):i-t.left<Ss.colMinWidthPx&&(i=t.left+Ss.colMinWidthPx);let o=i-t.left;return Np(this.tableMain)&&(o=t.right-i),this.dragColBreak.style.left=`${i}px`,this.dragColBreak.dataset.w=String(o),{left:i,width:o}}handleColMouseDown(n){if(n.button!==0||(n.preventDefault(),!this.tableMain))return;let{rect:e,body:t}=qm(this.tableMain);if(!t||!e)return;let r=this.tableMain.getCols();if(this.colIndex=this.findCurrentColIndex(n),this.colIndex===-1)return;let i=r[this.colIndex].width,o=this.tableMain.full?i/100*e.width:i;document.addEventListener("mouseup",this.handleColMouseUpFunc),document.addEventListener("mousemove",this.handleColMouseMoveFunc),this.dragging=!0;let l=document.createElement("div");l.classList.add(this.dragBEM.b(),this.dragBEM.is("col")),l.dataset.w=String(o);let a={top:e.y,left:n.clientX,height:e.height};Object.assign(l.style,{top:`${a.top}px`,left:`${a.left}px`,height:`${a.height}px`});let h=document.body;return h.appendChild(l),this.dragColBreak&&h.removeChild(this.dragColBreak),this.dragColBreak=l,a}findCurrentRowIndex(n){return-1}rowHeightChange(n,e){}handleRowMouseUp(){if(!this.tableMain||!this.dragRowBreak||this.rowIndex===-1)return;let n=Number.parseInt(this.dragRowBreak.dataset.h||"0");this.tableMain.getRows()[this.rowIndex].setHeight(`${n}px`),this.rowHeightChange(this.rowIndex,n),document.body.removeChild(this.dragRowBreak),this.dragRowBreak=null,document.removeEventListener("mouseup",this.handleRowMouseUpFunc),document.removeEventListener("mousemove",this.handleRowMouseMoveFunc),this.dragging=!1,this.quill.emitter.emit(av.AFTER_TABLE_RESIZE)}handleRowMouseMove(n){if(!this.tableMain||!this.dragRowBreak||this.rowIndex===-1)return;n.preventDefault();let e=this.tableMain.getRows(),t=e[this.rowIndex].domNode.getBoundingClientRect(),r=n.clientY;return r-t.y<Ss.rowMinHeightPx&&(r=t.y+Ss.rowMinHeightPx),this.dragRowBreak.style.top=`${r}px`,this.dragRowBreak.dataset.h=String(r-t.y),{top:r,height:r-t.y}}handleRowMouseDown(n){if(n.button!==0||(n.preventDefault(),!this.tableMain)||(this.rowIndex=this.findCurrentRowIndex(n),this.rowIndex===-1))return;this.dragging=!0,document.addEventListener("mouseup",this.handleRowMouseUpFunc),document.addEventListener("mousemove",this.handleRowMouseMoveFunc);let e=this.tableMain.getRows(),t=e[this.rowIndex].domNode.getBoundingClientRect().height,r=this.tableMain.domNode.getBoundingClientRect(),i=document.createElement("div");i.classList.add(this.dragBEM.b(),this.dragBEM.is("row")),i.dataset.h=String(t);let o={top:n.clientY,left:r.x,width:r.width};Object.assign(i.style,{top:`${o.top}px`,left:`${o.left}px`,width:`${o.width}px`});let l=document.body;return l.appendChild(i),this.dragRowBreak&&l.removeChild(this.dragRowBreak),this.dragRowBreak=i,o}update(){}destroy(){}},GB=class extends UB{constructor(e,t,r){super(e,r);Ee(this,"colResizer");Ee(this,"rowResizer");Ee(this,"currentTableCell");Ee(this,"dragging",!1);Ee(this,"curColIndex",-1);Ee(this,"curRowIndex",-1);Ee(this,"tableCellBlot");Ee(this,"bem",cu("resize-line"));Ee(this,"mousemoveHandler",e=>{if(this.dragging||this.tableModule.tableSelection&&this.tableModule.tableSelection.dragging)return;let t=this.findTableCell(e);if(!t)return this.hide();let r=Xe.find(t);r&&this.currentTableCell!==t&&(this.show(),this.currentTableCell=t,this.tableCellBlot=r,this.tableMain=Kl(r,Qe.tableMain),this.tableMain.getCols().length>0&&this.updateColResizer(),this.updateRowResizer())});Ee(this,"hideWhenTextChange",()=>{this.hide()});Ee(this,"handleColMouseUpFunc",(async function(){await this.handleColMouseUp(),this.updateColResizer()}).bind(this));Ee(this,"handleRowMouseUpFunc",(function(){this.handleRowMouseUp(),this.updateRowResizer()}).bind(this));this.tableModule=e,this.table=t,this.colResizer=this.tableModule.addContainer(this.bem.be("col")),this.rowResizer=this.tableModule.addContainer(this.bem.be("row")),this.table.addEventListener("mousemove",this.mousemoveHandler),this.quill.on(Xe.events.TEXT_CHANGE,this.hideWhenTextChange)}findTableCell(e){for(let t of e.composedPath()){if(t instanceof HTMLElement&&t.tagName==="TD")return t;if(t===document.body)return null}return null}findCurrentColIndex(){var e;return this.curColIndex+(((e=this.tableCellBlot)==null?void 0:e.colspan)||1)-1}updateColResizer(){if(!this.tableMain||!this.tableCellBlot)return;let e=this.tableCellBlot;this.tableModule.toolBox.removeChild(this.colResizer),this.colResizer=this.tableModule.addContainer(this.bem.be("col"));let[t]=A1(e,[Qe.tableBody]),r=t.domNode.getBoundingClientRect(),i=e.domNode.getBoundingClientRect(),o=this.quill.root.getBoundingClientRect(),l=i.right-o.x;Np(this.tableMain)&&(l=i.left-o.x),Object.assign(this.colResizer.style,{top:`${r.y-o.y}px`,left:`${l}px`,height:`${r.height}px`});let a=this.tableMain.getCols();this.curColIndex=a.findIndex(h=>h.colId===e.colId),this.colResizer.addEventListener("mousedown",this.handleColMouseDownFunc),this.colResizer.addEventListener("dragstart",h=>{h.preventDefault()})}findCurrentRowIndex(){return this.curRowIndex}updateRowResizer(){if(!this.tableMain||!this.tableCellBlot)return;let e=this.tableCellBlot;this.tableModule.toolBox.removeChild(this.rowResizer),this.rowResizer=this.tableModule.addContainer(this.bem.be("row"));let t=e.parent;if(!(t instanceof qh))return;let[r]=A1(e,[Qe.tableBody]),i=r.domNode.getBoundingClientRect(),o=e.domNode.getBoundingClientRect(),l=this.quill.root.getBoundingClientRect();Object.assign(this.rowResizer.style,{top:`${o.bottom-l.y}px`,left:`${i.x-l.x}px`,width:`${i.width}px`});let a=this.tableMain.getRows();this.curRowIndex=a.indexOf(t),this.rowResizer.addEventListener("mousedown",this.handleRowMouseDownFunc),this.rowResizer.addEventListener("dragstart",h=>{h.preventDefault()})}show(){this.rowResizer.classList.remove(this.bem.is("hidden")),this.colResizer.classList.remove(this.bem.is("hidden"))}hide(){this.currentTableCell=void 0,this.rowResizer.classList.add(this.bem.is("hidden")),this.colResizer.classList.add(this.bem.is("hidden"))}update(){this.updateColResizer(),this.updateRowResizer()}destroy(){this.colResizer.remove(),this.rowResizer.remove(),this.table.removeEventListener("mousemove",this.mousemoveHandler),this.quill.off(Xe.events.TEXT_CHANGE,this.hideWhenTextChange)}},YB=class{constructor(n,e,t,r){Ee(this,"scrollHandler",[]);Ee(this,"tableMainBlot",null);Ee(this,"tableWrapperBlot",null);Ee(this,"bem",cu("scale"));Ee(this,"startX",0);Ee(this,"startY",0);Ee(this,"offset",6);Ee(this,"options");Ee(this,"root");Ee(this,"block");Ee(this,"resizeobserver",new ResizeObserver(()=>this.update()));Ee(this,"updateWhenTextChange",()=>{this.update()});this.tableModule=n,this.table=e,this.quill=t,this.options=this.resolveOptions(r),this.tableMainBlot=Xe.find(e),this.tableMainBlot&&!this.tableMainBlot.full&&(this.tableWrapperBlot=this.tableMainBlot.parent,this.buildResizer(),this.show()),this.quill.on(Xe.events.TEXT_CHANGE,this.updateWhenTextChange)}resolveOptions(n){return Object.assign({blockSize:12},n)}buildResizer(){if(!this.tableMainBlot||!this.tableWrapperBlot)return;this.root=this.tableModule.addContainer(this.bem.b()),this.root.classList.add(this.bem.is("hidden")),this.block=document.createElement("div"),this.block.classList.add(this.bem.be("block")),Object.assign(this.block.style,{width:`${this.options.blockSize}px`,height:`${this.options.blockSize}px`}),this.root.appendChild(this.block);let n=[],e=[],t=i=>{if(!this.tableMainBlot)return;let o=Np(this.tableMainBlot)?-1:1,l=(i.clientX-this.startX)*o,a=i.clientY-this.startY,h=Math.floor(l/n.length),g=Math.floor(a/e.length);for(let{blot:m,width:x}of n)m.width=Math.max(x+h,Ss.colMinWidthPx);for(let{blot:m,height:x}of e)m.setHeight(`${Math.max(x+g,Ss.rowMinHeightPx)}px`)},r=()=>{n=[],e=[],document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r)};this.block.addEventListener("mousedown",i=>{!this.tableMainBlot||this.isTableOutofEditor()||(this.startX=i.clientX,this.startY=i.clientY,n=this.tableMainBlot.getCols().map(o=>({blot:o,width:Math.floor(o.width)})),e=this.tableMainBlot.getRows().map(o=>({blot:o,height:Math.floor(o.domNode.getBoundingClientRect().height)})),document.addEventListener("mousemove",t),document.addEventListener("mouseup",r))}),this.block.addEventListener("dragstart",i=>i.preventDefault()),this.resizeobserver.observe(this.tableMainBlot.domNode),gv.call(this,this.quill.root,()=>this.update()),gv.call(this,this.tableWrapperBlot.domNode,()=>this.update())}isTableOutofEditor(){if(!this.tableMainBlot||!this.tableWrapperBlot||this.tableMainBlot.full)return!1;let n=this.tableMainBlot.domNode.getBoundingClientRect(),e=this.tableWrapperBlot.domNode.getBoundingClientRect();if(n.width>e.width){for(let t of this.tableMainBlot.getCols())t.width=Math.floor(t.width/n.width*e.width);return this.tableMainBlot.colWidthFillTable(),!0}return!1}update(){if(!this.block||!this.root||!this.tableMainBlot||!this.tableWrapperBlot)return;if(this.tableMainBlot.full){this.hide();return}let{rect:n,body:e}=qm(this.tableMainBlot);if(!e||!n)return;let t=this.tableWrapperBlot.domNode.getBoundingClientRect(),r=this.quill.root.getBoundingClientRect(),{scrollTop:i,scrollLeft:o}=this.tableWrapperBlot.domNode,l=this.options.blockSize*2+this.offset,a=Math.min(n.width,t.width)+l,h=Math.min(n.height,t.height)+l;Object.assign(this.root.style,{width:`${a}px`,height:`${h}px`,left:`${Math.max(n.x,t.x)-r.x-this.options.blockSize}px`,top:`${Math.max(n.y,t.y)-r.y-this.options.blockSize}px`});let g={left:`${n.width+l-o}px`,top:`${h-i}px`};Np(this.tableMainBlot)?(this.root.classList.add(this.bem.is("align-right")),g.left=`${this.options.blockSize+-1*o}px`):this.root.classList.remove(this.bem.is("align-right")),Object.assign(this.block.style,g)}show(){this.root&&(this.root.classList.remove(this.bem.is("hidden")),this.update())}hide(){this.root&&this.root.classList.add(this.bem.is("hidden"))}destroy(){this.hide(),this.quill.off(Xe.events.TEXT_CHANGE,this.updateWhenTextChange),this.resizeobserver.disconnect(),this.root&&this.root.remove(),J0.call(this)}};const VB=0;var ZB=class{constructor(n,e,t={}){Ee(this,"options");Ee(this,"boundary",null);Ee(this,"scrollRecordEls",[]);Ee(this,"startScrollRecordPosition",[]);Ee(this,"selectedTableScrollX",0);Ee(this,"selectedTableScrollY",0);Ee(this,"selectedEditorScrollX",0);Ee(this,"selectedEditorScrollY",0);Ee(this,"selectedTds",[]);Ee(this,"cellSelectWrap");Ee(this,"cellSelect");Ee(this,"dragging",!1);Ee(this,"scrollHandler",[]);Ee(this,"tableMenu");Ee(this,"resizeObserver");Ee(this,"table");Ee(this,"isDisplaySelection",!1);Ee(this,"bem",cu("selection"));Ee(this,"lastSelection",{anchorNode:null,anchorOffset:0,focusNode:null,focusOffset:0});Ee(this,"updateAfterEvent",()=>{this.updateWithSelectedTds()});Ee(this,"quillSelectionChangeHandler",(n,e,t)=>{if(t!==Xe.sources.API&&n&&!this.quill.composition.isComposing&&this.selectedTds.length>0){let r=this.quill.getFormat(n),[i]=this.quill.getLine(n.index),o=!!r[Qe.tableCellInner]&&!!i,l=this.selectedTds.some(a=>a.children.contains(i));if(o&&!l)try{let a=Kl(i,Qe.tableCellInner);this.selectedTds=[a],this.updateWithSelectedTds()}catch{}else o&&l||this.hide()}});Ee(this,"selectionChangeHandler",()=>{let n=window.getSelection();if(!n)return;let{anchorNode:e,focusNode:t,anchorOffset:r,focusOffset:i}=n;if(!e||!t)return;let o=Xe.find(e),l=Xe.find(t);if(!o||!l||o.scroll!==this.quill.scroll||l.scroll!==this.quill.scroll)return;let a=hw(o),h=hw(l),g=a.has(Qe.tableColgroup),m=h.has(Qe.tableColgroup);if(g||m){let S=e,R=r,k=t,O=i;if(g){let P=a.get(Qe.tableWrapper),z=P.descendants(cf);z.length>0&&(S=z[0].domNode,R=0)}if(m){let P=h.get(Qe.tableWrapper),z=P.descendants(cf);z.length>0&&(k=z[0].domNode,O=0)}this.setSelectionData(n,{anchorNode:S,anchorOffset:R,focusNode:k,focusOffset:O});return}let x=a.has(Qe.tableCellInner),w=h.has(Qe.tableCellInner),_=x&&w;if(_){let S=a.get(Qe.tableCellInner),R=h.get(Qe.tableCellInner);_&&(_=S!==R)}if(x&&w&&_||!x&&w||!w&&x){this.setSelectionData(n,this.lastSelection),this.selectedTds.length>0&&this.hide();return}this.lastSelection={anchorNode:e,anchorOffset:r,focusNode:t,focusOffset:i}});Ee(this,"mouseDownHandler",n=>{let{button:e,target:t,clientX:r,clientY:i}=n,o=t.closest(".ql-table"),l=t.closest("caption");if(e!==0||!o||l)return;this.setSelectionTable(o);let a=o.dataset.tableId,h={x:r,y:i};this.recordScrollPosition(),this.selectedTds=this.computeSelectedTds(h,h),this.dragging=!0,this.show();let g=x=>{this.tableMenu&&this.tableMenu.hide(),this.tableModule.tableResize&&this.tableModule.tableResize.hide();let{button:w,target:_,clientX:S,clientY:R}=x,k=_.closest(".ql-table"),O=_.closest("caption");if(w!==0||O||!k||k.dataset.tableId!==a)return;let P={x:S,y:R};this.selectedTds=this.computeSelectedTds(h,P),this.selectedTds.length>1&&this.quill.blur(),this.update()},m=()=>{document.body.removeEventListener("mousemove",g,!1),document.body.removeEventListener("mouseup",m,!1),this.dragging=!1,this.clearRecordScrollPosition(),this.tableMenu&&this.selectedTds.length>0&&this.tableMenu.show()};document.body.addEventListener("mousemove",g,!1),document.body.addEventListener("mouseup",m,!1)});Ee(this,"removeCell",n=>{let e=this.quill.getSelection(),t=document.activeElement;if(!(e||n.key!=="Backspace"&&n.key!=="Delete"||!this.quill.root.contains(t))){if(this.table){let r=Xe.find(this.table),i=r.descendants(cf);if(this.selectedTds.length===i.length){r.remove();return}}for(let r of this.selectedTds)r.deleteAt(0,r.length()-1)}});this.tableModule=n,this.quill=e,this.options=this.resolveOptions(t),this.scrollRecordEls=[this.quill.root,document.documentElement],this.cellSelectWrap=n.addContainer(this.bem.b()),this.cellSelect=this.helpLinesInitial(),this.resizeObserver=rB(()=>this.updateAfterEvent(),{ignoreFirstBind:!0}),this.resizeObserver.observe(this.quill.root),this.quill.root.addEventListener("mousedown",this.mouseDownHandler,{passive:!1}),document.addEventListener("selectionchange",this.selectionChangeHandler,{passive:!1}),this.quill.on(av.AFTER_TABLE_RESIZE,this.updateAfterEvent),this.quill.on(Xe.events.SELECTION_CHANGE,this.quillSelectionChangeHandler),this.quill.on(Xe.events.TEXT_CHANGE,this.updateAfterEvent),this.options.tableMenu&&(this.tableMenu=new this.options.tableMenu(n,e,this.options.tableMenuOptions)),this.hide()}getFirstTextNode(n){for(let e of Array.from(n.childNodes))if(e.nodeType===Node.TEXT_NODE)return e;return n}getLastTextNode(n){for(let e=n.childNodes.length-1;e>=0;e--){let t=n.childNodes[e];if(t.nodeType===Node.TEXT_NODE)return t}return n}getNodeTailOffset(n){let e=document.createRange();return e.selectNodeContents(n),e.collapse(!1),e.startOffset}setSelectionData(n,e){let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}=e;if(!t||!i)return;let l=document.createRange(),a=this.selectionDirectionUp(e);a?(l.setStart(t,r),l.setEnd(t,r)):(l.setStart(t,r),l.setEnd(i,o)),n.removeAllRanges(),n.addRange(l),a&&n.extend(i,o)}selectionDirectionUp(n){let{anchorNode:e,anchorOffset:t,focusNode:r,focusOffset:i}=n;if(!e||!r)return!1;if(e===r)return t>i;let o=e.compareDocumentPosition(r);return o&Node.DOCUMENT_POSITION_CONTAINS||o&Node.DOCUMENT_POSITION_CONTAINED_BY?(o&Node.DOCUMENT_POSITION_FOLLOWING)!==0:(o&Node.DOCUMENT_POSITION_PRECEDING)!==0}findWrapSelection(n){let e=null,t=0,r=null,i=0;for(let{node:o,offset:l}of n)o&&((!e||this.selectionDirectionUp({anchorNode:e,anchorOffset:t,focusNode:o,focusOffset:l}))&&(e=o,t=l),(!r||this.selectionDirectionUp({anchorNode:o,anchorOffset:l,focusNode:r,focusOffset:i}))&&(r=o,i=l));return{startNode:e,startOffset:t,endNode:r,endOffset:i}}resolveOptions(n){return Object.assign({selectColor:"#0589f340",tableMenuOptions:{}},n)}helpLinesInitial(){this.cellSelectWrap.style.setProperty("--select-color",this.options.selectColor);let n=document.createElement("div");return n.classList.add(this.bem.be("line")),this.cellSelectWrap.appendChild(n),n}computeSelectedTds(n,e){if(!this.table)return[];let t=Xe.find(this.table);if(!t)return[];let r=t.descendants(eg)[0];if(!r)return[];let i=new Set(r.descendants(Nf).map((w,_)=>(w.index=_,w))),o=this.getScrollPositionDiff(),{rect:l}=qm(t);if(!l)return[];let a=n.x+o.x,h=n.y+o.y,g={x:Math.max(l.left,Math.min(e.x,a)),y:Math.max(l.top,Math.min(e.y,h)),x1:Math.min(l.right,Math.max(e.x,a)),y1:Math.min(l.bottom,Math.max(e.y,h))},m=new Set,x=!0;for(;x;){x=!1;for(let w of i){w.__rect||(w.__rect=w.domNode.getBoundingClientRect());let{x:_,y:S,right:R,bottom:k}=w.__rect;if(eB({x:Math.floor(g.x),y:Math.floor(g.y),x1:Math.floor(g.x1),y1:Math.floor(g.y1)},{x:Math.floor(_),y:Math.floor(S),x1:Math.floor(R),y1:Math.floor(k)},VB,m.size===0)){m.add(w),i.delete(w),g={x:Math.min(g.x,_),y:Math.min(g.y,S),x1:Math.max(g.x1,R),y1:Math.max(g.y1,k)},x=!0;break}}}for(let w of[...m,...i])delete w.__rect;return this.boundary=tB({...g,width:g.x1-g.x,height:g.y1-g.y},this.quill.root),Array.from(m).sort((w,_)=>w.index-_.index).map(w=>(delete w.index,w.getCellInner()))}getScrollPositionDiff(){let{x:n,y:e}=this.getTableViewScroll(),{x:t,y:r}=ap(this.quill.root);return this.selectedTableScrollX=n,this.selectedTableScrollY=e,this.selectedEditorScrollX=t,this.selectedEditorScrollY=r,this.startScrollRecordPosition.reduce((i,{x:o,y:l},a)=>{let{x:h,y:g}=ap(this.scrollRecordEls[a]);return i.x+=o-h,i.y+=l-g,i},{x:0,y:0})}recordScrollPosition(){this.clearRecordScrollPosition();for(let n of this.scrollRecordEls)this.startScrollRecordPosition.push(ap(n))}clearRecordScrollPosition(){this.startScrollRecordPosition=[]}updateWithSelectedTds(){if(this.selectedTds.length<=0)return;let n={x:1/0,y:1/0},e={x:-1/0,y:-1/0};for(let t of this.selectedTds){let r=t.domNode.getBoundingClientRect();n.x=Math.min(n.x,r.left),n.y=Math.min(n.y,r.top),e.x=Math.max(e.x,r.right),e.y=Math.max(e.y,r.bottom)}this.selectedTds=this.computeSelectedTds(n,e),this.selectedTds.length>0?this.update():this.hide()}update(){if(this.selectedTds.length===0||!this.boundary||!this.table)return;let{x:n,y:e}=ap(this.quill.root),{x:t,y:r}=this.getTableViewScroll(),i=this.table.parentElement.getBoundingClientRect(),o=this.quill.root.getBoundingClientRect(),l=i.x-o.x,a=i.y-o.y;Object.assign(this.cellSelect.style,{left:`${this.selectedEditorScrollX*2-n+this.boundary.x+this.selectedTableScrollX-t-l}px`,top:`${this.selectedEditorScrollY*2-e+this.boundary.y+this.selectedTableScrollY-r-a}px`,width:`${this.boundary.width}px`,height:`${this.boundary.height}px`}),Object.assign(this.cellSelectWrap.style,{left:`${l}px`,top:`${a}px`,width:`${i.width}px`,height:`${i.height}px`}),!this.dragging&&this.tableMenu&&this.tableMenu.update()}getTableViewScroll(){return this.table?ap(this.table.parentElement):{x:0,y:0}}setSelectionTable(n){this.table!==n&&(this.table=n,this.table?this.scrollRecordEls.push(this.table.parentElement):this.scrollRecordEls.pop())}showDisplay(){Object.assign(this.cellSelectWrap.style,{display:"block"}),this.isDisplaySelection=!0,this.table&&this.resizeObserver.observe(this.table)}show(){this.table&&(J0.call(this),this.update(),this.showDisplay(),document.addEventListener("keydown",this.removeCell),gv.call(this,this.quill.root,()=>{this.update()}),gv.call(this,this.table.parentElement,()=>{this.update()}))}hideDisplay(){Object.assign(this.cellSelectWrap.style,{display:"none"}),this.isDisplaySelection=!1,this.table&&this.resizeObserver.unobserve(this.table)}hide(){J0.call(this),document.removeEventListener("keydown",this.removeCell),this.hideDisplay(),this.boundary=null,this.selectedTds=[],this.setSelectionTable(void 0),this.tableMenu&&this.tableMenu.hide()}destroy(){this.resizeObserver.disconnect(),this.hide(),this.cellSelectWrap.remove(),this.tableMenu&&this.tableMenu.destroy(),J0.call(this),this.quill.root.removeEventListener("mousedown",this.mouseDownHandler),document.removeEventListener("selectionchange",this.selectionChangeHandler),this.quill.off(Xe.events.SELECTION_CHANGE,this.quillSelectionChangeHandler),this.quill.off(Xe.events.TEXT_CHANGE,this.updateAfterEvent),this.quill.on(av.AFTER_TABLE_RESIZE,this.updateAfterEvent)}};const Aw=Xe.import("parchment"),Yd=Xe.import("delta"),XB=Xe.import("ui/icons"),KB=Xe.import("blots/break"),JB=Xe.import("blots/block"),Rw=Xe.import("blots/block/embed");function QB(n,{tableId:e,rowId:t,colId:r}){let i={tableId:e,rowId:t,colId:r,colspan:1,rowspan:1},o=n.create(Qe.tableCell,i),l=n.create(Qe.tableCellInner,i),a=n.create("block");return a.appendChild(n.create("break")),l.appendChild(a),o.appendChild(l),o}function qB(n,e){return mF({onSelect:(t,r)=>{n.insertTable(t,r),e&&e.close()},customBtn:n.options.customBtn,texts:n.options.texts})}function Iw(n){return{bindInHead:!1,key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:[Qe.tableCellInner],handler(e,t){let r=n?"prev":"next",i=n?"tail":"head";if(t.line[r])return!0;let o=this.quill.selection.getBounds(e.index),l=t.line.domNode.getBoundingClientRect();if(!o||!l)return!0;if(n){if(o.top-l.top>3)return!0}else if(l.bottom-o.bottom>3)return!0;let a,h,g,m;try{[a,h,g,m]=A1(t.line,[Qe.tableWrapper,Qe.tableMain,Qe.tableRow,Qe.tableCell])}catch{return!0}let x=h.getColIds(),w=a.descendants(Q0,0)[0],_;if(w){let R=window.getComputedStyle(w.domNode);_=r==="next"&&R.captionSide==="bottom"?w:r==="next"?a.next:w}else _=a[r];if(t.line[r]||!_)return!0;let S=g[r];if(S){let R=x.indexOf(m.colId),k=S.getCellByColId(x[R],r);if(!k)return!0;let O=k.children[i];O.children&&(O=O.children[i]);let P=O.offset(this.quill.scroll)+Math.min(t.offset,O.length()-1);this.quill.setSelection(P,0,Xe.sources.USER)}else{let R=_.offset(this.quill.scroll)+(n?_.length()-1:0);this.quill.setSelection(R,0,Xe.sources.USER)}return!1}}}var Sd,jB=(Sd=class{constructor(e,t){Ee(this,"quill");Ee(this,"options");Ee(this,"toolBox");Ee(this,"fixTableByLisenter",S_(this.balanceTables,100));Ee(this,"selector");Ee(this,"table");Ee(this,"tableSelection");Ee(this,"tableResize");Ee(this,"tableScrollbar");Ee(this,"tableAlign");Ee(this,"tableResizeScale");Ee(this,"resizeOb");if(this.quill=e,this.options=this.resolveOptions(t||{}),this.toolBox=this.initialContainer(),!this.options.scrollbar){let o=cu("scrollbar");this.quill.container.classList.add(o.bm("origin"))}this.options.selection&&(this.tableSelection=new this.options.selection(this,this.quill,this.options.selectionOptions));let r=this.quill.getModule("toolbar");if(r&&this.quill.theme.pickers){let[,o]=(r.controls||[]).find(([l])=>l===this.statics.toolName)||[];if(o&&o.tagName.toLocaleLowerCase()==="select"){let l=this.quill.theme.pickers.find(a=>a.select===o);l&&(l.label.innerHTML=this.options.icon,this.buildCustomSelect(this.options.customSelect,l),l.label.addEventListener("mousedown",()=>{if(!this.selector||!l)return;let a=this.selector.getBoundingClientRect(),{leftLimited:h}=nB(a);if(h){let g=l.label.getBoundingClientRect();Object.assign(l.options.style,{transform:`translateX(calc(-100% + ${g.width}px))`})}else Object.assign(l.options.style,{transform:void 0})}))}}let i=this.quill.getModule("keyboard");for(let o of Object.values(Sd.keyboradHandler))o.bindInHead?i.bindings[o.key].unshift(o):i.addBinding(o.key,o);this.quill.root.addEventListener("click",o=>{let l=o.composedPath();if(!l||l.length<=0)return;let a=l.find(h=>h.tagName&&h.tagName.toUpperCase()==="TABLE"&&h.classList.contains("ql-table"));if(a){if(this.table===a){this.tableSelection&&this.tableSelection.show(),this.tableAlign&&this.tableAlign.update(),this.tableResize&&this.tableResize.update(),this.tableScrollbar&&this.tableScrollbar.update();return}this.table&&this.hideTableTools(),this.showTableTools(a)}else this.table&&this.hideTableTools()},!1),this.quill.on(Xe.events.EDITOR_CHANGE,o=>{o===Xe.events.TEXT_CHANGE&&(!this.table||!this.quill.root.contains(this.table))&&this.hideTableTools()}),this.quillHack(),this.listenBalanceCells()}static register(){$g.allowedChildren=[Ff],Ff.allowedChildren=[eg,Ag,Q0],Ff.requiredContainer=$g,Q0.requiredContainer=Ff,Ag.allowedChildren=[Ig],Ag.requiredContainer=Ff,eg.allowedChildren=[qh],eg.requiredContainer=Ff,qh.allowedChildren=[Nf],Nf.requiredContainer=eg,Nf.allowedChildren=[cf,KB],Nf.requiredContainer=qh,cf.requiredContainer=Nf;let e=new Set(["table"]),t=Object.entries(Xe.imports).filter(([i,o])=>{let l=i.split("formats/")[1];return i.startsWith("formats/")&&!e.has(l)&&!I0(o,Aw.Attributor)&&(I0(o,JB)||I0(o,Rw))}),r=t.reduce((i,[o,l])=>{let a=I0(l,Rw)?Ew:lm;return i[o]=class extends hF(l,[a]){static register(){}},i},{});Xe.register({"blots/scroll":dB,"blots/block":lm,"blots/block/embed":Ew,...r,[`blots/${Qe.container}`]:dg,[`formats/${Qe.tableCell}`]:Nf,[`formats/${Qe.tableCellInner}`]:cf,[`formats/${Qe.tableRow}`]:qh,[`formats/${Qe.tableBody}`]:eg,[`formats/${Qe.tableCol}`]:Ig,[`formats/${Qe.tableColgroup}`]:Ag,[`formats/${Qe.tableCaption}`]:Q0,[`formats/${Qe.tableMain}`]:Ff,[`formats/${Qe.tableWrapper}`]:$g,"modules/clipboard":_B},!0)}get statics(){return this.constructor}initialContainer(){let e=cu("toolbox"),t=this.quill.addContainer(e.b()),r=()=>{let i=this.quill.root.getBoundingClientRect(),{offsetLeft:o,offsetTop:l}=this.quill.root;Object.assign(t.style,{top:`${l}px`,left:`${o}px`,width:`${i.width}px`,height:`${i.height}px`})};return this.resizeOb=new ResizeObserver(r),this.resizeOb.observe(this.quill.root),t}addContainer(e){if(Lg(e)){let t=document.createElement("div");for(let r of e.split(" "))t.classList.add(r);return this.toolBox.appendChild(t),t}else return this.toolBox.appendChild(e),e}resolveOptions(e){return Object.assign({customBtn:!1,texts:this.resolveTexts(e.texts||{}),full:!1,fullSwitch:!0,icon:XB.table,selectionOptions:{},alignOptions:{},scrollbarOptions:{},resizeOptions:{},resizeScaleOptions:{},autoMergeCell:!0},e)}resolveTexts(e){return Object.assign({fullCheckboxText:"Insert full width table",customBtnText:"Custom",confirmText:"Confirm",cancelText:"Cancel",rowText:"Row",colText:"Column",notPositiveNumberError:"Please enter a positive integer",custom:"Custom",clear:"Clear",transparent:"Transparent",perWidthInsufficient:"The percentage width is insufficient. To complete the operation, the table needs to be converted to a fixed width. Do you want to continue?",CopyCell:"Copy cell",CutCell:"Cut cell",InsertTop:"Insert row above",InsertRight:"Insert column right",InsertBottom:"Insert row below",InsertLeft:"Insert column Left",MergeCell:"Merge Cell",SplitCell:"Split Cell",DeleteRow:"Delete Row",DeleteColumn:"Delete Column",DeleteTable:"Delete table",BackgroundColor:"Set background color",BorderColor:"Set border color"},e)}quillHack(){var i;let e=this.quill.getSemanticHTML;this.quill.getSemanticHTML=(o=0,l)=>{let a=e.call(this.quill,o,l),h=Xe.import(`formats/${Qe.tableWrapper}`),g=new DOMParser,m=g.parseFromString(a,"text/html");for(let x of Array.from(m.querySelectorAll(`.${h.className} caption[contenteditable], .${h.className} td > [contenteditable]`)))x.removeAttribute("contenteditable");return m.body.innerHTML};let t=this.quill.format;this.quill.format=function(o,l,a=Xe.sources.API){if(!(this.scroll.query(o).prototype instanceof Aw.EmbedBlot)){let g=this.getModule(kb.moduleName),m=this.getSelection(!0);if(!this.getFormat(m)[Qe.tableCellInner]||m.length>0||g&&g.tableSelection&&g.tableSelection.selectedTds.length<=1)return t.call(this,o,l,a);if(g&&g.tableSelection&&g.tableSelection.selectedTds.length>0){let w=g.tableSelection.selectedTds,_=!1,S=[];for(let P of w){let z=P.offset(this.scroll),H=P.length();S.push({index:z,length:H}),this.getFormat(z,H)[o]!==l&&(_=!0)}let R=_?l:!1,k=new Yd;for(let[P,{index:z,length:H}]of S.entries()){let G=P===0?0:S[P-1].index+S[P-1].length;k.retain(z-G).retain(H,{[o]:R})}let O=this.updateContents(k,a);return this.blur(),O}}return t.call(this,o,l,a)};let r=this.quill.theme.modules.toolbar;if(r){let o=(i=r.handlers)==null?void 0:i.clean;if(o){let l=(a,h,g=()=>"")=>{let m=this.quill.getText(a,h),[x,w]=this.quill.getLine(a+h),_=0,S=new Yd;x!=null&&(_=x.length()-w,S=x.delta().slice(w,w+_-1).insert(`
459
- `));let R=this.quill.getContents(a,h+_),k=R.diff(new Yd().insert(m).concat(S)),O=0,P=k.ops.map(z=>{let{attributes:H,...G}=z;if(z.insert?O-=Lg(z.insert)?z.insert.length:1:z.retain?O+=gF(z.retain)?z.retain:1:z.delete&&(O+=z.delete),H){let{[Qe.tableCellInner]:N,...J}=H;if(g){let Y=R.slice(O-1,O).ops[0];if(Y&&Y.attributes&&Y.attributes[Qe.tableCellInner]){let K=Y.attributes[Qe.tableCellInner],{style:fe,...X}=K,te=g(fe);return te?{...G,attributes:{...J,[Qe.tableCellInner]:{style:te,...X}}}:{...G,attributes:{...J,[Qe.tableCellInner]:X}}}}return{...G,attributes:{...J}}}return z});return new Yd(P)};r.handlers.clean=function(a){let h=this.quill.getModule(kb.moduleName),g=this.quill.getSelection();if(g&&g.length>0&&this.quill.getFormat(g)[Qe.tableCellInner]){let x=l(g.index,g.length,!1),w=new Yd().retain(g.index).concat(x);this.quill.updateContents(w,Xe.sources.USER);return}if(h&&h.tableSelection&&h.tableSelection.selectedTds.length>0&&h.tableSelection.table){let m=Xe.find(h.tableSelection.table);if(!m){console.warn("TableMainFormat not found");return}let x=h.tableSelection.selectedTds,w=new Set,_=[];for(let P of x)if(P.parent instanceof Nf){for(let z of P.parent.getNearByCell("top"))w.has(z)||(w.add(z),_.push({td:z,cleanBorder:"bottom"}));for(let z of P.parent.getNearByCell("left"))w.has(z)||(w.add(z),_.push({td:z,cleanBorder:"right"}));w.add(P.parent),_.push({td:P.parent,cleanBorder:!0})}let S=m.descendants(Nf),R=new Map(S.map((P,z)=>[P,z]));_.sort((P,z)=>R.get(P.td)-R.get(z.td));let k=new Yd,O=0;for(let{td:P,cleanBorder:z}of _){let H=P.getCellInner().offset(this.quill.scroll),G=P.getCellInner().length(),N=l(H,G-1,Y=>{if(!Y||z===!0)return"";let K=pv(Y),fe=Object.keys(K).filter(X=>!X.startsWith(k1(`border-${z}`))).reduce((X,te)=>(X[te]=K[te],X),{});return om(fe)}),J=new Yd().retain(H-O).concat(N);k=k.concat(J),O=H+G}this.quill.updateContents(k,Xe.sources.USER),x.length>1&&this.quill.blur();return}return o.call(this,a)}}}}showTableTools(e){var t;e&&(this.table=e,(t=this.tableSelection)==null||t.show(),this.options.align&&(this.tableAlign=new this.options.align(this,e,this.quill,this.options.alignOptions)),this.options.scrollbar&&(this.tableScrollbar=new this.options.scrollbar(this,e,this.quill,this.options.scrollbarOptions)),this.options.resize&&(this.tableResize=new this.options.resize(this,e,this.quill,this.options.resizeOptions)),this.options.resizeScale&&(this.tableResizeScale=new this.options.resizeScale(this,e,this.quill,this.options.resizeScaleOptions)))}hideTableTools(){var e;(e=this.tableSelection)==null||e.hide(),this.tableScrollbar&&(this.tableScrollbar.destroy(),this.tableScrollbar=void 0),this.tableAlign&&(this.tableAlign.destroy(),this.tableAlign=void 0),this.tableResize&&(this.tableResize.destroy(),this.tableResize=void 0),this.tableResizeScale&&this.tableResizeScale.destroy(),this.table=void 0}async buildCustomSelect(e,t){if(!e||!nm(e))return;let r=document.createElement("div");if(r.classList.add("ql-custom-select"),this.selector=await e(this,t),r.appendChild(this.selector),this.options.fullSwitch){let i=cu("creator"),o=document.createElement("label");o.classList.add(i.be("checkbox"));let l=document.createElement("input");l.type="checkbox",l.checked=this.options.full,l.addEventListener("change",()=>{this.options.full=l.checked});let a=document.createElement("span");a.textContent=this.options.texts.fullCheckboxText,o.appendChild(l),o.appendChild(a),r.appendChild(o)}t.options.innerHTML="",t.options.appendChild(r)}setCellAttrs(e,t,r,i=!1){if(e.length!==0)for(let o of e)o.setFormatValue(t,r,i)}getTextByCell(e){let t="";for(let r of e){let i=r.offset(this.quill.scroll),o=r.length();for(let l of this.quill.getContents(i,o).ops)Lg(l.insert)&&(t+=l.insert)}return t}getHTMLByCell(e,t=!1){if(e.length===0)return"";let r=null;try{for(let k of e){let O=Kl(k,Qe.tableMain);if(r||(r=O),O!==r)return console.error("tableMain is not same"),""}}catch{return console.error("tds must be in same tableMain"),""}if(!r)return"";let i=this.quill.getIndex(r),o=r.length(),l=this.quill.getSemanticHTML(i,o),a=new DOMParser,h=a.parseFromString(l,"text/html"),g=[],m=new Set,x=new Set;for(let k of e)m.add(k.colId),x.add(`${k.rowId}-${k.colId}`);for(let k of Array.from(h.querySelectorAll("col")))m.has(k.dataset.colId)?g.push(k.getAttribute("width")):k.remove();let w=0,_=null;for(let k of Array.from(h.querySelectorAll("td")))if(x.has(`${k.dataset.rowId}-${k.dataset.colId}`))_!==k.dataset.rowId&&(w+=1,_=k.dataset.rowId);else{let O=k.parentElement;k.remove(),O&&O.children.length<=0&&O.remove()}let S=Array.from(h.querySelectorAll("col")),R=S.map(k=>Ig.value(k));if(r.full){let k=R.reduce((O,P)=>P.width+O,0);for(let[O,P]of R.entries())P.width=Math.round(P.width/k*100),S[O].setAttribute("width",`${P.width}%`)}else{let k=0;for(let P of R)k+=P.width;let O=h.querySelector("table");O.style.width=`${k}px`}if(t){let k=r.getRows();if(w===k.length)this.removeCol(e);else for(let O of e)O.domNode.innerHTML="<p><br></p>"}return h.body.innerHTML}insertTable(e,t){if(e>=30||t>=30)throw Error("Both rows and columns must be less than 30.");this.quill.focus();let r=this.quill.getSelection();if(r==null)return;let[i]=this.quill.getLeaf(r.index);if(!i)return;if(i_(i))throw Error(`Not supported ${i.statics.blotName} insert into table.`);let o=this.calculateTableCellBorderWidth(),l=getComputedStyle(this.quill.root),a=Number.parseInt(l.paddingLeft),h=Number.parseInt(l.paddingRight),g=Number.parseInt(l.width)-a-h-o,m=Fa(),x=Array(t).fill(0).map(()=>Fa()),w=this.options.full?`${Math.max(1/t*100,Ss.colMinWidthPre)}%`:`${Math.max(Math.floor(g/t),Ss.colMinWidthPx)}px`,_=[{retain:r.index}],S=this.quill.getContents(r.index,1),[,R]=this.quill.getLine(r.index);S.ops[0].insert!==`
458
+ `;const HB="color-selector",io={Break:{name:"break"},CopyCell:{name:"CopyCell",tip:"Copy cell",icon:RB,handle:(n,e)=>{let t=n.getTextByCell(e),r=n.getHTMLByCell(e),i=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([r],{type:"text/html"})});navigator.clipboard.write([i]),n.hideTableTools()}},CutCell:{name:"CutCell",tip:"Cut cell",icon:IB,handle:(n,e)=>{let t=n.getTextByCell(e),r=n.getHTMLByCell(e,!0),i=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([r],{type:"text/html"})});navigator.clipboard.write([i]),n.hideTableTools()}},InsertTop:{name:"InsertTop",icon:OB,tip:"Insert row above",handle:(n,e)=>{n.appendRow(e,!1),n.hideTableTools()}},InsertRight:{name:"InsertRight",icon:LB,tip:"Insert column right",handle:(n,e)=>{n.appendCol(e,!0),n.hideTableTools()}},InsertBottom:{name:"InsertBottom",icon:kB,tip:"Insert row below",handle:(n,e)=>{n.appendRow(e,!0),n.hideTableTools()}},InsertLeft:{name:"InsertLeft",icon:MB,tip:"Insert column Left",handle:(n,e)=>{n.appendCol(e,!1),n.hideTableTools()}},MergeCell:{name:"MergeCell",icon:PB,tip:"Merge Cell",handle:(n,e)=>{n.mergeCells(e),n.hideTableTools()}},SplitCell:{name:"SplitCell",icon:BB,tip:"Split Cell",handle:(n,e)=>{n.splitCell(e),n.hideTableTools()}},DeleteRow:{name:"DeleteRow",icon:NB,tip:"Delete Row",handle:(n,e)=>{n.removeRow(e),n.hideTableTools()}},DeleteColumn:{name:"DeleteColumn",icon:DB,tip:"Delete Column",handle:(n,e)=>{n.removeCol(e),n.hideTableTools()}},DeleteTable:{name:"DeleteTable",icon:FB,tip:"Delete table",handle:(n,e)=>{n.deleteTable(e)}},BackgroundColor:{name:"BackgroundColor",icon:TB,isColorChoose:!0,tip:"Set background color",key:"background-color",handle:(n,e,t)=>{n.setCellAttrs(e,"background-color",t,!0)}},BorderColor:{name:"BorderColor",icon:AB,isColorChoose:!0,tip:"Set border color",key:"border-color",handle:(n,e,t)=>{n.setCellAttrs(e,"border-color",t,!0)}},SwitchWidth:{name:"SwitchWidth",icon:EB,tip:"Switch table width",handle:n=>{if(!n.table)return;let e=Xe.find(n.table);e&&(e.full?e.cancelFull():e.setFull())}},InsertCaption:{name:"InsertCaption",icon:zB,tip:"Insert table caption",handle:n=>{if(!n.table)return;let e=Xe.find(n.table);if(!e)return;let t=n.quill.scroll.create("text","Table Caption").wrap(Qe.tableCaption,{tableId:e.tableId});e.insertBefore(t,e.children.head)}}},P0=10,e1=cu("color-map"),Lu={selectWrapper:e1.b(),used:e1.bm("used"),item:e1.be("item"),btn:e1.be("btn"),map:e1.be("content"),mapRow:e1.be("content-row")};var WB=class{constructor(n,e,t){Ee(this,"usedColors",new Set);Ee(this,"options");Ee(this,"menu",null);Ee(this,"isMenuDisplay",!1);Ee(this,"isColorPicking",!1);Ee(this,"updateUsedColor");Ee(this,"tooltipItem",[]);Ee(this,"activeTooltip",null);Ee(this,"bem",cu("menu"));Ee(this,"colorItemClass",`color-${Fa()}`);Ee(this,"colorChooseTooltipOption",{direction:"top"});Ee(this,"updateWhenTextChange",()=>{this.isMenuDisplay&&this.update()});this.tableModule=n,this.quill=e,this.options=this.resolveOptions(t);try{let r=localStorage.getItem(this.options.localstorageKey)||"[]",i=JSON.parse(r);l_(i)||(i=[]),i.slice(-1*P0).map(o=>this.usedColors.add(o))}catch{}this.updateUsedColor=S_(r=>{if(!r)return;if(this.usedColors.add(r),this.usedColors.size>P0){let o=Array.from(this.usedColors).slice(-1*P0);this.usedColors.clear(),o.map(l=>this.usedColors.add(l))}localStorage.setItem(this.options.localstorageKey,JSON.stringify(Array.from(this.usedColors)));let i=Array.from(document.querySelectorAll(`.${this.colorItemClass}.${Lu.used}`));for(let o of i){let l=document.createElement("div");l.classList.add(Lu.item),l.style.backgroundColor=String(r),Array.from(o.querySelectorAll(`.${Lu.item}[style*="background-color: ${l.style.backgroundColor}"]`)).length<=0&&o.appendChild(l);let h=Array.from(o.querySelectorAll(`.${Lu.item}`)).slice(0,-1*P0);for(let g of h)g.remove()}},1e3),this.quill.on(Xe.events.TEXT_CHANGE,this.updateWhenTextChange)}resolveOptions(n){return Object.assign({tipText:!0,tools:[io.InsertTop,io.InsertRight,io.InsertBottom,io.InsertLeft,io.Break,io.MergeCell,io.SplitCell,io.Break,io.DeleteRow,io.DeleteColumn,io.DeleteTable,io.Break,io.BackgroundColor,io.BorderColor],localstorageKey:"__table-bg-used-color",defaultColorMap:sF},n)}buildTools(){let n=document.createElement("div");n.classList.add(this.bem.b()),Object.assign(n.style,{display:"flex"});for(let e of this.options.tools){let{name:t,icon:r,handle:i,isColorChoose:o,key:l,tip:a=""}=e,h=document.createElement("span");if(h.classList.add(this.bem.be("item")),t==="break")h.classList.add(this.bem.is("break"));else{let g=document.createElement("i");if(g.classList.add("icon"),nm(r)?g.appendChild(r(this.tableModule)):g.innerHTML=r,h.appendChild(g),o&&l){let x=this.createColorChoose(h,{name:t,icon:r,handle:i,isColorChoose:o,key:l,tip:a});this.tooltipItem.push(x),h.classList.add(HB)}else nm(i)&&h.addEventListener("click",x=>{this.quill.focus(),i(this.tableModule,this.getSelectedTds(),x)},!1);let m=this.tableModule.options.texts[t]||a;this.options.tipText&&m&&a&&this.createTipText(h,m)}n.appendChild(h)}return n}createColorChoose(n,{handle:e,key:t}){let r=document.createElement("div");if(r.classList.add(Lu.selectWrapper),this.options.defaultColorMap.length>0){let _=document.createElement("div");_.classList.add(Lu.map);for(let S of this.options.defaultColorMap){let R=document.createElement("div");R.classList.add(Lu.mapRow);for(let k of S){let O=document.createElement("div");O.classList.add(Lu.item),O.style.backgroundColor=k,R.appendChild(O)}_.appendChild(R)}r.appendChild(_)}let i=document.createElement("div");i.classList.add(Lu.mapRow),Object.assign(i.style,{marginTop:"4px"});let o=document.createElement("div");o.classList.add(Lu.btn,"transparent"),o.textContent=this.tableModule.options.texts.transparent,o.addEventListener("click",()=>{e(this.tableModule,this.getSelectedTds(),"transparent")});let l=document.createElement("div");l.classList.add(Lu.btn,"clear"),l.textContent=this.tableModule.options.texts.clear,l.addEventListener("click",()=>{e(this.tableModule,this.getSelectedTds(),null)});let a=document.createElement("div");a.classList.add(Lu.btn,"custom"),a.textContent=this.tableModule.options.texts.custom;let h=yF({onChange:_=>{e(this.tableModule,this.getSelectedTds(),_),this.updateUsedColor(_)}}),{hide:g,destroy:m}=Lb(a,{direction:"right",type:"click",content:h,container:a});i.appendChild(o),i.appendChild(l),i.appendChild(a),r.appendChild(i);let x=document.createElement("div");x.classList.add(Lu.used,this.colorItemClass);for(let _ of this.usedColors){let S=document.createElement("div");S.classList.add(Lu.item),S.style.backgroundColor=_,x.appendChild(S)}r.appendChild(x),r.addEventListener("click",_=>{_.stopPropagation(),g();let S=_.target,R=S.style.backgroundColor,k=this.getSelectedTds();if(S&&R&&k.length>0){if(this.tableModule.setCellAttrs(k,t,R,!0),!S.closest(`.${Lu.item}`))return;this.updateUsedColor(R)}});let w=Lb(n,{type:"click",content:r,onOpen:()=>(this.isMenuDisplay&&this.tableModule.tableSelection&&this.tableModule.tableSelection.hideDisplay(),this.setActiveTooltip(w),!1),onClose:()=>(this.isMenuDisplay&&this.tableModule.tableSelection&&(this.tableModule.tableSelection.updateWithSelectedTds(),this.tableModule.tableSelection.showDisplay()),r.contains(h)&&g(),this.activeTooltip===w&&(this.activeTooltip=null),!1),onDestroy:()=>{m(),this.activeTooltip===w&&(this.activeTooltip=null)},...this.colorChooseTooltipOption});return w.isColorPick=!0,w}setActiveTooltip(n){this.activeTooltip&&this.activeTooltip!==n&&this.activeTooltip.hide(!0),this.activeTooltip=n}getSelectedTds(){var n;return((n=this.tableModule.tableSelection)==null?void 0:n.selectedTds)||[]}createTipText(n,e){let t=Lb(n,{msg:e});t&&this.tooltipItem.push(t)}show(){!this.menu||!this.tableModule.tableSelection||!this.tableModule.tableSelection.boundary||(Object.assign(this.menu.style,{display:"flex"}),this.isMenuDisplay=!0,this.update())}update(){}hide(){this.menu&&Object.assign(this.menu.style,{display:"none"});for(let n of this.tooltipItem)n.hide(!0);this.isMenuDisplay=!1}destroy(){this.quill.off(Xe.events.TEXT_CHANGE,this.updateWhenTextChange),this.activeTooltip=null;for(let n of this.tooltipItem)n.destroy();this.menu&&(this.hide(),this.menu.remove(),this.menu=null)}},UB=class extends WB{constructor(n,e,t){super(n,e,t),this.tableModule=n,this.quill=e,this.menu=this.buildTools(),this.tableModule.addContainer(this.menu),this.show(),this.update()}update(){!this.isMenuDisplay||!this.menu||!this.tableModule.tableSelection||!this.tableModule.tableSelection.isDisplaySelection||(super.update(),__(this.tableModule.tableSelection.cellSelect,this.menu,{placement:"bottom",middleware:[w_(),x_({limiter:C_()}),m_(20)]}).then(({x:n,y:e})=>{Object.assign(this.menu.style,{left:`${n}px`,top:`${e}px`})}))}};const Np=n=>!n.full&&n.align==="right";var GB=class{constructor(n,e){Ee(this,"colIndex",-1);Ee(this,"tableMain");Ee(this,"dragging",!1);Ee(this,"dragColBreak",null);Ee(this,"handleColMouseUpFunc",this.handleColMouseUp.bind(this));Ee(this,"handleColMouseMoveFunc",this.handleColMouseMove.bind(this));Ee(this,"handleColMouseDownFunc",this.handleColMouseDown.bind(this));Ee(this,"rowIndex",-1);Ee(this,"dragRowBreak",null);Ee(this,"handleRowMouseUpFunc",this.handleRowMouseUp.bind(this));Ee(this,"handleRowMouseMoveFunc",this.handleRowMouseMove.bind(this));Ee(this,"handleRowMouseDownFunc",this.handleRowMouseDown.bind(this));Ee(this,"dragBEM",cu("drag-line"));this.tableModule=n,this.quill=e}findCurrentColIndex(n){return-1}colWidthChange(n,e,t){}async createConfirmDialog({message:n,confirm:e,cancel:t}){return new Promise(r=>{let i=document.createElement("div");Object.assign(i.style,{padding:"8px 12px",fontSize:"14px",lineHeight:"1.5"});let o=document.createElement("p");o.textContent=n;let l=document.createElement("div");Object.assign(l.style,{display:"flex",justifyContent:"flex-end",gap:"6px"});let a=cv({content:t}),h=cv({type:"confirm",content:e});l.appendChild(a),l.appendChild(h),i.appendChild(o),i.appendChild(l);let{close:g}=s_({child:i});a.addEventListener("click",()=>{r(!1),g()}),h.addEventListener("click",()=>{r(!0),g()})})}async handleColMouseUp(){if(!this.dragColBreak||!this.tableMain||this.colIndex===-1)return;let n=this.tableMain.getCols(),e=Number.parseInt(this.dragColBreak.dataset.w||"0"),t=this.tableMain.full,r=!1,i=[];if(t){let o=this.tableMain.domNode.getBoundingClientRect().width,l=e/o*100,a=n[this.colIndex].width;if(l<a){if(l=Math.max(Ss.colMinWidthPre,l),n[this.colIndex+1]||n[this.colIndex-1]){let h=n[this.colIndex+1]?this.colIndex+1:this.colIndex-1;i.push({index:h,width:n[h].width+a-l})}else l=100;r=!0,i.push({index:this.colIndex,width:l})}else if(n[this.colIndex+1]){let h=a+n[this.colIndex+1].width;l=Math.min(h-Ss.colMinWidthPre,l),r=!0,i.push({index:this.colIndex,width:l},{index:this.colIndex+1,width:h-l})}}else this.tableMain.domNode.style.width=`${Number.parseFloat(this.tableMain.domNode.style.width)-n[this.colIndex].domNode.getBoundingClientRect().width+e}px`,r=!0,i.push({index:this.colIndex,width:e});if(document.body.removeChild(this.dragColBreak),this.dragColBreak=null,document.removeEventListener("mouseup",this.handleColMouseUpFunc),document.removeEventListener("mousemove",this.handleColMouseMoveFunc),this.dragging=!1,r){let o=this.tableMain.domNode.getBoundingClientRect().width;if(t){let l=0,a=new Set(i.map(({index:h,width:g})=>(l+=g,h)));for(let[h,g]of n.entries())a.has(h)||(l+=g.width);if(l>100){if(!await this.createConfirmDialog({message:this.tableModule.options.texts.perWidthInsufficient,confirm:this.tableModule.options.texts.confirmText,cancel:this.tableModule.options.texts.cancelText}))return;this.tableMain.cancelFull(),t=!1;for(let[h,g]of i.entries()){let{width:m,index:x}=g;i[h]={index:x,width:m/100*o}}}}for(let{index:l,width:a}of i)n[l].width=`${Math.round(a)}${t?"%":"px"}`,this.colWidthChange(l,{px:Math.round(a/100*o),pre:Math.round(a)},t)}this.quill.emitter.emit(av.AFTER_TABLE_RESIZE)}getColumnRect(n){if(!this.tableMain)return null;let e=this.tableMain.getCols();if(n>=e.length)return null;let t=e[0].domNode.getBoundingClientRect().left;for(let o=0;o<n;o++){let l=e[o].domNode.getBoundingClientRect();t+=l.width}let r=e[n],i=r.domNode.getBoundingClientRect().width;return{left:t,right:t+i,width:i}}handleColMouseMove(n){if(n.preventDefault(),!this.dragColBreak||!this.tableMain||this.colIndex===-1)return;let e=this.tableMain.getCols(),t=this.getColumnRect(this.colIndex),r=this.tableMain.domNode.getBoundingClientRect(),i=n.clientX;if(this.tableMain.full){let l=Ss.colMinWidthPre/100*r.width,a=r.right;i>t.right&&e[this.colIndex+1]&&(a=Math.max(this.getColumnRect(this.colIndex+1).right-l,t.left+l));let h=t.left+l;i=Math.min(Math.max(i,h),a)}else Np(this.tableMain)?t.right-i<Ss.colMinWidthPx&&(i=t.right-Ss.colMinWidthPx):i-t.left<Ss.colMinWidthPx&&(i=t.left+Ss.colMinWidthPx);let o=i-t.left;return Np(this.tableMain)&&(o=t.right-i),this.dragColBreak.style.left=`${i}px`,this.dragColBreak.dataset.w=String(o),{left:i,width:o}}handleColMouseDown(n){if(n.button!==0||(n.preventDefault(),!this.tableMain))return;let{rect:e,body:t}=qm(this.tableMain);if(!t||!e)return;let r=this.tableMain.getCols();if(this.colIndex=this.findCurrentColIndex(n),this.colIndex===-1)return;let i=r[this.colIndex].width,o=this.tableMain.full?i/100*e.width:i;document.addEventListener("mouseup",this.handleColMouseUpFunc),document.addEventListener("mousemove",this.handleColMouseMoveFunc),this.dragging=!0;let l=document.createElement("div");l.classList.add(this.dragBEM.b(),this.dragBEM.is("col")),l.dataset.w=String(o);let a={top:e.y,left:n.clientX,height:e.height};Object.assign(l.style,{top:`${a.top}px`,left:`${a.left}px`,height:`${a.height}px`});let h=document.body;return h.appendChild(l),this.dragColBreak&&h.removeChild(this.dragColBreak),this.dragColBreak=l,a}findCurrentRowIndex(n){return-1}rowHeightChange(n,e){}handleRowMouseUp(){if(!this.tableMain||!this.dragRowBreak||this.rowIndex===-1)return;let n=Number.parseInt(this.dragRowBreak.dataset.h||"0");this.tableMain.getRows()[this.rowIndex].setHeight(`${n}px`),this.rowHeightChange(this.rowIndex,n),document.body.removeChild(this.dragRowBreak),this.dragRowBreak=null,document.removeEventListener("mouseup",this.handleRowMouseUpFunc),document.removeEventListener("mousemove",this.handleRowMouseMoveFunc),this.dragging=!1,this.quill.emitter.emit(av.AFTER_TABLE_RESIZE)}handleRowMouseMove(n){if(!this.tableMain||!this.dragRowBreak||this.rowIndex===-1)return;n.preventDefault();let e=this.tableMain.getRows(),t=e[this.rowIndex].domNode.getBoundingClientRect(),r=n.clientY;return r-t.y<Ss.rowMinHeightPx&&(r=t.y+Ss.rowMinHeightPx),this.dragRowBreak.style.top=`${r}px`,this.dragRowBreak.dataset.h=String(r-t.y),{top:r,height:r-t.y}}handleRowMouseDown(n){if(n.button!==0||(n.preventDefault(),!this.tableMain)||(this.rowIndex=this.findCurrentRowIndex(n),this.rowIndex===-1))return;this.dragging=!0,document.addEventListener("mouseup",this.handleRowMouseUpFunc),document.addEventListener("mousemove",this.handleRowMouseMoveFunc);let e=this.tableMain.getRows(),t=e[this.rowIndex].domNode.getBoundingClientRect().height,r=this.tableMain.domNode.getBoundingClientRect(),i=document.createElement("div");i.classList.add(this.dragBEM.b(),this.dragBEM.is("row")),i.dataset.h=String(t);let o={top:n.clientY,left:r.x,width:r.width};Object.assign(i.style,{top:`${o.top}px`,left:`${o.left}px`,width:`${o.width}px`});let l=document.body;return l.appendChild(i),this.dragRowBreak&&l.removeChild(this.dragRowBreak),this.dragRowBreak=i,o}update(){}destroy(){}},YB=class extends GB{constructor(e,t,r){super(e,r);Ee(this,"colResizer");Ee(this,"rowResizer");Ee(this,"currentTableCell");Ee(this,"dragging",!1);Ee(this,"curColIndex",-1);Ee(this,"curRowIndex",-1);Ee(this,"tableCellBlot");Ee(this,"bem",cu("resize-line"));Ee(this,"mousemoveHandler",e=>{if(this.dragging||this.tableModule.tableSelection&&this.tableModule.tableSelection.dragging)return;let t=this.findTableCell(e);if(!t)return this.hide();let r=Xe.find(t);r&&this.currentTableCell!==t&&(this.show(),this.currentTableCell=t,this.tableCellBlot=r,this.tableMain=Kl(r,Qe.tableMain),this.tableMain.getCols().length>0&&this.updateColResizer(),this.updateRowResizer())});Ee(this,"hideWhenTextChange",()=>{this.hide()});Ee(this,"handleColMouseUpFunc",(async function(){await this.handleColMouseUp(),this.updateColResizer()}).bind(this));Ee(this,"handleRowMouseUpFunc",(function(){this.handleRowMouseUp(),this.updateRowResizer()}).bind(this));this.tableModule=e,this.table=t,this.colResizer=this.tableModule.addContainer(this.bem.be("col")),this.rowResizer=this.tableModule.addContainer(this.bem.be("row")),this.table.addEventListener("mousemove",this.mousemoveHandler),this.quill.on(Xe.events.TEXT_CHANGE,this.hideWhenTextChange)}findTableCell(e){for(let t of e.composedPath()){if(t instanceof HTMLElement&&t.tagName==="TD")return t;if(t===document.body)return null}return null}findCurrentColIndex(){var e;return this.curColIndex+(((e=this.tableCellBlot)==null?void 0:e.colspan)||1)-1}updateColResizer(){if(!this.tableMain||!this.tableCellBlot)return;let e=this.tableCellBlot;this.tableModule.toolBox.removeChild(this.colResizer),this.colResizer=this.tableModule.addContainer(this.bem.be("col"));let[t]=A1(e,[Qe.tableBody]),r=t.domNode.getBoundingClientRect(),i=e.domNode.getBoundingClientRect(),o=this.quill.root.getBoundingClientRect(),l=i.right-o.x;Np(this.tableMain)&&(l=i.left-o.x),Object.assign(this.colResizer.style,{top:`${r.y-o.y}px`,left:`${l}px`,height:`${r.height}px`});let a=this.tableMain.getCols();this.curColIndex=a.findIndex(h=>h.colId===e.colId),this.colResizer.addEventListener("mousedown",this.handleColMouseDownFunc),this.colResizer.addEventListener("dragstart",h=>{h.preventDefault()})}findCurrentRowIndex(){return this.curRowIndex}updateRowResizer(){if(!this.tableMain||!this.tableCellBlot)return;let e=this.tableCellBlot;this.tableModule.toolBox.removeChild(this.rowResizer),this.rowResizer=this.tableModule.addContainer(this.bem.be("row"));let t=e.parent;if(!(t instanceof qh))return;let[r]=A1(e,[Qe.tableBody]),i=r.domNode.getBoundingClientRect(),o=e.domNode.getBoundingClientRect(),l=this.quill.root.getBoundingClientRect();Object.assign(this.rowResizer.style,{top:`${o.bottom-l.y}px`,left:`${i.x-l.x}px`,width:`${i.width}px`});let a=this.tableMain.getRows();this.curRowIndex=a.indexOf(t),this.rowResizer.addEventListener("mousedown",this.handleRowMouseDownFunc),this.rowResizer.addEventListener("dragstart",h=>{h.preventDefault()})}show(){this.rowResizer.classList.remove(this.bem.is("hidden")),this.colResizer.classList.remove(this.bem.is("hidden"))}hide(){this.currentTableCell=void 0,this.rowResizer.classList.add(this.bem.is("hidden")),this.colResizer.classList.add(this.bem.is("hidden"))}update(){this.updateColResizer(),this.updateRowResizer()}destroy(){this.colResizer.remove(),this.rowResizer.remove(),this.table.removeEventListener("mousemove",this.mousemoveHandler),this.quill.off(Xe.events.TEXT_CHANGE,this.hideWhenTextChange)}},VB=class{constructor(n,e,t,r){Ee(this,"scrollHandler",[]);Ee(this,"tableMainBlot",null);Ee(this,"tableWrapperBlot",null);Ee(this,"bem",cu("scale"));Ee(this,"startX",0);Ee(this,"startY",0);Ee(this,"offset",6);Ee(this,"options");Ee(this,"root");Ee(this,"block");Ee(this,"resizeobserver",new ResizeObserver(()=>this.update()));Ee(this,"updateWhenTextChange",()=>{this.update()});this.tableModule=n,this.table=e,this.quill=t,this.options=this.resolveOptions(r),this.tableMainBlot=Xe.find(e),this.tableMainBlot&&!this.tableMainBlot.full&&(this.tableWrapperBlot=this.tableMainBlot.parent,this.buildResizer(),this.show()),this.quill.on(Xe.events.TEXT_CHANGE,this.updateWhenTextChange)}resolveOptions(n){return Object.assign({blockSize:12},n)}buildResizer(){if(!this.tableMainBlot||!this.tableWrapperBlot)return;this.root=this.tableModule.addContainer(this.bem.b()),this.root.classList.add(this.bem.is("hidden")),this.block=document.createElement("div"),this.block.classList.add(this.bem.be("block")),Object.assign(this.block.style,{width:`${this.options.blockSize}px`,height:`${this.options.blockSize}px`}),this.root.appendChild(this.block);let n=[],e=[],t=i=>{if(!this.tableMainBlot)return;let o=Np(this.tableMainBlot)?-1:1,l=(i.clientX-this.startX)*o,a=i.clientY-this.startY,h=Math.floor(l/n.length),g=Math.floor(a/e.length);for(let{blot:m,width:x}of n)m.width=Math.max(x+h,Ss.colMinWidthPx);for(let{blot:m,height:x}of e)m.setHeight(`${Math.max(x+g,Ss.rowMinHeightPx)}px`)},r=()=>{n=[],e=[],document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r)};this.block.addEventListener("mousedown",i=>{!this.tableMainBlot||this.isTableOutofEditor()||(this.startX=i.clientX,this.startY=i.clientY,n=this.tableMainBlot.getCols().map(o=>({blot:o,width:Math.floor(o.width)})),e=this.tableMainBlot.getRows().map(o=>({blot:o,height:Math.floor(o.domNode.getBoundingClientRect().height)})),document.addEventListener("mousemove",t),document.addEventListener("mouseup",r))}),this.block.addEventListener("dragstart",i=>i.preventDefault()),this.resizeobserver.observe(this.tableMainBlot.domNode),gv.call(this,this.quill.root,()=>this.update()),gv.call(this,this.tableWrapperBlot.domNode,()=>this.update())}isTableOutofEditor(){if(!this.tableMainBlot||!this.tableWrapperBlot||this.tableMainBlot.full)return!1;let n=this.tableMainBlot.domNode.getBoundingClientRect(),e=this.tableWrapperBlot.domNode.getBoundingClientRect();if(n.width>e.width){for(let t of this.tableMainBlot.getCols())t.width=Math.floor(t.width/n.width*e.width);return this.tableMainBlot.colWidthFillTable(),!0}return!1}update(){if(!this.block||!this.root||!this.tableMainBlot||!this.tableWrapperBlot)return;if(this.tableMainBlot.full){this.hide();return}let{rect:n,body:e}=qm(this.tableMainBlot);if(!e||!n)return;let t=this.tableWrapperBlot.domNode.getBoundingClientRect(),r=this.quill.root.getBoundingClientRect(),{scrollTop:i,scrollLeft:o}=this.tableWrapperBlot.domNode,l=this.options.blockSize*2+this.offset,a=Math.min(n.width,t.width)+l,h=Math.min(n.height,t.height)+l;Object.assign(this.root.style,{width:`${a}px`,height:`${h}px`,left:`${Math.max(n.x,t.x)-r.x-this.options.blockSize}px`,top:`${Math.max(n.y,t.y)-r.y-this.options.blockSize}px`});let g={left:`${n.width+l-o}px`,top:`${h-i}px`};Np(this.tableMainBlot)?(this.root.classList.add(this.bem.is("align-right")),g.left=`${this.options.blockSize+-1*o}px`):this.root.classList.remove(this.bem.is("align-right")),Object.assign(this.block.style,g)}show(){this.root&&(this.root.classList.remove(this.bem.is("hidden")),this.update())}hide(){this.root&&this.root.classList.add(this.bem.is("hidden"))}destroy(){this.hide(),this.quill.off(Xe.events.TEXT_CHANGE,this.updateWhenTextChange),this.resizeobserver.disconnect(),this.root&&this.root.remove(),J0.call(this)}};const ZB=0;var XB=class{constructor(n,e,t={}){Ee(this,"options");Ee(this,"boundary",null);Ee(this,"scrollRecordEls",[]);Ee(this,"startScrollRecordPosition",[]);Ee(this,"selectedTableScrollX",0);Ee(this,"selectedTableScrollY",0);Ee(this,"selectedEditorScrollX",0);Ee(this,"selectedEditorScrollY",0);Ee(this,"selectedTds",[]);Ee(this,"cellSelectWrap");Ee(this,"cellSelect");Ee(this,"dragging",!1);Ee(this,"scrollHandler",[]);Ee(this,"tableMenu");Ee(this,"resizeObserver");Ee(this,"table");Ee(this,"isDisplaySelection",!1);Ee(this,"bem",cu("selection"));Ee(this,"lastSelection",{anchorNode:null,anchorOffset:0,focusNode:null,focusOffset:0});Ee(this,"updateAfterEvent",()=>{this.updateWithSelectedTds()});Ee(this,"quillSelectionChangeHandler",(n,e,t)=>{if(t!==Xe.sources.API&&n&&!this.quill.composition.isComposing&&this.selectedTds.length>0){let r=this.quill.getFormat(n),[i]=this.quill.getLine(n.index),o=!!r[Qe.tableCellInner]&&!!i,l=this.selectedTds.some(a=>a.children.contains(i));if(o&&!l)try{let a=Kl(i,Qe.tableCellInner);this.selectedTds=[a],this.updateWithSelectedTds()}catch{}else o&&l||this.hide()}});Ee(this,"selectionChangeHandler",()=>{let n=window.getSelection();if(!n)return;let{anchorNode:e,focusNode:t,anchorOffset:r,focusOffset:i}=n;if(!e||!t)return;let o=Xe.find(e),l=Xe.find(t);if(!o||!l||o.scroll!==this.quill.scroll||l.scroll!==this.quill.scroll)return;let a=hw(o),h=hw(l),g=a.has(Qe.tableColgroup),m=h.has(Qe.tableColgroup);if(g||m){let S=e,R=r,k=t,O=i;if(g){let P=a.get(Qe.tableWrapper),z=P.descendants(cf);z.length>0&&(S=z[0].domNode,R=0)}if(m){let P=h.get(Qe.tableWrapper),z=P.descendants(cf);z.length>0&&(k=z[0].domNode,O=0)}this.setSelectionData(n,{anchorNode:S,anchorOffset:R,focusNode:k,focusOffset:O});return}let x=a.has(Qe.tableCellInner),w=h.has(Qe.tableCellInner),_=x&&w;if(_){let S=a.get(Qe.tableCellInner),R=h.get(Qe.tableCellInner);_&&(_=S!==R)}if(x&&w&&_||!x&&w||!w&&x){this.setSelectionData(n,this.lastSelection),this.selectedTds.length>0&&this.hide();return}this.lastSelection={anchorNode:e,anchorOffset:r,focusNode:t,focusOffset:i}});Ee(this,"mouseDownHandler",n=>{let{button:e,target:t,clientX:r,clientY:i}=n,o=t.closest(".ql-table"),l=t.closest("caption");if(e!==0||!o||l)return;this.setSelectionTable(o);let a=o.dataset.tableId,h={x:r,y:i};this.recordScrollPosition(),this.selectedTds=this.computeSelectedTds(h,h),this.dragging=!0,this.show();let g=x=>{this.tableMenu&&this.tableMenu.hide(),this.tableModule.tableResize&&this.tableModule.tableResize.hide();let{button:w,target:_,clientX:S,clientY:R}=x,k=_.closest(".ql-table"),O=_.closest("caption");if(w!==0||O||!k||k.dataset.tableId!==a)return;let P={x:S,y:R};this.selectedTds=this.computeSelectedTds(h,P),this.selectedTds.length>1&&this.quill.blur(),this.update()},m=()=>{document.body.removeEventListener("mousemove",g,!1),document.body.removeEventListener("mouseup",m,!1),this.dragging=!1,this.clearRecordScrollPosition(),this.tableMenu&&this.selectedTds.length>0&&this.tableMenu.show()};document.body.addEventListener("mousemove",g,!1),document.body.addEventListener("mouseup",m,!1)});Ee(this,"removeCell",n=>{let e=this.quill.getSelection(),t=document.activeElement;if(!(e||n.key!=="Backspace"&&n.key!=="Delete"||!this.quill.root.contains(t))){if(this.table){let r=Xe.find(this.table),i=r.descendants(cf);if(this.selectedTds.length===i.length){r.remove();return}}for(let r of this.selectedTds)r.deleteAt(0,r.length()-1)}});this.tableModule=n,this.quill=e,this.options=this.resolveOptions(t),this.scrollRecordEls=[this.quill.root,document.documentElement],this.cellSelectWrap=n.addContainer(this.bem.b()),this.cellSelect=this.helpLinesInitial(),this.resizeObserver=iB(()=>this.updateAfterEvent(),{ignoreFirstBind:!0}),this.resizeObserver.observe(this.quill.root),this.quill.root.addEventListener("mousedown",this.mouseDownHandler,{passive:!1}),document.addEventListener("selectionchange",this.selectionChangeHandler,{passive:!1}),this.quill.on(av.AFTER_TABLE_RESIZE,this.updateAfterEvent),this.quill.on(Xe.events.SELECTION_CHANGE,this.quillSelectionChangeHandler),this.quill.on(Xe.events.TEXT_CHANGE,this.updateAfterEvent),this.options.tableMenu&&(this.tableMenu=new this.options.tableMenu(n,e,this.options.tableMenuOptions)),this.hide()}getFirstTextNode(n){for(let e of Array.from(n.childNodes))if(e.nodeType===Node.TEXT_NODE)return e;return n}getLastTextNode(n){for(let e=n.childNodes.length-1;e>=0;e--){let t=n.childNodes[e];if(t.nodeType===Node.TEXT_NODE)return t}return n}getNodeTailOffset(n){let e=document.createRange();return e.selectNodeContents(n),e.collapse(!1),e.startOffset}setSelectionData(n,e){let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}=e;if(!t||!i)return;let l=document.createRange(),a=this.selectionDirectionUp(e);a?(l.setStart(t,r),l.setEnd(t,r)):(l.setStart(t,r),l.setEnd(i,o)),n.removeAllRanges(),n.addRange(l),a&&n.extend(i,o)}selectionDirectionUp(n){let{anchorNode:e,anchorOffset:t,focusNode:r,focusOffset:i}=n;if(!e||!r)return!1;if(e===r)return t>i;let o=e.compareDocumentPosition(r);return o&Node.DOCUMENT_POSITION_CONTAINS||o&Node.DOCUMENT_POSITION_CONTAINED_BY?(o&Node.DOCUMENT_POSITION_FOLLOWING)!==0:(o&Node.DOCUMENT_POSITION_PRECEDING)!==0}findWrapSelection(n){let e=null,t=0,r=null,i=0;for(let{node:o,offset:l}of n)o&&((!e||this.selectionDirectionUp({anchorNode:e,anchorOffset:t,focusNode:o,focusOffset:l}))&&(e=o,t=l),(!r||this.selectionDirectionUp({anchorNode:o,anchorOffset:l,focusNode:r,focusOffset:i}))&&(r=o,i=l));return{startNode:e,startOffset:t,endNode:r,endOffset:i}}resolveOptions(n){return Object.assign({selectColor:"#0589f340",tableMenuOptions:{}},n)}helpLinesInitial(){this.cellSelectWrap.style.setProperty("--select-color",this.options.selectColor);let n=document.createElement("div");return n.classList.add(this.bem.be("line")),this.cellSelectWrap.appendChild(n),n}computeSelectedTds(n,e){if(!this.table)return[];let t=Xe.find(this.table);if(!t)return[];let r=t.descendants(eg)[0];if(!r)return[];let i=new Set(r.descendants(Nf).map((w,_)=>(w.index=_,w))),o=this.getScrollPositionDiff(),{rect:l}=qm(t);if(!l)return[];let a=n.x+o.x,h=n.y+o.y,g={x:Math.max(l.left,Math.min(e.x,a)),y:Math.max(l.top,Math.min(e.y,h)),x1:Math.min(l.right,Math.max(e.x,a)),y1:Math.min(l.bottom,Math.max(e.y,h))},m=new Set,x=!0;for(;x;){x=!1;for(let w of i){w.__rect||(w.__rect=w.domNode.getBoundingClientRect());let{x:_,y:S,right:R,bottom:k}=w.__rect;if(tB({x:Math.floor(g.x),y:Math.floor(g.y),x1:Math.floor(g.x1),y1:Math.floor(g.y1)},{x:Math.floor(_),y:Math.floor(S),x1:Math.floor(R),y1:Math.floor(k)},ZB,m.size===0)){m.add(w),i.delete(w),g={x:Math.min(g.x,_),y:Math.min(g.y,S),x1:Math.max(g.x1,R),y1:Math.max(g.y1,k)},x=!0;break}}}for(let w of[...m,...i])delete w.__rect;return this.boundary=nB({...g,width:g.x1-g.x,height:g.y1-g.y},this.quill.root),Array.from(m).sort((w,_)=>w.index-_.index).map(w=>(delete w.index,w.getCellInner()))}getScrollPositionDiff(){let{x:n,y:e}=this.getTableViewScroll(),{x:t,y:r}=ap(this.quill.root);return this.selectedTableScrollX=n,this.selectedTableScrollY=e,this.selectedEditorScrollX=t,this.selectedEditorScrollY=r,this.startScrollRecordPosition.reduce((i,{x:o,y:l},a)=>{let{x:h,y:g}=ap(this.scrollRecordEls[a]);return i.x+=o-h,i.y+=l-g,i},{x:0,y:0})}recordScrollPosition(){this.clearRecordScrollPosition();for(let n of this.scrollRecordEls)this.startScrollRecordPosition.push(ap(n))}clearRecordScrollPosition(){this.startScrollRecordPosition=[]}updateWithSelectedTds(){if(this.selectedTds.length<=0)return;let n={x:1/0,y:1/0},e={x:-1/0,y:-1/0};for(let t of this.selectedTds){let r=t.domNode.getBoundingClientRect();n.x=Math.min(n.x,r.left),n.y=Math.min(n.y,r.top),e.x=Math.max(e.x,r.right),e.y=Math.max(e.y,r.bottom)}this.selectedTds=this.computeSelectedTds(n,e),this.selectedTds.length>0?this.update():this.hide()}update(){if(this.selectedTds.length===0||!this.boundary||!this.table)return;let{x:n,y:e}=ap(this.quill.root),{x:t,y:r}=this.getTableViewScroll(),i=this.table.parentElement.getBoundingClientRect(),o=this.quill.root.getBoundingClientRect(),l=i.x-o.x,a=i.y-o.y;Object.assign(this.cellSelect.style,{left:`${this.selectedEditorScrollX*2-n+this.boundary.x+this.selectedTableScrollX-t-l}px`,top:`${this.selectedEditorScrollY*2-e+this.boundary.y+this.selectedTableScrollY-r-a}px`,width:`${this.boundary.width}px`,height:`${this.boundary.height}px`}),Object.assign(this.cellSelectWrap.style,{left:`${l}px`,top:`${a}px`,width:`${i.width}px`,height:`${i.height}px`}),!this.dragging&&this.tableMenu&&this.tableMenu.update()}getTableViewScroll(){return this.table?ap(this.table.parentElement):{x:0,y:0}}setSelectionTable(n){this.table!==n&&(this.table=n,this.table?this.scrollRecordEls.push(this.table.parentElement):this.scrollRecordEls.pop())}showDisplay(){Object.assign(this.cellSelectWrap.style,{display:"block"}),this.isDisplaySelection=!0,this.table&&this.resizeObserver.observe(this.table)}show(){this.table&&(J0.call(this),this.update(),this.showDisplay(),document.addEventListener("keydown",this.removeCell),gv.call(this,this.quill.root,()=>{this.update()}),gv.call(this,this.table.parentElement,()=>{this.update()}))}hideDisplay(){Object.assign(this.cellSelectWrap.style,{display:"none"}),this.isDisplaySelection=!1,this.table&&this.resizeObserver.unobserve(this.table)}hide(){J0.call(this),document.removeEventListener("keydown",this.removeCell),this.hideDisplay(),this.boundary=null,this.selectedTds=[],this.setSelectionTable(void 0),this.tableMenu&&this.tableMenu.hide()}destroy(){this.resizeObserver.disconnect(),this.hide(),this.cellSelectWrap.remove(),this.tableMenu&&this.tableMenu.destroy(),J0.call(this),this.quill.root.removeEventListener("mousedown",this.mouseDownHandler),document.removeEventListener("selectionchange",this.selectionChangeHandler),this.quill.off(Xe.events.SELECTION_CHANGE,this.quillSelectionChangeHandler),this.quill.off(Xe.events.TEXT_CHANGE,this.updateAfterEvent),this.quill.on(av.AFTER_TABLE_RESIZE,this.updateAfterEvent)}};const Aw=Xe.import("parchment"),Yd=Xe.import("delta"),KB=Xe.import("ui/icons"),JB=Xe.import("blots/break"),QB=Xe.import("blots/block"),Rw=Xe.import("blots/block/embed");function qB(n,{tableId:e,rowId:t,colId:r}){let i={tableId:e,rowId:t,colId:r,colspan:1,rowspan:1},o=n.create(Qe.tableCell,i),l=n.create(Qe.tableCellInner,i),a=n.create("block");return a.appendChild(n.create("break")),l.appendChild(a),o.appendChild(l),o}function jB(n,e){return xF({onSelect:(t,r)=>{n.insertTable(t,r),e&&e.close()},customBtn:n.options.customBtn,texts:n.options.texts})}function Iw(n){return{bindInHead:!1,key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:[Qe.tableCellInner],handler(e,t){let r=n?"prev":"next",i=n?"tail":"head";if(t.line[r])return!0;let o=this.quill.selection.getBounds(e.index),l=t.line.domNode.getBoundingClientRect();if(!o||!l)return!0;if(n){if(o.top-l.top>3)return!0}else if(l.bottom-o.bottom>3)return!0;let a,h,g,m;try{[a,h,g,m]=A1(t.line,[Qe.tableWrapper,Qe.tableMain,Qe.tableRow,Qe.tableCell])}catch{return!0}let x=h.getColIds(),w=a.descendants(Q0,0)[0],_;if(w){let R=window.getComputedStyle(w.domNode);_=r==="next"&&R.captionSide==="bottom"?w:r==="next"?a.next:w}else _=a[r];if(t.line[r]||!_)return!0;let S=g[r];if(S){let R=x.indexOf(m.colId),k=S.getCellByColId(x[R],r);if(!k)return!0;let O=k.children[i];O.children&&(O=O.children[i]);let P=O.offset(this.quill.scroll)+Math.min(t.offset,O.length()-1);this.quill.setSelection(P,0,Xe.sources.USER)}else{let R=_.offset(this.quill.scroll)+(n?_.length()-1:0);this.quill.setSelection(R,0,Xe.sources.USER)}return!1}}}var Sd,$B=(Sd=class{constructor(e,t){Ee(this,"quill");Ee(this,"options");Ee(this,"toolBox");Ee(this,"fixTableByLisenter",S_(this.balanceTables,100));Ee(this,"selector");Ee(this,"table");Ee(this,"tableSelection");Ee(this,"tableResize");Ee(this,"tableScrollbar");Ee(this,"tableAlign");Ee(this,"tableResizeScale");Ee(this,"resizeOb");if(this.quill=e,this.options=this.resolveOptions(t||{}),this.toolBox=this.initialContainer(),!this.options.scrollbar){let o=cu("scrollbar");this.quill.container.classList.add(o.bm("origin"))}this.options.selection&&(this.tableSelection=new this.options.selection(this,this.quill,this.options.selectionOptions));let r=this.quill.getModule("toolbar");if(r&&this.quill.theme.pickers){let[,o]=(r.controls||[]).find(([l])=>l===this.statics.toolName)||[];if(o&&o.tagName.toLocaleLowerCase()==="select"){let l=this.quill.theme.pickers.find(a=>a.select===o);l&&(l.label.innerHTML=this.options.icon,this.buildCustomSelect(this.options.customSelect,l),l.label.addEventListener("mousedown",()=>{if(!this.selector||!l)return;let a=this.selector.getBoundingClientRect(),{leftLimited:h}=rB(a);if(h){let g=l.label.getBoundingClientRect();Object.assign(l.options.style,{transform:`translateX(calc(-100% + ${g.width}px))`})}else Object.assign(l.options.style,{transform:void 0})}))}}let i=this.quill.getModule("keyboard");for(let o of Object.values(Sd.keyboradHandler))o.bindInHead?i.bindings[o.key].unshift(o):i.addBinding(o.key,o);this.quill.root.addEventListener("click",o=>{let l=o.composedPath();if(!l||l.length<=0)return;let a=l.find(h=>h.tagName&&h.tagName.toUpperCase()==="TABLE"&&h.classList.contains("ql-table"));if(a){if(this.table===a){this.tableSelection&&this.tableSelection.show(),this.tableAlign&&this.tableAlign.update(),this.tableResize&&this.tableResize.update(),this.tableScrollbar&&this.tableScrollbar.update();return}this.table&&this.hideTableTools(),this.showTableTools(a)}else this.table&&this.hideTableTools()},!1),this.quill.on(Xe.events.EDITOR_CHANGE,o=>{o===Xe.events.TEXT_CHANGE&&(!this.table||!this.quill.root.contains(this.table))&&this.hideTableTools()}),this.quillHack(),this.listenBalanceCells()}static register(){$g.allowedChildren=[Ff],Ff.allowedChildren=[eg,Ag,Q0],Ff.requiredContainer=$g,Q0.requiredContainer=Ff,Ag.allowedChildren=[Ig],Ag.requiredContainer=Ff,eg.allowedChildren=[qh],eg.requiredContainer=Ff,qh.allowedChildren=[Nf],Nf.requiredContainer=eg,Nf.allowedChildren=[cf,JB],Nf.requiredContainer=qh,cf.requiredContainer=Nf;let e=new Set(["table"]),t=Object.entries(Xe.imports).filter(([i,o])=>{let l=i.split("formats/")[1];return i.startsWith("formats/")&&!e.has(l)&&!I0(o,Aw.Attributor)&&(I0(o,QB)||I0(o,Rw))}),r=t.reduce((i,[o,l])=>{let a=I0(l,Rw)?Ew:lm;return i[o]=class extends dF(l,[a]){static register(){}},i},{});Xe.register({"blots/scroll":gB,"blots/block":lm,"blots/block/embed":Ew,...r,[`blots/${Qe.container}`]:dg,[`formats/${Qe.tableCell}`]:Nf,[`formats/${Qe.tableCellInner}`]:cf,[`formats/${Qe.tableRow}`]:qh,[`formats/${Qe.tableBody}`]:eg,[`formats/${Qe.tableCol}`]:Ig,[`formats/${Qe.tableColgroup}`]:Ag,[`formats/${Qe.tableCaption}`]:Q0,[`formats/${Qe.tableMain}`]:Ff,[`formats/${Qe.tableWrapper}`]:$g,"modules/clipboard":SB},!0)}get statics(){return this.constructor}initialContainer(){let e=cu("toolbox"),t=this.quill.addContainer(e.b()),r=()=>{let i=this.quill.root.getBoundingClientRect(),{offsetLeft:o,offsetTop:l}=this.quill.root;Object.assign(t.style,{top:`${l}px`,left:`${o}px`,width:`${i.width}px`,height:`${i.height}px`})};return this.resizeOb=new ResizeObserver(r),this.resizeOb.observe(this.quill.root),t}addContainer(e){if(Lg(e)){let t=document.createElement("div");for(let r of e.split(" "))t.classList.add(r);return this.toolBox.appendChild(t),t}else return this.toolBox.appendChild(e),e}resolveOptions(e){return Object.assign({customBtn:!1,texts:this.resolveTexts(e.texts||{}),full:!1,fullSwitch:!0,icon:KB.table,selectionOptions:{},alignOptions:{},scrollbarOptions:{},resizeOptions:{},resizeScaleOptions:{},autoMergeCell:!0},e)}resolveTexts(e){return Object.assign({fullCheckboxText:"Insert full width table",customBtnText:"Custom",confirmText:"Confirm",cancelText:"Cancel",rowText:"Row",colText:"Column",notPositiveNumberError:"Please enter a positive integer",custom:"Custom",clear:"Clear",transparent:"Transparent",perWidthInsufficient:"The percentage width is insufficient. To complete the operation, the table needs to be converted to a fixed width. Do you want to continue?",CopyCell:"Copy cell",CutCell:"Cut cell",InsertTop:"Insert row above",InsertRight:"Insert column right",InsertBottom:"Insert row below",InsertLeft:"Insert column Left",MergeCell:"Merge Cell",SplitCell:"Split Cell",DeleteRow:"Delete Row",DeleteColumn:"Delete Column",DeleteTable:"Delete table",BackgroundColor:"Set background color",BorderColor:"Set border color"},e)}quillHack(){var i;let e=this.quill.getSemanticHTML;this.quill.getSemanticHTML=(o=0,l)=>{let a=e.call(this.quill,o,l),h=Xe.import(`formats/${Qe.tableWrapper}`),g=new DOMParser,m=g.parseFromString(a,"text/html");for(let x of Array.from(m.querySelectorAll(`.${h.className} caption[contenteditable], .${h.className} td > [contenteditable]`)))x.removeAttribute("contenteditable");return m.body.innerHTML};let t=this.quill.format;this.quill.format=function(o,l,a=Xe.sources.API){if(!(this.scroll.query(o).prototype instanceof Aw.EmbedBlot)){let g=this.getModule(kb.moduleName),m=this.getSelection(!0);if(!this.getFormat(m)[Qe.tableCellInner]||m.length>0||g&&g.tableSelection&&g.tableSelection.selectedTds.length<=1)return t.call(this,o,l,a);if(g&&g.tableSelection&&g.tableSelection.selectedTds.length>0){let w=g.tableSelection.selectedTds,_=!1,S=[];for(let P of w){let z=P.offset(this.scroll),H=P.length();S.push({index:z,length:H}),this.getFormat(z,H)[o]!==l&&(_=!0)}let R=_?l:!1,k=new Yd;for(let[P,{index:z,length:H}]of S.entries()){let G=P===0?0:S[P-1].index+S[P-1].length;k.retain(z-G).retain(H,{[o]:R})}let O=this.updateContents(k,a);return this.blur(),O}}return t.call(this,o,l,a)};let r=this.quill.theme.modules.toolbar;if(r){let o=(i=r.handlers)==null?void 0:i.clean;if(o){let l=(a,h,g=()=>"")=>{let m=this.quill.getText(a,h),[x,w]=this.quill.getLine(a+h),_=0,S=new Yd;x!=null&&(_=x.length()-w,S=x.delta().slice(w,w+_-1).insert(`
459
+ `));let R=this.quill.getContents(a,h+_),k=R.diff(new Yd().insert(m).concat(S)),O=0,P=k.ops.map(z=>{let{attributes:H,...G}=z;if(z.insert?O-=Lg(z.insert)?z.insert.length:1:z.retain?O+=pF(z.retain)?z.retain:1:z.delete&&(O+=z.delete),H){let{[Qe.tableCellInner]:N,...J}=H;if(g){let Y=R.slice(O-1,O).ops[0];if(Y&&Y.attributes&&Y.attributes[Qe.tableCellInner]){let K=Y.attributes[Qe.tableCellInner],{style:fe,...X}=K,te=g(fe);return te?{...G,attributes:{...J,[Qe.tableCellInner]:{style:te,...X}}}:{...G,attributes:{...J,[Qe.tableCellInner]:X}}}}return{...G,attributes:{...J}}}return z});return new Yd(P)};r.handlers.clean=function(a){let h=this.quill.getModule(kb.moduleName),g=this.quill.getSelection();if(g&&g.length>0&&this.quill.getFormat(g)[Qe.tableCellInner]){let x=l(g.index,g.length,!1),w=new Yd().retain(g.index).concat(x);this.quill.updateContents(w,Xe.sources.USER);return}if(h&&h.tableSelection&&h.tableSelection.selectedTds.length>0&&h.tableSelection.table){let m=Xe.find(h.tableSelection.table);if(!m){console.warn("TableMainFormat not found");return}let x=h.tableSelection.selectedTds,w=new Set,_=[];for(let P of x)if(P.parent instanceof Nf){for(let z of P.parent.getNearByCell("top"))w.has(z)||(w.add(z),_.push({td:z,cleanBorder:"bottom"}));for(let z of P.parent.getNearByCell("left"))w.has(z)||(w.add(z),_.push({td:z,cleanBorder:"right"}));w.add(P.parent),_.push({td:P.parent,cleanBorder:!0})}let S=m.descendants(Nf),R=new Map(S.map((P,z)=>[P,z]));_.sort((P,z)=>R.get(P.td)-R.get(z.td));let k=new Yd,O=0;for(let{td:P,cleanBorder:z}of _){let H=P.getCellInner().offset(this.quill.scroll),G=P.getCellInner().length(),N=l(H,G-1,Y=>{if(!Y||z===!0)return"";let K=pv(Y),fe=Object.keys(K).filter(X=>!X.startsWith(k1(`border-${z}`))).reduce((X,te)=>(X[te]=K[te],X),{});return om(fe)}),J=new Yd().retain(H-O).concat(N);k=k.concat(J),O=H+G}this.quill.updateContents(k,Xe.sources.USER),x.length>1&&this.quill.blur();return}return o.call(this,a)}}}}showTableTools(e){var t;e&&(this.table=e,(t=this.tableSelection)==null||t.show(),this.options.align&&(this.tableAlign=new this.options.align(this,e,this.quill,this.options.alignOptions)),this.options.scrollbar&&(this.tableScrollbar=new this.options.scrollbar(this,e,this.quill,this.options.scrollbarOptions)),this.options.resize&&(this.tableResize=new this.options.resize(this,e,this.quill,this.options.resizeOptions)),this.options.resizeScale&&(this.tableResizeScale=new this.options.resizeScale(this,e,this.quill,this.options.resizeScaleOptions)))}hideTableTools(){var e;(e=this.tableSelection)==null||e.hide(),this.tableScrollbar&&(this.tableScrollbar.destroy(),this.tableScrollbar=void 0),this.tableAlign&&(this.tableAlign.destroy(),this.tableAlign=void 0),this.tableResize&&(this.tableResize.destroy(),this.tableResize=void 0),this.tableResizeScale&&this.tableResizeScale.destroy(),this.table=void 0}async buildCustomSelect(e,t){if(!e||!nm(e))return;let r=document.createElement("div");if(r.classList.add("ql-custom-select"),this.selector=await e(this,t),r.appendChild(this.selector),this.options.fullSwitch){let i=cu("creator"),o=document.createElement("label");o.classList.add(i.be("checkbox"));let l=document.createElement("input");l.type="checkbox",l.checked=this.options.full,l.addEventListener("change",()=>{this.options.full=l.checked});let a=document.createElement("span");a.textContent=this.options.texts.fullCheckboxText,o.appendChild(l),o.appendChild(a),r.appendChild(o)}t.options.innerHTML="",t.options.appendChild(r)}setCellAttrs(e,t,r,i=!1){if(e.length!==0)for(let o of e)o.setFormatValue(t,r,i)}getTextByCell(e){let t="";for(let r of e){let i=r.offset(this.quill.scroll),o=r.length();for(let l of this.quill.getContents(i,o).ops)Lg(l.insert)&&(t+=l.insert)}return t}getHTMLByCell(e,t=!1){if(e.length===0)return"";let r=null;try{for(let k of e){let O=Kl(k,Qe.tableMain);if(r||(r=O),O!==r)return console.error("tableMain is not same"),""}}catch{return console.error("tds must be in same tableMain"),""}if(!r)return"";let i=this.quill.getIndex(r),o=r.length(),l=this.quill.getSemanticHTML(i,o),a=new DOMParser,h=a.parseFromString(l,"text/html"),g=[],m=new Set,x=new Set;for(let k of e)m.add(k.colId),x.add(`${k.rowId}-${k.colId}`);for(let k of Array.from(h.querySelectorAll("col")))m.has(k.dataset.colId)?g.push(k.getAttribute("width")):k.remove();let w=0,_=null;for(let k of Array.from(h.querySelectorAll("td")))if(x.has(`${k.dataset.rowId}-${k.dataset.colId}`))_!==k.dataset.rowId&&(w+=1,_=k.dataset.rowId);else{let O=k.parentElement;k.remove(),O&&O.children.length<=0&&O.remove()}let S=Array.from(h.querySelectorAll("col")),R=S.map(k=>Ig.value(k));if(r.full){let k=R.reduce((O,P)=>P.width+O,0);for(let[O,P]of R.entries())P.width=Math.round(P.width/k*100),S[O].setAttribute("width",`${P.width}%`)}else{let k=0;for(let P of R)k+=P.width;let O=h.querySelector("table");O.style.width=`${k}px`}if(t){let k=r.getRows();if(w===k.length)this.removeCol(e);else for(let O of e)O.domNode.innerHTML="<p><br></p>"}return h.body.innerHTML}insertTable(e,t){if(e>=30||t>=30)throw Error("Both rows and columns must be less than 30.");this.quill.focus();let r=this.quill.getSelection();if(r==null)return;let[i]=this.quill.getLeaf(r.index);if(!i)return;if(i_(i))throw Error(`Not supported ${i.statics.blotName} insert into table.`);let o=this.calculateTableCellBorderWidth(),l=getComputedStyle(this.quill.root),a=Number.parseInt(l.paddingLeft),h=Number.parseInt(l.paddingRight),g=Number.parseInt(l.width)-a-h-o,m=Fa(),x=Array(t).fill(0).map(()=>Fa()),w=this.options.full?`${Math.max(1/t*100,Ss.colMinWidthPre)}%`:`${Math.max(Math.floor(g/t),Ss.colMinWidthPx)}px`,_=[{retain:r.index}],S=this.quill.getContents(r.index,1),[,R]=this.quill.getLine(r.index);S.ops[0].insert!==`
460
460
  `&&R!==0&&_.push({insert:`
461
461
  `});for(let k=0;k<t;k++)_.push({insert:{[Qe.tableCol]:{width:w,tableId:m,colId:x[k],full:this.options.full}}});for(let k=0;k<e;k++){let O=Fa();for(let P=0;P<t;P++)_.push({insert:`
462
462
  `,attributes:{[Qe.tableCellInner]:{tableId:m,rowId:O,colId:x[P],rowspan:1,colspan:1}}})}this.quill.updateContents(new Yd(_),Xe.sources.USER),this.quill.setSelection(r.index+t,Xe.sources.SILENT),this.quill.focus()}calculateTableCellBorderWidth(){let e=`
@@ -467,21 +467,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
467
467
  </tr>
468
468
  </tbody>
469
469
  </table>
470
- `,t=document.createElement("div");t.className=$g.className,t.innerHTML=e,t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.visibility="hidden",this.quill.root.appendChild(t);let r=window.getComputedStyle(t.querySelector("td")),i=Number.parseFloat(r.borderWidth)||0;return this.quill.root.removeChild(t),i}fixUnusuaDeletelTable(e){let t=e.getRows(),r=e.getColIds();if(t.length===0)return e.remove();if(r.length===0)return;let i=Array(t.length).fill(0).map(()=>Array(r.length).fill(!1)),o=e.tableId;for(let[l,a]of t.entries()){let h=0,g=0,m=i[l],x=a.descendants(Nf);for(;g<r.length;){if(m[g]){g+=1;continue}let w=x[h];if(!w||w.colId!==r[g])a.insertBefore(QB(this.quill.scroll,{tableId:o,colId:r[g],rowId:a.rowId}),w);else{l+w.rowspan-1>=t.length&&(w.getCellInner().rowspan=t.length-l);let{colspan:_,rowspan:S}=w;if(_>1)for(let R=1;R<_;R++)m[g+R]=!0;if(S>1)for(let R=l+1;R<l+S;R++)for(let k=0;k<_;k++)i[R][g+k]=!0;h+=1}g+=1}if(h<x.length)for(let w=h;w<x.length;w++)x[w].remove()}}balanceTables(){for(let e of this.quill.scroll.descendants(Ff))e.checkEmptyCol(this.options.autoMergeCell),e.checkEmptyRow(this.options.autoMergeCell),this.fixUnusuaDeletelTable(e)}listenBalanceCells(){this.quill.on(Xe.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.fixTableByLisenter(),!0):!1);for(let t of e){let r=t.target;if(r.tagName==="TABLE"){let i=Xe.find(r);if(i){i.sortMergeChildren();break}}}})}deleteTable(e){if(e.length===0)return;let t=Kl(e[0],Qe.tableMain);t&&t.remove(),this.hideTableTools()}appendRow(e,t){if(e.length<=0)return;let r=e[t?e.length-1:0],[i,o,l]=A1(r,[Qe.tableMain,Qe.tableBody,Qe.tableRow]),a=i.getRows(),h=a.indexOf(l),g=h+(t?r.rowspan:0);o.insertRow(g)}appendCol(e,t){if(e.length<=0)return;let[r]=e.reduce((w,_)=>{let S=_.getColumnIndex();return(!t&&S<=w[1]||t&&S>=w[1])&&(w=[_,S]),w},[e[0],e[0].getColumnIndex()]),i=r.getColumnIndex()+(t?r.colspan:0),o=Kl(r,Qe.tableMain),l=o.tableId,a=Fa(),[h]=o.descendants(Ag);h&&h.insertColByIndex(i,{tableId:l,colId:a,width:o.full?6:160,full:o.full});let g=o.getRows(),m=[],x=0;for(let w of Object.values(g)){let _=m.shift()||0;if(x>0){--x;continue}let S=w.insertCell(i-_,{tableId:l,rowId:w.rowId,colId:a,rowspan:1,colspan:1});S.skipRowNum&&(x+=S.skipRowNum);for(let[R,k]of S.entries())m[R]=(m[R]||0)+k}}fixTableByRemove(e){if(!this.options.autoMergeCell)return;let t=e.getRows(),r=e.getCols(),i=r.reduce((h,g)=>(h[g.colId]=0,h),{}),o=[...t].reverse(),l=[];for(let[h,g]of o.entries()){let m=t.length-h-1;g.children.length<=0?l.push(m):g.foreachCellInner(x=>{let w=l.reduce((_,S)=>x.rowspan+m>S?_+1:_,0);x.rowspan-=w,i[x.colId]+=1})}let a=0;for(let h of Object.values(i))if(h===0){let g=[],m=0;for(let x of Object.values(t)){let w=g.shift()||0,_=[];m>0?(_=x.getCellByColumIndex(a-w)[2],--m):(_=x.removeCell(a-w),_.skipRowNum&&(m+=_.skipRowNum));for(let[S,R]of _.entries())g[S]=(g[S]||0)+R}}else a+=1;for(let h of r)i[h.colId]===0&&(h.prev?h.prev.width+=h.width:h.next&&(h.next.width+=h.width),h.remove())}removeRow(e){if(e.length<=0)return;let t=e[0],r=Kl(t,Qe.tableMain),i=r.getRows(),o=i.length,l=-1;for(let h of e){let g=Kl(h,Qe.tableRow),m=i.indexOf(g);m<o&&(o=m),m+h.rowspan>l&&(l=m+h.rowspan)}let a={};for(let h=o;h<Math.min(i.length,l);h++){let g=i[h];g.foreachCellInner(m=>{m.rowspan+h>l&&(a[m.colId]={rowspan:m.rowspan+h-l,colspan:m.colspan,colIndex:m.getColumnIndex()}),m.parent.remove()}),g.length()===0&&g.remove()}if(i[l]){let h=i[l],g=r.tableId;for(let[m,{colIndex:x,colspan:w,rowspan:_}]of Object.entries(a))h.insertCell(x,{tableId:g,rowId:h.rowId,colId:m,colspan:w,rowspan:_})}this.fixTableByRemove(r)}removeCol(e){if(e.length<=0)return;let t=e[0],r=Kl(t,Qe.tableMain),i={};for(let g of e)i[g.rowId]||(i[g.rowId]=0),i[g.rowId]+=g.colspan;let o=Math.max(...Object.values(i)),l=t.getColumnIndex(),a=r.descendants(qh);for(let g=0;g<o;g++){let m=[],x=0;for(let w of Object.values(a)){let _=m.shift()||0;if(x>0){--x;continue}let S=w.removeCell(l-_);S.skipRowNum&&(x+=S.skipRowNum);for(let[R,k]of S.entries())m[R]=(m[R]||0)+k}}let[h]=r.descendants(Ag);if(h)for(let g=0;g<o;g++)h.removeColByIndex(l);this.fixTableByRemove(r)}mergeCells(e){if(e.length<=1)return;let t=e.reduce((a,h,g)=>{let m=h.colId;a[0][m]||(a[0][m]=0),a[0][m]+=h.rowspan;let x=h.rowId;return a[1][x]||(a[1][x]=0),a[1][x]+=h.colspan,g!==0&&(h.moveChildren(a[2]),h.parent.remove()),a},[{},{},e[0]]),r=Math.max(...Object.values(t[0])),i=Math.max(...Object.values(t[1])),o=t[2];o.colspan=i,o.rowspan=r;let l=Kl(o,Qe.tableMain);this.fixTableByRemove(l)}splitCell(e){if(e.length!==1)return;let t=e[0];if(t.colspan===1&&t.rowspan===1)return;let[r,i]=A1(t,[Qe.tableMain,Qe.tableRow]),o=r.tableId,l=t.getColumnIndex(),a=r.getColIds().slice(l,l+t.colspan).reverse(),h=t.formats()[Qe.tableCellInner].style,g=i,m=t.rowspan;for(t.colspan=1,t.rowspan=1;g&&m>0;){for(let x of a){if(g===i&&x===t.colId)continue;let w={tableId:o,rowId:g.rowId,colId:x,rowspan:1,colspan:1};h&&(w.style=h),g.insertCell(l+(g===i?1:0),w)}--m,g=g.next}}},Ee(Sd,"moduleName",kb.moduleName),Ee(Sd,"toolName",Qe.tableWrapper),Ee(Sd,"keyboradHandler",{"forbid remove table by backspace":{bindInHead:!0,key:"Backspace",collapsed:!0,offset:0,handler(e,t){let r=this.quill.getLine(e.index),i=r[0];return i.prev instanceof $g?(i.prev.remove(),!1):!(t.format[Qe.tableCellInner]&&i.offset(Kl(i,Qe.tableCellInner))===0)}},"forbid remove table by delete":{bindInHead:!0,key:"Delete",collapsed:!0,handler(e,t){let r=this.quill.getLine(e.index),i=r[0],o=r[1];if((i.next instanceof $g||i.next instanceof Ig)&&o===i.length()-1)return!1;if(t.format[Qe.tableCellInner]){let l=Kl(i,Qe.tableCellInner);if(i===l.children.tail&&o===i.length()-1)return!1}return!0}},"table up":Iw(!0),"table down":Iw(!1),"table caption break":{bindInHead:!0,key:"Enter",shiftKey:null,format:[Qe.tableCaption],handler(e,t){return!1}}}),Sd),E_=jB;const $B="_AEditorWrapper_gy9qb_1",ez="_AEditorContainer_gy9qb_7",tz="_AEditor_gy9qb_1",nz="_Primary_gy9qb_24",rz="_ReadOnly_gy9qb_54",iz="_Raw_gy9qb_128",oz="_LimitContainer_gy9qb_145",lz="_Limit_gy9qb_145",sz="_Indicator_gy9qb_168",az="_Resizer_gy9qb_176",af={AEditorWrapper:$B,AEditorContainer:ez,AEditor:tz,Primary:nz,"ql-toolbar":"_ql-toolbar_gy9qb_24","ql-snow":"_ql-snow_gy9qb_24",ReadOnly:rz,Error:"_Error_gy9qb_91",Raw:iz,LimitContainer:oz,Limit:lz,Indicator:sz,Resizer:az,"ql-image-resizer-overlay":"_ql-image-resizer-overlay_gy9qb_209","ql-image-resizer-handle":"_ql-image-resizer-handle_gy9qb_216","ql-image-resizer-display":"_ql-image-resizer-display_gy9qb_226","ql-image-resizer-toolbar":"_ql-image-resizer-toolbar_gy9qb_237","ql-image-resizer-toolbar-button":"_ql-image-resizer-toolbar-button_gy9qb_245"};class cz{constructor(e,t={}){Ee(this,"quill");Ee(this,"cleanupFunctions",[]);this.quill=e,t.isTitleMode&&this.setupTitleModePaste()}setupTitleModePaste(){const e=this.quill.root,t=r=>{if(r.preventDefault(),!r.clipboardData)return;const i=r.clipboardData.getData("text/html"),o=r.clipboardData.getData("text/plain"),l=this.quill.getSelection(!0);if(l)if(l.length>0&&this.quill.deleteText(l.index,l.length,Xe.sources.USER),i){const a=document.createElement("div");a.innerHTML=i,this.replaceBreaksWithSpaces(a);const g=this.quill.getModule("clipboard").convert({html:a.innerHTML});this.quill.updateContents(g,Xe.sources.USER),setTimeout(()=>{const m=g.reduce((x,w)=>x+(typeof w.insert=="string"?w.insert.length:1),0);this.quill.setSelection(l.index+m,0,Xe.sources.SILENT)},0)}else{const a=o.replace(/[\r\n]+/g," ").trim();this.quill.insertText(l.index,a,Xe.sources.USER),this.quill.setSelection(l.index+a.length,0,Xe.sources.SILENT)}};e.addEventListener("paste",t,{capture:!0}),this.cleanupFunctions.push(()=>{e.removeEventListener("paste",t,{capture:!0})})}replaceBreaksWithSpaces(e){var i,o;const t=l=>{var a;if(l.nodeType===Node.TEXT_NODE)l.textContent=((a=l.textContent)==null?void 0:a.replace(/[\r\n]+/g," "))??"";else for(const h of Array.from(l.childNodes))t(h)};t(e);const r=e.querySelectorAll("br, p, div");for(const l of Array.from(r))l.tagName==="BR"?(i=l.parentNode)==null||i.replaceChild(document.createTextNode(" "),l):(l.tagName==="P"||l.tagName==="DIV")&&l.nextSibling&&!((o=l.textContent)!=null&&o.endsWith(" "))&&l.appendChild(document.createTextNode(" "));e.innerHTML=e.innerHTML.replace(/\s+$/,""),e.innerHTML=e.innerHTML.replace(/\s{2,}/g," ")}destroy(){this.cleanupFunctions.forEach(e=>e()),this.cleanupFunctions=[]}async copyContent(e){var t;try{const r=this.quill.getText(),i=this.quill.root.innerHTML;return this.copyToClipboard(r,i,e)}catch(r){return console.error("Error in copyContent:",r),(t=e==null?void 0:e.onError)==null||t.call(e),!1}}async copyToClipboard(e,t,r){var i,o;try{return await this.tryModernClipboardWithHtml(e,t,r)||await this.tryModernClipboardText(e,r)||t&&this.tryLegacyClipboardWithHtml(t,r)||this.tryLegacyClipboardText(e,r)?!0:((i=r==null?void 0:r.onError)==null||i.call(r),!1)}catch(l){return console.error("복사 중 오류 발생:",l),(o=r==null?void 0:r.onError)==null||o.call(r),!1}}async tryModernClipboardWithHtml(e,t,r){var i;if(!navigator.clipboard||!t||!window.ClipboardItem||!window.isSecureContext)return!1;try{return await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]),(i=r==null?void 0:r.onSuccess)==null||i.call(r),!0}catch{return!1}}async tryModernClipboardText(e,t){var r;if(!navigator.clipboard||!window.isSecureContext)return!1;try{return await navigator.clipboard.writeText(e),(r=t==null?void 0:t.onSuccess)==null||r.call(t),!0}catch{return!1}}tryLegacyClipboardWithHtml(e,t){const r=document.createElement("div");r.innerHTML=e,r.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(r);try{const i=document.createRange();i.selectNodeContents(r);const o=window.getSelection();return o?(o.removeAllRanges(),o.addRange(i),this.tryClipboardEventCopy({html:e,text:r.textContent??""},t)):!1}finally{document.body.removeChild(r)}}tryLegacyClipboardText(e,t){const r=document.createElement("textarea");r.value=e,r.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(r);try{return r.focus(),r.select(),this.tryClipboardEventCopy({text:e},t)}finally{document.body.removeChild(r)}}tryClipboardEventCopy(e,t){var o;let r=!1;const i=l=>{l.preventDefault(),l.clipboardData&&(l.clipboardData.setData("text/plain",e.text),e.html&&l.clipboardData.setData("text/html",e.html),r=!0)};document.addEventListener("copy",i);try{const l=new ClipboardEvent("copy",{clipboardData:new DataTransfer});if(document.dispatchEvent(l),r)return(o=t==null?void 0:t.onSuccess)==null||o.call(t),!0}catch{return!1}return document.removeEventListener("copy",i),!1}}const uz=Xe.import("blots/block/embed"),fz=Xe.import("ui/icons");fz.divider=a1.renderToString(M.jsx(fo,{icon:"Minus",strokeWidth:2.5,width:"100%"}));class am extends uz{static create(e){const t=super.create(e);return t.style.border="var(--AEditor_Addon_Primary_border)",t.style.borderBottom="none",t.style.transition="border var(--Transition)",t}}Ee(am,"blotName","divider"),Ee(am,"tagName","hr");class hz{constructor(e,t){this.debug=e,this.suppressErrorLogging=t}prefixString(){return"</> quill-image-compress: "}get log(){return this.debug?console.warn.bind(console,this.prefixString()):()=>{}}get error(){return this.suppressErrorLogging?()=>{}:console.error.bind(console,this.prefixString())}get warn(){return this.suppressErrorLogging?()=>{}:console.warn.bind(console,this.prefixString())}}async function T_(n){const e=new FileReader,t=new Promise((r,i)=>{e.addEventListener("load",()=>{const o=e.result;typeof o=="string"?r(o):i(new Error("could not convert file to base64"))},!1)});return e.readAsDataURL(n),t}function dz(n,e,t,r){if(t&&r&&n<=t&&e<=r)return[n,e];if(t&&n>t){const i=t,o=Math.floor(e/n*i);if(r&&o>r){const l=r;return[Math.floor(n/e*l),l]}else return[i,o]}if(r&&e>r){const i=r;return[Math.floor(n/e*i),i]}return[n,e]}async function gz(n,e,t={}){const r=e.split(";")[0].split(":")[1],{maxWidth:i,maxHeight:o,imageType:l="image/jpeg",keepImageTypes:a,ignoreImageTypes:h,imageQuality:g=.7}=t,m=new Image;m.src=e,await new Promise(k=>{m.onload=()=>{k()}});const[x,w]=dz(m.width,m.height,i,o),_=document.createElement("canvas");_.width=x,_.height=w;const S=_.getContext("2d");if(l==="image/jpeg"&&(S.fillStyle="#FFFFFF",S.fillRect(0,0,m.width,m.height)),h!=null&&h.includes(r))return e;a!=null&&a.includes(r)&&(t.imageType=r),S.drawImage(m,0,0,x,w);const R=_.toDataURL(t.imageType??l,g);return n.log("downscaling image...",{args:{dataUrl:e,...t},newHeight:w,newWidth:x}),R}function pz(n,e){n.maxWidth??(n.maxWidth=1e3),n.maxHeight??(n.maxHeight=1e3),vz(n,e),bz(n,e),yz(n,e),mz(n,e),xz(n,e)}function vz(n,e){n.maxWidth&&typeof n.maxWidth!="number"&&(e.warn(`[config error] 'maxWidth' is required to be a "number" (in pixels),
470
+ `,t=document.createElement("div");t.className=$g.className,t.innerHTML=e,t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.visibility="hidden",this.quill.root.appendChild(t);let r=window.getComputedStyle(t.querySelector("td")),i=Number.parseFloat(r.borderWidth)||0;return this.quill.root.removeChild(t),i}fixUnusuaDeletelTable(e){let t=e.getRows(),r=e.getColIds();if(t.length===0)return e.remove();if(r.length===0)return;let i=Array(t.length).fill(0).map(()=>Array(r.length).fill(!1)),o=e.tableId;for(let[l,a]of t.entries()){let h=0,g=0,m=i[l],x=a.descendants(Nf);for(;g<r.length;){if(m[g]){g+=1;continue}let w=x[h];if(!w||w.colId!==r[g])a.insertBefore(qB(this.quill.scroll,{tableId:o,colId:r[g],rowId:a.rowId}),w);else{l+w.rowspan-1>=t.length&&(w.getCellInner().rowspan=t.length-l);let{colspan:_,rowspan:S}=w;if(_>1)for(let R=1;R<_;R++)m[g+R]=!0;if(S>1)for(let R=l+1;R<l+S;R++)for(let k=0;k<_;k++)i[R][g+k]=!0;h+=1}g+=1}if(h<x.length)for(let w=h;w<x.length;w++)x[w].remove()}}balanceTables(){for(let e of this.quill.scroll.descendants(Ff))e.checkEmptyCol(this.options.autoMergeCell),e.checkEmptyRow(this.options.autoMergeCell),this.fixUnusuaDeletelTable(e)}listenBalanceCells(){this.quill.on(Xe.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.fixTableByLisenter(),!0):!1);for(let t of e){let r=t.target;if(r.tagName==="TABLE"){let i=Xe.find(r);if(i){i.sortMergeChildren();break}}}})}deleteTable(e){if(e.length===0)return;let t=Kl(e[0],Qe.tableMain);t&&t.remove(),this.hideTableTools()}appendRow(e,t){if(e.length<=0)return;let r=e[t?e.length-1:0],[i,o,l]=A1(r,[Qe.tableMain,Qe.tableBody,Qe.tableRow]),a=i.getRows(),h=a.indexOf(l),g=h+(t?r.rowspan:0);o.insertRow(g)}appendCol(e,t){if(e.length<=0)return;let[r]=e.reduce((w,_)=>{let S=_.getColumnIndex();return(!t&&S<=w[1]||t&&S>=w[1])&&(w=[_,S]),w},[e[0],e[0].getColumnIndex()]),i=r.getColumnIndex()+(t?r.colspan:0),o=Kl(r,Qe.tableMain),l=o.tableId,a=Fa(),[h]=o.descendants(Ag);h&&h.insertColByIndex(i,{tableId:l,colId:a,width:o.full?6:160,full:o.full});let g=o.getRows(),m=[],x=0;for(let w of Object.values(g)){let _=m.shift()||0;if(x>0){--x;continue}let S=w.insertCell(i-_,{tableId:l,rowId:w.rowId,colId:a,rowspan:1,colspan:1});S.skipRowNum&&(x+=S.skipRowNum);for(let[R,k]of S.entries())m[R]=(m[R]||0)+k}}fixTableByRemove(e){if(!this.options.autoMergeCell)return;let t=e.getRows(),r=e.getCols(),i=r.reduce((h,g)=>(h[g.colId]=0,h),{}),o=[...t].reverse(),l=[];for(let[h,g]of o.entries()){let m=t.length-h-1;g.children.length<=0?l.push(m):g.foreachCellInner(x=>{let w=l.reduce((_,S)=>x.rowspan+m>S?_+1:_,0);x.rowspan-=w,i[x.colId]+=1})}let a=0;for(let h of Object.values(i))if(h===0){let g=[],m=0;for(let x of Object.values(t)){let w=g.shift()||0,_=[];m>0?(_=x.getCellByColumIndex(a-w)[2],--m):(_=x.removeCell(a-w),_.skipRowNum&&(m+=_.skipRowNum));for(let[S,R]of _.entries())g[S]=(g[S]||0)+R}}else a+=1;for(let h of r)i[h.colId]===0&&(h.prev?h.prev.width+=h.width:h.next&&(h.next.width+=h.width),h.remove())}removeRow(e){if(e.length<=0)return;let t=e[0],r=Kl(t,Qe.tableMain),i=r.getRows(),o=i.length,l=-1;for(let h of e){let g=Kl(h,Qe.tableRow),m=i.indexOf(g);m<o&&(o=m),m+h.rowspan>l&&(l=m+h.rowspan)}let a={};for(let h=o;h<Math.min(i.length,l);h++){let g=i[h];g.foreachCellInner(m=>{m.rowspan+h>l&&(a[m.colId]={rowspan:m.rowspan+h-l,colspan:m.colspan,colIndex:m.getColumnIndex()}),m.parent.remove()}),g.length()===0&&g.remove()}if(i[l]){let h=i[l],g=r.tableId;for(let[m,{colIndex:x,colspan:w,rowspan:_}]of Object.entries(a))h.insertCell(x,{tableId:g,rowId:h.rowId,colId:m,colspan:w,rowspan:_})}this.fixTableByRemove(r)}removeCol(e){if(e.length<=0)return;let t=e[0],r=Kl(t,Qe.tableMain),i={};for(let g of e)i[g.rowId]||(i[g.rowId]=0),i[g.rowId]+=g.colspan;let o=Math.max(...Object.values(i)),l=t.getColumnIndex(),a=r.descendants(qh);for(let g=0;g<o;g++){let m=[],x=0;for(let w of Object.values(a)){let _=m.shift()||0;if(x>0){--x;continue}let S=w.removeCell(l-_);S.skipRowNum&&(x+=S.skipRowNum);for(let[R,k]of S.entries())m[R]=(m[R]||0)+k}}let[h]=r.descendants(Ag);if(h)for(let g=0;g<o;g++)h.removeColByIndex(l);this.fixTableByRemove(r)}mergeCells(e){if(e.length<=1)return;let t=e.reduce((a,h,g)=>{let m=h.colId;a[0][m]||(a[0][m]=0),a[0][m]+=h.rowspan;let x=h.rowId;return a[1][x]||(a[1][x]=0),a[1][x]+=h.colspan,g!==0&&(h.moveChildren(a[2]),h.parent.remove()),a},[{},{},e[0]]),r=Math.max(...Object.values(t[0])),i=Math.max(...Object.values(t[1])),o=t[2];o.colspan=i,o.rowspan=r;let l=Kl(o,Qe.tableMain);this.fixTableByRemove(l)}splitCell(e){if(e.length!==1)return;let t=e[0];if(t.colspan===1&&t.rowspan===1)return;let[r,i]=A1(t,[Qe.tableMain,Qe.tableRow]),o=r.tableId,l=t.getColumnIndex(),a=r.getColIds().slice(l,l+t.colspan).reverse(),h=t.formats()[Qe.tableCellInner].style,g=i,m=t.rowspan;for(t.colspan=1,t.rowspan=1;g&&m>0;){for(let x of a){if(g===i&&x===t.colId)continue;let w={tableId:o,rowId:g.rowId,colId:x,rowspan:1,colspan:1};h&&(w.style=h),g.insertCell(l+(g===i?1:0),w)}--m,g=g.next}}},Ee(Sd,"moduleName",kb.moduleName),Ee(Sd,"toolName",Qe.tableWrapper),Ee(Sd,"keyboradHandler",{"forbid remove table by backspace":{bindInHead:!0,key:"Backspace",collapsed:!0,offset:0,handler(e,t){let r=this.quill.getLine(e.index),i=r[0];return i.prev instanceof $g?(i.prev.remove(),!1):!(t.format[Qe.tableCellInner]&&i.offset(Kl(i,Qe.tableCellInner))===0)}},"forbid remove table by delete":{bindInHead:!0,key:"Delete",collapsed:!0,handler(e,t){let r=this.quill.getLine(e.index),i=r[0],o=r[1];if((i.next instanceof $g||i.next instanceof Ig)&&o===i.length()-1)return!1;if(t.format[Qe.tableCellInner]){let l=Kl(i,Qe.tableCellInner);if(i===l.children.tail&&o===i.length()-1)return!1}return!0}},"table up":Iw(!0),"table down":Iw(!1),"table caption break":{bindInHead:!0,key:"Enter",shiftKey:null,format:[Qe.tableCaption],handler(e,t){return!1}}}),Sd),E_=$B;const ez="_AEditorWrapper_gy9qb_1",tz="_AEditorContainer_gy9qb_7",nz="_AEditor_gy9qb_1",rz="_Primary_gy9qb_24",iz="_ReadOnly_gy9qb_54",oz="_Raw_gy9qb_128",lz="_LimitContainer_gy9qb_145",sz="_Limit_gy9qb_145",az="_Indicator_gy9qb_168",cz="_Resizer_gy9qb_176",af={AEditorWrapper:ez,AEditorContainer:tz,AEditor:nz,Primary:rz,"ql-toolbar":"_ql-toolbar_gy9qb_24","ql-snow":"_ql-snow_gy9qb_24",ReadOnly:iz,Error:"_Error_gy9qb_91",Raw:oz,LimitContainer:lz,Limit:sz,Indicator:az,Resizer:cz,"ql-image-resizer-overlay":"_ql-image-resizer-overlay_gy9qb_209","ql-image-resizer-handle":"_ql-image-resizer-handle_gy9qb_216","ql-image-resizer-display":"_ql-image-resizer-display_gy9qb_226","ql-image-resizer-toolbar":"_ql-image-resizer-toolbar_gy9qb_237","ql-image-resizer-toolbar-button":"_ql-image-resizer-toolbar-button_gy9qb_245"};class uz{constructor(e,t={}){Ee(this,"quill");Ee(this,"cleanupFunctions",[]);this.quill=e,t.isTitleMode&&this.setupTitleModePaste()}setupTitleModePaste(){const e=this.quill.root,t=r=>{if(r.preventDefault(),!r.clipboardData)return;const i=r.clipboardData.getData("text/html"),o=r.clipboardData.getData("text/plain"),l=this.quill.getSelection(!0);if(l)if(l.length>0&&this.quill.deleteText(l.index,l.length,Xe.sources.USER),i){const a=document.createElement("div");a.innerHTML=i,this.replaceBreaksWithSpaces(a);const g=this.quill.getModule("clipboard").convert({html:a.innerHTML});this.quill.updateContents(g,Xe.sources.USER),setTimeout(()=>{const m=g.reduce((x,w)=>x+(typeof w.insert=="string"?w.insert.length:1),0);this.quill.setSelection(l.index+m,0,Xe.sources.SILENT)},0)}else{const a=o.replace(/[\r\n]+/g," ").trim();this.quill.insertText(l.index,a,Xe.sources.USER),this.quill.setSelection(l.index+a.length,0,Xe.sources.SILENT)}};e.addEventListener("paste",t,{capture:!0}),this.cleanupFunctions.push(()=>{e.removeEventListener("paste",t,{capture:!0})})}replaceBreaksWithSpaces(e){var i,o;const t=l=>{var a;if(l.nodeType===Node.TEXT_NODE)l.textContent=((a=l.textContent)==null?void 0:a.replace(/[\r\n]+/g," "))??"";else for(const h of Array.from(l.childNodes))t(h)};t(e);const r=e.querySelectorAll("br, p, div");for(const l of Array.from(r))l.tagName==="BR"?(i=l.parentNode)==null||i.replaceChild(document.createTextNode(" "),l):(l.tagName==="P"||l.tagName==="DIV")&&l.nextSibling&&!((o=l.textContent)!=null&&o.endsWith(" "))&&l.appendChild(document.createTextNode(" "));e.innerHTML=e.innerHTML.replace(/\s+$/,""),e.innerHTML=e.innerHTML.replace(/\s{2,}/g," ")}destroy(){this.cleanupFunctions.forEach(e=>e()),this.cleanupFunctions=[]}async copyContent(e){var t;try{const r=this.quill.getText(),i=this.quill.root.innerHTML;return this.copyToClipboard(r,i,e)}catch(r){return console.error("Error in copyContent:",r),(t=e==null?void 0:e.onError)==null||t.call(e),!1}}async copyToClipboard(e,t,r){var i,o;try{return await this.tryModernClipboardWithHtml(e,t,r)||await this.tryModernClipboardText(e,r)||t&&this.tryLegacyClipboardWithHtml(t,r)||this.tryLegacyClipboardText(e,r)?!0:((i=r==null?void 0:r.onError)==null||i.call(r),!1)}catch(l){return console.error("복사 중 오류 발생:",l),(o=r==null?void 0:r.onError)==null||o.call(r),!1}}async tryModernClipboardWithHtml(e,t,r){var i;if(!navigator.clipboard||!t||!window.ClipboardItem||!window.isSecureContext)return!1;try{return await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]),(i=r==null?void 0:r.onSuccess)==null||i.call(r),!0}catch{return!1}}async tryModernClipboardText(e,t){var r;if(!navigator.clipboard||!window.isSecureContext)return!1;try{return await navigator.clipboard.writeText(e),(r=t==null?void 0:t.onSuccess)==null||r.call(t),!0}catch{return!1}}tryLegacyClipboardWithHtml(e,t){const r=document.createElement("div");r.innerHTML=e,r.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(r);try{const i=document.createRange();i.selectNodeContents(r);const o=window.getSelection();return o?(o.removeAllRanges(),o.addRange(i),this.tryClipboardEventCopy({html:e,text:r.textContent??""},t)):!1}finally{document.body.removeChild(r)}}tryLegacyClipboardText(e,t){const r=document.createElement("textarea");r.value=e,r.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(r);try{return r.focus(),r.select(),this.tryClipboardEventCopy({text:e},t)}finally{document.body.removeChild(r)}}tryClipboardEventCopy(e,t){var o;let r=!1;const i=l=>{l.preventDefault(),l.clipboardData&&(l.clipboardData.setData("text/plain",e.text),e.html&&l.clipboardData.setData("text/html",e.html),r=!0)};document.addEventListener("copy",i);try{const l=new ClipboardEvent("copy",{clipboardData:new DataTransfer});if(document.dispatchEvent(l),r)return(o=t==null?void 0:t.onSuccess)==null||o.call(t),!0}catch{return!1}return document.removeEventListener("copy",i),!1}}const fz=Xe.import("blots/block/embed"),hz=Xe.import("ui/icons");hz.divider=a1.renderToString(M.jsx(fo,{icon:"Minus",strokeWidth:2.5,width:"100%"}));class am extends fz{static create(e){const t=super.create(e);return t.style.border="var(--AEditor_Addon_Primary_border)",t.style.borderBottom="none",t.style.transition="border var(--Transition)",t}}Ee(am,"blotName","divider"),Ee(am,"tagName","hr");class dz{constructor(e,t){this.debug=e,this.suppressErrorLogging=t}prefixString(){return"</> quill-image-compress: "}get log(){return this.debug?console.warn.bind(console,this.prefixString()):()=>{}}get error(){return this.suppressErrorLogging?()=>{}:console.error.bind(console,this.prefixString())}get warn(){return this.suppressErrorLogging?()=>{}:console.warn.bind(console,this.prefixString())}}async function T_(n){const e=new FileReader,t=new Promise((r,i)=>{e.addEventListener("load",()=>{const o=e.result;typeof o=="string"?r(o):i(new Error("could not convert file to base64"))},!1)});return e.readAsDataURL(n),t}function gz(n,e,t,r){if(t&&r&&n<=t&&e<=r)return[n,e];if(t&&n>t){const i=t,o=Math.floor(e/n*i);if(r&&o>r){const l=r;return[Math.floor(n/e*l),l]}else return[i,o]}if(r&&e>r){const i=r;return[Math.floor(n/e*i),i]}return[n,e]}async function pz(n,e,t={}){const r=e.split(";")[0].split(":")[1],{maxWidth:i,maxHeight:o,imageType:l="image/jpeg",keepImageTypes:a,ignoreImageTypes:h,imageQuality:g=.7}=t,m=new Image;m.src=e,await new Promise(k=>{m.onload=()=>{k()}});const[x,w]=gz(m.width,m.height,i,o),_=document.createElement("canvas");_.width=x,_.height=w;const S=_.getContext("2d");if(l==="image/jpeg"&&(S.fillStyle="#FFFFFF",S.fillRect(0,0,m.width,m.height)),h!=null&&h.includes(r))return e;a!=null&&a.includes(r)&&(t.imageType=r),S.drawImage(m,0,0,x,w);const R=_.toDataURL(t.imageType??l,g);return n.log("downscaling image...",{args:{dataUrl:e,...t},newHeight:w,newWidth:x}),R}function vz(n,e){n.maxWidth??(n.maxWidth=1e3),n.maxHeight??(n.maxHeight=1e3),bz(n,e),yz(n,e),mz(n,e),xz(n,e),wz(n,e)}function bz(n,e){n.maxWidth&&typeof n.maxWidth!="number"&&(e.warn(`[config error] 'maxWidth' is required to be a "number" (in pixels),
471
471
  received: ${n.maxWidth}
472
472
  -> using default 1000`),n.maxWidth=1e3),n.maxHeight&&typeof n.maxHeight!="number"&&(e.warn(`[config error] 'maxHeight' is required to be a "number" (in pixels),
473
473
  received: ${n.maxHeight}
474
- -> using default 1000`),n.maxHeight=1e3)}function bz(n,e){n.quality&&typeof n.quality!="number"&&(e.warn(`quill.imageCompressor: [config error] 'quality' is required to be a "number",
474
+ -> using default 1000`),n.maxHeight=1e3)}function yz(n,e){n.quality&&typeof n.quality!="number"&&(e.warn(`quill.imageCompressor: [config error] 'quality' is required to be a "number",
475
475
  received: ${n.quality}
476
- -> using default 0.7`),n.quality=.7)}function yz(n,e){n.imageType&&(typeof n.imageType!="string"||!n.imageType.startsWith("image/"))&&(e.warn(`quill.imageCompressor: [config error] 'imageType' is required be in the form of "image/png" or "image/jpeg" etc ...,
476
+ -> using default 0.7`),n.quality=.7)}function mz(n,e){n.imageType&&(typeof n.imageType!="string"||!n.imageType.startsWith("image/"))&&(e.warn(`quill.imageCompressor: [config error] 'imageType' is required be in the form of "image/png" or "image/jpeg" etc ...,
477
477
  received: ${n.imageType}
478
- -> using default image/jpeg`),n.imageType="image/jpeg")}function mz(n,e){n.keepImageTypes??(n.keepImageTypes=[]),n.keepImageTypes&&!Array.isArray(n.keepImageTypes)&&(e.warn(`quill.imageCompressor: [config error] 'keepImageTypes' is required to be a "array", received: ${n.keepImageTypes} -> using default []`),n.keepImageTypes=[]),n.ignoreImageTypes??(n.ignoreImageTypes=[]),n.ignoreImageTypes&&!Array.isArray(n.ignoreImageTypes)&&(e.warn(`quill.imageCompressor: [config error] 'ignoreImageTypes' is required to be a "array", received: ${n.ignoreImageTypes} -> using default []`),n.ignoreImageTypes=[])}function xz(n,e){n.handleOnPaste&&typeof n.handleOnPaste!="boolean"&&typeof n.handleOnPaste!="function"&&(e.warn(`quill.imageCompressor: [config error] 'handlePaste' is required to be a "boolean" or a "function", received: ${n.ignoreImageTypes} -> using default true`),n.handleOnPaste=!0),n.insertIntoEditor&&typeof n.insertIntoEditor!="function"&&(e.warn(`quill.imageCompressor: [config error] 'insertIntoEditor' is required to be a "function", received: ${n.insertIntoEditor} -> using default undefined`),n.insertIntoEditor=void 0)}function kw(n){return!!/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i.exec(n)}class wz{constructor(e,t,r,i){Ee(this,"localDrag",!1);this.quill=e,this.onNewDataUrl=t,this.logger=r,this.handleOnPaste=i,this.quill.root.addEventListener("dragstart",o=>this.handleDragStart(o),!1),this.quill.root.addEventListener("dragend",o=>this.handleDragEnd(o),!1),this.quill.root.addEventListener("drop",o=>this.handleDrop(o),!0),this.handleOnPaste!==!1&&this.quill.root.addEventListener("paste",o=>this.handlePaste(o),!0)}handleDragStart(e){this.localDrag=!0}handleDragEnd(e){this.localDrag=!1}async handleDrop(e){var l,a,h,g;if(this.localDrag)return;e.preventDefault();const t=document.getSelection();if(t&&document.caretPositionFromPoint){const m=document.caretPositionFromPoint(e.clientX,e.clientY);m&&t.setBaseAndExtent(m.offsetNode,m.offset,m.offsetNode,m.offset)}this.logger.log("handleDrop",{evt:e});const r=(l=e.dataTransfer)==null?void 0:l.files,i=Array.from(r||[]).filter(m=>kw(m.type));if(i.length>0){e.stopPropagation(),this.logger.log("handleDrop","found files",{evt:e,files:r,imageFiles:i}),await this.pasteFilesIntoQuill(i);return}if((a=e.dataTransfer)!=null&&a.items){e.stopPropagation(),this.logger.log("handleDrop","found items",{evt:e,files:r,imageFiles:i}),await this.handleDataTransferList((h=e.dataTransfer)==null?void 0:h.items,e);return}const o=(g=e.dataTransfer)==null?void 0:g.getData("URL");if(this.logger.log("handleDrop","trying getData('URL')",{draggedUrl:o}),o){const m=await(await fetch(o)).blob();this.logger.log("handleDrop","blob from drag event",{evt:e,files:r,imageFiles:i}),await this.pasteFilesIntoQuill([m])}}async handlePaste(e){var t;typeof this.handleOnPaste=="function"&&!this.handleOnPaste(e)||await this.handleDataTransferList((t=e.clipboardData)==null?void 0:t.items,e)}async handleDataTransferList(e,t){const r=Array.from(e||[]),i=r.filter(a=>a.kind==="file"&&kw(a.type)),o=r.map(a=>({type:a.type,kind:a.kind}));if(this.logger.log("handleDataTransferList",{fileTypes:o,imageCount:i.length}),!i.length)return;t.preventDefault(),t.stopPropagation();const l=i.map(a=>a.getAsFile());await this.pasteFilesIntoQuill(l)}async pasteFilesIntoQuill(e){this.logger.log(" pasteFilesIntoQuill",`pasting ${e.length} images...`),await Promise.all(e.map(async(t,r)=>{if(!t)return;const i=await T_(t);this.logger.log(" pasteFilesIntoQuill",`pasting image (${r})`),this.onNewDataUrl(i)})),this.logger.log(" pasteFilesIntoQuill","done")}}class Fp{constructor(e,t){Ee(this,"quill");Ee(this,"range");Ee(this,"options");Ee(this,"imageDrop");Ee(this,"fileHolder");Ee(this,"Logger");this.quill=e,this.options=t||{};const r=!!t.debug,i=!!t.suppressErrorLogging;this.Logger=new hz(r,i),pz(t,this.Logger);const o=async a=>{this.Logger.log("onImageDrop",{dataUrl:a});const h=await this.downscaleImageFromUrl(a);this.insertToEditor(h,Fp.b64toBlob(h))};this.imageDrop=new wz(e,o,this.Logger,typeof this.options.handleOnPaste=="function"?this.options.handleOnPaste:this.options.handleOnPaste!==!1),this.Logger.log("fileChanged",{options:t,quill:e,debug:r});const l=this.quill.getModule("toolbar");l?l.addHandler("image",()=>this.selectLocalImage()):this.Logger.error("Quill toolbar module not found! need { toolbar: // options } in Quill.modules for image icon to sit in")}static b64toBlob(e){const t=atob(e.split(",")[1]),r=e.slice(5).split(";")[0],i=new ArrayBuffer(t.length);let o=new Uint8Array(i);for(let l=0;l<t.length;l++)o[l]=t.charCodeAt(l);return new Blob([i],{type:r})}destroy(){this.imageDrop&&console.warn("ImageDrop instance cleanup")}selectLocalImage(e){this.range=this.quill.getSelection(),this.fileHolder=document.createElement("input"),this.fileHolder.setAttribute("type","file"),this.fileHolder.setAttribute("accept","image/*"),this.fileHolder.setAttribute("style","visibility:hidden"),this.fileHolder.onchange=()=>this.fileChanged().then(()=>e&&e()),document.body.appendChild(this.fileHolder),this.fileHolder.click(),window.requestAnimationFrame(()=>{this.fileHolder&&document.body.removeChild(this.fileHolder)})}async fileChanged(e){var l;const t=e||((l=this.fileHolder)==null?void 0:l.files);if(!(t!=null&&t.length))return;const r=t[0];if(this.Logger.log("fileChanged",{file:r}),!r)return;const i=await T_(r),o=await this.downscaleImageFromUrl(i);this.insertToEditor(o,Fp.b64toBlob(o))}async downscaleImageFromUrl(e){const t=await gz(this.Logger,e,{maxWidth:this.options.maxWidth,maxHeight:this.options.maxHeight,imageType:this.options.imageType,keepImageTypes:this.options.keepImageTypes,ignoreImageTypes:this.options.ignoreImageTypes,imageQuality:this.options.quality});return this.Logger.log("downscaleImageFromUrl",{dataUrl:e,dataUrlCompressed:t}),t}insertToEditor(e,t){if(this.options.insertIntoEditor)this.options.insertIntoEditor(e,t,this.quill);else{this.Logger.log("insertToEditor",{url:e}),this.range=this.quill.getSelection();const r=this.range;if(!r)return;this.logFileSize(e),this.quill.insertEmbed(r.index,"image",`${e}`,"user"),r.index++,this.quill.setSelection(r,"api")}}logFileSize(e){const i=(Math.round((e.length-"data:image/png;base64,".length)*3/4)/1024).toFixed(0);this.Logger.log("estimated img size: "+i+" kb")}}window.imageCompressor=Fp;const Bp={OVERLAY:"ql-image-resizer-overlay",HANDLE:"ql-image-resizer-handle",DISPLAY:"ql-image-resizer-display",TOOLBAR:"ql-image-resizer-toolbar",TOOLBAR_BUTTON:"ql-image-resizer-toolbar-button"},Vd={BACKSPACE:8,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40},D0=(n,e)=>{const t=n?"top":"bottom",r=e?"left":"right",i=n===e?"nwse-resize":"nesw-resize";return{[t]:"-5px",[r]:"-5px",cursor:i}},Cz={tl:D0(!0,!0),tr:D0(!0,!1),bl:D0(!1,!0),br:D0(!1,!1)},_z={modules:["DisplaySize","Toolbar","Resize","Keyboard"],embedTags:["VIDEO","IFRAME"],tools:["left","center","right","justify"],contentOptions:[{attribute:["width"],limit:{minWidth:100},blotName:"image"},{attribute:["width","height"],limit:{minWidth:200,ratio:.5625},blotName:"video"}]},Sz=Xe.import("formats/image");class q0 extends Sz{static get ATTRIBUTES(){return["alt","height","width","class","style","data-align"]}static formats(e){return this.ATTRIBUTES.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)??""),t),{})}format(e,t){this.constructor.ATTRIBUTES.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}Ee(q0,"blotName","image"),Ee(q0,"tagName","img"),Ee(q0,"scope",Kn.INLINE);Xe.register("formats/image",q0,!0);class Xp{constructor(e){Ee(this,"resizer");Ee(this,"quill");Ee(this,"overlay");Ee(this,"activeEle");Ee(this,"blot");Ee(this,"options");Ee(this,"requestUpdate");this.resizer=e,this.quill=e.quill,this.overlay=e.overlay,this.activeEle=e.activeEle,this.blot=e.blot,this.options=e.options,this.requestUpdate=()=>e.onUpdate(!0)}onCreate(){}onDestroy(){}onUpdate(){}}class Ez extends Xp{constructor(){super(...arguments);Ee(this,"display")}onCreate(){var t;this.display=document.createElement("div"),this.display.className=af[Bp.DISPLAY],(t=this.overlay)==null||t.appendChild(this.display)}onUpdate(){if(!this.display||!this.activeEle)return;const[t,r]=[this.activeEle.offsetWidth,this.activeEle.offsetHeight];this.display.innerHTML=`${t} &times; ${r}`,this.positionDisplay(t,r)}positionDisplay(t,r){var a;if(!this.display)return;const i=this.display.getBoundingClientRect(),o=t>120&&r>30,l=((a=this.activeEle)==null?void 0:a.style.float)==="right";Object.assign(this.display.style,{right:o?"4px":l?"auto":`-${i.width+4}px`,bottom:o?"4px":`-${i.height+4}px`,left:o?"auto":l?`-${i.width+4}px`:"auto"})}}class Tz extends Xp{constructor(){super(...arguments);Ee(this,"boxes",[]);Ee(this,"dragBox",null);Ee(this,"dragStartX",0);Ee(this,"dragStartY",0);Ee(this,"contentOption");Ee(this,"preDragSize",{width:0,height:0});Ee(this,"naturalSize",[0,0]);Ee(this,"handleDragProxy",null);Ee(this,"handleMouseupProxy",null);Ee(this,"handleMousedown",t=>{!this.blot||!this.activeEle||(this.dragBox=t.target,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.preDragSize={width:this.activeEle.offsetWidth,height:this.activeEle.offsetHeight},this.naturalSize=this.getNaturalSize(),this.setCursor(window.getComputedStyle(this.dragBox).cursor),this.handleDragProxy=this.handleDrag.bind(this),this.handleMouseupProxy=this.handleMouseup.bind(this),document.addEventListener("mousemove",this.handleDragProxy,!0),document.addEventListener("mouseup",this.handleMouseupProxy,!0))});Ee(this,"handleMouseup",t=>{if(!this.activeEle||!this.blot||!this.contentOption)return;const r=this.calcSize(t,this.contentOption.limit);Object.assign(this.activeEle,r),Object.assign(this.activeEle.style,{width:null,height:null}),this.setCursor(""),this.removeEventListeners()});Ee(this,"handleDrag",t=>{!this.activeEle||!this.blot||!this.contentOption||(Object.assign(this.activeEle.style,this.calcSize(t,{...this.contentOption.limit,unit:!0})),this.requestUpdate())});Ee(this,"handleDoubleClick",t=>{if(!this.blot||!this.activeEle||!this.contentOption)return;t.stopPropagation();const[r,i]=this.naturalSize,o={};this.contentOption.attribute.includes("width")&&(o.width=r),this.contentOption.attribute.includes("height")&&(o.height=i);const l=this.applyConstraints(o,this.contentOption.limit);Object.assign(this.activeEle,l),this.requestUpdate()})}onCreate(){!this.blot||!this.options.contentOptions||(this.contentOption=this.options.contentOptions.find(t=>t.blotName===this.blot.statics.blotName),this.boxes=[],["tl","tr","br","bl"].forEach(this.addBox.bind(this)))}onDestroy(){this.setCursor("")}addBox(t){var i;const r=document.createElement("div");r.className=`${af[Bp.HANDLE]} ${t}`,r.addEventListener("mousedown",this.handleMousedown,!1),r.addEventListener("dblclick",this.handleDoubleClick,!1),Object.assign(r.style,Cz[t]),(i=this.overlay)==null||i.appendChild(r),this.boxes.push(r)}removeEventListeners(){this.handleDragProxy&&(document.removeEventListener("mousemove",this.handleDragProxy,!0),this.handleDragProxy=null),this.handleMouseupProxy&&(document.removeEventListener("mouseup",this.handleMouseupProxy,!0),this.handleMouseupProxy=null)}calcSize(t,r={}){var h;if(!this.dragBox||!this.activeEle)return{};const i=t.clientX-this.dragStartX,o=t.clientY-this.dragStartY,l=this.dragBox===this.boxes[0]||this.dragBox===this.boxes[3]?-1:1,a={};return(h=this.contentOption)!=null&&h.attribute?this.contentOption.attribute.forEach(g=>a[g]=this.preDragSize[g]):a.width=this.preDragSize.width,a.width&&(a.width=Math.round(this.preDragSize.width+i*l)),a.height&&(a.height=Math.round(this.preDragSize.height+o*l)),this.applyConstraints(a,r)}applyConstraints(t,r={}){const i=typeof t.width=="string"?parseInt(t.width,10):t.width||0,o=typeof t.height=="string"?parseInt(t.height,10):t.height||0;let l=i,a=o;if(r.ratio){l=this.applyLimit(l,r.minWidth,r.maxWidth),a=l*r.ratio;const g=this.applyLimit(a,r.minHeight,r.maxHeight);g!==a&&(a=g,l=a/r.ratio)}else i&&(l=this.applyLimit(l,r.minWidth,r.maxWidth)),o&&(a=this.applyLimit(a,r.minHeight,r.maxHeight));const h={};return t.width!==void 0&&(h.width=r.unit?`${l}px`:l),t.height!==void 0&&(h.height=r.unit?`${a}px`:a),h}applyLimit(t,r,i){let o=t;return r!==void 0&&(o=Math.max(r,o)),i!==void 0&&(o=Math.min(i,o)),o}getNaturalSize(){if(!this.activeEle)return[0,0];const t=this.activeEle.getAttribute("data-size");if(!t){const r=this.activeEle,i=[r.offsetWidth,r.offsetHeight];return r.setAttribute("data-size",i.join(",")),i}return t.split(",").map(Number)}setCursor(t){[document.body,this.activeEle].forEach(r=>r&&(r.style.cursor=t))}}const qd=class qd extends Xp{constructor(){super(...arguments);Ee(this,"keyboardProxy",null)}static injectInit(t){var i;const r=(i=t.keyboard)==null?void 0:i.bindings;r&&[qd.keys.LEFT,qd.keys.RIGHT].forEach(o=>(r[o]||[]).unshift(qd.makeArrowHandler(o)))}static makeArrowHandler(t){const r=t===qd.keys.LEFT;return{key:t,shiftKey:!1,altKey:null,[r?"prefix":"suffix"]:/^$/,handler(i){const o=this.quill;if(!o.resizer)return!0;let l=i.index;const a=t===qd.keys.RIGHT,[h]=o.getLine(l+(r?-1:0));if(!h)return!0;if(o.resizer.judgeShow(h))return!1;const g=o.getIndex(h);if(a&&g+h.length()-1===l)return!0;a&&(l+=i.length+1);const[m]=o.getLeaf(l);if(!m)return!0;const x=m.offset(m.parent),w=m.constructor&&"scope"in m.constructor&&m.constructor.scope===Kn.BLOCK_BLOT;if(r&&(w&&l===x||l===0||l===g))return!0;let _=m;if(r&&x===0){const[S]=o.getLeaf(l-1);S&&(_=S)}return!_||!o.resizer.judgeShow(_)}}}onCreate(){this.keyboardProxy=this.keyboardHandle.bind(this),document.addEventListener("keydown",this.keyboardProxy,!0)}onDestroy(){this.keyboardProxy&&document.removeEventListener("keydown",this.keyboardProxy,!0)}keyboardHandle(t){if(t.defaultPrevented||t.shiftKey||t.ctrlKey||t.altKey||!this.activeEle)return;const r=t.keyCode;let i=this.blot.offset(this.quill.scroll),o=null,l=!1;r===Vd.BACKSPACE||r===Vd.DELETE?(this.handleDelete(),l=!0):r>=Vd.LEFT&&r<=Vd.DOWN&&([i,o]=this.handleArrowKeys(r,i),l=!0),l&&(t.stopPropagation(),t.preventDefault()),!(o&&this.resizer.judgeShow(o,o.domNode))&&(this.quill.setSelection(i),this.resizer.hide())}handleDelete(){this.blot&&(this.blot.deleteAt(0,1),this.blot.parent.optimize({}))}handleArrowKeys(t,r){let i=null;return t===Vd.RIGHT?r+=this.blot.length()||1:t===Vd.UP?(r=this.getOtherLineIndex(-1),i=this.quill.getLeaf(r)[0]):t===Vd.DOWN&&(r=this.getOtherLineIndex(1),i=this.quill.getLeaf(r)[0]),[r,i]}getOtherLineIndex(t){if(!this.blot)return 0;const r=this.blot.offset(this.quill.scroll),[i]=this.quill.getLine(r);if(!i)return r;const o=this.blot.offset(i)+1,l=t>0?i.next:i.prev;if(!l)return r;let a=l.length();return l.statics.blotName==="block"&&a--,l.offset(this.quill.scroll)+Math.min(a,o)}};Ee(qd,"keys",Vd);let vv=qd;const f1=class f1 extends Xp{constructor(t){super(t);Ee(this,"toolbar");Ee(this,"blot");this.blot=t.blot}createStyleTool(t,r){const i={left:{float:"left"},right:{float:"right"},center:{display:"block",margin:"0 auto",float:"none"},justify:{display:"block",float:"none",margin:"0",width:"100%"}};return{icon:t,apply:o=>{const l=i[r];Object.assign(o.style,l),o.setAttribute("data-align",r)},isApplied:o=>{const l=o.style;switch(r){case"center":return l.float==="none";case"justify":return l.display==="block"&&l.width==="100%";case"left":case"right":return l.float===r;default:return!1}}}}onCreate(){var t;this.toolbar=document.createElement("div"),this.toolbar.className=af[Bp.TOOLBAR],(t=this.overlay)==null||t.appendChild(this.toolbar),Object.keys(f1.Tools).forEach(r=>{const i=r;f1.Tools[i]=this.createStyleTool(f1.Tools[i].icon,i)}),this._addToolbarButtons()}_addToolbarButtons(){if(!this.toolbar||!this.activeEle)return;const{Tools:t}=this.constructor;this.options.tools.forEach(r=>{const i=r,o=t[i];if(!o)return;const l=document.createElement("button");l.type="button",l.className=af[Bp.TOOLBAR_BUTTON],l.innerHTML=a1.renderToString(M.jsx(fo,{icon:o.icon,size:"xs"})),l.setAttribute("data-tool",i),o.isApplied&&o.isApplied.call(this,this.activeEle)&&(l.style.backgroundColor="var(--AEditor_Addon_Secondary_color)"),this.addButtonClickHandler(l,o),this.toolbar.appendChild(l)})}addButtonClickHandler(t,r){!this.activeEle||!this.blot||t.addEventListener("click",i=>{var l;if(i.stopPropagation(),r.handler&&r.handler.call(this,i,t,this.activeEle)!==!0)return;const o=r.isApplied&&r.isApplied.call(this,this.activeEle);return this.toolbar&&Array.from(this.toolbar.querySelectorAll("button")).forEach(a=>a.style.backgroundColor=""),o?(this.activeEle.style.cssText="",this.activeEle.setAttribute("data-align","")):(t.style.backgroundColor="var(--AEditor_Addon_Secondary_color)",(l=r.apply)==null||l.call(r,this.activeEle)),this.requestUpdate(),!1})}};Ee(f1,"Tools",{left:{icon:"AlignLeft"},center:{icon:"AlignCenter"},right:{icon:"AlignRight"},justify:{icon:"AlignJustify"}});let cm=f1;class A_{constructor(e,t={}){Ee(this,"quill");Ee(this,"options");Ee(this,"moduleClasses");Ee(this,"modules",[]);Ee(this,"blot");Ee(this,"selectedBlots",[]);Ee(this,"embedClassName","");Ee(this,"activeEle");Ee(this,"overlay");Ee(this,"updateFromModule",!1);Ee(this,"hideProxy",null);Ee(this,"updateOverlayPositionProxy",null);var i;e.resizer=this,this.quill=e;const r=t.modules?[...t.modules]:null;this.options={..._z,...t},r&&(this.options.modules=r),document.execCommand("enableObjectResizing",!1,"false"),this.moduleClasses=this.options.modules,this.quill.root.addEventListener("mousedown",this.handleClick.bind(this),!1),this.quill.on("text-change",this.handleChange.bind(this)),this.quill.container.style.position=this.quill.container.style.position||"relative",this.quill.on("selection-change",this.addBlotsSelectedClass.bind(this)),vv.injectInit(this.quill),(i=this.options.embedTags)!=null&&i.length&&this.initializeEmbed()}initializeModules(){this.modules.forEach(e=>e.onDestroy()),this.modules=[],this.modules=this.moduleClasses.map(e=>new(this.constructor.Modules[e]||e)(this)),this.modules.forEach(e=>e.onCreate()),this.repositionElements(),this.modules.forEach(e=>e.onUpdate())}initializeEmbed(){if(!this.options.embedTags.length)return;this.embedClassName=`ql-${Array.from({length},()=>[Math.floor(Math.random()*62)]).join("")}`;const e=[""].concat(this.options.embedTags).join(`, .${this.embedClassName} `).slice(2)+"{pointer-events: none;}",t=document.createElement("style");t.textContent=e,this.quill.container.appendChild(t),this.quill.root.classList.add(this.embedClassName)}onUpdate(e){this.updateFromModule=!!e,this.repositionElements(),this.modules.forEach(t=>t.onUpdate())}handleClick(e){if(this.overlay&&(e.target===this.overlay||this.overlay.contains(e.target)))return;let t=e.target;if(t=this.getEventTarget(e,t),t!=null&&t.tagName){const r=this.quill.scroll.find(t);if(r&&this.judgeShow(r,t)){e.preventDefault();return}}this.activeEle&&this.hide()}getEventTarget(e,t){var o;const r=(o=this.options.embedTags)==null?void 0:o.join();if(!r)return t;const i=this.quill.root;return(t===i||t.querySelectorAll(r).length)&&(i.classList.remove(this.embedClassName),t=document.elementFromPoint(e.clientX,e.clientY),i.classList.add(this.embedClassName)),t}judgeShow(e,t){if(!e||!this.options.contentOptions)return!1;!t&&e.domNode&&(t=e.domNode);const r=this.options.contentOptions.find(o=>o.blotName===e.statics.blotName);if(!r)return!1;if(this.activeEle===t)return!0;const i=r.limit||{};return!i.minWidth||i.minWidth&&t.offsetWidth>=i.minWidth?(this.activeEle&&this.hide(),this.activeEle=t,this.blot=e,this.showOverlay(),this.initializeModules(),!0):!1}handleChange(e,t,r){if(this.updateFromModule){this.updateFromModule=!1;return}r!=="user"||!this.overlay||!this.activeEle||this.onUpdate()}showOverlay(){this.overlay&&this.hideOverlay(),this.quill.setSelection(null),[document.body,this.quill.root].forEach(e=>e.style.userSelect="none"),this.overlay=document.createElement("div"),this.overlay.className=`${af[Bp.OVERLAY]}`,this.overlay.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation(),this.quill.root.scrollTop+=e.deltaY*.5},{passive:!1}),this.quill.container.appendChild(this.overlay),this.hideProxy=()=>this.activeEle&&this.hide(),this.updateOverlayPositionProxy=()=>this.overlay&&(this.overlay.style.marginTop=-1*this.quill.root.scrollTop+"px"),this.quill.root.addEventListener("input",this.hideProxy,!0),this.quill.root.addEventListener("scroll",this.updateOverlayPositionProxy),this.repositionElements()}hideOverlay(){this.overlay&&(this.quill.container.removeChild(this.overlay),this.overlay=void 0,this.hideProxy&&this.quill.root.removeEventListener("input",this.hideProxy,!0),this.updateOverlayPositionProxy&&this.quill.root.removeEventListener("scroll",this.updateOverlayPositionProxy),[document.body,this.quill.root].forEach(e=>e.style.userSelect=""))}repositionElements(){if(!this.overlay||!this.activeEle)return;const e=this.quill.container,t=this.activeEle.getBoundingClientRect(),r=e.getBoundingClientRect();Object.assign(this.overlay.style,{left:`${t.left-r.left-1+e.scrollLeft}px`,top:`${t.top-r.top+this.quill.root.scrollTop}px`,width:`${t.width}px`,height:`${t.height}px`,marginTop:-1*this.quill.root.scrollTop+"px"})}addBlotsSelectedClass(e){if(!e){this.selectedBlots=[];return}try{const t=i=>{var o;return["image","iframe","video"].includes((o=i.statics)==null?void 0:o.blotName)},r=this.quill.scroll.descendants(t,e.index,e.length);this.selectedBlots=r.filter(i=>!i.statics||!this.options.contentOptions?!1:!!this.options.contentOptions.find(o=>o.blotName===i.statics.blotName))}catch{}}hide(){this.hideOverlay(),this.modules.forEach(e=>e.onDestroy()),this.modules=[],this.activeEle=void 0,this.blot=void 0}}Ee(A_,"Modules",{Base:Xp,DisplaySize:Ez,Toolbar:cm,Resize:Tz,Keyboard:vv});const N0=Xe.import("delta"),Az=Xe.import("modules/clipboard");function Rz(n){let e=Number.parseFloat(n.getAttribute("width")||String(Ss.colDefaultWidth));if(Number.isNaN(e)){const t=n.style.width;e=t?Number.parseFloat(t):n.offsetWidth}return e}function Iz(n,e){const t=new Array(e).fill(Ss.colDefaultWidth),r=Array.from(n.querySelectorAll("tr"));for(const i of r){const o=Array.from(i.querySelectorAll("td"));for(const[l,a]of o.entries())if(l<e){const h=Rz(a);t[l]=h||t[l]}else break}return t}class kz extends Az{constructor(t,r){super(t,r);Ee(this,"tableId",Fa());Ee(this,"rowId",Fa());Ee(this,"colIds",[]);Ee(this,"rowspanCount",[]);Ee(this,"cellCount",0);Ee(this,"colCount",0);Ee(this,"STYLE_PROPERTIES",["color","background","background-color","mso-pattern","border","border-color","border-top","border-right","border-bottom","border-left"]);this.quill=t,this.addMatcher("table",this.matchTable.bind(this)),this.addMatcher("colgroup",this.matchColgroup.bind(this)),this.addMatcher("col",this.matchCol.bind(this)),this.addMatcher("tr",this.matchTr.bind(this)),this.addMatcher("td",this.matchTd.bind(this)),this.addMatcher("th",this.matchTd.bind(this)),this.addMatcher("caption",this.matchCaption.bind(this))}matchTable(t,r){if(r.ops.length===0)return r;const i=[],o=[];let l=-1;for(let g=0;g<r.ops.length;g++){const{attributes:m,insert:x}=r.ops[g],{table:w,[Qe.tableCell]:_,...S}=m||{},R=tg.isObject(x)&&x[Qe.tableCol];R?o.push({insert:x}):i.push({attributes:S,insert:x}),!(S!=null&&S[Qe.tableCellInner])&&!R&&(l=g)}const h=Iz(t,this.colIds.length).reduce((g,m,x)=>(o[x]?g.push(o[x]):g.push({insert:{[Qe.tableCol]:{tableId:this.tableId,colId:this.colIds[x],width:m,full:!0}}}),g),[]);return i.splice(l+1,0,...h),this.tableId=Fa(),this.colIds=[],this.rowspanCount=[],this.cellCount=0,this.colCount=0,new N0(i)}matchColgroup(t,r){const i=[];for(let o=0;o<r.ops.length;o++){const l=r.ops[o];l&&tg.isObject(l.insert)&&l.insert[Qe.tableCol]&&i.push(l)}return new N0(i)}matchCol(t){this.colIds[this.colCount]=Fa();const r=new N0().insert({[Qe.tableCol]:Object.assign(Ig.value(t),{tableId:this.tableId,colId:this.colIds[this.colCount]})});return this.colCount+=1,r}matchTr(t,r){this.rowId=Fa(),this.cellCount=0;for(const[i,o]of this.rowspanCount.entries())o.rowspan>0&&(o.rowspan-=1),o.rowspan<=0&&(this.rowspanCount[i]={rowspan:0,colspan:0});return r}matchTd(t,r){const i=t,o=Nf.formats(i);if(!this.colIds[this.cellCount]||!this.rowspanCount[this.cellCount])for(let m=this.cellCount;m>=0;m--)this.colIds[m]||(this.colIds[m]=Fa()),this.rowspanCount[m]||(this.rowspanCount[m]={rowspan:0,colspan:0});const{colspan:l}=this.rowspanCount[this.cellCount];this.cellCount+=l,o.rowspan>0&&(this.rowspanCount[this.cellCount]={rowspan:o.rowspan,colspan:o.colspan});const a=this.colIds[this.cellCount];this.cellCount+=o.colspan;const h=Object.assign(o,{tableId:this.tableId,rowId:this.rowId,colId:a});this.handleBorderNoneStyles(i,h);const g=[];for(const m of r.ops){const{attributes:x={},...w}=m,{[Qe.tableCell]:_,...S}=x;g.push({...w,attributes:{...S,[Qe.tableCellInner]:h}})}return(g.length<=0||!tg.isString(g[g.length-1].insert)||!g[g.length-1].insert.endsWith(`
478
+ -> using default image/jpeg`),n.imageType="image/jpeg")}function xz(n,e){n.keepImageTypes??(n.keepImageTypes=[]),n.keepImageTypes&&!Array.isArray(n.keepImageTypes)&&(e.warn(`quill.imageCompressor: [config error] 'keepImageTypes' is required to be a "array", received: ${n.keepImageTypes} -> using default []`),n.keepImageTypes=[]),n.ignoreImageTypes??(n.ignoreImageTypes=[]),n.ignoreImageTypes&&!Array.isArray(n.ignoreImageTypes)&&(e.warn(`quill.imageCompressor: [config error] 'ignoreImageTypes' is required to be a "array", received: ${n.ignoreImageTypes} -> using default []`),n.ignoreImageTypes=[])}function wz(n,e){n.handleOnPaste&&typeof n.handleOnPaste!="boolean"&&typeof n.handleOnPaste!="function"&&(e.warn(`quill.imageCompressor: [config error] 'handlePaste' is required to be a "boolean" or a "function", received: ${n.ignoreImageTypes} -> using default true`),n.handleOnPaste=!0),n.insertIntoEditor&&typeof n.insertIntoEditor!="function"&&(e.warn(`quill.imageCompressor: [config error] 'insertIntoEditor' is required to be a "function", received: ${n.insertIntoEditor} -> using default undefined`),n.insertIntoEditor=void 0)}function kw(n){return!!/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i.exec(n)}class Cz{constructor(e,t,r,i){Ee(this,"localDrag",!1);this.quill=e,this.onNewDataUrl=t,this.logger=r,this.handleOnPaste=i,this.quill.root.addEventListener("dragstart",o=>this.handleDragStart(o),!1),this.quill.root.addEventListener("dragend",o=>this.handleDragEnd(o),!1),this.quill.root.addEventListener("drop",o=>this.handleDrop(o),!0),this.handleOnPaste!==!1&&this.quill.root.addEventListener("paste",o=>this.handlePaste(o),!0)}handleDragStart(e){this.localDrag=!0}handleDragEnd(e){this.localDrag=!1}async handleDrop(e){var l,a,h,g;if(this.localDrag)return;e.preventDefault();const t=document.getSelection();if(t&&document.caretPositionFromPoint){const m=document.caretPositionFromPoint(e.clientX,e.clientY);m&&t.setBaseAndExtent(m.offsetNode,m.offset,m.offsetNode,m.offset)}this.logger.log("handleDrop",{evt:e});const r=(l=e.dataTransfer)==null?void 0:l.files,i=Array.from(r||[]).filter(m=>kw(m.type));if(i.length>0){e.stopPropagation(),this.logger.log("handleDrop","found files",{evt:e,files:r,imageFiles:i}),await this.pasteFilesIntoQuill(i);return}if((a=e.dataTransfer)!=null&&a.items){e.stopPropagation(),this.logger.log("handleDrop","found items",{evt:e,files:r,imageFiles:i}),await this.handleDataTransferList((h=e.dataTransfer)==null?void 0:h.items,e);return}const o=(g=e.dataTransfer)==null?void 0:g.getData("URL");if(this.logger.log("handleDrop","trying getData('URL')",{draggedUrl:o}),o){const m=await(await fetch(o)).blob();this.logger.log("handleDrop","blob from drag event",{evt:e,files:r,imageFiles:i}),await this.pasteFilesIntoQuill([m])}}async handlePaste(e){var t;typeof this.handleOnPaste=="function"&&!this.handleOnPaste(e)||await this.handleDataTransferList((t=e.clipboardData)==null?void 0:t.items,e)}async handleDataTransferList(e,t){const r=Array.from(e||[]),i=r.filter(a=>a.kind==="file"&&kw(a.type)),o=r.map(a=>({type:a.type,kind:a.kind}));if(this.logger.log("handleDataTransferList",{fileTypes:o,imageCount:i.length}),!i.length)return;t.preventDefault(),t.stopPropagation();const l=i.map(a=>a.getAsFile());await this.pasteFilesIntoQuill(l)}async pasteFilesIntoQuill(e){this.logger.log(" pasteFilesIntoQuill",`pasting ${e.length} images...`),await Promise.all(e.map(async(t,r)=>{if(!t)return;const i=await T_(t);this.logger.log(" pasteFilesIntoQuill",`pasting image (${r})`),this.onNewDataUrl(i)})),this.logger.log(" pasteFilesIntoQuill","done")}}class Fp{constructor(e,t){Ee(this,"quill");Ee(this,"range");Ee(this,"options");Ee(this,"imageDrop");Ee(this,"fileHolder");Ee(this,"Logger");this.quill=e,this.options=t||{};const r=!!t.debug,i=!!t.suppressErrorLogging;this.Logger=new dz(r,i),vz(t,this.Logger);const o=async a=>{this.Logger.log("onImageDrop",{dataUrl:a});const h=await this.downscaleImageFromUrl(a);this.insertToEditor(h,Fp.b64toBlob(h))};this.imageDrop=new Cz(e,o,this.Logger,typeof this.options.handleOnPaste=="function"?this.options.handleOnPaste:this.options.handleOnPaste!==!1),this.Logger.log("fileChanged",{options:t,quill:e,debug:r});const l=this.quill.getModule("toolbar");l?l.addHandler("image",()=>this.selectLocalImage()):this.Logger.error("Quill toolbar module not found! need { toolbar: // options } in Quill.modules for image icon to sit in")}static b64toBlob(e){const t=atob(e.split(",")[1]),r=e.slice(5).split(";")[0],i=new ArrayBuffer(t.length);let o=new Uint8Array(i);for(let l=0;l<t.length;l++)o[l]=t.charCodeAt(l);return new Blob([i],{type:r})}destroy(){this.imageDrop&&console.warn("ImageDrop instance cleanup")}selectLocalImage(e){this.range=this.quill.getSelection(),this.fileHolder=document.createElement("input"),this.fileHolder.setAttribute("type","file"),this.fileHolder.setAttribute("accept","image/*"),this.fileHolder.setAttribute("style","visibility:hidden"),this.fileHolder.onchange=()=>this.fileChanged().then(()=>e&&e()),document.body.appendChild(this.fileHolder),this.fileHolder.click(),window.requestAnimationFrame(()=>{this.fileHolder&&document.body.removeChild(this.fileHolder)})}async fileChanged(e){var l;const t=e||((l=this.fileHolder)==null?void 0:l.files);if(!(t!=null&&t.length))return;const r=t[0];if(this.Logger.log("fileChanged",{file:r}),!r)return;const i=await T_(r),o=await this.downscaleImageFromUrl(i);this.insertToEditor(o,Fp.b64toBlob(o))}async downscaleImageFromUrl(e){const t=await pz(this.Logger,e,{maxWidth:this.options.maxWidth,maxHeight:this.options.maxHeight,imageType:this.options.imageType,keepImageTypes:this.options.keepImageTypes,ignoreImageTypes:this.options.ignoreImageTypes,imageQuality:this.options.quality});return this.Logger.log("downscaleImageFromUrl",{dataUrl:e,dataUrlCompressed:t}),t}insertToEditor(e,t){if(this.options.insertIntoEditor)this.options.insertIntoEditor(e,t,this.quill);else{this.Logger.log("insertToEditor",{url:e}),this.range=this.quill.getSelection();const r=this.range;if(!r)return;this.logFileSize(e),this.quill.insertEmbed(r.index,"image",`${e}`,"user"),r.index++,this.quill.setSelection(r,"api")}}logFileSize(e){const i=(Math.round((e.length-"data:image/png;base64,".length)*3/4)/1024).toFixed(0);this.Logger.log("estimated img size: "+i+" kb")}}window.imageCompressor=Fp;const Bp={OVERLAY:"ql-image-resizer-overlay",HANDLE:"ql-image-resizer-handle",DISPLAY:"ql-image-resizer-display",TOOLBAR:"ql-image-resizer-toolbar",TOOLBAR_BUTTON:"ql-image-resizer-toolbar-button"},Vd={BACKSPACE:8,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40},D0=(n,e)=>{const t=n?"top":"bottom",r=e?"left":"right",i=n===e?"nwse-resize":"nesw-resize";return{[t]:"-5px",[r]:"-5px",cursor:i}},_z={tl:D0(!0,!0),tr:D0(!0,!1),bl:D0(!1,!0),br:D0(!1,!1)},Sz={modules:["DisplaySize","Toolbar","Resize","Keyboard"],embedTags:["VIDEO","IFRAME"],tools:["left","center","right","justify"],contentOptions:[{attribute:["width"],limit:{minWidth:100},blotName:"image"},{attribute:["width","height"],limit:{minWidth:200,ratio:.5625},blotName:"video"}]},Ez=Xe.import("formats/image");class q0 extends Ez{static get ATTRIBUTES(){return["alt","height","width","class","style","data-align"]}static formats(e){return this.ATTRIBUTES.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)??""),t),{})}format(e,t){this.constructor.ATTRIBUTES.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}Ee(q0,"blotName","image"),Ee(q0,"tagName","img"),Ee(q0,"scope",Kn.INLINE);Xe.register("formats/image",q0,!0);class Xp{constructor(e){Ee(this,"resizer");Ee(this,"quill");Ee(this,"overlay");Ee(this,"activeEle");Ee(this,"blot");Ee(this,"options");Ee(this,"requestUpdate");this.resizer=e,this.quill=e.quill,this.overlay=e.overlay,this.activeEle=e.activeEle,this.blot=e.blot,this.options=e.options,this.requestUpdate=()=>e.onUpdate(!0)}onCreate(){}onDestroy(){}onUpdate(){}}class Tz extends Xp{constructor(){super(...arguments);Ee(this,"display")}onCreate(){var t;this.display=document.createElement("div"),this.display.className=af[Bp.DISPLAY],(t=this.overlay)==null||t.appendChild(this.display)}onUpdate(){if(!this.display||!this.activeEle)return;const[t,r]=[this.activeEle.offsetWidth,this.activeEle.offsetHeight];this.display.innerHTML=`${t} &times; ${r}`,this.positionDisplay(t,r)}positionDisplay(t,r){var a;if(!this.display)return;const i=this.display.getBoundingClientRect(),o=t>120&&r>30,l=((a=this.activeEle)==null?void 0:a.style.float)==="right";Object.assign(this.display.style,{right:o?"4px":l?"auto":`-${i.width+4}px`,bottom:o?"4px":`-${i.height+4}px`,left:o?"auto":l?`-${i.width+4}px`:"auto"})}}class Az extends Xp{constructor(){super(...arguments);Ee(this,"boxes",[]);Ee(this,"dragBox",null);Ee(this,"dragStartX",0);Ee(this,"dragStartY",0);Ee(this,"contentOption");Ee(this,"preDragSize",{width:0,height:0});Ee(this,"naturalSize",[0,0]);Ee(this,"handleDragProxy",null);Ee(this,"handleMouseupProxy",null);Ee(this,"handleMousedown",t=>{!this.blot||!this.activeEle||(this.dragBox=t.target,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.preDragSize={width:this.activeEle.offsetWidth,height:this.activeEle.offsetHeight},this.naturalSize=this.getNaturalSize(),this.setCursor(window.getComputedStyle(this.dragBox).cursor),this.handleDragProxy=this.handleDrag.bind(this),this.handleMouseupProxy=this.handleMouseup.bind(this),document.addEventListener("mousemove",this.handleDragProxy,!0),document.addEventListener("mouseup",this.handleMouseupProxy,!0))});Ee(this,"handleMouseup",t=>{if(!this.activeEle||!this.blot||!this.contentOption)return;const r=this.calcSize(t,this.contentOption.limit);Object.assign(this.activeEle,r),Object.assign(this.activeEle.style,{width:null,height:null}),this.setCursor(""),this.removeEventListeners()});Ee(this,"handleDrag",t=>{!this.activeEle||!this.blot||!this.contentOption||(Object.assign(this.activeEle.style,this.calcSize(t,{...this.contentOption.limit,unit:!0})),this.requestUpdate())});Ee(this,"handleDoubleClick",t=>{if(!this.blot||!this.activeEle||!this.contentOption)return;t.stopPropagation();const[r,i]=this.naturalSize,o={};this.contentOption.attribute.includes("width")&&(o.width=r),this.contentOption.attribute.includes("height")&&(o.height=i);const l=this.applyConstraints(o,this.contentOption.limit);Object.assign(this.activeEle,l),this.requestUpdate()})}onCreate(){!this.blot||!this.options.contentOptions||(this.contentOption=this.options.contentOptions.find(t=>t.blotName===this.blot.statics.blotName),this.boxes=[],["tl","tr","br","bl"].forEach(this.addBox.bind(this)))}onDestroy(){this.setCursor("")}addBox(t){var i;const r=document.createElement("div");r.className=`${af[Bp.HANDLE]} ${t}`,r.addEventListener("mousedown",this.handleMousedown,!1),r.addEventListener("dblclick",this.handleDoubleClick,!1),Object.assign(r.style,_z[t]),(i=this.overlay)==null||i.appendChild(r),this.boxes.push(r)}removeEventListeners(){this.handleDragProxy&&(document.removeEventListener("mousemove",this.handleDragProxy,!0),this.handleDragProxy=null),this.handleMouseupProxy&&(document.removeEventListener("mouseup",this.handleMouseupProxy,!0),this.handleMouseupProxy=null)}calcSize(t,r={}){var h;if(!this.dragBox||!this.activeEle)return{};const i=t.clientX-this.dragStartX,o=t.clientY-this.dragStartY,l=this.dragBox===this.boxes[0]||this.dragBox===this.boxes[3]?-1:1,a={};return(h=this.contentOption)!=null&&h.attribute?this.contentOption.attribute.forEach(g=>a[g]=this.preDragSize[g]):a.width=this.preDragSize.width,a.width&&(a.width=Math.round(this.preDragSize.width+i*l)),a.height&&(a.height=Math.round(this.preDragSize.height+o*l)),this.applyConstraints(a,r)}applyConstraints(t,r={}){const i=typeof t.width=="string"?parseInt(t.width,10):t.width||0,o=typeof t.height=="string"?parseInt(t.height,10):t.height||0;let l=i,a=o;if(r.ratio){l=this.applyLimit(l,r.minWidth,r.maxWidth),a=l*r.ratio;const g=this.applyLimit(a,r.minHeight,r.maxHeight);g!==a&&(a=g,l=a/r.ratio)}else i&&(l=this.applyLimit(l,r.minWidth,r.maxWidth)),o&&(a=this.applyLimit(a,r.minHeight,r.maxHeight));const h={};return t.width!==void 0&&(h.width=r.unit?`${l}px`:l),t.height!==void 0&&(h.height=r.unit?`${a}px`:a),h}applyLimit(t,r,i){let o=t;return r!==void 0&&(o=Math.max(r,o)),i!==void 0&&(o=Math.min(i,o)),o}getNaturalSize(){if(!this.activeEle)return[0,0];const t=this.activeEle.getAttribute("data-size");if(!t){const r=this.activeEle,i=[r.offsetWidth,r.offsetHeight];return r.setAttribute("data-size",i.join(",")),i}return t.split(",").map(Number)}setCursor(t){[document.body,this.activeEle].forEach(r=>r&&(r.style.cursor=t))}}const qd=class qd extends Xp{constructor(){super(...arguments);Ee(this,"keyboardProxy",null)}static injectInit(t){var i;const r=(i=t.keyboard)==null?void 0:i.bindings;r&&[qd.keys.LEFT,qd.keys.RIGHT].forEach(o=>(r[o]||[]).unshift(qd.makeArrowHandler(o)))}static makeArrowHandler(t){const r=t===qd.keys.LEFT;return{key:t,shiftKey:!1,altKey:null,[r?"prefix":"suffix"]:/^$/,handler(i){const o=this.quill;if(!o.resizer)return!0;let l=i.index;const a=t===qd.keys.RIGHT,[h]=o.getLine(l+(r?-1:0));if(!h)return!0;if(o.resizer.judgeShow(h))return!1;const g=o.getIndex(h);if(a&&g+h.length()-1===l)return!0;a&&(l+=i.length+1);const[m]=o.getLeaf(l);if(!m)return!0;const x=m.offset(m.parent),w=m.constructor&&"scope"in m.constructor&&m.constructor.scope===Kn.BLOCK_BLOT;if(r&&(w&&l===x||l===0||l===g))return!0;let _=m;if(r&&x===0){const[S]=o.getLeaf(l-1);S&&(_=S)}return!_||!o.resizer.judgeShow(_)}}}onCreate(){this.keyboardProxy=this.keyboardHandle.bind(this),document.addEventListener("keydown",this.keyboardProxy,!0)}onDestroy(){this.keyboardProxy&&document.removeEventListener("keydown",this.keyboardProxy,!0)}keyboardHandle(t){if(t.defaultPrevented||t.shiftKey||t.ctrlKey||t.altKey||!this.activeEle)return;const r=t.keyCode;let i=this.blot.offset(this.quill.scroll),o=null,l=!1;r===Vd.BACKSPACE||r===Vd.DELETE?(this.handleDelete(),l=!0):r>=Vd.LEFT&&r<=Vd.DOWN&&([i,o]=this.handleArrowKeys(r,i),l=!0),l&&(t.stopPropagation(),t.preventDefault()),!(o&&this.resizer.judgeShow(o,o.domNode))&&(this.quill.setSelection(i),this.resizer.hide())}handleDelete(){this.blot&&(this.blot.deleteAt(0,1),this.blot.parent.optimize({}))}handleArrowKeys(t,r){let i=null;return t===Vd.RIGHT?r+=this.blot.length()||1:t===Vd.UP?(r=this.getOtherLineIndex(-1),i=this.quill.getLeaf(r)[0]):t===Vd.DOWN&&(r=this.getOtherLineIndex(1),i=this.quill.getLeaf(r)[0]),[r,i]}getOtherLineIndex(t){if(!this.blot)return 0;const r=this.blot.offset(this.quill.scroll),[i]=this.quill.getLine(r);if(!i)return r;const o=this.blot.offset(i)+1,l=t>0?i.next:i.prev;if(!l)return r;let a=l.length();return l.statics.blotName==="block"&&a--,l.offset(this.quill.scroll)+Math.min(a,o)}};Ee(qd,"keys",Vd);let vv=qd;const f1=class f1 extends Xp{constructor(t){super(t);Ee(this,"toolbar");Ee(this,"blot");this.blot=t.blot}createStyleTool(t,r){const i={left:{float:"left"},right:{float:"right"},center:{display:"block",margin:"0 auto",float:"none"},justify:{display:"block",float:"none",margin:"0",width:"100%"}};return{icon:t,apply:o=>{const l=i[r];Object.assign(o.style,l),o.setAttribute("data-align",r)},isApplied:o=>{const l=o.style;switch(r){case"center":return l.float==="none";case"justify":return l.display==="block"&&l.width==="100%";case"left":case"right":return l.float===r;default:return!1}}}}onCreate(){var t;this.toolbar=document.createElement("div"),this.toolbar.className=af[Bp.TOOLBAR],(t=this.overlay)==null||t.appendChild(this.toolbar),Object.keys(f1.Tools).forEach(r=>{const i=r;f1.Tools[i]=this.createStyleTool(f1.Tools[i].icon,i)}),this._addToolbarButtons()}_addToolbarButtons(){if(!this.toolbar||!this.activeEle)return;const{Tools:t}=this.constructor;this.options.tools.forEach(r=>{const i=r,o=t[i];if(!o)return;const l=document.createElement("button");l.type="button",l.className=af[Bp.TOOLBAR_BUTTON],l.innerHTML=a1.renderToString(M.jsx(fo,{icon:o.icon,size:"xs"})),l.setAttribute("data-tool",i),o.isApplied&&o.isApplied.call(this,this.activeEle)&&(l.style.backgroundColor="var(--AEditor_Addon_Secondary_color)"),this.addButtonClickHandler(l,o),this.toolbar.appendChild(l)})}addButtonClickHandler(t,r){!this.activeEle||!this.blot||t.addEventListener("click",i=>{var l;if(i.stopPropagation(),r.handler&&r.handler.call(this,i,t,this.activeEle)!==!0)return;const o=r.isApplied&&r.isApplied.call(this,this.activeEle);return this.toolbar&&Array.from(this.toolbar.querySelectorAll("button")).forEach(a=>a.style.backgroundColor=""),o?(this.activeEle.style.cssText="",this.activeEle.setAttribute("data-align","")):(t.style.backgroundColor="var(--AEditor_Addon_Secondary_color)",(l=r.apply)==null||l.call(r,this.activeEle)),this.requestUpdate(),!1})}};Ee(f1,"Tools",{left:{icon:"AlignLeft"},center:{icon:"AlignCenter"},right:{icon:"AlignRight"},justify:{icon:"AlignJustify"}});let cm=f1;class A_{constructor(e,t={}){Ee(this,"quill");Ee(this,"options");Ee(this,"moduleClasses");Ee(this,"modules",[]);Ee(this,"blot");Ee(this,"selectedBlots",[]);Ee(this,"embedClassName","");Ee(this,"activeEle");Ee(this,"overlay");Ee(this,"updateFromModule",!1);Ee(this,"hideProxy",null);Ee(this,"updateOverlayPositionProxy",null);var i;e.resizer=this,this.quill=e;const r=t.modules?[...t.modules]:null;this.options={...Sz,...t},r&&(this.options.modules=r),document.execCommand("enableObjectResizing",!1,"false"),this.moduleClasses=this.options.modules,this.quill.root.addEventListener("mousedown",this.handleClick.bind(this),!1),this.quill.on("text-change",this.handleChange.bind(this)),this.quill.container.style.position=this.quill.container.style.position||"relative",this.quill.on("selection-change",this.addBlotsSelectedClass.bind(this)),vv.injectInit(this.quill),(i=this.options.embedTags)!=null&&i.length&&this.initializeEmbed()}initializeModules(){this.modules.forEach(e=>e.onDestroy()),this.modules=[],this.modules=this.moduleClasses.map(e=>new(this.constructor.Modules[e]||e)(this)),this.modules.forEach(e=>e.onCreate()),this.repositionElements(),this.modules.forEach(e=>e.onUpdate())}initializeEmbed(){if(!this.options.embedTags.length)return;this.embedClassName=`ql-${Array.from({length},()=>[Math.floor(Math.random()*62)]).join("")}`;const e=[""].concat(this.options.embedTags).join(`, .${this.embedClassName} `).slice(2)+"{pointer-events: none;}",t=document.createElement("style");t.textContent=e,this.quill.container.appendChild(t),this.quill.root.classList.add(this.embedClassName)}onUpdate(e){this.updateFromModule=!!e,this.repositionElements(),this.modules.forEach(t=>t.onUpdate())}handleClick(e){if(this.overlay&&(e.target===this.overlay||this.overlay.contains(e.target)))return;let t=e.target;if(t=this.getEventTarget(e,t),t!=null&&t.tagName){const r=this.quill.scroll.find(t);if(r&&this.judgeShow(r,t)){e.preventDefault();return}}this.activeEle&&this.hide()}getEventTarget(e,t){var o;const r=(o=this.options.embedTags)==null?void 0:o.join();if(!r)return t;const i=this.quill.root;return(t===i||t.querySelectorAll(r).length)&&(i.classList.remove(this.embedClassName),t=document.elementFromPoint(e.clientX,e.clientY),i.classList.add(this.embedClassName)),t}judgeShow(e,t){if(!e||!this.options.contentOptions)return!1;!t&&e.domNode&&(t=e.domNode);const r=this.options.contentOptions.find(o=>o.blotName===e.statics.blotName);if(!r)return!1;if(this.activeEle===t)return!0;const i=r.limit||{};return!i.minWidth||i.minWidth&&t.offsetWidth>=i.minWidth?(this.activeEle&&this.hide(),this.activeEle=t,this.blot=e,this.showOverlay(),this.initializeModules(),!0):!1}handleChange(e,t,r){if(this.updateFromModule){this.updateFromModule=!1;return}r!=="user"||!this.overlay||!this.activeEle||this.onUpdate()}showOverlay(){this.overlay&&this.hideOverlay(),this.quill.setSelection(null),[document.body,this.quill.root].forEach(e=>e.style.userSelect="none"),this.overlay=document.createElement("div"),this.overlay.className=`${af[Bp.OVERLAY]}`,this.overlay.addEventListener("wheel",e=>{e.preventDefault(),e.stopPropagation(),this.quill.root.scrollTop+=e.deltaY*.5},{passive:!1}),this.quill.container.appendChild(this.overlay),this.hideProxy=()=>this.activeEle&&this.hide(),this.updateOverlayPositionProxy=()=>this.overlay&&(this.overlay.style.marginTop=-1*this.quill.root.scrollTop+"px"),this.quill.root.addEventListener("input",this.hideProxy,!0),this.quill.root.addEventListener("scroll",this.updateOverlayPositionProxy),this.repositionElements()}hideOverlay(){this.overlay&&(this.quill.container.removeChild(this.overlay),this.overlay=void 0,this.hideProxy&&this.quill.root.removeEventListener("input",this.hideProxy,!0),this.updateOverlayPositionProxy&&this.quill.root.removeEventListener("scroll",this.updateOverlayPositionProxy),[document.body,this.quill.root].forEach(e=>e.style.userSelect=""))}repositionElements(){if(!this.overlay||!this.activeEle)return;const e=this.quill.container,t=this.activeEle.getBoundingClientRect(),r=e.getBoundingClientRect();Object.assign(this.overlay.style,{left:`${t.left-r.left-1+e.scrollLeft}px`,top:`${t.top-r.top+this.quill.root.scrollTop}px`,width:`${t.width}px`,height:`${t.height}px`,marginTop:-1*this.quill.root.scrollTop+"px"})}addBlotsSelectedClass(e){if(!e){this.selectedBlots=[];return}try{const t=i=>{var o;return["image","iframe","video"].includes((o=i.statics)==null?void 0:o.blotName)},r=this.quill.scroll.descendants(t,e.index,e.length);this.selectedBlots=r.filter(i=>!i.statics||!this.options.contentOptions?!1:!!this.options.contentOptions.find(o=>o.blotName===i.statics.blotName))}catch{}}hide(){this.hideOverlay(),this.modules.forEach(e=>e.onDestroy()),this.modules=[],this.activeEle=void 0,this.blot=void 0}}Ee(A_,"Modules",{Base:Xp,DisplaySize:Tz,Toolbar:cm,Resize:Az,Keyboard:vv});const N0=Xe.import("delta"),Rz=Xe.import("modules/clipboard");function Iz(n){let e=Number.parseFloat(n.getAttribute("width")||String(Ss.colDefaultWidth));if(Number.isNaN(e)){const t=n.style.width;e=t?Number.parseFloat(t):n.offsetWidth}return e}function kz(n,e){const t=new Array(e).fill(Ss.colDefaultWidth),r=Array.from(n.querySelectorAll("tr"));for(const i of r){const o=Array.from(i.querySelectorAll("td"));for(const[l,a]of o.entries())if(l<e){const h=Iz(a);t[l]=h||t[l]}else break}return t}class Mz extends Rz{constructor(t,r){super(t,r);Ee(this,"tableId",Fa());Ee(this,"rowId",Fa());Ee(this,"colIds",[]);Ee(this,"rowspanCount",[]);Ee(this,"cellCount",0);Ee(this,"colCount",0);Ee(this,"STYLE_PROPERTIES",["color","background","background-color","mso-pattern","border","border-color","border-top","border-right","border-bottom","border-left"]);this.quill=t,this.addMatcher("table",this.matchTable.bind(this)),this.addMatcher("colgroup",this.matchColgroup.bind(this)),this.addMatcher("col",this.matchCol.bind(this)),this.addMatcher("tr",this.matchTr.bind(this)),this.addMatcher("td",this.matchTd.bind(this)),this.addMatcher("th",this.matchTd.bind(this)),this.addMatcher("caption",this.matchCaption.bind(this))}matchTable(t,r){if(r.ops.length===0)return r;const i=[],o=[];let l=-1;for(let g=0;g<r.ops.length;g++){const{attributes:m,insert:x}=r.ops[g],{table:w,[Qe.tableCell]:_,...S}=m||{},R=tg.isObject(x)&&x[Qe.tableCol];R?o.push({insert:x}):i.push({attributes:S,insert:x}),!(S!=null&&S[Qe.tableCellInner])&&!R&&(l=g)}const h=kz(t,this.colIds.length).reduce((g,m,x)=>(o[x]?g.push(o[x]):g.push({insert:{[Qe.tableCol]:{tableId:this.tableId,colId:this.colIds[x],width:m,full:!0}}}),g),[]);return i.splice(l+1,0,...h),this.tableId=Fa(),this.colIds=[],this.rowspanCount=[],this.cellCount=0,this.colCount=0,new N0(i)}matchColgroup(t,r){const i=[];for(let o=0;o<r.ops.length;o++){const l=r.ops[o];l&&tg.isObject(l.insert)&&l.insert[Qe.tableCol]&&i.push(l)}return new N0(i)}matchCol(t){this.colIds[this.colCount]=Fa();const r=new N0().insert({[Qe.tableCol]:Object.assign(Ig.value(t),{tableId:this.tableId,colId:this.colIds[this.colCount]})});return this.colCount+=1,r}matchTr(t,r){this.rowId=Fa(),this.cellCount=0;for(const[i,o]of this.rowspanCount.entries())o.rowspan>0&&(o.rowspan-=1),o.rowspan<=0&&(this.rowspanCount[i]={rowspan:0,colspan:0});return r}matchTd(t,r){const i=t,o=Nf.formats(i);if(!this.colIds[this.cellCount]||!this.rowspanCount[this.cellCount])for(let m=this.cellCount;m>=0;m--)this.colIds[m]||(this.colIds[m]=Fa()),this.rowspanCount[m]||(this.rowspanCount[m]={rowspan:0,colspan:0});const{colspan:l}=this.rowspanCount[this.cellCount];this.cellCount+=l,o.rowspan>0&&(this.rowspanCount[this.cellCount]={rowspan:o.rowspan,colspan:o.colspan});const a=this.colIds[this.cellCount];this.cellCount+=o.colspan;const h=Object.assign(o,{tableId:this.tableId,rowId:this.rowId,colId:a});this.handleBorderNoneStyles(i,h);const g=[];for(const m of r.ops){const{attributes:x={},...w}=m,{[Qe.tableCell]:_,...S}=x;g.push({...w,attributes:{...S,[Qe.tableCellInner]:h}})}return(g.length<=0||!tg.isString(g[g.length-1].insert)||!g[g.length-1].insert.endsWith(`
479
479
  `))&&g.push({insert:`
480
- `,attributes:{[Qe.tableCellInner]:h}}),new N0(g)}handleBorderNoneStyles(t,r){if(!(r!=null&&r.style))return;["border",...["top","right","bottom","left"].flatMap(o=>[`border-${o}`,`border-${o}-style`])].filter(o=>t.style[o]==="none").forEach(o=>r.style=r.style.replaceAll(new RegExp(`${o}:none;?`,"g"),""))}convert({html:t,text:r},i={}){if(t){const a=new DOMParser().parseFromString(t,"text/html");this.preprocessTableHtml(a),this.mergeClassStylesToInline(a),t=a.body.innerHTML}const o=super.convert({html:t,text:r},i);if(i[Qe.tableCellInner])for(const l of o.ops){if(tg.isObject(l.insert)&&l.insert[Qe.tableCol]){l.insert="";continue}l.attributes||(l.attributes={}),l.attributes[Qe.tableCellInner]=i[Qe.tableCellInner]}return o}parseStyleWithFilter(t,r){if(!t)return{};const i={};let o="",l="",a=!0,h=0;for(let g=0;g<t.length;g++){const m=t[g];m===":"&&a?(o=t.substring(h,g).trim(),h=g+1,a=!1):m===";"&&(!a&&o&&(l=t.substring(h,g).trim(),(!r||r(o))&&(i[o]=l)),h=g+1,a=!0)}return!a&&o&&h<t.length&&(l=t.substring(h).trim(),(!r||r(o))&&(i[o]=l)),i}mergeClassStylesToInline(t){var r;try{const i=t.querySelectorAll("td[class], th[class]");if(i.length===0)return;const o=new Set;for(const m of i)(m.getAttribute("class")||"").split(/\s+/).filter(Boolean).forEach(w=>o.add(w));if(o.size===0)return;const l=t.querySelectorAll("style");if(l.length===0)return;const a=Array.from(l).map(m=>m.textContent||"").join("");if(!a)return;const h={},g=m=>this.STYLE_PROPERTIES.some(x=>m.startsWith(x));for(const m of o){const x=new RegExp(`\\.${m}[^{]*{([^}]*)}`,"g");let w;for(;(w=x.exec(a))!==null;){const _=w[1],S=this.parseStyleWithFilter(_),R={};let k=!1;for(const O in S)g(O)&&(R[O]=S[O],k=!0);k&&(h[m]=R)}}if(Object.keys(h).length===0)return;for(let m=0;m<i.length;m++){const x=i[m],w=((r=x.getAttribute("class"))==null?void 0:r.split(/\s+/).filter(Boolean))||[],_=x.getAttribute("style")||"",S=this.parseStyleWithFilter(_);let R=!1;for(const k of w){const O=h[k];if(O)for(const P in O)S[P]||(S[P]=O[P],R=!0)}if(R){let k="";for(const O in S)k+=O+":"+S[O]+";";k&&x.setAttribute("style",k)}x.removeAttribute("class")}}catch(i){console.error("스타일 처리 오류",i)}}matchCaption(t,r){for(let i=0;i<r.ops.length;i++){const o=r.ops[i],{attributes:l}=o;l&&l[Qe.tableCaption]&&(l[Qe.tableCaption].tableId=this.tableId,o.attributes=l)}return r}preprocessTableHtml(t){try{const r=t.querySelectorAll("table");for(const i of Array.from(r))i.querySelectorAll("tr").length!==0&&(this.cleanupTableStyles(i),this.applyRowspanHeights(i),this.fixRowspanCells(i));this.mergeClassStylesToInline(t)}catch(r){console.error("테이블 전처리 오류",r)}}cleanupTableStyles(t){const r=t.querySelectorAll("td, th, tr, colgroup");for(const i of r){const o=i;o.removeAttribute("height");const l=o.getAttribute("style");if(l){const a=l.replace(/height\s*:[^;]*;?/gi,"").trim();o.setAttribute("style",a||"")}}}applyRowspanHeights(t){const i=t.querySelectorAll("td, th");t.style.borderCollapse="collapse";for(const o of i){const l=o,h=parseInt(l.getAttribute("rowspan")||"1")*24,g=l.getAttribute("style")||"",m=g+(g?"; ":"")+`height: ${h}px`;l.setAttribute("style",m)}}fixRowspanCells(t){const r=t.querySelectorAll("tr");if(r.length<=1)return;const i=[],o=new Map;for(let l=0;l<r.length;l++){const h=r[l].querySelectorAll("td, th");if(h.length===0&&l<r.length-1){i.push(l);continue}for(const g of Array.from(h)){const m=parseInt(g.getAttribute("rowspan")||"1");if(m>1)for(let x=1;x<m;x++){const w=l+x;if(w>=r.length)break;o.has(w)||o.set(w,[]),o.get(w).push(g)}}}i.length>0&&this.processEmptyRows(i,r,o)}processEmptyRows(t,r,i){for(const o of t){const l=i.get(o);if(l)for(const a of l){const h=parseInt(a.getAttribute("rowspan")||"1");h>1&&a.setAttribute("rowspan",(h-1).toString())}}for(const o of t.reverse())r[o].remove()}}class Mz extends E_{fixUnusuaDeletelTable(){}mergeCells(e){if(!this.table||!this.tableSelection)return;const t=this.tableSelection.selectedTds||[];if(t.length>1&&(e=t),!e||e.length<=1)return;const r=Kl(e[0],Qe.tableMain),i=r.getRows(),o=e.map(w=>{if(!w||!w.parent||!w.parent.domNode)return null;const _=w.parent.domNode;if(!_)return null;const S=i.findIndex(O=>O.rowId===w.rowId);if(S===-1)return null;const R=w.getColumnIndex();if(R===-1)return null;const k=_.getBoundingClientRect();return!k||k.width===0||k.height===0?null:{td:w,rowIndex:S,colIndex:R,rowspan:w.rowspan,colspan:w.colspan,visualLeft:k.left,visualRight:k.right,visualTop:k.top,visualBottom:k.bottom}}).filter(Boolean);if(o.length<=1)return;o.sort((w,_)=>w.visualTop-_.visualTop||w.visualLeft-_.visualLeft);const l=o[0],a=l.td,h=Math.max(...o.map(w=>w.rowIndex+w.rowspan-1)),g=Math.max(...o.map(w=>w.colIndex+w.colspan-1)),m=h-l.rowIndex+1,x=g-l.colIndex+1;for(const w of o)w.td!==a&&(w.td.moveChildren(a),w.td.parent.remove());a.rowspan=m,a.colspan=x,this.fixTableByRemove(r)}}Xe.register({"modules/imageCompress":Fp,"modules/resize":A_,"modules/tableUp":Mz,"modules/magicUrl":oF,"formats/divider":am,"modules/clipboard":kz,"modules/copy":cz,"modules/toggleFullscreen":r_},!0);const u1={KB:1024,QUALITY:.7,IMAGE_SIZES:new Map},Lz={getCharLength:n=>Array.from(n).length,calculateTextSize:n=>{if(!n.ops||n.ops.length===0)return 0;let e=0;for(const t of n.ops)if(typeof t.insert=="string")e+=new TextEncoder().encode(t.insert).length-1;else if(typeof t.insert=="object"&&t.insert.image){const r=t.insert.image;r&&(e+=u1.IMAGE_SIZES.get(r)||Math.ceil(r.length*u1.QUALITY))}return e}},Oz=n=>{const{type:e="Primary",editorRef:t,useValue:r,useError:i,placeholder:o,tabIndex:l,autoFocus:a,editorProps:h,style:g,minHeight:m,maxHeight:x,contentHeight:w,contentMaxHeight:_=1e3,toolbarSize:S="Med",toolbarType:R="Default",readOnly:k,limitPosition:O="Bottom",maxLength:P,size:z=100,editorClassName:H,editorStyle:G,noImageResize:N,...J}=n,[{wrapId:Y,wrapProps:K,labelProps:fe,...X},te]=Bg(J),ne=B.useMemo(()=>e==="ReadOnly"||k,[e,k]),ue=B.useMemo(()=>w?20:0,[w]),[se,$]=B.useState(S==="Med"?40:50),re=B.useMemo(()=>ne?0:se,[ne,se]),[ge,me]=B.useMemo(()=>!i||ne||O==="Top"?[0,0]:[20,6],[i,ne,O]),oe=B.useMemo(()=>ge+me,[ge,me]),[Q,pe]=B.useState(w),[Ie,Fe]=B.useState(!1),[xe,Oe]=B.useState(!1),Le=B.useRef(null),He=B.useRef(0),Te=B.useRef(0),ke=B.useMemo(()=>X.label?24:0,[X.label]),Be=B.useMemo(()=>R==="Title",[R]),rt=B.useMemo(()=>w||m||Be,[w,m,Be]),Re=B.useMemo(()=>rt?"fit-content":x?x+ke:`calc(100% - ${ke}px)`,[rt,x,ke]),ut=B.useMemo(()=>{if(w){if(Q)switch(e){case"ReadOnly":return Q;case"Raw":return Q+oe;default:return Q+re+oe}}else return},[w,Q,e,re,oe]),qe=B.useMemo(()=>{if(!(!x||x<=re+oe))switch(e){case"ReadOnly":return x;case"Raw":return x-oe;default:return x-re-oe}},[e,re,oe,x]),ot=B.useMemo(()=>{if(m&&w){const lt=Math.min(m-re-oe,w);return ne?lt:lt+re+oe}else return m||(w?void 0:`calc(100% - ${ke}px)`)},[m,w,ke,re,oe,ne]),st=B.useMemo(()=>(Array.isArray(X.errorMessage)?X.errorMessage.some(Boolean):!!X.errorMessage)?"Error":e,[X.errorMessage,e]),bt=B.useCallback(lt=>{let kt=lt;kt=h7.sanitize(lt);const vt=document.createElement("div");return vt.innerHTML=kt,new Xe(vt,{readOnly:!0}).getContents()},[]),[Mt,Bt]=Fo(r,""),[at,Ye]=B.useState(()=>bt(Mt));B.useEffect(()=>{Bt===void 0&&Ye(bt(Mt))},[bt,Bt,Mt]);const Tt=B.useMemo(()=>M.jsx(Pz,{htmlDelta:at,isReadonly:ne,limit:z*u1.KB,useError:i}),[at,ne,z,i]),Ut=B.useRef(null),gt=B.useRef([]),[Ht,xt]=B.useState(!0);B.useEffect(()=>{const lt=setTimeout(()=>xt(!1),0);return()=>{clearTimeout(lt),gt.current.forEach(kt=>kt()),gt.current=[]}},[]);const pn=B.useCallback((lt,kt)=>{if(!w)return kt;const vt=m?m-re-oe:w,zt=Math.max(vt,0),Lt=x?x-re-oe:_;return Math.min(Lt,Math.max(zt,kt+lt))},[w,m,re,oe,x,_]),$t=B.useCallback(lt=>{if(!Ie||!w)return;const kt=lt.clientY-Te.current,vt=pn(kt,He.current);Q!==vt&&pe(vt),lt.preventDefault(),lt.stopPropagation()},[Ie,w,pn,Q]),sn=B.useCallback(lt=>{Fe(!1),Oe(!1),document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",sn),lt.preventDefault(),lt.stopPropagation()},[$t]),Xt=B.useCallback(lt=>{if(!w)return;if(lt.detail===2){pe(w);return}Q===void 0?(pe(w),He.current=w):He.current=Q,Fe(!0),Oe(!0),Te.current=lt.clientY;const kt=zt=>{if(!w)return;const Lt=zt.clientY-Te.current,yt=pn(Lt,He.current);pe(yt),zt.preventDefault(),zt.stopPropagation()},vt=zt=>{Fe(!1),Oe(!1),document.removeEventListener("mousemove",kt),document.removeEventListener("mouseup",vt),zt.preventDefault(),zt.stopPropagation()};document.addEventListener("mousemove",kt),document.addEventListener("mouseup",vt),lt.preventDefault(),lt.stopPropagation()},[w,Q,pn]),bn=B.useCallback((lt,kt,vt,zt)=>{if(vt!=="user"&&vt!=="api")return;const Lt=zt.getContents(),yt=zt.getLength()-1,Rt=P!==void 0&&yt>P,on=er=>er.replace(/\s{2,}/g,wn=>"&nbsp;".repeat(wn.length)),En=lt.replace(/^<p><br><\/p>$/,"").trim(),Jt=on(En);if(!Rt){Ye(Lt),Bt==null||Bt(Jt);return}const xn=hn(Lt,P);Ye(xn);const _n=new Xe(document.createElement("div"));_n.setContents(xn);const zn=on(_n.root.innerHTML.replace(/^<p><br><\/p>$/,"").trim());Bt==null||Bt(zn)},[P,Bt]),hn=(lt,kt)=>{var Lt,yt,Rt;if(!lt.ops)return lt;const vt=new Xn;let zt=0;for(const on of lt.ops){if(zt>=kt)break;if(on.insert&&typeof on.insert=="string"){const En=on.insert,Jt=kt-zt;if(En.length<=Jt)(Lt=vt.ops)==null||Lt.push(on),zt+=En.length;else{const xn={...on,insert:En.substring(0,Jt)};(yt=vt.ops)==null||yt.push(xn),zt+=Jt;break}}else zt<kt&&((Rt=vt.ops)==null||Rt.push(on),zt+=1)}return vt},Rn=B.useCallback(lt=>{var Lt,yt;const kt=lt.getEditor().container;if(!kt)return null;const vt=(Lt=kt.closest(".AEditorContainer"))==null?void 0:Lt.querySelector(".ql-toolbar");return vt||((yt=kt.parentElement)==null?void 0:yt.querySelector(".ql-toolbar"))||null},[]),vn=B.useCallback((lt,kt,vt,zt)=>{if(!lt)return;const Lt=vt;lt.addEventListener(kt,Lt,zt),gt.current.push(()=>lt.removeEventListener(kt,Lt,zt))},[]),We=B.useCallback((lt,kt,vt)=>{const zt=kt.getFormat();lt.forEach(Lt=>{if(zt[Lt]){const yt=zt[Lt],Rt=`.ql-${Lt}`,on=vt.querySelector(`${Rt} .ql-picker-label`),En=vt.querySelectorAll(`${Rt} .ql-picker-item`),Jt=Array.from(En).find(xn=>xn.getAttribute("data-value")===yt);Jt&&(Jt.classList.add("ql-selected"),on==null||on.classList.add("ql-active"))}})},[]),Ce=B.useCallback(lt=>{if(!lt.length)return;const zt=lt[0].target.getBoundingClientRect(),Lt=Math.ceil(zt.height);$(yt=>Math.abs(yt-Lt)<.1?yt:Lt)},[]),it=B.useCallback((lt,kt)=>{if(lt.key!=="Backspace")return;const vt=kt.getSelection(!1);if(!vt||vt.length>0)return;const zt=vt.index;if(zt<=0)return;const[Lt]=kt.getLine(zt);if(Lt&&zt===kt.getIndex(Lt)||kt.getFormat(zt,1).link)return;const yt=kt.getFormat(zt-1,1);if(yt.link){lt.preventDefault();let Rt=zt-1;for(;Rt>0&&kt.getFormat(Rt-1,1).link===yt.link;)Rt--;const[on]=kt.scroll.descendant(En=>{var Jt;return((Jt=En==null?void 0:En.statics)==null?void 0:Jt.blotName)==="link"},Rt);if(on!=null&&on.domNode){const En=(on.domNode.textContent||"").length;kt.removeFormat(Rt,En)}}},[]),Ct=B.useCallback(()=>({clipboard:{matchers:[["img",()=>!1],["table",()=>!1],["iframe",()=>!1],["video",()=>!1],["h1, h2, h3, h4, h5, h6",()=>!1],["blockquote",()=>!1],["hr",()=>!1]]},copy:{isTitleMode:!0},keyboard:{bindings:{enter:{key:"Enter",handler:()=>!1},newline:{key:"Enter",shiftKey:!0,handler:()=>!1},tab:{key:"Tab",handler:()=>!1},"remove-newline":{key:"Backspace",collapsed:!0,format:["blockquote","list","code-block"],offset:0,handler:function(lt){const{blockquote:kt,list:vt,["code-block"]:zt}=lt.getFormat();return kt||vt||zt?(lt.format("blockquote",!1),lt.format("list",!1),lt.format("code-block",!1),!1):!0}}}},magicUrl:!0,toolbar:{container:[["bold","italic","underline","strike",{color:[]},{background:[]},"clean"]]}}),[]),Qt=B.useCallback(()=>({clipboard:{},copy:{},keyboard:{},magicUrl:!0,toggleFullscreen:{type:st,maximize:a1.renderToString(M.jsx(fo,{icon:"Maximize",size:S==="Med"?"sm":"md"})),minimize:a1.renderToString(M.jsx(fo,{icon:"Minimize",size:S==="Med"?"sm":"md"}))},imageCompress:{quality:u1.QUALITY,imageType:"image/jpeg",maxWidth:1500,maxHeight:1500,debug:!1,handleOnPaste:lt=>{var kt,vt;try{const zt=(kt=lt.clipboardData)==null?void 0:kt.items;if(!zt)return!0;const Lt=Array.from(zt).some(on=>{const En=on.type.toLowerCase();return En.includes("Excel")||En.includes("text/html")}),yt=(vt=lt.clipboardData)==null?void 0:vt.getData("text/html"),Rt=yt&&(yt.includes("<table")||yt.includes("<tbody")||yt.includes("<td"));return!(Lt||Rt)}catch(zt){return console.warn("Error in handleOnPaste:",zt),!0}},insertIntoEditor:(lt,kt,vt)=>{u1.IMAGE_SIZES.has(lt)||u1.IMAGE_SIZES.set(lt,kt.size);const zt=vt.getSelection();zt&&vt.insertEmbed(zt.index,"image",lt,Xe.sources.USER)}},...!ne&&{...!N&&{resize:{}},table:!1,tableUp:{fullSwitch:!1,icon:a1.renderToString(M.jsx(fo,{icon:"Table",size:S==="Med"?"sm":"md",strokeWidth:2.5})),resize:GB,resizeScale:YB,customSelect:qB,selection:ZB,fixUnusuaDeletelTable:!1,selectionOptions:{tableMenu:WB,tableMenuOptions:{localstorageKey:"used-color",tipText:!0,tools:[io.InsertCaption,io.InsertTop,io.InsertRight,io.InsertBottom,io.InsertLeft,io.Break,io.MergeCell,io.SplitCell,io.Break,io.DeleteRow,io.DeleteColumn,io.DeleteTable,io.Break,io.BackgroundColor,io.BorderColor,io.Break,io.CopyCell,io.CutCell,io.Break,io.SwitchWidth]}},texts:{fullCheckboxText:Or.AEditor["Insert Full Width Table"],customBtnText:Or.AEditor.Custom,confirmText:Or.AEditor.Confirm,cancelText:Or.AEditor.Cancel,rowText:Or.AEditor.Row,colText:Or.AEditor.Column,CopyCell:Or.AEditor["Copy Cell"],CutCell:Or.AEditor["Cut Cell"],notPositiveNumberError:Or.AEditor["Not Positive Number Error"],custom:Or.AEditor.Custom,clear:Or.AEditor.Clear,transparent:Or.AEditor.Transparent,perWidthInsufficient:Or.AEditor.perWidthInsufficient,InsertTop:Or.AEditor["Insert Row Top"],InsertRight:Or.AEditor["Insert Column Right"],InsertBottom:Or.AEditor["Insert Row Bottom"],InsertLeft:Or.AEditor["Insert Column Left"],MergeCell:Or.AEditor["Merge Cell"],SplitCell:Or.AEditor["Split Cell"],DeleteRow:Or.AEditor["Delete Row"],DeleteColumn:Or.AEditor["Delete Column"],DeleteTable:Or.AEditor["Delete Table"],BackgroundColor:Or.AEditor["Set Background Color"],BorderColor:Or.AEditor["Set Border Color"],SwitchWidth:Or.AEditor["Switch Table Width"],InsertCaption:Or.AEditor["Insert Table Caption"]}},toolbar:{container:[[{header:[1,2,3,!1,4]}],["bold","italic","underline","strike","blockquote","divider",{[E_.toolName]:[]},{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],handlers:{divider:function(){const lt=this.quill,kt=lt.getSelection(!0);if(!kt)return;const vt=Math.min(kt.index+1,lt.getLength()-1);lt.insertEmbed(vt,"divider",!0,Xe.sources.USER),setTimeout(()=>lt.setSelection(Math.min(vt+1,lt.getLength()-1),0,Xe.sources.SILENT),0)}}}}}),[ne,N,S,st]),Yt=B.useMemo(()=>Be?Ct():Qt(),[Be,Ct,Qt]),yn=B.useCallback(lt=>{if(!lt)return;const kt=lt.getEditor();if(!kt)return;const vt=kt.root,zt=Rn(lt);vt&&H&&vt.classList.add(...H.split(" ")),vt&&G&&Object.entries(G).forEach(([yt,Rt])=>{const on=yt.replace(/([A-Z])/g,En=>`-${En[0].toLowerCase()}`);vt.style[on]=Rt}),vn(vt,"keydown",yt=>it(yt,kt));const Lt=new ResizeObserver(Ce);if(zt){Lt.observe(zt),gt.current.push(()=>Lt.disconnect());const yt=["header","color","background"];yt.forEach(Rt=>{const on=zt.querySelector(`.ql-${Rt} .ql-picker-label`);on&&vn(on,"click",()=>We(yt,kt,zt))})}},[Rn,H,G,vn,Ce,it,We]),gn=B.useCallback(lt=>{if(gt.current.forEach(vt=>vt()),gt.current=[],Ut.current=lt,!lt){tg.isFunction(t)?t(null):t!=null&&t.current&&(t.current=null);return}const kt=lt;kt.copyContent=vt=>{lt.getEditor().getModule("copy").copyContent(vt)},tg.isFunction(t)?t(kt):t&&(t.current=kt),yn(lt)},[t,yn]);return M.jsx(lg,{wrapId:Y,...X,label:M.jsxs(Ml,{style:{gap:4},children:[X.label,O==="Top"&&Tt]}),labelProps:{...fe,style:{minHeight:X.label?20:void 0,marginBottom:X.label?4:0,...fe==null?void 0:fe.style}},wrapProps:{...K,className:dt.clsx(K==null?void 0:K.className,!rt&&af.AEditorWrapper),style:{...K==null?void 0:K.style,height:Re}},children:M.jsxs(zi,{...te,className:dt.clsx(te.className,af.AEditorContainer,Ht&&"NoTransition"),style:{...g,height:ut,minHeight:ot},children:[M.jsx(Pv,{...h,ref:gn,preserveWhitespace:!0,modules:Yt,placeholder:o,readOnly:ne,theme:"snow",value:at,className:dt.clsx(h==null?void 0:h.className,af.AEditor,af[st],Be&&"Title",Ht&&"NoTransition"),style:{...h==null?void 0:h.style,maxHeight:qe?qe+re:void 0,"--icon-size":`${S==="Med"?20:24}px`,"--editor-padding":Be?"8px 12px":"12px","--toolbar-padding":`${S==="Med"?7.5:12.5}px`,"--content-height":Be?"fit-content":Q?`${Q}px`:"100%","--content-max-height":qe?`${qe}px`:"100%","--default-text":`'${Or.AEditor.Default}'`,"--visit-url-text":`'${Or.AEditor["Visit URL:"]}'`,"--enter-link-text":`'${Or.AEditor["Enter link:"]}'`,"--enter-video-text":`'${Or.AEditor["Enter video:"]}'`,"--edit-text":`'${Or.AEditor.Edit}'`,"--save-text":`'${Or.AEditor.Save}'`,"--remove-text":`'${Or.AEditor.Remove}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(a1.renderToString(M.jsx(fo,{icon:"EditorArrow"})))}`,"--title-color-picker-row":Be?1:4,"--title-header-font-size":`${S==="Med"?12:14}px`},onChange:bn}),w&&M.jsxs(M.Fragment,{children:[M.jsx("div",{ref:Le,className:dt.clsx(af.Resizer,Ht&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0},onMouseDown:Xt}),M.jsx("div",{children:`${Math.round(Q)}px`,className:dt.clsx(af.Indicator,"NoSelect","Label1",Ht&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0,display:xe?"flex":"none"}})]}),M.jsx("div",{children:Tt,className:dt.clsx(af.LimitContainer,"NoSelect",Ht&&"NoTransition"),style:{marginTop:me,minHeight:ge,display:O==="Bottom"?"flex":"none"}})]})})},Pz=n=>{const e=Gn.c(17),{htmlDelta:t,limit:r,useError:i,isReadonly:o}=n,[l,a]=Fo(i,!1),h=Lz.calculateTextSize(t);let g,m;if(e[0]!==h||e[1]!==r||e[2]!==a?(g=()=>{a&&a(h>r)},m=[h,r,a],e[0]=h,e[1]=r,e[2]=a,e[3]=g,e[4]=m):(g=e[3],m=e[4]),B.useEffect(g,m),!i||o)return null;let x;e[5]!==l?(x=dt.clsx(l&&af.Error),e[5]=l,e[6]=x):x=e[6];let w;e[7]!==h?(w=Mg(h),e[7]=h,e[8]=w):w=e[8];let _;e[9]!==x||e[10]!==w?(_=M.jsx("span",{className:x,children:w}),e[9]=x,e[10]=w,e[11]=_):_=e[11];let S;e[12]!==r?(S=Mg(r),e[12]=r,e[13]=S):S=e[13];let R;return e[14]!==_||e[15]!==S?(R=M.jsxs(nd,{className:af.Limit,children:["(",_," / ",S,")"]}),e[14]=_,e[15]=S,e[16]=R):R=e[16],R};function Dz(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return B.useMemo(()=>r=>{e.forEach(i=>i(r))},e)}const zv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N1(n){const e=Object.prototype.toString.call(n);return e==="[object Window]"||e==="[object global]"}function jm(n){return"nodeType"in n}function uf(n){var e,t;return n?N1(n)?n:jm(n)&&(e=(t=n.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function $m(n){const{Document:e}=uf(n);return n instanceof e}function Kp(n){return N1(n)?!1:n instanceof uf(n).HTMLElement}function R_(n){return n instanceof uf(n).SVGElement}function F1(n){return n?N1(n)?n.document:jm(n)?$m(n)?n:Kp(n)||R_(n)?n.ownerDocument:document:document:document}const ld=zv?B.useLayoutEffect:B.useEffect;function e2(n){const e=B.useRef(n);return ld(()=>{e.current=n}),B.useCallback(function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function Nz(){const n=B.useRef(null),e=B.useCallback((r,i)=>{n.current=setInterval(r,i)},[]),t=B.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[e,t]}function zp(n,e){e===void 0&&(e=[n]);const t=B.useRef(n);return ld(()=>{t.current!==n&&(t.current=n)},e),t}function Jp(n,e){const t=B.useRef();return B.useMemo(()=>{const r=n(t.current);return t.current=r,r},[...e])}function bv(n){const e=e2(n),t=B.useRef(null),r=B.useCallback(i=>{i!==t.current&&(e==null||e(i,t.current)),t.current=i},[]);return[t,r]}function um(n){const e=B.useRef();return B.useEffect(()=>{e.current=n},[n]),e.current}let Pb={};function Qp(n,e){return B.useMemo(()=>{if(e)return e;const t=Pb[n]==null?0:Pb[n]+1;return Pb[n]=t,n+"-"+t},[n,e])}function I_(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((o,l)=>{const a=Object.entries(l);for(const[h,g]of a){const m=o[h];m!=null&&(o[h]=m+n*g)}return o},{...e})}}const m1=I_(1),yv=I_(-1);function Fz(n){return"clientX"in n&&"clientY"in n}function t2(n){if(!n)return!1;const{KeyboardEvent:e}=uf(n.target);return e&&n instanceof e}function Bz(n){if(!n)return!1;const{TouchEvent:e}=uf(n.target);return e&&n instanceof e}function fm(n){if(Bz(n)){if(n.touches&&n.touches.length){const{clientX:e,clientY:t}=n.touches[0];return{x:e,y:t}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:e,clientY:t}=n.changedTouches[0];return{x:e,y:t}}}return Fz(n)?{x:n.clientX,y:n.clientY}:null}const Hp=Object.freeze({Translate:{toString(n){if(!n)return;const{x:e,y:t}=n;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:e,scaleY:t}=n;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(n){if(n)return[Hp.Translate.toString(n),Hp.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:e,duration:t,easing:r}=n;return e+" "+t+"ms "+r}}}),Mw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function zz(n){return n.matches(Mw)?n:n.querySelector(Mw)}const Hz={display:"none"};function Wz(n){let{id:e,value:t}=n;return B.createElement("div",{id:e,style:Hz},t)}function Uz(n){let{id:e,announcement:t,ariaLiveType:r="assertive"}=n;const i={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 B.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},t)}function Gz(){const[n,e]=B.useState("");return{announce:B.useCallback(r=>{r!=null&&e(r)},[]),announcement:n}}const k_=B.createContext(null);function Yz(n){const e=B.useContext(k_);B.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(n)},[n,e])}function Vz(){const[n]=B.useState(()=>new Set),e=B.useCallback(r=>(n.add(r),()=>n.delete(r)),[n]);return[B.useCallback(r=>{let{type:i,event:o}=r;n.forEach(l=>{var a;return(a=l[i])==null?void 0:a.call(l,o)})},[n]),e]}const Zz={draggable:`
480
+ `,attributes:{[Qe.tableCellInner]:h}}),new N0(g)}handleBorderNoneStyles(t,r){if(!(r!=null&&r.style))return;["border",...["top","right","bottom","left"].flatMap(o=>[`border-${o}`,`border-${o}-style`])].filter(o=>t.style[o]==="none").forEach(o=>r.style=r.style.replaceAll(new RegExp(`${o}:none;?`,"g"),""))}convert({html:t,text:r},i={}){if(t){const a=new DOMParser().parseFromString(t,"text/html");this.preprocessTableHtml(a),this.mergeClassStylesToInline(a),t=a.body.innerHTML}const o=super.convert({html:t,text:r},i);if(i[Qe.tableCellInner])for(const l of o.ops){if(tg.isObject(l.insert)&&l.insert[Qe.tableCol]){l.insert="";continue}l.attributes||(l.attributes={}),l.attributes[Qe.tableCellInner]=i[Qe.tableCellInner]}return o}parseStyleWithFilter(t,r){if(!t)return{};const i={};let o="",l="",a=!0,h=0;for(let g=0;g<t.length;g++){const m=t[g];m===":"&&a?(o=t.substring(h,g).trim(),h=g+1,a=!1):m===";"&&(!a&&o&&(l=t.substring(h,g).trim(),(!r||r(o))&&(i[o]=l)),h=g+1,a=!0)}return!a&&o&&h<t.length&&(l=t.substring(h).trim(),(!r||r(o))&&(i[o]=l)),i}mergeClassStylesToInline(t){var r;try{const i=t.querySelectorAll("td[class], th[class]");if(i.length===0)return;const o=new Set;for(const m of i)(m.getAttribute("class")||"").split(/\s+/).filter(Boolean).forEach(w=>o.add(w));if(o.size===0)return;const l=t.querySelectorAll("style");if(l.length===0)return;const a=Array.from(l).map(m=>m.textContent||"").join("");if(!a)return;const h={},g=m=>this.STYLE_PROPERTIES.some(x=>m.startsWith(x));for(const m of o){const x=new RegExp(`\\.${m}[^{]*{([^}]*)}`,"g");let w;for(;(w=x.exec(a))!==null;){const _=w[1],S=this.parseStyleWithFilter(_),R={};let k=!1;for(const O in S)g(O)&&(R[O]=S[O],k=!0);k&&(h[m]=R)}}if(Object.keys(h).length===0)return;for(let m=0;m<i.length;m++){const x=i[m],w=((r=x.getAttribute("class"))==null?void 0:r.split(/\s+/).filter(Boolean))||[],_=x.getAttribute("style")||"",S=this.parseStyleWithFilter(_);let R=!1;for(const k of w){const O=h[k];if(O)for(const P in O)S[P]||(S[P]=O[P],R=!0)}if(R){let k="";for(const O in S)k+=O+":"+S[O]+";";k&&x.setAttribute("style",k)}x.removeAttribute("class")}}catch(i){console.error("스타일 처리 오류",i)}}matchCaption(t,r){for(let i=0;i<r.ops.length;i++){const o=r.ops[i],{attributes:l}=o;l&&l[Qe.tableCaption]&&(l[Qe.tableCaption].tableId=this.tableId,o.attributes=l)}return r}preprocessTableHtml(t){try{const r=t.querySelectorAll("table");for(const i of Array.from(r))i.querySelectorAll("tr").length!==0&&(this.cleanupTableStyles(i),this.applyRowspanHeights(i),this.fixRowspanCells(i));this.mergeClassStylesToInline(t)}catch(r){console.error("테이블 전처리 오류",r)}}cleanupTableStyles(t){const r=t.querySelectorAll("td, th, tr, colgroup");for(const i of r){const o=i;o.removeAttribute("height");const l=o.getAttribute("style");if(l){const a=l.replace(/height\s*:[^;]*;?/gi,"").trim();o.setAttribute("style",a||"")}}}applyRowspanHeights(t){const i=t.querySelectorAll("td, th");t.style.borderCollapse="collapse";for(const o of i){const l=o,h=parseInt(l.getAttribute("rowspan")||"1")*24,g=l.getAttribute("style")||"",m=g+(g?"; ":"")+`height: ${h}px`;l.setAttribute("style",m)}}fixRowspanCells(t){const r=t.querySelectorAll("tr");if(r.length<=1)return;const i=[],o=new Map;for(let l=0;l<r.length;l++){const h=r[l].querySelectorAll("td, th");if(h.length===0&&l<r.length-1){i.push(l);continue}for(const g of Array.from(h)){const m=parseInt(g.getAttribute("rowspan")||"1");if(m>1)for(let x=1;x<m;x++){const w=l+x;if(w>=r.length)break;o.has(w)||o.set(w,[]),o.get(w).push(g)}}}i.length>0&&this.processEmptyRows(i,r,o)}processEmptyRows(t,r,i){for(const o of t){const l=i.get(o);if(l)for(const a of l){const h=parseInt(a.getAttribute("rowspan")||"1");h>1&&a.setAttribute("rowspan",(h-1).toString())}}for(const o of t.reverse())r[o].remove()}}class Lz extends E_{fixUnusuaDeletelTable(){}mergeCells(e){if(!this.table||!this.tableSelection)return;const t=this.tableSelection.selectedTds||[];if(t.length>1&&(e=t),!e||e.length<=1)return;const r=Kl(e[0],Qe.tableMain),i=r.getRows(),o=e.map(w=>{if(!w||!w.parent||!w.parent.domNode)return null;const _=w.parent.domNode;if(!_)return null;const S=i.findIndex(O=>O.rowId===w.rowId);if(S===-1)return null;const R=w.getColumnIndex();if(R===-1)return null;const k=_.getBoundingClientRect();return!k||k.width===0||k.height===0?null:{td:w,rowIndex:S,colIndex:R,rowspan:w.rowspan,colspan:w.colspan,visualLeft:k.left,visualRight:k.right,visualTop:k.top,visualBottom:k.bottom}}).filter(Boolean);if(o.length<=1)return;o.sort((w,_)=>w.visualTop-_.visualTop||w.visualLeft-_.visualLeft);const l=o[0],a=l.td,h=Math.max(...o.map(w=>w.rowIndex+w.rowspan-1)),g=Math.max(...o.map(w=>w.colIndex+w.colspan-1)),m=h-l.rowIndex+1,x=g-l.colIndex+1;for(const w of o)w.td!==a&&(w.td.moveChildren(a),w.td.parent.remove());a.rowspan=m,a.colspan=x,this.fixTableByRemove(r)}}Xe.register({"modules/imageCompress":Fp,"modules/resize":A_,"modules/tableUp":Lz,"modules/magicUrl":lF,"formats/divider":am,"modules/clipboard":Mz,"modules/copy":uz,"modules/toggleFullscreen":r_},!0);const u1={KB:1024,QUALITY:.7,IMAGE_SIZES:new Map},Oz={getCharLength:n=>Array.from(n).length,calculateTextSize:n=>{if(!n.ops||n.ops.length===0)return 0;let e=0;for(const t of n.ops)if(typeof t.insert=="string")e+=new TextEncoder().encode(t.insert).length-1;else if(typeof t.insert=="object"&&t.insert.image){const r=t.insert.image;r&&(e+=u1.IMAGE_SIZES.get(r)||Math.ceil(r.length*u1.QUALITY))}return e}},Pz=n=>{const{type:e="Primary",editorRef:t,useValue:r,useError:i,placeholder:o,tabIndex:l,autoFocus:a,editorProps:h,style:g,minHeight:m,maxHeight:x,contentHeight:w,contentMaxHeight:_=1e3,toolbarSize:S="Med",toolbarType:R="Default",readOnly:k,limitPosition:O="Bottom",maxLength:P,size:z=100,editorClassName:H,editorStyle:G,noImageResize:N,...J}=n,[{wrapId:Y,wrapProps:K,labelProps:fe,...X},te]=Bg(J),ne=B.useMemo(()=>e==="ReadOnly"||k,[e,k]),ue=B.useMemo(()=>w?20:0,[w]),[se,$]=B.useState(S==="Med"?40:50),re=B.useMemo(()=>ne?0:se,[ne,se]),[ge,me]=B.useMemo(()=>!i||ne||O==="Top"?[0,0]:[20,6],[i,ne,O]),oe=B.useMemo(()=>ge+me,[ge,me]),[Q,pe]=B.useState(w),[Ie,Fe]=B.useState(!1),[xe,Oe]=B.useState(!1),Le=B.useRef(null),He=B.useRef(0),Te=B.useRef(0),ke=B.useMemo(()=>X.label?24:0,[X.label]),Be=B.useMemo(()=>R==="Title",[R]),rt=B.useMemo(()=>w||m||Be,[w,m,Be]),Re=B.useMemo(()=>rt?"fit-content":x?x+ke:`calc(100% - ${ke}px)`,[rt,x,ke]),ut=B.useMemo(()=>{if(w){if(Q)switch(e){case"ReadOnly":return Q;case"Raw":return Q+oe;default:return Q+re+oe}}else return},[w,Q,e,re,oe]),qe=B.useMemo(()=>{if(!(!x||x<=re+oe))switch(e){case"ReadOnly":return x;case"Raw":return x-oe;default:return x-re-oe}},[e,re,oe,x]),ot=B.useMemo(()=>{if(m&&w){const lt=Math.min(m-re-oe,w);return ne?lt:lt+re+oe}else return m||(w?void 0:`calc(100% - ${ke}px)`)},[m,w,ke,re,oe,ne]),st=B.useMemo(()=>(Array.isArray(X.errorMessage)?X.errorMessage.some(Boolean):!!X.errorMessage)?"Error":e,[X.errorMessage,e]),bt=B.useCallback(lt=>{let kt=lt;kt=d7.sanitize(lt);const vt=document.createElement("div");return vt.innerHTML=kt,new Xe(vt,{readOnly:!0}).getContents()},[]),[Mt,Bt]=Fo(r,""),[at,Ye]=B.useState(()=>bt(Mt));B.useEffect(()=>{Bt===void 0&&Ye(bt(Mt))},[bt,Bt,Mt]);const Tt=B.useMemo(()=>M.jsx(Dz,{htmlDelta:at,isReadonly:ne,limit:z*u1.KB,useError:i}),[at,ne,z,i]),Ut=B.useRef(null),gt=B.useRef([]),[Ht,xt]=B.useState(!0);B.useEffect(()=>{const lt=setTimeout(()=>xt(!1),0);return()=>{clearTimeout(lt),gt.current.forEach(kt=>kt()),gt.current=[]}},[]);const pn=B.useCallback((lt,kt)=>{if(!w)return kt;const vt=m?m-re-oe:w,zt=Math.max(vt,0),Lt=x?x-re-oe:_;return Math.min(Lt,Math.max(zt,kt+lt))},[w,m,re,oe,x,_]),$t=B.useCallback(lt=>{if(!Ie||!w)return;const kt=lt.clientY-Te.current,vt=pn(kt,He.current);Q!==vt&&pe(vt),lt.preventDefault(),lt.stopPropagation()},[Ie,w,pn,Q]),sn=B.useCallback(lt=>{Fe(!1),Oe(!1),document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",sn),lt.preventDefault(),lt.stopPropagation()},[$t]),Xt=B.useCallback(lt=>{if(!w)return;if(lt.detail===2){pe(w);return}Q===void 0?(pe(w),He.current=w):He.current=Q,Fe(!0),Oe(!0),Te.current=lt.clientY;const kt=zt=>{if(!w)return;const Lt=zt.clientY-Te.current,yt=pn(Lt,He.current);pe(yt),zt.preventDefault(),zt.stopPropagation()},vt=zt=>{Fe(!1),Oe(!1),document.removeEventListener("mousemove",kt),document.removeEventListener("mouseup",vt),zt.preventDefault(),zt.stopPropagation()};document.addEventListener("mousemove",kt),document.addEventListener("mouseup",vt),lt.preventDefault(),lt.stopPropagation()},[w,Q,pn]),bn=B.useCallback((lt,kt,vt,zt)=>{if(vt!=="user"&&vt!=="api")return;const Lt=zt.getContents(),yt=zt.getLength()-1,Rt=P!==void 0&&yt>P,on=er=>er.replace(/\s{2,}/g,wn=>"&nbsp;".repeat(wn.length)),En=lt.replace(/^<p><br><\/p>$/,"").trim(),Jt=on(En);if(!Rt){Ye(Lt),Bt==null||Bt(Jt);return}const xn=hn(Lt,P);Ye(xn);const _n=new Xe(document.createElement("div"));_n.setContents(xn);const zn=on(_n.root.innerHTML.replace(/^<p><br><\/p>$/,"").trim());Bt==null||Bt(zn)},[P,Bt]),hn=(lt,kt)=>{var Lt,yt,Rt;if(!lt.ops)return lt;const vt=new Xn;let zt=0;for(const on of lt.ops){if(zt>=kt)break;if(on.insert&&typeof on.insert=="string"){const En=on.insert,Jt=kt-zt;if(En.length<=Jt)(Lt=vt.ops)==null||Lt.push(on),zt+=En.length;else{const xn={...on,insert:En.substring(0,Jt)};(yt=vt.ops)==null||yt.push(xn),zt+=Jt;break}}else zt<kt&&((Rt=vt.ops)==null||Rt.push(on),zt+=1)}return vt},Rn=B.useCallback(lt=>{var Lt,yt;const kt=lt.getEditor().container;if(!kt)return null;const vt=(Lt=kt.closest(".AEditorContainer"))==null?void 0:Lt.querySelector(".ql-toolbar");return vt||((yt=kt.parentElement)==null?void 0:yt.querySelector(".ql-toolbar"))||null},[]),vn=B.useCallback((lt,kt,vt,zt)=>{if(!lt)return;const Lt=vt;lt.addEventListener(kt,Lt,zt),gt.current.push(()=>lt.removeEventListener(kt,Lt,zt))},[]),We=B.useCallback((lt,kt,vt)=>{const zt=kt.getFormat();lt.forEach(Lt=>{if(zt[Lt]){const yt=zt[Lt],Rt=`.ql-${Lt}`,on=vt.querySelector(`${Rt} .ql-picker-label`),En=vt.querySelectorAll(`${Rt} .ql-picker-item`),Jt=Array.from(En).find(xn=>xn.getAttribute("data-value")===yt);Jt&&(Jt.classList.add("ql-selected"),on==null||on.classList.add("ql-active"))}})},[]),Ce=B.useCallback(lt=>{if(!lt.length)return;const zt=lt[0].target.getBoundingClientRect(),Lt=Math.ceil(zt.height);$(yt=>Math.abs(yt-Lt)<.1?yt:Lt)},[]),it=B.useCallback((lt,kt)=>{if(lt.key!=="Backspace")return;const vt=kt.getSelection(!1);if(!vt||vt.length>0)return;const zt=vt.index;if(zt<=0)return;const[Lt]=kt.getLine(zt);if(Lt&&zt===kt.getIndex(Lt)||kt.getFormat(zt,1).link)return;const yt=kt.getFormat(zt-1,1);if(yt.link){lt.preventDefault();let Rt=zt-1;for(;Rt>0&&kt.getFormat(Rt-1,1).link===yt.link;)Rt--;const[on]=kt.scroll.descendant(En=>{var Jt;return((Jt=En==null?void 0:En.statics)==null?void 0:Jt.blotName)==="link"},Rt);if(on!=null&&on.domNode){const En=(on.domNode.textContent||"").length;kt.removeFormat(Rt,En)}}},[]),Ct=B.useCallback(()=>({clipboard:{matchers:[["img",()=>!1],["table",()=>!1],["iframe",()=>!1],["video",()=>!1],["h1, h2, h3, h4, h5, h6",()=>!1],["blockquote",()=>!1],["hr",()=>!1]]},copy:{isTitleMode:!0},keyboard:{bindings:{enter:{key:"Enter",handler:()=>!1},newline:{key:"Enter",shiftKey:!0,handler:()=>!1},tab:{key:"Tab",handler:()=>!1},"remove-newline":{key:"Backspace",collapsed:!0,format:["blockquote","list","code-block"],offset:0,handler:function(lt){const{blockquote:kt,list:vt,["code-block"]:zt}=lt.getFormat();return kt||vt||zt?(lt.format("blockquote",!1),lt.format("list",!1),lt.format("code-block",!1),!1):!0}}}},magicUrl:!0,toolbar:{container:[["bold","italic","underline","strike",{color:[]},{background:[]},"clean"]]}}),[]),Qt=B.useCallback(()=>({clipboard:{},copy:{},keyboard:{},magicUrl:!0,toggleFullscreen:{type:st,maximize:a1.renderToString(M.jsx(fo,{icon:"Maximize",size:S==="Med"?"sm":"md"})),minimize:a1.renderToString(M.jsx(fo,{icon:"Minimize",size:S==="Med"?"sm":"md"}))},imageCompress:{quality:u1.QUALITY,imageType:"image/jpeg",maxWidth:1500,maxHeight:1500,debug:!1,handleOnPaste:lt=>{var kt,vt;try{const zt=(kt=lt.clipboardData)==null?void 0:kt.items;if(!zt)return!0;const Lt=Array.from(zt).some(on=>{const En=on.type.toLowerCase();return En.includes("Excel")||En.includes("text/html")}),yt=(vt=lt.clipboardData)==null?void 0:vt.getData("text/html"),Rt=yt&&(yt.includes("<table")||yt.includes("<tbody")||yt.includes("<td"));return!(Lt||Rt)}catch(zt){return console.warn("Error in handleOnPaste:",zt),!0}},insertIntoEditor:(lt,kt,vt)=>{u1.IMAGE_SIZES.has(lt)||u1.IMAGE_SIZES.set(lt,kt.size);const zt=vt.getSelection();zt&&vt.insertEmbed(zt.index,"image",lt,Xe.sources.USER)}},...!ne&&{...!N&&{resize:{}},table:!1,tableUp:{fullSwitch:!1,icon:a1.renderToString(M.jsx(fo,{icon:"Table",size:S==="Med"?"sm":"md",strokeWidth:2.5})),resize:YB,resizeScale:VB,customSelect:jB,selection:XB,fixUnusuaDeletelTable:!1,selectionOptions:{tableMenu:UB,tableMenuOptions:{localstorageKey:"used-color",tipText:!0,tools:[io.InsertCaption,io.InsertTop,io.InsertRight,io.InsertBottom,io.InsertLeft,io.Break,io.MergeCell,io.SplitCell,io.Break,io.DeleteRow,io.DeleteColumn,io.DeleteTable,io.Break,io.BackgroundColor,io.BorderColor,io.Break,io.CopyCell,io.CutCell,io.Break,io.SwitchWidth]}},texts:{fullCheckboxText:Or.AEditor["Insert Full Width Table"],customBtnText:Or.AEditor.Custom,confirmText:Or.AEditor.Confirm,cancelText:Or.AEditor.Cancel,rowText:Or.AEditor.Row,colText:Or.AEditor.Column,CopyCell:Or.AEditor["Copy Cell"],CutCell:Or.AEditor["Cut Cell"],notPositiveNumberError:Or.AEditor["Not Positive Number Error"],custom:Or.AEditor.Custom,clear:Or.AEditor.Clear,transparent:Or.AEditor.Transparent,perWidthInsufficient:Or.AEditor.perWidthInsufficient,InsertTop:Or.AEditor["Insert Row Top"],InsertRight:Or.AEditor["Insert Column Right"],InsertBottom:Or.AEditor["Insert Row Bottom"],InsertLeft:Or.AEditor["Insert Column Left"],MergeCell:Or.AEditor["Merge Cell"],SplitCell:Or.AEditor["Split Cell"],DeleteRow:Or.AEditor["Delete Row"],DeleteColumn:Or.AEditor["Delete Column"],DeleteTable:Or.AEditor["Delete Table"],BackgroundColor:Or.AEditor["Set Background Color"],BorderColor:Or.AEditor["Set Border Color"],SwitchWidth:Or.AEditor["Switch Table Width"],InsertCaption:Or.AEditor["Insert Table Caption"]}},toolbar:{container:[[{header:[1,2,3,!1,4]}],["bold","italic","underline","strike","blockquote","divider",{[E_.toolName]:[]},{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],handlers:{divider:function(){const lt=this.quill,kt=lt.getSelection(!0);if(!kt)return;const vt=Math.min(kt.index+1,lt.getLength()-1);lt.insertEmbed(vt,"divider",!0,Xe.sources.USER),setTimeout(()=>lt.setSelection(Math.min(vt+1,lt.getLength()-1),0,Xe.sources.SILENT),0)}}}}}),[ne,N,S,st]),Yt=B.useMemo(()=>Be?Ct():Qt(),[Be,Ct,Qt]),yn=B.useCallback(lt=>{if(!lt)return;const kt=lt.getEditor();if(!kt)return;const vt=kt.root,zt=Rn(lt);vt&&H&&vt.classList.add(...H.split(" ")),vt&&G&&Object.entries(G).forEach(([yt,Rt])=>{const on=yt.replace(/([A-Z])/g,En=>`-${En[0].toLowerCase()}`);vt.style[on]=Rt}),vn(vt,"keydown",yt=>it(yt,kt));const Lt=new ResizeObserver(Ce);if(zt){Lt.observe(zt),gt.current.push(()=>Lt.disconnect());const yt=["header","color","background"];yt.forEach(Rt=>{const on=zt.querySelector(`.ql-${Rt} .ql-picker-label`);on&&vn(on,"click",()=>We(yt,kt,zt))})}},[Rn,H,G,vn,Ce,it,We]),gn=B.useCallback(lt=>{if(gt.current.forEach(vt=>vt()),gt.current=[],Ut.current=lt,!lt){tg.isFunction(t)?t(null):t!=null&&t.current&&(t.current=null);return}const kt=lt;kt.copyContent=vt=>{lt.getEditor().getModule("copy").copyContent(vt)},tg.isFunction(t)?t(kt):t&&(t.current=kt),yn(lt)},[t,yn]);return M.jsx(lg,{wrapId:Y,...X,label:M.jsxs(Ml,{style:{gap:4},children:[X.label,O==="Top"&&Tt]}),labelProps:{...fe,style:{minHeight:X.label?20:void 0,marginBottom:X.label?4:0,...fe==null?void 0:fe.style}},wrapProps:{...K,className:dt.clsx(K==null?void 0:K.className,!rt&&af.AEditorWrapper),style:{...K==null?void 0:K.style,height:Re}},children:M.jsxs(zi,{...te,className:dt.clsx(te.className,af.AEditorContainer,Ht&&"NoTransition"),style:{...g,height:ut,minHeight:ot},children:[M.jsx(Pv,{...h,ref:gn,preserveWhitespace:!0,modules:Yt,placeholder:o,readOnly:ne,theme:"snow",value:at,className:dt.clsx(h==null?void 0:h.className,af.AEditor,af[st],Be&&"Title",Ht&&"NoTransition"),style:{...h==null?void 0:h.style,maxHeight:qe?qe+re:void 0,"--icon-size":`${S==="Med"?20:24}px`,"--editor-padding":Be?"8px 12px":"12px","--toolbar-padding":`${S==="Med"?7.5:12.5}px`,"--content-height":Be?"fit-content":Q?`${Q}px`:"100%","--content-max-height":qe?`${qe}px`:"100%","--default-text":`'${Or.AEditor.Default}'`,"--visit-url-text":`'${Or.AEditor["Visit URL:"]}'`,"--enter-link-text":`'${Or.AEditor["Enter link:"]}'`,"--enter-video-text":`'${Or.AEditor["Enter video:"]}'`,"--edit-text":`'${Or.AEditor.Edit}'`,"--save-text":`'${Or.AEditor.Save}'`,"--remove-text":`'${Or.AEditor.Remove}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(a1.renderToString(M.jsx(fo,{icon:"EditorArrow"})))}`,"--title-color-picker-row":Be?1:4,"--title-header-font-size":`${S==="Med"?12:14}px`},onChange:bn}),w&&M.jsxs(M.Fragment,{children:[M.jsx("div",{ref:Le,className:dt.clsx(af.Resizer,Ht&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0},onMouseDown:Xt}),M.jsx("div",{children:`${Math.round(Q)}px`,className:dt.clsx(af.Indicator,"NoSelect","Label1",Ht&&"NoTransition"),style:{height:ue,bottom:i&&!ne?oe:0,display:xe?"flex":"none"}})]}),M.jsx("div",{children:Tt,className:dt.clsx(af.LimitContainer,"NoSelect",Ht&&"NoTransition"),style:{marginTop:me,minHeight:ge,display:O==="Bottom"?"flex":"none"}})]})})},Dz=n=>{const e=Gn.c(17),{htmlDelta:t,limit:r,useError:i,isReadonly:o}=n,[l,a]=Fo(i,!1),h=Oz.calculateTextSize(t);let g,m;if(e[0]!==h||e[1]!==r||e[2]!==a?(g=()=>{a&&a(h>r)},m=[h,r,a],e[0]=h,e[1]=r,e[2]=a,e[3]=g,e[4]=m):(g=e[3],m=e[4]),B.useEffect(g,m),!i||o)return null;let x;e[5]!==l?(x=dt.clsx(l&&af.Error),e[5]=l,e[6]=x):x=e[6];let w;e[7]!==h?(w=Mg(h),e[7]=h,e[8]=w):w=e[8];let _;e[9]!==x||e[10]!==w?(_=M.jsx("span",{className:x,children:w}),e[9]=x,e[10]=w,e[11]=_):_=e[11];let S;e[12]!==r?(S=Mg(r),e[12]=r,e[13]=S):S=e[13];let R;return e[14]!==_||e[15]!==S?(R=M.jsxs(nd,{className:af.Limit,children:["(",_," / ",S,")"]}),e[14]=_,e[15]=S,e[16]=R):R=e[16],R};function Nz(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return B.useMemo(()=>r=>{e.forEach(i=>i(r))},e)}const zv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N1(n){const e=Object.prototype.toString.call(n);return e==="[object Window]"||e==="[object global]"}function jm(n){return"nodeType"in n}function uf(n){var e,t;return n?N1(n)?n:jm(n)&&(e=(t=n.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function $m(n){const{Document:e}=uf(n);return n instanceof e}function Kp(n){return N1(n)?!1:n instanceof uf(n).HTMLElement}function R_(n){return n instanceof uf(n).SVGElement}function F1(n){return n?N1(n)?n.document:jm(n)?$m(n)?n:Kp(n)||R_(n)?n.ownerDocument:document:document:document}const ld=zv?B.useLayoutEffect:B.useEffect;function e2(n){const e=B.useRef(n);return ld(()=>{e.current=n}),B.useCallback(function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function Fz(){const n=B.useRef(null),e=B.useCallback((r,i)=>{n.current=setInterval(r,i)},[]),t=B.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[e,t]}function zp(n,e){e===void 0&&(e=[n]);const t=B.useRef(n);return ld(()=>{t.current!==n&&(t.current=n)},e),t}function Jp(n,e){const t=B.useRef();return B.useMemo(()=>{const r=n(t.current);return t.current=r,r},[...e])}function bv(n){const e=e2(n),t=B.useRef(null),r=B.useCallback(i=>{i!==t.current&&(e==null||e(i,t.current)),t.current=i},[]);return[t,r]}function um(n){const e=B.useRef();return B.useEffect(()=>{e.current=n},[n]),e.current}let Pb={};function Qp(n,e){return B.useMemo(()=>{if(e)return e;const t=Pb[n]==null?0:Pb[n]+1;return Pb[n]=t,n+"-"+t},[n,e])}function I_(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((o,l)=>{const a=Object.entries(l);for(const[h,g]of a){const m=o[h];m!=null&&(o[h]=m+n*g)}return o},{...e})}}const m1=I_(1),yv=I_(-1);function Bz(n){return"clientX"in n&&"clientY"in n}function t2(n){if(!n)return!1;const{KeyboardEvent:e}=uf(n.target);return e&&n instanceof e}function zz(n){if(!n)return!1;const{TouchEvent:e}=uf(n.target);return e&&n instanceof e}function fm(n){if(zz(n)){if(n.touches&&n.touches.length){const{clientX:e,clientY:t}=n.touches[0];return{x:e,y:t}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:e,clientY:t}=n.changedTouches[0];return{x:e,y:t}}}return Bz(n)?{x:n.clientX,y:n.clientY}:null}const Hp=Object.freeze({Translate:{toString(n){if(!n)return;const{x:e,y:t}=n;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:e,scaleY:t}=n;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(n){if(n)return[Hp.Translate.toString(n),Hp.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:e,duration:t,easing:r}=n;return e+" "+t+"ms "+r}}}),Mw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Hz(n){return n.matches(Mw)?n:n.querySelector(Mw)}const Wz={display:"none"};function Uz(n){let{id:e,value:t}=n;return B.createElement("div",{id:e,style:Wz},t)}function Gz(n){let{id:e,announcement:t,ariaLiveType:r="assertive"}=n;const i={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 B.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},t)}function Yz(){const[n,e]=B.useState("");return{announce:B.useCallback(r=>{r!=null&&e(r)},[]),announcement:n}}const k_=B.createContext(null);function Vz(n){const e=B.useContext(k_);B.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(n)},[n,e])}function Zz(){const[n]=B.useState(()=>new Set),e=B.useCallback(r=>(n.add(r),()=>n.delete(r)),[n]);return[B.useCallback(r=>{let{type:i,event:o}=r;n.forEach(l=>{var a;return(a=l[i])==null?void 0:a.call(l,o)})},[n]),e]}const Xz={draggable:`
481
481
  To pick up a draggable item, press the space bar.
482
482
  While dragging, use the arrow keys to move the item.
483
483
  Press space again to drop the item in its new position, or press escape to cancel.
484
- `},Xz={onDragStart(n){let{active:e}=n;return"Picked up draggable item "+e.id+"."},onDragOver(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was moved over droppable area "+t.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was dropped over droppable area "+t.id:"Draggable item "+e.id+" was dropped."},onDragCancel(n){let{active:e}=n;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Kz(n){let{announcements:e=Xz,container:t,hiddenTextDescribedById:r,screenReaderInstructions:i=Zz}=n;const{announce:o,announcement:l}=Gz(),a=Qp("DndLiveRegion"),[h,g]=B.useState(!1);if(B.useEffect(()=>{g(!0)},[]),Yz(B.useMemo(()=>({onDragStart(x){let{active:w}=x;o(e.onDragStart({active:w}))},onDragMove(x){let{active:w,over:_}=x;e.onDragMove&&o(e.onDragMove({active:w,over:_}))},onDragOver(x){let{active:w,over:_}=x;o(e.onDragOver({active:w,over:_}))},onDragEnd(x){let{active:w,over:_}=x;o(e.onDragEnd({active:w,over:_}))},onDragCancel(x){let{active:w,over:_}=x;o(e.onDragCancel({active:w,over:_}))}}),[o,e])),!h)return null;const m=B.createElement(B.Fragment,null,B.createElement(Wz,{id:r,value:i.draggable}),B.createElement(Uz,{id:a,announcement:l}));return t?su.createPortal(m,t):m}var Ba;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Ba||(Ba={}));function mv(){}function Lw(n,e){return B.useMemo(()=>({sensor:n,options:e??{}}),[n,e])}function Jz(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return B.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Fh=Object.freeze({x:0,y:0});function Qz(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function qz(n,e){let{data:{value:t}}=n,{data:{value:r}}=e;return t-r}function jz(n,e){let{data:{value:t}}=n,{data:{value:r}}=e;return r-t}function $z(n,e){if(!n||n.length===0)return null;const[t]=n;return t[e]}function Ow(n,e,t){return e===void 0&&(e=n.left),t===void 0&&(t=n.top),{x:e+n.width*.5,y:t+n.height*.5}}const eH=n=>{let{collisionRect:e,droppableRects:t,droppableContainers:r}=n;const i=Ow(e,e.left,e.top),o=[];for(const l of r){const{id:a}=l,h=t.get(a);if(h){const g=Qz(Ow(h),i);o.push({id:a,data:{droppableContainer:l,value:g}})}}return o.sort(qz)};function tH(n,e){const t=Math.max(e.top,n.top),r=Math.max(e.left,n.left),i=Math.min(e.left+e.width,n.left+n.width),o=Math.min(e.top+e.height,n.top+n.height),l=i-r,a=o-t;if(r<i&&t<o){const h=e.width*e.height,g=n.width*n.height,m=l*a,x=m/(h+g-m);return Number(x.toFixed(4))}return 0}const nH=n=>{let{collisionRect:e,droppableRects:t,droppableContainers:r}=n;const i=[];for(const o of r){const{id:l}=o,a=t.get(l);if(a){const h=tH(a,e);h>0&&i.push({id:l,data:{droppableContainer:o,value:h}})}}return i.sort(jz)};function rH(n,e,t){return{...n,scaleX:e&&t?e.width/t.width:1,scaleY:e&&t?e.height/t.height:1}}function M_(n,e){return n&&e?{x:n.left-e.left,y:n.top-e.top}:Fh}function iH(n){return function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((l,a)=>({...l,top:l.top+n*a.y,bottom:l.bottom+n*a.y,left:l.left+n*a.x,right:l.right+n*a.x}),{...t})}}const oH=iH(1);function lH(n){if(n.startsWith("matrix3d(")){const e=n.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(n.startsWith("matrix(")){const e=n.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function sH(n,e,t){const r=lH(e);if(!r)return n;const{scaleX:i,scaleY:o,x:l,y:a}=r,h=n.left-l-(1-i)*parseFloat(t),g=n.top-a-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),m=i?n.width/i:n.width,x=o?n.height/o:n.height;return{width:m,height:x,top:g,right:h+m,bottom:g+x,left:h}}const aH={ignoreTransform:!1};function B1(n,e){e===void 0&&(e=aH);let t=n.getBoundingClientRect();if(e.ignoreTransform){const{transform:g,transformOrigin:m}=uf(n).getComputedStyle(n);g&&(t=sH(t,g,m))}const{top:r,left:i,width:o,height:l,bottom:a,right:h}=t;return{top:r,left:i,width:o,height:l,bottom:a,right:h}}function Pw(n){return B1(n,{ignoreTransform:!0})}function cH(n){const e=n.innerWidth,t=n.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function uH(n,e){return e===void 0&&(e=uf(n).getComputedStyle(n)),e.position==="fixed"}function fH(n,e){e===void 0&&(e=uf(n).getComputedStyle(n));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=e[i];return typeof o=="string"?t.test(o):!1})}function n2(n,e){const t=[];function r(i){if(e!=null&&t.length>=e||!i)return t;if($m(i)&&i.scrollingElement!=null&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!Kp(i)||R_(i)||t.includes(i))return t;const o=uf(n).getComputedStyle(i);return i!==n&&fH(i,o)&&t.push(i),uH(i,o)?t:r(i.parentNode)}return n?r(n):t}function L_(n){const[e]=n2(n,1);return e??null}function Db(n){return!zv||!n?null:N1(n)?n:jm(n)?$m(n)||n===F1(n).scrollingElement?window:Kp(n)?n:null:null}function O_(n){return N1(n)?n.scrollX:n.scrollLeft}function P_(n){return N1(n)?n.scrollY:n.scrollTop}function hm(n){return{x:O_(n),y:P_(n)}}var oc;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(oc||(oc={}));function D_(n){return!zv||!n?!1:n===document.scrollingElement}function N_(n){const e={x:0,y:0},t=D_(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},r={x:n.scrollWidth-t.width,y:n.scrollHeight-t.height},i=n.scrollTop<=e.y,o=n.scrollLeft<=e.x,l=n.scrollTop>=r.y,a=n.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:l,isRight:a,maxScroll:r,minScroll:e}}const hH={x:.2,y:.2};function dH(n,e,t,r,i){let{top:o,left:l,right:a,bottom:h}=t;r===void 0&&(r=10),i===void 0&&(i=hH);const{isTop:g,isBottom:m,isLeft:x,isRight:w}=N_(n),_={x:0,y:0},S={x:0,y:0},R={height:e.height*i.y,width:e.width*i.x};return!g&&o<=e.top+R.height?(_.y=oc.Backward,S.y=r*Math.abs((e.top+R.height-o)/R.height)):!m&&h>=e.bottom-R.height&&(_.y=oc.Forward,S.y=r*Math.abs((e.bottom-R.height-h)/R.height)),!w&&a>=e.right-R.width?(_.x=oc.Forward,S.x=r*Math.abs((e.right-R.width-a)/R.width)):!x&&l<=e.left+R.width&&(_.x=oc.Backward,S.x=r*Math.abs((e.left+R.width-l)/R.width)),{direction:_,speed:S}}function gH(n){if(n===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:e,left:t,right:r,bottom:i}=n.getBoundingClientRect();return{top:e,left:t,right:r,bottom:i,width:n.clientWidth,height:n.clientHeight}}function F_(n){return n.reduce((e,t)=>m1(e,hm(t)),Fh)}function pH(n){return n.reduce((e,t)=>e+O_(t),0)}function vH(n){return n.reduce((e,t)=>e+P_(t),0)}function bH(n,e){if(e===void 0&&(e=B1),!n)return;const{top:t,left:r,bottom:i,right:o}=e(n);L_(n)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const yH=[["x",["left","right"],pH],["y",["top","bottom"],vH]];class r2{constructor(e,t){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 r=n2(t),i=F_(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,l,a]of yH)for(const h of l)Object.defineProperty(this,h,{get:()=>{const g=a(r),m=i[o]-g;return this.rect[h]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xp{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...t)})},this.target=e}add(e,t,r){var i;(i=this.target)==null||i.addEventListener(e,t,r),this.listeners.push([e,t,r])}}function mH(n){const{EventTarget:e}=uf(n);return n instanceof e?n:F1(n)}function Nb(n,e){const t=Math.abs(n.x),r=Math.abs(n.y);return typeof e=="number"?Math.sqrt(t**2+r**2)>e:"x"in e&&"y"in e?t>e.x&&r>e.y:"x"in e?t>e.x:"y"in e?r>e.y:!1}var fh;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(fh||(fh={}));function Dw(n){n.preventDefault()}function xH(n){n.stopPropagation()}var _o;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(_o||(_o={}));const B_={start:[_o.Space,_o.Enter],cancel:[_o.Esc],end:[_o.Space,_o.Enter,_o.Tab]},wH=(n,e)=>{let{currentCoordinates:t}=e;switch(n.code){case _o.Right:return{...t,x:t.x+25};case _o.Left:return{...t,x:t.x-25};case _o.Down:return{...t,y:t.y+25};case _o.Up:return{...t,y:t.y-25}}};class i2{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new xp(F1(t)),this.windowListeners=new xp(uf(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fh.Resize,this.handleCancel),this.windowListeners.add(fh.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fh.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,r=e.node.current;r&&bH(r),t(Fh)}handleKeyDown(e){if(t2(e)){const{active:t,context:r,options:i}=this.props,{keyboardCodes:o=B_,coordinateGetter:l=wH,scrollBehavior:a="smooth"}=i,{code:h}=e;if(o.end.includes(h)){this.handleEnd(e);return}if(o.cancel.includes(h)){this.handleCancel(e);return}const{collisionRect:g}=r.current,m=g?{x:g.left,y:g.top}:Fh;this.referenceCoordinates||(this.referenceCoordinates=m);const x=l(e,{active:t,context:r.current,currentCoordinates:m});if(x){const w=yv(x,m),_={x:0,y:0},{scrollableAncestors:S}=r.current;for(const R of S){const k=e.code,{isTop:O,isRight:P,isLeft:z,isBottom:H,maxScroll:G,minScroll:N}=N_(R),J=gH(R),Y={x:Math.min(k===_o.Right?J.right-J.width/2:J.right,Math.max(k===_o.Right?J.left:J.left+J.width/2,x.x)),y:Math.min(k===_o.Down?J.bottom-J.height/2:J.bottom,Math.max(k===_o.Down?J.top:J.top+J.height/2,x.y))},K=k===_o.Right&&!P||k===_o.Left&&!z,fe=k===_o.Down&&!H||k===_o.Up&&!O;if(K&&Y.x!==x.x){const X=R.scrollLeft+w.x,te=k===_o.Right&&X<=G.x||k===_o.Left&&X>=N.x;if(te&&!w.y){R.scrollTo({left:X,behavior:a});return}te?_.x=R.scrollLeft-X:_.x=k===_o.Right?R.scrollLeft-G.x:R.scrollLeft-N.x,_.x&&R.scrollBy({left:-_.x,behavior:a});break}else if(fe&&Y.y!==x.y){const X=R.scrollTop+w.y,te=k===_o.Down&&X<=G.y||k===_o.Up&&X>=N.y;if(te&&!w.x){R.scrollTo({top:X,behavior:a});return}te?_.y=R.scrollTop-X:_.y=k===_o.Down?R.scrollTop-G.y:R.scrollTop-N.y,_.y&&R.scrollBy({top:-_.y,behavior:a});break}}this.handleMove(e,m1(yv(x,this.referenceCoordinates),_))}}}handleMove(e,t){const{onMove:r}=this.props;e.preventDefault(),r(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}i2.activators=[{eventName:"onKeyDown",handler:(n,e,t)=>{let{keyboardCodes:r=B_,onActivation:i}=e,{active:o}=t;const{code:l}=n.nativeEvent;if(r.start.includes(l)){const a=o.activatorNode.current;return a&&n.target!==a?!1:(n.preventDefault(),i==null||i({event:n.nativeEvent}),!0)}return!1}}];function Nw(n){return!!(n&&"distance"in n)}function Fw(n){return!!(n&&"delay"in n)}class o2{constructor(e,t,r){var i;r===void 0&&(r=mH(e.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=e,this.events=t;const{event:o}=e,{target:l}=o;this.props=e,this.events=t,this.document=F1(l),this.documentListeners=new xp(this.document),this.listeners=new xp(r),this.windowListeners=new xp(uf(l)),this.initialCoordinates=(i=fm(o))!=null?i:Fh,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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(fh.Resize,this.handleCancel),this.windowListeners.add(fh.DragStart,Dw),this.windowListeners.add(fh.VisibilityChange,this.handleCancel),this.windowListeners.add(fh.ContextMenu,Dw),this.documentListeners.add(fh.Keydown,this.handleKeydown),t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fw(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Nw(t)){this.handlePending(t);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(e,t){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(fh.Click,xH,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fh.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:l,options:{activationConstraint:a}}=o;if(!i)return;const h=(t=fm(e))!=null?t:Fh,g=yv(i,h);if(!r&&a){if(Nw(a)){if(a.tolerance!=null&&Nb(g,a.tolerance))return this.handleCancel();if(Nb(g,a.distance))return this.handleStart()}if(Fw(a)&&Nb(g,a.tolerance))return this.handleCancel();this.handlePending(a,g);return}e.cancelable&&e.preventDefault(),l(h)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===_o.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const CH={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class l2 extends o2{constructor(e){const{event:t}=e,r=F1(t.target);super(e,CH,r)}}l2.activators=[{eventName:"onPointerDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;return!t.isPrimary||t.button!==0?!1:(r==null||r({event:t}),!0)}}];const _H={move:{name:"mousemove"},end:{name:"mouseup"}};var dm;(function(n){n[n.RightClick=2]="RightClick"})(dm||(dm={}));class SH extends o2{constructor(e){super(e,_H,F1(e.event.target))}}SH.activators=[{eventName:"onMouseDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;return t.button===dm.RightClick?!1:(r==null||r({event:t}),!0)}}];const Fb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class EH extends o2{constructor(e){super(e,Fb)}static setup(){return window.addEventListener(Fb.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Fb.move.name,e)};function e(){}}}EH.activators=[{eventName:"onTouchStart",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;const{touches:i}=t;return i.length>1?!1:(r==null||r({event:t}),!0)}}];var wp;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(wp||(wp={}));var xv;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(xv||(xv={}));function TH(n){let{acceleration:e,activator:t=wp.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:l=5,order:a=xv.TreeOrder,pointerCoordinates:h,scrollableAncestors:g,scrollableAncestorRects:m,delta:x,threshold:w}=n;const _=RH({delta:x,disabled:!o}),[S,R]=Nz(),k=B.useRef({x:0,y:0}),O=B.useRef({x:0,y:0}),P=B.useMemo(()=>{switch(t){case wp.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case wp.DraggableRect:return i}},[t,i,h]),z=B.useRef(null),H=B.useCallback(()=>{const N=z.current;if(!N)return;const J=k.current.x*O.current.x,Y=k.current.y*O.current.y;N.scrollBy(J,Y)},[]),G=B.useMemo(()=>a===xv.TreeOrder?[...g].reverse():g,[a,g]);B.useEffect(()=>{if(!o||!g.length||!P){R();return}for(const N of G){if((r==null?void 0:r(N))===!1)continue;const J=g.indexOf(N),Y=m[J];if(!Y)continue;const{direction:K,speed:fe}=dH(N,Y,P,e,w);for(const X of["x","y"])_[X][K[X]]||(fe[X]=0,K[X]=0);if(fe.x>0||fe.y>0){R(),z.current=N,S(H,l),k.current=fe,O.current=K;return}}k.current={x:0,y:0},O.current={x:0,y:0},R()},[e,H,r,R,o,l,JSON.stringify(P),JSON.stringify(_),S,g,G,m,JSON.stringify(w)])}const AH={x:{[oc.Backward]:!1,[oc.Forward]:!1},y:{[oc.Backward]:!1,[oc.Forward]:!1}};function RH(n){let{delta:e,disabled:t}=n;const r=um(e);return Jp(i=>{if(t||!r||!i)return AH;const o={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[oc.Backward]:i.x[oc.Backward]||o.x===-1,[oc.Forward]:i.x[oc.Forward]||o.x===1},y:{[oc.Backward]:i.y[oc.Backward]||o.y===-1,[oc.Forward]:i.y[oc.Forward]||o.y===1}}},[t,e,r])}function IH(n,e){const t=e!=null?n.get(e):void 0,r=t?t.node.current:null;return Jp(i=>{var o;return e==null?null:(o=r??i)!=null?o:null},[r,e])}function kH(n,e){return B.useMemo(()=>n.reduce((t,r)=>{const{sensor:i}=r,o=i.activators.map(l=>({eventName:l.eventName,handler:e(l.handler,r)}));return[...t,...o]},[]),[n,e])}var M1;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(M1||(M1={}));var gm;(function(n){n.Optimized="optimized"})(gm||(gm={}));const Bw=new Map;function MH(n,e){let{dragging:t,dependencies:r,config:i}=e;const[o,l]=B.useState(null),{frequency:a,measure:h,strategy:g}=i,m=B.useRef(n),x=k(),w=zp(x),_=B.useCallback(function(O){O===void 0&&(O=[]),!w.current&&l(P=>P===null?O:P.concat(O.filter(z=>!P.includes(z))))},[w]),S=B.useRef(null),R=Jp(O=>{if(x&&!t)return Bw;if(!O||O===Bw||m.current!==n||o!=null){const P=new Map;for(let z of n){if(!z)continue;if(o&&o.length>0&&!o.includes(z.id)&&z.rect.current){P.set(z.id,z.rect.current);continue}const H=z.node.current,G=H?new r2(h(H),H):null;z.rect.current=G,G&&P.set(z.id,G)}return P}return O},[n,o,t,x,h]);return B.useEffect(()=>{m.current=n},[n]),B.useEffect(()=>{x||_()},[t,x]),B.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),B.useEffect(()=>{x||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{_(),S.current=null},a))},[a,x,_,...r]),{droppableRects:R,measureDroppableContainers:_,measuringScheduled:o!=null};function k(){switch(g){case M1.Always:return!1;case M1.BeforeDragging:return t;default:return!t}}}function z_(n,e){return Jp(t=>n?t||(typeof e=="function"?e(n):n):null,[e,n])}function LH(n,e){return z_(n,e)}function OH(n){let{callback:e,disabled:t}=n;const r=e2(e),i=B.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,t]);return B.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Hv(n){let{callback:e,disabled:t}=n;const r=e2(e),i=B.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[t]);return B.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function PH(n){return new r2(B1(n),n)}function zw(n,e,t){e===void 0&&(e=PH);const[r,i]=B.useState(null);function o(){i(h=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=h??t)!=null?g:null}const m=e(n);return JSON.stringify(h)===JSON.stringify(m)?h:m})}const l=OH({callback(h){if(n)for(const g of h){const{type:m,target:x}=g;if(m==="childList"&&x instanceof HTMLElement&&x.contains(n)){o();break}}}}),a=Hv({callback:o});return ld(()=>{o(),n?(a==null||a.observe(n),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),l==null||l.disconnect())},[n]),r}function DH(n){const e=z_(n);return M_(n,e)}const Hw=[];function NH(n){const e=B.useRef(n),t=Jp(r=>n?r&&r!==Hw&&n&&e.current&&n.parentNode===e.current.parentNode?r:n2(n):Hw,[n]);return B.useEffect(()=>{e.current=n},[n]),t}function FH(n){const[e,t]=B.useState(null),r=B.useRef(n),i=B.useCallback(o=>{const l=Db(o.target);l&&t(a=>a?(a.set(l,hm(l)),new Map(a)):null)},[]);return B.useEffect(()=>{const o=r.current;if(n!==o){l(o);const a=n.map(h=>{const g=Db(h);return g?(g.addEventListener("scroll",i,{passive:!0}),[g,hm(g)]):null}).filter(h=>h!=null);t(a.length?new Map(a):null),r.current=n}return()=>{l(n),l(o)};function l(a){a.forEach(h=>{const g=Db(h);g==null||g.removeEventListener("scroll",i)})}},[i,n]),B.useMemo(()=>n.length?e?Array.from(e.values()).reduce((o,l)=>m1(o,l),Fh):F_(n):Fh,[n,e])}function Ww(n,e){e===void 0&&(e=[]);const t=B.useRef(null);return B.useEffect(()=>{t.current=null},e),B.useEffect(()=>{const r=n!==Fh;r&&!t.current&&(t.current=n),!r&&t.current&&(t.current=null)},[n]),t.current?yv(n,t.current):Fh}function BH(n){B.useEffect(()=>{if(!zv)return;const e=n.map(t=>{let{sensor:r}=t;return r.setup==null?void 0:r.setup()});return()=>{for(const t of e)t==null||t()}},n.map(e=>{let{sensor:t}=e;return t}))}function zH(n,e){return B.useMemo(()=>n.reduce((t,r)=>{let{eventName:i,handler:o}=r;return t[i]=l=>{o(l,e)},t},{}),[n,e])}function H_(n){return B.useMemo(()=>n?cH(n):null,[n])}const Uw=[];function HH(n,e){e===void 0&&(e=B1);const[t]=n,r=H_(t?uf(t):null),[i,o]=B.useState(Uw);function l(){o(()=>n.length?n.map(h=>D_(h)?r:new r2(e(h),h)):Uw)}const a=Hv({callback:l});return ld(()=>{a==null||a.disconnect(),l(),n.forEach(h=>a==null?void 0:a.observe(h))},[n]),i}function WH(n){if(!n)return null;if(n.children.length>1)return n;const e=n.children[0];return Kp(e)?e:n}function UH(n){let{measure:e}=n;const[t,r]=B.useState(null),i=B.useCallback(g=>{for(const{target:m}of g)if(Kp(m)){r(x=>{const w=e(m);return x?{...x,width:w.width,height:w.height}:w});break}},[e]),o=Hv({callback:i}),l=B.useCallback(g=>{const m=WH(g);o==null||o.disconnect(),m&&(o==null||o.observe(m)),r(m?e(m):null)},[e,o]),[a,h]=bv(l);return B.useMemo(()=>({nodeRef:a,rect:t,setRef:h}),[t,a,h])}const GH=[{sensor:l2,options:{}},{sensor:i2,options:{}}],YH={current:{}},j0={draggable:{measure:Pw},droppable:{measure:Pw,strategy:M1.WhileDragging,frequency:gm.Optimized},dragOverlay:{measure:B1}};class Cp extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,r;return(t=(r=this.get(e))==null?void 0:r.node.current)!=null?t:void 0}}const VH={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cp,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mv},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:j0,measureDroppableContainers:mv,windowRect:null,measuringScheduled:!1},ZH={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mv,draggableNodes:new Map,over:null,measureDroppableContainers:mv},Wv=B.createContext(ZH),W_=B.createContext(VH);function XH(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cp}}}function KH(n,e){switch(e.type){case Ba.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Ba.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:e.coordinates.x-n.draggable.initialCoordinates.x,y:e.coordinates.y-n.draggable.initialCoordinates.y}}};case Ba.DragEnd:case Ba.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ba.RegisterDroppable:{const{element:t}=e,{id:r}=t,i=new Cp(n.droppable.containers);return i.set(r,t),{...n,droppable:{...n.droppable,containers:i}}}case Ba.SetDroppableDisabled:{const{id:t,key:r,disabled:i}=e,o=n.droppable.containers.get(t);if(!o||r!==o.key)return n;const l=new Cp(n.droppable.containers);return l.set(t,{...o,disabled:i}),{...n,droppable:{...n.droppable,containers:l}}}case Ba.UnregisterDroppable:{const{id:t,key:r}=e,i=n.droppable.containers.get(t);if(!i||r!==i.key)return n;const o=new Cp(n.droppable.containers);return o.delete(t),{...n,droppable:{...n.droppable,containers:o}}}default:return n}}function JH(n){let{disabled:e}=n;const{active:t,activatorEvent:r,draggableNodes:i}=B.useContext(Wv),o=um(r),l=um(t==null?void 0:t.id);return B.useEffect(()=>{if(!e&&!r&&o&&l!=null){if(!t2(o)||document.activeElement===o.target)return;const a=i.get(l);if(!a)return;const{activatorNode:h,node:g}=a;if(!h.current&&!g.current)return;requestAnimationFrame(()=>{for(const m of[h.current,g.current]){if(!m)continue;const x=zz(m);if(x){x.focus();break}}})}},[r,e,i,l,o]),null}function QH(n,e){let{transform:t,...r}=e;return n!=null&&n.length?n.reduce((i,o)=>o({transform:i,...r}),t):t}function qH(n){return B.useMemo(()=>({draggable:{...j0.draggable,...n==null?void 0:n.draggable},droppable:{...j0.droppable,...n==null?void 0:n.droppable},dragOverlay:{...j0.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function jH(n){let{activeNode:e,measure:t,initialRect:r,config:i=!0}=n;const o=B.useRef(!1),{x:l,y:a}=typeof i=="boolean"?{x:i,y:i}:i;ld(()=>{if(!l&&!a||!e){o.current=!1;return}if(o.current||!r)return;const g=e==null?void 0:e.node.current;if(!g||g.isConnected===!1)return;const m=t(g),x=M_(m,r);if(l||(x.x=0),a||(x.y=0),o.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const w=L_(g);w&&w.scrollBy({top:x.y,left:x.x})}},[e,l,a,r,t])}const U_=B.createContext({...Fh,scaleX:1,scaleY:1});var Jd;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Jd||(Jd={}));const $H=B.memo(function(e){var t,r,i,o;let{id:l,accessibility:a,autoScroll:h=!0,children:g,sensors:m=GH,collisionDetection:x=nH,measuring:w,modifiers:_,...S}=e;const R=B.useReducer(KH,void 0,XH),[k,O]=R,[P,z]=Vz(),[H,G]=B.useState(Jd.Uninitialized),N=H===Jd.Initialized,{draggable:{active:J,nodes:Y,translate:K},droppable:{containers:fe}}=k,X=J!=null?Y.get(J):null,te=B.useRef({initial:null,translated:null}),ne=B.useMemo(()=>{var yn;return J!=null?{id:J,data:(yn=X==null?void 0:X.data)!=null?yn:YH,rect:te}:null},[J,X]),ue=B.useRef(null),[se,$]=B.useState(null),[re,ge]=B.useState(null),me=zp(S,Object.values(S)),oe=Qp("DndDescribedBy",l),Q=B.useMemo(()=>fe.getEnabled(),[fe]),pe=qH(w),{droppableRects:Ie,measureDroppableContainers:Fe,measuringScheduled:xe}=MH(Q,{dragging:N,dependencies:[K.x,K.y],config:pe.droppable}),Oe=IH(Y,J),Le=B.useMemo(()=>re?fm(re):null,[re]),He=Yt(),Te=LH(Oe,pe.draggable.measure);jH({activeNode:J!=null?Y.get(J):null,config:He.layoutShiftCompensation,initialRect:Te,measure:pe.draggable.measure});const ke=zw(Oe,pe.draggable.measure,Te),Be=zw(Oe?Oe.parentElement:null),rt=B.useRef({activatorEvent:null,active:null,activeNode:Oe,collisionRect:null,collisions:null,droppableRects:Ie,draggableNodes:Y,draggingNode:null,draggingNodeRect:null,droppableContainers:fe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Re=fe.getNodeFor((t=rt.current.over)==null?void 0:t.id),ut=UH({measure:pe.dragOverlay.measure}),qe=(r=ut.nodeRef.current)!=null?r:Oe,ot=N?(i=ut.rect)!=null?i:ke:null,st=!!(ut.nodeRef.current&&ut.rect),bt=DH(st?null:ke),Mt=H_(qe?uf(qe):null),Bt=NH(N?Re??Oe:null),at=HH(Bt),Ye=QH(_,{transform:{x:K.x-bt.x,y:K.y-bt.y,scaleX:1,scaleY:1},activatorEvent:re,active:ne,activeNodeRect:ke,containerNodeRect:Be,draggingNodeRect:ot,over:rt.current.over,overlayNodeRect:ut.rect,scrollableAncestors:Bt,scrollableAncestorRects:at,windowRect:Mt}),Tt=Le?m1(Le,K):null,Ut=FH(Bt),gt=Ww(Ut),Ht=Ww(Ut,[ke]),xt=m1(Ye,gt),pn=ot?oH(ot,Ye):null,$t=ne&&pn?x({active:ne,collisionRect:pn,droppableRects:Ie,droppableContainers:Q,pointerCoordinates:Tt}):null,sn=$z($t,"id"),[Xt,bn]=B.useState(null),hn=st?Ye:m1(Ye,Ht),Rn=rH(hn,(o=Xt==null?void 0:Xt.rect)!=null?o:null,ke),vn=B.useRef(null),We=B.useCallback((yn,gn)=>{let{sensor:lt,options:kt}=gn;if(ue.current==null)return;const vt=Y.get(ue.current);if(!vt)return;const zt=yn.nativeEvent,Lt=new lt({active:ue.current,activeNode:vt,event:zt,options:kt,context:rt,onAbort(Rt){if(!Y.get(Rt))return;const{onDragAbort:En}=me.current,Jt={id:Rt};En==null||En(Jt),P({type:"onDragAbort",event:Jt})},onPending(Rt,on,En,Jt){if(!Y.get(Rt))return;const{onDragPending:_n}=me.current,zn={id:Rt,constraint:on,initialCoordinates:En,offset:Jt};_n==null||_n(zn),P({type:"onDragPending",event:zn})},onStart(Rt){const on=ue.current;if(on==null)return;const En=Y.get(on);if(!En)return;const{onDragStart:Jt}=me.current,xn={activatorEvent:zt,active:{id:on,data:En.data,rect:te}};su.unstable_batchedUpdates(()=>{Jt==null||Jt(xn),G(Jd.Initializing),O({type:Ba.DragStart,initialCoordinates:Rt,active:on}),P({type:"onDragStart",event:xn}),$(vn.current),ge(zt)})},onMove(Rt){O({type:Ba.DragMove,coordinates:Rt})},onEnd:yt(Ba.DragEnd),onCancel:yt(Ba.DragCancel)});vn.current=Lt;function yt(Rt){return async function(){const{active:En,collisions:Jt,over:xn,scrollAdjustedTranslate:_n}=rt.current;let zn=null;if(En&&_n){const{cancelDrop:er}=me.current;zn={activatorEvent:zt,active:En,collisions:Jt,delta:_n,over:xn},Rt===Ba.DragEnd&&typeof er=="function"&&await Promise.resolve(er(zn))&&(Rt=Ba.DragCancel)}ue.current=null,su.unstable_batchedUpdates(()=>{O({type:Rt}),G(Jd.Uninitialized),bn(null),$(null),ge(null),vn.current=null;const er=Rt===Ba.DragEnd?"onDragEnd":"onDragCancel";if(zn){const wn=me.current[er];wn==null||wn(zn),P({type:er,event:zn})}})}}},[Y]),Ce=B.useCallback((yn,gn)=>(lt,kt)=>{const vt=lt.nativeEvent,zt=Y.get(kt);if(ue.current!==null||!zt||vt.dndKit||vt.defaultPrevented)return;const Lt={active:zt};yn(lt,gn.options,Lt)===!0&&(vt.dndKit={capturedBy:gn.sensor},ue.current=kt,We(lt,gn))},[Y,We]),it=kH(m,Ce);BH(m),ld(()=>{ke&&H===Jd.Initializing&&G(Jd.Initialized)},[ke,H]),B.useEffect(()=>{const{onDragMove:yn}=me.current,{active:gn,activatorEvent:lt,collisions:kt,over:vt}=rt.current;if(!gn||!lt)return;const zt={active:gn,activatorEvent:lt,collisions:kt,delta:{x:xt.x,y:xt.y},over:vt};su.unstable_batchedUpdates(()=>{yn==null||yn(zt),P({type:"onDragMove",event:zt})})},[xt.x,xt.y]),B.useEffect(()=>{const{active:yn,activatorEvent:gn,collisions:lt,droppableContainers:kt,scrollAdjustedTranslate:vt}=rt.current;if(!yn||ue.current==null||!gn||!vt)return;const{onDragOver:zt}=me.current,Lt=kt.get(sn),yt=Lt&&Lt.rect.current?{id:Lt.id,rect:Lt.rect.current,data:Lt.data,disabled:Lt.disabled}:null,Rt={active:yn,activatorEvent:gn,collisions:lt,delta:{x:vt.x,y:vt.y},over:yt};su.unstable_batchedUpdates(()=>{bn(yt),zt==null||zt(Rt),P({type:"onDragOver",event:Rt})})},[sn]),ld(()=>{rt.current={activatorEvent:re,active:ne,activeNode:Oe,collisionRect:pn,collisions:$t,droppableRects:Ie,draggableNodes:Y,draggingNode:qe,draggingNodeRect:ot,droppableContainers:fe,over:Xt,scrollableAncestors:Bt,scrollAdjustedTranslate:xt},te.current={initial:ot,translated:pn}},[ne,Oe,$t,pn,Y,qe,ot,Ie,fe,Xt,Bt,xt]),TH({...He,delta:K,draggingRect:pn,pointerCoordinates:Tt,scrollableAncestors:Bt,scrollableAncestorRects:at});const Ct=B.useMemo(()=>({active:ne,activeNode:Oe,activeNodeRect:ke,activatorEvent:re,collisions:$t,containerNodeRect:Be,dragOverlay:ut,draggableNodes:Y,droppableContainers:fe,droppableRects:Ie,over:Xt,measureDroppableContainers:Fe,scrollableAncestors:Bt,scrollableAncestorRects:at,measuringConfiguration:pe,measuringScheduled:xe,windowRect:Mt}),[ne,Oe,ke,re,$t,Be,ut,Y,fe,Ie,Xt,Fe,Bt,at,pe,xe,Mt]),Qt=B.useMemo(()=>({activatorEvent:re,activators:it,active:ne,activeNodeRect:ke,ariaDescribedById:{draggable:oe},dispatch:O,draggableNodes:Y,over:Xt,measureDroppableContainers:Fe}),[re,it,ne,ke,O,oe,Y,Xt,Fe]);return B.createElement(k_.Provider,{value:z},B.createElement(Wv.Provider,{value:Qt},B.createElement(W_.Provider,{value:Ct},B.createElement(U_.Provider,{value:Rn},g)),B.createElement(JH,{disabled:(a==null?void 0:a.restoreFocus)===!1})),B.createElement(Kz,{...a,hiddenTextDescribedById:oe}));function Yt(){const yn=(se==null?void 0:se.autoScrollEnabled)===!1,gn=typeof h=="object"?h.enabled===!1:h===!1,lt=N&&!yn&&!gn;return typeof h=="object"?{...h,enabled:lt}:{enabled:lt}}}),eW=B.createContext(null),Gw="button",tW="Draggable";function nW(n){let{id:e,data:t,disabled:r=!1,attributes:i}=n;const o=Qp(tW),{activators:l,activatorEvent:a,active:h,activeNodeRect:g,ariaDescribedById:m,draggableNodes:x,over:w}=B.useContext(Wv),{role:_=Gw,roleDescription:S="draggable",tabIndex:R=0}=i??{},k=(h==null?void 0:h.id)===e,O=B.useContext(k?U_:eW),[P,z]=bv(),[H,G]=bv(),N=zH(l,e),J=zp(t);ld(()=>(x.set(e,{id:e,key:o,node:P,activatorNode:H,data:J}),()=>{const K=x.get(e);K&&K.key===o&&x.delete(e)}),[x,e]);const Y=B.useMemo(()=>({role:_,tabIndex:R,"aria-disabled":r,"aria-pressed":k&&_===Gw?!0:void 0,"aria-roledescription":S,"aria-describedby":m.draggable}),[r,_,R,k,S,m.draggable]);return{active:h,activatorEvent:a,activeNodeRect:g,attributes:Y,isDragging:k,listeners:r?void 0:N,node:P,over:w,setNodeRef:z,setActivatorNodeRef:G,transform:O}}function rW(){return B.useContext(W_)}const iW="Droppable",oW={timeout:25};function lW(n){let{data:e,disabled:t=!1,id:r,resizeObserverConfig:i}=n;const o=Qp(iW),{active:l,dispatch:a,over:h,measureDroppableContainers:g}=B.useContext(Wv),m=B.useRef({disabled:t}),x=B.useRef(!1),w=B.useRef(null),_=B.useRef(null),{disabled:S,updateMeasurementsFor:R,timeout:k}={...oW,...i},O=zp(R??r),P=B.useCallback(()=>{if(!x.current){x.current=!0;return}_.current!=null&&clearTimeout(_.current),_.current=setTimeout(()=>{g(Array.isArray(O.current)?O.current:[O.current]),_.current=null},k)},[k]),z=Hv({callback:P,disabled:S||!l}),H=B.useCallback((Y,K)=>{z&&(K&&(z.unobserve(K),x.current=!1),Y&&z.observe(Y))},[z]),[G,N]=bv(H),J=zp(e);return B.useEffect(()=>{!z||!G.current||(z.disconnect(),x.current=!1,z.observe(G.current))},[G,z]),B.useEffect(()=>(a({type:Ba.RegisterDroppable,element:{id:r,key:o,disabled:t,node:G,rect:w,data:J}}),()=>a({type:Ba.UnregisterDroppable,key:o,id:r})),[r]),B.useEffect(()=>{t!==m.current.disabled&&(a({type:Ba.SetDroppableDisabled,id:r,key:o,disabled:t}),m.current.disabled=t)},[r,o,t,a]),{active:l,rect:w,isOver:(h==null?void 0:h.id)===r,node:G,over:h,setNodeRef:N}}function G_(n,e,t){const r={...n};return e.top+n.y<=t.top?r.y=t.top-e.top:e.bottom+n.y>=t.top+t.height&&(r.y=t.top+t.height-e.bottom),e.left+n.x<=t.left?r.x=t.left-e.left:e.right+n.x>=t.left+t.width&&(r.x=t.left+t.width-e.right),r}const sW=n=>{let{containerNodeRect:e,draggingNodeRect:t,transform:r}=n;return!t||!e?r:G_(r,t,e)},aW=n=>{let{transform:e,draggingNodeRect:t,windowRect:r}=n;return!t||!r?e:G_(e,t,r)};function wv(n,e,t){const r=n.slice();return r.splice(t<0?r.length+t:t,0,r.splice(e,1)[0]),r}function cW(n,e){return n.reduce((t,r,i)=>{const o=e.get(r);return o&&(t[i]=o),t},Array(n.length))}function F0(n){return n!==null&&n>=0}function uW(n,e){if(n===e)return!0;if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function fW(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Y_=n=>{let{rects:e,activeIndex:t,overIndex:r,index:i}=n;const o=wv(e,r,t),l=e[i],a=o[i];return!a||!l?null:{x:a.left-l.left,y:a.top-l.top,scaleX:a.width/l.width,scaleY:a.height/l.height}},B0={scaleX:1,scaleY:1},hW=n=>{var e;let{activeIndex:t,activeNodeRect:r,index:i,rects:o,overIndex:l}=n;const a=(e=o[t])!=null?e:r;if(!a)return null;if(i===t){const g=o[l];return g?{x:0,y:t<l?g.top+g.height-(a.top+a.height):g.top-a.top,...B0}:null}const h=dW(o,i,t);return i>t&&i<=l?{x:0,y:-a.height-h,...B0}:i<t&&i>=l?{x:0,y:a.height+h,...B0}:{x:0,y:0,...B0}};function dW(n,e,t){const r=n[e],i=n[e-1],o=n[e+1];return r?t<e?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const V_="Sortable",Z_=B.createContext({activeIndex:-1,containerId:V_,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Y_,disabled:{draggable:!1,droppable:!1}});function gW(n){let{children:e,id:t,items:r,strategy:i=Y_,disabled:o=!1}=n;const{active:l,dragOverlay:a,droppableRects:h,over:g,measureDroppableContainers:m}=rW(),x=Qp(V_,t),w=a.rect!==null,_=B.useMemo(()=>r.map(N=>typeof N=="object"&&"id"in N?N.id:N),[r]),S=l!=null,R=l?_.indexOf(l.id):-1,k=g?_.indexOf(g.id):-1,O=B.useRef(_),P=!uW(_,O.current),z=k!==-1&&R===-1||P,H=fW(o);ld(()=>{P&&S&&m(_)},[P,_,S,m]),B.useEffect(()=>{O.current=_},[_]);const G=B.useMemo(()=>({activeIndex:R,containerId:x,disabled:H,disableTransforms:z,items:_,overIndex:k,useDragOverlay:w,sortedRects:cW(_,h),strategy:i}),[R,x,H.draggable,H.droppable,z,_,k,h,w,i]);return B.createElement(Z_.Provider,{value:G},e)}const pW=n=>{let{id:e,items:t,activeIndex:r,overIndex:i}=n;return wv(t,r,i).indexOf(e)},vW=n=>{let{containerId:e,isSorting:t,wasDragging:r,index:i,items:o,newIndex:l,previousItems:a,previousContainerId:h,transition:g}=n;return!g||!r||a!==o&&i===l?!1:t?!0:l!==i&&e===h},bW={duration:200,easing:"ease"},X_="transform",yW=Hp.Transition.toString({property:X_,duration:0,easing:"linear"}),mW={roleDescription:"sortable"};function xW(n){let{disabled:e,index:t,node:r,rect:i}=n;const[o,l]=B.useState(null),a=B.useRef(t);return ld(()=>{if(!e&&t!==a.current&&r.current){const h=i.current;if(h){const g=B1(r.current,{ignoreTransform:!0}),m={x:h.left-g.left,y:h.top-g.top,scaleX:h.width/g.width,scaleY:h.height/g.height};(m.x||m.y)&&l(m)}}t!==a.current&&(a.current=t)},[e,t,r,i]),B.useEffect(()=>{o&&l(null)},[o]),o}function wW(n){let{animateLayoutChanges:e=vW,attributes:t,disabled:r,data:i,getNewIndex:o=pW,id:l,strategy:a,resizeObserverConfig:h,transition:g=bW}=n;const{items:m,containerId:x,activeIndex:w,disabled:_,disableTransforms:S,sortedRects:R,overIndex:k,useDragOverlay:O,strategy:P}=B.useContext(Z_),z=CW(r,_),H=m.indexOf(l),G=B.useMemo(()=>({sortable:{containerId:x,index:H,items:m},...i}),[x,i,H,m]),N=B.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:J,node:Y,isOver:K,setNodeRef:fe}=lW({id:l,data:G,disabled:z.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...h}}),{active:X,activatorEvent:te,activeNodeRect:ne,attributes:ue,setNodeRef:se,listeners:$,isDragging:re,over:ge,setActivatorNodeRef:me,transform:oe}=nW({id:l,data:G,attributes:{...mW,...t},disabled:z.draggable}),Q=Dz(fe,se),pe=!!X,Ie=pe&&!S&&F0(w)&&F0(k),Fe=!O&&re,xe=Fe&&Ie?oe:null,Le=Ie?xe??(a??P)({rects:R,activeNodeRect:ne,activeIndex:w,overIndex:k,index:H}):null,He=F0(w)&&F0(k)?o({id:l,items:m,activeIndex:w,overIndex:k}):H,Te=X==null?void 0:X.id,ke=B.useRef({activeId:Te,items:m,newIndex:He,containerId:x}),Be=m!==ke.current.items,rt=e({active:X,containerId:x,isDragging:re,isSorting:pe,id:l,index:H,items:m,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:g,wasDragging:ke.current.activeId!=null}),Re=xW({disabled:!rt,index:H,node:Y,rect:J});return B.useEffect(()=>{pe&&ke.current.newIndex!==He&&(ke.current.newIndex=He),x!==ke.current.containerId&&(ke.current.containerId=x),m!==ke.current.items&&(ke.current.items=m)},[pe,He,x,m]),B.useEffect(()=>{if(Te===ke.current.activeId)return;if(Te!=null&&ke.current.activeId==null){ke.current.activeId=Te;return}const qe=setTimeout(()=>{ke.current.activeId=Te},50);return()=>clearTimeout(qe)},[Te]),{active:X,activeIndex:w,attributes:ue,data:G,rect:J,index:H,newIndex:He,items:m,isOver:K,isSorting:pe,isDragging:re,listeners:$,node:Y,overIndex:k,over:ge,setNodeRef:Q,setActivatorNodeRef:me,setDroppableNodeRef:fe,setDraggableNodeRef:se,transform:Re??Le,transition:ut()};function ut(){if(Re||Be&&ke.current.newIndex===H)return yW;if(!(Fe&&!t2(te)||!g)&&(pe||rt))return Hp.Transition.toString({...g,property:X_})}}function CW(n,e){var t,r;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(t=n==null?void 0:n.draggable)!=null?t:e.draggable,droppable:(r=n==null?void 0:n.droppable)!=null?r:e.droppable}}_o.Down,_o.Right,_o.Up,_o.Left;function Cv(n,e){Array.isArray(n)||(n=[n]);for(const t of n){if(e(t))return t;if(!t.children||t.children.length<1)continue;const r=Cv(t.children,e);if(r)return r}}function qp(n,e){Array.isArray(n)||(n=[n]);for(const t of n)e(t),!(!t.children||t.children.length<1)&&qp(t.children,e)}function K_(n,e){Array.isArray(n)||(n=[n]);const t=[];return qp(n,(r,i)=>t.push(e(r,i))),t}function J_(n,e){Array.isArray(n)||(n=[n]);for(const t of n){if(!e(t))return!1;if(!(!t.children||t.children.length<1)&&!J_(t.children,e))return!1}return!0}function _W(n,e){Array.isArray(n)||(n=[n]);const t=[];return qp(n,(r,i)=>{e(r,i)&&t.push(r)}),t}function SW(n){Array.isArray(n)||(n=[n]);let e=0;return qp(n,()=>e++),e}function EW(n,e,t,r){if(r(e,t))return null;Array.isArray(n)||(n=[n]);const i=Cv(n,l=>{var a;return(a=l.children)==null?void 0:a.some(h=>r(h,e))}),o=Cv(n,l=>{var a;return(a=l.children)==null?void 0:a.some(h=>r(h,t))});if(i===void 0&&o===void 0){const l=n.findIndex(h=>r(h,e)),a=n.findIndex(h=>r(h,t));return n.splice(l,1),n.splice(a,0,e),[...n]}else if(i!==void 0&&o!==void 0&&r(i,o)&&i.children){const l=i.children.findIndex(h=>r(h,e)),a=i.children.findIndex(h=>r(h,t));return l===void 0||a===void 0?null:(i.children.splice(l,1),i.children.splice(a,0,e),i.children=[...i.children],[...n])}return null}function TW(n,e,t){const r=[],i=[...e];for(;i.length>0;){const o=i.shift();if(o&&!r.find(l=>t(l,o))&&(r.push(o),!(!o.children||o.children.length<1)))for(const l of o.children)i.push(l)}return r}function AW(n,e,t){Array.isArray(n)||(n=[n]);const r=K_(n,l=>l),i=[],o=[...e];for(;o.length>0;){const l=o.shift();if(!l||i.find(h=>t(h,l)))continue;i.push(l);const a=r.find(h=>{var g;return(g=h.children)==null?void 0:g.some(m=>t(m,l))});a&&o.push(a)}return i}const Qd={find:Cv,forEach:qp,map:K_,every:J_,filter:_W,length:SW,replace:EW,descendants:TW,ancestors:AW},RW="_AWrap_1mpkv_1",IW="_AContainer_1mpkv_10",kW="_ATree_1mpkv_18",MW="_ATreeBody_1mpkv_30",LW="_TreeTopAddon_1mpkv_36",OW="_CoverBorder_1mpkv_46",PW="_InsertBorder_1mpkv_55",DW="_ATreeHeader_1mpkv_86",NW="_ATreeBodyHeader_1mpkv_92",FW="_ATreeBodyHeaderResources_1mpkv_102",BW="_ATreeItem_1mpkv_108",zW="_IsSelectUsed_1mpkv_124",HW="_IsSelected_1mpkv_127",WW="_IsSearchSelected_1mpkv_132",UW="_IsHovered_1mpkv_143",GW="_CheckBox_1mpkv_147",YW="_Indents_1mpkv_159",VW="_ExpandIcon_1mpkv_166",ZW="_Content_1mpkv_178",XW="_RightSticky_1mpkv_187",KW="_SearchInputWrap_1mpkv_196",JW="_SearchInput_1mpkv_196",QW="_RightAddon_1mpkv_208",qW="_RightAddonIcon_1mpkv_219",jW="_Loader_1mpkv_226",$W="_IsChildOfDragSource_1mpkv_231",No={AWrap:RW,AContainer:IW,ATree:kW,ATreeBody:MW,TreeTopAddon:LW,CoverBorder:OW,InsertBorder:PW,ATreeHeader:DW,ATreeBodyHeader:NW,ATreeBodyHeaderResources:FW,ATreeItem:BW,IsSelectUsed:zW,IsSelected:HW,IsSearchSelected:WW,IsHovered:UW,CheckBox:GW,Indents:YW,ExpandIcon:VW,Content:ZW,RightSticky:XW,SearchInputWrap:KW,SearchInput:JW,RightAddon:QW,RightAddonIcon:qW,Loader:jW,IsChildOfDragSource:$W},eU=n=>{const{isEqual:e,item:t,itemId:r,selectDisabled:i,selectUnused:o,isParentDisabled:l,indents:a,extIndents:h,useExpand:g,useSelect:m,useSearch:x,showCheckbox:w,icons:_,iconWidth:S,isSelectMulti:R,isDraggable:k,isParentCheckHovered:O,hoverdItem:P,onMouseOver:z,onMouseLeave:H,ContentRenderer:G,TreeItemRenderer:N,RightStickyAddon:J,resources:Y,containerRef:K,TreeItemStyle:fe,TreeItemClassName:X,searchItemStyle:te,searchItemClassName:ne,height:ue,isDragSrcItem:se,isChildOfDragItem:$,getItemId:re,treeItemTooltip:ge,treeItemTooltipDelay:me,treeItemTooltipDirection:oe,treeItemTooltipDistance:Q}=n,{children:pe}=B.useMemo(()=>t,[t]),[Ie,Fe]=B.useMemo(()=>g,[g]),[xe,Oe]=B.useMemo(()=>m,[m]),[Le,He]=B.useMemo(()=>x,[x]),Te=B.useMemo(()=>o?o(t):!1,[o,t]),ke=B.useMemo(()=>!i||l?l:i(t),[i,l,t]),Be=B.useMemo(()=>Ie.some(yt=>e(yt,t)),[Ie,e,t]),rt=B.useMemo(()=>!pe||pe.length<1?"noChild":Be?"expanded":"collapsed",[pe,Be]),Re=B.useMemo(()=>Ur.getContent(_,n),[_,n]),ut=B.useMemo(()=>{const yt=Re==null?void 0:Re[rt];return ym.includes(yt)?M.jsx(fo,{icon:yt,style:{width:S,height:S}}):yt},[Re,S,rt]),qe=B.useCallback(yt=>{!Fe||rt==="noChild"||(Fe(Be?Ie.filter(Rt=>!e(Rt,t)):[...Ie,t]),yt.stopPropagation())},[Fe,Ie,Be,t,e,rt]),ot=B.useMemo(()=>xe.some(yt=>e(yt,t)),[xe,e,t]),st=B.useCallback(()=>{!Oe||ke||(Oe(R?ot?xe.filter(yt=>!e(yt,t)):[...xe,t]:[t]),Le&&He&&Le.items.some(yt=>e(yt,t))&&He({...Le,item:t}))},[R,ke,ot,Le,He,Oe,e,xe,t]),bt=B.useMemo(()=>Le==null?void 0:Le.items.some(yt=>e(yt,t)),[Le,e,t]),Mt=B.useMemo(()=>bt&&(Le==null?void 0:Le.item)&&e(Le.item,t),[bt,Le,e,t]),Bt=B.useRef(null),at=B.useRef(null),{attributes:Ye,listeners:Tt,setNodeRef:Ut,transform:gt,transition:Ht,isDragging:xt}=wW({id:r||`item-${JSON.stringify(t)}`,disabled:!k||!!l||!r}),pn=B.useMemo(()=>$?$(t):!1,[$,t]),$t=B.useMemo(()=>{const yt=gt?{transform:Hp.Transform.toString(gt),transition:Ht,opacity:xt?.5:1,zIndex:xt?1:"auto"}:{};return se||pn?{...yt,opacity:.5,zIndex:10}:yt},[gt,Ht,xt,se,pn]);B.useEffect(()=>{r&&Ut&&at.current&&Ut(at.current)},[r,Ut]),B.useEffect(()=>{setTimeout(()=>{if(Mt&&Bt.current&&K.current){const{top:yt,bottom:Rt}=Bt.current.getBoundingClientRect(),{top:on,bottom:En}=K.current.getBoundingClientRect();(yt<on||Rt>En)&&Bt.current.scrollIntoView({behavior:"smooth",block:"center"})}},10)},[K,Mt]);const[sn,Xt]=B.useState(!1),bn=B.useCallback(()=>!ke&&Xt(!0),[ke]),hn=B.useCallback(()=>!ke&&Xt(!1),[ke]),Rn=B.useMemo(()=>Qd.map(t,yt=>yt).filter(yt=>!(i!=null&&i(yt))&&!(o!=null&&o(yt))),[i,o,t]),vn=B.useMemo(()=>!w||!R?!1:ot&&Rn.some(yt=>xe.some(Rt=>e(yt,Rt)))&&Rn.some(yt=>!xe.some(Rt=>e(yt,Rt))),[w,R,ot,Rn,e,xe]),We=B.useMemo(()=>w?R?Rn.every(yt=>xe.some(Rt=>e(yt,Rt))):xe.some(yt=>e(yt,t)):!1,[w,R,Rn,t,e,xe]),Ce=B.useCallback(()=>{if(!(!Oe||ke))if(R)if(ot){const yt=xe.filter(Rt=>!(o!=null&&o(Rt))&&!(i!=null&&i(Rt))&&Rn.some(on=>e(on,Rt)));yt.length>0&&Oe(xe.filter(Rt=>!yt.some(on=>e(Rt,on))))}else{const yt=Rn.filter(Rt=>!(o!=null&&o(Rt))&&!(i!=null&&i(Rt))&&!xe.some(on=>e(on,Rt)));yt.length>0&&Oe([...xe,...yt])}else Oe([t])},[ke,i,o,R,Oe,e,ot,xe,Rn,t]),it=B.useCallback(yt=>{ke||Ce(),yt.stopPropagation()},[ke,Ce]),Ct=B.useMemo(()=>{if(!w||!R||ke)return"";if(ot){const Rt=xe.filter(on=>!(o!=null&&o(on))&&!(i!=null&&i(on))&&Rn.some(En=>e(En,on)));if(Rt.length>0)return Y["deselect n"](Rt.length)}const yt=Rn.filter(Rt=>!(o!=null&&o(Rt))&&!(i!=null&&i(Rt))&&!xe.some(on=>e(on,Rt)));return Y["select n"](yt.length)},[i,o,Y,ke,w,R,ot,Rn,e,xe]),Qt=B.useMemo(()=>Ur.getContent(J,n),[J,n]),Yt=B.useMemo(()=>Ur.getContent(fe,n),[n,fe]),yn=B.useMemo(()=>Ur.getContent(X,n),[n,X]),gn=B.useMemo(()=>Ur.getContent(ne,n),[n,ne]),lt=B.useMemo(()=>Ur.getContent(te,n),[n,te]),kt=B.useMemo(()=>Ur.getContent(ge,n),[n,ge]),vt=B.useMemo(()=>Ur.getContent(me,n),[n,me]),zt=B.useMemo(()=>Ur.getContent(oe,n),[n,oe]),Lt=B.useMemo(()=>Ur.getContent(Q,n),[n,Q]);return M.jsxs(B.Fragment,{children:[M.jsxs(zi,{abaseRef:at,isDisabled:ke,className:dt.clsx(No.ATreeItem,ot&&No.IsSelected,!ke&&(sn||O)&&No.IsHovered,bt&&No.IsSearched,Mt&&(gn||No.IsSearchSelected),!Te&&No.IsSelectUsed,pn&&No.IsChildOfDragSource,"NoSelect",yn),style:{...Yt,...Mt&&lt?lt:{},"--ATreeItem_height":`${ue}px`,...$t||{}},onClick:st,onMouseLeave:yt=>H==null?void 0:H(yt,t),onMouseOver:yt=>z==null?void 0:z(yt,t),...k&&!ke&&Ye?Ye:{},...k&&!ke&&Tt?Tt:{},tooltip:kt,tooltipDelay:vt,tooltipDirection:zt,tooltipDistance:Lt,children:[w&&M.jsx(w1,{className:No.CheckBox,isDisabled:ke,isIndeterminate:vn,tooltip:Ct,useCheck:[+We,Ce],style:{visibility:ke||Te?"hidden":"visible",zIndex:ke||Te?0:2},onClick:it,onMouseOut:hn,onMouseOver:bn}),M.jsx("div",{className:No.Indents,style:{paddingLeft:w?0:Re!=null&&Re.noChild?12:0},children:a.map((yt,Rt)=>{const on=Rt===a.length-1;return M.jsx(P3,{value:yt,map:{Collapsed:h?h({iconWidth:S}).collapsed:M.jsx(nU,{iconWidth:S}),Expanded:h?h({iconWidth:S,isLast:on}).expanded:M.jsx(tU,{iconWidth:S,isLast:on}),IsLast:h?h({iconWidth:S}).isLast:M.jsx(rU,{iconWidth:S})}},Rt)})}),ut&&M.jsx("div",{className:No.ExpandIcon,style:{width:S,minWidth:S,maxWidth:S},onClick:qe,children:ut}),M.jsx("div",{className:dt.clsx(No.Content,"NoSelect"),children:M.jsx(G,{containerRef:K,ContentRenderer:G,extIndents:h,height:ue,hoverdItem:P,icons:_,iconWidth:S,indents:a,isDraggable:k,isEqual:e,isParentCheckHovered:R&&(sn||O),isSelectMulti:R,item:t,itemId:r,resources:Y,RightStickyAddon:J,searchItemClassName:gn,searchItemStyle:te,showCheckbox:w,TreeItemClassName:X,TreeItemRenderer:N,TreeItemStyle:fe,treeItemTooltip:ge,treeItemTooltipDelay:me,treeItemTooltipDirection:oe,treeItemTooltipDistance:Q,useExpand:g,useSearch:x,useSelect:m,onMouseLeave:H,onMouseOver:z})}),Qt&&M.jsx("div",{className:No.RightSticky,children:Qt})]}),Be&&(pe==null?void 0:pe.map((yt,Rt)=>M.jsx(N,{containerRef:K,ContentRenderer:G,extIndents:h,height:ue,hoverdItem:P,icons:_,iconWidth:S,isChildOfDragItem:$,isDraggable:k,isDragSrcItem:se,isEqual:e,isParentCheckHovered:R&&(sn||O),isSelectMulti:R,item:yt,itemId:re?`${re(t)}-child-${Rt}`:r?`${r}-child-${Rt}`:void 0,resources:Y,RightStickyAddon:J,searchItemClassName:gn,searchItemStyle:te,selectDisabled:i,selectUnused:o,showCheckbox:w,TreeItemClassName:X,TreeItemRenderer:N,TreeItemStyle:fe,treeItemTooltip:ge,treeItemTooltipDelay:me,treeItemTooltipDirection:oe,treeItemTooltipDistance:Q,useExpand:g,useSearch:x,useSelect:m,indents:[...a.map(on=>on==="IsLast"?"Collapsed":on),Rt===pe.length-1?"IsLast":"Expanded"],onMouseLeave:H,onMouseOver:z},re?re(yt):Rt)))]})},tU=n=>{const e=Gn.c(9),{iconWidth:t,isLast:r}=n,i=t/8*3,o=t/2,l=t/8;let a;e[0]!==i||e[1]!==o||e[2]!==l?(a={width:i,height:"100%",borderLeft:"var(--ATree_Indent_border)",marginLeft:o,marginRight:l,boxSizing:"border-box",transition:"border-color var(--Transition)"},e[0]=i,e[1]=o,e[2]=l,e[3]=a):a=e[3];let h;e[4]!==r?(h=r&&M.jsx("div",{style:{borderBottom:"var(--ATree_Indent_border)",height:"50%",transition:"border-color var(--Transition)"}}),e[4]=r,e[5]=h):h=e[5];let g;return e[6]!==a||e[7]!==h?(g=M.jsx("div",{style:a,children:h}),e[6]=a,e[7]=h,e[8]=g):g=e[8],g},nU=n=>{const e=Gn.c(2),{iconWidth:t}=n;let r;return e[0]!==t?(r=M.jsx("div",{style:{width:t,height:"100%",borderLeft:"none",marginLeft:0,transition:"border-color var(--Transition)"}}),e[0]=t,e[1]=r):r=e[1],r},rU=n=>{const e=Gn.c(4),{iconWidth:t}=n,r=t/8*3,i=t/2,o=t/8;let l;return e[0]!==r||e[1]!==i||e[2]!==o?(l=M.jsx("div",{style:{width:r,height:"50%",borderLeft:"var(--ATree_Indent_border)",borderBottom:"var(--ATree_Indent_border)",marginLeft:i,marginRight:o,boxSizing:"border-box",transition:"border-color var(--Transition)"}}),e[0]=r,e[1]=i,e[2]=o,e[3]=l):l=e[3],l},iU=n=>{const e=Gn.c(26),{isEqual:t,searchResult:r,initSearch:i,searchUp:o,searchDown:l,searchEnter:a,isDisabled:h,isLoading:g,resources:m,maxLength:x,autoFocus:w}=n;let _;e[0]!==l||e[1]!==a||e[2]!==o?(_=K=>{K.key==="Enter"?a():K.key==="ArrowDown"?l():K.key==="ArrowUp"&&o(),K.preventDefault(),K.stopPropagation()},e[0]=l,e[1]=a,e[2]=o,e[3]=_):_=e[3];const S=_;let R;e[4]!==i?(R=K=>{i(K)},e[4]=i,e[5]=R):R=e[5];const k=R;let O;h||g?O=-1:O=void 0;const P=O,z=m["Search(Placeholder)"],H=(r==null?void 0:r.keyword)??"";let G;e[6]!==k||e[7]!==H?(G=[H,k],e[6]=k,e[7]=H,e[8]=G):G=e[8];let N;e[9]!==t||e[10]!==m||e[11]!==l||e[12]!==a||e[13]!==r||e[14]!==o?(N=M.jsx(oU,{isEqual:t,resources:m,searchDown:l,searchEnter:a,searchResult:r,searchUp:o}),e[9]=t,e[10]=m,e[11]=l,e[12]=a,e[13]=r,e[14]=o,e[15]=N):N=e[15];let J;e[16]===Symbol.for("react.memo_cache_sentinel")?(J={className:No.SearchInputWrap},e[16]=J):J=e[16];let Y;return e[17]!==w||e[18]!==h||e[19]!==x||e[20]!==S||e[21]!==z||e[22]!==G||e[23]!==N||e[24]!==P?(Y=M.jsx(sg,{autoFocus:w,className:No.SearchInput,isDisabled:h,maxLength:x,placeholder:z,tabIndex:P,useValue:G,RightAddon:N,wrapProps:J,onKeyDown:S}),e[17]=w,e[18]=h,e[19]=x,e[20]=S,e[21]=z,e[22]=G,e[23]=N,e[24]=P,e[25]=Y):Y=e[25],Y},oU=n=>{const e=Gn.c(22),{isEqual:t,searchResult:r,searchUp:i,searchDown:o,searchEnter:l,resources:a}=n;let h;if(!r||r.items.length<1)h=0;else{let Y;e[0]!==t||e[1]!==r.item?(Y=K=>r.item&&t(K,r.item),e[0]=t,e[1]=r.item,e[2]=Y):Y=e[2],h=r.items.findIndex(Y)+1}const g=h;let m;!r||r.items.length<1?m=0:m=r.items.length;const x=m;let w;g<2?w=!0:w=!1;const _=w;let S;g>=x?S=!0:S=!1;const R=S;let k;e[3]!==_||e[4]!==i?(k=Y=>{Y.stopPropagation(),!_&&i()},e[3]=_,e[4]=i,e[5]=k):k=e[5];const O=k;let P;e[6]!==R||e[7]!==o?(P=Y=>{Y.stopPropagation(),!R&&o()},e[6]=R,e[7]=o,e[8]=P):P=e[8];const z=P;let H;e[9]!==l?(H=Y=>{Y.stopPropagation(),l()},e[9]=l,e[10]=H):H=e[10];const G=H;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=dt.clsx(No.RightAddon,"NoSelect"),e[11]=N):N=e[11];let J;return e[12]!==R||e[13]!==_||e[14]!==x||e[15]!==z||e[16]!==G||e[17]!==O||e[18]!==g||e[19]!==a||e[20]!==r?(J=M.jsx("div",{className:N,children:r?M.jsxs(M.Fragment,{children:[g,"/",x,M.jsx(zi,{isDisabled:_,onClick:O,children:M.jsx(fo,{className:No.RightAddonIcon,icon:"ArrowUp",mask:""})}),M.jsx(zi,{isDisabled:R,onClick:z,children:M.jsx(fo,{className:No.RightAddonIcon,icon:"ArrowDown"})})]}):M.jsx(ba,{className:No.RightAddonIcon,icon:"Search",style:{marginRight:4},tooltip:a["Search(Button)"],type:"Raw",onClick:G})}),e[12]=R,e[13]=_,e[14]=x,e[15]=z,e[16]=G,e[17]=O,e[18]=g,e[19]=a,e[20]=r,e[21]=J):J=e[21],J},lU=n=>{var ri;const{pk:e,selectDisabled:t,selectUnused:r,useItems:i,useExpand:o,useSelect:l,useSearch:a,showCheckbox:h,iconWidth:g=24,icons:m={noChild:"Folder",collapsed:"FolderCopy",expanded:"FolderOpen"},indents:x,isSelectMulti:w=!1,noSearch:_=!1,isDraggable:S,noSyncSearchSelect:R=!1,actionRef:k,placeholder:O,searchPredicate:P=aU,isDisabled:z,isLoading:H,ContentRenderer:G=sU,TreeItemRenderer:N=eU,RightStickyAddon:J,TopRightAddon:Y,TreeTopAddon:K,resources:fe,maxLength:X,autoFocus:te,TreeHeaderStyle:ne,TreeHeaderClassName:ue,TreeItemStyle:se,TreeItemClassName:$,OverflowPadding:re,insertBorder:ge,width:me,searchItemClassName:oe,searchItemStyle:Q,height:pe=40,treeItemTooltip:Ie,treeItemTooltipDelay:Fe,treeItemTooltipDirection:xe,treeItemTooltipDistance:Oe,...Le}=n,He=B.useMemo(()=>({...Or.ATree,...fe}),[fe]),Te=B.useCallback(($e,tn)=>!$e||!tn?!1:e!==void 0?Array.isArray(e)?e.every(ln=>$e&&tn&&$e[ln]!==void 0&&tn[ln]!==void 0&&Jh.isEqual($e[ln],tn[ln])):$e&&tn&&$e[e]!==void 0&&tn[e]!==void 0&&Jh.isEqual($e[e],tn[e]):Jh.isEqual($e,tn),[e]),ke=B.useRef(null),[Be,rt]=Fo(i,[]),Re=B.useMemo(()=>Qd.map(Be,$e=>$e),[Be]),[ut,qe]=Fo(o,[]),[ot,st]=Fo(l,[]),[bt,Mt]=Fo(a,void 0),Bt=B.useCallback($e=>{if(z||!qe||ut.some(Nn=>Te(Nn,$e)))return;const tn=[];let ln=$e;for(;ln;){const Nn=ln;ut.find(yr=>Te(yr,Nn))||tn.push(Nn),ln=Re.find(yr=>{var Ln;return(Ln=yr.children)==null?void 0:Ln.some(Pt=>Te(Pt,Nn))})}qe([...ut,...tn])},[ut,z,Te,qe,Re]),at=B.useCallback(()=>{!qe||z||qe([...Re])},[Re,z,qe]),Ye=B.useCallback(()=>{!qe||z||qe([])},[qe,z]),Tt=B.useCallback($e=>{!st||z||r!=null&&r($e)||(st([$e]),Bt($e))},[st,z,r,Bt]),Ut=B.useCallback($e=>{if(!Mt||z)return;if(!$e||_){Mt(void 0),R||st==null||st([]);return}const tn=Qd.filter(Be,Nn=>P($e,Nn));let ln;if(tn.find(Nn=>(bt==null?void 0:bt.item)&&Te(Nn,bt.item))?ln=bt==null?void 0:bt.item:tn.length>0&&(ln=tn[0]),Mt({keyword:$e,items:tn,item:ln}),ln&&Bt(ln),st&&!R)if(w)st(tn);else{const Nn=tn.find(yr=>ln&&Te(yr,ln));st(Nn?[Nn]:[])}},[Be,z,Te,P,Mt,st,Bt,R,_,w,bt]),gt=B.useRef(!1);B.useEffect(()=>{gt.current=!0},[Be]),B.useEffect(()=>{bt&&gt.current&&(Ut(bt.keyword),gt.current=!1)},[Ut,bt]);const Ht=B.useCallback(()=>{if(!bt||!Mt||z)return;let $e=bt.items.findIndex(tn=>bt.item&&Te(tn,bt.item))-1;$e<0||(Mt({...bt,item:bt.items[$e]}),Bt(bt.items[$e]),R||Tt(bt.items[$e]))},[bt,Bt,Mt,z,Tt,Te,R]),xt=B.useCallback(()=>{if(!bt||!Mt||z)return;let $e=bt.items.findIndex(tn=>bt.item&&Te(tn,bt.item))+1;$e>=bt.items.length||(Mt({...bt,item:bt.items[$e]}),Bt(bt.items[$e]),R||Tt(bt.items[$e]))},[bt,Bt,z,Mt,Tt,Te,R]),pn=B.useCallback(()=>{if(!bt||!Mt||z)return;let $e=bt.items.findIndex(ln=>bt.item&&Te(ln,bt.item));if(!R||r!=null&&r(bt.items[$e])){xt();return}if(ot.some(ln=>bt.item&&Te(ln,bt.item))){let ln=$e+1;const Nn=bt.items[ln];if(ln>=bt.items.length)return;Mt({...bt,item:Nn}),Tt(Nn)}else Tt(bt.items[$e])},[bt,Mt,z,ot,R,xt,Te,Tt,r]),[$t,sn]=B.useState(!1),Xt=B.useCallback(()=>sn(!0),[]),bn=B.useCallback(()=>sn(!1),[]),hn=B.useMemo(()=>r?Qd.map(Be,$e=>$e).filter($e=>!r($e)):t?Qd.map(Be,$e=>$e).filter($e=>!t($e)):Qd.map(Be,$e=>$e),[r,t,Be]),Rn=B.useMemo(()=>!h||!w?!1:ot.length>0&&hn.length>ot.length,[h,w,ot,hn]),vn=B.useMemo(()=>!h||!w?!1:ot.length>0&&hn.length===ot.length,[h,w,ot,hn]),We=B.useCallback(()=>{if(!st||!w||z)return;const $e=ot.filter(tn=>!(r!=null&&r(tn))&&!(t!=null&&t(tn))&&hn.some(ln=>Te(ln,tn)));if($e.length>0)st(ot.filter(tn=>!$e.some(ln=>Te(tn,ln))));else{const tn=hn.filter(ln=>!(r!=null&&r(ln))&&!(t!=null&&t(ln))&&!ot.some(Nn=>Te(Nn,ln)));tn.length>0&&st([...ot,...tn])}},[w,z,r,t,st,ot,hn,Te]),Ce=B.useMemo(()=>{if(!h||!w||z)return"";const $e=ot.filter(tn=>!(r!=null&&r(tn))&&!(t!=null&&t(tn))&&hn.some(ln=>Te(ln,tn)));if($e.length>0)return He["deselect n"]($e.length);{const tn=hn.filter(ln=>!(r!=null&&r(ln))&&!(t!=null&&t(ln))&&!ot.some(Nn=>Te(Nn,ln)));return He["select n"](tn.length)}},[r,t,z,He,h,w,hn,ot,Te]),[it,Ct]=B.useState(),Qt=Jz(Lw(l2,{activationConstraint:{distance:8}}),Lw(i2)),Yt=B.useRef(new Map),yn=B.useCallback($e=>{if(!Yt.current.has($e)){const tn=`item_${Jh.uniqueId()}`;Yt.current.set($e,tn)}return Yt.current.get($e)},[]),gn=B.useCallback($e=>Re.find(tn=>yn(tn)===$e),[Re,yn]),lt=B.useCallback($e=>!it||!it.children?!1:it.children.some(ln=>Te(ln,$e))?!0:it.children.some(ln=>ln.children?Qd.find(ln,Nn=>Te(Nn,$e))!==void 0:!1),[it,Te]),kt=B.useCallback($e=>{if(!S||z)return;const tn=gn($e.active.id);tn&&Ct(tn)},[S,z,gn]),vt=B.useCallback(($e,tn,ln,Nn)=>{const yr=$e.findIndex(Pt=>Nn(Pt,tn)),Ln=$e.findIndex(Pt=>Nn(Pt,ln));return yr!==-1&&Ln!==-1?wv($e,yr,Ln):$e.map(Pt=>{if(!Pt.children)return Pt;const Se=Pt.children.findIndex(At=>Nn(At,tn)),tt=Pt.children.findIndex(At=>Nn(At,ln));return Se!==-1&&tt!==-1?{...Pt,children:wv(Pt.children,Se,tt)}:Pt.children?{...Pt,children:vt(Pt.children,tn,ln,Nn)}:Pt})},[]),zt=B.useCallback($e=>{!S||z||!it||!$e.over||gn($e.over.id)},[S,z,it,gn]),Lt=B.useCallback($e=>{if(!S||z||!rt||!it||!$e.over)return;const tn=gn($e.over.id);if(!tn||Te(it,tn)){Ct(void 0);return}const ln=vt(Be,it,tn,Te);rt(ln),Ct(void 0)},[S,z,rt,it,gn,Te,Be,vt]),yt=B.useMemo(()=>Be.map($e=>yn($e)),[Be,yn]);B.useEffect(()=>{var $e;h||($e=ke.current)==null||$e.scrollTo(0,0)},[h,ke]),B.useEffect(()=>{!w&&ot.length>1&&(st==null||st([ot[ot.length-1]]))},[w,st,ot]),B.useEffect(()=>{k&&(k.current={expandAll:at,collapseAll:Ye})},[k,at,Ye]),B.useEffect(()=>{if(!t||!st)return;const $e=ot.filter(tn=>!t(tn));ot.length!==$e.length&&st($e)},[t,ot,st]),B.useEffect(()=>{if(!r||!st)return;const $e=ot.filter(tn=>!r(tn));ot.length!==$e.length&&st($e)},[r,ot,st]),B.useEffect(()=>{Mt&&Mt(void 0)},[Mt]);const[Rt,on]=B.useState(null),En=B.useCallback(($e,tn)=>{z||($e.stopPropagation(),$e.preventDefault(),on(tn))},[z]),Jt=B.useCallback(($e,tn)=>{Rt===null||z||Te(tn,Rt)&&($e.stopPropagation(),$e.preventDefault(),on(null))},[Rt,z,Te]),xn=B.useRef(null),[_n,zn]=B.useState(!1),[er,wn]=B.useState((ri=xn.current)==null?void 0:ri.scrollHeight);return B.useEffect(()=>{if(ut.length<0)return;const $e=ke.current,tn=xn.current,ln=$e.clientHeight<tn.clientHeight;wn(ln?tn.scrollHeight:$e.clientHeight),zn(ln)},[ut]),M.jsxs(zi,{...Le,className:dt.clsx(Le.className,No.AWrap),isDisabled:z,children:[(!_||Y)&&M.jsxs(Ml,{className:dt.clsx(No.ATreeHeader,ue),style:ne,children:[!_&&M.jsx(iU,{autoFocus:te,initSearch:Ut,isDisabled:z,isEqual:Te,isLoading:H,maxLength:X,resources:He,searchDown:xt,searchEnter:pn,searchResult:bt,searchUp:Ht}),!_&&Y&&M.jsx(cs,{w:8}),Y]}),(!_||Y||h&&w||S)&&M.jsx(Am,{isLoading:H&&Be.length!==0}),(h&&w||S)&&M.jsxs("div",{className:dt.clsx(No.ATreeBodyHeader,"NoSelect"),children:[h&&M.jsx(w1,{className:No.CheckBox,isDisabled:z,isIndeterminate:Rn,tooltip:Ce,useCheck:[+vn,()=>We()],onMouseOut:bn,onMouseOver:Xt}),He.Items,M.jsx(zg,{}),M.jsxs("div",{className:dt.clsx(No.ATreeBodyHeaderResources,"NoSelect"),style:{marginRight:_n?8:0},children:[M.jsx("span",{children:h&&He["*Click row for single select"]}),M.jsx("span",{children:S&&He["*Change order to row drag"]})]})]}),K&&M.jsx("div",{className:No.TreeTopAddon,children:K}),M.jsx("div",{ref:ke,className:dt.clsx(Le.className,No.AContainer),children:M.jsxs("div",{className:No.ATree,style:{minWidth:me||"fit-content",marginRight:re&&_n?8:0},children:[M.jsxs("div",{ref:xn,className:No.ATreeBody,children:[Be.length===0?H?M.jsx(cU,{text:He["Loading Contents..."]}):O:null,M.jsx($H,{collisionDetection:eH,modifiers:[sW,aW],sensors:Qt,measuring:{droppable:{strategy:M1.Always}},onDragEnd:Lt,onDragOver:zt,onDragStart:kt,children:M.jsx(gW,{items:yt,strategy:hW,children:Be.map($e=>M.jsx(N,{containerRef:ke,ContentRenderer:G,extIndents:x,getItemId:yn,height:pe,hoverdItem:Rt,icons:m,iconWidth:g,indents:[],isChildOfDragItem:lt,isDraggable:S,isDragSrcItem:Te($e,it),isEqual:Te,isParentCheckHovered:w&&$t,isParentDisabled:z,isSelectMulti:w,item:$e,itemId:yn($e),resources:He,RightStickyAddon:J,searchItemClassName:oe,searchItemStyle:Q,selectDisabled:t,selectUnused:r,showCheckbox:h,TreeItemClassName:$,TreeItemRenderer:N,TreeItemStyle:se,treeItemTooltip:Ie,treeItemTooltipDelay:Fe,treeItemTooltipDirection:xe,treeItemTooltipDistance:Oe,useExpand:[ut,qe],useSearch:[bt,Mt],useSelect:[ot,st],onMouseLeave:Jt,onMouseOver:En},yn($e)))})})]}),ge&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:No.CoverBorder}),M.jsx("div",{className:No.InsertBorder,style:{"--InsertBorder_height":`${pe}px`,height:_n?er:"100%"}})]})]})})]})},sU=n=>{const{item:e}=n,t={};return $n.keys(e).forEach(r=>{r!=="children"&&(t[r]=e[r])}),JSON.stringify(t)};function aU(n,e){return $n.some(e,(t,r)=>{var i;return(i=$n.stringify(r))==null?void 0:i.toLowerCase().includes(n.toLowerCase())})}const cU=n=>{const e=Gn.c(4),{text:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=dt.clsx(No.Loader,"NoSelect"),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=M.jsx(fo,{height:40,icon:"Spinner",style:{height:40},width:40}),e[1]=i):i=e[1];let o;return e[2]!==t?(o=M.jsxs(Ml,{className:r,children:[i,M.jsx(V3,{text:t})]}),e[2]=t,e[3]=o):o=e[3],o};var Bb,Yw;function z1(){return Yw||(Yw=1,Bb=TypeError),Bb}const uU={},fU=Object.freeze(Object.defineProperty({__proto__:null,default:uU},Symbol.toStringTag,{value:"Module"})),hU=TE(fU);var zb,Vw;function Uv(){if(Vw)return zb;Vw=1;var n=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=n&&e&&typeof e.get=="function"?e.get:null,r=n&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=i&&o&&typeof o.get=="function"?o.get:null,a=i&&Set.prototype.forEach,h=typeof WeakMap=="function"&&WeakMap.prototype,g=h?WeakMap.prototype.has:null,m=typeof WeakSet=="function"&&WeakSet.prototype,x=m?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,_=w?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,R=Object.prototype.toString,k=Function.prototype.toString,O=String.prototype.match,P=String.prototype.slice,z=String.prototype.replace,H=String.prototype.toUpperCase,G=String.prototype.toLowerCase,N=RegExp.prototype.test,J=Array.prototype.concat,Y=Array.prototype.join,K=Array.prototype.slice,fe=Math.floor,X=typeof BigInt=="function"?BigInt.prototype.valueOf:null,te=Object.getOwnPropertySymbols,ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",se=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ue||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,re=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(We){return We.__proto__}:null);function ge(We,Ce){if(We===1/0||We===-1/0||We!==We||We&&We>-1e3&&We<1e3||N.call(/e/,Ce))return Ce;var it=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof We=="number"){var Ct=We<0?-fe(-We):fe(We);if(Ct!==We){var Qt=String(Ct),Yt=P.call(Ce,Qt.length+1);return z.call(Qt,it,"$&_")+"."+z.call(z.call(Yt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return z.call(Ce,it,"$&_")}var me=hU,oe=me.custom,Q=ut(oe)?oe:null,pe={__proto__:null,double:'"',single:"'"},Ie={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};zb=function We(Ce,it,Ct,Qt){var Yt=it||{};if(st(Yt,"quoteStyle")&&!st(pe,Yt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(st(Yt,"maxStringLength")&&(typeof Yt.maxStringLength=="number"?Yt.maxStringLength<0&&Yt.maxStringLength!==1/0:Yt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var yn=st(Yt,"customInspect")?Yt.customInspect:!0;if(typeof yn!="boolean"&&yn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(st(Yt,"indent")&&Yt.indent!==null&&Yt.indent!==" "&&!(parseInt(Yt.indent,10)===Yt.indent&&Yt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(st(Yt,"numericSeparator")&&typeof Yt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var gn=Yt.numericSeparator;if(typeof Ce>"u")return"undefined";if(Ce===null)return"null";if(typeof Ce=="boolean")return Ce?"true":"false";if(typeof Ce=="string")return xt(Ce,Yt);if(typeof Ce=="number"){if(Ce===0)return 1/0/Ce>0?"0":"-0";var lt=String(Ce);return gn?ge(Ce,lt):lt}if(typeof Ce=="bigint"){var kt=String(Ce)+"n";return gn?ge(Ce,kt):kt}var vt=typeof Yt.depth>"u"?5:Yt.depth;if(typeof Ct>"u"&&(Ct=0),Ct>=vt&&vt>0&&typeof Ce=="object")return Le(Ce)?"[Array]":"[Object]";var zt=hn(Yt,Ct);if(typeof Qt>"u")Qt=[];else if(Bt(Qt,Ce)>=0)return"[Circular]";function Lt(Ln,Pt,Se){if(Pt&&(Qt=K.call(Qt),Qt.push(Pt)),Se){var tt={depth:Yt.depth};return st(Yt,"quoteStyle")&&(tt.quoteStyle=Yt.quoteStyle),We(Ln,tt,Ct+1,Qt)}return We(Ln,Yt,Ct+1,Qt)}if(typeof Ce=="function"&&!Te(Ce)){var yt=Mt(Ce),Rt=vn(Ce,Lt);return"[Function"+(yt?": "+yt:" (anonymous)")+"]"+(Rt.length>0?" { "+Y.call(Rt,", ")+" }":"")}if(ut(Ce)){var on=ue?z.call(String(Ce),/^(Symbol\(.*\))_[^)]*$/,"$1"):ne.call(Ce);return typeof Ce=="object"&&!ue?$t(on):on}if(Ht(Ce)){for(var En="<"+G.call(String(Ce.nodeName)),Jt=Ce.attributes||[],xn=0;xn<Jt.length;xn++)En+=" "+Jt[xn].name+"="+Fe(xe(Jt[xn].value),"double",Yt);return En+=">",Ce.childNodes&&Ce.childNodes.length&&(En+="..."),En+="</"+G.call(String(Ce.nodeName))+">",En}if(Le(Ce)){if(Ce.length===0)return"[]";var _n=vn(Ce,Lt);return zt&&!bn(_n)?"["+Rn(_n,zt)+"]":"[ "+Y.call(_n,", ")+" ]"}if(ke(Ce)){var zn=vn(Ce,Lt);return!("cause"in Error.prototype)&&"cause"in Ce&&!$.call(Ce,"cause")?"{ ["+String(Ce)+"] "+Y.call(J.call("[cause]: "+Lt(Ce.cause),zn),", ")+" }":zn.length===0?"["+String(Ce)+"]":"{ ["+String(Ce)+"] "+Y.call(zn,", ")+" }"}if(typeof Ce=="object"&&yn){if(Q&&typeof Ce[Q]=="function"&&me)return me(Ce,{depth:vt-Ct});if(yn!=="symbol"&&typeof Ce.inspect=="function")return Ce.inspect()}if(at(Ce)){var er=[];return r&&r.call(Ce,function(Ln,Pt){er.push(Lt(Pt,Ce,!0)+" => "+Lt(Ln,Ce))}),Xt("Map",t.call(Ce),er,zt)}if(Ut(Ce)){var wn=[];return a&&a.call(Ce,function(Ln){wn.push(Lt(Ln,Ce))}),Xt("Set",l.call(Ce),wn,zt)}if(Ye(Ce))return sn("WeakMap");if(gt(Ce))return sn("WeakSet");if(Tt(Ce))return sn("WeakRef");if(rt(Ce))return $t(Lt(Number(Ce)));if(qe(Ce))return $t(Lt(X.call(Ce)));if(Re(Ce))return $t(S.call(Ce));if(Be(Ce))return $t(Lt(String(Ce)));if(typeof window<"u"&&Ce===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Ce===globalThis||typeof jh<"u"&&Ce===jh)return"{ [object globalThis] }";if(!He(Ce)&&!Te(Ce)){var ri=vn(Ce,Lt),$e=re?re(Ce)===Object.prototype:Ce instanceof Object||Ce.constructor===Object,tn=Ce instanceof Object?"":"null prototype",ln=!$e&&se&&Object(Ce)===Ce&&se in Ce?P.call(bt(Ce),8,-1):tn?"Object":"",Nn=$e||typeof Ce.constructor!="function"?"":Ce.constructor.name?Ce.constructor.name+" ":"",yr=Nn+(ln||tn?"["+Y.call(J.call([],ln||[],tn||[]),": ")+"] ":"");return ri.length===0?yr+"{}":zt?yr+"{"+Rn(ri,zt)+"}":yr+"{ "+Y.call(ri,", ")+" }"}return String(Ce)};function Fe(We,Ce,it){var Ct=it.quoteStyle||Ce,Qt=pe[Ct];return Qt+We+Qt}function xe(We){return z.call(String(We),/"/g,"&quot;")}function Oe(We){return!se||!(typeof We=="object"&&(se in We||typeof We[se]<"u"))}function Le(We){return bt(We)==="[object Array]"&&Oe(We)}function He(We){return bt(We)==="[object Date]"&&Oe(We)}function Te(We){return bt(We)==="[object RegExp]"&&Oe(We)}function ke(We){return bt(We)==="[object Error]"&&Oe(We)}function Be(We){return bt(We)==="[object String]"&&Oe(We)}function rt(We){return bt(We)==="[object Number]"&&Oe(We)}function Re(We){return bt(We)==="[object Boolean]"&&Oe(We)}function ut(We){if(ue)return We&&typeof We=="object"&&We instanceof Symbol;if(typeof We=="symbol")return!0;if(!We||typeof We!="object"||!ne)return!1;try{return ne.call(We),!0}catch{}return!1}function qe(We){if(!We||typeof We!="object"||!X)return!1;try{return X.call(We),!0}catch{}return!1}var ot=Object.prototype.hasOwnProperty||function(We){return We in this};function st(We,Ce){return ot.call(We,Ce)}function bt(We){return R.call(We)}function Mt(We){if(We.name)return We.name;var Ce=O.call(k.call(We),/^function\s*([\w$]+)/);return Ce?Ce[1]:null}function Bt(We,Ce){if(We.indexOf)return We.indexOf(Ce);for(var it=0,Ct=We.length;it<Ct;it++)if(We[it]===Ce)return it;return-1}function at(We){if(!t||!We||typeof We!="object")return!1;try{t.call(We);try{l.call(We)}catch{return!0}return We instanceof Map}catch{}return!1}function Ye(We){if(!g||!We||typeof We!="object")return!1;try{g.call(We,g);try{x.call(We,x)}catch{return!0}return We instanceof WeakMap}catch{}return!1}function Tt(We){if(!_||!We||typeof We!="object")return!1;try{return _.call(We),!0}catch{}return!1}function Ut(We){if(!l||!We||typeof We!="object")return!1;try{l.call(We);try{t.call(We)}catch{return!0}return We instanceof Set}catch{}return!1}function gt(We){if(!x||!We||typeof We!="object")return!1;try{x.call(We,x);try{g.call(We,g)}catch{return!0}return We instanceof WeakSet}catch{}return!1}function Ht(We){return!We||typeof We!="object"?!1:typeof HTMLElement<"u"&&We instanceof HTMLElement?!0:typeof We.nodeName=="string"&&typeof We.getAttribute=="function"}function xt(We,Ce){if(We.length>Ce.maxStringLength){var it=We.length-Ce.maxStringLength,Ct="... "+it+" more character"+(it>1?"s":"");return xt(P.call(We,0,Ce.maxStringLength),Ce)+Ct}var Qt=Ie[Ce.quoteStyle||"single"];Qt.lastIndex=0;var Yt=z.call(z.call(We,Qt,"\\$1"),/[\x00-\x1f]/g,pn);return Fe(Yt,"single",Ce)}function pn(We){var Ce=We.charCodeAt(0),it={8:"b",9:"t",10:"n",12:"f",13:"r"}[Ce];return it?"\\"+it:"\\x"+(Ce<16?"0":"")+H.call(Ce.toString(16))}function $t(We){return"Object("+We+")"}function sn(We){return We+" { ? }"}function Xt(We,Ce,it,Ct){var Qt=Ct?Rn(it,Ct):Y.call(it,", ");return We+" ("+Ce+") {"+Qt+"}"}function bn(We){for(var Ce=0;Ce<We.length;Ce++)if(Bt(We[Ce],`
484
+ `},Kz={onDragStart(n){let{active:e}=n;return"Picked up draggable item "+e.id+"."},onDragOver(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was moved over droppable area "+t.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was dropped over droppable area "+t.id:"Draggable item "+e.id+" was dropped."},onDragCancel(n){let{active:e}=n;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Jz(n){let{announcements:e=Kz,container:t,hiddenTextDescribedById:r,screenReaderInstructions:i=Xz}=n;const{announce:o,announcement:l}=Yz(),a=Qp("DndLiveRegion"),[h,g]=B.useState(!1);if(B.useEffect(()=>{g(!0)},[]),Vz(B.useMemo(()=>({onDragStart(x){let{active:w}=x;o(e.onDragStart({active:w}))},onDragMove(x){let{active:w,over:_}=x;e.onDragMove&&o(e.onDragMove({active:w,over:_}))},onDragOver(x){let{active:w,over:_}=x;o(e.onDragOver({active:w,over:_}))},onDragEnd(x){let{active:w,over:_}=x;o(e.onDragEnd({active:w,over:_}))},onDragCancel(x){let{active:w,over:_}=x;o(e.onDragCancel({active:w,over:_}))}}),[o,e])),!h)return null;const m=B.createElement(B.Fragment,null,B.createElement(Uz,{id:r,value:i.draggable}),B.createElement(Gz,{id:a,announcement:l}));return t?su.createPortal(m,t):m}var Ba;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Ba||(Ba={}));function mv(){}function Lw(n,e){return B.useMemo(()=>({sensor:n,options:e??{}}),[n,e])}function Qz(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return B.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Fh=Object.freeze({x:0,y:0});function qz(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function jz(n,e){let{data:{value:t}}=n,{data:{value:r}}=e;return t-r}function $z(n,e){let{data:{value:t}}=n,{data:{value:r}}=e;return r-t}function eH(n,e){if(!n||n.length===0)return null;const[t]=n;return t[e]}function Ow(n,e,t){return e===void 0&&(e=n.left),t===void 0&&(t=n.top),{x:e+n.width*.5,y:t+n.height*.5}}const tH=n=>{let{collisionRect:e,droppableRects:t,droppableContainers:r}=n;const i=Ow(e,e.left,e.top),o=[];for(const l of r){const{id:a}=l,h=t.get(a);if(h){const g=qz(Ow(h),i);o.push({id:a,data:{droppableContainer:l,value:g}})}}return o.sort(jz)};function nH(n,e){const t=Math.max(e.top,n.top),r=Math.max(e.left,n.left),i=Math.min(e.left+e.width,n.left+n.width),o=Math.min(e.top+e.height,n.top+n.height),l=i-r,a=o-t;if(r<i&&t<o){const h=e.width*e.height,g=n.width*n.height,m=l*a,x=m/(h+g-m);return Number(x.toFixed(4))}return 0}const rH=n=>{let{collisionRect:e,droppableRects:t,droppableContainers:r}=n;const i=[];for(const o of r){const{id:l}=o,a=t.get(l);if(a){const h=nH(a,e);h>0&&i.push({id:l,data:{droppableContainer:o,value:h}})}}return i.sort($z)};function iH(n,e,t){return{...n,scaleX:e&&t?e.width/t.width:1,scaleY:e&&t?e.height/t.height:1}}function M_(n,e){return n&&e?{x:n.left-e.left,y:n.top-e.top}:Fh}function oH(n){return function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((l,a)=>({...l,top:l.top+n*a.y,bottom:l.bottom+n*a.y,left:l.left+n*a.x,right:l.right+n*a.x}),{...t})}}const lH=oH(1);function sH(n){if(n.startsWith("matrix3d(")){const e=n.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(n.startsWith("matrix(")){const e=n.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function aH(n,e,t){const r=sH(e);if(!r)return n;const{scaleX:i,scaleY:o,x:l,y:a}=r,h=n.left-l-(1-i)*parseFloat(t),g=n.top-a-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),m=i?n.width/i:n.width,x=o?n.height/o:n.height;return{width:m,height:x,top:g,right:h+m,bottom:g+x,left:h}}const cH={ignoreTransform:!1};function B1(n,e){e===void 0&&(e=cH);let t=n.getBoundingClientRect();if(e.ignoreTransform){const{transform:g,transformOrigin:m}=uf(n).getComputedStyle(n);g&&(t=aH(t,g,m))}const{top:r,left:i,width:o,height:l,bottom:a,right:h}=t;return{top:r,left:i,width:o,height:l,bottom:a,right:h}}function Pw(n){return B1(n,{ignoreTransform:!0})}function uH(n){const e=n.innerWidth,t=n.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function fH(n,e){return e===void 0&&(e=uf(n).getComputedStyle(n)),e.position==="fixed"}function hH(n,e){e===void 0&&(e=uf(n).getComputedStyle(n));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=e[i];return typeof o=="string"?t.test(o):!1})}function n2(n,e){const t=[];function r(i){if(e!=null&&t.length>=e||!i)return t;if($m(i)&&i.scrollingElement!=null&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!Kp(i)||R_(i)||t.includes(i))return t;const o=uf(n).getComputedStyle(i);return i!==n&&hH(i,o)&&t.push(i),fH(i,o)?t:r(i.parentNode)}return n?r(n):t}function L_(n){const[e]=n2(n,1);return e??null}function Db(n){return!zv||!n?null:N1(n)?n:jm(n)?$m(n)||n===F1(n).scrollingElement?window:Kp(n)?n:null:null}function O_(n){return N1(n)?n.scrollX:n.scrollLeft}function P_(n){return N1(n)?n.scrollY:n.scrollTop}function hm(n){return{x:O_(n),y:P_(n)}}var oc;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(oc||(oc={}));function D_(n){return!zv||!n?!1:n===document.scrollingElement}function N_(n){const e={x:0,y:0},t=D_(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},r={x:n.scrollWidth-t.width,y:n.scrollHeight-t.height},i=n.scrollTop<=e.y,o=n.scrollLeft<=e.x,l=n.scrollTop>=r.y,a=n.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:l,isRight:a,maxScroll:r,minScroll:e}}const dH={x:.2,y:.2};function gH(n,e,t,r,i){let{top:o,left:l,right:a,bottom:h}=t;r===void 0&&(r=10),i===void 0&&(i=dH);const{isTop:g,isBottom:m,isLeft:x,isRight:w}=N_(n),_={x:0,y:0},S={x:0,y:0},R={height:e.height*i.y,width:e.width*i.x};return!g&&o<=e.top+R.height?(_.y=oc.Backward,S.y=r*Math.abs((e.top+R.height-o)/R.height)):!m&&h>=e.bottom-R.height&&(_.y=oc.Forward,S.y=r*Math.abs((e.bottom-R.height-h)/R.height)),!w&&a>=e.right-R.width?(_.x=oc.Forward,S.x=r*Math.abs((e.right-R.width-a)/R.width)):!x&&l<=e.left+R.width&&(_.x=oc.Backward,S.x=r*Math.abs((e.left+R.width-l)/R.width)),{direction:_,speed:S}}function pH(n){if(n===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:e,left:t,right:r,bottom:i}=n.getBoundingClientRect();return{top:e,left:t,right:r,bottom:i,width:n.clientWidth,height:n.clientHeight}}function F_(n){return n.reduce((e,t)=>m1(e,hm(t)),Fh)}function vH(n){return n.reduce((e,t)=>e+O_(t),0)}function bH(n){return n.reduce((e,t)=>e+P_(t),0)}function yH(n,e){if(e===void 0&&(e=B1),!n)return;const{top:t,left:r,bottom:i,right:o}=e(n);L_(n)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const mH=[["x",["left","right"],vH],["y",["top","bottom"],bH]];class r2{constructor(e,t){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 r=n2(t),i=F_(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,l,a]of mH)for(const h of l)Object.defineProperty(this,h,{get:()=>{const g=a(r),m=i[o]-g;return this.rect[h]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xp{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...t)})},this.target=e}add(e,t,r){var i;(i=this.target)==null||i.addEventListener(e,t,r),this.listeners.push([e,t,r])}}function xH(n){const{EventTarget:e}=uf(n);return n instanceof e?n:F1(n)}function Nb(n,e){const t=Math.abs(n.x),r=Math.abs(n.y);return typeof e=="number"?Math.sqrt(t**2+r**2)>e:"x"in e&&"y"in e?t>e.x&&r>e.y:"x"in e?t>e.x:"y"in e?r>e.y:!1}var fh;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(fh||(fh={}));function Dw(n){n.preventDefault()}function wH(n){n.stopPropagation()}var _o;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(_o||(_o={}));const B_={start:[_o.Space,_o.Enter],cancel:[_o.Esc],end:[_o.Space,_o.Enter,_o.Tab]},CH=(n,e)=>{let{currentCoordinates:t}=e;switch(n.code){case _o.Right:return{...t,x:t.x+25};case _o.Left:return{...t,x:t.x-25};case _o.Down:return{...t,y:t.y+25};case _o.Up:return{...t,y:t.y-25}}};class i2{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new xp(F1(t)),this.windowListeners=new xp(uf(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fh.Resize,this.handleCancel),this.windowListeners.add(fh.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fh.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,r=e.node.current;r&&yH(r),t(Fh)}handleKeyDown(e){if(t2(e)){const{active:t,context:r,options:i}=this.props,{keyboardCodes:o=B_,coordinateGetter:l=CH,scrollBehavior:a="smooth"}=i,{code:h}=e;if(o.end.includes(h)){this.handleEnd(e);return}if(o.cancel.includes(h)){this.handleCancel(e);return}const{collisionRect:g}=r.current,m=g?{x:g.left,y:g.top}:Fh;this.referenceCoordinates||(this.referenceCoordinates=m);const x=l(e,{active:t,context:r.current,currentCoordinates:m});if(x){const w=yv(x,m),_={x:0,y:0},{scrollableAncestors:S}=r.current;for(const R of S){const k=e.code,{isTop:O,isRight:P,isLeft:z,isBottom:H,maxScroll:G,minScroll:N}=N_(R),J=pH(R),Y={x:Math.min(k===_o.Right?J.right-J.width/2:J.right,Math.max(k===_o.Right?J.left:J.left+J.width/2,x.x)),y:Math.min(k===_o.Down?J.bottom-J.height/2:J.bottom,Math.max(k===_o.Down?J.top:J.top+J.height/2,x.y))},K=k===_o.Right&&!P||k===_o.Left&&!z,fe=k===_o.Down&&!H||k===_o.Up&&!O;if(K&&Y.x!==x.x){const X=R.scrollLeft+w.x,te=k===_o.Right&&X<=G.x||k===_o.Left&&X>=N.x;if(te&&!w.y){R.scrollTo({left:X,behavior:a});return}te?_.x=R.scrollLeft-X:_.x=k===_o.Right?R.scrollLeft-G.x:R.scrollLeft-N.x,_.x&&R.scrollBy({left:-_.x,behavior:a});break}else if(fe&&Y.y!==x.y){const X=R.scrollTop+w.y,te=k===_o.Down&&X<=G.y||k===_o.Up&&X>=N.y;if(te&&!w.x){R.scrollTo({top:X,behavior:a});return}te?_.y=R.scrollTop-X:_.y=k===_o.Down?R.scrollTop-G.y:R.scrollTop-N.y,_.y&&R.scrollBy({top:-_.y,behavior:a});break}}this.handleMove(e,m1(yv(x,this.referenceCoordinates),_))}}}handleMove(e,t){const{onMove:r}=this.props;e.preventDefault(),r(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}i2.activators=[{eventName:"onKeyDown",handler:(n,e,t)=>{let{keyboardCodes:r=B_,onActivation:i}=e,{active:o}=t;const{code:l}=n.nativeEvent;if(r.start.includes(l)){const a=o.activatorNode.current;return a&&n.target!==a?!1:(n.preventDefault(),i==null||i({event:n.nativeEvent}),!0)}return!1}}];function Nw(n){return!!(n&&"distance"in n)}function Fw(n){return!!(n&&"delay"in n)}class o2{constructor(e,t,r){var i;r===void 0&&(r=xH(e.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=e,this.events=t;const{event:o}=e,{target:l}=o;this.props=e,this.events=t,this.document=F1(l),this.documentListeners=new xp(this.document),this.listeners=new xp(r),this.windowListeners=new xp(uf(l)),this.initialCoordinates=(i=fm(o))!=null?i:Fh,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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(fh.Resize,this.handleCancel),this.windowListeners.add(fh.DragStart,Dw),this.windowListeners.add(fh.VisibilityChange,this.handleCancel),this.windowListeners.add(fh.ContextMenu,Dw),this.documentListeners.add(fh.Keydown,this.handleKeydown),t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fw(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Nw(t)){this.handlePending(t);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(e,t){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(fh.Click,wH,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fh.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:l,options:{activationConstraint:a}}=o;if(!i)return;const h=(t=fm(e))!=null?t:Fh,g=yv(i,h);if(!r&&a){if(Nw(a)){if(a.tolerance!=null&&Nb(g,a.tolerance))return this.handleCancel();if(Nb(g,a.distance))return this.handleStart()}if(Fw(a)&&Nb(g,a.tolerance))return this.handleCancel();this.handlePending(a,g);return}e.cancelable&&e.preventDefault(),l(h)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===_o.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const _H={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class l2 extends o2{constructor(e){const{event:t}=e,r=F1(t.target);super(e,_H,r)}}l2.activators=[{eventName:"onPointerDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;return!t.isPrimary||t.button!==0?!1:(r==null||r({event:t}),!0)}}];const SH={move:{name:"mousemove"},end:{name:"mouseup"}};var dm;(function(n){n[n.RightClick=2]="RightClick"})(dm||(dm={}));class EH extends o2{constructor(e){super(e,SH,F1(e.event.target))}}EH.activators=[{eventName:"onMouseDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;return t.button===dm.RightClick?!1:(r==null||r({event:t}),!0)}}];const Fb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class TH extends o2{constructor(e){super(e,Fb)}static setup(){return window.addEventListener(Fb.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Fb.move.name,e)};function e(){}}}TH.activators=[{eventName:"onTouchStart",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;const{touches:i}=t;return i.length>1?!1:(r==null||r({event:t}),!0)}}];var wp;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(wp||(wp={}));var xv;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(xv||(xv={}));function AH(n){let{acceleration:e,activator:t=wp.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:l=5,order:a=xv.TreeOrder,pointerCoordinates:h,scrollableAncestors:g,scrollableAncestorRects:m,delta:x,threshold:w}=n;const _=IH({delta:x,disabled:!o}),[S,R]=Fz(),k=B.useRef({x:0,y:0}),O=B.useRef({x:0,y:0}),P=B.useMemo(()=>{switch(t){case wp.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case wp.DraggableRect:return i}},[t,i,h]),z=B.useRef(null),H=B.useCallback(()=>{const N=z.current;if(!N)return;const J=k.current.x*O.current.x,Y=k.current.y*O.current.y;N.scrollBy(J,Y)},[]),G=B.useMemo(()=>a===xv.TreeOrder?[...g].reverse():g,[a,g]);B.useEffect(()=>{if(!o||!g.length||!P){R();return}for(const N of G){if((r==null?void 0:r(N))===!1)continue;const J=g.indexOf(N),Y=m[J];if(!Y)continue;const{direction:K,speed:fe}=gH(N,Y,P,e,w);for(const X of["x","y"])_[X][K[X]]||(fe[X]=0,K[X]=0);if(fe.x>0||fe.y>0){R(),z.current=N,S(H,l),k.current=fe,O.current=K;return}}k.current={x:0,y:0},O.current={x:0,y:0},R()},[e,H,r,R,o,l,JSON.stringify(P),JSON.stringify(_),S,g,G,m,JSON.stringify(w)])}const RH={x:{[oc.Backward]:!1,[oc.Forward]:!1},y:{[oc.Backward]:!1,[oc.Forward]:!1}};function IH(n){let{delta:e,disabled:t}=n;const r=um(e);return Jp(i=>{if(t||!r||!i)return RH;const o={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[oc.Backward]:i.x[oc.Backward]||o.x===-1,[oc.Forward]:i.x[oc.Forward]||o.x===1},y:{[oc.Backward]:i.y[oc.Backward]||o.y===-1,[oc.Forward]:i.y[oc.Forward]||o.y===1}}},[t,e,r])}function kH(n,e){const t=e!=null?n.get(e):void 0,r=t?t.node.current:null;return Jp(i=>{var o;return e==null?null:(o=r??i)!=null?o:null},[r,e])}function MH(n,e){return B.useMemo(()=>n.reduce((t,r)=>{const{sensor:i}=r,o=i.activators.map(l=>({eventName:l.eventName,handler:e(l.handler,r)}));return[...t,...o]},[]),[n,e])}var M1;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(M1||(M1={}));var gm;(function(n){n.Optimized="optimized"})(gm||(gm={}));const Bw=new Map;function LH(n,e){let{dragging:t,dependencies:r,config:i}=e;const[o,l]=B.useState(null),{frequency:a,measure:h,strategy:g}=i,m=B.useRef(n),x=k(),w=zp(x),_=B.useCallback(function(O){O===void 0&&(O=[]),!w.current&&l(P=>P===null?O:P.concat(O.filter(z=>!P.includes(z))))},[w]),S=B.useRef(null),R=Jp(O=>{if(x&&!t)return Bw;if(!O||O===Bw||m.current!==n||o!=null){const P=new Map;for(let z of n){if(!z)continue;if(o&&o.length>0&&!o.includes(z.id)&&z.rect.current){P.set(z.id,z.rect.current);continue}const H=z.node.current,G=H?new r2(h(H),H):null;z.rect.current=G,G&&P.set(z.id,G)}return P}return O},[n,o,t,x,h]);return B.useEffect(()=>{m.current=n},[n]),B.useEffect(()=>{x||_()},[t,x]),B.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),B.useEffect(()=>{x||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{_(),S.current=null},a))},[a,x,_,...r]),{droppableRects:R,measureDroppableContainers:_,measuringScheduled:o!=null};function k(){switch(g){case M1.Always:return!1;case M1.BeforeDragging:return t;default:return!t}}}function z_(n,e){return Jp(t=>n?t||(typeof e=="function"?e(n):n):null,[e,n])}function OH(n,e){return z_(n,e)}function PH(n){let{callback:e,disabled:t}=n;const r=e2(e),i=B.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,t]);return B.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Hv(n){let{callback:e,disabled:t}=n;const r=e2(e),i=B.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[t]);return B.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function DH(n){return new r2(B1(n),n)}function zw(n,e,t){e===void 0&&(e=DH);const[r,i]=B.useState(null);function o(){i(h=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=h??t)!=null?g:null}const m=e(n);return JSON.stringify(h)===JSON.stringify(m)?h:m})}const l=PH({callback(h){if(n)for(const g of h){const{type:m,target:x}=g;if(m==="childList"&&x instanceof HTMLElement&&x.contains(n)){o();break}}}}),a=Hv({callback:o});return ld(()=>{o(),n?(a==null||a.observe(n),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),l==null||l.disconnect())},[n]),r}function NH(n){const e=z_(n);return M_(n,e)}const Hw=[];function FH(n){const e=B.useRef(n),t=Jp(r=>n?r&&r!==Hw&&n&&e.current&&n.parentNode===e.current.parentNode?r:n2(n):Hw,[n]);return B.useEffect(()=>{e.current=n},[n]),t}function BH(n){const[e,t]=B.useState(null),r=B.useRef(n),i=B.useCallback(o=>{const l=Db(o.target);l&&t(a=>a?(a.set(l,hm(l)),new Map(a)):null)},[]);return B.useEffect(()=>{const o=r.current;if(n!==o){l(o);const a=n.map(h=>{const g=Db(h);return g?(g.addEventListener("scroll",i,{passive:!0}),[g,hm(g)]):null}).filter(h=>h!=null);t(a.length?new Map(a):null),r.current=n}return()=>{l(n),l(o)};function l(a){a.forEach(h=>{const g=Db(h);g==null||g.removeEventListener("scroll",i)})}},[i,n]),B.useMemo(()=>n.length?e?Array.from(e.values()).reduce((o,l)=>m1(o,l),Fh):F_(n):Fh,[n,e])}function Ww(n,e){e===void 0&&(e=[]);const t=B.useRef(null);return B.useEffect(()=>{t.current=null},e),B.useEffect(()=>{const r=n!==Fh;r&&!t.current&&(t.current=n),!r&&t.current&&(t.current=null)},[n]),t.current?yv(n,t.current):Fh}function zH(n){B.useEffect(()=>{if(!zv)return;const e=n.map(t=>{let{sensor:r}=t;return r.setup==null?void 0:r.setup()});return()=>{for(const t of e)t==null||t()}},n.map(e=>{let{sensor:t}=e;return t}))}function HH(n,e){return B.useMemo(()=>n.reduce((t,r)=>{let{eventName:i,handler:o}=r;return t[i]=l=>{o(l,e)},t},{}),[n,e])}function H_(n){return B.useMemo(()=>n?uH(n):null,[n])}const Uw=[];function WH(n,e){e===void 0&&(e=B1);const[t]=n,r=H_(t?uf(t):null),[i,o]=B.useState(Uw);function l(){o(()=>n.length?n.map(h=>D_(h)?r:new r2(e(h),h)):Uw)}const a=Hv({callback:l});return ld(()=>{a==null||a.disconnect(),l(),n.forEach(h=>a==null?void 0:a.observe(h))},[n]),i}function UH(n){if(!n)return null;if(n.children.length>1)return n;const e=n.children[0];return Kp(e)?e:n}function GH(n){let{measure:e}=n;const[t,r]=B.useState(null),i=B.useCallback(g=>{for(const{target:m}of g)if(Kp(m)){r(x=>{const w=e(m);return x?{...x,width:w.width,height:w.height}:w});break}},[e]),o=Hv({callback:i}),l=B.useCallback(g=>{const m=UH(g);o==null||o.disconnect(),m&&(o==null||o.observe(m)),r(m?e(m):null)},[e,o]),[a,h]=bv(l);return B.useMemo(()=>({nodeRef:a,rect:t,setRef:h}),[t,a,h])}const YH=[{sensor:l2,options:{}},{sensor:i2,options:{}}],VH={current:{}},j0={draggable:{measure:Pw},droppable:{measure:Pw,strategy:M1.WhileDragging,frequency:gm.Optimized},dragOverlay:{measure:B1}};class Cp extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,r;return(t=(r=this.get(e))==null?void 0:r.node.current)!=null?t:void 0}}const ZH={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cp,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mv},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:j0,measureDroppableContainers:mv,windowRect:null,measuringScheduled:!1},XH={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mv,draggableNodes:new Map,over:null,measureDroppableContainers:mv},Wv=B.createContext(XH),W_=B.createContext(ZH);function KH(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cp}}}function JH(n,e){switch(e.type){case Ba.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Ba.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:e.coordinates.x-n.draggable.initialCoordinates.x,y:e.coordinates.y-n.draggable.initialCoordinates.y}}};case Ba.DragEnd:case Ba.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ba.RegisterDroppable:{const{element:t}=e,{id:r}=t,i=new Cp(n.droppable.containers);return i.set(r,t),{...n,droppable:{...n.droppable,containers:i}}}case Ba.SetDroppableDisabled:{const{id:t,key:r,disabled:i}=e,o=n.droppable.containers.get(t);if(!o||r!==o.key)return n;const l=new Cp(n.droppable.containers);return l.set(t,{...o,disabled:i}),{...n,droppable:{...n.droppable,containers:l}}}case Ba.UnregisterDroppable:{const{id:t,key:r}=e,i=n.droppable.containers.get(t);if(!i||r!==i.key)return n;const o=new Cp(n.droppable.containers);return o.delete(t),{...n,droppable:{...n.droppable,containers:o}}}default:return n}}function QH(n){let{disabled:e}=n;const{active:t,activatorEvent:r,draggableNodes:i}=B.useContext(Wv),o=um(r),l=um(t==null?void 0:t.id);return B.useEffect(()=>{if(!e&&!r&&o&&l!=null){if(!t2(o)||document.activeElement===o.target)return;const a=i.get(l);if(!a)return;const{activatorNode:h,node:g}=a;if(!h.current&&!g.current)return;requestAnimationFrame(()=>{for(const m of[h.current,g.current]){if(!m)continue;const x=Hz(m);if(x){x.focus();break}}})}},[r,e,i,l,o]),null}function qH(n,e){let{transform:t,...r}=e;return n!=null&&n.length?n.reduce((i,o)=>o({transform:i,...r}),t):t}function jH(n){return B.useMemo(()=>({draggable:{...j0.draggable,...n==null?void 0:n.draggable},droppable:{...j0.droppable,...n==null?void 0:n.droppable},dragOverlay:{...j0.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function $H(n){let{activeNode:e,measure:t,initialRect:r,config:i=!0}=n;const o=B.useRef(!1),{x:l,y:a}=typeof i=="boolean"?{x:i,y:i}:i;ld(()=>{if(!l&&!a||!e){o.current=!1;return}if(o.current||!r)return;const g=e==null?void 0:e.node.current;if(!g||g.isConnected===!1)return;const m=t(g),x=M_(m,r);if(l||(x.x=0),a||(x.y=0),o.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const w=L_(g);w&&w.scrollBy({top:x.y,left:x.x})}},[e,l,a,r,t])}const U_=B.createContext({...Fh,scaleX:1,scaleY:1});var Jd;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Jd||(Jd={}));const eW=B.memo(function(e){var t,r,i,o;let{id:l,accessibility:a,autoScroll:h=!0,children:g,sensors:m=YH,collisionDetection:x=rH,measuring:w,modifiers:_,...S}=e;const R=B.useReducer(JH,void 0,KH),[k,O]=R,[P,z]=Zz(),[H,G]=B.useState(Jd.Uninitialized),N=H===Jd.Initialized,{draggable:{active:J,nodes:Y,translate:K},droppable:{containers:fe}}=k,X=J!=null?Y.get(J):null,te=B.useRef({initial:null,translated:null}),ne=B.useMemo(()=>{var yn;return J!=null?{id:J,data:(yn=X==null?void 0:X.data)!=null?yn:VH,rect:te}:null},[J,X]),ue=B.useRef(null),[se,$]=B.useState(null),[re,ge]=B.useState(null),me=zp(S,Object.values(S)),oe=Qp("DndDescribedBy",l),Q=B.useMemo(()=>fe.getEnabled(),[fe]),pe=jH(w),{droppableRects:Ie,measureDroppableContainers:Fe,measuringScheduled:xe}=LH(Q,{dragging:N,dependencies:[K.x,K.y],config:pe.droppable}),Oe=kH(Y,J),Le=B.useMemo(()=>re?fm(re):null,[re]),He=Yt(),Te=OH(Oe,pe.draggable.measure);$H({activeNode:J!=null?Y.get(J):null,config:He.layoutShiftCompensation,initialRect:Te,measure:pe.draggable.measure});const ke=zw(Oe,pe.draggable.measure,Te),Be=zw(Oe?Oe.parentElement:null),rt=B.useRef({activatorEvent:null,active:null,activeNode:Oe,collisionRect:null,collisions:null,droppableRects:Ie,draggableNodes:Y,draggingNode:null,draggingNodeRect:null,droppableContainers:fe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Re=fe.getNodeFor((t=rt.current.over)==null?void 0:t.id),ut=GH({measure:pe.dragOverlay.measure}),qe=(r=ut.nodeRef.current)!=null?r:Oe,ot=N?(i=ut.rect)!=null?i:ke:null,st=!!(ut.nodeRef.current&&ut.rect),bt=NH(st?null:ke),Mt=H_(qe?uf(qe):null),Bt=FH(N?Re??Oe:null),at=WH(Bt),Ye=qH(_,{transform:{x:K.x-bt.x,y:K.y-bt.y,scaleX:1,scaleY:1},activatorEvent:re,active:ne,activeNodeRect:ke,containerNodeRect:Be,draggingNodeRect:ot,over:rt.current.over,overlayNodeRect:ut.rect,scrollableAncestors:Bt,scrollableAncestorRects:at,windowRect:Mt}),Tt=Le?m1(Le,K):null,Ut=BH(Bt),gt=Ww(Ut),Ht=Ww(Ut,[ke]),xt=m1(Ye,gt),pn=ot?lH(ot,Ye):null,$t=ne&&pn?x({active:ne,collisionRect:pn,droppableRects:Ie,droppableContainers:Q,pointerCoordinates:Tt}):null,sn=eH($t,"id"),[Xt,bn]=B.useState(null),hn=st?Ye:m1(Ye,Ht),Rn=iH(hn,(o=Xt==null?void 0:Xt.rect)!=null?o:null,ke),vn=B.useRef(null),We=B.useCallback((yn,gn)=>{let{sensor:lt,options:kt}=gn;if(ue.current==null)return;const vt=Y.get(ue.current);if(!vt)return;const zt=yn.nativeEvent,Lt=new lt({active:ue.current,activeNode:vt,event:zt,options:kt,context:rt,onAbort(Rt){if(!Y.get(Rt))return;const{onDragAbort:En}=me.current,Jt={id:Rt};En==null||En(Jt),P({type:"onDragAbort",event:Jt})},onPending(Rt,on,En,Jt){if(!Y.get(Rt))return;const{onDragPending:_n}=me.current,zn={id:Rt,constraint:on,initialCoordinates:En,offset:Jt};_n==null||_n(zn),P({type:"onDragPending",event:zn})},onStart(Rt){const on=ue.current;if(on==null)return;const En=Y.get(on);if(!En)return;const{onDragStart:Jt}=me.current,xn={activatorEvent:zt,active:{id:on,data:En.data,rect:te}};su.unstable_batchedUpdates(()=>{Jt==null||Jt(xn),G(Jd.Initializing),O({type:Ba.DragStart,initialCoordinates:Rt,active:on}),P({type:"onDragStart",event:xn}),$(vn.current),ge(zt)})},onMove(Rt){O({type:Ba.DragMove,coordinates:Rt})},onEnd:yt(Ba.DragEnd),onCancel:yt(Ba.DragCancel)});vn.current=Lt;function yt(Rt){return async function(){const{active:En,collisions:Jt,over:xn,scrollAdjustedTranslate:_n}=rt.current;let zn=null;if(En&&_n){const{cancelDrop:er}=me.current;zn={activatorEvent:zt,active:En,collisions:Jt,delta:_n,over:xn},Rt===Ba.DragEnd&&typeof er=="function"&&await Promise.resolve(er(zn))&&(Rt=Ba.DragCancel)}ue.current=null,su.unstable_batchedUpdates(()=>{O({type:Rt}),G(Jd.Uninitialized),bn(null),$(null),ge(null),vn.current=null;const er=Rt===Ba.DragEnd?"onDragEnd":"onDragCancel";if(zn){const wn=me.current[er];wn==null||wn(zn),P({type:er,event:zn})}})}}},[Y]),Ce=B.useCallback((yn,gn)=>(lt,kt)=>{const vt=lt.nativeEvent,zt=Y.get(kt);if(ue.current!==null||!zt||vt.dndKit||vt.defaultPrevented)return;const Lt={active:zt};yn(lt,gn.options,Lt)===!0&&(vt.dndKit={capturedBy:gn.sensor},ue.current=kt,We(lt,gn))},[Y,We]),it=MH(m,Ce);zH(m),ld(()=>{ke&&H===Jd.Initializing&&G(Jd.Initialized)},[ke,H]),B.useEffect(()=>{const{onDragMove:yn}=me.current,{active:gn,activatorEvent:lt,collisions:kt,over:vt}=rt.current;if(!gn||!lt)return;const zt={active:gn,activatorEvent:lt,collisions:kt,delta:{x:xt.x,y:xt.y},over:vt};su.unstable_batchedUpdates(()=>{yn==null||yn(zt),P({type:"onDragMove",event:zt})})},[xt.x,xt.y]),B.useEffect(()=>{const{active:yn,activatorEvent:gn,collisions:lt,droppableContainers:kt,scrollAdjustedTranslate:vt}=rt.current;if(!yn||ue.current==null||!gn||!vt)return;const{onDragOver:zt}=me.current,Lt=kt.get(sn),yt=Lt&&Lt.rect.current?{id:Lt.id,rect:Lt.rect.current,data:Lt.data,disabled:Lt.disabled}:null,Rt={active:yn,activatorEvent:gn,collisions:lt,delta:{x:vt.x,y:vt.y},over:yt};su.unstable_batchedUpdates(()=>{bn(yt),zt==null||zt(Rt),P({type:"onDragOver",event:Rt})})},[sn]),ld(()=>{rt.current={activatorEvent:re,active:ne,activeNode:Oe,collisionRect:pn,collisions:$t,droppableRects:Ie,draggableNodes:Y,draggingNode:qe,draggingNodeRect:ot,droppableContainers:fe,over:Xt,scrollableAncestors:Bt,scrollAdjustedTranslate:xt},te.current={initial:ot,translated:pn}},[ne,Oe,$t,pn,Y,qe,ot,Ie,fe,Xt,Bt,xt]),AH({...He,delta:K,draggingRect:pn,pointerCoordinates:Tt,scrollableAncestors:Bt,scrollableAncestorRects:at});const Ct=B.useMemo(()=>({active:ne,activeNode:Oe,activeNodeRect:ke,activatorEvent:re,collisions:$t,containerNodeRect:Be,dragOverlay:ut,draggableNodes:Y,droppableContainers:fe,droppableRects:Ie,over:Xt,measureDroppableContainers:Fe,scrollableAncestors:Bt,scrollableAncestorRects:at,measuringConfiguration:pe,measuringScheduled:xe,windowRect:Mt}),[ne,Oe,ke,re,$t,Be,ut,Y,fe,Ie,Xt,Fe,Bt,at,pe,xe,Mt]),Qt=B.useMemo(()=>({activatorEvent:re,activators:it,active:ne,activeNodeRect:ke,ariaDescribedById:{draggable:oe},dispatch:O,draggableNodes:Y,over:Xt,measureDroppableContainers:Fe}),[re,it,ne,ke,O,oe,Y,Xt,Fe]);return B.createElement(k_.Provider,{value:z},B.createElement(Wv.Provider,{value:Qt},B.createElement(W_.Provider,{value:Ct},B.createElement(U_.Provider,{value:Rn},g)),B.createElement(QH,{disabled:(a==null?void 0:a.restoreFocus)===!1})),B.createElement(Jz,{...a,hiddenTextDescribedById:oe}));function Yt(){const yn=(se==null?void 0:se.autoScrollEnabled)===!1,gn=typeof h=="object"?h.enabled===!1:h===!1,lt=N&&!yn&&!gn;return typeof h=="object"?{...h,enabled:lt}:{enabled:lt}}}),tW=B.createContext(null),Gw="button",nW="Draggable";function rW(n){let{id:e,data:t,disabled:r=!1,attributes:i}=n;const o=Qp(nW),{activators:l,activatorEvent:a,active:h,activeNodeRect:g,ariaDescribedById:m,draggableNodes:x,over:w}=B.useContext(Wv),{role:_=Gw,roleDescription:S="draggable",tabIndex:R=0}=i??{},k=(h==null?void 0:h.id)===e,O=B.useContext(k?U_:tW),[P,z]=bv(),[H,G]=bv(),N=HH(l,e),J=zp(t);ld(()=>(x.set(e,{id:e,key:o,node:P,activatorNode:H,data:J}),()=>{const K=x.get(e);K&&K.key===o&&x.delete(e)}),[x,e]);const Y=B.useMemo(()=>({role:_,tabIndex:R,"aria-disabled":r,"aria-pressed":k&&_===Gw?!0:void 0,"aria-roledescription":S,"aria-describedby":m.draggable}),[r,_,R,k,S,m.draggable]);return{active:h,activatorEvent:a,activeNodeRect:g,attributes:Y,isDragging:k,listeners:r?void 0:N,node:P,over:w,setNodeRef:z,setActivatorNodeRef:G,transform:O}}function iW(){return B.useContext(W_)}const oW="Droppable",lW={timeout:25};function sW(n){let{data:e,disabled:t=!1,id:r,resizeObserverConfig:i}=n;const o=Qp(oW),{active:l,dispatch:a,over:h,measureDroppableContainers:g}=B.useContext(Wv),m=B.useRef({disabled:t}),x=B.useRef(!1),w=B.useRef(null),_=B.useRef(null),{disabled:S,updateMeasurementsFor:R,timeout:k}={...lW,...i},O=zp(R??r),P=B.useCallback(()=>{if(!x.current){x.current=!0;return}_.current!=null&&clearTimeout(_.current),_.current=setTimeout(()=>{g(Array.isArray(O.current)?O.current:[O.current]),_.current=null},k)},[k]),z=Hv({callback:P,disabled:S||!l}),H=B.useCallback((Y,K)=>{z&&(K&&(z.unobserve(K),x.current=!1),Y&&z.observe(Y))},[z]),[G,N]=bv(H),J=zp(e);return B.useEffect(()=>{!z||!G.current||(z.disconnect(),x.current=!1,z.observe(G.current))},[G,z]),B.useEffect(()=>(a({type:Ba.RegisterDroppable,element:{id:r,key:o,disabled:t,node:G,rect:w,data:J}}),()=>a({type:Ba.UnregisterDroppable,key:o,id:r})),[r]),B.useEffect(()=>{t!==m.current.disabled&&(a({type:Ba.SetDroppableDisabled,id:r,key:o,disabled:t}),m.current.disabled=t)},[r,o,t,a]),{active:l,rect:w,isOver:(h==null?void 0:h.id)===r,node:G,over:h,setNodeRef:N}}function G_(n,e,t){const r={...n};return e.top+n.y<=t.top?r.y=t.top-e.top:e.bottom+n.y>=t.top+t.height&&(r.y=t.top+t.height-e.bottom),e.left+n.x<=t.left?r.x=t.left-e.left:e.right+n.x>=t.left+t.width&&(r.x=t.left+t.width-e.right),r}const aW=n=>{let{containerNodeRect:e,draggingNodeRect:t,transform:r}=n;return!t||!e?r:G_(r,t,e)},cW=n=>{let{transform:e,draggingNodeRect:t,windowRect:r}=n;return!t||!r?e:G_(e,t,r)};function wv(n,e,t){const r=n.slice();return r.splice(t<0?r.length+t:t,0,r.splice(e,1)[0]),r}function uW(n,e){return n.reduce((t,r,i)=>{const o=e.get(r);return o&&(t[i]=o),t},Array(n.length))}function F0(n){return n!==null&&n>=0}function fW(n,e){if(n===e)return!0;if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function hW(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Y_=n=>{let{rects:e,activeIndex:t,overIndex:r,index:i}=n;const o=wv(e,r,t),l=e[i],a=o[i];return!a||!l?null:{x:a.left-l.left,y:a.top-l.top,scaleX:a.width/l.width,scaleY:a.height/l.height}},B0={scaleX:1,scaleY:1},dW=n=>{var e;let{activeIndex:t,activeNodeRect:r,index:i,rects:o,overIndex:l}=n;const a=(e=o[t])!=null?e:r;if(!a)return null;if(i===t){const g=o[l];return g?{x:0,y:t<l?g.top+g.height-(a.top+a.height):g.top-a.top,...B0}:null}const h=gW(o,i,t);return i>t&&i<=l?{x:0,y:-a.height-h,...B0}:i<t&&i>=l?{x:0,y:a.height+h,...B0}:{x:0,y:0,...B0}};function gW(n,e,t){const r=n[e],i=n[e-1],o=n[e+1];return r?t<e?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const V_="Sortable",Z_=B.createContext({activeIndex:-1,containerId:V_,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Y_,disabled:{draggable:!1,droppable:!1}});function pW(n){let{children:e,id:t,items:r,strategy:i=Y_,disabled:o=!1}=n;const{active:l,dragOverlay:a,droppableRects:h,over:g,measureDroppableContainers:m}=iW(),x=Qp(V_,t),w=a.rect!==null,_=B.useMemo(()=>r.map(N=>typeof N=="object"&&"id"in N?N.id:N),[r]),S=l!=null,R=l?_.indexOf(l.id):-1,k=g?_.indexOf(g.id):-1,O=B.useRef(_),P=!fW(_,O.current),z=k!==-1&&R===-1||P,H=hW(o);ld(()=>{P&&S&&m(_)},[P,_,S,m]),B.useEffect(()=>{O.current=_},[_]);const G=B.useMemo(()=>({activeIndex:R,containerId:x,disabled:H,disableTransforms:z,items:_,overIndex:k,useDragOverlay:w,sortedRects:uW(_,h),strategy:i}),[R,x,H.draggable,H.droppable,z,_,k,h,w,i]);return B.createElement(Z_.Provider,{value:G},e)}const vW=n=>{let{id:e,items:t,activeIndex:r,overIndex:i}=n;return wv(t,r,i).indexOf(e)},bW=n=>{let{containerId:e,isSorting:t,wasDragging:r,index:i,items:o,newIndex:l,previousItems:a,previousContainerId:h,transition:g}=n;return!g||!r||a!==o&&i===l?!1:t?!0:l!==i&&e===h},yW={duration:200,easing:"ease"},X_="transform",mW=Hp.Transition.toString({property:X_,duration:0,easing:"linear"}),xW={roleDescription:"sortable"};function wW(n){let{disabled:e,index:t,node:r,rect:i}=n;const[o,l]=B.useState(null),a=B.useRef(t);return ld(()=>{if(!e&&t!==a.current&&r.current){const h=i.current;if(h){const g=B1(r.current,{ignoreTransform:!0}),m={x:h.left-g.left,y:h.top-g.top,scaleX:h.width/g.width,scaleY:h.height/g.height};(m.x||m.y)&&l(m)}}t!==a.current&&(a.current=t)},[e,t,r,i]),B.useEffect(()=>{o&&l(null)},[o]),o}function CW(n){let{animateLayoutChanges:e=bW,attributes:t,disabled:r,data:i,getNewIndex:o=vW,id:l,strategy:a,resizeObserverConfig:h,transition:g=yW}=n;const{items:m,containerId:x,activeIndex:w,disabled:_,disableTransforms:S,sortedRects:R,overIndex:k,useDragOverlay:O,strategy:P}=B.useContext(Z_),z=_W(r,_),H=m.indexOf(l),G=B.useMemo(()=>({sortable:{containerId:x,index:H,items:m},...i}),[x,i,H,m]),N=B.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:J,node:Y,isOver:K,setNodeRef:fe}=sW({id:l,data:G,disabled:z.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...h}}),{active:X,activatorEvent:te,activeNodeRect:ne,attributes:ue,setNodeRef:se,listeners:$,isDragging:re,over:ge,setActivatorNodeRef:me,transform:oe}=rW({id:l,data:G,attributes:{...xW,...t},disabled:z.draggable}),Q=Nz(fe,se),pe=!!X,Ie=pe&&!S&&F0(w)&&F0(k),Fe=!O&&re,xe=Fe&&Ie?oe:null,Le=Ie?xe??(a??P)({rects:R,activeNodeRect:ne,activeIndex:w,overIndex:k,index:H}):null,He=F0(w)&&F0(k)?o({id:l,items:m,activeIndex:w,overIndex:k}):H,Te=X==null?void 0:X.id,ke=B.useRef({activeId:Te,items:m,newIndex:He,containerId:x}),Be=m!==ke.current.items,rt=e({active:X,containerId:x,isDragging:re,isSorting:pe,id:l,index:H,items:m,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:g,wasDragging:ke.current.activeId!=null}),Re=wW({disabled:!rt,index:H,node:Y,rect:J});return B.useEffect(()=>{pe&&ke.current.newIndex!==He&&(ke.current.newIndex=He),x!==ke.current.containerId&&(ke.current.containerId=x),m!==ke.current.items&&(ke.current.items=m)},[pe,He,x,m]),B.useEffect(()=>{if(Te===ke.current.activeId)return;if(Te!=null&&ke.current.activeId==null){ke.current.activeId=Te;return}const qe=setTimeout(()=>{ke.current.activeId=Te},50);return()=>clearTimeout(qe)},[Te]),{active:X,activeIndex:w,attributes:ue,data:G,rect:J,index:H,newIndex:He,items:m,isOver:K,isSorting:pe,isDragging:re,listeners:$,node:Y,overIndex:k,over:ge,setNodeRef:Q,setActivatorNodeRef:me,setDroppableNodeRef:fe,setDraggableNodeRef:se,transform:Re??Le,transition:ut()};function ut(){if(Re||Be&&ke.current.newIndex===H)return mW;if(!(Fe&&!t2(te)||!g)&&(pe||rt))return Hp.Transition.toString({...g,property:X_})}}function _W(n,e){var t,r;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(t=n==null?void 0:n.draggable)!=null?t:e.draggable,droppable:(r=n==null?void 0:n.droppable)!=null?r:e.droppable}}_o.Down,_o.Right,_o.Up,_o.Left;function Cv(n,e){Array.isArray(n)||(n=[n]);for(const t of n){if(e(t))return t;if(!t.children||t.children.length<1)continue;const r=Cv(t.children,e);if(r)return r}}function qp(n,e){Array.isArray(n)||(n=[n]);for(const t of n)e(t),!(!t.children||t.children.length<1)&&qp(t.children,e)}function K_(n,e){Array.isArray(n)||(n=[n]);const t=[];return qp(n,(r,i)=>t.push(e(r,i))),t}function J_(n,e){Array.isArray(n)||(n=[n]);for(const t of n){if(!e(t))return!1;if(!(!t.children||t.children.length<1)&&!J_(t.children,e))return!1}return!0}function SW(n,e){Array.isArray(n)||(n=[n]);const t=[];return qp(n,(r,i)=>{e(r,i)&&t.push(r)}),t}function EW(n){Array.isArray(n)||(n=[n]);let e=0;return qp(n,()=>e++),e}function TW(n,e,t,r){if(r(e,t))return null;Array.isArray(n)||(n=[n]);const i=Cv(n,l=>{var a;return(a=l.children)==null?void 0:a.some(h=>r(h,e))}),o=Cv(n,l=>{var a;return(a=l.children)==null?void 0:a.some(h=>r(h,t))});if(i===void 0&&o===void 0){const l=n.findIndex(h=>r(h,e)),a=n.findIndex(h=>r(h,t));return n.splice(l,1),n.splice(a,0,e),[...n]}else if(i!==void 0&&o!==void 0&&r(i,o)&&i.children){const l=i.children.findIndex(h=>r(h,e)),a=i.children.findIndex(h=>r(h,t));return l===void 0||a===void 0?null:(i.children.splice(l,1),i.children.splice(a,0,e),i.children=[...i.children],[...n])}return null}function AW(n,e,t){const r=[],i=[...e];for(;i.length>0;){const o=i.shift();if(o&&!r.find(l=>t(l,o))&&(r.push(o),!(!o.children||o.children.length<1)))for(const l of o.children)i.push(l)}return r}function RW(n,e,t){Array.isArray(n)||(n=[n]);const r=K_(n,l=>l),i=[],o=[...e];for(;o.length>0;){const l=o.shift();if(!l||i.find(h=>t(h,l)))continue;i.push(l);const a=r.find(h=>{var g;return(g=h.children)==null?void 0:g.some(m=>t(m,l))});a&&o.push(a)}return i}const Qd={find:Cv,forEach:qp,map:K_,every:J_,filter:SW,length:EW,replace:TW,descendants:AW,ancestors:RW},IW="_AWrap_1mpkv_1",kW="_AContainer_1mpkv_10",MW="_ATree_1mpkv_18",LW="_ATreeBody_1mpkv_30",OW="_TreeTopAddon_1mpkv_36",PW="_CoverBorder_1mpkv_46",DW="_InsertBorder_1mpkv_55",NW="_ATreeHeader_1mpkv_86",FW="_ATreeBodyHeader_1mpkv_92",BW="_ATreeBodyHeaderResources_1mpkv_102",zW="_ATreeItem_1mpkv_108",HW="_IsSelectUsed_1mpkv_124",WW="_IsSelected_1mpkv_127",UW="_IsSearchSelected_1mpkv_132",GW="_IsHovered_1mpkv_143",YW="_CheckBox_1mpkv_147",VW="_Indents_1mpkv_159",ZW="_ExpandIcon_1mpkv_166",XW="_Content_1mpkv_178",KW="_RightSticky_1mpkv_187",JW="_SearchInputWrap_1mpkv_196",QW="_SearchInput_1mpkv_196",qW="_RightAddon_1mpkv_208",jW="_RightAddonIcon_1mpkv_219",$W="_Loader_1mpkv_226",eU="_IsChildOfDragSource_1mpkv_231",No={AWrap:IW,AContainer:kW,ATree:MW,ATreeBody:LW,TreeTopAddon:OW,CoverBorder:PW,InsertBorder:DW,ATreeHeader:NW,ATreeBodyHeader:FW,ATreeBodyHeaderResources:BW,ATreeItem:zW,IsSelectUsed:HW,IsSelected:WW,IsSearchSelected:UW,IsHovered:GW,CheckBox:YW,Indents:VW,ExpandIcon:ZW,Content:XW,RightSticky:KW,SearchInputWrap:JW,SearchInput:QW,RightAddon:qW,RightAddonIcon:jW,Loader:$W,IsChildOfDragSource:eU},tU=n=>{const{isEqual:e,item:t,itemId:r,selectDisabled:i,selectUnused:o,isParentDisabled:l,indents:a,extIndents:h,useExpand:g,useSelect:m,useSearch:x,showCheckbox:w,icons:_,iconWidth:S,isSelectMulti:R,isDraggable:k,isParentCheckHovered:O,hoverdItem:P,onMouseOver:z,onMouseLeave:H,ContentRenderer:G,TreeItemRenderer:N,RightStickyAddon:J,resources:Y,containerRef:K,TreeItemStyle:fe,TreeItemClassName:X,searchItemStyle:te,searchItemClassName:ne,height:ue,isDragSrcItem:se,isChildOfDragItem:$,getItemId:re,treeItemTooltip:ge,treeItemTooltipDelay:me,treeItemTooltipDirection:oe,treeItemTooltipDistance:Q}=n,{children:pe}=B.useMemo(()=>t,[t]),[Ie,Fe]=B.useMemo(()=>g,[g]),[xe,Oe]=B.useMemo(()=>m,[m]),[Le,He]=B.useMemo(()=>x,[x]),Te=B.useMemo(()=>o?o(t):!1,[o,t]),ke=B.useMemo(()=>!i||l?l:i(t),[i,l,t]),Be=B.useMemo(()=>Ie.some(yt=>e(yt,t)),[Ie,e,t]),rt=B.useMemo(()=>!pe||pe.length<1?"noChild":Be?"expanded":"collapsed",[pe,Be]),Re=B.useMemo(()=>Ur.getContent(_,n),[_,n]),ut=B.useMemo(()=>{const yt=Re==null?void 0:Re[rt];return ym.includes(yt)?M.jsx(fo,{icon:yt,style:{width:S,height:S}}):yt},[Re,S,rt]),qe=B.useCallback(yt=>{!Fe||rt==="noChild"||(Fe(Be?Ie.filter(Rt=>!e(Rt,t)):[...Ie,t]),yt.stopPropagation())},[Fe,Ie,Be,t,e,rt]),ot=B.useMemo(()=>xe.some(yt=>e(yt,t)),[xe,e,t]),st=B.useCallback(()=>{!Oe||ke||(Oe(R?ot?xe.filter(yt=>!e(yt,t)):[...xe,t]:[t]),Le&&He&&Le.items.some(yt=>e(yt,t))&&He({...Le,item:t}))},[R,ke,ot,Le,He,Oe,e,xe,t]),bt=B.useMemo(()=>Le==null?void 0:Le.items.some(yt=>e(yt,t)),[Le,e,t]),Mt=B.useMemo(()=>bt&&(Le==null?void 0:Le.item)&&e(Le.item,t),[bt,Le,e,t]),Bt=B.useRef(null),at=B.useRef(null),{attributes:Ye,listeners:Tt,setNodeRef:Ut,transform:gt,transition:Ht,isDragging:xt}=CW({id:r||`item-${JSON.stringify(t)}`,disabled:!k||!!l||!r}),pn=B.useMemo(()=>$?$(t):!1,[$,t]),$t=B.useMemo(()=>{const yt=gt?{transform:Hp.Transform.toString(gt),transition:Ht,opacity:xt?.5:1,zIndex:xt?1:"auto"}:{};return se||pn?{...yt,opacity:.5,zIndex:10}:yt},[gt,Ht,xt,se,pn]);B.useEffect(()=>{r&&Ut&&at.current&&Ut(at.current)},[r,Ut]),B.useEffect(()=>{setTimeout(()=>{if(Mt&&Bt.current&&K.current){const{top:yt,bottom:Rt}=Bt.current.getBoundingClientRect(),{top:on,bottom:En}=K.current.getBoundingClientRect();(yt<on||Rt>En)&&Bt.current.scrollIntoView({behavior:"smooth",block:"center"})}},10)},[K,Mt]);const[sn,Xt]=B.useState(!1),bn=B.useCallback(()=>!ke&&Xt(!0),[ke]),hn=B.useCallback(()=>!ke&&Xt(!1),[ke]),Rn=B.useMemo(()=>Qd.map(t,yt=>yt).filter(yt=>!(i!=null&&i(yt))&&!(o!=null&&o(yt))),[i,o,t]),vn=B.useMemo(()=>!w||!R?!1:ot&&Rn.some(yt=>xe.some(Rt=>e(yt,Rt)))&&Rn.some(yt=>!xe.some(Rt=>e(yt,Rt))),[w,R,ot,Rn,e,xe]),We=B.useMemo(()=>w?R?Rn.every(yt=>xe.some(Rt=>e(yt,Rt))):xe.some(yt=>e(yt,t)):!1,[w,R,Rn,t,e,xe]),Ce=B.useCallback(()=>{if(!(!Oe||ke))if(R)if(ot){const yt=xe.filter(Rt=>!(o!=null&&o(Rt))&&!(i!=null&&i(Rt))&&Rn.some(on=>e(on,Rt)));yt.length>0&&Oe(xe.filter(Rt=>!yt.some(on=>e(Rt,on))))}else{const yt=Rn.filter(Rt=>!(o!=null&&o(Rt))&&!(i!=null&&i(Rt))&&!xe.some(on=>e(on,Rt)));yt.length>0&&Oe([...xe,...yt])}else Oe([t])},[ke,i,o,R,Oe,e,ot,xe,Rn,t]),it=B.useCallback(yt=>{ke||Ce(),yt.stopPropagation()},[ke,Ce]),Ct=B.useMemo(()=>{if(!w||!R||ke)return"";if(ot){const Rt=xe.filter(on=>!(o!=null&&o(on))&&!(i!=null&&i(on))&&Rn.some(En=>e(En,on)));if(Rt.length>0)return Y["deselect n"](Rt.length)}const yt=Rn.filter(Rt=>!(o!=null&&o(Rt))&&!(i!=null&&i(Rt))&&!xe.some(on=>e(on,Rt)));return Y["select n"](yt.length)},[i,o,Y,ke,w,R,ot,Rn,e,xe]),Qt=B.useMemo(()=>Ur.getContent(J,n),[J,n]),Yt=B.useMemo(()=>Ur.getContent(fe,n),[n,fe]),yn=B.useMemo(()=>Ur.getContent(X,n),[n,X]),gn=B.useMemo(()=>Ur.getContent(ne,n),[n,ne]),lt=B.useMemo(()=>Ur.getContent(te,n),[n,te]),kt=B.useMemo(()=>Ur.getContent(ge,n),[n,ge]),vt=B.useMemo(()=>Ur.getContent(me,n),[n,me]),zt=B.useMemo(()=>Ur.getContent(oe,n),[n,oe]),Lt=B.useMemo(()=>Ur.getContent(Q,n),[n,Q]);return M.jsxs(B.Fragment,{children:[M.jsxs(zi,{abaseRef:at,isDisabled:ke,className:dt.clsx(No.ATreeItem,ot&&No.IsSelected,!ke&&(sn||O)&&No.IsHovered,bt&&No.IsSearched,Mt&&(gn||No.IsSearchSelected),!Te&&No.IsSelectUsed,pn&&No.IsChildOfDragSource,"NoSelect",yn),style:{...Yt,...Mt&&lt?lt:{},"--ATreeItem_height":`${ue}px`,...$t||{}},onClick:st,onMouseLeave:yt=>H==null?void 0:H(yt,t),onMouseOver:yt=>z==null?void 0:z(yt,t),...k&&!ke&&Ye?Ye:{},...k&&!ke&&Tt?Tt:{},tooltip:kt,tooltipDelay:vt,tooltipDirection:zt,tooltipDistance:Lt,children:[w&&M.jsx(w1,{className:No.CheckBox,isDisabled:ke,isIndeterminate:vn,tooltip:Ct,useCheck:[+We,Ce],style:{visibility:ke||Te?"hidden":"visible",zIndex:ke||Te?0:2},onClick:it,onMouseOut:hn,onMouseOver:bn}),M.jsx("div",{className:No.Indents,style:{paddingLeft:w?0:Re!=null&&Re.noChild?12:0},children:a.map((yt,Rt)=>{const on=Rt===a.length-1;return M.jsx(P3,{value:yt,map:{Collapsed:h?h({iconWidth:S}).collapsed:M.jsx(rU,{iconWidth:S}),Expanded:h?h({iconWidth:S,isLast:on}).expanded:M.jsx(nU,{iconWidth:S,isLast:on}),IsLast:h?h({iconWidth:S}).isLast:M.jsx(iU,{iconWidth:S})}},Rt)})}),ut&&M.jsx("div",{className:No.ExpandIcon,style:{width:S,minWidth:S,maxWidth:S},onClick:qe,children:ut}),M.jsx("div",{className:dt.clsx(No.Content,"NoSelect"),children:M.jsx(G,{containerRef:K,ContentRenderer:G,extIndents:h,height:ue,hoverdItem:P,icons:_,iconWidth:S,indents:a,isDraggable:k,isEqual:e,isParentCheckHovered:R&&(sn||O),isSelectMulti:R,item:t,itemId:r,resources:Y,RightStickyAddon:J,searchItemClassName:gn,searchItemStyle:te,showCheckbox:w,TreeItemClassName:X,TreeItemRenderer:N,TreeItemStyle:fe,treeItemTooltip:ge,treeItemTooltipDelay:me,treeItemTooltipDirection:oe,treeItemTooltipDistance:Q,useExpand:g,useSearch:x,useSelect:m,onMouseLeave:H,onMouseOver:z})}),Qt&&M.jsx("div",{className:No.RightSticky,children:Qt})]}),Be&&(pe==null?void 0:pe.map((yt,Rt)=>M.jsx(N,{containerRef:K,ContentRenderer:G,extIndents:h,height:ue,hoverdItem:P,icons:_,iconWidth:S,isChildOfDragItem:$,isDraggable:k,isDragSrcItem:se,isEqual:e,isParentCheckHovered:R&&(sn||O),isSelectMulti:R,item:yt,itemId:re?`${re(t)}-child-${Rt}`:r?`${r}-child-${Rt}`:void 0,resources:Y,RightStickyAddon:J,searchItemClassName:gn,searchItemStyle:te,selectDisabled:i,selectUnused:o,showCheckbox:w,TreeItemClassName:X,TreeItemRenderer:N,TreeItemStyle:fe,treeItemTooltip:ge,treeItemTooltipDelay:me,treeItemTooltipDirection:oe,treeItemTooltipDistance:Q,useExpand:g,useSearch:x,useSelect:m,indents:[...a.map(on=>on==="IsLast"?"Collapsed":on),Rt===pe.length-1?"IsLast":"Expanded"],onMouseLeave:H,onMouseOver:z},re?re(yt):Rt)))]})},nU=n=>{const e=Gn.c(9),{iconWidth:t,isLast:r}=n,i=t/8*3,o=t/2,l=t/8;let a;e[0]!==i||e[1]!==o||e[2]!==l?(a={width:i,height:"100%",borderLeft:"var(--ATree_Indent_border)",marginLeft:o,marginRight:l,boxSizing:"border-box",transition:"border-color var(--Transition)"},e[0]=i,e[1]=o,e[2]=l,e[3]=a):a=e[3];let h;e[4]!==r?(h=r&&M.jsx("div",{style:{borderBottom:"var(--ATree_Indent_border)",height:"50%",transition:"border-color var(--Transition)"}}),e[4]=r,e[5]=h):h=e[5];let g;return e[6]!==a||e[7]!==h?(g=M.jsx("div",{style:a,children:h}),e[6]=a,e[7]=h,e[8]=g):g=e[8],g},rU=n=>{const e=Gn.c(2),{iconWidth:t}=n;let r;return e[0]!==t?(r=M.jsx("div",{style:{width:t,height:"100%",borderLeft:"none",marginLeft:0,transition:"border-color var(--Transition)"}}),e[0]=t,e[1]=r):r=e[1],r},iU=n=>{const e=Gn.c(4),{iconWidth:t}=n,r=t/8*3,i=t/2,o=t/8;let l;return e[0]!==r||e[1]!==i||e[2]!==o?(l=M.jsx("div",{style:{width:r,height:"50%",borderLeft:"var(--ATree_Indent_border)",borderBottom:"var(--ATree_Indent_border)",marginLeft:i,marginRight:o,boxSizing:"border-box",transition:"border-color var(--Transition)"}}),e[0]=r,e[1]=i,e[2]=o,e[3]=l):l=e[3],l},oU=n=>{const e=Gn.c(26),{isEqual:t,searchResult:r,initSearch:i,searchUp:o,searchDown:l,searchEnter:a,isDisabled:h,isLoading:g,resources:m,maxLength:x,autoFocus:w}=n;let _;e[0]!==l||e[1]!==a||e[2]!==o?(_=K=>{K.key==="Enter"?a():K.key==="ArrowDown"?l():K.key==="ArrowUp"&&o(),K.preventDefault(),K.stopPropagation()},e[0]=l,e[1]=a,e[2]=o,e[3]=_):_=e[3];const S=_;let R;e[4]!==i?(R=K=>{i(K)},e[4]=i,e[5]=R):R=e[5];const k=R;let O;h||g?O=-1:O=void 0;const P=O,z=m["Search(Placeholder)"],H=(r==null?void 0:r.keyword)??"";let G;e[6]!==k||e[7]!==H?(G=[H,k],e[6]=k,e[7]=H,e[8]=G):G=e[8];let N;e[9]!==t||e[10]!==m||e[11]!==l||e[12]!==a||e[13]!==r||e[14]!==o?(N=M.jsx(lU,{isEqual:t,resources:m,searchDown:l,searchEnter:a,searchResult:r,searchUp:o}),e[9]=t,e[10]=m,e[11]=l,e[12]=a,e[13]=r,e[14]=o,e[15]=N):N=e[15];let J;e[16]===Symbol.for("react.memo_cache_sentinel")?(J={className:No.SearchInputWrap},e[16]=J):J=e[16];let Y;return e[17]!==w||e[18]!==h||e[19]!==x||e[20]!==S||e[21]!==z||e[22]!==G||e[23]!==N||e[24]!==P?(Y=M.jsx(sg,{autoFocus:w,className:No.SearchInput,isDisabled:h,maxLength:x,placeholder:z,tabIndex:P,useValue:G,RightAddon:N,wrapProps:J,onKeyDown:S}),e[17]=w,e[18]=h,e[19]=x,e[20]=S,e[21]=z,e[22]=G,e[23]=N,e[24]=P,e[25]=Y):Y=e[25],Y},lU=n=>{const e=Gn.c(22),{isEqual:t,searchResult:r,searchUp:i,searchDown:o,searchEnter:l,resources:a}=n;let h;if(!r||r.items.length<1)h=0;else{let Y;e[0]!==t||e[1]!==r.item?(Y=K=>r.item&&t(K,r.item),e[0]=t,e[1]=r.item,e[2]=Y):Y=e[2],h=r.items.findIndex(Y)+1}const g=h;let m;!r||r.items.length<1?m=0:m=r.items.length;const x=m;let w;g<2?w=!0:w=!1;const _=w;let S;g>=x?S=!0:S=!1;const R=S;let k;e[3]!==_||e[4]!==i?(k=Y=>{Y.stopPropagation(),!_&&i()},e[3]=_,e[4]=i,e[5]=k):k=e[5];const O=k;let P;e[6]!==R||e[7]!==o?(P=Y=>{Y.stopPropagation(),!R&&o()},e[6]=R,e[7]=o,e[8]=P):P=e[8];const z=P;let H;e[9]!==l?(H=Y=>{Y.stopPropagation(),l()},e[9]=l,e[10]=H):H=e[10];const G=H;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=dt.clsx(No.RightAddon,"NoSelect"),e[11]=N):N=e[11];let J;return e[12]!==R||e[13]!==_||e[14]!==x||e[15]!==z||e[16]!==G||e[17]!==O||e[18]!==g||e[19]!==a||e[20]!==r?(J=M.jsx("div",{className:N,children:r?M.jsxs(M.Fragment,{children:[g,"/",x,M.jsx(zi,{isDisabled:_,onClick:O,children:M.jsx(fo,{className:No.RightAddonIcon,icon:"ArrowUp",mask:""})}),M.jsx(zi,{isDisabled:R,onClick:z,children:M.jsx(fo,{className:No.RightAddonIcon,icon:"ArrowDown"})})]}):M.jsx(ba,{className:No.RightAddonIcon,icon:"Search",style:{marginRight:4},tooltip:a["Search(Button)"],type:"Raw",onClick:G})}),e[12]=R,e[13]=_,e[14]=x,e[15]=z,e[16]=G,e[17]=O,e[18]=g,e[19]=a,e[20]=r,e[21]=J):J=e[21],J},sU=n=>{var ri;const{pk:e,selectDisabled:t,selectUnused:r,useItems:i,useExpand:o,useSelect:l,useSearch:a,showCheckbox:h,iconWidth:g=24,icons:m={noChild:"Folder",collapsed:"FolderCopy",expanded:"FolderOpen"},indents:x,isSelectMulti:w=!1,noSearch:_=!1,isDraggable:S,noSyncSearchSelect:R=!1,actionRef:k,placeholder:O,searchPredicate:P=cU,isDisabled:z,isLoading:H,ContentRenderer:G=aU,TreeItemRenderer:N=tU,RightStickyAddon:J,TopRightAddon:Y,TreeTopAddon:K,resources:fe,maxLength:X,autoFocus:te,TreeHeaderStyle:ne,TreeHeaderClassName:ue,TreeItemStyle:se,TreeItemClassName:$,OverflowPadding:re,insertBorder:ge,width:me,searchItemClassName:oe,searchItemStyle:Q,height:pe=40,treeItemTooltip:Ie,treeItemTooltipDelay:Fe,treeItemTooltipDirection:xe,treeItemTooltipDistance:Oe,...Le}=n,He=B.useMemo(()=>({...Or.ATree,...fe}),[fe]),Te=B.useCallback(($e,tn)=>!$e||!tn?!1:e!==void 0?Array.isArray(e)?e.every(ln=>$e&&tn&&$e[ln]!==void 0&&tn[ln]!==void 0&&Jh.isEqual($e[ln],tn[ln])):$e&&tn&&$e[e]!==void 0&&tn[e]!==void 0&&Jh.isEqual($e[e],tn[e]):Jh.isEqual($e,tn),[e]),ke=B.useRef(null),[Be,rt]=Fo(i,[]),Re=B.useMemo(()=>Qd.map(Be,$e=>$e),[Be]),[ut,qe]=Fo(o,[]),[ot,st]=Fo(l,[]),[bt,Mt]=Fo(a,void 0),Bt=B.useCallback($e=>{if(z||!qe||ut.some(Nn=>Te(Nn,$e)))return;const tn=[];let ln=$e;for(;ln;){const Nn=ln;ut.find(yr=>Te(yr,Nn))||tn.push(Nn),ln=Re.find(yr=>{var Ln;return(Ln=yr.children)==null?void 0:Ln.some(Pt=>Te(Pt,Nn))})}qe([...ut,...tn])},[ut,z,Te,qe,Re]),at=B.useCallback(()=>{!qe||z||qe([...Re])},[Re,z,qe]),Ye=B.useCallback(()=>{!qe||z||qe([])},[qe,z]),Tt=B.useCallback($e=>{!st||z||r!=null&&r($e)||(st([$e]),Bt($e))},[st,z,r,Bt]),Ut=B.useCallback($e=>{if(!Mt||z)return;if(!$e||_){Mt(void 0),R||st==null||st([]);return}const tn=Qd.filter(Be,Nn=>P($e,Nn));let ln;if(tn.find(Nn=>(bt==null?void 0:bt.item)&&Te(Nn,bt.item))?ln=bt==null?void 0:bt.item:tn.length>0&&(ln=tn[0]),Mt({keyword:$e,items:tn,item:ln}),ln&&Bt(ln),st&&!R)if(w)st(tn);else{const Nn=tn.find(yr=>ln&&Te(yr,ln));st(Nn?[Nn]:[])}},[Be,z,Te,P,Mt,st,Bt,R,_,w,bt]),gt=B.useRef(!1);B.useEffect(()=>{gt.current=!0},[Be]),B.useEffect(()=>{bt&&gt.current&&(Ut(bt.keyword),gt.current=!1)},[Ut,bt]);const Ht=B.useCallback(()=>{if(!bt||!Mt||z)return;let $e=bt.items.findIndex(tn=>bt.item&&Te(tn,bt.item))-1;$e<0||(Mt({...bt,item:bt.items[$e]}),Bt(bt.items[$e]),R||Tt(bt.items[$e]))},[bt,Bt,Mt,z,Tt,Te,R]),xt=B.useCallback(()=>{if(!bt||!Mt||z)return;let $e=bt.items.findIndex(tn=>bt.item&&Te(tn,bt.item))+1;$e>=bt.items.length||(Mt({...bt,item:bt.items[$e]}),Bt(bt.items[$e]),R||Tt(bt.items[$e]))},[bt,Bt,z,Mt,Tt,Te,R]),pn=B.useCallback(()=>{if(!bt||!Mt||z)return;let $e=bt.items.findIndex(ln=>bt.item&&Te(ln,bt.item));if(!R||r!=null&&r(bt.items[$e])){xt();return}if(ot.some(ln=>bt.item&&Te(ln,bt.item))){let ln=$e+1;const Nn=bt.items[ln];if(ln>=bt.items.length)return;Mt({...bt,item:Nn}),Tt(Nn)}else Tt(bt.items[$e])},[bt,Mt,z,ot,R,xt,Te,Tt,r]),[$t,sn]=B.useState(!1),Xt=B.useCallback(()=>sn(!0),[]),bn=B.useCallback(()=>sn(!1),[]),hn=B.useMemo(()=>r?Qd.map(Be,$e=>$e).filter($e=>!r($e)):t?Qd.map(Be,$e=>$e).filter($e=>!t($e)):Qd.map(Be,$e=>$e),[r,t,Be]),Rn=B.useMemo(()=>!h||!w?!1:ot.length>0&&hn.length>ot.length,[h,w,ot,hn]),vn=B.useMemo(()=>!h||!w?!1:ot.length>0&&hn.length===ot.length,[h,w,ot,hn]),We=B.useCallback(()=>{if(!st||!w||z)return;const $e=ot.filter(tn=>!(r!=null&&r(tn))&&!(t!=null&&t(tn))&&hn.some(ln=>Te(ln,tn)));if($e.length>0)st(ot.filter(tn=>!$e.some(ln=>Te(tn,ln))));else{const tn=hn.filter(ln=>!(r!=null&&r(ln))&&!(t!=null&&t(ln))&&!ot.some(Nn=>Te(Nn,ln)));tn.length>0&&st([...ot,...tn])}},[w,z,r,t,st,ot,hn,Te]),Ce=B.useMemo(()=>{if(!h||!w||z)return"";const $e=ot.filter(tn=>!(r!=null&&r(tn))&&!(t!=null&&t(tn))&&hn.some(ln=>Te(ln,tn)));if($e.length>0)return He["deselect n"]($e.length);{const tn=hn.filter(ln=>!(r!=null&&r(ln))&&!(t!=null&&t(ln))&&!ot.some(Nn=>Te(Nn,ln)));return He["select n"](tn.length)}},[r,t,z,He,h,w,hn,ot,Te]),[it,Ct]=B.useState(),Qt=Qz(Lw(l2,{activationConstraint:{distance:8}}),Lw(i2)),Yt=B.useRef(new Map),yn=B.useCallback($e=>{if(!Yt.current.has($e)){const tn=`item_${Jh.uniqueId()}`;Yt.current.set($e,tn)}return Yt.current.get($e)},[]),gn=B.useCallback($e=>Re.find(tn=>yn(tn)===$e),[Re,yn]),lt=B.useCallback($e=>!it||!it.children?!1:it.children.some(ln=>Te(ln,$e))?!0:it.children.some(ln=>ln.children?Qd.find(ln,Nn=>Te(Nn,$e))!==void 0:!1),[it,Te]),kt=B.useCallback($e=>{if(!S||z)return;const tn=gn($e.active.id);tn&&Ct(tn)},[S,z,gn]),vt=B.useCallback(($e,tn,ln,Nn)=>{const yr=$e.findIndex(Pt=>Nn(Pt,tn)),Ln=$e.findIndex(Pt=>Nn(Pt,ln));return yr!==-1&&Ln!==-1?wv($e,yr,Ln):$e.map(Pt=>{if(!Pt.children)return Pt;const Se=Pt.children.findIndex(At=>Nn(At,tn)),tt=Pt.children.findIndex(At=>Nn(At,ln));return Se!==-1&&tt!==-1?{...Pt,children:wv(Pt.children,Se,tt)}:Pt.children?{...Pt,children:vt(Pt.children,tn,ln,Nn)}:Pt})},[]),zt=B.useCallback($e=>{!S||z||!it||!$e.over||gn($e.over.id)},[S,z,it,gn]),Lt=B.useCallback($e=>{if(!S||z||!rt||!it||!$e.over)return;const tn=gn($e.over.id);if(!tn||Te(it,tn)){Ct(void 0);return}const ln=vt(Be,it,tn,Te);rt(ln),Ct(void 0)},[S,z,rt,it,gn,Te,Be,vt]),yt=B.useMemo(()=>Be.map($e=>yn($e)),[Be,yn]);B.useEffect(()=>{var $e;h||($e=ke.current)==null||$e.scrollTo(0,0)},[h,ke]),B.useEffect(()=>{!w&&ot.length>1&&(st==null||st([ot[ot.length-1]]))},[w,st,ot]),B.useEffect(()=>{k&&(k.current={expandAll:at,collapseAll:Ye})},[k,at,Ye]),B.useEffect(()=>{if(!t||!st)return;const $e=ot.filter(tn=>!t(tn));ot.length!==$e.length&&st($e)},[t,ot,st]),B.useEffect(()=>{if(!r||!st)return;const $e=ot.filter(tn=>!r(tn));ot.length!==$e.length&&st($e)},[r,ot,st]),B.useEffect(()=>{Mt&&Mt(void 0)},[Mt]);const[Rt,on]=B.useState(null),En=B.useCallback(($e,tn)=>{z||($e.stopPropagation(),$e.preventDefault(),on(tn))},[z]),Jt=B.useCallback(($e,tn)=>{Rt===null||z||Te(tn,Rt)&&($e.stopPropagation(),$e.preventDefault(),on(null))},[Rt,z,Te]),xn=B.useRef(null),[_n,zn]=B.useState(!1),[er,wn]=B.useState((ri=xn.current)==null?void 0:ri.scrollHeight);return B.useEffect(()=>{if(ut.length<0)return;const $e=ke.current,tn=xn.current,ln=$e.clientHeight<tn.clientHeight;wn(ln?tn.scrollHeight:$e.clientHeight),zn(ln)},[ut]),M.jsxs(zi,{...Le,className:dt.clsx(Le.className,No.AWrap),isDisabled:z,children:[(!_||Y)&&M.jsxs(Ml,{className:dt.clsx(No.ATreeHeader,ue),style:ne,children:[!_&&M.jsx(oU,{autoFocus:te,initSearch:Ut,isDisabled:z,isEqual:Te,isLoading:H,maxLength:X,resources:He,searchDown:xt,searchEnter:pn,searchResult:bt,searchUp:Ht}),!_&&Y&&M.jsx(cs,{w:8}),Y]}),(!_||Y||h&&w||S)&&M.jsx(Am,{isLoading:H&&Be.length!==0}),(h&&w||S)&&M.jsxs("div",{className:dt.clsx(No.ATreeBodyHeader,"NoSelect"),children:[h&&M.jsx(w1,{className:No.CheckBox,isDisabled:z,isIndeterminate:Rn,tooltip:Ce,useCheck:[+vn,()=>We()],onMouseOut:bn,onMouseOver:Xt}),He.Items,M.jsx(zg,{}),M.jsxs("div",{className:dt.clsx(No.ATreeBodyHeaderResources,"NoSelect"),style:{marginRight:_n?8:0},children:[M.jsx("span",{children:h&&He["*Click row for single select"]}),M.jsx("span",{children:S&&He["*Change order to row drag"]})]})]}),K&&M.jsx("div",{className:No.TreeTopAddon,children:K}),M.jsx("div",{ref:ke,className:dt.clsx(Le.className,No.AContainer),children:M.jsxs("div",{className:No.ATree,style:{minWidth:me||"fit-content",marginRight:re&&_n?8:0},children:[M.jsxs("div",{ref:xn,className:No.ATreeBody,children:[Be.length===0?H?M.jsx(uU,{text:He["Loading Contents..."]}):O:null,M.jsx(eW,{collisionDetection:tH,modifiers:[aW,cW],sensors:Qt,measuring:{droppable:{strategy:M1.Always}},onDragEnd:Lt,onDragOver:zt,onDragStart:kt,children:M.jsx(pW,{items:yt,strategy:dW,children:Be.map($e=>M.jsx(N,{containerRef:ke,ContentRenderer:G,extIndents:x,getItemId:yn,height:pe,hoverdItem:Rt,icons:m,iconWidth:g,indents:[],isChildOfDragItem:lt,isDraggable:S,isDragSrcItem:Te($e,it),isEqual:Te,isParentCheckHovered:w&&$t,isParentDisabled:z,isSelectMulti:w,item:$e,itemId:yn($e),resources:He,RightStickyAddon:J,searchItemClassName:oe,searchItemStyle:Q,selectDisabled:t,selectUnused:r,showCheckbox:h,TreeItemClassName:$,TreeItemRenderer:N,TreeItemStyle:se,treeItemTooltip:Ie,treeItemTooltipDelay:Fe,treeItemTooltipDirection:xe,treeItemTooltipDistance:Oe,useExpand:[ut,qe],useSearch:[bt,Mt],useSelect:[ot,st],onMouseLeave:Jt,onMouseOver:En},yn($e)))})})]}),ge&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:No.CoverBorder}),M.jsx("div",{className:No.InsertBorder,style:{"--InsertBorder_height":`${pe}px`,height:_n?er:"100%"}})]})]})})]})},aU=n=>{const{item:e}=n,t={};return $n.keys(e).forEach(r=>{r!=="children"&&(t[r]=e[r])}),JSON.stringify(t)};function cU(n,e){return $n.some(e,(t,r)=>{var i;return(i=$n.stringify(r))==null?void 0:i.toLowerCase().includes(n.toLowerCase())})}const uU=n=>{const e=Gn.c(4),{text:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=dt.clsx(No.Loader,"NoSelect"),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=M.jsx(fo,{height:40,icon:"Spinner",style:{height:40},width:40}),e[1]=i):i=e[1];let o;return e[2]!==t?(o=M.jsxs(Ml,{className:r,children:[i,M.jsx(V3,{text:t})]}),e[2]=t,e[3]=o):o=e[3],o};var Bb,Yw;function z1(){return Yw||(Yw=1,Bb=TypeError),Bb}const fU={},hU=Object.freeze(Object.defineProperty({__proto__:null,default:fU},Symbol.toStringTag,{value:"Module"})),dU=TE(hU);var zb,Vw;function Uv(){if(Vw)return zb;Vw=1;var n=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=n&&e&&typeof e.get=="function"?e.get:null,r=n&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=i&&o&&typeof o.get=="function"?o.get:null,a=i&&Set.prototype.forEach,h=typeof WeakMap=="function"&&WeakMap.prototype,g=h?WeakMap.prototype.has:null,m=typeof WeakSet=="function"&&WeakSet.prototype,x=m?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,_=w?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,R=Object.prototype.toString,k=Function.prototype.toString,O=String.prototype.match,P=String.prototype.slice,z=String.prototype.replace,H=String.prototype.toUpperCase,G=String.prototype.toLowerCase,N=RegExp.prototype.test,J=Array.prototype.concat,Y=Array.prototype.join,K=Array.prototype.slice,fe=Math.floor,X=typeof BigInt=="function"?BigInt.prototype.valueOf:null,te=Object.getOwnPropertySymbols,ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",se=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ue||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,re=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(We){return We.__proto__}:null);function ge(We,Ce){if(We===1/0||We===-1/0||We!==We||We&&We>-1e3&&We<1e3||N.call(/e/,Ce))return Ce;var it=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof We=="number"){var Ct=We<0?-fe(-We):fe(We);if(Ct!==We){var Qt=String(Ct),Yt=P.call(Ce,Qt.length+1);return z.call(Qt,it,"$&_")+"."+z.call(z.call(Yt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return z.call(Ce,it,"$&_")}var me=dU,oe=me.custom,Q=ut(oe)?oe:null,pe={__proto__:null,double:'"',single:"'"},Ie={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};zb=function We(Ce,it,Ct,Qt){var Yt=it||{};if(st(Yt,"quoteStyle")&&!st(pe,Yt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(st(Yt,"maxStringLength")&&(typeof Yt.maxStringLength=="number"?Yt.maxStringLength<0&&Yt.maxStringLength!==1/0:Yt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var yn=st(Yt,"customInspect")?Yt.customInspect:!0;if(typeof yn!="boolean"&&yn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(st(Yt,"indent")&&Yt.indent!==null&&Yt.indent!==" "&&!(parseInt(Yt.indent,10)===Yt.indent&&Yt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(st(Yt,"numericSeparator")&&typeof Yt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var gn=Yt.numericSeparator;if(typeof Ce>"u")return"undefined";if(Ce===null)return"null";if(typeof Ce=="boolean")return Ce?"true":"false";if(typeof Ce=="string")return xt(Ce,Yt);if(typeof Ce=="number"){if(Ce===0)return 1/0/Ce>0?"0":"-0";var lt=String(Ce);return gn?ge(Ce,lt):lt}if(typeof Ce=="bigint"){var kt=String(Ce)+"n";return gn?ge(Ce,kt):kt}var vt=typeof Yt.depth>"u"?5:Yt.depth;if(typeof Ct>"u"&&(Ct=0),Ct>=vt&&vt>0&&typeof Ce=="object")return Le(Ce)?"[Array]":"[Object]";var zt=hn(Yt,Ct);if(typeof Qt>"u")Qt=[];else if(Bt(Qt,Ce)>=0)return"[Circular]";function Lt(Ln,Pt,Se){if(Pt&&(Qt=K.call(Qt),Qt.push(Pt)),Se){var tt={depth:Yt.depth};return st(Yt,"quoteStyle")&&(tt.quoteStyle=Yt.quoteStyle),We(Ln,tt,Ct+1,Qt)}return We(Ln,Yt,Ct+1,Qt)}if(typeof Ce=="function"&&!Te(Ce)){var yt=Mt(Ce),Rt=vn(Ce,Lt);return"[Function"+(yt?": "+yt:" (anonymous)")+"]"+(Rt.length>0?" { "+Y.call(Rt,", ")+" }":"")}if(ut(Ce)){var on=ue?z.call(String(Ce),/^(Symbol\(.*\))_[^)]*$/,"$1"):ne.call(Ce);return typeof Ce=="object"&&!ue?$t(on):on}if(Ht(Ce)){for(var En="<"+G.call(String(Ce.nodeName)),Jt=Ce.attributes||[],xn=0;xn<Jt.length;xn++)En+=" "+Jt[xn].name+"="+Fe(xe(Jt[xn].value),"double",Yt);return En+=">",Ce.childNodes&&Ce.childNodes.length&&(En+="..."),En+="</"+G.call(String(Ce.nodeName))+">",En}if(Le(Ce)){if(Ce.length===0)return"[]";var _n=vn(Ce,Lt);return zt&&!bn(_n)?"["+Rn(_n,zt)+"]":"[ "+Y.call(_n,", ")+" ]"}if(ke(Ce)){var zn=vn(Ce,Lt);return!("cause"in Error.prototype)&&"cause"in Ce&&!$.call(Ce,"cause")?"{ ["+String(Ce)+"] "+Y.call(J.call("[cause]: "+Lt(Ce.cause),zn),", ")+" }":zn.length===0?"["+String(Ce)+"]":"{ ["+String(Ce)+"] "+Y.call(zn,", ")+" }"}if(typeof Ce=="object"&&yn){if(Q&&typeof Ce[Q]=="function"&&me)return me(Ce,{depth:vt-Ct});if(yn!=="symbol"&&typeof Ce.inspect=="function")return Ce.inspect()}if(at(Ce)){var er=[];return r&&r.call(Ce,function(Ln,Pt){er.push(Lt(Pt,Ce,!0)+" => "+Lt(Ln,Ce))}),Xt("Map",t.call(Ce),er,zt)}if(Ut(Ce)){var wn=[];return a&&a.call(Ce,function(Ln){wn.push(Lt(Ln,Ce))}),Xt("Set",l.call(Ce),wn,zt)}if(Ye(Ce))return sn("WeakMap");if(gt(Ce))return sn("WeakSet");if(Tt(Ce))return sn("WeakRef");if(rt(Ce))return $t(Lt(Number(Ce)));if(qe(Ce))return $t(Lt(X.call(Ce)));if(Re(Ce))return $t(S.call(Ce));if(Be(Ce))return $t(Lt(String(Ce)));if(typeof window<"u"&&Ce===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Ce===globalThis||typeof jh<"u"&&Ce===jh)return"{ [object globalThis] }";if(!He(Ce)&&!Te(Ce)){var ri=vn(Ce,Lt),$e=re?re(Ce)===Object.prototype:Ce instanceof Object||Ce.constructor===Object,tn=Ce instanceof Object?"":"null prototype",ln=!$e&&se&&Object(Ce)===Ce&&se in Ce?P.call(bt(Ce),8,-1):tn?"Object":"",Nn=$e||typeof Ce.constructor!="function"?"":Ce.constructor.name?Ce.constructor.name+" ":"",yr=Nn+(ln||tn?"["+Y.call(J.call([],ln||[],tn||[]),": ")+"] ":"");return ri.length===0?yr+"{}":zt?yr+"{"+Rn(ri,zt)+"}":yr+"{ "+Y.call(ri,", ")+" }"}return String(Ce)};function Fe(We,Ce,it){var Ct=it.quoteStyle||Ce,Qt=pe[Ct];return Qt+We+Qt}function xe(We){return z.call(String(We),/"/g,"&quot;")}function Oe(We){return!se||!(typeof We=="object"&&(se in We||typeof We[se]<"u"))}function Le(We){return bt(We)==="[object Array]"&&Oe(We)}function He(We){return bt(We)==="[object Date]"&&Oe(We)}function Te(We){return bt(We)==="[object RegExp]"&&Oe(We)}function ke(We){return bt(We)==="[object Error]"&&Oe(We)}function Be(We){return bt(We)==="[object String]"&&Oe(We)}function rt(We){return bt(We)==="[object Number]"&&Oe(We)}function Re(We){return bt(We)==="[object Boolean]"&&Oe(We)}function ut(We){if(ue)return We&&typeof We=="object"&&We instanceof Symbol;if(typeof We=="symbol")return!0;if(!We||typeof We!="object"||!ne)return!1;try{return ne.call(We),!0}catch{}return!1}function qe(We){if(!We||typeof We!="object"||!X)return!1;try{return X.call(We),!0}catch{}return!1}var ot=Object.prototype.hasOwnProperty||function(We){return We in this};function st(We,Ce){return ot.call(We,Ce)}function bt(We){return R.call(We)}function Mt(We){if(We.name)return We.name;var Ce=O.call(k.call(We),/^function\s*([\w$]+)/);return Ce?Ce[1]:null}function Bt(We,Ce){if(We.indexOf)return We.indexOf(Ce);for(var it=0,Ct=We.length;it<Ct;it++)if(We[it]===Ce)return it;return-1}function at(We){if(!t||!We||typeof We!="object")return!1;try{t.call(We);try{l.call(We)}catch{return!0}return We instanceof Map}catch{}return!1}function Ye(We){if(!g||!We||typeof We!="object")return!1;try{g.call(We,g);try{x.call(We,x)}catch{return!0}return We instanceof WeakMap}catch{}return!1}function Tt(We){if(!_||!We||typeof We!="object")return!1;try{return _.call(We),!0}catch{}return!1}function Ut(We){if(!l||!We||typeof We!="object")return!1;try{l.call(We);try{t.call(We)}catch{return!0}return We instanceof Set}catch{}return!1}function gt(We){if(!x||!We||typeof We!="object")return!1;try{x.call(We,x);try{g.call(We,g)}catch{return!0}return We instanceof WeakSet}catch{}return!1}function Ht(We){return!We||typeof We!="object"?!1:typeof HTMLElement<"u"&&We instanceof HTMLElement?!0:typeof We.nodeName=="string"&&typeof We.getAttribute=="function"}function xt(We,Ce){if(We.length>Ce.maxStringLength){var it=We.length-Ce.maxStringLength,Ct="... "+it+" more character"+(it>1?"s":"");return xt(P.call(We,0,Ce.maxStringLength),Ce)+Ct}var Qt=Ie[Ce.quoteStyle||"single"];Qt.lastIndex=0;var Yt=z.call(z.call(We,Qt,"\\$1"),/[\x00-\x1f]/g,pn);return Fe(Yt,"single",Ce)}function pn(We){var Ce=We.charCodeAt(0),it={8:"b",9:"t",10:"n",12:"f",13:"r"}[Ce];return it?"\\"+it:"\\x"+(Ce<16?"0":"")+H.call(Ce.toString(16))}function $t(We){return"Object("+We+")"}function sn(We){return We+" { ? }"}function Xt(We,Ce,it,Ct){var Qt=Ct?Rn(it,Ct):Y.call(it,", ");return We+" ("+Ce+") {"+Qt+"}"}function bn(We){for(var Ce=0;Ce<We.length;Ce++)if(Bt(We[Ce],`
485
485
  `)>=0)return!1;return!0}function hn(We,Ce){var it;if(We.indent===" ")it=" ";else if(typeof We.indent=="number"&&We.indent>0)it=Y.call(Array(We.indent+1)," ");else return null;return{base:it,prev:Y.call(Array(Ce+1),it)}}function Rn(We,Ce){if(We.length===0)return"";var it=`
486
486
  `+Ce.prev+Ce.base;return it+Y.call(We,","+it)+`
487
- `+Ce.prev}function vn(We,Ce){var it=Le(We),Ct=[];if(it){Ct.length=We.length;for(var Qt=0;Qt<We.length;Qt++)Ct[Qt]=st(We,Qt)?Ce(We[Qt],We):""}var Yt=typeof te=="function"?te(We):[],yn;if(ue){yn={};for(var gn=0;gn<Yt.length;gn++)yn["$"+Yt[gn]]=Yt[gn]}for(var lt in We)st(We,lt)&&(it&&String(Number(lt))===lt&&lt<We.length||ue&&yn["$"+lt]instanceof Symbol||(N.call(/[^\w$]/,lt)?Ct.push(Ce(lt,We)+": "+Ce(We[lt],We)):Ct.push(lt+": "+Ce(We[lt],We))));if(typeof te=="function")for(var kt=0;kt<Yt.length;kt++)$.call(We,Yt[kt])&&Ct.push("["+Ce(Yt[kt])+"]: "+Ce(We[Yt[kt]],We));return Ct}return zb}var Hb,Zw;function dU(){if(Zw)return Hb;Zw=1;var n=Uv(),e=z1(),t=function(a,h,g){for(var m=a,x;(x=m.next)!=null;m=x)if(x.key===h)return m.next=x.next,g||(x.next=a.next,a.next=x),x},r=function(a,h){if(a){var g=t(a,h);return g&&g.value}},i=function(a,h,g){var m=t(a,h);m?m.value=g:a.next={key:h,next:a.next,value:g}},o=function(a,h){return a?!!t(a,h):!1},l=function(a,h){if(a)return t(a,h,!0)};return Hb=function(){var h,g={assert:function(m){if(!g.has(m))throw new e("Side channel does not contain "+n(m))},delete:function(m){var x=h&&h.next,w=l(h,m);return w&&x&&x===w&&(h=void 0),!!w},get:function(m){return r(h,m)},has:function(m){return o(h,m)},set:function(m,x){h||(h={next:void 0}),i(h,m,x)}};return g},Hb}var Wb,Xw;function Q_(){return Xw||(Xw=1,Wb=Object),Wb}var Ub,Kw;function gU(){return Kw||(Kw=1,Ub=Error),Ub}var Gb,Jw;function pU(){return Jw||(Jw=1,Gb=EvalError),Gb}var Yb,Qw;function vU(){return Qw||(Qw=1,Yb=RangeError),Yb}var Vb,qw;function bU(){return qw||(qw=1,Vb=ReferenceError),Vb}var Zb,jw;function yU(){return jw||(jw=1,Zb=SyntaxError),Zb}var Xb,$w;function mU(){return $w||($w=1,Xb=URIError),Xb}var Kb,eC;function xU(){return eC||(eC=1,Kb=Math.abs),Kb}var Jb,tC;function wU(){return tC||(tC=1,Jb=Math.floor),Jb}var Qb,nC;function CU(){return nC||(nC=1,Qb=Math.max),Qb}var qb,rC;function _U(){return rC||(rC=1,qb=Math.min),qb}var jb,iC;function SU(){return iC||(iC=1,jb=Math.pow),jb}var $b,oC;function EU(){return oC||(oC=1,$b=Math.round),$b}var ey,lC;function TU(){return lC||(lC=1,ey=Number.isNaN||function(e){return e!==e}),ey}var ty,sC;function AU(){if(sC)return ty;sC=1;var n=TU();return ty=function(t){return n(t)||t===0?t:t<0?-1:1},ty}var ny,aC;function RU(){return aC||(aC=1,ny=Object.getOwnPropertyDescriptor),ny}var ry,cC;function q_(){if(cC)return ry;cC=1;var n=RU();if(n)try{n([],"length")}catch{n=null}return ry=n,ry}var iy,uC;function IU(){if(uC)return iy;uC=1;var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch{n=!1}return iy=n,iy}var oy,fC;function kU(){return fC||(fC=1,oy=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var l=Object.getOwnPropertySymbols(e);if(l.length!==1||l[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),oy}var ly,hC;function MU(){if(hC)return ly;hC=1;var n=typeof Symbol<"u"&&Symbol,e=kU();return ly=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ly}var sy,dC;function j_(){return dC||(dC=1,sy=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),sy}var ay,gC;function $_(){if(gC)return ay;gC=1;var n=Q_();return ay=n.getPrototypeOf||null,ay}var cy,pC;function LU(){if(pC)return cy;pC=1;var n="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,r="[object Function]",i=function(h,g){for(var m=[],x=0;x<h.length;x+=1)m[x]=h[x];for(var w=0;w<g.length;w+=1)m[w+h.length]=g[w];return m},o=function(h,g){for(var m=[],x=g,w=0;x<h.length;x+=1,w+=1)m[w]=h[x];return m},l=function(a,h){for(var g="",m=0;m<a.length;m+=1)g+=a[m],m+1<a.length&&(g+=h);return g};return cy=function(h){var g=this;if(typeof g!="function"||e.apply(g)!==r)throw new TypeError(n+g);for(var m=o(arguments,1),x,w=function(){if(this instanceof x){var O=g.apply(this,i(m,arguments));return Object(O)===O?O:this}return g.apply(h,i(m,arguments))},_=t(0,g.length-m.length),S=[],R=0;R<_;R++)S[R]="$"+R;if(x=Function("binder","return function ("+l(S,",")+"){ return binder.apply(this,arguments); }")(w),g.prototype){var k=function(){};k.prototype=g.prototype,x.prototype=new k,k.prototype=null}return x},cy}var uy,vC;function Gv(){if(vC)return uy;vC=1;var n=LU();return uy=Function.prototype.bind||n,uy}var fy,bC;function s2(){return bC||(bC=1,fy=Function.prototype.call),fy}var hy,yC;function e5(){return yC||(yC=1,hy=Function.prototype.apply),hy}var dy,mC;function OU(){return mC||(mC=1,dy=typeof Reflect<"u"&&Reflect&&Reflect.apply),dy}var gy,xC;function PU(){if(xC)return gy;xC=1;var n=Gv(),e=e5(),t=s2(),r=OU();return gy=r||n.call(t,e),gy}var py,wC;function t5(){if(wC)return py;wC=1;var n=Gv(),e=z1(),t=s2(),r=PU();return py=function(o){if(o.length<1||typeof o[0]!="function")throw new e("a function is required");return r(n,t,o)},py}var vy,CC;function DU(){if(CC)return vy;CC=1;var n=t5(),e=q_(),t;try{t=[].__proto__===Array.prototype}catch(l){if(!l||typeof l!="object"||!("code"in l)||l.code!=="ERR_PROTO_ACCESS")throw l}var r=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return vy=r&&typeof r.get=="function"?n([r.get]):typeof o=="function"?function(a){return o(a==null?a:i(a))}:!1,vy}var by,_C;function NU(){if(_C)return by;_C=1;var n=j_(),e=$_(),t=DU();return by=n?function(i){return n(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,by}var yy,SC;function FU(){if(SC)return yy;SC=1;var n=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Gv();return yy=t.call(n,e),yy}var my,EC;function a2(){if(EC)return my;EC=1;var n,e=Q_(),t=gU(),r=pU(),i=vU(),o=bU(),l=yU(),a=z1(),h=mU(),g=xU(),m=wU(),x=CU(),w=_U(),_=SU(),S=EU(),R=AU(),k=Function,O=function(Te){try{return k('"use strict"; return ('+Te+").constructor;")()}catch{}},P=q_(),z=IU(),H=function(){throw new a},G=P?(function(){try{return arguments.callee,H}catch{try{return P(arguments,"callee").get}catch{return H}}})():H,N=MU()(),J=NU(),Y=$_(),K=j_(),fe=e5(),X=s2(),te={},ne=typeof Uint8Array>"u"||!J?n:J(Uint8Array),ue={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":N&&J?J([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":te,"%AsyncGenerator%":te,"%AsyncGeneratorFunction%":te,"%AsyncIteratorPrototype%":te,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?n:Float16Array,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":k,"%GeneratorFunction%":te,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":N&&J?J(J([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!N||!J?n:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!N||!J?n:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":N&&J?J(""[Symbol.iterator]()):n,"%Symbol%":N?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":G,"%TypedArray%":ne,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":X,"%Function.prototype.apply%":fe,"%Object.defineProperty%":z,"%Object.getPrototypeOf%":Y,"%Math.abs%":g,"%Math.floor%":m,"%Math.max%":x,"%Math.min%":w,"%Math.pow%":_,"%Math.round%":S,"%Math.sign%":R,"%Reflect.getPrototypeOf%":K};if(J)try{null.error}catch(Te){var se=J(J(Te));ue["%Error.prototype%"]=se}var $=function Te(ke){var Be;if(ke==="%AsyncFunction%")Be=O("async function () {}");else if(ke==="%GeneratorFunction%")Be=O("function* () {}");else if(ke==="%AsyncGeneratorFunction%")Be=O("async function* () {}");else if(ke==="%AsyncGenerator%"){var rt=Te("%AsyncGeneratorFunction%");rt&&(Be=rt.prototype)}else if(ke==="%AsyncIteratorPrototype%"){var Re=Te("%AsyncGenerator%");Re&&J&&(Be=J(Re.prototype))}return ue[ke]=Be,Be},re={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ge=Gv(),me=FU(),oe=ge.call(X,Array.prototype.concat),Q=ge.call(fe,Array.prototype.splice),pe=ge.call(X,String.prototype.replace),Ie=ge.call(X,String.prototype.slice),Fe=ge.call(X,RegExp.prototype.exec),xe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Oe=/\\(\\)?/g,Le=function(ke){var Be=Ie(ke,0,1),rt=Ie(ke,-1);if(Be==="%"&&rt!=="%")throw new l("invalid intrinsic syntax, expected closing `%`");if(rt==="%"&&Be!=="%")throw new l("invalid intrinsic syntax, expected opening `%`");var Re=[];return pe(ke,xe,function(ut,qe,ot,st){Re[Re.length]=ot?pe(st,Oe,"$1"):qe||ut}),Re},He=function(ke,Be){var rt=ke,Re;if(me(re,rt)&&(Re=re[rt],rt="%"+Re[0]+"%"),me(ue,rt)){var ut=ue[rt];if(ut===te&&(ut=$(rt)),typeof ut>"u"&&!Be)throw new a("intrinsic "+ke+" exists, but is not available. Please file an issue!");return{alias:Re,name:rt,value:ut}}throw new l("intrinsic "+ke+" does not exist!")};return my=function(ke,Be){if(typeof ke!="string"||ke.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Be!="boolean")throw new a('"allowMissing" argument must be a boolean');if(Fe(/^%?[^%]*%?$/,ke)===null)throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var rt=Le(ke),Re=rt.length>0?rt[0]:"",ut=He("%"+Re+"%",Be),qe=ut.name,ot=ut.value,st=!1,bt=ut.alias;bt&&(Re=bt[0],Q(rt,oe([0,1],bt)));for(var Mt=1,Bt=!0;Mt<rt.length;Mt+=1){var at=rt[Mt],Ye=Ie(at,0,1),Tt=Ie(at,-1);if((Ye==='"'||Ye==="'"||Ye==="`"||Tt==='"'||Tt==="'"||Tt==="`")&&Ye!==Tt)throw new l("property names with quotes must have matching quotes");if((at==="constructor"||!Bt)&&(st=!0),Re+="."+at,qe="%"+Re+"%",me(ue,qe))ot=ue[qe];else if(ot!=null){if(!(at in ot)){if(!Be)throw new a("base intrinsic for "+ke+" exists, but the property is not available.");return}if(P&&Mt+1>=rt.length){var Ut=P(ot,at);Bt=!!Ut,Bt&&"get"in Ut&&!("originalValue"in Ut.get)?ot=Ut.get:ot=ot[at]}else Bt=me(ot,at),ot=ot[at];Bt&&!st&&(ue[qe]=ot)}}return ot},my}var xy,TC;function n5(){if(TC)return xy;TC=1;var n=a2(),e=t5(),t=e([n("%String.prototype.indexOf%")]);return xy=function(i,o){var l=n(i,!!o);return typeof l=="function"&&t(i,".prototype.")>-1?e([l]):l},xy}var wy,AC;function r5(){if(AC)return wy;AC=1;var n=a2(),e=n5(),t=Uv(),r=z1(),i=n("%Map%",!0),o=e("Map.prototype.get",!0),l=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),h=e("Map.prototype.delete",!0),g=e("Map.prototype.size",!0);return wy=!!i&&function(){var x,w={assert:function(_){if(!w.has(_))throw new r("Side channel does not contain "+t(_))},delete:function(_){if(x){var S=h(x,_);return g(x)===0&&(x=void 0),S}return!1},get:function(_){if(x)return o(x,_)},has:function(_){return x?a(x,_):!1},set:function(_,S){x||(x=new i),l(x,_,S)}};return w},wy}var Cy,RC;function BU(){if(RC)return Cy;RC=1;var n=a2(),e=n5(),t=Uv(),r=r5(),i=z1(),o=n("%WeakMap%",!0),l=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),h=e("WeakMap.prototype.has",!0),g=e("WeakMap.prototype.delete",!0);return Cy=o?function(){var x,w,_={assert:function(S){if(!_.has(S))throw new i("Side channel does not contain "+t(S))},delete:function(S){if(o&&S&&(typeof S=="object"||typeof S=="function")){if(x)return g(x,S)}else if(r&&w)return w.delete(S);return!1},get:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&x?l(x,S):w&&w.get(S)},has:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&x?h(x,S):!!w&&w.has(S)},set:function(S,R){o&&S&&(typeof S=="object"||typeof S=="function")?(x||(x=new o),a(x,S,R)):r&&(w||(w=r()),w.set(S,R))}};return _}:r,Cy}var _y,IC;function zU(){if(IC)return _y;IC=1;var n=z1(),e=Uv(),t=dU(),r=r5(),i=BU(),o=i||r||t;return _y=function(){var a,h={assert:function(g){if(!h.has(g))throw new n("Side channel does not contain "+e(g))},delete:function(g){return!!a&&a.delete(g)},get:function(g){return a&&a.get(g)},has:function(g){return!!a&&a.has(g)},set:function(g,m){a||(a=o()),a.set(g,m)}};return h},_y}var Sy,kC;function c2(){if(kC)return Sy;kC=1;var n=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Sy={default:t.RFC3986,formatters:{RFC1738:function(r){return n.call(r,e,"+")},RFC3986:function(r){return String(r)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Sy}var Ey,MC;function i5(){if(MC)return Ey;MC=1;var n=c2(),e=Object.prototype.hasOwnProperty,t=Array.isArray,r=(function(){for(var k=[],O=0;O<256;++O)k.push("%"+((O<16?"0":"")+O.toString(16)).toUpperCase());return k})(),i=function(O){for(;O.length>1;){var P=O.pop(),z=P.obj[P.prop];if(t(z)){for(var H=[],G=0;G<z.length;++G)typeof z[G]<"u"&&H.push(z[G]);P.obj[P.prop]=H}}},o=function(O,P){for(var z=P&&P.plainObjects?{__proto__:null}:{},H=0;H<O.length;++H)typeof O[H]<"u"&&(z[H]=O[H]);return z},l=function k(O,P,z){if(!P)return O;if(typeof P!="object"&&typeof P!="function"){if(t(O))O.push(P);else if(O&&typeof O=="object")(z&&(z.plainObjects||z.allowPrototypes)||!e.call(Object.prototype,P))&&(O[P]=!0);else return[O,P];return O}if(!O||typeof O!="object")return[O].concat(P);var H=O;return t(O)&&!t(P)&&(H=o(O,z)),t(O)&&t(P)?(P.forEach(function(G,N){if(e.call(O,N)){var J=O[N];J&&typeof J=="object"&&G&&typeof G=="object"?O[N]=k(J,G,z):O.push(G)}else O[N]=G}),O):Object.keys(P).reduce(function(G,N){var J=P[N];return e.call(G,N)?G[N]=k(G[N],J,z):G[N]=J,G},H)},a=function(O,P){return Object.keys(P).reduce(function(z,H){return z[H]=P[H],z},O)},h=function(k,O,P){var z=k.replace(/\+/g," ");if(P==="iso-8859-1")return z.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(z)}catch{return z}},g=1024,m=function(O,P,z,H,G){if(O.length===0)return O;var N=O;if(typeof O=="symbol"?N=Symbol.prototype.toString.call(O):typeof O!="string"&&(N=String(O)),z==="iso-8859-1")return escape(N).replace(/%u[0-9a-f]{4}/gi,function(ne){return"%26%23"+parseInt(ne.slice(2),16)+"%3B"});for(var J="",Y=0;Y<N.length;Y+=g){for(var K=N.length>=g?N.slice(Y,Y+g):N,fe=[],X=0;X<K.length;++X){var te=K.charCodeAt(X);if(te===45||te===46||te===95||te===126||te>=48&&te<=57||te>=65&&te<=90||te>=97&&te<=122||G===n.RFC1738&&(te===40||te===41)){fe[fe.length]=K.charAt(X);continue}if(te<128){fe[fe.length]=r[te];continue}if(te<2048){fe[fe.length]=r[192|te>>6]+r[128|te&63];continue}if(te<55296||te>=57344){fe[fe.length]=r[224|te>>12]+r[128|te>>6&63]+r[128|te&63];continue}X+=1,te=65536+((te&1023)<<10|K.charCodeAt(X)&1023),fe[fe.length]=r[240|te>>18]+r[128|te>>12&63]+r[128|te>>6&63]+r[128|te&63]}J+=fe.join("")}return J},x=function(O){for(var P=[{obj:{o:O},prop:"o"}],z=[],H=0;H<P.length;++H)for(var G=P[H],N=G.obj[G.prop],J=Object.keys(N),Y=0;Y<J.length;++Y){var K=J[Y],fe=N[K];typeof fe=="object"&&fe!==null&&z.indexOf(fe)===-1&&(P.push({obj:N,prop:K}),z.push(fe))}return i(P),O},w=function(O){return Object.prototype.toString.call(O)==="[object RegExp]"},_=function(O){return!O||typeof O!="object"?!1:!!(O.constructor&&O.constructor.isBuffer&&O.constructor.isBuffer(O))},S=function(O,P){return[].concat(O,P)},R=function(O,P){if(t(O)){for(var z=[],H=0;H<O.length;H+=1)z.push(P(O[H]));return z}return P(O)};return Ey={arrayToObject:o,assign:a,combine:S,compact:x,decode:h,encode:m,isBuffer:_,isRegExp:w,maybeMap:R,merge:l},Ey}var Ty,LC;function HU(){if(LC)return Ty;LC=1;var n=zU(),e=i5(),t=c2(),r=Object.prototype.hasOwnProperty,i={brackets:function(k){return k+"[]"},comma:"comma",indices:function(k,O){return k+"["+O+"]"},repeat:function(k){return k}},o=Array.isArray,l=Array.prototype.push,a=function(R,k){l.apply(R,o(k)?k:[k])},h=Date.prototype.toISOString,g=t.default,m={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,filter:void 0,format:g,formatter:t.formatters[g],indices:!1,serializeDate:function(k){return h.call(k)},skipNulls:!1,strictNullHandling:!1},x=function(k){return typeof k=="string"||typeof k=="number"||typeof k=="boolean"||typeof k=="symbol"||typeof k=="bigint"},w={},_=function R(k,O,P,z,H,G,N,J,Y,K,fe,X,te,ne,ue,se,$,re){for(var ge=k,me=re,oe=0,Q=!1;(me=me.get(w))!==void 0&&!Q;){var pe=me.get(k);if(oe+=1,typeof pe<"u"){if(pe===oe)throw new RangeError("Cyclic object value");Q=!0}typeof me.get(w)>"u"&&(oe=0)}if(typeof K=="function"?ge=K(O,ge):ge instanceof Date?ge=te(ge):P==="comma"&&o(ge)&&(ge=e.maybeMap(ge,function(qe){return qe instanceof Date?te(qe):qe})),ge===null){if(G)return Y&&!se?Y(O,m.encoder,$,"key",ne):O;ge=""}if(x(ge)||e.isBuffer(ge)){if(Y){var Ie=se?O:Y(O,m.encoder,$,"key",ne);return[ue(Ie)+"="+ue(Y(ge,m.encoder,$,"value",ne))]}return[ue(O)+"="+ue(String(ge))]}var Fe=[];if(typeof ge>"u")return Fe;var xe;if(P==="comma"&&o(ge))se&&Y&&(ge=e.maybeMap(ge,Y)),xe=[{value:ge.length>0?ge.join(",")||null:void 0}];else if(o(K))xe=K;else{var Oe=Object.keys(ge);xe=fe?Oe.sort(fe):Oe}var Le=J?String(O).replace(/\./g,"%2E"):String(O),He=z&&o(ge)&&ge.length===1?Le+"[]":Le;if(H&&o(ge)&&ge.length===0)return He+"[]";for(var Te=0;Te<xe.length;++Te){var ke=xe[Te],Be=typeof ke=="object"&&ke&&typeof ke.value<"u"?ke.value:ge[ke];if(!(N&&Be===null)){var rt=X&&J?String(ke).replace(/\./g,"%2E"):String(ke),Re=o(ge)?typeof P=="function"?P(He,rt):He:He+(X?"."+rt:"["+rt+"]");re.set(k,oe);var ut=n();ut.set(w,re),a(Fe,R(Be,Re,P,z,H,G,N,J,P==="comma"&&se&&o(ge)?null:Y,K,fe,X,te,ne,ue,se,$,ut))}}return Fe},S=function(k){if(!k)return m;if(typeof k.allowEmptyArrays<"u"&&typeof k.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof k.encodeDotInKeys<"u"&&typeof k.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(k.encoder!==null&&typeof k.encoder<"u"&&typeof k.encoder!="function")throw new TypeError("Encoder has to be a function.");var O=k.charset||m.charset;if(typeof k.charset<"u"&&k.charset!=="utf-8"&&k.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var P=t.default;if(typeof k.format<"u"){if(!r.call(t.formatters,k.format))throw new TypeError("Unknown format option provided.");P=k.format}var z=t.formatters[P],H=m.filter;(typeof k.filter=="function"||o(k.filter))&&(H=k.filter);var G;if(k.arrayFormat in i?G=k.arrayFormat:"indices"in k?G=k.indices?"indices":"repeat":G=m.arrayFormat,"commaRoundTrip"in k&&typeof k.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var N=typeof k.allowDots>"u"?k.encodeDotInKeys===!0?!0:m.allowDots:!!k.allowDots;return{addQueryPrefix:typeof k.addQueryPrefix=="boolean"?k.addQueryPrefix:m.addQueryPrefix,allowDots:N,allowEmptyArrays:typeof k.allowEmptyArrays=="boolean"?!!k.allowEmptyArrays:m.allowEmptyArrays,arrayFormat:G,charset:O,charsetSentinel:typeof k.charsetSentinel=="boolean"?k.charsetSentinel:m.charsetSentinel,commaRoundTrip:!!k.commaRoundTrip,delimiter:typeof k.delimiter>"u"?m.delimiter:k.delimiter,encode:typeof k.encode=="boolean"?k.encode:m.encode,encodeDotInKeys:typeof k.encodeDotInKeys=="boolean"?k.encodeDotInKeys:m.encodeDotInKeys,encoder:typeof k.encoder=="function"?k.encoder:m.encoder,encodeValuesOnly:typeof k.encodeValuesOnly=="boolean"?k.encodeValuesOnly:m.encodeValuesOnly,filter:H,format:P,formatter:z,serializeDate:typeof k.serializeDate=="function"?k.serializeDate:m.serializeDate,skipNulls:typeof k.skipNulls=="boolean"?k.skipNulls:m.skipNulls,sort:typeof k.sort=="function"?k.sort:null,strictNullHandling:typeof k.strictNullHandling=="boolean"?k.strictNullHandling:m.strictNullHandling}};return Ty=function(R,k){var O=R,P=S(k),z,H;typeof P.filter=="function"?(H=P.filter,O=H("",O)):o(P.filter)&&(H=P.filter,z=H);var G=[];if(typeof O!="object"||O===null)return"";var N=i[P.arrayFormat],J=N==="comma"&&P.commaRoundTrip;z||(z=Object.keys(O)),P.sort&&z.sort(P.sort);for(var Y=n(),K=0;K<z.length;++K){var fe=z[K],X=O[fe];P.skipNulls&&X===null||a(G,_(X,fe,N,J,P.allowEmptyArrays,P.strictNullHandling,P.skipNulls,P.encodeDotInKeys,P.encode?P.encoder:null,P.filter,P.sort,P.allowDots,P.serializeDate,P.format,P.formatter,P.encodeValuesOnly,P.charset,Y))}var te=G.join(P.delimiter),ne=P.addQueryPrefix===!0?"?":"";return P.charsetSentinel&&(P.charset==="iso-8859-1"?ne+="utf8=%26%2310003%3B&":ne+="utf8=%E2%9C%93&"),te.length>0?ne+te:""},Ty}var Ay,OC;function WU(){if(OC)return Ay;OC=1;var n=i5(),e=Object.prototype.hasOwnProperty,t=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(w){return w.replace(/&#(\d+);/g,function(_,S){return String.fromCharCode(parseInt(S,10))})},o=function(w,_,S){if(w&&typeof w=="string"&&_.comma&&w.indexOf(",")>-1)return w.split(",");if(_.throwOnLimitExceeded&&S>=_.arrayLimit)throw new RangeError("Array limit exceeded. Only "+_.arrayLimit+" element"+(_.arrayLimit===1?"":"s")+" allowed in an array.");return w},l="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",h=function(_,S){var R={__proto__:null},k=S.ignoreQueryPrefix?_.replace(/^\?/,""):_;k=k.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var O=S.parameterLimit===1/0?void 0:S.parameterLimit,P=k.split(S.delimiter,S.throwOnLimitExceeded?O+1:O);if(S.throwOnLimitExceeded&&P.length>O)throw new RangeError("Parameter limit exceeded. Only "+O+" parameter"+(O===1?"":"s")+" allowed.");var z=-1,H,G=S.charset;if(S.charsetSentinel)for(H=0;H<P.length;++H)P[H].indexOf("utf8=")===0&&(P[H]===a?G="utf-8":P[H]===l&&(G="iso-8859-1"),z=H,H=P.length);for(H=0;H<P.length;++H)if(H!==z){var N=P[H],J=N.indexOf("]="),Y=J===-1?N.indexOf("="):J+1,K,fe;Y===-1?(K=S.decoder(N,r.decoder,G,"key"),fe=S.strictNullHandling?null:""):(K=S.decoder(N.slice(0,Y),r.decoder,G,"key"),fe=n.maybeMap(o(N.slice(Y+1),S,t(R[K])?R[K].length:0),function(te){return S.decoder(te,r.decoder,G,"value")})),fe&&S.interpretNumericEntities&&G==="iso-8859-1"&&(fe=i(String(fe))),N.indexOf("[]=")>-1&&(fe=t(fe)?[fe]:fe);var X=e.call(R,K);X&&S.duplicates==="combine"?R[K]=n.combine(R[K],fe):(!X||S.duplicates==="last")&&(R[K]=fe)}return R},g=function(w,_,S,R){var k=0;if(w.length>0&&w[w.length-1]==="[]"){var O=w.slice(0,-1).join("");k=Array.isArray(_)&&_[O]?_[O].length:0}for(var P=R?_:o(_,S,k),z=w.length-1;z>=0;--z){var H,G=w[z];if(G==="[]"&&S.parseArrays)H=S.allowEmptyArrays&&(P===""||S.strictNullHandling&&P===null)?[]:n.combine([],P);else{H=S.plainObjects?{__proto__:null}:{};var N=G.charAt(0)==="["&&G.charAt(G.length-1)==="]"?G.slice(1,-1):G,J=S.decodeDotInKeys?N.replace(/%2E/g,"."):N,Y=parseInt(J,10);!S.parseArrays&&J===""?H={0:P}:!isNaN(Y)&&G!==J&&String(Y)===J&&Y>=0&&S.parseArrays&&Y<=S.arrayLimit?(H=[],H[Y]=P):J!=="__proto__"&&(H[J]=P)}P=H}return P},m=function(_,S,R,k){if(_){var O=R.allowDots?_.replace(/\.([^.[]+)/g,"[$1]"):_,P=/(\[[^[\]]*])/,z=/(\[[^[\]]*])/g,H=R.depth>0&&P.exec(O),G=H?O.slice(0,H.index):O,N=[];if(G){if(!R.plainObjects&&e.call(Object.prototype,G)&&!R.allowPrototypes)return;N.push(G)}for(var J=0;R.depth>0&&(H=z.exec(O))!==null&&J<R.depth;){if(J+=1,!R.plainObjects&&e.call(Object.prototype,H[1].slice(1,-1))&&!R.allowPrototypes)return;N.push(H[1])}if(H){if(R.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+R.depth+" and strictDepth is true");N.push("["+O.slice(H.index)+"]")}return g(N,S,R,k)}},x=function(_){if(!_)return r;if(typeof _.allowEmptyArrays<"u"&&typeof _.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof _.decodeDotInKeys<"u"&&typeof _.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(_.decoder!==null&&typeof _.decoder<"u"&&typeof _.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof _.charset<"u"&&_.charset!=="utf-8"&&_.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof _.throwOnLimitExceeded<"u"&&typeof _.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var S=typeof _.charset>"u"?r.charset:_.charset,R=typeof _.duplicates>"u"?r.duplicates:_.duplicates;if(R!=="combine"&&R!=="first"&&R!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var k=typeof _.allowDots>"u"?_.decodeDotInKeys===!0?!0:r.allowDots:!!_.allowDots;return{allowDots:k,allowEmptyArrays:typeof _.allowEmptyArrays=="boolean"?!!_.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof _.allowPrototypes=="boolean"?_.allowPrototypes:r.allowPrototypes,allowSparse:typeof _.allowSparse=="boolean"?_.allowSparse:r.allowSparse,arrayLimit:typeof _.arrayLimit=="number"?_.arrayLimit:r.arrayLimit,charset:S,charsetSentinel:typeof _.charsetSentinel=="boolean"?_.charsetSentinel:r.charsetSentinel,comma:typeof _.comma=="boolean"?_.comma:r.comma,decodeDotInKeys:typeof _.decodeDotInKeys=="boolean"?_.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof _.decoder=="function"?_.decoder:r.decoder,delimiter:typeof _.delimiter=="string"||n.isRegExp(_.delimiter)?_.delimiter:r.delimiter,depth:typeof _.depth=="number"||_.depth===!1?+_.depth:r.depth,duplicates:R,ignoreQueryPrefix:_.ignoreQueryPrefix===!0,interpretNumericEntities:typeof _.interpretNumericEntities=="boolean"?_.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof _.parameterLimit=="number"?_.parameterLimit:r.parameterLimit,parseArrays:_.parseArrays!==!1,plainObjects:typeof _.plainObjects=="boolean"?_.plainObjects:r.plainObjects,strictDepth:typeof _.strictDepth=="boolean"?!!_.strictDepth:r.strictDepth,strictNullHandling:typeof _.strictNullHandling=="boolean"?_.strictNullHandling:r.strictNullHandling,throwOnLimitExceeded:typeof _.throwOnLimitExceeded=="boolean"?_.throwOnLimitExceeded:!1}};return Ay=function(w,_){var S=x(_);if(w===""||w===null||typeof w>"u")return S.plainObjects?{__proto__:null}:{};for(var R=typeof w=="string"?h(w,S):w,k=S.plainObjects?{__proto__:null}:{},O=Object.keys(R),P=0;P<O.length;++P){var z=O[P],H=m(z,R[z],S,typeof w=="string");k=n.merge(k,H,S)}return S.allowSparse===!0?k:n.compact(k)},Ay}var Ry,PC;function UU(){if(PC)return Ry;PC=1;var n=HU(),e=WU(),t=c2();return Ry={formats:t,parse:e,stringify:n},Ry}var GU=UU();const YU=L1(GU),pm={StoredContexts:{},defaultHandler:()=>{}},o5={Init:()=>{},Create:n=>{const e=n.method+n.url;return pm.StoredContexts[e]=n,VU(n)},FetchBaseUrl:()=>window.location.href,useDefaultHandler:n=>{pm.defaultHandler=n}};function VU(n){const e=`[${n.method}] ${n.url}`;return{Call:async r=>{let{url:i,method:o,stream:l,paramType:a}=n;const{po:h,onStream:g,onStreamEnd:m,noDefaultHandle:x=[]}=r??{};(a==="query"||o==="GET")&&h!==void 0&&(i+="?"+YU.stringify(h,{arrayFormat:"comma"}));const w={method:o,headers:{Accept:"application/json;charset=UTF-8","X-Requested-With":"XMLHttpRequest","Cache-Control":"no-cache",Pragma:"no-cache",crossDomain:"true"}};if(a==="form"){const R=new FormData;if(h!==void 0)for(const k in h){const O=h[k];R.append(k,O)}w.body=R}else(a==="body"||a===void 0&&n.method!=="GET")&&(w.body=JSON.stringify(h),w.headers["Content-Type"]="application/json;charset=UTF-8");let _={errorCode:0,message:""};const S=Date.now();i=o5.FetchBaseUrl()+i;try{let R=await fetch(i,w);if(R.ok===!1)return _.errorCode=R.status,_.message=R.statusText,_;{const k=new TextDecoder("utf-8");if(l){if(R.body){let O=R.body.getReader(),P="";for(;;){const z=await O.read();if(z.done)break;const H=k.decode(z.value).trim();P+=H;let G=null;try{const N=H.split("\0");let J=N[N.length-1];for(let Y=N.length-2;Y>=0;Y--)if(N[Y].trim().length!==0){J=N[Y];break}G=await JSON.parse(J)}catch{try{const J=P.split("\0");let Y=J[J.length-1];for(let K=J.length-2;K>=0;K--)if(J[K].trim().length!==0){Y=J[K];break}G=await JSON.parse(Y)}catch{}}if(G!=null&&(Object.keys(G).includes("err_code")?_.errorCode=G.err_code:(_.errorCode=0,_.data=G,P="",z.done?m==null||m(_.data):g==null||g(_.data))),z.done)break}}}else if(R.body){const P=await R.body.getReader().read(),z=k.decode(P.value);if(z==="null")return _;{let H=await JSON.parse(z.replaceAll("\0",""));Object.keys(H).includes("err_code")?(_.errorCode=H.err_code,_.message=H.err_msg):_.data=H}}}}catch(R){console.warn(R),_.errorCode=-1,_.message=R.message}return console.debug(`${e} ${Date.now()-S}ms`),x!==!0&&await pm.defaultHandler(_,x),_}}}exports.ABase=zi;exports.ABaseStyleKeys=r3;exports.AButton=Ic;exports.AButtonStyleKeys=o3;exports.AButtonTypes=lA;exports.ACheckBox=w1;exports.ACheckBoxStyleKeys=c3;exports.AChip=wm;exports.AChipKeys=I3;exports.AChips=m6;exports.AClock=P6;exports.AColFrame=O3;exports.ADatePicker=Em;exports.ADatePickerStyleKeys=x3;exports.ADatePickerTypes=u8;exports.ADateRangePicker=_m;exports.ADateRangePickerStyleKeys=w3;exports.ADialog=m8;exports.ADialogStyleKeys=u3;exports.ADialogTypes=y8;exports.ADivideFrame=D3;exports.AEditor=Oz;exports.AEditorStyleKeys=a3;exports.AFileBox=k8;exports.AFileBoxStyleKeys=v3;exports.AFileUploader=o9;exports.AFileUploaderStyleKeys=b3;exports.AFloatMenu=B3;exports.AFloatMenuKeys=E3;exports.AFrameStyleKeys=S3;exports.AGrow=zg;exports.AIcon=fo;exports.AIconButton=ba;exports.AIconButtonStyleKeys=C3;exports.AIconButtonTypes=sA;exports.AIconHOC=hT;exports.AIcons=ym;exports.AInput=sg;exports.AInputStyleKeys=l3;exports.AInputTypes=J6;exports.AListView=v9;exports.AListViewStyleKeys=y3;exports.ALoadingBorder=Am;exports.ALoadingBorderKeys=T3;exports.AMultiSelect=G9;exports.AMultiSelectStyleKeys=h3;exports.ANumInput=f9;exports.AOverflowFrame=nd;exports.AProgressBar=YC;exports.ARadioSelect=R9;exports.ARadioSelectKeys=R3;exports.ARowFrame=Ml;exports.ASelect=Td;exports.ASelectStyleKeys=f3;exports.ASelectTypes=fR;exports.ASpace=cs;exports.AStepper=iI;exports.AStepperStyleKeys=m3;exports.ASwitch=QC;exports.ASwitchFrame=P3;exports.ASwitchStyleKeys=g3;exports.ATab=H3;exports.ATabStyleKeys=p3;exports.ATabTypes=bI;exports.ATable=kk;exports.ATableStyleKeys=_3;exports.AText=V3;exports.ATextArea=Gk;exports.ATextAreaStyleKeys=s3;exports.ATextAreaTypes=Uk;exports.AThemeButton=OA;exports.AThemes=pp;exports.ATooltip=JC;exports.ATooltipStyleKeys=i3;exports.ATree=lU;exports.ATreeStyleKeys=d3;exports.AWrap=lg;exports.AWrapKeys=A3;exports.AWrapPropsExtract=Bg;exports.AWrapTypes=dA;exports.ApiContext=o5;exports.BodyStyleKeys=n3;exports.CreateADC=E8;exports.DefaultOptionRenderer=z3;exports.EDir12=O1;exports.EDir4=ic;exports.FileSizeTrans=Mg;exports.Icons=_v;exports.IsCursorPointer=HC;exports.IsFixedShape=zC;exports.IsInteractive=WC;exports.NoSelect=FC;exports.NoTransition=BC;exports.Resources=Or;exports.SetResources=AT;exports.alphanumericRegex=C6;exports.bound=gp;exports.cbF=Ur;exports.changeSemanticMode=xm;exports.componentStyleKeys=EA;exports.createEvent=Eg;exports.dateF=Un;exports.dbF=Th;exports.defaultPredicate=U3;exports.dlgF=T8;exports.emailIdRegex=S6;exports.emailRegex=_6;exports.fileF=Tg;exports.getFileKey=F3;exports.getMonthsOptions=Ap;exports.getYearsOptions=Sm;exports.hangulRegex=T6;exports.hexRegex=E6;exports.key=NC;exports.noHanguljamoRegex=R6;exports.noSpaceRegex=A6;exports.numF=G0;exports.objF=$n;exports.paletteKeys=qC;exports.paletteModes=Sv;exports.passwordRegex=k6;exports.refinedDesignTokens=lc;exports.sF=dt;exports.semanticKeys=e3;exports.semanticModes=x1;exports.setDir12Style=mm;exports.setDir12StyleElem=XC;exports.specialCharRegex=I6;exports.strF=Cm;exports.tableF=_d;exports.textMeasurement=kg;exports.treeF=Qd;exports.useADialogCore=_8;exports.useADialogCores=C8;exports.useDB=M3;exports.useEvent=Y3;exports.useInit=W3;exports.useLayoutDB=L3;exports.useOffset=ZC;exports.useValues=Fo;exports.uuidRegex=M6;
487
+ `+Ce.prev}function vn(We,Ce){var it=Le(We),Ct=[];if(it){Ct.length=We.length;for(var Qt=0;Qt<We.length;Qt++)Ct[Qt]=st(We,Qt)?Ce(We[Qt],We):""}var Yt=typeof te=="function"?te(We):[],yn;if(ue){yn={};for(var gn=0;gn<Yt.length;gn++)yn["$"+Yt[gn]]=Yt[gn]}for(var lt in We)st(We,lt)&&(it&&String(Number(lt))===lt&&lt<We.length||ue&&yn["$"+lt]instanceof Symbol||(N.call(/[^\w$]/,lt)?Ct.push(Ce(lt,We)+": "+Ce(We[lt],We)):Ct.push(lt+": "+Ce(We[lt],We))));if(typeof te=="function")for(var kt=0;kt<Yt.length;kt++)$.call(We,Yt[kt])&&Ct.push("["+Ce(Yt[kt])+"]: "+Ce(We[Yt[kt]],We));return Ct}return zb}var Hb,Zw;function gU(){if(Zw)return Hb;Zw=1;var n=Uv(),e=z1(),t=function(a,h,g){for(var m=a,x;(x=m.next)!=null;m=x)if(x.key===h)return m.next=x.next,g||(x.next=a.next,a.next=x),x},r=function(a,h){if(a){var g=t(a,h);return g&&g.value}},i=function(a,h,g){var m=t(a,h);m?m.value=g:a.next={key:h,next:a.next,value:g}},o=function(a,h){return a?!!t(a,h):!1},l=function(a,h){if(a)return t(a,h,!0)};return Hb=function(){var h,g={assert:function(m){if(!g.has(m))throw new e("Side channel does not contain "+n(m))},delete:function(m){var x=h&&h.next,w=l(h,m);return w&&x&&x===w&&(h=void 0),!!w},get:function(m){return r(h,m)},has:function(m){return o(h,m)},set:function(m,x){h||(h={next:void 0}),i(h,m,x)}};return g},Hb}var Wb,Xw;function Q_(){return Xw||(Xw=1,Wb=Object),Wb}var Ub,Kw;function pU(){return Kw||(Kw=1,Ub=Error),Ub}var Gb,Jw;function vU(){return Jw||(Jw=1,Gb=EvalError),Gb}var Yb,Qw;function bU(){return Qw||(Qw=1,Yb=RangeError),Yb}var Vb,qw;function yU(){return qw||(qw=1,Vb=ReferenceError),Vb}var Zb,jw;function mU(){return jw||(jw=1,Zb=SyntaxError),Zb}var Xb,$w;function xU(){return $w||($w=1,Xb=URIError),Xb}var Kb,eC;function wU(){return eC||(eC=1,Kb=Math.abs),Kb}var Jb,tC;function CU(){return tC||(tC=1,Jb=Math.floor),Jb}var Qb,nC;function _U(){return nC||(nC=1,Qb=Math.max),Qb}var qb,rC;function SU(){return rC||(rC=1,qb=Math.min),qb}var jb,iC;function EU(){return iC||(iC=1,jb=Math.pow),jb}var $b,oC;function TU(){return oC||(oC=1,$b=Math.round),$b}var ey,lC;function AU(){return lC||(lC=1,ey=Number.isNaN||function(e){return e!==e}),ey}var ty,sC;function RU(){if(sC)return ty;sC=1;var n=AU();return ty=function(t){return n(t)||t===0?t:t<0?-1:1},ty}var ny,aC;function IU(){return aC||(aC=1,ny=Object.getOwnPropertyDescriptor),ny}var ry,cC;function q_(){if(cC)return ry;cC=1;var n=IU();if(n)try{n([],"length")}catch{n=null}return ry=n,ry}var iy,uC;function kU(){if(uC)return iy;uC=1;var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch{n=!1}return iy=n,iy}var oy,fC;function MU(){return fC||(fC=1,oy=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var l=Object.getOwnPropertySymbols(e);if(l.length!==1||l[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),oy}var ly,hC;function LU(){if(hC)return ly;hC=1;var n=typeof Symbol<"u"&&Symbol,e=MU();return ly=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ly}var sy,dC;function j_(){return dC||(dC=1,sy=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),sy}var ay,gC;function $_(){if(gC)return ay;gC=1;var n=Q_();return ay=n.getPrototypeOf||null,ay}var cy,pC;function OU(){if(pC)return cy;pC=1;var n="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,r="[object Function]",i=function(h,g){for(var m=[],x=0;x<h.length;x+=1)m[x]=h[x];for(var w=0;w<g.length;w+=1)m[w+h.length]=g[w];return m},o=function(h,g){for(var m=[],x=g,w=0;x<h.length;x+=1,w+=1)m[w]=h[x];return m},l=function(a,h){for(var g="",m=0;m<a.length;m+=1)g+=a[m],m+1<a.length&&(g+=h);return g};return cy=function(h){var g=this;if(typeof g!="function"||e.apply(g)!==r)throw new TypeError(n+g);for(var m=o(arguments,1),x,w=function(){if(this instanceof x){var O=g.apply(this,i(m,arguments));return Object(O)===O?O:this}return g.apply(h,i(m,arguments))},_=t(0,g.length-m.length),S=[],R=0;R<_;R++)S[R]="$"+R;if(x=Function("binder","return function ("+l(S,",")+"){ return binder.apply(this,arguments); }")(w),g.prototype){var k=function(){};k.prototype=g.prototype,x.prototype=new k,k.prototype=null}return x},cy}var uy,vC;function Gv(){if(vC)return uy;vC=1;var n=OU();return uy=Function.prototype.bind||n,uy}var fy,bC;function s2(){return bC||(bC=1,fy=Function.prototype.call),fy}var hy,yC;function e5(){return yC||(yC=1,hy=Function.prototype.apply),hy}var dy,mC;function PU(){return mC||(mC=1,dy=typeof Reflect<"u"&&Reflect&&Reflect.apply),dy}var gy,xC;function DU(){if(xC)return gy;xC=1;var n=Gv(),e=e5(),t=s2(),r=PU();return gy=r||n.call(t,e),gy}var py,wC;function t5(){if(wC)return py;wC=1;var n=Gv(),e=z1(),t=s2(),r=DU();return py=function(o){if(o.length<1||typeof o[0]!="function")throw new e("a function is required");return r(n,t,o)},py}var vy,CC;function NU(){if(CC)return vy;CC=1;var n=t5(),e=q_(),t;try{t=[].__proto__===Array.prototype}catch(l){if(!l||typeof l!="object"||!("code"in l)||l.code!=="ERR_PROTO_ACCESS")throw l}var r=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return vy=r&&typeof r.get=="function"?n([r.get]):typeof o=="function"?function(a){return o(a==null?a:i(a))}:!1,vy}var by,_C;function FU(){if(_C)return by;_C=1;var n=j_(),e=$_(),t=NU();return by=n?function(i){return n(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,by}var yy,SC;function BU(){if(SC)return yy;SC=1;var n=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Gv();return yy=t.call(n,e),yy}var my,EC;function a2(){if(EC)return my;EC=1;var n,e=Q_(),t=pU(),r=vU(),i=bU(),o=yU(),l=mU(),a=z1(),h=xU(),g=wU(),m=CU(),x=_U(),w=SU(),_=EU(),S=TU(),R=RU(),k=Function,O=function(Te){try{return k('"use strict"; return ('+Te+").constructor;")()}catch{}},P=q_(),z=kU(),H=function(){throw new a},G=P?(function(){try{return arguments.callee,H}catch{try{return P(arguments,"callee").get}catch{return H}}})():H,N=LU()(),J=FU(),Y=$_(),K=j_(),fe=e5(),X=s2(),te={},ne=typeof Uint8Array>"u"||!J?n:J(Uint8Array),ue={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":N&&J?J([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":te,"%AsyncGenerator%":te,"%AsyncGeneratorFunction%":te,"%AsyncIteratorPrototype%":te,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?n:Float16Array,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":k,"%GeneratorFunction%":te,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":N&&J?J(J([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!N||!J?n:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!N||!J?n:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":N&&J?J(""[Symbol.iterator]()):n,"%Symbol%":N?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":G,"%TypedArray%":ne,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":X,"%Function.prototype.apply%":fe,"%Object.defineProperty%":z,"%Object.getPrototypeOf%":Y,"%Math.abs%":g,"%Math.floor%":m,"%Math.max%":x,"%Math.min%":w,"%Math.pow%":_,"%Math.round%":S,"%Math.sign%":R,"%Reflect.getPrototypeOf%":K};if(J)try{null.error}catch(Te){var se=J(J(Te));ue["%Error.prototype%"]=se}var $=function Te(ke){var Be;if(ke==="%AsyncFunction%")Be=O("async function () {}");else if(ke==="%GeneratorFunction%")Be=O("function* () {}");else if(ke==="%AsyncGeneratorFunction%")Be=O("async function* () {}");else if(ke==="%AsyncGenerator%"){var rt=Te("%AsyncGeneratorFunction%");rt&&(Be=rt.prototype)}else if(ke==="%AsyncIteratorPrototype%"){var Re=Te("%AsyncGenerator%");Re&&J&&(Be=J(Re.prototype))}return ue[ke]=Be,Be},re={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ge=Gv(),me=BU(),oe=ge.call(X,Array.prototype.concat),Q=ge.call(fe,Array.prototype.splice),pe=ge.call(X,String.prototype.replace),Ie=ge.call(X,String.prototype.slice),Fe=ge.call(X,RegExp.prototype.exec),xe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Oe=/\\(\\)?/g,Le=function(ke){var Be=Ie(ke,0,1),rt=Ie(ke,-1);if(Be==="%"&&rt!=="%")throw new l("invalid intrinsic syntax, expected closing `%`");if(rt==="%"&&Be!=="%")throw new l("invalid intrinsic syntax, expected opening `%`");var Re=[];return pe(ke,xe,function(ut,qe,ot,st){Re[Re.length]=ot?pe(st,Oe,"$1"):qe||ut}),Re},He=function(ke,Be){var rt=ke,Re;if(me(re,rt)&&(Re=re[rt],rt="%"+Re[0]+"%"),me(ue,rt)){var ut=ue[rt];if(ut===te&&(ut=$(rt)),typeof ut>"u"&&!Be)throw new a("intrinsic "+ke+" exists, but is not available. Please file an issue!");return{alias:Re,name:rt,value:ut}}throw new l("intrinsic "+ke+" does not exist!")};return my=function(ke,Be){if(typeof ke!="string"||ke.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Be!="boolean")throw new a('"allowMissing" argument must be a boolean');if(Fe(/^%?[^%]*%?$/,ke)===null)throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var rt=Le(ke),Re=rt.length>0?rt[0]:"",ut=He("%"+Re+"%",Be),qe=ut.name,ot=ut.value,st=!1,bt=ut.alias;bt&&(Re=bt[0],Q(rt,oe([0,1],bt)));for(var Mt=1,Bt=!0;Mt<rt.length;Mt+=1){var at=rt[Mt],Ye=Ie(at,0,1),Tt=Ie(at,-1);if((Ye==='"'||Ye==="'"||Ye==="`"||Tt==='"'||Tt==="'"||Tt==="`")&&Ye!==Tt)throw new l("property names with quotes must have matching quotes");if((at==="constructor"||!Bt)&&(st=!0),Re+="."+at,qe="%"+Re+"%",me(ue,qe))ot=ue[qe];else if(ot!=null){if(!(at in ot)){if(!Be)throw new a("base intrinsic for "+ke+" exists, but the property is not available.");return}if(P&&Mt+1>=rt.length){var Ut=P(ot,at);Bt=!!Ut,Bt&&"get"in Ut&&!("originalValue"in Ut.get)?ot=Ut.get:ot=ot[at]}else Bt=me(ot,at),ot=ot[at];Bt&&!st&&(ue[qe]=ot)}}return ot},my}var xy,TC;function n5(){if(TC)return xy;TC=1;var n=a2(),e=t5(),t=e([n("%String.prototype.indexOf%")]);return xy=function(i,o){var l=n(i,!!o);return typeof l=="function"&&t(i,".prototype.")>-1?e([l]):l},xy}var wy,AC;function r5(){if(AC)return wy;AC=1;var n=a2(),e=n5(),t=Uv(),r=z1(),i=n("%Map%",!0),o=e("Map.prototype.get",!0),l=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),h=e("Map.prototype.delete",!0),g=e("Map.prototype.size",!0);return wy=!!i&&function(){var x,w={assert:function(_){if(!w.has(_))throw new r("Side channel does not contain "+t(_))},delete:function(_){if(x){var S=h(x,_);return g(x)===0&&(x=void 0),S}return!1},get:function(_){if(x)return o(x,_)},has:function(_){return x?a(x,_):!1},set:function(_,S){x||(x=new i),l(x,_,S)}};return w},wy}var Cy,RC;function zU(){if(RC)return Cy;RC=1;var n=a2(),e=n5(),t=Uv(),r=r5(),i=z1(),o=n("%WeakMap%",!0),l=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),h=e("WeakMap.prototype.has",!0),g=e("WeakMap.prototype.delete",!0);return Cy=o?function(){var x,w,_={assert:function(S){if(!_.has(S))throw new i("Side channel does not contain "+t(S))},delete:function(S){if(o&&S&&(typeof S=="object"||typeof S=="function")){if(x)return g(x,S)}else if(r&&w)return w.delete(S);return!1},get:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&x?l(x,S):w&&w.get(S)},has:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&x?h(x,S):!!w&&w.has(S)},set:function(S,R){o&&S&&(typeof S=="object"||typeof S=="function")?(x||(x=new o),a(x,S,R)):r&&(w||(w=r()),w.set(S,R))}};return _}:r,Cy}var _y,IC;function HU(){if(IC)return _y;IC=1;var n=z1(),e=Uv(),t=gU(),r=r5(),i=zU(),o=i||r||t;return _y=function(){var a,h={assert:function(g){if(!h.has(g))throw new n("Side channel does not contain "+e(g))},delete:function(g){return!!a&&a.delete(g)},get:function(g){return a&&a.get(g)},has:function(g){return!!a&&a.has(g)},set:function(g,m){a||(a=o()),a.set(g,m)}};return h},_y}var Sy,kC;function c2(){if(kC)return Sy;kC=1;var n=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Sy={default:t.RFC3986,formatters:{RFC1738:function(r){return n.call(r,e,"+")},RFC3986:function(r){return String(r)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Sy}var Ey,MC;function i5(){if(MC)return Ey;MC=1;var n=c2(),e=Object.prototype.hasOwnProperty,t=Array.isArray,r=(function(){for(var k=[],O=0;O<256;++O)k.push("%"+((O<16?"0":"")+O.toString(16)).toUpperCase());return k})(),i=function(O){for(;O.length>1;){var P=O.pop(),z=P.obj[P.prop];if(t(z)){for(var H=[],G=0;G<z.length;++G)typeof z[G]<"u"&&H.push(z[G]);P.obj[P.prop]=H}}},o=function(O,P){for(var z=P&&P.plainObjects?{__proto__:null}:{},H=0;H<O.length;++H)typeof O[H]<"u"&&(z[H]=O[H]);return z},l=function k(O,P,z){if(!P)return O;if(typeof P!="object"&&typeof P!="function"){if(t(O))O.push(P);else if(O&&typeof O=="object")(z&&(z.plainObjects||z.allowPrototypes)||!e.call(Object.prototype,P))&&(O[P]=!0);else return[O,P];return O}if(!O||typeof O!="object")return[O].concat(P);var H=O;return t(O)&&!t(P)&&(H=o(O,z)),t(O)&&t(P)?(P.forEach(function(G,N){if(e.call(O,N)){var J=O[N];J&&typeof J=="object"&&G&&typeof G=="object"?O[N]=k(J,G,z):O.push(G)}else O[N]=G}),O):Object.keys(P).reduce(function(G,N){var J=P[N];return e.call(G,N)?G[N]=k(G[N],J,z):G[N]=J,G},H)},a=function(O,P){return Object.keys(P).reduce(function(z,H){return z[H]=P[H],z},O)},h=function(k,O,P){var z=k.replace(/\+/g," ");if(P==="iso-8859-1")return z.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(z)}catch{return z}},g=1024,m=function(O,P,z,H,G){if(O.length===0)return O;var N=O;if(typeof O=="symbol"?N=Symbol.prototype.toString.call(O):typeof O!="string"&&(N=String(O)),z==="iso-8859-1")return escape(N).replace(/%u[0-9a-f]{4}/gi,function(ne){return"%26%23"+parseInt(ne.slice(2),16)+"%3B"});for(var J="",Y=0;Y<N.length;Y+=g){for(var K=N.length>=g?N.slice(Y,Y+g):N,fe=[],X=0;X<K.length;++X){var te=K.charCodeAt(X);if(te===45||te===46||te===95||te===126||te>=48&&te<=57||te>=65&&te<=90||te>=97&&te<=122||G===n.RFC1738&&(te===40||te===41)){fe[fe.length]=K.charAt(X);continue}if(te<128){fe[fe.length]=r[te];continue}if(te<2048){fe[fe.length]=r[192|te>>6]+r[128|te&63];continue}if(te<55296||te>=57344){fe[fe.length]=r[224|te>>12]+r[128|te>>6&63]+r[128|te&63];continue}X+=1,te=65536+((te&1023)<<10|K.charCodeAt(X)&1023),fe[fe.length]=r[240|te>>18]+r[128|te>>12&63]+r[128|te>>6&63]+r[128|te&63]}J+=fe.join("")}return J},x=function(O){for(var P=[{obj:{o:O},prop:"o"}],z=[],H=0;H<P.length;++H)for(var G=P[H],N=G.obj[G.prop],J=Object.keys(N),Y=0;Y<J.length;++Y){var K=J[Y],fe=N[K];typeof fe=="object"&&fe!==null&&z.indexOf(fe)===-1&&(P.push({obj:N,prop:K}),z.push(fe))}return i(P),O},w=function(O){return Object.prototype.toString.call(O)==="[object RegExp]"},_=function(O){return!O||typeof O!="object"?!1:!!(O.constructor&&O.constructor.isBuffer&&O.constructor.isBuffer(O))},S=function(O,P){return[].concat(O,P)},R=function(O,P){if(t(O)){for(var z=[],H=0;H<O.length;H+=1)z.push(P(O[H]));return z}return P(O)};return Ey={arrayToObject:o,assign:a,combine:S,compact:x,decode:h,encode:m,isBuffer:_,isRegExp:w,maybeMap:R,merge:l},Ey}var Ty,LC;function WU(){if(LC)return Ty;LC=1;var n=HU(),e=i5(),t=c2(),r=Object.prototype.hasOwnProperty,i={brackets:function(k){return k+"[]"},comma:"comma",indices:function(k,O){return k+"["+O+"]"},repeat:function(k){return k}},o=Array.isArray,l=Array.prototype.push,a=function(R,k){l.apply(R,o(k)?k:[k])},h=Date.prototype.toISOString,g=t.default,m={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,filter:void 0,format:g,formatter:t.formatters[g],indices:!1,serializeDate:function(k){return h.call(k)},skipNulls:!1,strictNullHandling:!1},x=function(k){return typeof k=="string"||typeof k=="number"||typeof k=="boolean"||typeof k=="symbol"||typeof k=="bigint"},w={},_=function R(k,O,P,z,H,G,N,J,Y,K,fe,X,te,ne,ue,se,$,re){for(var ge=k,me=re,oe=0,Q=!1;(me=me.get(w))!==void 0&&!Q;){var pe=me.get(k);if(oe+=1,typeof pe<"u"){if(pe===oe)throw new RangeError("Cyclic object value");Q=!0}typeof me.get(w)>"u"&&(oe=0)}if(typeof K=="function"?ge=K(O,ge):ge instanceof Date?ge=te(ge):P==="comma"&&o(ge)&&(ge=e.maybeMap(ge,function(qe){return qe instanceof Date?te(qe):qe})),ge===null){if(G)return Y&&!se?Y(O,m.encoder,$,"key",ne):O;ge=""}if(x(ge)||e.isBuffer(ge)){if(Y){var Ie=se?O:Y(O,m.encoder,$,"key",ne);return[ue(Ie)+"="+ue(Y(ge,m.encoder,$,"value",ne))]}return[ue(O)+"="+ue(String(ge))]}var Fe=[];if(typeof ge>"u")return Fe;var xe;if(P==="comma"&&o(ge))se&&Y&&(ge=e.maybeMap(ge,Y)),xe=[{value:ge.length>0?ge.join(",")||null:void 0}];else if(o(K))xe=K;else{var Oe=Object.keys(ge);xe=fe?Oe.sort(fe):Oe}var Le=J?String(O).replace(/\./g,"%2E"):String(O),He=z&&o(ge)&&ge.length===1?Le+"[]":Le;if(H&&o(ge)&&ge.length===0)return He+"[]";for(var Te=0;Te<xe.length;++Te){var ke=xe[Te],Be=typeof ke=="object"&&ke&&typeof ke.value<"u"?ke.value:ge[ke];if(!(N&&Be===null)){var rt=X&&J?String(ke).replace(/\./g,"%2E"):String(ke),Re=o(ge)?typeof P=="function"?P(He,rt):He:He+(X?"."+rt:"["+rt+"]");re.set(k,oe);var ut=n();ut.set(w,re),a(Fe,R(Be,Re,P,z,H,G,N,J,P==="comma"&&se&&o(ge)?null:Y,K,fe,X,te,ne,ue,se,$,ut))}}return Fe},S=function(k){if(!k)return m;if(typeof k.allowEmptyArrays<"u"&&typeof k.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof k.encodeDotInKeys<"u"&&typeof k.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(k.encoder!==null&&typeof k.encoder<"u"&&typeof k.encoder!="function")throw new TypeError("Encoder has to be a function.");var O=k.charset||m.charset;if(typeof k.charset<"u"&&k.charset!=="utf-8"&&k.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var P=t.default;if(typeof k.format<"u"){if(!r.call(t.formatters,k.format))throw new TypeError("Unknown format option provided.");P=k.format}var z=t.formatters[P],H=m.filter;(typeof k.filter=="function"||o(k.filter))&&(H=k.filter);var G;if(k.arrayFormat in i?G=k.arrayFormat:"indices"in k?G=k.indices?"indices":"repeat":G=m.arrayFormat,"commaRoundTrip"in k&&typeof k.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var N=typeof k.allowDots>"u"?k.encodeDotInKeys===!0?!0:m.allowDots:!!k.allowDots;return{addQueryPrefix:typeof k.addQueryPrefix=="boolean"?k.addQueryPrefix:m.addQueryPrefix,allowDots:N,allowEmptyArrays:typeof k.allowEmptyArrays=="boolean"?!!k.allowEmptyArrays:m.allowEmptyArrays,arrayFormat:G,charset:O,charsetSentinel:typeof k.charsetSentinel=="boolean"?k.charsetSentinel:m.charsetSentinel,commaRoundTrip:!!k.commaRoundTrip,delimiter:typeof k.delimiter>"u"?m.delimiter:k.delimiter,encode:typeof k.encode=="boolean"?k.encode:m.encode,encodeDotInKeys:typeof k.encodeDotInKeys=="boolean"?k.encodeDotInKeys:m.encodeDotInKeys,encoder:typeof k.encoder=="function"?k.encoder:m.encoder,encodeValuesOnly:typeof k.encodeValuesOnly=="boolean"?k.encodeValuesOnly:m.encodeValuesOnly,filter:H,format:P,formatter:z,serializeDate:typeof k.serializeDate=="function"?k.serializeDate:m.serializeDate,skipNulls:typeof k.skipNulls=="boolean"?k.skipNulls:m.skipNulls,sort:typeof k.sort=="function"?k.sort:null,strictNullHandling:typeof k.strictNullHandling=="boolean"?k.strictNullHandling:m.strictNullHandling}};return Ty=function(R,k){var O=R,P=S(k),z,H;typeof P.filter=="function"?(H=P.filter,O=H("",O)):o(P.filter)&&(H=P.filter,z=H);var G=[];if(typeof O!="object"||O===null)return"";var N=i[P.arrayFormat],J=N==="comma"&&P.commaRoundTrip;z||(z=Object.keys(O)),P.sort&&z.sort(P.sort);for(var Y=n(),K=0;K<z.length;++K){var fe=z[K],X=O[fe];P.skipNulls&&X===null||a(G,_(X,fe,N,J,P.allowEmptyArrays,P.strictNullHandling,P.skipNulls,P.encodeDotInKeys,P.encode?P.encoder:null,P.filter,P.sort,P.allowDots,P.serializeDate,P.format,P.formatter,P.encodeValuesOnly,P.charset,Y))}var te=G.join(P.delimiter),ne=P.addQueryPrefix===!0?"?":"";return P.charsetSentinel&&(P.charset==="iso-8859-1"?ne+="utf8=%26%2310003%3B&":ne+="utf8=%E2%9C%93&"),te.length>0?ne+te:""},Ty}var Ay,OC;function UU(){if(OC)return Ay;OC=1;var n=i5(),e=Object.prototype.hasOwnProperty,t=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(w){return w.replace(/&#(\d+);/g,function(_,S){return String.fromCharCode(parseInt(S,10))})},o=function(w,_,S){if(w&&typeof w=="string"&&_.comma&&w.indexOf(",")>-1)return w.split(",");if(_.throwOnLimitExceeded&&S>=_.arrayLimit)throw new RangeError("Array limit exceeded. Only "+_.arrayLimit+" element"+(_.arrayLimit===1?"":"s")+" allowed in an array.");return w},l="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",h=function(_,S){var R={__proto__:null},k=S.ignoreQueryPrefix?_.replace(/^\?/,""):_;k=k.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var O=S.parameterLimit===1/0?void 0:S.parameterLimit,P=k.split(S.delimiter,S.throwOnLimitExceeded?O+1:O);if(S.throwOnLimitExceeded&&P.length>O)throw new RangeError("Parameter limit exceeded. Only "+O+" parameter"+(O===1?"":"s")+" allowed.");var z=-1,H,G=S.charset;if(S.charsetSentinel)for(H=0;H<P.length;++H)P[H].indexOf("utf8=")===0&&(P[H]===a?G="utf-8":P[H]===l&&(G="iso-8859-1"),z=H,H=P.length);for(H=0;H<P.length;++H)if(H!==z){var N=P[H],J=N.indexOf("]="),Y=J===-1?N.indexOf("="):J+1,K,fe;Y===-1?(K=S.decoder(N,r.decoder,G,"key"),fe=S.strictNullHandling?null:""):(K=S.decoder(N.slice(0,Y),r.decoder,G,"key"),fe=n.maybeMap(o(N.slice(Y+1),S,t(R[K])?R[K].length:0),function(te){return S.decoder(te,r.decoder,G,"value")})),fe&&S.interpretNumericEntities&&G==="iso-8859-1"&&(fe=i(String(fe))),N.indexOf("[]=")>-1&&(fe=t(fe)?[fe]:fe);var X=e.call(R,K);X&&S.duplicates==="combine"?R[K]=n.combine(R[K],fe):(!X||S.duplicates==="last")&&(R[K]=fe)}return R},g=function(w,_,S,R){var k=0;if(w.length>0&&w[w.length-1]==="[]"){var O=w.slice(0,-1).join("");k=Array.isArray(_)&&_[O]?_[O].length:0}for(var P=R?_:o(_,S,k),z=w.length-1;z>=0;--z){var H,G=w[z];if(G==="[]"&&S.parseArrays)H=S.allowEmptyArrays&&(P===""||S.strictNullHandling&&P===null)?[]:n.combine([],P);else{H=S.plainObjects?{__proto__:null}:{};var N=G.charAt(0)==="["&&G.charAt(G.length-1)==="]"?G.slice(1,-1):G,J=S.decodeDotInKeys?N.replace(/%2E/g,"."):N,Y=parseInt(J,10);!S.parseArrays&&J===""?H={0:P}:!isNaN(Y)&&G!==J&&String(Y)===J&&Y>=0&&S.parseArrays&&Y<=S.arrayLimit?(H=[],H[Y]=P):J!=="__proto__"&&(H[J]=P)}P=H}return P},m=function(_,S,R,k){if(_){var O=R.allowDots?_.replace(/\.([^.[]+)/g,"[$1]"):_,P=/(\[[^[\]]*])/,z=/(\[[^[\]]*])/g,H=R.depth>0&&P.exec(O),G=H?O.slice(0,H.index):O,N=[];if(G){if(!R.plainObjects&&e.call(Object.prototype,G)&&!R.allowPrototypes)return;N.push(G)}for(var J=0;R.depth>0&&(H=z.exec(O))!==null&&J<R.depth;){if(J+=1,!R.plainObjects&&e.call(Object.prototype,H[1].slice(1,-1))&&!R.allowPrototypes)return;N.push(H[1])}if(H){if(R.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+R.depth+" and strictDepth is true");N.push("["+O.slice(H.index)+"]")}return g(N,S,R,k)}},x=function(_){if(!_)return r;if(typeof _.allowEmptyArrays<"u"&&typeof _.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof _.decodeDotInKeys<"u"&&typeof _.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(_.decoder!==null&&typeof _.decoder<"u"&&typeof _.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof _.charset<"u"&&_.charset!=="utf-8"&&_.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof _.throwOnLimitExceeded<"u"&&typeof _.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var S=typeof _.charset>"u"?r.charset:_.charset,R=typeof _.duplicates>"u"?r.duplicates:_.duplicates;if(R!=="combine"&&R!=="first"&&R!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var k=typeof _.allowDots>"u"?_.decodeDotInKeys===!0?!0:r.allowDots:!!_.allowDots;return{allowDots:k,allowEmptyArrays:typeof _.allowEmptyArrays=="boolean"?!!_.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof _.allowPrototypes=="boolean"?_.allowPrototypes:r.allowPrototypes,allowSparse:typeof _.allowSparse=="boolean"?_.allowSparse:r.allowSparse,arrayLimit:typeof _.arrayLimit=="number"?_.arrayLimit:r.arrayLimit,charset:S,charsetSentinel:typeof _.charsetSentinel=="boolean"?_.charsetSentinel:r.charsetSentinel,comma:typeof _.comma=="boolean"?_.comma:r.comma,decodeDotInKeys:typeof _.decodeDotInKeys=="boolean"?_.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof _.decoder=="function"?_.decoder:r.decoder,delimiter:typeof _.delimiter=="string"||n.isRegExp(_.delimiter)?_.delimiter:r.delimiter,depth:typeof _.depth=="number"||_.depth===!1?+_.depth:r.depth,duplicates:R,ignoreQueryPrefix:_.ignoreQueryPrefix===!0,interpretNumericEntities:typeof _.interpretNumericEntities=="boolean"?_.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof _.parameterLimit=="number"?_.parameterLimit:r.parameterLimit,parseArrays:_.parseArrays!==!1,plainObjects:typeof _.plainObjects=="boolean"?_.plainObjects:r.plainObjects,strictDepth:typeof _.strictDepth=="boolean"?!!_.strictDepth:r.strictDepth,strictNullHandling:typeof _.strictNullHandling=="boolean"?_.strictNullHandling:r.strictNullHandling,throwOnLimitExceeded:typeof _.throwOnLimitExceeded=="boolean"?_.throwOnLimitExceeded:!1}};return Ay=function(w,_){var S=x(_);if(w===""||w===null||typeof w>"u")return S.plainObjects?{__proto__:null}:{};for(var R=typeof w=="string"?h(w,S):w,k=S.plainObjects?{__proto__:null}:{},O=Object.keys(R),P=0;P<O.length;++P){var z=O[P],H=m(z,R[z],S,typeof w=="string");k=n.merge(k,H,S)}return S.allowSparse===!0?k:n.compact(k)},Ay}var Ry,PC;function GU(){if(PC)return Ry;PC=1;var n=WU(),e=UU(),t=c2();return Ry={formats:t,parse:e,stringify:n},Ry}var YU=GU();const VU=L1(YU),pm={StoredContexts:{},defaultHandler:()=>{}},o5={Init:()=>{},Create:n=>{const e=n.method+n.url;return pm.StoredContexts[e]=n,ZU(n)},FetchBaseUrl:()=>window.location.href,useDefaultHandler:n=>{pm.defaultHandler=n}};function ZU(n){const e=`[${n.method}] ${n.url}`;return{Call:async r=>{let{url:i,method:o,stream:l,paramType:a}=n;const{po:h,onStream:g,onStreamEnd:m,noDefaultHandle:x=[]}=r??{};(a==="query"||o==="GET")&&h!==void 0&&(i+="?"+VU.stringify(h,{arrayFormat:"comma"}));const w={method:o,headers:{Accept:"application/json;charset=UTF-8","X-Requested-With":"XMLHttpRequest","Cache-Control":"no-cache",Pragma:"no-cache",crossDomain:"true"}};if(a==="form"){const R=new FormData;if(h!==void 0)for(const k in h){const O=h[k];R.append(k,O)}w.body=R}else(a==="body"||a===void 0&&n.method!=="GET")&&(w.body=JSON.stringify(h),w.headers["Content-Type"]="application/json;charset=UTF-8");let _={errorCode:0,message:""};const S=Date.now();i=o5.FetchBaseUrl()+i;try{let R=await fetch(i,w);if(R.ok===!1)return _.errorCode=R.status,_.message=R.statusText,_;{const k=new TextDecoder("utf-8");if(l){if(R.body){let O=R.body.getReader(),P="";for(;;){const z=await O.read();if(z.done)break;const H=k.decode(z.value).trim();P+=H;let G=null;try{const N=H.split("\0");let J=N[N.length-1];for(let Y=N.length-2;Y>=0;Y--)if(N[Y].trim().length!==0){J=N[Y];break}G=await JSON.parse(J)}catch{try{const J=P.split("\0");let Y=J[J.length-1];for(let K=J.length-2;K>=0;K--)if(J[K].trim().length!==0){Y=J[K];break}G=await JSON.parse(Y)}catch{}}if(G!=null&&(Object.keys(G).includes("err_code")?_.errorCode=G.err_code:(_.errorCode=0,_.data=G,P="",z.done?m==null||m(_.data):g==null||g(_.data))),z.done)break}}}else if(R.body){const P=await R.body.getReader().read(),z=k.decode(P.value);if(z==="null")return _;{let H=await JSON.parse(z.replaceAll("\0",""));Object.keys(H).includes("err_code")?(_.errorCode=H.err_code,_.message=H.err_msg):_.data=H}}}}catch(R){console.warn(R),_.errorCode=-1,_.message=R.message}return console.debug(`${e} ${Date.now()-S}ms`),x!==!0&&await pm.defaultHandler(_,x),_}}}exports.ABase=zi;exports.ABaseStyleKeys=r3;exports.AButton=Ic;exports.AButtonStyleKeys=o3;exports.AButtonTypes=lA;exports.ACheckBox=w1;exports.ACheckBoxStyleKeys=c3;exports.AChip=wm;exports.AChipKeys=I3;exports.AChips=m6;exports.AClock=D6;exports.AColFrame=O3;exports.ADatePicker=Em;exports.ADatePickerStyleKeys=x3;exports.ADatePickerTypes=f8;exports.ADateRangePicker=_m;exports.ADateRangePickerStyleKeys=w3;exports.ADialog=x8;exports.ADialogStyleKeys=u3;exports.ADialogTypes=m8;exports.ADivideFrame=D3;exports.AEditor=Pz;exports.AEditorStyleKeys=a3;exports.AFileBox=M8;exports.AFileBoxStyleKeys=v3;exports.AFileUploader=l9;exports.AFileUploaderStyleKeys=b3;exports.AFloatMenu=B3;exports.AFloatMenuKeys=E3;exports.AFrameStyleKeys=S3;exports.AGrow=zg;exports.AIcon=fo;exports.AIconButton=ba;exports.AIconButtonStyleKeys=C3;exports.AIconButtonTypes=sA;exports.AIconHOC=hT;exports.AIcons=ym;exports.AInput=sg;exports.AInputStyleKeys=l3;exports.AInputTypes=Q6;exports.AListView=b9;exports.AListViewStyleKeys=y3;exports.ALoadingBorder=Am;exports.ALoadingBorderKeys=T3;exports.AMultiSelect=Y9;exports.AMultiSelectStyleKeys=h3;exports.ANumInput=h9;exports.AOverflowFrame=nd;exports.AProgressBar=YC;exports.ARadioSelect=I9;exports.ARadioSelectKeys=R3;exports.ARowFrame=Ml;exports.ASelect=Td;exports.ASelectStyleKeys=f3;exports.ASelectTypes=hR;exports.ASpace=cs;exports.AStepper=oI;exports.AStepperStyleKeys=m3;exports.ASwitch=QC;exports.ASwitchFrame=P3;exports.ASwitchStyleKeys=g3;exports.ATab=H3;exports.ATabStyleKeys=p3;exports.ATabTypes=yI;exports.ATable=Mk;exports.ATableStyleKeys=_3;exports.AText=V3;exports.ATextArea=Yk;exports.ATextAreaStyleKeys=s3;exports.ATextAreaTypes=Gk;exports.AThemeButton=OA;exports.AThemes=pp;exports.ATooltip=JC;exports.ATooltipStyleKeys=i3;exports.ATree=sU;exports.ATreeStyleKeys=d3;exports.AWrap=lg;exports.AWrapKeys=A3;exports.AWrapPropsExtract=Bg;exports.AWrapTypes=dA;exports.ApiContext=o5;exports.BodyStyleKeys=n3;exports.CreateADC=T8;exports.DefaultOptionRenderer=z3;exports.EDir12=O1;exports.EDir4=ic;exports.FileSizeTrans=Mg;exports.Icons=_v;exports.IsCursorPointer=HC;exports.IsFixedShape=zC;exports.IsInteractive=WC;exports.NoSelect=FC;exports.NoTransition=BC;exports.Resources=Or;exports.SetResources=AT;exports.alphanumericRegex=C6;exports.bound=gp;exports.cbF=Ur;exports.changeSemanticMode=xm;exports.componentStyleKeys=EA;exports.createEvent=Eg;exports.dateF=Un;exports.dbF=Th;exports.defaultPredicate=U3;exports.dlgF=A8;exports.emailIdRegex=E6;exports.emailRegex=S6;exports.fileF=Tg;exports.getFileKey=F3;exports.getMonthsOptions=Ap;exports.getYearsOptions=Sm;exports.hangulRegex=A6;exports.hexRegex=T6;exports.key=NC;exports.noHanguljamoRegex=I6;exports.noSpaceRegex=R6;exports.numF=G0;exports.objF=$n;exports.onlyAlphanumericRegex=_6;exports.paletteKeys=qC;exports.paletteModes=Sv;exports.passwordRegex=M6;exports.refinedDesignTokens=lc;exports.sF=dt;exports.semanticKeys=e3;exports.semanticModes=x1;exports.setDir12Style=mm;exports.setDir12StyleElem=XC;exports.specialCharRegex=k6;exports.strF=Cm;exports.tableF=_d;exports.textMeasurement=kg;exports.treeF=Qd;exports.useADialogCore=S8;exports.useADialogCores=_8;exports.useDB=M3;exports.useEvent=Y3;exports.useInit=W3;exports.useLayoutDB=L3;exports.useOffset=ZC;exports.useValues=Fo;exports.uuidRegex=L6;