1import{aJ as w,aS as K}from"./DoKAI4N6.js";import{bM as P,bN as b}from"./CYVbO0uZ.js";import{s as S}from"./DRq3dXTG.js";import{s as B}from"./C7TDjahR.js";import{L as O,F as s,R as i,Y as r,X as p,aj as C,Q as a,a3 as y,a5 as f,P as m,a7 as N,U as z,ak as j}from"./CJNkWG1Y.js";var D={root:"p-organizationchart p-component",table:"p-organizationchart-table",node:function(t){var n=t.instance;return["p-organizationchart-node",{"p-organizationchart-node-selectable":n.selectable,"p-organizationchart-node-selected":n.selected}]},nodeToggleButton:function(t){var n=t.instance;return["p-organizationchart-node-toggle-button",{"p-disabled":!n.selectable}]},nodeToggleButtonIcon:"p-organizationchart-node-toggle-button-icon",connectors:"p-organizationchart-connectors",connectorDown:"p-organizationchart-connector-down",connectorLeft:function(t){var n=t.index;return["p-organizationchart-connector-left",{"p-organizationchart-connector-top":n!==0}]},connectorRight:function(t){var n=t.props,l=t.index;return["p-organizationchart-connector-right",{"p-organizationchart-connector-top":l!==n.node.children.length-1}]},nodeChildren:"p-organizationchart-node-children"},M=w.extend({name:"organizationchart",style:P,classes:D}),I={name:"BaseOrganizationChart",extends:K,props:{value:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},collapsible:{type:Boolean,default:!1},collapsedKeys:{type:null,default:null}},style:M,provide:function(){return{$pcOrganizationChart:this,$parentInstance:this}}},T={name:"OrganizationChartNode",hostName:"OrganizationChart",extends:K,emits:["node-click","node-toggle"],props:{node:{type:null,default:null},templates:{type:null,default:null},collapsible:{type:Boolean,default:!1},collapsedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null}},methods:{getPTOptions:function(t){return this.ptm(t,{context:{expanded:this.expanded,selectable:this.selectable,selected:this.selected,toggleable:this.toggleable,active:this.selected}})},getNodeOptions:function(t,n){return this.ptm(n,{context:{lineTop:t}})},onNodeClick:function(t){b(t.target,"data-pc-section","nodetogglebutton")||b(t.target,"data-pc-section","nodetogglebuttonicon")||this.selectionMode&&this.$emit("node-click",this.node)},onChildNodeClick:function(t){this.$emit("node-click",t)},toggleNode:function(){this.$emit("node-toggle",this.node)},onChildNodeToggle:function(t){this.$emit("node-toggle",t)},onKeydown:function(t){(t.code==="Enter"||t.code==="NumpadEnter"||t.code==="Space")&&(this.toggleNode(),t.preventDefault())}},computed:{leaf:function(){return this.node.leaf===!1?!1:!(this.node.children&&this.node.children.length)},colspan:function(){return this.node.children&&this.node.children.length?this.node.children.length*2:null},childStyle:function(){return{visibility:!this.leaf&&this.expanded?"inherit":"hidden"}},expanded:function(){return this.collapsedKeys[this.node.key]===void 0},selectable:function(){return this.selectionMode&&this.node.selectable!==!1},selected:function(){return this.selectable&&this.selectionKeys&&this.selectionKeys[this.node.key]===!0},toggleable:function(){return this.collapsible&&this.node.collapsible!==!1&&!this.leaf}},components:{ChevronDownIcon:S,ChevronUpIcon:B}},E=["colspan"],L=["colspan"],R=["colspan"];function x(e,t,n,l,d,o){var h=O("OrganizationChartNode",!0);return i(),s("table",a({class:e.cx("table")},e.ptm("table")),[r("tbody",C(j(e.ptm("body"))),[n.node?(i(),s("tr",C(a({key:0},e.ptm("row"))),[r("td",a({colspan:o.colspan},e.ptm("cell")),[r("div",a({class:[e.cx("node"),n.node.styleClass],onClick:t[2]||(t[2]=function(){return o.onNodeClick&&o.onNodeClick.apply(o,arguments)})},o.getPTOptions("node")),[(i(),y(f(n.templates[n.node.type]||n.templates.default),{node:n.node},null,8,["node"])),o.toggleable?(i(),s("a",a({key:0,tabindex:"0",class:e.cx("nodeToggleButton"),onClick:t[0]||(t[0]=function(){return o.toggleNode&&o.toggleNode.apply(o,arguments)}),onKeydown:t[1]||(t[1]=function(){return o.onKeydown&&o.onKeydown.apply(o,arguments)})},o.getPTOptions("nodeToggleButton")),[n.templates.toggleicon||n.templates.togglericon?(i(),y(f(n.templates.toggleicon||n.templates.togglericon),a({key:0,expanded:o.expanded,class:e.cx("nodeToggleButtonIcon")},o.getPTOptions("nodeToggleButtonIcon")),null,16,["expanded","class"])):(i(),y(f(o.expanded?"ChevronDownIcon":"ChevronUpIcon"),a({key:1,class:e.cx("nodeToggleButtonIcon")},o.getPTOptions("nodeToggleButtonIcon")),null,16,["class"]))],16)):p("",!0)],16)],16,E)],16)):p("",!0),r("tr",a({style:o.childStyle,class:e.cx("connectors")},e.ptm("connectors")),[r("td",a({colspan:o.colspan},e.ptm("lineCell")),[r("div",a({class:e.cx("connectorDown")},e.ptm("connectorDown")),null,16)],16,L)],16),r("tr",a({style:o.childStyle,class:e.cx("connectors")},e.ptm("connectors")),[n.node.children&&n.node.children.length===1?(i(),s("td",a({key:0,colspan:o.colspan},e.ptm("lineCell")),[r("div",a({class:e.cx("connectorDown")},e.ptm("connectorDown")),null,16)],16,R)):p("",!0),n.node.children&&n.node.children.length>1?(i(!0),s(m,{key:1},N(n.node.children,function(u,g){return i(),s(m,{key:u.key},[r("td",a({class:e.cx("connectorLeft",{index:g})},{ref_for:!0},o.getNodeOptions(g!==0,"connectorLeft")),"Â ",16),r("td",a({class:e.cx("connectorRight",{index:g})},{ref_for:!0},o.getNodeOptions(g!==n.node.children.length-1,"connectorRight")),"Â ",16)],64)}),128)):p("",!0)],16),r("tr",a({style:o.childStyle,class:e.cx("nodeChildren")},e.ptm("nodeChildren")),[(i(!0),s(m,null,N(n.node.children,function(u){return i(),s("td",a({key:u.key,colspan:"2"},{ref_for:!0},e.ptm("nodeCell")),[z(h,{node:u,templates:n.templates,collapsedKeys:n.collapsedKeys,onNodeToggle:o.onChildNodeToggle,collapsible:n.collapsible,selectionMode:n.selectionMode,selectionKeys:n.selectionKeys,onNodeClick:o.onChildNodeClick,pt:e.pt,unstyled:e.unstyled},null,8,["node","templates","collapsedKeys","onNodeToggle","collapsible","selectionMode","selectionKeys","onNodeClick","pt","unstyled"])],16)}),128))],16)],16)],16)}T.render=x;function c(e){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(e)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(d){return Object.getOwnPropertyDescriptor(e,d).enumerable})),n.push.apply(n,l)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
1t%2?v(Object(n),!0).forEach(function(l){U(e,l,n[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(n,l))})}return e}function U(e,t,n){return(t=V(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e){var t=F(e,"string");return c(t)=="symbol"?t:t+""}function F(e,t){if(c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var l=n.call(e,t);if(c(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var A={name:"OrganizationChart",extends:I,inheritAttrs:!1,emits:["node-unselect","node-select","update:selectionKeys","node-expand","node-collapse","update:collapsedKeys"],data:function(){return{d_collapsedKeys:this.collapsedKeys||{}}},watch:{collapsedKeys:function(t){this.d_collapsedKeys=t}},methods:{onNodeClick:function(t){var n=t.key;if(this.selectionMode){var l=this.selectionKeys?k({},this.selectionKeys):{};l[n]?(delete l[n],this.$emit("node-unselect",t)):(this.selectionMode==="single"&&(l={}),l[n]=!0,this.$emit("node-select",t)),this.$emit("update:selectionKeys",l)}},onNodeToggle:function(t){var n=t.key;this.d_collapsedKeys[n]?(delete this.d_collapsedKeys[n],this.$emit("node-expand",t)):(this.d_collapsedKeys[n]=!0,this.$emit("node-collapse",t)),this.d_collapsedKeys=k({},this.d_collapsedKeys),this.$emit("update:collapsedKeys",this.d_collapsedKeys)}},components:{OrganizationChartNode:T}};function J(e,t,n,l,d,o){var h=O("OrganizationChartNode");return i(),s("div",a({class:e.cx("root")},e.ptmi("root")),[z(h,{node:e.value,templates:e.$slots,onNodeToggle:o.onNodeToggle,collapsedKeys:d.d_collapsedKeys,collapsible:e.collapsible,onNodeClick:o.onNodeClick,selectionMode:e.selectionMode,selectionKeys:e.selectionKeys,pt:e.pt,unstyled:e.unstyled},null,8,["node","templates","onNodeToggle","collapsedKeys","collapsible","onNodeClick","selectionMode","selectionKeys","pt","unstyled"])],16)}A.render=J;export{A as default};
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.