import{_ as k,o as s,c as a,t as w,e as m,Y as C,Z as g,$ as j,J as c,r as A,a as l,F as y,i as f,n as o,g as B,w as S,f as u,C as h,j as i}from"./1.10.0_index.js";const x={props:{the_string:String}};function O(e,r,n,p,d,v){return s(),a("div",null,w(n.the_string),1)}const _=k(x,[["render",O]]);function b(e,r){return!!Object.prototype.hasOwnProperty.call(e,r)}function D(){try{let e;if(arguments.length===3?e=m(arguments[0],arguments[1],arguments[2]):arguments.length===2?e=m(arguments[0],arguments[1],{}):arguments.length===1&&(e=arguments[0]),typeof e=="object"&&Object.keys(e).length>=0&&Array.isArray(e)==!1)return e;throw new Error("A dictionary could not be furnished from the preceeding arguments.")}catch{}return console.warn("A dictionary could not be furnished from these arguments",arguments),{}}const N={components:{g_button:C,string_data:_},props:{columns:Array,rows:Array,theme:Object},watch:{theme(){const{styles:e,parsed_theme:r}=this.retrieve_styles();this.styles=e,this.parsed_theme=r},rows(){this.parsed_rows=this.rows}},data(){const{styles:e,parsed_theme:r}=this.retrieve_styles();return{styles:e,parsed_rows:this.rows,parsed_theme:r,column_sorted:[]}},methods:{retrieve_styles(){const e=g({},{palette:{text:"black"}},this.theme);return{parsed_theme:e,styles:{table_row:{borderBottom:"1px solid "+j(e.palette.text).alpha(.3),wordBreak:"break-all",padding:"2px"}}}},has_field:b,furnish_dict:D,parse_table_data(e){try{if(typeof e=="string")return c(_,{the_string:e});if(typeof e=="number")return c(_,{the_string:e.toString()});if(b(e,"component")){const n=g({},e.props);var r=e.component;return c(r,n)}}catch{}return c(_,{the_string:""})},column_clicked(e){console.log("column_clicked");const r=e.place,n=e.sorting,p=this.parsed_rows;let d="forward";this.column_sorted[0]===r&&this.column_sorted[1]==="forward"&&(d="backward"),typeof n=="function"?this.parsed_rows=n({rows:p,place:r,direction:d}):this.parsed_rows=p,this.column_sorted=[r,d]}},mounted(){}},V=N,z={style:{display:"flex",alignItems:"center"}},E={style:{display:"flex",flexDirection:"column",padding:"0 8px"}},F=l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15 11.25-3-3m0 0-3 3m3-3v7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1),I=[F];function R(e,r,n,p,d,v){const $=A("g_button");return s(),a("table",{style:o({borderCollapse:"separate",borderSpacing:"0px",color:e.parsed_theme.palette.text})},[l("thead",{style:o({position:"relative",border:"1px solid "+e.parsed_theme.palette.text,borderRadius:"4px"})},[(s(!0),a(y,null,f(e.columns,t=>(s(),a("th",{style:o(Object.assign({},{position:"relative",borderRadius:"4px",minHeight:"1px"},e.furnish_dict(t,["styles","th"],{})))},[B($,{style:{position:"relative",top:0,left:0,width:"100%",height:"100%",alignItems:"center",cursor:"pointer",border:0,boxSizing:"border-box",background:"none"},pressable:!0,styles:{outside:{},inside:{}},outline_width:"1px",outline_color:e.parsed_theme.palette.text,transition_duration:".3s",clicked:()=>{e.column_clicked(t)}},{default:S(()=>[l("div",z,[l("p",{style:o({textAlign:"center",color:e.parsed_theme.palette.text})},w(t.name),5),l("div",E,[(s(),a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6",style:o({stroke:e.parsed_theme.palette.text,height:"25px",opacity:e.column_sorted[0]===t.place?1:0,transform:e.column_sorted[1]==="backward"?"rotate(180deg)":"rotate(0deg)",transition:"transform .3s, opacity .3s"})},I,4))])])]),_:2},1032,["outline_color","clicked"])],4))),256))],4),l("tbody",null,[(s(!0),a(y,null,f(e.parsed_rows,t=>(s(),a("tr",null,[e.has_field(t,"1")?(s(),a("td",{key:0,style:o(e.styles.table_row)},[e.has_field(t,"1")?(s(),u(h(e.parse_table_data(t[1])),{key:0})):i("",!0)],4)):i("",!0),e.has_field(t,"2")?(s(),a("td",{key:1,style:o(e.styles.table_row)},[e.has_field(t,"2")?(s(),u(h(e.parse_table_data(t[2])),{key:0})):i("",!0)],4)):i("",!0),e.has_field(t,"3")?(s(),a("td",{key:2,style:o(e.styles.table_row)},[e.has_field(t,"3")?(s(),u(h(e.parse_table_data(t[3])),{key:0})):i("",!0)],4)):i("",!0),e.has_field(t,"4")?(s(),a("td",{key:3,style:o(e.styles.table_row)},[e.has_field(t,"4")?(s(),u(h(e.parse_table_data(t[4])),{key:0})):i("",!0)],4)):i("",!0)]))),256))])],4)}const H=k(V,[["render",R]]);export{D as f,H as g};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 19464 characters]
