ados-rcm 1.1.360 → 1.1.361
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 +1 -1
- package/dist/index.es.js +237 -237
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -344,7 +344,7 @@ Error generating stack: `+d.message+`
|
|
344
344
|
`,"user"),this.quill.setSelection(i+1,0),t.index=i+1}else{const l=this.quill.getLine(t.index)[0];l&&l.length()>1?(this.quill.insertText(t.index,`
|
345
345
|
|
346
346
|
`,"user"),t.index+=2):(this.quill.insertText(t.index,`
|
347
|
-
`,"user"),t.index+=1)}}findTableParent(e){let t=e;for(;t;){if(t.domNode&&t.domNode.tagName==="TABLE")return t;t=t.parent}return null}hidePicker(){this.removeTooltip(),this.picker&&(this.picker.remove(),this.picker=null),this.tableButton&&this.tableButton.classList.remove("ql-expanded")}}var Iu={},Wb;function IP(){if(Wb)return Iu;Wb=1;var r=Fs;if(process.env.NODE_ENV==="production")Iu.createRoot=r.createRoot,Iu.hydrateRoot=r.hydrateRoot;else{var e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Iu.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return r.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},Iu.hydrateRoot=function(t,n,i){e.usingClientEntryPoint=!0;try{return r.hydrateRoot(t,n,i)}finally{e.usingClientEntryPoint=!1}}}return Iu}var LP=IP();const Vb=il(LP);class MP{constructor(e,t){it(this,"DEFAULTS",{maxRowCount:-1});it(this,"quill");it(this,"options");it(this,"position",null);it(this,"table");it(this,"selectedCell",null);it(this,"menuRoot",null);it(this,"helperTextElement",null);it(this,"scrollTimeout",null);it(this,"SCROLL_DEBOUNCE_TIME",80);it(this,"lastSelectedCellRef",null);it(this,"boundDocClickHandler",this.hideMenu.bind(this));it(this,"boundEditorChangeHandler",this.editorChangeHandler.bind(this));it(this,"boundContextMenuHandler",this.contextMenuHandler.bind(this));it(this,"boundCopyHandler",this.copyHandler.bind(this));it(this,"boundScrollHandler",this.handleScroll.bind(this));it(this,"boundPasteHandler",this.pasteHandler.bind(this));it(this,"menuItems",[]);it(this,"positionCache",new Map);it(this,"POSITION_CACHE_LIFETIME",1e3);it(this,"reactRoot",null);if(this.quill=e,this.options={...this.DEFAULTS,...t},this.table=e.getModule("table"),!this.table){console.error('"table" module not found');return}this.initializeMenuItems(),this.overrideTableMethods(),this.initializeHelperText(),this.attachEventListeners()}initializeMenuItems(){this.menuItems=[{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnRight()},icon:Os.renderToString(v.jsx(Br,{icon:"AddColRight"})),title:hn.AEditor["Insert Column Right"]},{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnLeft()},icon:Os.renderToString(v.jsx(Br,{icon:"AddColLeft"})),title:hn.AEditor["Insert Column Left"]},{handler:()=>{this.table.insertRowAbove()},icon:Os.renderToString(v.jsx(Br,{icon:"AddRowAbove"})),title:hn.AEditor["Insert Row Top"]},{handler:()=>{this.table.insertRowBelow()},icon:Os.renderToString(v.jsx(Br,{icon:"AddRowBelow"})),title:hn.AEditor["Insert Row Bottom"]},{handler:()=>{this.table.deleteColumn()},icon:Os.renderToString(v.jsx(Br,{icon:"RemoveCol"})),title:hn.AEditor["Delete Column"]},{handler:()=>{this.table.deleteRow()},icon:Os.renderToString(v.jsx(Br,{icon:"RemoveRow"})),title:hn.AEditor["Delete Row"]},{handler:()=>{this.table.deleteTable()},icon:Os.renderToString(v.jsx(Br,{icon:"Trash"})),title:hn.AEditor["Delete Table"]}]}overrideTableMethods(){const e=this.table.insertTable;this.table.insertTable=(...n)=>{const i=e.apply(this.table,n),l=this.quill.getSelection();return l&&(this.quill.focus(),setTimeout(()=>this.detectButton(l),0)),i};const t=this.table.deleteTable;this.table.deleteTable=(...n)=>{const i=t.apply(this.table,n);return this.cleanupTableUI(),i}}initializeHelperText(){this.helperTextElement=document.createElement("div"),this.helperTextElement.className=Wn["ql-tableui-helper"];const e=document.createElement("span");e.className=Be.clsx("Caption1",Wn["ql-tableui-helper__text"],"NoSelect"),e.textContent=hn.AEditor["Right click to open properties"];const t=document.createElement("span");t.className=Wn["ql-tableui-helper__icon"],t.innerHTML=Os.renderToString(v.jsx(Br,{icon:"MoreHorizontal",size:"xs"})),t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.menuRoot?this.hideMenu():this.showMenu()}),this.helperTextElement.appendChild(e),this.helperTextElement.appendChild(t),this.helperTextElement.style.display="none",this.quill.container.appendChild(this.helperTextElement)}attachEventListeners(){this.quill.on("editor-change",this.boundEditorChangeHandler),this.quill.root.addEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.addEventListener("copy",this.boundCopyHandler),this.quill.root.addEventListener("paste",this.boundPasteHandler),window.addEventListener("scroll",this.boundScrollHandler,!0)}removeEventListeners(){this.quill.off("editor-change",this.boundEditorChangeHandler),this.quill.root.removeEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.removeEventListener("copy",this.boundCopyHandler),this.quill.root.removeEventListener("paste",this.boundPasteHandler),document.removeEventListener("click",this.boundDocClickHandler),window.removeEventListener("scroll",this.boundScrollHandler,!0)}editorChangeHandler(e,t,n,i){e==="selection-change"&&this.detectButton(t)}contextMenuHandler(e){return this.isTable()?(e.preventDefault(),this.showMenu(),!1):!0}copyHandler(e){if(!this.selectedCell||!e.clipboardData)return;e.preventDefault();const t=this.selectedCell.textContent||"";e.clipboardData.setData("text/plain",t)}isTable(e){return e=e||this.quill.getSelection(),e?!!(this.quill.getFormat(e.index).table&&!e.length):!1}getColCount(e){if(e=e||this.quill.getSelection(),!e)return 0;const[t]=this.table.getTable(e);return t?t.rows().reduce((n,i)=>Math.max(i.children.length,n),0):0}showMenu(){if(this.menuRoot){this.hideMenu();return}if(!this.selectedCell)return;this.menuRoot||(this.menuRoot=document.createElement("div"),document.body.appendChild(this.menuRoot));const e=this.getBoundingRectWithCache(this.selectedCell),t=window.innerWidth,n=window.innerHeight,i=I.memo(({item:u,index:h})=>v.jsxs("div",{className:Wn["ql-tableui-options__item"],onClick:this.createItemClickHandler(u),children:[v.jsx("span",{className:Wn["ql-tableui-options__item-icon"],dangerouslySetInnerHTML:{__html:u.icon}}),v.jsx("span",{className:Wn["ql-tableui-options__item-text"],children:u.title})]},h)),l=()=>v.jsx("div",{className:Wn["ql-tableui-options"],style:{position:"fixed",visibility:"hidden",zIndex:1e4},children:this.menuItems.map((u,h)=>v.jsx(i,{item:u,index:h},h))});try{Vb.createRoot?(this.reactRoot=Vb.createRoot(this.menuRoot),this.reactRoot.render(v.jsx(l,{}))):Fs.render(v.jsx(l,{}),this.menuRoot)}catch{Fs.render(v.jsx(l,{}),this.menuRoot)}document.addEventListener("click",this.boundDocClickHandler),requestAnimationFrame(()=>{if(!this.menuRoot)return;const u=this.menuRoot.firstElementChild;if(u){const h=u.getBoundingClientRect();let g=e.bottom+window.scrollY,m=e.left+window.scrollX;m+h.width>t&&(m=e.right-h.width+window.scrollX),g+h.height>n+window.scrollY&&(g=e.top-h.height+window.scrollY),u.style.top=`${g}px`,u.style.left=`${m}px`,u.style.visibility="visible"}})}hideMenu(){this.menuRoot&&(document.removeEventListener("click",this.boundDocClickHandler),this.reactRoot?(this.reactRoot.unmount(),this.reactRoot=null):Fs.unmountComponentAtNode(this.menuRoot),this.menuRoot.remove(),this.menuRoot=null)}detectButton(e){if(e)if(this.isTable(e)){const[t,n]=this.quill.getLine(e.index);if(!t||!t.domNode)return;const i=t.domNode,l=`${i.tagName}-${i.offsetLeft}-${i.offsetTop}`;this.selectedCell===i||this.lastSelectedCellRef===l||(this.clearAllTableCellOutlines(),i.style.outline="2px solid var(--acent-brand)",i.style.outlineOffset="-1px",this.selectedCell=i,this.lastSelectedCellRef=l),this.showHelperText();const h=this.quill.container.getBoundingClientRect(),g=i.getBoundingClientRect(),m={bottom:g.bottom-h.top,height:g.height,left:g.left-h.left,right:g.right-h.left,top:g.top-h.top,width:g.width,x:g.x,y:g.y,toJSON:()=>JSON.stringify(m)};this.position&&(this.position.top!==m.top||this.position.left!==m.left)&&this.hideMenu(),this.position=m}else this.cleanupTableUI()}clearAllTableCellOutlines(){this.selectedCell&&(this.selectedCell.style.removeProperty("outline"),this.selectedCell.style.removeProperty("outline-offset"),this.selectedCell=null),this.quill.root.querySelectorAll("td, th").forEach(t=>{t instanceof HTMLElement&&(t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"))}),this.lastSelectedCellRef=null}showHelperText(){if(!this.selectedCell||!this.helperTextElement)return;const e=this.quill.getSelection();if(!e)return;const[t]=this.table.getTable(e);if(!t||!t.domNode)return;const i=t.domNode.getBoundingClientRect(),l=this.quill.container.getBoundingClientRect();if(!(i.bottom<l.top+5||i.top>l.bottom-5)){let h=i.top-l.top-20;i.top<l.top&&(h=5),this.helperTextElement.style.display="block",this.helperTextElement.style.left=`${i.left-l.left}px`,this.helperTextElement.style.top=`${h}px`}else this.helperTextElement.style.display="none"}removeHelperText(){this.helperTextElement&&(this.helperTextElement.style.display="none")}handleScroll(){this.removeHelperText(),this.hideMenu(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{const e=this.quill.getSelection();e&&this.isTable(e)&&this.detectButton(e),this.scrollTimeout=null},this.SCROLL_DEBOUNCE_TIME)}destroy(){this.removeEventListeners(),this.cleanupTableUI(),this.helperTextElement&&this.helperTextElement.remove(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=null),this.positionCache.clear(),this.reactRoot=null,this.selectedCell=null,this.helperTextElement=null,this.position=null,this.options=this.DEFAULTS,this.menuRoot=null,this.table=null}createItemClickHandler(e){return t=>{t.preventDefault(),t.stopPropagation(),this.quill.focus(),e.handler(),this.hideMenu(),this.detectButton(this.quill.getSelection())}}getBoundingRectWithCache(e){const t=Date.now(),n=this.positionCache.get(e);if(n&&t-n.timestamp<this.POSITION_CACHE_LIFETIME)return n.rect;const i=e.getBoundingClientRect();return this.positionCache.set(e,{rect:i,timestamp:t}),i}pasteHandler(){this.clearAllTableCellOutlines(),setTimeout(()=>{const e=this.quill.getSelection();e&&this.detectButton(e)},0)}cleanupTableUI(){this.removeHelperText(),this.clearAllTableCellOutlines(),this.hideMenu(),this.lastSelectedCellRef=null}}const lS=[1,2,3,!1,4],cS=$e.import("ui/icons");cS.table=Os.renderToString(v.jsx(Br,{icon:"Table",strokeWidth:2.5}));cS.divider=Os.renderToString(v.jsx(Br,{icon:"Minus",strokeWidth:2.5}));const DP=$e.import("blots/block/embed");class rm extends DP{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}}it(rm,"blotName","divider"),it(rm,"tagName","hr");$e.register({"modules/imageCompress":ZD,"modules/resize":JD,"modules/tablePicker":RP,"modules/tableUI":MP,"formats/header":FP(lS),"formats/divider":rm},!0);const OP=["bold","italic","underline","strike","blockquote","table","size","header","color","indent","list","align","image","link","video","divider"],PP=[[{header:lS}],["bold","italic","underline","strike","blockquote","divider","table",{color:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],NP=r=>{const{onEnterPress:e,errorMessage:t,type:n="Primary",editorRef:i,useValue:l,useError:u,placeholder:h,tabIndex:g,autoFocus:m,editorProps:M,wrapProps:T,helperText:C,label:_,labelProps:S,wrapType:D,style:A,minHeight:b="100%",maxHeight:R,contentHeight:O,contentMaxHeight:H=1e3,toolbarSize:q="Med",readOnly:G,...Y}=r,ue=I.useMemo(()=>n==="ReadOnly"||G,[n,G]),te=I.useMemo(()=>O?20:0,[O]),[fe,N]=I.useState(q==="Med"?40:50),re=I.useMemo(()=>ue?0:fe,[ue,fe]),[K,ne]=I.useMemo(()=>[20,6],[]),ie=I.useMemo(()=>u?K+ne:0,[u,K,ne]),[ce,me]=I.useState(O),[ae,_e]=I.useState(!1),[ge,Se]=I.useState(!1),Le=I.useRef(null),Pe=I.useRef(0),Ve=I.useRef(0),Te=23,rt=I.useCallback(ve=>{if(!ae||!O)return;const We=ve.clientY-Ve.current,ot=Math.min(H,Math.max(O,Pe.current+We));me(ot)},[O,ae,H]),ht=I.useCallback(()=>{_e(!1),Se(!1),window.removeEventListener("mousemove",rt),window.removeEventListener("mouseup",ht)},[rt]),Ke=I.useCallback(ve=>{if(!ce)return;if(ve.detail===2){me(O);return}_e(!0),Se(!0),Pe.current=ce,Ve.current=ve.clientY;const We=pt=>{if(!O)return;const vt=pt.clientY-Ve.current,je=Math.min(H,Math.max(O,Pe.current+vt));me(je)},ot=()=>{_e(!1),Se(!1),window.removeEventListener("mousemove",We),window.removeEventListener("mouseup",ot)};window.addEventListener("mousemove",We),window.addEventListener("mouseup",ot)},[O,ce,H]),Ye=I.useMemo(()=>{if(O){if(ce)switch(n){case"ReadOnly":return ce;case"Raw":return ce+ie;default:return ce+re+ie}}else return},[O,ce,n,re,ie]),De=I.useMemo(()=>{if(!(!R||R<=re+ie))switch(n){case"ReadOnly":return R;case"Raw":return R-ie;default:return R-re-ie}},[n,re,ie,R]),ke=I.useMemo(()=>jP(t)?"Error":n,[t,n]),[Ee,Ne]=pn(l,""),[Re,Xe]=pn(u,!1),[ut,Ct]=I.useState(()=>{if(!Ee)return new $t;try{const ve=document.createElement("div");return ve.innerHTML=Ee,new $e(ve,{readOnly:!0}).getContents()}catch(ve){return console.warn("Error parsing HTML content:",ve),new $t}}),xt=I.useMemo(()=>Math.floor(5e4*.68234)*3,[]),mt=I.useCallback(ve=>ve.ops?ve.ops.reduce((We,ot)=>{if(typeof ot.insert=="string"){const pt=ot.insert.replace(/\n/g,"");return We+pt.split("").reduce((vt,je)=>vt+(je.charCodeAt(0)<=127?1:3),0)}return typeof ot.insert=="object"&&ot.insert.image?We+ot.insert.image.length:We},0):0,[]),Lt=I.useMemo(()=>({clipboard:{matchVisual:!1},imageCompress:{quality:.5},...!ue&&{resize:{locale:{altTip:hn.AEditor["Image size adjust"],center:hn.AEditor.Center,floatLeft:hn.AEditor.floatLeft,floatRight:hn.AEditor.floatRight,inputTip:hn.AEditor["Input on mouse down"],restore:hn.AEditor.Restore}},table:!0,tablePicker:!0,tableUI:!0,toolbar:{container:PP,handlers:{divider:function(){const ve=this.quill,We=ve.getSelection(!0),ot=ve.getModule("table"),pt=ot&&(()=>{try{return!!ot.getTable(We)[0]}catch{return!1}})();pt||ve.insertText(We.index,`
|
347
|
+
`,"user"),t.index+=1)}}findTableParent(e){let t=e;for(;t;){if(t.domNode&&t.domNode.tagName==="TABLE")return t;t=t.parent}return null}hidePicker(){this.removeTooltip(),this.picker&&(this.picker.remove(),this.picker=null),this.tableButton&&this.tableButton.classList.remove("ql-expanded")}}var Iu={},Wb;function IP(){if(Wb)return Iu;Wb=1;var r=Fs;if(process.env.NODE_ENV==="production")Iu.createRoot=r.createRoot,Iu.hydrateRoot=r.hydrateRoot;else{var e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Iu.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return r.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},Iu.hydrateRoot=function(t,n,i){e.usingClientEntryPoint=!0;try{return r.hydrateRoot(t,n,i)}finally{e.usingClientEntryPoint=!1}}}return Iu}var LP=IP();const Vb=il(LP);class MP{constructor(e,t){it(this,"DEFAULTS",{maxRowCount:-1});it(this,"quill");it(this,"options");it(this,"position",null);it(this,"table");it(this,"selectedCell",null);it(this,"menuRoot",null);it(this,"helperTextElement",null);it(this,"scrollTimeout",null);it(this,"SCROLL_DEBOUNCE_TIME",80);it(this,"lastSelectedCellRef",null);it(this,"boundDocClickHandler",this.hideMenu.bind(this));it(this,"boundEditorChangeHandler",this.editorChangeHandler.bind(this));it(this,"boundContextMenuHandler",this.contextMenuHandler.bind(this));it(this,"boundCopyHandler",this.copyHandler.bind(this));it(this,"boundScrollHandler",this.handleScroll.bind(this));it(this,"boundPasteHandler",this.pasteHandler.bind(this));it(this,"menuItems",[]);it(this,"positionCache",new Map);it(this,"POSITION_CACHE_LIFETIME",1e3);it(this,"reactRoot",null);if(this.quill=e,this.options={...this.DEFAULTS,...t},this.table=e.getModule("table"),!this.table){console.error('"table" module not found');return}this.initializeMenuItems(),this.overrideTableMethods(),this.initializeHelperText(),this.attachEventListeners()}initializeMenuItems(){this.menuItems=[{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnRight()},icon:Os.renderToString(v.jsx(Br,{icon:"AddColRight"})),title:hn.AEditor["Insert Column Right"]},{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnLeft()},icon:Os.renderToString(v.jsx(Br,{icon:"AddColLeft"})),title:hn.AEditor["Insert Column Left"]},{handler:()=>{this.table.insertRowAbove()},icon:Os.renderToString(v.jsx(Br,{icon:"AddRowAbove"})),title:hn.AEditor["Insert Row Top"]},{handler:()=>{this.table.insertRowBelow()},icon:Os.renderToString(v.jsx(Br,{icon:"AddRowBelow"})),title:hn.AEditor["Insert Row Bottom"]},{handler:()=>{this.table.deleteColumn()},icon:Os.renderToString(v.jsx(Br,{icon:"RemoveCol"})),title:hn.AEditor["Delete Column"]},{handler:()=>{this.table.deleteRow()},icon:Os.renderToString(v.jsx(Br,{icon:"RemoveRow"})),title:hn.AEditor["Delete Row"]},{handler:()=>{this.table.deleteTable()},icon:Os.renderToString(v.jsx(Br,{icon:"Trash"})),title:hn.AEditor["Delete Table"]}]}overrideTableMethods(){const e=this.table.insertTable;this.table.insertTable=(...n)=>{const i=e.apply(this.table,n),l=this.quill.getSelection();return l&&(this.quill.focus(),setTimeout(()=>this.detectButton(l),0)),i};const t=this.table.deleteTable;this.table.deleteTable=(...n)=>{const i=t.apply(this.table,n);return this.cleanupTableUI(),i}}initializeHelperText(){this.helperTextElement=document.createElement("div"),this.helperTextElement.className=Wn["ql-tableui-helper"];const e=document.createElement("span");e.className=Be.clsx("Caption1",Wn["ql-tableui-helper__text"],"NoSelect"),e.textContent=hn.AEditor["Right click to open properties"];const t=document.createElement("span");t.className=Wn["ql-tableui-helper__icon"],t.innerHTML=Os.renderToString(v.jsx(Br,{icon:"MoreHorizontal",size:"xs"})),t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.menuRoot?this.hideMenu():this.showMenu()}),this.helperTextElement.appendChild(e),this.helperTextElement.appendChild(t),this.helperTextElement.style.display="none",this.quill.container.appendChild(this.helperTextElement)}attachEventListeners(){this.quill.on("editor-change",this.boundEditorChangeHandler),this.quill.root.addEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.addEventListener("copy",this.boundCopyHandler),this.quill.root.addEventListener("paste",this.boundPasteHandler),window.addEventListener("scroll",this.boundScrollHandler,!0)}removeEventListeners(){this.quill.off("editor-change",this.boundEditorChangeHandler),this.quill.root.removeEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.removeEventListener("copy",this.boundCopyHandler),this.quill.root.removeEventListener("paste",this.boundPasteHandler),document.removeEventListener("click",this.boundDocClickHandler),window.removeEventListener("scroll",this.boundScrollHandler,!0)}editorChangeHandler(e,t,n,i){e==="selection-change"&&this.detectButton(t)}contextMenuHandler(e){return this.isTable()?(e.preventDefault(),this.showMenu(),!1):!0}copyHandler(e){if(!this.selectedCell||!e.clipboardData)return;e.preventDefault();const t=this.selectedCell.textContent||"";e.clipboardData.setData("text/plain",t)}isTable(e){return e=e||this.quill.getSelection(),e?!!(this.quill.getFormat(e.index).table&&!e.length):!1}getColCount(e){if(e=e||this.quill.getSelection(),!e)return 0;const[t]=this.table.getTable(e);return t?t.rows().reduce((n,i)=>Math.max(i.children.length,n),0):0}showMenu(){if(this.menuRoot){this.hideMenu();return}if(!this.selectedCell)return;this.menuRoot||(this.menuRoot=document.createElement("div"),document.body.appendChild(this.menuRoot));const e=this.getBoundingRectWithCache(this.selectedCell),t=window.innerWidth,n=window.innerHeight,i=I.memo(({item:u,index:h})=>v.jsxs("div",{className:Wn["ql-tableui-options__item"],onClick:this.createItemClickHandler(u),children:[v.jsx("span",{className:Wn["ql-tableui-options__item-icon"],dangerouslySetInnerHTML:{__html:u.icon}}),v.jsx("span",{className:Wn["ql-tableui-options__item-text"],children:u.title})]},h)),l=()=>v.jsx("div",{className:Wn["ql-tableui-options"],style:{position:"fixed",visibility:"hidden",zIndex:1e4},children:this.menuItems.map((u,h)=>v.jsx(i,{item:u,index:h},h))});try{Vb.createRoot?(this.reactRoot=Vb.createRoot(this.menuRoot),this.reactRoot.render(v.jsx(l,{}))):Fs.render(v.jsx(l,{}),this.menuRoot)}catch{Fs.render(v.jsx(l,{}),this.menuRoot)}document.addEventListener("click",this.boundDocClickHandler),requestAnimationFrame(()=>{if(!this.menuRoot)return;const u=this.menuRoot.firstElementChild;if(u){const h=u.getBoundingClientRect();let g=e.bottom+window.scrollY,m=e.left+window.scrollX;m+h.width>t&&(m=e.right-h.width+window.scrollX),g+h.height>n+window.scrollY&&(g=e.top-h.height+window.scrollY),u.style.top=`${g}px`,u.style.left=`${m}px`,u.style.visibility="visible"}})}hideMenu(){this.menuRoot&&(document.removeEventListener("click",this.boundDocClickHandler),this.reactRoot?(this.reactRoot.unmount(),this.reactRoot=null):Fs.unmountComponentAtNode(this.menuRoot),this.menuRoot.remove(),this.menuRoot=null)}detectButton(e){if(e)if(this.isTable(e)){const[t,n]=this.quill.getLine(e.index);if(!t||!t.domNode)return;const i=t.domNode,l=`${i.tagName}-${i.offsetLeft}-${i.offsetTop}`;this.selectedCell===i||this.lastSelectedCellRef===l||(this.clearAllTableCellOutlines(),i.style.outline="2px solid var(--acent-brand)",i.style.outlineOffset="-1px",this.selectedCell=i,this.lastSelectedCellRef=l),this.showHelperText();const h=this.quill.container.getBoundingClientRect(),g=i.getBoundingClientRect(),m={bottom:g.bottom-h.top,height:g.height,left:g.left-h.left,right:g.right-h.left,top:g.top-h.top,width:g.width,x:g.x,y:g.y,toJSON:()=>JSON.stringify(m)};this.position&&(this.position.top!==m.top||this.position.left!==m.left)&&this.hideMenu(),this.position=m}else this.cleanupTableUI()}clearAllTableCellOutlines(){this.selectedCell&&(this.selectedCell.style.removeProperty("outline"),this.selectedCell.style.removeProperty("outline-offset"),this.selectedCell=null),this.quill.root.querySelectorAll("td, th").forEach(t=>{t instanceof HTMLElement&&(t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"))}),this.lastSelectedCellRef=null}showHelperText(){if(!this.selectedCell||!this.helperTextElement)return;const e=this.quill.getSelection();if(!e)return;const[t]=this.table.getTable(e);if(!t||!t.domNode)return;const i=t.domNode.getBoundingClientRect(),l=this.quill.container.getBoundingClientRect();if(!(i.bottom<l.top+5||i.top>l.bottom-5)){let h=i.top-l.top-20;i.top<l.top&&(h=5),this.helperTextElement.style.display="block",this.helperTextElement.style.left=`${i.left-l.left}px`,this.helperTextElement.style.top=`${h}px`}else this.helperTextElement.style.display="none"}removeHelperText(){this.helperTextElement&&(this.helperTextElement.style.display="none")}handleScroll(){this.removeHelperText(),this.hideMenu(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{const e=this.quill.getSelection();e&&this.isTable(e)&&this.detectButton(e),this.scrollTimeout=null},this.SCROLL_DEBOUNCE_TIME)}destroy(){this.removeEventListeners(),this.cleanupTableUI(),this.helperTextElement&&this.helperTextElement.remove(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=null),this.positionCache.clear(),this.reactRoot=null,this.selectedCell=null,this.helperTextElement=null,this.position=null,this.options=this.DEFAULTS,this.menuRoot=null,this.table=null}createItemClickHandler(e){return t=>{t.preventDefault(),t.stopPropagation(),this.quill.focus(),e.handler(),this.hideMenu(),this.detectButton(this.quill.getSelection())}}getBoundingRectWithCache(e){const t=Date.now(),n=this.positionCache.get(e);if(n&&t-n.timestamp<this.POSITION_CACHE_LIFETIME)return n.rect;const i=e.getBoundingClientRect();return this.positionCache.set(e,{rect:i,timestamp:t}),i}pasteHandler(){this.clearAllTableCellOutlines(),setTimeout(()=>{const e=this.quill.getSelection();e&&this.detectButton(e)},0)}cleanupTableUI(){this.removeHelperText(),this.clearAllTableCellOutlines(),this.hideMenu(),this.lastSelectedCellRef=null}}const lS=[1,2,3,!1,4],cS=$e.import("ui/icons");cS.table=Os.renderToString(v.jsx(Br,{icon:"Table",strokeWidth:2.5}));cS.divider=Os.renderToString(v.jsx(Br,{icon:"Minus",strokeWidth:2.5}));const DP=$e.import("blots/block/embed");class rm extends DP{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}}it(rm,"blotName","divider"),it(rm,"tagName","hr");$e.register({"modules/imageCompress":ZD,"modules/resize":JD,"modules/tablePicker":RP,"modules/tableUI":MP,"formats/header":FP(lS),"formats/divider":rm},!0);const OP=["bold","italic","underline","strike","blockquote","table","size","header","color","indent","list","align","image","link","video","divider"],PP=[[{header:lS}],["bold","italic","underline","strike","blockquote","divider","table",{color:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],NP=r=>{const{onEnterPress:e,errorMessage:t,type:n="Primary",editorRef:i,useValue:l,useError:u,placeholder:h,tabIndex:g,autoFocus:m,editorProps:M,wrapProps:T,helperText:C,label:_,labelProps:S,wrapType:D,style:A,minHeight:b="100%",maxHeight:R,contentHeight:O,contentMaxHeight:H=1e3,toolbarSize:q="Med",readOnly:G,...Y}=r,ue=I.useMemo(()=>n==="ReadOnly"||G,[n,G]),te=I.useMemo(()=>O?20:0,[O]),[fe,N]=I.useState(q==="Med"?40:50),re=I.useMemo(()=>ue?0:fe,[ue,fe]),[K,ne]=I.useMemo(()=>[20,6],[]),ie=I.useMemo(()=>u?K+ne:0,[u,K,ne]),[ce,me]=I.useState(O),[ae,_e]=I.useState(!1),[ge,Se]=I.useState(!1),Le=I.useRef(null),Pe=I.useRef(0),Ve=I.useRef(0),Te=I.useMemo(()=>_?23:0,[_]),rt=I.useCallback(ve=>{if(!ae||!O)return;const We=ve.clientY-Ve.current,ot=Math.min(H,Math.max(O,Pe.current+We));me(ot)},[O,ae,H]),ht=I.useCallback(()=>{_e(!1),Se(!1),window.removeEventListener("mousemove",rt),window.removeEventListener("mouseup",ht)},[rt]),Ke=I.useCallback(ve=>{if(!ce)return;if(ve.detail===2){me(O);return}_e(!0),Se(!0),Pe.current=ce,Ve.current=ve.clientY;const We=pt=>{if(!O)return;const vt=pt.clientY-Ve.current,je=Math.min(H,Math.max(O,Pe.current+vt));me(je)},ot=()=>{_e(!1),Se(!1),window.removeEventListener("mousemove",We),window.removeEventListener("mouseup",ot)};window.addEventListener("mousemove",We),window.addEventListener("mouseup",ot)},[O,ce,H]),Ye=I.useMemo(()=>{if(O){if(ce)switch(n){case"ReadOnly":return ce;case"Raw":return ce+ie;default:return ce+re+ie}}else return},[O,ce,n,re,ie]),De=I.useMemo(()=>{if(!(!R||R<=re+ie))switch(n){case"ReadOnly":return R;case"Raw":return R-ie;default:return R-re-ie}},[n,re,ie,R]),ke=I.useMemo(()=>jP(t)?"Error":n,[t,n]),[Ee,Ne]=pn(l,""),[Re,Xe]=pn(u,!1),[ut,Ct]=I.useState(()=>{if(!Ee)return new $t;try{const ve=document.createElement("div");return ve.innerHTML=Ee,new $e(ve,{readOnly:!0}).getContents()}catch(ve){return console.warn("Error parsing HTML content:",ve),new $t}}),xt=I.useMemo(()=>Math.floor(5e4*.68234)*3,[]),mt=I.useCallback(ve=>ve.ops?ve.ops.reduce((We,ot)=>{if(typeof ot.insert=="string"){const pt=ot.insert.replace(/\n/g,"");return We+pt.split("").reduce((vt,je)=>vt+(je.charCodeAt(0)<=127?1:3),0)}return typeof ot.insert=="object"&&ot.insert.image?We+ot.insert.image.length:We},0):0,[]),Lt=I.useMemo(()=>({clipboard:{matchVisual:!1},imageCompress:{quality:.5},...!ue&&{resize:{locale:{altTip:hn.AEditor["Image size adjust"],center:hn.AEditor.Center,floatLeft:hn.AEditor.floatLeft,floatRight:hn.AEditor.floatRight,inputTip:hn.AEditor["Input on mouse down"],restore:hn.AEditor.Restore}},table:!0,tablePicker:!0,tableUI:!0,toolbar:{container:PP,handlers:{divider:function(){const ve=this.quill,We=ve.getSelection(!0),ot=ve.getModule("table"),pt=ot&&(()=>{try{return!!ot.getTable(We)[0]}catch{return!1}})();pt||ve.insertText(We.index,`
|
348
348
|
`,$e.sources.USER);const vt=pt?0:1;ve.insertEmbed(We.index+vt,"divider",!0,$e.sources.USER),ve.setSelection(We.index+vt+1,0,$e.sources.SILENT)}}}}}),[ue]),At=I.useCallback((ve,We,ot,pt)=>{var Mt;if(!Ne||ot!=="user")return;const vt=pt.getContents(),je=pt.getHTML(),yt=((Mt=vt.ops)==null?void 0:Mt.length)===1&&vt.ops[0].insert===`
|
349
349
|
`;if(Xe){const cr=mt(vt);Xe(cr>xt)}Ne(yt?"":je),Ct(vt)},[mt,xt,Xe,Ne]),lt=I.useMemo(()=>q==="Med"?8:12.5,[q]),ct=I.useCallback(ve=>{if(!ve)return;const We=ve.getEditor();if(!We)return;const ot=[],pt={input:er=>{const he=er.target;he.value=he.value.replace(/[^0-9]/g,"");const ee=parseInt(he.value);ee>100&&(he.value="100"),ee<1&&(he.value="1")},keyDown:er=>{if(er.key!=="Delete"&&er.key!=="Backspace")return;const he=document.querySelector("#image-resizer");if(!he)return;const ee=he.getBoundingClientRect(),qe=document.querySelectorAll(".ql-editor img"),Qe=Array.from(qe).find(Et=>{const gt=Et.getBoundingClientRect();return Math.abs(gt.left-ee.left)<5&&Math.abs(gt.top-ee.top)<5});if(Qe){he.style.display="none";const Et=$e.find(Qe),gt=We.getIndex(Et);Et.remove(),We.setSelection(gt,0,$e.sources.USER)}},formatExpand:er=>{const he=We.getFormat();er.forEach(ee=>{if(he[ee]){const qe=he[ee],Qe=`.ql-${ee}`,Et=document.querySelector(`${Qe} .ql-picker-label`),gt=document.querySelectorAll(`${Qe} .ql-picker-item`),wt=Array.from(gt).find(Gt=>Gt.getAttribute("data-value")===qe);wt&&(wt.classList.add("ql-selected"),Et==null||Et.classList.add("ql-active"))}})},resizeToolbar:er=>{requestAnimationFrame(()=>{for(const he of er)N(he.contentRect.height+lt*2)})}},vt=We.root,je=document.querySelector(".ql-snow.ql-toolbar"),yt=document.querySelector("#image-resizer .input-wrapper input"),Mt=new ResizeObserver(pt.resizeToolbar),cr=["header","color"],Lr=[];return vt==null||vt.addEventListener("keydown",pt.keyDown),yt==null||yt.addEventListener("input",pt.input),Mt.observe(je),cr.forEach(er=>{const he=document.querySelector(`.ql-${er} .ql-picker-label`);he&&(he.addEventListener("click",()=>pt.formatExpand(cr)),Lr.push(he))}),ot.push(()=>{vt==null||vt.removeEventListener("keydown",pt.keyDown),yt==null||yt.removeEventListener("input",pt.input),Mt.disconnect(),Lr.forEach(er=>er.removeEventListener("click",()=>pt.formatExpand(cr)))}),()=>ot.forEach(er=>er())},[lt]),St=I.useCallback(ve=>{i&&(typeof i=="function"?i(ve):i.current=ve),ve&&ct(ve)},[i,ct]);return v.jsx(Uc,{helperText:C,label:_,wrapType:D,labelProps:{...S,style:{minHeight:20}},errorMessage:t,wrapProps:{...T,style:{...T==null?void 0:T.style,minHeight:"fit-content",height:`calc(100% - ${Te}px)`}},children:v.jsxs(Ur,{...Y,className:Be.clsx(Y.className,Wn.AEditorContainer),style:{...A,height:Ye,minHeight:b},children:[v.jsx(bh,{...M,ref:St,className:Be.clsx(M==null?void 0:M.className,Wn.AEditor,Wn[ke]),formats:OP,modules:Lt,placeholder:h,readOnly:ue,theme:"snow",value:ut,style:{maxHeight:De?De+re:void 0,"--icon-size":`${q==="Med"?18:24}px`,"--toolbar-padding":`${lt}px`,"--content-height":ce?`${ce-te}px`:"100%","--max-height":De?`${De}px`:void 0,"--default-text":`'${hn.AEditor.Default}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(Os.renderToString(v.jsx(Br,{icon:"EditorArrow"})))}`},onChange:At}),O&&v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:Le,className:Wn.Resizer,style:{height:te,bottom:u&&!ue?ie:0},onMouseDown:Ke}),ge&&v.jsx("div",{className:Be.clsx(Wn.Indicator,"NoSelect","Caption"),style:{bottom:u&&!ue?ie+2:2},children:`${Math.round(ce)}px`})]}),u&&!ue&&v.jsx("div",{className:Be.clsx(Wn.LimitContainer,"NoSelect"),style:{marginTop:ne,minHeight:K},children:v.jsxs(Xl,{className:Wn.Limit,children:["(",v.jsx("span",{className:Re?Wn.Error:void 0,children:nm(mt(ut))})," / ",nm(xt),")"]})})]})})};function jP(r){return Array.isArray(r)?r.filter(Boolean).length>0:!!r}function FP(r){const e=$e.import("formats/header");return e.whitelist=r,e}const nm=r=>{if(!r)return"0 bytes";const e=["bytes","KB","MB","GB","TB","PB","EB","ZB","YB","RB","QB"];let t=0;for(;r>=1024&&t<e.length-1;)r/=1024,t++;return`${t===0?Math.floor(r):r.toFixed(1)} ${e[t]}`};function eh(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(e(t))return t;if(!t.children||t.children.length<1)continue;const n=eh(t.children,e);if(n)return n}}function sd(r,e){Array.isArray(r)||(r=[r]);for(const t of r)e(t),!(!t.children||t.children.length<1)&&sd(t.children,e)}function uS(r,e){Array.isArray(r)||(r=[r]);const t=[];return sd(r,(n,i)=>t.push(e(n,i))),t}function fS(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(!e(t))return!1;if(!(!t.children||t.children.length<1)&&!fS(t.children,e))return!1}return!0}function BP(r,e){Array.isArray(r)||(r=[r]);const t=[];return sd(r,(n,i)=>{e(n,i)&&t.push(n)}),t}function qP(r){Array.isArray(r)||(r=[r]);let e=0;return sd(r,()=>e++),e}function HP(r,e,t,n){if(n(e,t))return null;Array.isArray(r)||(r=[r]);const i=eh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,e))}),l=eh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,t))});if(i===void 0&&l===void 0){const u=r.findIndex(g=>n(g,e)),h=r.findIndex(g=>n(g,t));return r.splice(u,1),r.splice(h,0,e),[...r]}else if(i!==void 0&&l!==void 0&&n(i,l)&&i.children){const u=i.children.findIndex(g=>n(g,e)),h=i.children.findIndex(g=>n(g,t));return u===void 0||h===void 0?null:(i.children.splice(u,1),i.children.splice(h,0,e),i.children=[...i.children],[...r])}return null}function zP(r,e,t){const n=[],i=[...e];for(;i.length>0;){const l=i.shift();if(l&&!n.find(u=>t(u,l))&&(n.push(l),!(!l.children||l.children.length<1)))for(const u of l.children)i.push(u)}return n}function $P(r,e,t){Array.isArray(r)||(r=[r]);const n=uS(r,u=>u),i=[],l=[...e];for(;l.length>0;){const u=l.shift();if(!u||i.find(g=>t(g,u)))continue;i.push(u);const h=n.find(g=>{var m;return(m=g.children)==null?void 0:m.some(M=>t(M,u))});h&&l.push(h)}return i}const Qa={find:eh,forEach:sd,map:uS,every:fS,filter:BP,length:qP,replace:HP,descendants:zP,ancestors:$P},UP="_AWrap_f5le3_1",WP="_AContainer_f5le3_10",VP="_ATree_f5le3_18",GP="_ATreeBody_f5le3_30",ZP="_CoverBorder_f5le3_36",YP="_InsertBorder_f5le3_45",KP="_ATreeHeader_f5le3_76",XP="_ATreeBodyHeader_f5le3_82",JP="_ATreeBodyHeaderResources_f5le3_92",QP="_ATreeItem_f5le3_98",eN="_IsSelectUsed_f5le3_114",tN="_IsSelected_f5le3_117",rN="_IsSearchSelected_f5le3_122",nN="_IsHovered_f5le3_133",iN="_CheckBox_f5le3_137",oN="_Indents_f5le3_149",sN="_ExpandIcon_f5le3_156",aN="_Content_f5le3_168",lN="_RightSticky_f5le3_177",cN="_SearchInputWrap_f5le3_188",uN="_SearchInput_f5le3_188",fN="_RightAddon_f5le3_200",dN="_RightAddonIcon_f5le3_211",hN="_Loader_f5le3_218",fn={AWrap:UP,AContainer:WP,ATree:VP,ATreeBody:GP,CoverBorder:ZP,InsertBorder:YP,ATreeHeader:KP,ATreeBodyHeader:XP,ATreeBodyHeaderResources:JP,ATreeItem:QP,IsSelectUsed:eN,IsSelected:tN,IsSearchSelected:rN,IsHovered:nN,CheckBox:iN,Indents:oN,ExpandIcon:sN,Content:aN,RightSticky:lN,SearchInputWrap:cN,SearchInput:uN,RightAddon:fN,RightAddonIcon:dN,Loader:hN},pN=r=>{const{isEqual:e,item:t,selectDisabled:n,selectUnused:i,isParentDisabled:l,indents:u,extIndents:h,useExpand:g,useSelect:m,useSearch:M,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:S,icons:D,iconWidth:A,isSelectMulti:b,isDraggable:R,isParentCheckHovered:O,hoverdItem:H,onMouseOver:q,onMouseLeave:G,ContentRenderer:Y,TreeItemRenderer:ue,RightStickyAddon:te,resources:fe,containerRef:N,TreeItemStyle:re,TreeItemClassName:K,searchItemStyle:ne,searchItemClassName:ie,height:ce}=r,{children:me}=I.useMemo(()=>t,[t]),[ae,_e]=I.useMemo(()=>g,[g]),[ge,Se]=I.useMemo(()=>m,[m]),[Le,Pe]=I.useMemo(()=>M,[M]),Ve=I.useMemo(()=>i?i(t):!1,[i,t]),Te=I.useMemo(()=>!n||l?l:n(t),[n,l,t]),rt=I.useMemo(()=>ae.some(je=>e(je,t)),[ae,e,t]),ht=I.useMemo(()=>!me||me.length<1?"noChild":rt?"expanded":"collapsed",[me,rt]),Ke=I.useMemo(()=>{const je=D[ht];return am.includes(je)?v.jsx(Br,{style:{width:A,height:A},icon:je}):je},[D,A,ht]),Ye=I.useCallback(je=>{!_e||ht==="noChild"||(_e(rt?ae.filter(yt=>!e(yt,t)):[...ae,t]),je.stopPropagation())},[_e,ae,rt,t,e,ht]),De=I.useMemo(()=>ge.some(je=>e(je,t)),[ge,e,t]),ke=I.useCallback(()=>{!Se||Te||(Se(b?De?ge.filter(je=>!e(je,t)):[...ge,t]:[t]),Le&&Pe&&Le.items.some(je=>e(je,t))&&Pe({...Le,item:t}))},[b,Te,De,Le,Pe,Se,e,ge,t]),Ee=I.useMemo(()=>Le==null?void 0:Le.items.some(je=>e(je,t)),[Le,e,t]),Ne=I.useMemo(()=>Ee&&(Le==null?void 0:Le.item)&&e(Le.item,t),[Ee,Le,e,t]),Re=I.useRef(null);I.useEffect(()=>{setTimeout(()=>{if(Ne&&Re.current&&N.current){const{top:je,bottom:yt}=Re.current.getBoundingClientRect(),{top:Mt,bottom:cr}=N.current.getBoundingClientRect();(je<Mt||yt>cr)&&Re.current.scrollIntoView({behavior:"smooth",block:"center"})}},10)},[N,Ne]);const[Xe,ut]=I.useState(!1),Ct=I.useCallback(()=>!Te&&ut(!0),[Te]),xt=I.useCallback(()=>!Te&&ut(!1),[Te]),mt=I.useMemo(()=>Qa.map(t,je=>je).filter(je=>!(n!=null&&n(je))&&!(i!=null&&i(je))),[n,i,t]),Lt=I.useMemo(()=>!S||!b?!1:De&&mt.some(je=>ge.some(yt=>e(je,yt)))&&mt.some(je=>!ge.some(yt=>e(je,yt))),[S,b,De,mt,e,ge]),At=I.useMemo(()=>S?b?mt.every(je=>ge.some(yt=>e(je,yt))):ge.some(je=>e(je,t)):!1,[S,b,mt,t,e,ge]),lt=I.useCallback(()=>{if(!(!Se||Te))if(b)if(De){const je=ge.filter(yt=>!(i!=null&&i(yt))&&!(n!=null&&n(yt))&&mt.some(Mt=>e(Mt,yt)));je.length>0&&Se(ge.filter(yt=>!je.some(Mt=>e(yt,Mt))))}else{const je=mt.filter(yt=>!(i!=null&&i(yt))&&!(n!=null&&n(yt))&&!ge.some(Mt=>e(Mt,yt)));je.length>0&&Se([...ge,...je])}else Se([t])},[Te,n,i,b,Se,e,De,ge,mt,t]),ct=I.useCallback(je=>{Te||lt(),je.stopPropagation()},[Te,lt]),St=I.useMemo(()=>{if(!S||!b||Te)return"";if(De){const yt=ge.filter(Mt=>!(i!=null&&i(Mt))&&!(n!=null&&n(Mt))&&mt.some(cr=>e(cr,Mt)));if(yt.length>0)return fe["deselect n"](yt.length)}const je=mt.filter(yt=>!(i!=null&&i(yt))&&!(n!=null&&n(yt))&&!ge.some(Mt=>e(Mt,yt)));return fe["select n"](je.length)},[n,i,fe,Te,S,b,De,mt,e,ge]),ve=I.useMemo(()=>Er.getContent(te,r),[te,r]),We=I.useMemo(()=>Er.getContent(re,r),[r,re]),ot=I.useMemo(()=>Er.getContent(K,r),[r,K]),pt=I.useMemo(()=>Er.getContent(ie,r),[r,ie]),vt=I.useMemo(()=>Er.getContent(ne,r),[r,ne]);return v.jsxs(I.Fragment,{children:[v.jsxs(Ur,{className:Be.clsx(fn.ATreeItem,De&&fn.IsSelected,!Te&&(Xe||O)&&fn.IsHovered,Ee&&fn.IsSearched,Ne&&(pt||fn.IsSearchSelected),!Ve&&fn.IsSelectUsed,"NoSelect",ot),style:{...We,...Ne&&vt,"--ATreeItem_height":`${ce}px`},draggable:R,onDragStart:()=>T==null?void 0:T(t),onDragEnter:je=>C==null?void 0:C(je,t),onDragEnd:je=>_==null?void 0:_(je,t),onClick:ke,abaseRef:Re,isDisabled:Te,onMouseOver:je=>q==null?void 0:q(je,t),onMouseLeave:je=>G==null?void 0:G(je,t),children:[S&&v.jsx(Uu,{style:{visibility:Te||Ve?"hidden":"visible",zIndex:Te||Ve?0:2},className:fn.CheckBox,useCheck:[+At,lt],onClick:ct,isIndeterminate:Lt,onMouseOver:Ct,onMouseOut:xt,tooltip:St,isDisabled:Te}),v.jsx("div",{className:fn.Indents,style:{paddingLeft:S?0:r.icons.noChild?12:0},children:u.map((je,yt)=>{const Mt=yt===u.length-1;return v.jsx(I2,{value:je,map:{Collapsed:h?h({iconWidth:A}).collapsed:v.jsx(mN,{iconWidth:A}),Expanded:h?h({iconWidth:A,isLast:Mt}).expanded:v.jsx(gN,{iconWidth:A,isLast:Mt}),IsLast:h?h({iconWidth:A}).isLast:v.jsx(vN,{iconWidth:A})}},yt)})}),Ke&&v.jsx("div",{className:fn.ExpandIcon,style:{width:A,minWidth:A,maxWidth:A},onClick:Ye,children:Ke}),v.jsx("div",{className:Be.clsx(fn.Content,"NoSelect"),children:v.jsx(Y,{isEqual:e,item:t,indents:u,extIndents:h,useExpand:g,useSelect:m,useSearch:M,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:S,icons:D,iconWidth:A,isSelectMulti:b,isDraggable:R,isParentCheckHovered:b&&(Xe||O),hoverdItem:H,onMouseOver:q,onMouseLeave:G,ContentRenderer:Y,TreeItemRenderer:ue,RightStickyAddon:te,resources:fe,containerRef:N,TreeItemStyle:re,TreeItemClassName:K,searchItemClassName:pt,searchItemStyle:ne,height:ce})}),ve&&v.jsx("div",{className:fn.RightSticky,children:ve})]}),rt&&(me==null?void 0:me.map((je,yt)=>v.jsx(ue,{isEqual:e,item:je,selectDisabled:n,selectUnused:i,indents:[...u.map(Mt=>Mt==="IsLast"?"Collapsed":Mt),yt===me.length-1?"IsLast":"Expanded"],extIndents:h,ContentRenderer:Y,useExpand:g,useSelect:m,useSearch:M,onDragStart:T,onDragOver:C,onDragEnd:_,showCheckbox:S,icons:D,iconWidth:A,isSelectMulti:b,isDraggable:R,isParentCheckHovered:b&&(Xe||O),hoverdItem:H,onMouseOver:q,onMouseLeave:G,TreeItemRenderer:ue,RightStickyAddon:te,resources:fe,containerRef:N,TreeItemStyle:re,TreeItemClassName:K,searchItemClassName:pt,searchItemStyle:ne,height:ce},yt)))]})},gN=({iconWidth:r,isLast:e})=>v.jsx("div",{style:{width:r/8*3,height:"100%",borderLeft:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"},children:e&&v.jsx("div",{style:{borderBottom:"var(--ATree_Indent_border)",height:"50%",transition:"border-color var(--Transition)"}})}),mN=({iconWidth:r})=>v.jsx("div",{style:{width:r,height:"100%",borderLeft:"none",marginLeft:0,transition:"border-color var(--Transition)"}}),vN=({iconWidth:r})=>v.jsx("div",{style:{width:r/8*3,height:"50%",borderLeft:"var(--ATree_Indent_border)",borderBottom:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"}}),yN=r=>{const{isEqual:e,searchResult:t,initSearch:n,searchUp:i,searchDown:l,searchEnter:u,isDisabled:h,isLoading:g,resources:m,maxLength:M,autoFocus:T}=r,C=I.useCallback(D=>{D.key==="Enter"?u():D.key==="ArrowDown"?l():D.key==="ArrowUp"&&i(),D.preventDefault(),D.stopPropagation()},[l,u,i]),_=I.useCallback(D=>{n(D)},[n]),S=I.useMemo(()=>h||g?-1:void 0,[h,g]);return v.jsx(Jl,{className:fn.SearchInput,wrapProps:{className:fn.SearchInputWrap},isDisabled:h,tabIndex:S,useValue:[(t==null?void 0:t.keyword)??"",_],onKeyDown:C,placeholder:m["Search(Placeholder)"],RightAddon:v.jsx(bN,{isEqual:e,searchResult:t,searchUp:i,searchDown:l,searchEnter:u,resources:m}),maxLength:M,autoFocus:T})},bN=r=>{const{isEqual:e,searchResult:t,searchUp:n,searchDown:i,searchEnter:l,resources:u}=r,h=I.useMemo(()=>!t||t.items.length<1?0:t.items.findIndex(S=>t.item&&e(S,t.item))+1,[t,e]),g=I.useMemo(()=>!t||t.items.length<1?0:t.items.length,[t]),m=I.useMemo(()=>h<2,[h]),M=I.useMemo(()=>h>=g,[h,g]),T=I.useCallback(S=>{S.stopPropagation(),!m&&n()},[n,m]),C=I.useCallback(S=>{S.stopPropagation(),!M&&i()},[i,M]),_=I.useCallback(S=>{S.stopPropagation(),l()},[l]);return v.jsx("div",{className:Be.clsx(fn.RightAddon,"NoSelect"),children:t?v.jsxs(v.Fragment,{children:[h,"/",g,v.jsx(Ur,{onClick:T,isDisabled:m,children:v.jsx(Br,{className:fn.RightAddonIcon,icon:"ArrowUp",mask:""})}),v.jsx(Ur,{onClick:C,isDisabled:M,children:v.jsx(Br,{className:fn.RightAddonIcon,icon:"ArrowDown"})})]}):v.jsx(vo,{type:"Raw",className:fn.RightAddonIcon,style:{marginRight:4},icon:"Search",onClick:_,tooltip:u["Search(Button)"]})})},_N=r=>{var Wr;const{pk:e,selectDisabled:t,selectUnused:n,useItems:i,useExpand:l,useSelect:u,useSearch:h,showCheckbox:g,iconWidth:m=24,icons:M={noChild:"Folder",collapsed:"FolderCopy",expanded:"FolderOpen"},indents:T,isSelectMulti:C=!1,noSearch:_=!1,isDraggable:S,noSyncSearchSelect:D=!1,actionRef:A,placeholder:b,searchPredicate:R=SN,isDisabled:O,isLoading:H,ContentRenderer:q=xN,TreeItemRenderer:G=pN,RightStickyAddon:Y,TopRightAddon:ue,TreeTopAddon:te,resources:fe,maxLength:N,autoFocus:re,TreeItemStyle:K,TreeItemClassName:ne,OverflowPadding:ie,insertBorder:ce,width:me,searchItemClassName:ae,searchItemStyle:_e,height:ge=40,...Se}=r,Le=I.useMemo(()=>({...hn.ATree,...fe}),[fe]),Pe=I.useCallback((st,It)=>e!==void 0?Array.isArray(e)?e.every(_t=>el.isEqual(st[_t],It[_t])):el.isEqual(st[e],It[e]):el.isEqual(st,It),[e]),Ve=I.useRef(null),[Te,rt]=pn(i,[]),ht=I.useMemo(()=>Qa.map(Te,st=>st),[Te]),[Ke,Ye]=pn(l,[]),[De,ke]=pn(u,[]),[Ee,Ne]=pn(h,void 0),Re=I.useCallback(st=>{if(O||!Ye||Ke.some(Je=>Pe(Je,st)))return;const It=[];let _t=st;for(;_t;){const Je=_t;Ke.find(Nt=>Pe(Nt,Je))||It.push(Je),_t=ht.find(Nt=>{var Q;return(Q=Nt.children)==null?void 0:Q.some(He=>Pe(He,Je))})}Ye([...Ke,...It])},[Ke,O,Pe,Ye,ht]),Xe=I.useCallback(()=>{!Ye||O||Ye([...ht])},[ht,O,Ye]),ut=I.useCallback(()=>{!Ye||O||Ye([])},[Ye,O]),Ct=I.useCallback(st=>{!ke||O||n!=null&&n(st)||(ke([st]),Re(st))},[ke,O,n,Re]),xt=I.useCallback(st=>{if(!Ne||O)return;if(!st||_){Ne(void 0),D||ke==null||ke([]);return}const It=Qa.filter(Te,Je=>R(st,Je));let _t;if(It.find(Je=>(Ee==null?void 0:Ee.item)&&Pe(Je,Ee.item))?_t=Ee==null?void 0:Ee.item:It.length>0&&(_t=It[0]),Ne({keyword:st,items:It,item:_t}),_t&&Re(_t),ke&&!D)if(C)ke(It);else{const Je=It.find(Nt=>_t&&Pe(Nt,_t));ke(Je?[Je]:[])}},[Te,O,Pe,R,Ne,ke,Re,D,_,C,Ee]),mt=I.useRef(!1);I.useEffect(()=>{mt.current=!0},[Te]),I.useEffect(()=>{Ee&&mt.current&&(xt(Ee.keyword),mt.current=!1)},[xt,Ee]);const Lt=I.useCallback(()=>{if(!Ee||!Ne||O)return;let st=Ee.items.findIndex(It=>Ee.item&&Pe(It,Ee.item))-1;st<0||(Ne({...Ee,item:Ee.items[st]}),Re(Ee.items[st]),D||Ct(Ee.items[st]))},[Ee,Re,Ne,O,Ct,Pe,D]),At=I.useCallback(()=>{if(!Ee||!Ne||O)return;let st=Ee.items.findIndex(It=>Ee.item&&Pe(It,Ee.item))+1;st>=Ee.items.length||(Ne({...Ee,item:Ee.items[st]}),Re(Ee.items[st]),D||Ct(Ee.items[st]))},[Ee,Re,O,Ne,Ct,Pe,D]),lt=I.useCallback(()=>{if(!Ee||!Ne||O)return;let st=Ee.items.findIndex(_t=>Ee.item&&Pe(_t,Ee.item));if(!D||n!=null&&n(Ee.items[st])){At();return}if(De.some(_t=>Ee.item&&Pe(_t,Ee.item))){let _t=st+1;const Je=Ee.items[_t];if(_t>=Ee.items.length)return;Ne({...Ee,item:Je}),Ct(Je)}else Ct(Ee.items[st])},[Ee,Ne,O,De,D,At,Pe,Ct,n]),[ct,St]=I.useState(!1),ve=I.useCallback(()=>St(!0),[]),We=I.useCallback(()=>St(!1),[]),ot=I.useMemo(()=>n?Qa.map(Te,st=>st).filter(st=>!n(st)):t?Qa.map(Te,st=>st).filter(st=>!t(st)):Qa.map(Te,st=>st),[n,t,Te]),pt=I.useMemo(()=>!g||!C?!1:De.length>0&&ot.length>De.length,[g,C,De,ot]),vt=I.useMemo(()=>!g||!C?!1:De.length>0&&ot.length===De.length,[g,C,De,ot]),je=I.useCallback(()=>{if(!ke||!C||O)return;const st=De.filter(It=>!(n!=null&&n(It))&&!(t!=null&&t(It))&&ot.some(_t=>Pe(_t,It)));if(st.length>0)ke(De.filter(It=>!st.some(_t=>Pe(It,_t))));else{const It=ot.filter(_t=>!(n!=null&&n(_t))&&!(t!=null&&t(_t))&&!De.some(Je=>Pe(Je,_t)));It.length>0&&ke([...De,...It])}},[C,O,n,t,ke,De,ot,Pe]),yt=I.useMemo(()=>{if(!g||!C||O)return"";const st=De.filter(It=>!(n!=null&&n(It))&&!(t!=null&&t(It))&&ot.some(_t=>Pe(_t,It)));if(st.length>0)return Le["deselect n"](st.length);{const It=ot.filter(_t=>!(n!=null&&n(_t))&&!(t!=null&&t(_t))&&!De.some(Je=>Pe(Je,_t)));return Le["select n"](It.length)}},[n,t,O,Le,g,C,ot,De,Pe]),[Mt,cr]=I.useState(null),[Lr,er]=I.useState(null),he=I.useCallback(st=>{!S||O||cr(st)},[O,S]),ee=I.useCallback((st,It)=>{if(!S||O||!Mt||(st.preventDefault(),st.stopPropagation(),er(It),!rt))return;const _t=Qa.replace(Te,Mt,It,Pe);_t&&rt(_t)},[S,Te,Mt,O,rt,Pe]),qe=I.useCallback(()=>{if(!S||O||!Mt||!Lr||!rt||Pe(Mt,Lr))return;const st=Qa.replace(Te,Mt,Lr,Pe);st&&(rt(st),cr(null))},[S,rt,Te,Mt,Lr,Pe,O]);I.useEffect(()=>{var st;g||(st=Ve.current)==null||st.scrollTo(0,0)},[g,Ve]),I.useEffect(()=>{!C&&De.length>1&&(ke==null||ke([De[De.length-1]]))},[C,ke,De]),I.useEffect(()=>{A&&(A.current={expandAll:Xe,collapseAll:ut})},[A,Xe,ut]),I.useEffect(()=>{if(!t||!ke)return;const st=De.filter(It=>!t(It));De.length!==st.length&&ke(st)},[t,De,ke]),I.useEffect(()=>{if(!n||!ke)return;const st=De.filter(It=>!n(It));De.length!==st.length&&ke(st)},[n,De,ke]),I.useEffect(()=>{Ne&&Ne(void 0)},[Ne]);const[Qe,Et]=I.useState(!1);I.useEffect(()=>{Et(st=>!st)},[Te]);const[gt,wt]=I.useState(null),Gt=I.useCallback((st,It)=>{O||(st.stopPropagation(),st.preventDefault(),wt(It))},[O]),Ft=I.useCallback((st,It)=>{gt===null||O||Pe(It,gt)&&(st.stopPropagation(),st.preventDefault(),wt(null))},[gt,O,Pe]),or=I.useRef(null),[dr,kr]=I.useState(!1),[ur,_r]=I.useState((Wr=or.current)==null?void 0:Wr.scrollHeight);return I.useEffect(()=>{if(Ke.length<0)return;const st=Ve.current,It=or.current,_t=st.clientHeight<It.clientHeight;_r(_t?It.scrollHeight:st.clientHeight),kr(_t)},[Ke]),v.jsxs(Ur,{...Se,isDisabled:O,className:Be.clsx(Se.className,fn.AWrap),children:[(!_||ue)&&v.jsxs(si,{className:fn.ATreeHeader,children:[!_&&v.jsx(yN,{isEqual:Pe,searchResult:Ee,initSearch:xt,searchUp:Lt,searchDown:At,searchEnter:lt,isLoading:H,isDisabled:O,resources:Le,maxLength:N,autoFocus:re}),!_&&ue&&v.jsx(mn,{w:8}),ue]}),(!_||ue||g&&C||S)&&v.jsx(hm,{isLoading:H&&Te.length!==0}),(g&&C||S)&&v.jsxs("div",{className:Be.clsx(fn.ATreeBodyHeader,"NoSelect"),children:[g&&v.jsx(Uu,{className:fn.CheckBox,useCheck:[+vt,()=>je()],isIndeterminate:pt,onMouseOver:ve,onMouseOut:We,isDisabled:O,tooltip:yt}),Le.Items,v.jsx(Yc,{}),v.jsxs("div",{className:Be.clsx(fn.ATreeBodyHeaderResources,"NoSelect"),style:{marginRight:dr?8:0},children:[v.jsx("span",{children:g&&Le["*Click row for single select"]}),v.jsx("span",{children:S&&Le["*Change order to row drag"]})]})]}),v.jsx("div",{ref:Ve,className:Be.clsx(Se.className,fn.AContainer),children:v.jsxs("div",{className:fn.ATree,style:{minWidth:me||"fit-content",marginRight:ie&&dr?8:0},children:[v.jsxs("div",{ref:or,className:fn.ATreeBody,children:[Te.length===0?H?v.jsx(CN,{text:Le["Loading Contents..."]}):b:te,Te.map((st,It)=>v.jsx(G,{isEqual:Pe,indents:[],extIndents:T,item:st,selectDisabled:t,selectUnused:n,isParentDisabled:O,useExpand:[Ke,Ye],useSelect:[De,ke],useSearch:[Ee,Ne],onDragStart:he,onDragOver:ee,onDragEnd:qe,showCheckbox:g,icons:M,iconWidth:m,isSelectMulti:C,isDraggable:S,isParentCheckHovered:C&&ct,ContentRenderer:q,TreeItemRenderer:G,RightStickyAddon:Y,resources:Le,containerRef:Ve,TreeItemStyle:K,TreeItemClassName:ne,hoverdItem:gt,onMouseOver:Gt,onMouseLeave:Ft,searchItemClassName:ae,searchItemStyle:_e,height:ge},`${It}${Qe}`))]}),ce&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:fn.CoverBorder}),v.jsx("div",{className:fn.InsertBorder,style:{"--InsertBorder_height":`${ge}px`,height:dr?ur:"100%"}})]})]})})]})},xN=r=>{const{item:e}=r,t={};return Kt.keys(e).forEach(n=>{n!=="children"&&(t[n]=e[n])}),JSON.stringify(t)};function SN(r,e){return Kt.some(e,(t,n)=>{var i;return(i=Kt.stringify(n))==null?void 0:i.toLowerCase().includes(r.toLowerCase())})}const CN=r=>{const{text:e}=r;return v.jsxs(si,{className:Be.clsx(fn.Loader,"NoSelect"),children:[v.jsx(Br,{icon:"Spinner",style:{height:40},height:40,width:40}),v.jsx(z2,{text:e})]})};var $g,Gb;function Qu(){return Gb||(Gb=1,$g=TypeError),$g}const wN={},AN=Object.freeze(Object.defineProperty({__proto__:null,default:wN},Symbol.toStringTag,{value:"Module"})),TN=t4(AN);var Ug,Zb;function _h(){if(Zb)return Ug;Zb=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,l=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=i&&l&&typeof l.get=="function"?l.get:null,h=i&&Set.prototype.forEach,g=typeof WeakMap=="function"&&WeakMap.prototype,m=g?WeakMap.prototype.has:null,M=typeof WeakSet=="function"&&WeakSet.prototype,T=M?WeakSet.prototype.has:null,C=typeof WeakRef=="function"&&WeakRef.prototype,_=C?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,D=Object.prototype.toString,A=Function.prototype.toString,b=String.prototype.match,R=String.prototype.slice,O=String.prototype.replace,H=String.prototype.toUpperCase,q=String.prototype.toLowerCase,G=RegExp.prototype.test,Y=Array.prototype.concat,ue=Array.prototype.join,te=Array.prototype.slice,fe=Math.floor,N=typeof BigInt=="function"?BigInt.prototype.valueOf:null,re=Object.getOwnPropertySymbols,K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ne=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ne||!0)?Symbol.toStringTag:null,ce=Object.prototype.propertyIsEnumerable,me=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(he){return he.__proto__}:null);function ae(he,ee){if(he===1/0||he===-1/0||he!==he||he&&he>-1e3&&he<1e3||G.call(/e/,ee))return ee;var qe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof he=="number"){var Qe=he<0?-fe(-he):fe(he);if(Qe!==he){var Et=String(Qe),gt=R.call(ee,Et.length+1);return O.call(Et,qe,"$&_")+"."+O.call(O.call(gt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return O.call(ee,qe,"$&_")}var _e=TN,ge=_e.custom,Se=Re(ge)?ge:null,Le={__proto__:null,double:'"',single:"'"},Pe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ug=function he(ee,qe,Qe,Et){var gt=qe||{};if(Ct(gt,"quoteStyle")&&!Ct(Le,gt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ct(gt,"maxStringLength")&&(typeof gt.maxStringLength=="number"?gt.maxStringLength<0&>.maxStringLength!==1/0:gt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var wt=Ct(gt,"customInspect")?gt.customInspect:!0;if(typeof wt!="boolean"&&wt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ct(gt,"indent")&>.indent!==null&>.indent!==" "&&!(parseInt(gt.indent,10)===gt.indent&>.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ct(gt,"numericSeparator")&&typeof gt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Gt=gt.numericSeparator;if(typeof ee>"u")return"undefined";if(ee===null)return"null";if(typeof ee=="boolean")return ee?"true":"false";if(typeof ee=="string")return ot(ee,gt);if(typeof ee=="number"){if(ee===0)return 1/0/ee>0?"0":"-0";var Ft=String(ee);return Gt?ae(ee,Ft):Ft}if(typeof ee=="bigint"){var or=String(ee)+"n";return Gt?ae(ee,or):or}var dr=typeof gt.depth>"u"?5:gt.depth;if(typeof Qe>"u"&&(Qe=0),Qe>=dr&&dr>0&&typeof ee=="object")return ht(ee)?"[Array]":"[Object]";var kr=cr(gt,Qe);if(typeof Et>"u")Et=[];else if(Lt(Et,ee)>=0)return"[Circular]";function ur(sr,fr,zr){if(fr&&(Et=te.call(Et),Et.push(fr)),zr){var gr={depth:gt.depth};return Ct(gt,"quoteStyle")&&(gr.quoteStyle=gt.quoteStyle),he(sr,gr,Qe+1,Et)}return he(sr,gt,Qe+1,Et)}if(typeof ee=="function"&&!Ye(ee)){var _r=mt(ee),Wr=er(ee,ur);return"[Function"+(_r?": "+_r:" (anonymous)")+"]"+(Wr.length>0?" { "+ue.call(Wr,", ")+" }":"")}if(Re(ee)){var st=ne?O.call(String(ee),/^(Symbol\(.*\))_[^)]*$/,"$1"):K.call(ee);return typeof ee=="object"&&!ne?vt(st):st}if(We(ee)){for(var It="<"+q.call(String(ee.nodeName)),_t=ee.attributes||[],Je=0;Je<_t.length;Je++)It+=" "+_t[Je].name+"="+Ve(Te(_t[Je].value),"double",gt);return It+=">",ee.childNodes&&ee.childNodes.length&&(It+="..."),It+="</"+q.call(String(ee.nodeName))+">",It}if(ht(ee)){if(ee.length===0)return"[]";var Nt=er(ee,ur);return kr&&!Mt(Nt)?"["+Lr(Nt,kr)+"]":"[ "+ue.call(Nt,", ")+" ]"}if(De(ee)){var Q=er(ee,ur);return!("cause"in Error.prototype)&&"cause"in ee&&!ce.call(ee,"cause")?"{ ["+String(ee)+"] "+ue.call(Y.call("[cause]: "+ur(ee.cause),Q),", ")+" }":Q.length===0?"["+String(ee)+"]":"{ ["+String(ee)+"] "+ue.call(Q,", ")+" }"}if(typeof ee=="object"&&wt){if(Se&&typeof ee[Se]=="function"&&_e)return _e(ee,{depth:dr-Qe});if(wt!=="symbol"&&typeof ee.inspect=="function")return ee.inspect()}if(At(ee)){var He=[];return n&&n.call(ee,function(sr,fr){He.push(ur(fr,ee,!0)+" => "+ur(sr,ee))}),yt("Map",t.call(ee),He,kr)}if(St(ee)){var dt=[];return h&&h.call(ee,function(sr){dt.push(ur(sr,ee))}),yt("Set",u.call(ee),dt,kr)}if(lt(ee))return je("WeakMap");if(ve(ee))return je("WeakSet");if(ct(ee))return je("WeakRef");if(Ee(ee))return vt(ur(Number(ee)));if(Xe(ee))return vt(ur(N.call(ee)));if(Ne(ee))return vt(S.call(ee));if(ke(ee))return vt(ur(String(ee)));if(typeof window<"u"&&ee===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ee===globalThis||typeof yi<"u"&&ee===yi)return"{ [object globalThis] }";if(!Ke(ee)&&!Ye(ee)){var Ot=er(ee,ur),Qt=me?me(ee)===Object.prototype:ee instanceof Object||ee.constructor===Object,Zt=ee instanceof Object?"":"null prototype",Dt=!Qt&&ie&&Object(ee)===ee&&ie in ee?R.call(xt(ee),8,-1):Zt?"Object":"",Yt=Qt||typeof ee.constructor!="function"?"":ee.constructor.name?ee.constructor.name+" ":"",Mr=Yt+(Dt||Zt?"["+ue.call(Y.call([],Dt||[],Zt||[]),": ")+"] ":"");return Ot.length===0?Mr+"{}":kr?Mr+"{"+Lr(Ot,kr)+"}":Mr+"{ "+ue.call(Ot,", ")+" }"}return String(ee)};function Ve(he,ee,qe){var Qe=qe.quoteStyle||ee,Et=Le[Qe];return Et+he+Et}function Te(he){return O.call(String(he),/"/g,""")}function rt(he){return!ie||!(typeof he=="object"&&(ie in he||typeof he[ie]<"u"))}function ht(he){return xt(he)==="[object Array]"&&rt(he)}function Ke(he){return xt(he)==="[object Date]"&&rt(he)}function Ye(he){return xt(he)==="[object RegExp]"&&rt(he)}function De(he){return xt(he)==="[object Error]"&&rt(he)}function ke(he){return xt(he)==="[object String]"&&rt(he)}function Ee(he){return xt(he)==="[object Number]"&&rt(he)}function Ne(he){return xt(he)==="[object Boolean]"&&rt(he)}function Re(he){if(ne)return he&&typeof he=="object"&&he instanceof Symbol;if(typeof he=="symbol")return!0;if(!he||typeof he!="object"||!K)return!1;try{return K.call(he),!0}catch{}return!1}function Xe(he){if(!he||typeof he!="object"||!N)return!1;try{return N.call(he),!0}catch{}return!1}var ut=Object.prototype.hasOwnProperty||function(he){return he in this};function Ct(he,ee){return ut.call(he,ee)}function xt(he){return D.call(he)}function mt(he){if(he.name)return he.name;var ee=b.call(A.call(he),/^function\s*([\w$]+)/);return ee?ee[1]:null}function Lt(he,ee){if(he.indexOf)return he.indexOf(ee);for(var qe=0,Qe=he.length;qe<Qe;qe++)if(he[qe]===ee)return qe;return-1}function At(he){if(!t||!he||typeof he!="object")return!1;try{t.call(he);try{u.call(he)}catch{return!0}return he instanceof Map}catch{}return!1}function lt(he){if(!m||!he||typeof he!="object")return!1;try{m.call(he,m);try{T.call(he,T)}catch{return!0}return he instanceof WeakMap}catch{}return!1}function ct(he){if(!_||!he||typeof he!="object")return!1;try{return _.call(he),!0}catch{}return!1}function St(he){if(!u||!he||typeof he!="object")return!1;try{u.call(he);try{t.call(he)}catch{return!0}return he instanceof Set}catch{}return!1}function ve(he){if(!T||!he||typeof he!="object")return!1;try{T.call(he,T);try{m.call(he,m)}catch{return!0}return he instanceof WeakSet}catch{}return!1}function We(he){return!he||typeof he!="object"?!1:typeof HTMLElement<"u"&&he instanceof HTMLElement?!0:typeof he.nodeName=="string"&&typeof he.getAttribute=="function"}function ot(he,ee){if(he.length>ee.maxStringLength){var qe=he.length-ee.maxStringLength,Qe="... "+qe+" more character"+(qe>1?"s":"");return ot(R.call(he,0,ee.maxStringLength),ee)+Qe}var Et=Pe[ee.quoteStyle||"single"];Et.lastIndex=0;var gt=O.call(O.call(he,Et,"\\$1"),/[\x00-\x1f]/g,pt);return Ve(gt,"single",ee)}function pt(he){var ee=he.charCodeAt(0),qe={8:"b",9:"t",10:"n",12:"f",13:"r"}[ee];return qe?"\\"+qe:"\\x"+(ee<16?"0":"")+H.call(ee.toString(16))}function vt(he){return"Object("+he+")"}function je(he){return he+" { ? }"}function yt(he,ee,qe,Qe){var Et=Qe?Lr(qe,Qe):ue.call(qe,", ");return he+" ("+ee+") {"+Et+"}"}function Mt(he){for(var ee=0;ee<he.length;ee++)if(Lt(he[ee],`
|
350
350
|
`)>=0)return!1;return!0}function cr(he,ee){var qe;if(he.indent===" ")qe=" ";else if(typeof he.indent=="number"&&he.indent>0)qe=ue.call(Array(he.indent+1)," ");else return null;return{base:qe,prev:ue.call(Array(ee+1),qe)}}function Lr(he,ee){if(he.length===0)return"";var qe=`
|