The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

!function(){"use strict";angular.module("llngConfDiff",["ui.tree","ui.bootstrap","llApp","ngCookies"],["$rootScopeProvider",function(t){return t.digestTtl(15)}]).controller("DiffCtrl",["$scope","$http","$q","$translator","$location",function(p,a,l,o,i){var e,u,c,s,h,f;return p.links=links,p.menulinks=menulinks,p.staticPrefix=staticPrefix,p.scriptname=scriptname,p.availableLanguages=availableLanguages,p.waiting=!0,p.showM=!1,p.cfg=[],p.data={},p.currentNode=null,p.translateTitle=function(t){return o.translateField(t,"title")},p.translateP=o.translateP,p.translate=o.translate,p.toggle=function(t){return t.toggle()},p.stoggle=function(t,e){return p.currentNode=e,t.toggle()},p.menuClick=function(t){if(t.popup)window.open(t.popup);else switch(t.action||(t.action=t.title),typeof t.action){case"function":t.action(p.currentNode,p);break;case"string":p[t.action]();break;default:console.log(typeof t.action)}return p.showM=!1},p.getLanguage=function(t){return p.lang=t,c(),p.showM=!1},u=function(n,r){var o=l.defer();return null==p.cfg[n]||p.cfg[n]!==r?a.get(""+confPrefix+r).then(function(t){var e;return t&&t.data?(p.cfg[n]=t.data,e=new Date(1e3*t.data.cfgDate),p.cfg[n].date=e.toLocaleString(),console.log(`Metadatas of cfg ${r} loaded`),o.resolve("OK")):o.reject(t)},function(t){return console.log(t),o.reject("NOK")}):o.resolve(),o.promise},c=function(){return p.message=null,p.currentNode=null,l.all([o.init(p.lang),a.get(staticPrefix+"reverseTree.json").then(function(t){return t.data,console.log("Structure loaded")})]).then(function(){return l.defer(),a.get(`${scriptname}diff/${p.cfg[0].cfgNum}/`+p.cfg[1].cfgNum).then(function(t){return t=s(t.data[0],t.data[1]),p.data=e(t),p.message="",p.waiting=!1},function(t){return p.message=p.translate("error")+" : "+t.statusLine})}),p.activeModule="conf",p.myStyle={color:"#ffb84d"}},s=function(t,e,n=!0){var r,o,a,l=[];for(r in t)a=t[r],o=n?{title:p.translate(r),id:r}:{title:r},r.match(/^cfg(?:Num|Log|Author(?:IP)?|Date)$/)||(null==a||"object"!=typeof a||"array"===a.constructor?(o.oldvalue=a,o.newvalue=e[r]):"object"==typeof e[r]?o.nodes=s(t[r],e[r],!1):o.oldnodes=f(a,"old"),l.push(o));for(r in e)a=e[r],r.match(/^cfg(?:Num|Log|Author(?:IP)?|Date)$/)||null!=t[r]||(o=n?{title:p.translate(r),id:r}:{title:r},null==a||"object"!=typeof a||"array"===a.constructor?o.newvalue=a:(console.log("Iteration"),o.newnodes=f(a,"new")),l.push(o));return l},f=function(t,e){var n,r,o,a=[];for(n in t)r={title:n},"object"!=typeof(o=t[n])||"array"===o.constructor?r[e+"value"]=o:r[e+"nodes"]=f(t[n],e),a.push(r);return a},h=[],e=function(t){var e,n,r,o,a,l,i,u,c,s,f,g,d;if(null==h)return t;for(d=[],o=0,l=t.length;o<l;o++){for(e=t[o],f=d,a=0,i=(g=null!=h[e.id]?h[e.id].split("/"):"").length;a<i;a++)if(0<(s=g[a]).length)if(f.length){for(n=-1,r=c=0,u=f.length;c<u;r=++c)f[r].id===s&&(n=r);f=(-1!==n?f[n]:(f.push({id:s,title:p.translate(s),nodes:[]}),f[f.length-1])).nodes}else f.push({id:s,title:p.translate(s),nodes:[]}),f=f[0].nodes;f.push(e)}return d},p.newDiff=function(){return i.path(`/${p.cfg[0].cfgNum}/`+p.cfg[1].cfgNum)},p.$on("$locationChangeSuccess",function(t,e,n){var r=e.match(new RegExp("#!?/(latest|[0-9]+)(?:/(latest|[0-9]+))?$"));return null===r?i.path("/latest"):(p.waiting=!0,l.all([o.init(p.lang),a.get(staticPrefix+"reverseTree.json").then(function(t){return h=t.data,console.log("Structure loaded")}),u(0,r[1]),null!=r[2]?u(1,r[2]):void 0]).then(function(){return null!=r[2]?c():p.cfg[0].prev?(p.cfg[1]=p.cfg[0],u(0,p.cfg[1].prev).then(function(){return c()})):(p.data=[],p.waiting=!1)},function(){return p.message=p.translate("error"),p.waiting=!1})),!0})}])}();