varOS;!function(t){lets;!function(s){s.LibGitGraph=class{constructor(t){this._base_dir=void0,this.lines_data=[],this.commits={},this.oldest_commit_date=void0,this.svg_element=void0,this.commits_list_element=void0,this.load_more_el=void0,this.commit_detail_el=void0,this.current_head=void0,this._on_open_diff=void0,this.options={commits_per_page:100,x_offset:24,y_offset:24,target:void0,popup_height:250};for(constsint)this.options[s]=t[s];this.options.target&&$(this.options.target).addClass("git_grapth_container").css("overflow-y","auto").css("overflow-x","hidden").css("display","block").css("position","relative")}setbase_dir(t){this._base_dir=t,t&&(this.init_graph(),this.render_next())}gen_color(t){lets=t+10;conste=[0,0,0];for(lett=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&s,s>>=1;return"#"+e.reduce((t,s)=>(s>15?s.toString(16):"0"+s.toString(16))+t,"")}meta(){returnt.setting.system.packages.GitGraph}call(t){returnnewPromise(async(e,i)=>{t.args.base_dir=this._base_dir.path;leto={path:this.meta().path+"/api/api.lua",parameters:t},a=awaits.apigateway(o,!1);a.error?i(s.throwe(__("LibGitGrapth server call error: {0}",a.error))):e(a.result)})}load(t){lets={action:"log",args:{n_commits:this.options.commits_per_page.toString(),before:t||null}};returnthis.call(s)}error(s){t.announcer.oserror(__("GitGraph error: {0}",s.toString()),s)}seton_open_diff(t){this._on_open_diff=t}init_graph(){if(!this.options.target)returnthis.error(s.throwe("Target element is undefined"));this.current_y_offset=this.options.y_offset,this.lines_data=[],this.commits={},this.oldest_commit_date=void0,this.svg_element=void0,this.commits_list_element=void0,this.load_more_el=void0,this.commit_detail_el=void0,this.current_head=void0,$(this.options.target).empty(),this.svg_element=this.make_svg_el("svg",{width:this.options.x_offset,height:this.options.y_offset}),$(this.svg_element).css("display","block").css("position","absolute").css("left","0").css("top","0"),this.options.target.appendChild(this.svg_element);constt=$("<div />").css("position","absolute").css("left","0").css("top","0").css("width","100%").css("padding-top",this.options.y_offset/2+"px");this.commits_list_element=t[0],this.options.target.appendChild(this.commits_list_element);conste=$("<p />").css("height",this.options.y_offset+"px").css("display","block").css("padding","0").css("margin","0").css("line-height",this.options.y_offset+"px").css("vertical-align","middle");e.addClass("git_grapth_load_more"),e.on("click",t=>this.render_next()),e.text(__("More").__()),this.load_more_el=e[0],this.commits_list_element.appendChild(this.load_more_el);consti=$("<div />").css("position","absolute").css("top","0").css("height",this.options.popup_height+"px").css("display","none").css("user-select","text").addClass("git_grapth_commit_detail");this.commit_detail_el=i[0],this.options.target.appendChild(this.commit_detail_el)}render_next(){null!=this._base_dir&&this.load(this.oldest_commit_date).then(t=>{this.oldest_commit_date&&t.shift(),this.draw_graph(t)}).catch(t=>this.error(t))}make_svg_el(t,s){conste=document.createElementNS("http://www.w3.org/2000/svg",t);for(variins)e.setAttribute(i,s[i]);returne}max_line_off_x(){return0==this.lines_data.length?0:Math.max.apply(Math,this.lines_data.map(t=>t.x_offset))}update_line_data(t,s){conste=t.hashes.parents.split(" "),i=this.lines_data.filter(s=>s.next_commit==t.hashes.commit);leto={src:[],dest:void0};if(0===i.length){leti={next_commit:e[0],x_offset:this.max_line_off_x()+this.options.x_offset,current_commit:t.hashes.commit,beginning:!0,y_offset:s,color:this.gen_color(this.lines_data.length)};this.lines_data.push(i),o.dest=i}else{leta=Math.min.apply(Math,i.map(t=>t.x_offset)),_=void0;for(letnofi)n.x_offset==a?(_=n,_.next_commit=e[0],_.current_commit=t.hashes.commit,_.y_offset=s):(this.lines_data.splice(this.lines_data.indexOf(n),1),o.src.push(n));o.dest=_}if(2===e.length){leti=void0;i=this.lines_data.filter(t=>t.next_commit==e[1])[0],i?i.y_offset=s+this.options.y_offset:(i={next_commit:e[1],x_offset:this.max_line_off_x()+this.op