PageSourceSearch

https://kultvyselki.ru/kubcms-front/v5/master/s/c-ParentTreeSelect-DEBH1iKH.js

js kultvyselki.ru collected 2026-10-08 15:22:00 UTC 37,948 bytes, 1 lines download raw bytes

1import{E as ct,a as $e}from"./c-el-form-item-DpapBxAI.js";import{aO as Me,ey as ut,aR as z,g6 as ht,bZ as ft,aT as H,aU as se,cY as Ve,aV as w,b2 as j,b3 as Q,aX as Ke,bb as ze,aZ as $,b4 as Fe,a_ as x,bc as A,bw as R,by as B,b8 as De,ex as pe,aP as pt,aQ as de,gf as ye,bO as Y,bP as ue,bl as re,eE as te,bp as je,eB as yt,be as Nt,eL as Oe,b0 as W,bn as gt,a$ as ne,bH as fe,bF as kt,bo as X,gg as Ct,b5 as vt,eA as mt,bm as T,gh as bt,b7 as Se,gi as Re,ce as F,br as Ne,bs as ge,aW as M,b1 as ke,ck as V,bh as G,bg as ee,bt as He,c1 as qe,eV as _e,bA as Ue,bB as P,aS as Et,eO as Ce,bY as Kt,b6 as Ye,bS as We,gj as he,cN as xe,cM as Je,cL as Ae,gk as Dt,gl as St,bT as xt,gm as wt,fa as Tt,gn as It,cn as Le,cH as Ot,cd as At,bR as Lt}from"./c-index-D0PNHfG-.js";import{E as Pt}from"./c-index-MsKR8JGb.js";/* empty css                      */const Bt=Me({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:ut,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}});
1var $t=z({name:"ElText",__name:"text",props:Bt,setup(e){const t=e,s=ht(),a=x(),n=ft(),d=H("text"),r=A(()=>[d.b(),d.m(t.type),d.m(n.value),d.is("truncated",t.truncated),d.is("line-clamp",!R(t.lineClamp))]),i=async()=>{var p,c,h,y,l,g,N;if(await B(),s.title)return;let o=!1;const u=((p=a.value)==null?void 0:p.textContent)||"";if(t.truncated){const C=(c=a.value)==null?void 0:c.offsetWidth,b=(h=a.value)==null?void 0:h.scrollWidth;C&&b&&b>C&&(o=!0)}else if(!R(t.lineClamp)){const C=(y=a.value)==null?void 0:y.offsetHeight,b=(l=a.value)==null?void 0:l.scrollHeight;C&&b&&b>C&&(o=!0)}o?(g=a.value)==null||g.setAttribute("title",u):(N=a.value)==null||N.removeAttribute("title")};return se(i),Ve(i),(o,u)=>(w(),j(Fe(e.tag),{ref_key:"textRef",ref:a,class:$(r.value),style:ze({"-webkit-line-clamp":e.lineClamp})},{default:Q(()=>[Ke(o.$slots,"default")]),_:3},8,["class","style"]))}}),Mt=$t;const Vt=De(Mt),we="RootTree",Ge="NodeInstance",Pe="TreeNodeMap",Ze=Me({data:{type:de(Array),default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkOnClickLeaf:{type:Boolean,default:!0},checkDescendants:Boolean,autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array},defaultExpandedKeys:{type:Array},currentNodeKey:{type:[String,Number]},renderContent:{type:de(Function)},showCheckbox:Boolean,draggable:Boolean,allowDrag:{type:de(Function)},allowDrop:{type:de(Function)},props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:Boolean,highlightCurrent:Boolean,load:{type:Function},filterNodeMethod:{type:Function},accordion:Boolean,indent:{type:Number,default:18},icon:{type:pt}}),zt={"check-change":(e,t,s)=>e&&pe(t)&&pe(s),"current-change":(e,t)=>!0,"node-click":(e,t,s,a)=>e&&t&&a instanceof Event,"node-contextmenu":(e,t,s,a)=>e instanceof Event&&t&&s,"node-collapse":(e,t,s)=>e&&t,"node-expand":(e,t,s)=>e&&t,check:(e,t)=>e&&t,"node-drag-start":(e,t)=>e&&t,"node-drag-end":(e,t,s,a)=>e&&a,"node-drop":(e,t,s,a)=>e&&t&&a,"node-drag-leave":(e,t,s)=>e&&t&&s,"node-drag-enter":(e,t,s)=>e&&t&&s,"node-drag-over":(e,t,s)=>e&&t&&s},Qe="$treeNodeId",Be=function(e,t){!t||t.$treeNodeId||Object.defineProperty(t,Qe,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},Te=(e,t)=>
1t==null?void 0:t[e||"$treeNodeId"],ve=(e,t,s)=>{const a=e.value.currentNode;s();const n=e.value.currentNode;a!==n&&t("current-change",n?n.data:null,n)},Xe=e=>{let t=!0,s=!0,a=!0,n=!0;for(let d=0,r=e.length;d<r;d++){const i=e[d];(i.checked!==!0||i.indeterminate)&&(t=!1,i.disabled||(a=!1)),(i.checked!==!1||i.indeterminate)&&(s=!1),i.isEffectivelyChecked||(n=!1)}return{all:t,none:s,allWithoutDisable:a,half:!t&&!s,isEffectivelyChecked:n}},Z=function(e){if(e.childNodes.length===0||e.loading){e.isEffectivelyChecked=e.disabled||e.checked;return}const{all:t,none:s,half:a,isEffectivelyChecked:n}=Xe(e.childNodes);e.isEffectivelyChecked=n,t?(e.checked=!0,e.indeterminate=!1):a?(e.checked=!1,e.indeterminate=!0):s&&(e.checked=!1,e.indeterminate=!1);const d=e.parent;!d||d.level===0||e.store.checkStrictly||Z(d)},oe=function(e,t){const s=e.store.props,a=e.data||{},n=s[t];if(te(n))return n(a,e);if(je(n))return a[n];if(R(n)){const d=a[t];return R(d)?"":d}},me=function(e,t){e.forEach(s=>{s.canFocus=t,me(s.childNodes,t)})};let Ft=0;var be=class ie{constructor(t){this.isLeafByUser=void 0,this.isLeaf=void 0,this.isEffectivelyChecked=!1,this.id=Ft++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const s in t)ye(t,s)&&(this[s]=t[s]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){var d;const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const s=t.props;if(s&&typeof s.isLeaf<"u"){const r=oe(this,"isLeaf");pe(r)&&(this.isLeafByUser=r)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Y(this.data)||Be(this,this.data),!this.data)return;const a=t.defaultExpandedKeys,n=t.key;n&&!ue(this.key)&&a&&a.includes(this.key)&&this.expand(null,t.autoExpandParent),n&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode&&(t.currentNode.isCurrent=!1),t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),(this.level===1||((d=this.parent)==null?void 0:d.expanded)===!0)&&(this.canFocus=!0)}setData(t){Y(t)||Be(this,t),this.data=t,this.childNodes=[];let s;this.level===0&&Y(this.data)?s=this.data:s=oe(this,"children")||[];for(let a=0,n=s.length;a<n;a++)this.insertChild({data:s[a]})}get label(){return oe(this,"label")}get key(){const t=this.store.key;return this.data?this.data[t]:null}get disabled(){return oe(this,"disabled")}get nextSibling(){const t=this.parent;if(t){const s=t.childNodes.indexOf(this);if(s>-1)return t.childNodes[s+1]}return null}get previousSibling(){const t=this.parent;if(t){const s=t.childNodes.indexOf(this);if(s>-1)return s>0?t.childNodes[s-1]:null}return null}contains(t,s=!0){return(this.childNodes||[]).some(a=>a===t||s&&a.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,s,a){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof ie)){if(!a){const n=this.getChildren(!0);n!=null&&n.includes(t.data)||(R(s)||s<0?n==null||n.push(t.data):n==null||n.splice(s,0,t.data))}Object.assign(t,{parent:this,store:this.store}),t=re(new ie(t)),t instanceof ie&&t.initialize()}t.level=this.level+1,R(s)||s<0?this.childNodes.push(t):this.childNodes.splice(s,0,t),this.updateLeafState()}insertBefore(t,s){let a;s&&(a=this.childNodes.indexOf(s)),this.insertChild(t,a)}insertAfter(t,s){let a;s&&(a=this.childNodes.indexOf(s),a!==-1&&(a+=1)),this.insertChild(t,a)}removeChild(t){const s=this.getChildren()||[],a=s.indexOf(t.data);a>-1&&s.splice(a,1);const n=this.childNodes.indexOf(t);n>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(n,1)),this.updateLeafState()}removeChildByData(t){const s=this.childNodes.find(a=>a.data===t);s&&this.removeChild(s)}expand(t,s){const a=()=>{if(s){let n=this.parent;for(;n&&n.level>0;)n.expanded=!0,n=n.parent}this.expanded=!0,t&&t(),me(this.childNodes,!0)};this.shouldLoadData()?this.loadData(n=>{Y(n)&&(this.store.checkStrictly||(this.checked?this.setChecked(!0,!0):Z(this)),a())}):a()}doCreateChildren(t,s={}){t.forEach(a=>{this.insertChild(Object.assign({data:a},s),void 0,!0)})}collapse(){this.expanded=!1,me(this.childNodes,!1)}shouldLoadData(){return!!(this.store.lazy===!0&&this.store.load&&!this.loaded)}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}const t=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!t||t.length===0,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}this.isLeaf=!1}
1setChecked(t,s,a,n){if(this.indeterminate=t==="half",this.checked=t===!0,this.isEffectivelyChecked=!this.childNodes.length&&(this.disabled||this.checked),this.store.checkStrictly&&!s)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const r=()=>{if(s){const i=this.childNodes;for(let c=0,h=i.length;c<h;c++){const y=i[c];n=n||t!==!1;const l=y.disabled&&y.isLeaf?y.checked:n;y.setChecked(l,s,!0,n)}const{half:o,all:u,isEffectivelyChecked:p}=Xe(i);u||(this.checked=u,this.indeterminate=o),this.isEffectivelyChecked=this.childNodes.length?p:this.disabled||this.checked}};if(this.shouldLoadData()){this.loadData(()=>{r(),Z(this)},{checked:t!==!1});return}else r()}const d=this.parent;!d||d.level===0||!a&&!this.store.checkStrictly&&Z(d)}getChildren(t=!1){if(this.level===0)return this.data;const s=this.data;if(!s)return null;const a=this.store.props;let n="children";return a&&(n=a.children||"children"),R(s[n])&&(s[n]=null),t&&!s[n]&&(s[n]=[]),s[n]}updateChildren(){const t=this.getChildren()||[],s=this.childNodes.map(d=>d.data),a={},n=[];t.forEach((d,r)=>{const i=d[Qe];i&&s.some(o=>(o==null?void 0:o.$treeNodeId)===i)?a[i]={index:r,data:d}:n.push({index:r,data:d})}),this.store.lazy||s.forEach(d=>{a[d==null?void 0:d.$treeNodeId]||this.removeChildByData(d)}),n.forEach(({index:d,data:r})=>{this.insertChild({data:r},d)}),this.updateLeafState()}loadData(t,s={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(s).length)){this.loading=!0;const a=d=>{this.childNodes=[],this.doCreateChildren(d,s),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,d)},n=()=>{this.loading=!1};this.store.load(this,a,n)}else t&&t.call(this)}eachNode(t){const s=[this];for(;s.length;){const a=s.shift();s.unshift(...a.childNodes),t(a)}}reInitChecked(){this.store.checkStrictly||Z(this)}},jt=class{constructor(e){this.lazy=!1,this.checkStrictly=!1,this.autoExpandParent=!1,this.defaultExpandAll=!1,this.checkDescendants=!1,this.currentNode=null,this.currentNodeKey=null;for(const t in e)ye(e,t)&&(this[t]=e[t]);this.nodesMap={}}initialize(){if(this.root=new be({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,t=>{this.root.doCreateChildren(t),this._initDefaultCheckedNodes()},yt)}else this._initDefaultCheckedNodes()}filter(e){const t=this.filterNodeMethod,s=this.lazy,a=async function(n){const d=n.root?n.root.childNodes:n.childNodes;for(const[r,i]of d.entries())i.visible=!!(t!=null&&t.call(i,e,i.data,i)),r%80===0&&r>0&&await B(),await a(i);if(!n.visible&&d.length){let r=!0;r=!d.some(i=>i.visible),n.root?n.root.visible=r===!1:n.visible=r===!1}e&&n.visible&&!n.isLeaf&&(!s||n.loaded)&&n.expand()};a(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes(),this.setCurrentNodeKey(this.currentNodeKey)):this.root.updateChildren()}getNode(e){if(e instanceof be)return e;const t=Nt(e)?Te(this.key,e):e;return this.nodesMap[t]||null}insertBefore(e,t){var a;const s=this.getNode(t);(a=s.parent)==null||a.insertBefore({data:e},s)}insertAfter(e,t){var a;const s=this.getNode(t);(a=s.parent)==null||a.insertAfter({data:e},s)}remove(e){const t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))}append(e,t){const s=Oe(t)?this.root:this.getNode(t);s&&s.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],t=this.nodesMap;e.forEach(s=>{const a=t[s];a&&a.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){const t=this.defaultCheckedKeys||[];!ue(e.key)&&t.includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const t=this.key;if(!(!e||!e.data))if(!t)this.nodesMap[e.id]=e;else{const s=e.key;ue(s)||(this.nodesMap[s]=e)}}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(t=>{this.deregisterNode(t)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,t=!1){const s=[],a=function(n){(n.root?n.root.childNodes:n.childNodes).forEac
1h(d=>{(d.checked||t&&d.indeterminate)&&(!e||e&&d.isLeaf)&&s.push(d.data),a(d)})};return a(this),s}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(t=>(t||{})[this.key])}getHalfCheckedNodes(){const e=[],t=function(s){(s.root?s.root.childNodes:s.childNodes).forEach(a=>{a.indeterminate&&e.push(a.data),t(a)})};return t(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],t=this.nodesMap;for(const s in t)ye(t,s)&&e.push(t[s]);return e}updateChildren(e,t){const s=this.nodesMap[e];if(!s)return;const a=s.childNodes;for(let n=a.length-1;n>=0;n--){const d=a[n];this.remove(d.data)}for(let n=0,d=t.length;n<d;n++){const r=t[n];this.append(r,s.data)}}_setCheckedKeys(e,t=!1,s){const a=this._getAllNodes().sort((i,o)=>i.level-o.level),n=Object.create(null),d=Object.keys(s);a.forEach(i=>i.setChecked(!1,!1));const r=i=>{i.childNodes.forEach(o=>{var u;n[o.data[e]]=!0,(u=o.childNodes)!=null&&u.length&&r(o)})};for(let i=0,o=a.length;i<o;i++){const u=a[i],p=u.data[e].toString();if(!d.includes(p)){u.checked&&!n[p]&&u.setChecked(!1,!1);continue}if(u.childNodes.length&&r(u),u.isLeaf||this.checkStrictly){u.setChecked(!0,!1);continue}if(u.setChecked(!0,!0),t){u.setChecked(!1,!1,!0);const c=function(h){h.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1,!0),c(y)}),h.reInitChecked()};c(u)}}}setCheckedNodes(e,t=!1){const s=this.key,a={};e.forEach(n=>{a[(n||{})[s]]=!0}),this._setCheckedKeys(s,t,a)}setCheckedKeys(e,t=!1){this.defaultCheckedKeys=e;const s=this.key,a={};e.forEach(n=>{a[n]=!0}),this._setCheckedKeys(s,t,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(t=>{const s=this.getNode(t);s&&s.expand(null,this.autoExpandParent)})}setChecked(e,t,s){const a=this.getNode(e);a&&a.setChecked(!!t,s)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,t=!0){var n;const s=e[this.key],a=this.nodesMap[s];this.setCurrentNode(a),t&&this.currentNode&&this.currentNode.level>1&&((n=this.currentNode.parent)==null||n.expand(null,!0))}setCurrentNodeKey(e,t=!0){var a;if(this.currentNodeKey=e,Oe(e)){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const s=this.getNode(e);s&&(this.setCurrentNode(s),t&&this.currentNode&&this.currentNode.level>1&&((a=this.currentNode.parent)==null||a.expand(null,!0)))}};function et(e){const t=W(Pe,null);let s={treeNodeExpand:a=>{var n;e.node!==a&&((n=e.node)==null||n.collapse())},children:new Set};return t&&t.children.add(s),gt(()=>{t&&t.children.delete(s),s=null}),ne(Pe,s),{broadcastExpanded:a=>{if(e.accordion)for(const n of s.children)n.treeNodeExpand(a)}}}const tt=Symbol("dragEvents");function Rt({props:e,ctx:t,el$:s,dropIndicator$:a,store:n}){const d=H("tree"),r=x({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return ne(tt,{treeNodeDragStart:({event:p,treeNode:c})=>{if(p.dataTransfer){if(te(e.allowDrag)&&!e.allowDrag(c.node))return p.preventDefault(),!1;p.dataTransfer.effectAllowed="move";try{p.dataTransfer.setData("text/plain","")}catch{}r.value.draggingNode=c,t.emit("node-drag-start",c.node,p)}},treeNodeDragOver:({event:p,treeNode:c})=>{if(!p.dataTransfer)return;const h=c,y=r.value.dropNode;y&&y.node.id!==h.node.id&&fe(y.$el,d.is("drop-inner"));const l=r.value.draggingNode;if(!l||!h)return;let g=!0,N=!0,C=!0,b=!0;te(e.allowDrop)&&(g=e.allowDrop(l.node,h.node,"prev"),b=N=e.allowDrop(l.node,h.node,"inner"),C=e.allowDrop(l.node,h.node,"next")),p.dataTransfer.dropEffect=N||g||C?"move":"none",(g||N||C)&&(y==null?void 0:y.node.id)!==h.node.id&&(y&&t.emit("node-drag-leave",l.node,y.node,p),t.emit("node-drag-enter",l.node,h.node,p)),g||N||C?r.value.dropNode=h:r.value.dropNode=null,h.node.nextSibling===l.node&&(C=!1),h.node.previousSibling===l.node&&(g=!1),h.node.contains(l.node,!1)&&(N=!1),(l.node===h.node||l.node.contains(h.node))&&(g=!1,N=!1,C=!1);const D=h.$el,I=D.querySelector(`.${d.be("node","content")}`).getBoundingClientRect(),L=s.value.getBoundingClientRect(),E=s.value.scrollTop;let K;const q=g?N?.25:C?.45:1:Number.NEGATIVE_INFINITY,k=C?N?.75:g?.55:0:Number.POSITIVE_INFINITY;let m=-9999;const S=p.clientY-I.top;S<I.height*q?K="before":S>I.height*k?K="after":N?K="inner":K="none";const O=D.querySelector(`.${d.be("node","expand-icon")}`).getBoundingClientRect(),ae=a.value;K==="before"?m=O.top-L.top+E:K==="after"&&(m=O.bottom-L.top+E),ae.style.top=`${m}px`,ae.style.left=`${O.right-L.left}px`,K==="inner"?kt(D,d.is("drop-inner")):fe(D,d.is("drop-inner")),r.value.showDropIndicator=K==="before"||K==="after",r.value.allowDrop=r.value.showDropIndicator||b,r.value.dropType=K,t.emit("node-drag-over",l.no
1de,h.node,p)},treeNodeDragEnd:p=>{var l,g;const{draggingNode:c,dropType:h,dropNode:y}=r.value;if(p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move"),c!=null&&c.node.data&&y){const N={data:c.node.data};h!=="none"&&c.node.remove(),h==="before"?(l=y.node.parent)==null||l.insertBefore(N,y.node):h==="after"?(g=y.node.parent)==null||g.insertAfter(N,y.node):h==="inner"&&y.node.insertChild(N),h!=="none"&&(n.value.registerNode(N),n.value.key&&c.node.eachNode(C=>{var b;(b=n.value.nodesMap[C.data[n.value.key]])==null||b.setChecked(C.checked,!n.value.checkStrictly)})),fe(y.$el,d.is("drop-inner")),t.emit("node-drag-end",c.node,y.node,h,p),h!=="none"&&t.emit("node-drop",c.node,y.node,h,p)}c&&!y&&t.emit("node-drag-end",c.node,null,h,p),r.value.showDropIndicator=!1,r.value.draggingNode=null,r.value.dropNode=null,r.value.allowDrop=!0}}),{dragState:r}}var Ht=z({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=H("tree"),s=W(Ge),a=W(we);return()=>{const n=e.node,{data:d,store:r}=n;return e.renderContent?e.renderContent(X,{_self:s,node:n,data:d,store:r}):Ke(a.ctx.slots,"default",{node:n,data:d},()=>[X(Vt,{tag:"span",truncated:!0,class:t.be("node","label")},()=>[n.label])])}}}),qt=Ht,_t=z({name:"ElTreeNode",components:{ElCollapseTransition:ct,ElCheckbox:Pt,NodeContent:qt,ElIcon:vt,Loading:Ct},props:{node:{type:be,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:Boolean},emits:["node-expand"],setup(e,t){const s=H("tree"),{broadcastExpanded:a}=et(e),n=W(we),d=x(!1),r=x(!1),i=x(),o=x(),u=x(),p=W(tt),c=Se();ne(Ge,c),n||mt("Tree","Can not find node's tree."),e.node.expanded&&(d.value=!0,r.value=!0);const h=n.props.props.children||"children";T(()=>{var m;const k=(m=e.node.data)==null?void 0:m[h];return k&&[...k]},()=>{e.node.updateChildren()}),T(()=>e.node.indeterminate,k=>{g(e.node.checked,k)}),T(()=>e.node.checked,k=>{g(k,e.node.indeterminate)}),T(()=>e.node.childNodes.length,()=>e.node.reInitChecked()),T(()=>e.node.expanded,k=>{B(()=>d.value=k),k&&(r.value=!0)});const y=k=>n.props.nodeKey?Te(n.props.nodeKey,k.data):k.id,l=k=>{const m=e.props.class;if(!m)return{};let S;if(te(m)){const{data:O}=k;S=m(O,k)}else S=m;return je(S)?{[S]:!0}:S},g=(k,m)=>{(i.value!==k||o.value!==m)&&n.ctx.emit("check-change",e.node.data,k,m),i.value=k,o.value=m},N=k=>{ve(n.store,n.ctx.emit,()=>{var m;if((m=n==null?void 0:n.props)!=null&&m.nodeKey){const S=y(e.node);n.store.value.setCurrentNodeKey(S)}else n.store.value.setCurrentNode(e.node)}),n.currentNode.value=e.node,n.props.expandOnClickNode&&b(),(n.props.checkOnClickNode||e.node.isLeaf&&n.props.checkOnClickLeaf&&e.showCheckbox)&&!e.node.disabled&&D(!e.node.checked),n.ctx.emit("node-click",e.node.data,e.node,c,k)},C=k=>{var m;(m=n.instance.vnode.props)!=null&&m.onNodeContextmenu&&(k.stopPropagation(),k.preventDefault()),n.ctx.emit("node-contextmenu",k,e.node.data,e.node,c)},b=()=>{e.node.isLeaf||(d.value?(n.ctx.emit("node-collapse",e.node.data,e.node,c),e.node.collapse()):e.node.expand(()=>{t.emit("node-expand",e.node.data,e.node,c)}))},D=k=>{const m=n==null?void 0:n.props.checkStrictly,S=e.node.childNodes;!m&&S.length&&(k=S.some(O=>!O.isEffectivelyChecked)),e.node.setChecked(k,!m),B(()=>{const O=n.store.value;n.ctx.emit("check",e.node.data,{checkedNodes:O.getCheckedNodes(),checkedKeys:O.getCheckedKeys(),halfCheckedNodes:O.getHalfCheckedNodes(),halfCheckedKeys:O.getHalfCheckedKeys()})})};return{ns:s,node$:u,tree:n,expanded:d,childNodeRendered:r,oldChecked:i,oldIndeterminate:o,getNodeKey:y,getNodeClass:l,handleSelectChange:g,handleClick:N,handleContextMenu:C,handleExpandIconClick:b,handleCheckChange:D,handleChildNodeExpand:(k,m,S)=>{a(m),n.ctx.emit("node-expand",k,m,S)},handleDragStart:k=>{n.props.draggable&&p.treeNodeDragStart({event:k,treeNode:e})},handleDragOver:k=>{k.preventDefault(),n.props.draggable&&p.treeNodeDragOver({event:k,treeNode:{$el:u.value,node:e.node}})},handleDrop:k=>{k.preventDefault()},handleDragEnd:k=>{n.props.draggable&&p.treeNodeDragEnd(k)},CaretRight:bt}}});const Ut=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],Yt=["aria-expanded"];function Wt(e,t,s,a,n,d){const r=F("el-icon"),i=F("el-checkbox"),o=F("loading"),u=F("node-content"),p=F("el-tree-node"),c=F("el-collapse-transition");return Ne((w(),M("div",{ref:"node$",class:$([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)
1]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[2]||(t[2]=V((...h)=>e.handleClick&&e.handleClick(...h),["stop"])),onContextmenu:t[3]||(t[3]=(...h)=>e.handleContextMenu&&e.handleContextMenu(...h)),onDragstart:t[4]||(t[4]=V((...h)=>e.handleDragStart&&e.handleDragStart(...h),["stop"])),onDragover:t[5]||(t[5]=V((...h)=>e.handleDragOver&&e.handleDragOver(...h),["stop"])),onDragend:t[6]||(t[6]=V((...h)=>e.handleDragEnd&&e.handleDragEnd(...h),["stop"])),onDrop:t[7]||(t[7]=V((...h)=>e.handleDrop&&e.handleDrop(...h),["stop"]))},[ke("div",{class:$(e.ns.be("node","content")),style:ze({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(w(),j(r,{key:0,class:$([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:V(e.handleExpandIconClick,["stop"])},{default:Q(()=>[(w(),j(Fe(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):G("v-if",!0),e.showCheckbox?(w(),j(i,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=V(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):G("v-if",!0),e.node.loading?(w(),j(r,{key:2,class:$([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:Q(()=>[ee(o)]),_:1},8,["class"])):G("v-if",!0),ee(u,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),ee(c,null,{default:Q(()=>[!e.renderAfterExpand||e.childNodeRendered?Ne((w(),M("div",{key:0,class:$(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded,onClick:t[1]||(t[1]=V(()=>{},["stop"]))},[(w(!0),M(He,null,qe(e.node.childNodes,h=>(w(),j(p,{key:e.getNodeKey(h),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:h,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,Yt)),[[ge,e.expanded]]):G("v-if",!0)]),_:1})],42,Ut)),[[ge,e.node.visible]])}var Jt=Re(_t,[["render",Wt]]);function Gt({el$:e},t){const s=H("tree");se(()=>{d()}),Ve(()=>{var r;(r=e.value)==null||r.querySelectorAll("input[type=checkbox]").forEach(i=>{i.setAttribute("tabindex","-1")})});function a(r,i){var u,p;const o=t.value.getNode(r[i].dataset.key);return o.canFocus&&o.visible&&(((u=o.parent)==null?void 0:u.expanded)||((p=o.parent)==null?void 0:p.level)===0)}_e(e,"keydown",r=>{const i=r.target;if(!i.className.includes(s.b("node")))return;const o=Ue(r),u=Array.from(e.value.querySelectorAll(`.${s.is("focusable")}[role=treeitem]`)),p=u.indexOf(i);let c;if([P.up,P.down].includes(o)){if(r.preventDefault(),o===P.up){c=p===-1?0:p!==0?p-1:u.length-1;const y=c;for(;!a(u,c);){if(c--,c===y){c=-1;break}c<0&&(c=u.length-1)}}else{c=p===-1?0:p<u.length-1?p+1:0;const y=c;for(;!a(u,c);){if(c++,c===y){c=-1;break}c>=u.length&&(c=0)}}c!==-1&&u[c].focus()}[P.left,P.right].includes(o)&&(r.preventDefault(),i.click());const h=i.querySelector('[type="checkbox"]');[P.enter,P.numpadEnter,P.space].includes(o)&&h&&(r.preventDefault(),h.click())});const d=()=>{var o;if(!e.value)return;const r=Array.from(e.value.querySelectorAll(`.${s.is("focusable")}[role=treeitem]`));Array.from(e.value.querySelectorAll("input[type=checkbox]")).forEach(u=>{u.setAttribute("tabindex","-1")});const i=e.value.querySelectorAll(`.${s.is("checked")}[role=treeitem]`);if(i.length){i[0].setAttribute("tabindex","0");return}(o=r[0])==null||o.setAttribute("tabindex","0")}}var Zt=z({name:"ElTree",components:{ElTreeNode:Jt},props:Ze,emits:zt,setup(e,t){const{t:s}=Et(),a=H("tree"),n=x(new jt({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.f
1ilterNodeMethod}));n.value.initialize();const d=x(n.value.root),r=x(null),i=x(null),o=x(null),{broadcastExpanded:u}=et(e),{dragState:p}=Rt({props:e,ctx:t,el$:i,dropIndicator$:o,store:n});Gt({el$:i},n);const c=Se(),h=A(()=>{let f=c==null?void 0:c.parent;for(;f;){if(f.type.name==="ElTreeSelect")return!0;f=f.parent}return!1}),y=A(()=>{const{childNodes:f}=d.value;return(!f||f.length===0||f.every(({visible:v})=>!v))&&!h.value});T(()=>e.currentNodeKey,f=>{n.value.setCurrentNodeKey(f??null)}),T(()=>e.defaultCheckedKeys,(f,v)=>{Ce(f,v)||n.value.setDefaultCheckedKey(f??[])}),T(()=>e.defaultExpandedKeys,f=>{n.value.setDefaultExpandedKeys(f??[])}),T(()=>e.data,f=>{n.value.setData(f)},{deep:!0}),T(()=>e.checkStrictly,f=>{n.value.checkStrictly=f});const l=f=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");n.value.filter(f)},g=f=>e.nodeKey?Te(e.nodeKey,f.data):f.id,N=f=>{if(!e.nodeKey)throw new Error(`[Tree] nodeKey is required in ${f}`)},C=f=>{N("getNodePath");const v=n.value.getNode(f);if(!v)return[];const _=[v.data];let J=v.parent;for(;J&&J!==d.value;)_.push(J.data),J=J.parent;return _.reverse()},b=(f,v)=>n.value.getCheckedNodes(f,v),D=f=>n.value.getCheckedKeys(f),I=()=>{const f=n.value.getCurrentNode();return f?f.data:null},L=()=>{N("getCurrentKey");const f=I();return f?f[e.nodeKey]:null},E=(f,v)=>{N("setCheckedNodes"),n.value.setCheckedNodes(f,v)},K=(f,v)=>{N("setCheckedKeys"),n.value.setCheckedKeys(f,v)},q=(f,v,_=!1)=>{n.value.setChecked(f,v,_)},k=()=>n.value.getHalfCheckedNodes(),m=()=>n.value.getHalfCheckedKeys(),S=(f,v=!0)=>{N("setCurrentNode"),ve(n,t.emit,()=>{u(f),n.value.setUserCurrentNode(f,v)})},O=(f=null,v=!0)=>{N("setCurrentKey"),ve(n,t.emit,()=>{u(),n.value.setCurrentNodeKey(f,v)})},ae=f=>n.value.getNode(f),at=f=>{n.value.remove(f)},dt=(f,v)=>{n.value.append(f,v)},ot=(f,v)=>{n.value.insertBefore(f,v)},rt=(f,v)=>{n.value.insertAfter(f,v)},it=(f,v,_)=>{u(v),t.emit("node-expand",f,v,_)},lt=(f,v)=>{N("updateKeyChildren"),n.value.updateChildren(f,v)};return ne(we,{ctx:t,props:e,store:n,root:d,currentNode:r,instance:c}),ne(Kt,void 0),{ns:a,store:n,root:d,currentNode:r,dragState:p,el$:i,dropIndicator$:o,isEmpty:y,filter:l,getNodeKey:g,getNodePath:C,getCheckedNodes:b,getCheckedKeys:D,getCurrentNode:I,getCurrentKey:L,setCheckedNodes:E,setCheckedKeys:K,setChecked:q,getHalfCheckedNodes:k,getHalfCheckedKeys:m,setCurrentNode:S,setCurrentKey:O,t:s,getNode:ae,remove:at,append:dt,insertBefore:ot,insertAfter:rt,handleNodeExpand:it,updateKeyChildren:lt}}});function Qt(e,t,s,a,n,d){const r=F("el-tree-node");return w(),M("div",{ref:"el$",class:$([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(w(!0),M(He,null,qe(e.root.childNodes,i=>(w(),j(r,{key:e.getNodeKey(i),node:i,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(w(),M("div",{key:0,class:$(e.ns.e("empty-block"))},[Ke(e.$slots,"empty",{},()=>[ke("span",{class:$(e.ns.e("empty-text"))},Ye(e.emptyText??e.t("el.tree.emptyText")),3)])],2)):G("v-if",!0),Ne(ke("div",{ref:"dropIndicator$",class:$(e.ns.e("drop-indicator"))},null,2),[[ge,e.dragState.showDropIndicator]])],2)}var Xt=Re(Zt,[["render",Qt]]);const nt=De(Xt),en=(e,{attrs:t,emit:s},{select:a,tree:n,key:d})=>{const r=H("tree-select");T(()=>e.data,()=>{e.filterable&&B(()=>{var o,u;(u=n.value)==null||u.filter((o=a.value)==null?void 0:o.states.inputValue)})},{flush:"post"});const i=o=>{var p,c;const u=o.at(-1);if(u.expanded&&u.childNodes.at(-1))i([u.childNodes.at(-1)]);else{(c=(p=n.value.el$)==null?void 0:p.querySelector(`[data-key="${o.at(-1).key}"]`))==null||c.focus({preventScroll:!0});return}};return se(()=>{_e(()=>{var o;return(o=a.value)==null?void 0:o.$el},"keydown",async o=>{const u=Ue(o),{dropdownMenuVisible:p}=a.value;[P.down,P.up].includes(u)&&p&&(await B(),setTimeout(()=>{var c,h,y;if(P.up===u){const l=n.value.store.root.childNodes;i(l);return}(y=(h=(c=a.value.optionsArray[a.value.states.hoveringIndex].$el)==null?void 0:c.parentNode)==null?void 0:h.parentNode)==null||y.focus({preventScroll:!0})}
1))},{capture:!0})}),{...he(xe(e),Object.keys(Je.props)),...t,class:A(()=>t.class),style:A(()=>t.style),"onUpdate:modelValue":o=>s(We,o),valueKey:d,popperClass:A(()=>{const o=[r.e("popper")];return e.popperClass&&o.push(e.popperClass),o.join(" ")}),filterMethod:(o="")=>{var u;e.filterMethod?e.filterMethod(o):e.remoteMethod?e.remoteMethod(o):(u=n.value)==null||u.filter(o)}}},tn=z({extends:Ae,setup(e,t){const s=Ae.setup(e,t);delete s.selectOptionClick;const a=Se().proxy;return B(()=>{s.select.states.cachedOptions.get(a.value)||s.select.onOptionCreate(a)}),T(()=>t.attrs.visible,n=>{B(()=>{s.states.visible=n})},{immediate:!0}),s},methods:{selectOptionClick(){this.$el.parentElement.click()}}});function Ee(e){return e||e===0}function Ie(e){return Y(e)&&e.length}function U(e){return Y(e)?e:Ee(e)?[e]:[]}function le(e,t,s,a,n){for(let d=0;d<e.length;d++){const r=e[d];if(t(r,d,e,n))return a?a(r,d,e,n):r;{const i=s(r);if(Ie(i)){const o=le(i,t,s,a,r);if(o)return o}}}}function ce(e,t,s,a){for(let n=0;n<e.length;n++){const d=e[n];t(d,n,e,a);const r=s(d);
1Ie(r)&&ce(r,t,s,d)}}const nn=(e,{attrs:t,slots:s,emit:a},{select:n,tree:d,key:r})=>{T([()=>e.modelValue,d],()=>{e.showCheckbox&&B(()=>{const l=d.value;l&&!Ce(l.getCheckedKeys(),U(e.modelValue))&&l.setCheckedKeys(U(e.modelValue))})},{immediate:!0,deep:!0});const i=A(()=>({value:r.value,label:"label",children:"children",disabled:"disabled",isLeaf:"isLeaf",...e.props})),o=(l,g)=>{var C;const N=i.value[l];return te(N)?N(g,(C=d.value)==null?void 0:C.getNode(o("value",g))):g[N]},u=U(e.modelValue).map(l=>le(e.data||[],g=>o("value",g)===l,g=>o("children",g),(g,N,C,b)=>b&&o("value",b))).filter(l=>Ee(l)),p=A(()=>{if(!e.renderAfterExpand&&!e.lazy)return[];const l=[];return ce(e.data.concat(e.cacheData),g=>{const N=o("value",g);l.push({value:N,currentLabel:o("label",g),isDisabled:o("disabled",g)})},g=>o("children",g)),l}),c=()=>{var l;return(l=d.value)==null?void 0:l.getCheckedKeys().filter(g=>{var C;const N=(C=d.value)==null?void 0:C.getNode(g);return!ue(N)&&St(N.childNodes)})},h=l=>{Ce(e.modelValue,l)||a(xt,l)};function y(l){a(We,l),h(l)}return{...he(xe(e),Object.keys(nt.props)),...t,nodeKey:r,expandOnClickNode:A(()=>!e.checkStrictly&&e.expandOnClickNode),defaultExpandedKeys:A(()=>e.defaultExpandedKeys?e.defaultExpandedKeys.concat(u):u),renderContent:(l,{node:g,data:N,store:C})=>l(tn,{value:o("value",N),label:o("label",N),disabled:o("disabled",N),visible:g.visible},e.renderContent?()=>e.renderContent(l,{node:g,data:N,store:C}):s.default?()=>s.default({node:g,data:N,store:C}):void 0),filterNodeMethod:(l,g,N)=>e.filterNodeMethod?e.filterNodeMethod(l,g,N):l?new RegExp(Dt(l),"i").test(o("label",g)||""):!0,onNodeClick:(l,g,N)=>{var C,b,D;if((C=t.onNodeClick)==null||C.call(t,l,g,N),!(e.showCheckbox&&e.checkOnClickNode))if(!e.showCheckbox&&(e.checkStrictly||g.isLeaf)){if(!o("disabled",l)){const I=(b=n.value)==null?void 0:b.states.options.get(o("value",l));(D=n.value)==null||D.handleOptionSelect(I)}}else e.expandOnClickNode&&N.proxy.handleExpandIconClick()},onCheck:(l,g)=>{var L;if(!e.showCheckbox)return;const N=o("value",l),C={};ce([d.value.store.root],E=>C[E.key]=E,E=>E.childNodes);const b=g.checkedKeys,D=e.multiple?U(e.modelValue).filter(E=>!(E in C)&&!b.includes(E)):[],I=D.concat(b);if(e.checkStrictly)y(e.multiple?I:I.includes(N)?N:void 0);else if(e.multiple){const E=c();y(D.concat(E))}else{const E=le([l],k=>!Ie(o("children",k))&&!o("disabled",k),k=>o("children",k)),K=E?o("value",E):void 0,q=Ee(e.modelValue)&&!!le([l],k=>o("value",k)===e.modelValue,k=>o("children",k));y(K===e.modelValue||q?void 0:K)}B(()=>{var K;const E=U(e.modelValue);d.value.setCheckedKeys(E),(K=t.onCheck)==null||K.call(t,l,{checkedKeys:d.value.getCheckedKeys(),checkedNodes:d.value.getCheckedNodes(),halfCheckedKeys:d.value.getHalfCheckedKeys(),halfCheckedNodes:d.value.getHalfCheckedNodes()})}),(L=n.value)==null||L.focus()},onNodeExpand:(l,g,N)=>{var C;(C=t.onNodeExpand)==null||C.call(t,l,g,N),B(()=>{if(!e.checkStrictly&&e.lazy&&e.multiple&&g.checked){const b={},D=d.value.getCheckedKeys();ce([d.value.store.root],E=>b[E.key]=E,E=>E.childNodes);const I=U(e.modelValue).filter(E=>!(E in b)&&!D.includes(E)),L=c();y(I.concat(L))}})},cacheOptions:p}};var sn=z({props:{data:{type:Array,default:()=>[]}},setup(e){const t=W(wt);return T(()=>e.data,()=>{var a;e.data.forEach(n=>{t.states.cachedOptions.has(n.value)||t.states.cachedOptions.set(n.value,n)});const s=((a=t.selectRef)==null?void 0:a.querySelectorAll("input"))||[];Tt&&!Array.from(s).includes(document.activeElement)&&t.setSelected()},{flush:"post",immediate:!0}),()=>{}}}),an=z({name:"ElTreeSelect",inheritAttrs:!1,props:{...It,...Ze,cacheData:{type:Array,default:()=>[]}},setup(e,t){const{slots:s,expose:a,emit:n,attrs:d}=t,r={...d,onChange:void 0},i=x(),o=x(),u=A(()=>e.nodeKey||e.valueKey||"value"),p=en(e,{attrs:d,emit:n},{select:i,tree:o,key:u}),{cacheOptions:c,...h}=nn(e,{attrs:r,slots:s,emit:n},{select:i,tree:o,key:u}),y=re({});return a(y),se(()=>{Object.assign(y,{...he(o.value,["filter","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentKey","getCurrentNode","setCurrentKey","setCurrentNode","getNode","remove","append","insertBefore","insertAfter"]),...he(i.value,["focus","blur","selectedLabel"]),treeRef:o.value,selectRef:i.value})}),()=>X(Je,re({...p,ref:l=>i.value=l}),{...s,default:()=>[X(sn,{data:c.value}),X(nt,re({...h,ref:l=>o.value=l}))]})}}),dn=an;const st=De(dn),on=z({props:{defaultParentTitle:{type:[String],default:()=>null},placeholder:{type:String,default:"Выберите родительский пункт меню или оставьте это поле пустым чтобы этот материал стал родительским в меню"},modelValue:{type:null,default:()=>null,required:!0},exceptId:{type:[Number],required:!1}},components:{ElTreeSelect:st,ElLink:$e},emits:["update:modelValue"],setup(e,{emit:t}){const s=xe(e),a=x([]),n=x(!1),d=x(""),r=async(u,p)=>{var c,h;if(u.isLeaf)return p([]);try{const{data:y}=await Le.get("admin/content-v2/get-children-list",{params:{parentId:(c=u.data)!=null&&c.value?(h=u.data)==null?void 0:h.value:null,exceptId:s.exceptId.value}});
1p(y.items.map(l=>({label:l.label,value:l.id,isLeaf:l.totalchild===0})))}catch{}},i=A(()=>s.defaultParentTitle.value||d.value),o=async()=>{if(!s.defaultParentTitle.value&&s.modelValue.value)try{const{data:u}=await Le.get(`admin/content-v2/${s.modelValue.value}`,{params:{fields:["id::integer","title"]}});d.value=u.title}catch{Ot({message:"При загрузке материала для дерева материалов произошла ошибка, обновите страницу"})}};return se(async()=>{await o()}),T(s.modelValue,async()=>{await o()}),{...s,cpParentTitle:i,options:a,isViewParentTree:n,load:r,emit:t}}}),rn={key:0,class:"flex h-full flex-row justify-between"},ln={key:1};function cn(e,t,s,a,n,d){const r=$e,i=st;return w(),M("div",null,[!e.isViewParentTree&&e.cpParentTitle?(w(),M("div",rn,[ee(r,{onClick:t[0]||(t[0]=o=>e.isViewParentTree=!0),type:"primary"},{default:Q(()=>[Lt(Ye(e.cpParentTitle),1)]),_:1})])):(w(),M("div",ln,[ee(i,{clearable:"",modelValue:e.modelValue,"onUpdate:modelValue":t[1]||(t[1]=o=>e.emit("update:modelValue",o)),lazy:"",placeholder:e.placeholder,load:e.load,"check-strictly":"","render-after-expand":!1,class:"w-full"},null,8,["modelValue","placeholder","load"])]))])}const yn=At(on,[["render",cn]]);export{nt as E,yn as P,Vt as a};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.