import{G as p}from"./GraphinaGoogleChartBase.js";class a extends p{setUpChartsHandler(){this.chartHandlers={gantt_google:t=>this.observeChartElement(t,"Gantt")}}observeChartElement(t,e){gcfe_public_localize.view_port==="off"?(this.observer||(this.observer=new IntersectionObserver(s=>{s.forEach(n=>{n.isIntersecting&&(this.setupChart(jQuery(n.target),e),this.observer.unobserve(n.target))})},{threshold:.1})),this.observer.observe(t[0])):this.setupChart(t,e)}getFinalChartOptions(t,e){return t}getFinalChartData(t){return t}setDependField(t,e){const s=window.parent.document.querySelectorAll(".elementor-control-iq_gantt_google_value_list_3_1_repeaters .elementor-repeater-fields"),n=e.dependColumn;s.forEach((d,i)=>{const o=d.querySelector('[data-setting="iq_gantt_google_chart_value_3_element_dependencies"]'),r=d.querySelector('[data-setting="_id"]').value;if(o&&Object.keys(n).length>0){o.innerHTML="",o.append(new Option("Select",""));for(const l in n)if(r!==l){const u=t.iq_gantt_google_value_list_3_1_repeaters[i].iq_gantt_google_chart_value_3_element_dependencies[0]===l;o.append(new Option(n[l],l.toLowerCase(),u,u))}}})}setupTableData(t,e,s,n,d){var i;((i=t==null?void 0:t.extra)==null?void 0:i.length)>0?(e.addColumn("string","Task ID"),e.addColumn("string","Task Name"),e.addColumn("string","Resource"),e.addColumn("date","Start Date"),e.addColumn("date","End Date"),e.addColumn("number","Duration"),e.addColumn("number","Percent Complete"),e.addColumn("string","Dependencies"),t.extra.map(r=>this.prepareGanttRowData(r)).forEach(r=>e.addRow(r))):t.length>0?(e.addColumn("string","Task ID"),e.addColumn("string","Task Name"),e.addColumn("string","Resource"),e.addColumn("date","Start Date"),e.addColumn("date","End Date"),e.addColumn("number","Duration"),e.addColumn("number","Percent Complete"),e.addColumn("string","Dependencies"),t.map(r=>this.prepareGanttRowData(r)).forEach(r=>e.addRow(r))):(s.hide(),n.show())}}window.graphinaGoogleGanttChart=new a;
//# sourceMappingURL=gantt_google.js.map
